Conversation
- Add 66 pytest tests covering CoverageReport, _inst_size, _count_instructions, and CoverageCollector - Test all opcodes: MOVI, INC, DEC, ADD, SUB, MUL, CMP_EQ, MOV, PUSH, POP, JZ, JNZ - Test edge cases: empty bytecode, max_cycles, unknown opcodes, negative immediates, unreachable code - Test branch coverage both-ways and path accumulation - Document known discrepancy with unknown opcode sizing - Add .gitignore for Python, IDE, testing, and fleet artifacts
| from flux_coverage import CoverageCollector | ||
|
|
||
| # Analyze coverage of a factorial program | ||
| bytecode = [0x18, 0, 6, 0x18, 1, 1, 0x22, 1, 1, 0, 0x09, 0, 0x3D, 0, -6, 0, 0x00] |
There was a problem hiding this comment.
🟡 README Quick Start bytecode contains -6 which crashes bytes() constructor
The Quick Start example on line 37 uses -6 in the bytecode list: bytecode = [... 0x3D, 0, -6, 0, 0x00]. When this is passed to CoverageCollector.__init__ (coverage.py:68), it calls self.bytecode = bytes(bytecode), which raises ValueError: bytes must be in range(0, 256) because -6 is negative. The working tests use 0xFA for this value (the unsigned byte representation whose signed interpretation via sb() is -6).
| bytecode = [0x18, 0, 6, 0x18, 1, 1, 0x22, 1, 1, 0, 0x09, 0, 0x3D, 0, -6, 0, 0x00] | |
| bytecode = [0x18, 0, 6, 0x18, 1, 1, 0x22, 1, 1, 0, 0x09, 0, 0x3D, 0, 0xFA, 0, 0x00] |
Was this helpful? React with 👍 or 👎 to provide feedback.
Debug
| ## Quick Start | ||
|
|
||
| ```python | ||
| from flux_coverage import CoverageCollector |
There was a problem hiding this comment.
🟡 README Quick Start imports non-existent module flux_coverage
The Quick Start example imports from flux_coverage import CoverageCollector, but the actual module file is coverage.py, not flux_coverage.py. There is no flux_coverage module, package, or installed distribution in the repository. The test suite (tests/test_coverage.py:4) correctly imports from coverage import CoverageCollector. Copying the README example would raise ModuleNotFoundError.
| from flux_coverage import CoverageCollector | |
| from coverage import CoverageCollector |
Was this helpful? React with 👍 or 👎 to provide feedback.
Debug
|
|
||
| # Test with different inputs for differential coverage | ||
| collector2 = CoverageCollector(bytecode) | ||
| _, report2 = collector2.run(initial_regs={0: 1}) # n=1 instead of n=6 |
There was a problem hiding this comment.
🟡 README differential coverage example is ineffective — initial_regs={0: 1} is immediately overwritten
Line 52 shows collector2.run(initial_regs={0: 1}) with the comment # n=1 instead of n=6, implying this runs the factorial with a different input. However, the bytecode starts with MOVI r0, 6 (opcode 0x18, 0, 6 at position 0), which unconditionally sets r0 to 6, overwriting the initial value of 1. The factorial still computes 6!=720, not 1!=1. This undermines the "differential coverage" demonstration — both runs produce identical behavior.
Prompt for agents
The differential coverage example at README.md:50-52 is misleading. The bytecode begins with MOVI r0, 6 which unconditionally sets r0=6, so passing initial_regs={0: 1} has no effect — the program still computes 6!=720.
To fix this, either:
1. Modify the bytecode to not hardcode the input (remove the MOVI r0,6 instruction and start from ADD/MUL), relying on initial_regs to set the input, or
2. Change the example to use a different bytecode that actually depends on initial register values, or
3. At minimum, fix the comment to not claim 'n=1 instead of n=6' since that's incorrect.
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Adds a fleet-contextual README.md that explains this repo's role in the FLUX ecosystem.
What changed
Why
Many repos in the SuperInstance org were forked from Lucineer and had minimal or placeholder READMEs. Fleet-contextual READMEs help agents (and humans) understand how each repo fits into the broader FLUX architecture.
Task T-010 — Generated by Super Z (FLUX Fleet Greenhorn)