You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JIT: compact selected loop SSA into native scratch space #1015
After #1014, the exact frozen representativeJson function builds a valid optimizer plan with 131 bytecodes, 11 CFG blocks, 147 live whole-function SSA nodes, 13 edges, and 3 branches. All loop-region lowerers reject before selection because graph.nodes.len > jit.numeric_scratch_capacity (147 > 128), even though native OSR executes only one selected natural-loop region and imports its live entry values from the VM frame.
Scope
Select the exact natural loop before applying the native scratch-capacity gate.
Compact only values required by that region, its internal/backedge copies, exact side exits, frame states, handlers, and runtime-operation recovery states into stable region-local SSA slots.
Preserve original bytecode origins and CFG block identities for steps, diagnostics, side exits, and observability.
Reject irreducible or external-entry regions before pruning any edge that would expose the defect.
Keep all native scratch/deopt/stack-map indexes within the existing 128-slot ABI; do not enlarge the array to fit unrelated function nodes.
Acceptance
A focused function with more than 128 live pre-loop SSA values but a small natural loop publishes and executes exact OSR.
Entry imports, parallel edge copies, side-exit recovery, handlers, stack maps, invalidation, and moving-GC rewrites use the compact IDs.
oversized two-entry irreducible CFG remains rejected after the compaction fallback is forced.
The implementation keeps the fixed 128-slot ABI, preserves bytecode origins/block identities, remaps exact frame/edge recovery states, and verifies header dominance before pruning. I am leaving the issue open until the full forced-tier integration differential runs with the next measured operation-boundary change.
Completed by e11e1a1 and re-audited on current main at a4d47ae. The exact 147-node function-wide plan compacts to the selected 43-node region without changing the fixed 128-slot ABI. Current real-GC tests pass the loop set 14/14 plus the separate compaction/rejection set 4/4; both sets also pass under unsuppressed TSan. The tests pin frame imports, parallel copies, recovery states, moving safepoints, multi-exit reconstruction, and both original and post-compaction irreducible-region rejection. Frozen representative_json publishes optimizer OSR and preserves checksum 324952086.
Activity
perf(jit): compact loop OSR values (#1015)
glennmichael123 commentedon Sep 30, 2026
Landed and pushed as e11e1a1.
Executed evidence:
representativeJson: 147 whole-function nodes -> 127 outer-region nodes / 43 selected inner-region nodes; the 147/128 rejection is gone and lowering reaches the next independent unsupported-operation boundary;The implementation keeps the fixed 128-slot ABI, preserves bytecode origins/block identities, remaps exact frame/edge recovery states, and verifies header dominance before pruning. I am leaving the issue open until the full forced-tier integration differential runs with the next measured operation-boundary change.
glennmichael123 commentedon Oct 2, 2026
Completed by e11e1a1 and re-audited on current main at a4d47ae. The exact 147-node function-wide plan compacts to the selected 43-node region without changing the fixed 128-slot ABI. Current real-GC tests pass the loop set 14/14 plus the separate compaction/rejection set 4/4; both sets also pass under unsuppressed TSan. The tests pin frame imports, parallel copies, recovery states, moving safepoints, multi-exit reconstruction, and both original and post-compaction irreducible-region rejection. Frozen representative_json publishes optimizer OSR and preserves checksum 324952086.