Summary
Background:
There are many mismatches involving jumps and stack effects (e.g., LOAD_CONST/
JUMP_BACKWARD, JUMP_BACKWARD/JUMP_FORWARD, POP_TOP/CALL, POP_EXC/CALL patterns),
suggesting CPython/jump normalization drift.
Task:
- Audit RustPython compiler code generation for branch target calculation and jump
lowering.
- Ensure jump target normalization matches CPython offset-to-index expectations in dis
output.
- Verify POP_TOP/JUMP pairing and loop backedge generation around FOR_ITER/while/for
comprehensions.
- Re-run comparisons focused on core modules and remove false positives caused by
different normalization if safe.
Acceptance criteria:
- Diff counts for major jump-related pairs decrease substantially.
- Critical loop-heavy modules (
html/entities.py, inspect.py) show improved
instruction alignment.
Details
Summary
Background:
There are many mismatches involving jumps and stack effects (e.g., LOAD_CONST/
JUMP_BACKWARD, JUMP_BACKWARD/JUMP_FORWARD, POP_TOP/CALL, POP_EXC/CALL patterns),
suggesting CPython/jump normalization drift.
Task:
lowering.
output.
comprehensions.
different normalization if safe.
Acceptance criteria:
html/entities.py,inspect.py) show improvedinstruction alignment.
Details