Conversation
Bytecode & module layer:
- Python 3.14 magic numbers and bytecode table (bytecode_ops.inl),
bytes/python_3_14.cpp; opcode handling in bytecode.cpp/data.h for
CALL_KW, LOAD_CONST folding, RETURN_CONST, JUMP_BACKWARD loops,
exception-table (zero-cost try) landing pads.
- pyc_module/pyc_object: marshal parsing for 3.14 code objects.
ASTree structural reconstruction:
- Prescan-driven `while True:` recognition for 3.9+ (no SETUP_LOOP):
unconditional-loop heads from JUMP_BACKWARD targets, with
rotated-loop condition-head rejection (mid-body conditional exit +
protected_cycle exception-entry guard) so rotated inner while loops
(quicksort-style) are not misdetected.
- 3.13/3.14 while-try-finally with continue: handler back-edge targets
the condition-evaluation head; finally rendered on both normal and
exception paths; deferred in-loop handler containers (pending_conts)
with nested-try support.
- while-else exit transform via JUMP_BACKWARD; dangling WHILE closed
on RETURN_VALUE at EOF; EOF-guarded dead-jump probes for both
RETURN_VALUE and RETURN_CONST; curpos kept at current-opcode
semantics (fixes 3.10 module-level for RETURN duplication and
3.9 yield_from spurious return None).
- PEP 709 inline-comprehension bookkeeping resets.
Tests (tests/py314_roundtrip):
- Closed-loop roundtrip runner (compile -> pycdc -> ast.parse ->
__test__ probe equivalence) with interpreter autodetection,
21 cases x {3.13, 3.14} including nested loop/exception shapes,
algorithms (quicksort, sieve, RC4), tree/graph (BST/BFS/DFS).
- Validation: roundtrip 42/42, upstream suite 0 FAIL (93 PASS/XFAIL),
semantic probe matrix 8/8.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bytecode & module layer:
ASTree structural reconstruction:
while True:recognition for 3.9+ (no SETUP_LOOP): unconditional-loop heads from JUMP_BACKWARD targets, with rotated-loop condition-head rejection (mid-body conditional exit + protected_cycle exception-entry guard) so rotated inner while loops (quicksort-style) are not misdetected.Tests (tests/py314_roundtrip):