Summary
Background:
compare_bytecode.report shows high-frequency mismatches in exception control flow,
especially around COPY/POP_EXCEPT/RERAISE/RETURN_VALUE transitions. This indicates
instability in CPython 3.14-compatible exception-frame sequencing.
Task:
- Align RustPython bytecode emission for exception-sensitive paths (try/except/finally,
with, raise/re-raise).
- Verify sequencing for instruction pairs:
- COPY -> POP_EXCEPT
- POP_EXCEPT -> RERAISE
- RETURN_VALUE / RERAISE / COPY interaction in exception epilogues.
- Compare outputs against CPython at parser/codegen level and adjust stack effect
handling if needed.
Acceptance criteria:
- Top bytecode diff pair counts for exception-related instructions drop significantly.
test_traceback, traceback, inspect, pydoc no longer show broad control-flow
mismatch in repeated patterns.
- No new CPython/RustPython crashes in basic exception-heavy test cases.
Details
Summary
Background:
compare_bytecode.report shows high-frequency mismatches in exception control flow,
especially around COPY/POP_EXCEPT/RERAISE/RETURN_VALUE transitions. This indicates
instability in CPython 3.14-compatible exception-frame sequencing.
Task:
with, raise/re-raise).
handling if needed.
Acceptance criteria:
test_traceback,traceback,inspect,pydocno longer show broad control-flowmismatch in repeated patterns.
Details