Skip to content

Critical: Two incompatible ISA numbering systems #7

Description

@SuperInstance

Audit Finding

Severity: Critical
File(s): opcodes.py, isa_unified.py, test_conformance.py

Problem

The repository contains two completely different opcode numbering schemes that are mutually incompatible:

Aspect opcodes.py (VM executes) isa_unified.py (spec)
HALT 0x80 0x00
NOP 0x00 0x01
ADD 0x10 0x20
... completely different offsets completely different offsets

This means test_conformance.py generates bytecodes using the ISA spec numbers, but the VM interprets them using the opcodes.py numbers. The conformance test can never pass regardless of implementation correctness.

Impact

  • Conformance testing is fundamentally broken — false failures or false passes
  • Any external tooling that uses isa_unified.py to emit bytecodes will produce garbage when run on the VM
  • Blocks all integration across the FLUX ecosystem

Suggested Fix

  1. Preferred: Align isa_unified.py opcode values with opcodes.py (the VM is the source of truth for what executes)
  2. Alternative: Create a formal mapping/translation layer between the two namespaces, documented in isa_unified.py
  3. Update test_conformance.py to use whichever numbering is canonical

Related

  • Part of the broader ISA spec vs. VM implementation divergence tracked in flux-spec repo

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions