regex: Lifetime cell reuse and ContinueRunningNormally through the portal #409
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 420 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.362
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #409"
general
weight: 0.35
youknowone
Follow-up to #405: more per-event host overhead removed on the
majit/examples/regexcallgrind slope. The RPython build of the same benchmark runs at 12,452 Ir/char.| point | Ir/char |
|---|---:|
| tip of #405 | 15,557 |
| regalloc Lifetime cells reused | 15,361 |
| CRN reaches the portal (this PR's tip) | 15,245 |
Commits
LifetimeManageroverwrites the cells of earlier compilations in place (Rc::get_mut) and charges the translatedregalloc.py Lifetimesize to the host clock, so the JIT counter decay matches a fresh allocation.resume_in_blackholenow hands the originalJitExceptionto the portal (blackhole.py _run_forever→warmspot.py ll_portal_runner/handle_jitexception) instead of turning it into aPortalResume.- The generated
can_enter_jitconsumer matchesPortalControl.apply_portal_crnrestores the reds, the greens are read by reference, and the args box goes back ontomerge_point_args_scratch(blackhole.py recycle_merge_point_args).- This removes the PortalResume swap, the outcome match and three callback checks from every guard failure.
Stats
MAJIT_STATS=1 PYRE_REGEX_ROWS=2 PYRE_REGEX_LENGTHS=1048576, shortcircuit: bridges go from 8155 to 8157; host clock ticks are 775 in both.bhimpl_jit_merge_pointafter a CRN. They happen on the old path only: it swapped the args into the PortalResume scratch and returned an empty box to the pool.ContinueRunningNormallysize and the host regrow, and the extra bytes moved the decay earlier. The new path charges only the translated size.Verification
cargo test --release --features dynasmpasses formajit-macros,majit-metainterp,regex,tl,tlc,tla,tlr,tiny2,tiny3,tinyframe,braininterp,spcount,dualtape,i64envandcel.regexalso passes underMAJIT_STRICT=1and underPYPY_GC_NURSERY=65536.build-jit-core.sh --checkall pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01N1Sftb4SjjFgFkCvtBLvpi
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug Fixes
Improved handling of JIT back-edge outcomes, including exceptions, resumes, and state restoration.
Ensured pending finish operations are processed before returning through a back edge, including when portal entry returns a pointer.
Performance
* Reduced repeated lifetime-management work during compilation by reusing scratch storage.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->