Repository navigation
jit: fix two backend-independent jitstats floor reds (catch-landing exc_value, str_len_descr parent) - #995
jit: fix two backend-independent jitstats floor reds (catch-landing exc_value, str_len_descr parent)#995youknowone wants to merge 2 commits into
Conversation
…sh Ref The catch-landing exception-value push allocated a fresh Ref Variable with no defining op. Regalloc treats a producerless Ref as dead-until-first-use and coalesces it onto a body colour (a local live across the `try`). On a guard-failure bridge that re-walks the handler, that body colour's def sits in the skipped prefix, so the pushed value is read unbound (RegisterReadUnbound), aborting the walk. Reuse the landing's own last_exception value Variable (the edge pair set by exception_landing_state, whose colour generate_last_exc writes) as the pushed value. It is re-derived on any bridge and interferes with the surrounding live ranges, so it earns a distinct colour. Same fix as the PUSH_EXC_INFO last_exc_value re-read. Restores list_length_hint_validate to its recorded jit-stats baseline (loops_aborted 34->14, guard_failures 4923->828); raise_reg_unbound_jitstress unchanged. dynasm synthetic gate: 352 passed, only exception_args_virtual red. Assisted-by: Claude
str_len_descr minted the len(str) FieldDescr parentless via make_immutable_field_descr. When a trace constant-folds len(const_str), protect_speculative_field fails closed on the missing parent (get_parent_descr() == None) and signals InvalidLoop; the bridge is discarded and compile_loop gives up with ABORT_BAD_LOOP (loops_aborted and guard_failures rise). Add W_UNICODE_DESCR_GROUP (vtable &STR_TYPE, type_id W_UNICODE_GC_TYPE_ID, single positional usize `len` field), mirroring the W_Int/W_Bool/W_Long groups, and route str_len_descr through it so the FieldDescr carries a parent SizeDescr whose subclassrange validates the folded constant. Register the group in publish_runtime_descr_groups. exception_args_virtual loops_aborted 3->0 on dynasm, cranelift and wasm; full synth gate 353/353 on dynasm and cranelift, no collateral. Assisted-by: Claude
|
Warning Review limit reached
Next review available in: 20 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
https://github.com/youknowone/pyre/blob/71bbde0fd344dd29fbe721ea5bcca959d308cf0c/pyre-jit-trace/src/descr.rs#L861-L864
Publish the complete Unicode field layout
This registers a one-field SizeDescr as the authoritative parent for W_UnicodeObject, even though the translated object also has value, byte_len, w_slots, index_storage, and hash. Because publish_runtime_descr_groups runs before build-time descriptor rehydration and the nonzero vtable prevents the fuller descriptor from replacing it, those later field descriptors inherit a parent whose all_fielddescrs cannot represent their indices; optimizer paths such as virtual materialization/force_box then enumerate only len and can omit the remaining field stores and GC edges. Build the group from the complete object layout (using extra GC edges where appropriate) rather than relying on the current residual-allocation shortcut.
AGENTS.md reference: AGENTS.md:L194-L196
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
🤖 Codex parity reviewStatic analysis of this diff vs the local RPython/PyPy sources (commit 71bbde0). Files in the reviewed diff1. Regressions to PyPy parity introduced by this patchNone. 2. Other mismatches introduced by this patch
3. Pre-existing mismatches (already present before this patch)None. 4. Structural adaptations
|
|
Superseded — both fixes already landed on
— commented by Claude |
Closes the two remaining backend-independent jit-stats floor reds on
main, both by fixing JIT code to conform to the committed baselines — no baseline re-recording.Commit 1 —
list_length_hint_validate(catch-landing producerless exc_value)The catch-landing branch in
jit/codewriter.rspushed the caught exception value with a producerlessfresh_ref_value. Regalloc coalesced it onto a body colour (the local listr); on a guard-failure bridge that re-walks the handler, that colour's def sits in the skipped prefix, so the push reads unbound (RegisterReadUnbound{pc:456, reg:3}×20) and the walk aborts.Fix: reuse the landing's own
last_exceptionvalue Variable (which has agenerate_last_excproducer and is re-derived on any bridge), mirroring the existingPUSH_EXC_INFOtwin.Measured:
list_length_hint_validateloops_aborted 34→14, guard_failures 4923→828 — exact match to baseline.Commit 2 —
exception_args_virtual(parentless const-str getfield)str_len_descr()minted thelen(str)FieldDescr parentless viamake_immutable_field_descr. When a trace constant-foldslen(const_str),protect_speculative_fieldfails closed on the missing parent (get_parent_descr() == None), signalsInvalidLoop, the bridge is discarded andcompile_loopgives up withABORT_BAD_LOOP.Fix: add
W_UNICODE_DESCR_GROUP(vtable&STR_TYPE, type_idW_UNICODE_GC_TYPE_ID, single positionalusizelenfield), mirroring theW_Int/W_Bool/W_Longsingle-field groups, and routestr_len_descrthroughfield_descr_from_groupso the FieldDescr carries a parent SizeDescr whose subclassrange validates the folded constant. This restores PyPy'sget_field_descrinvariant (descr.py:218-239,parent_descrset unconditionally). NoBhDescr/serde change, no LLBC re-extraction.Measured:
exception_args_virtualloops_aborted 3→0 on dynasm, cranelift and wasm.Verification
pickle_terminal_raise_resumeis provably inert to commit 2 (main and branch both read 59 on macOS; the committed wasm baseline54is the Linux-CI value, so the local +5 is a platform read, not a regression).usizelength are intentional Rust-layout adaptations.— commented by Claude