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
The deopt state map now distinguishes reconstructible scalars from heap refs,
so precise deopt restores reassigned SCALAR params without corrupting
heap/flat-pointer params.
- vm-jit `decode_deopt_live`: reconstruct only `Int`/`Float` regs; skip
`Handle`/`FlatInt`/`FlatFloat` (heap table index / borrow-pinned buffer
pointer). The interpreter frame already holds those heap VmValues -- precise
resume implies no heap writes -- so they must not be decoded as raw scalars.
Exhaustive match (a new JitValueType must choose a side).
- reg-vm `restore_native_deopt_live_regs`: drop the `< n_params` guard (and the
now-unused `n_params` arg, updating 3 call sites). Every reg in `live` is now
a true scalar, so a reassigned scalar param is safe to restore.
- Un-#[ignore] `precise_deopt_restores_reassigned_scalar_param` (B2 repro); it
now passes. Update the vm-jit `force_bail_at_every_safepoint_captures_correct_state`
test to the scalar-only-capture contract (heap/flat regs intentionally absent).
Root cause of the earlier failed attempt: it skipped only `Handle`, leaving
`FlatInt`/`FlatFloat` to decode as garbage scalars and corrupt flat-buffer
params. `JitValueType` already carries the flat distinction, so the fix is to
skip all three non-scalar kinds.
Verification (dev container): deopt-stress 9/0, differential 33/0 (incl.
native_heap_reads / native_float_heap_reads / tv2_direct_flat_reads),
jit_acceptance 83/0, rsscript lib 276/0, vm-jit 81/0, default workspace build OK.
Remaining for full J0.1: inlined logical-frame-chain state-map format,
heap-payload-variant / live-out value reconstruction, precise-resume-default-on.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/planning/vm-optimizing-jit-plan.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,7 @@ numeric-mode language decision). Owner: TBD. Created 2026-06-20; status updated
37
37
| Item | State | Notes |
38
38
|---|---|---|
39
39
|**J0.0–J0.3** precise-deopt spine |**shipped (leaf/scalar subset)**|`NativeOutcome::Deopt` + per-site safepoint ids + live-reg capture + state-map + precise resume + every-safepoint stress test. **Precise resume is default-OFF** (gated by `RSS_JIT_PRECISE_DEOPT` / a test entrypoint); production still re-runs from the function top (byte-identical for the side-effect-free subset). The state-map is `resume_ip + live registers` — **not** yet the full inlined logical-frame-chain format J0.1 describes. So: done for the current leaf/scalar subset; full inlined-frame / side-effecting deopt is still **future**. |
40
+
|**J0.1 (heap-aware reg reconstruction)**|**shipped (slice)**| The deopt state map now distinguishes reconstructible scalars (`Int`/`Float`) from heap refs (`Handle`/`FlatInt`/`FlatFloat`): `decode_deopt_live` reconstructs only scalar regs (the interpreter frame already holds heap values — precise resume implies no heap writes), and `restore_native_deopt_live_regs` restores ALL scalar regs incl. **reassigned scalar params** (the `< n_params` skip is gone). Fixes the reassigned-scalar-param resume bug (`precise_deopt_restores_reassigned_scalar_param`); flat-buffer params stay uncorrupted. **Remaining for full J0.1:** inlined logical-frame-chain state-map format, heap-payload-variant / live-out *value* reconstruction (native-built heap values across a bail), and enabling precise resume by default. |
40
41
|**J0.4** heap writes + deopt-after-write |**future**| blocked on native heap-write codegen; the native subset is read-only today. |
41
42
|**J0.5** in-generated-code `VmLimits` accounting |**future**| currently the Model-A fallback (see J6); the `VmLimitsSnapshot` tick/poll machinery is not built. |
42
43
|**J1** profiling |**shipped**| per-call-site type feedback on dynamic sites, warm-gated, no interpreter regression. (Branch profiling **not** shipped — it regressed `bool_logic_loop`~7%; needs a hot/cold dispatch split.) |
0 commit comments