Skip to content

jit: pcmap audit retirement — GUARDCAP + RESULT harnesses, inject trivia-twin cutover - #626

Merged
youknowone merged 4 commits into
mainfrom
pc-map
Jul 17, 2026
Merged

youknowone merged 4 commits into
mainfrom
pc-map

Conversation

@youknowone

@youknowone youknowone commented Jul 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Rebased onto origin/main (#607 P2-bridge-compile default-ON) and closing out the pcmap audit scaffolding + the certifiable legacy result_color_at_pc_at consumers.

  1. retire PYRE_PCMAP_GUARDCAP_AUDIT — guard-capture depth twin census 10,808/10,808 eq on plain + P2 dynasm legs; production already on the depth twins (−74).
  2. inject_root_call_result trivia-twin fallback — jit: P2 bridge compile leg default-ON + guard-thrash fixes + vstack-mirror classification #607 made residual_ref_call_dst_before (byte-native dst-register decode) the primary; the .or_else marker-miss fallback now reads the result-color trivia twin instead of backxlat_py_pc + result_color_at_pc_at.
  3. retire PYRE_PCMAP_RESULT_AUDIT — every production result-color read on the JitCode-pc twins; the four assert blocks + gate removed (−68).
  4. recipe-parent + reconstruct result colors from the trivia twin — recipe_parent_frame_from_recipe and reconstruct_inline_recipe keyed off the carried JitCode pc via result_color_trivia_for_jitcode_pc, dropping the py inversion.

Certification of commit 4 (the dormant-consumer flip)

Both consumers are corpus-dormant (0 fires even under PYRE_P2_COMPILE), so a runtime fire census cannot certify them. Instead a throwaway whole-metadata verifier compared the trivia twin against the legacy result_color_at_pc[backxlat_py_pc(off)] reader at every block-head resume coordinate of every jitcode the corpus builds: 9,992 coordinates across 426 jitcodes, zero divergence (control confirmed the harness performed all 9,992 comparisons — up to 266 per jitcode — not a silent no-op). The reads are structurally unchanged.

The two inline-caller marker-miss fallbacks (compute_inline_caller_frame / compute_nested_inline_caller_frame) stay: when resume_marker_jit_pc is None there is no JitCode key for the twin, so they remain the residual keyless floor; the py-keyed result_color_at_pc table cannot be fully retired until those (and the build-time twin builder) are addressed.

Verification

  • check.py after each stage: dynasm 217/217, cranelift 217/217, wasm 216/216
  • cargo test -p pyre-jit-trace -p pyre-jit --features dynasm: green
  • whole-metadata twin verifier: 9,992/9,992 eq (0 divergence)

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jul 17, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@youknowone, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 38 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: ceececa0-c3e6-45e9-8ec3-f97c4501af06

📥 Commits

Reviewing files that changed from the base of the PR and between cc4872b and 1c59993.

📒 Files selected for processing (3)
  • pyre/pyre-jit-trace/src/jitcode_dispatch.rs
  • pyre/pyre-jit-trace/src/state.rs
  • pyre/pyre-jit-trace/src/trace.rs

Walkthrough

The JIT dispatch code no longer captures or emits guard-capture audit data, compares guard and table depths, or asserts F3 selector consistency. Mid-body auditing remains unchanged.

Changes

Guard-capture audit removal

Layer / File(s) Summary
Remove guard-capture audit checks
pyre/pyre-jit-trace/src/jitcode_dispatch.rs
Deletes guard-capture audit helpers, depth reconciliation and probe output, plus the audit-only F3 selector assertion.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • youknowone/pyre#455: Adds related guard-capture auditing and logging in the same JIT dispatch module.
  • youknowone/pyre#602: Adjusts the related PC-map guard-capture auditing and selector-consistency logic.

Poem

A bunny saw audit trails fade,
While mid-body checks stayed laid.
No twin-depth rows hop by,
No F3 guards compare the sky—
JIT dispatch rests, unclayed!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: retiring the pcmap audit/guard-capture harnesses and related cutover work.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pc-map

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 17, 2026 •

Copy link
Copy Markdown

🤖 Codex parity review

Static analysis of this diff vs the local RPython/PyPy sources (commit 1c59993).
Updated: 2026-07-17T22:42:47.308Z

Files in the reviewed diff
pyre/pyre-jit-trace/src/jitcode_dispatch.rs
pyre/pyre-jit-trace/src/state.rs
pyre/pyre-jit-trace/src/trace.rs

1. Regressions to PyPy parity introduced by this patch

None.

2. Other mismatches introduced by this patch

None.

3. Pre-existing mismatches (already present before this patch)

None.

4. Structural adaptations

  • pyre/pyre-jit-trace/src/jitcode_dispatch.rs:3076, pyre/pyre-jit-trace/src/jitcode_dispatch.rs:3193, pyre/pyre-jit-trace/src/state.rs:5850, and pyre/pyre-jit-trace/src/trace.rs:935 ↔ rpython/jit/metainterp/pyjitpl.py:180-193: Rust cannot read RPython’s _result_argcode and trailing bytecode destination directly. It uses codewriter-generated, trivia-aware JitCode-PC metadata to locate and clear/inject the pending result register. Static inspection confirms this twin is built from result_color_at_pc[skip_python_trivia_forward(python_pc_for_jitcode_pc(...))], matching the prior backxlat_py_pc lookup and preserving PyPy’s “result box is not defined yet” behavior.

@youknowone youknowone changed the title jit: retire the PYRE_PCMAP_GUARDCAP_AUDIT census harness jit: pcmap audit retirement — GUARDCAP + RESULT harnesses, inject trivia-twin cutover Jul 17, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 63972ffefd

ℹ️ 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".

Comment thread pyre/pyre-jit-trace/src/trace.rs Outdated
Comment on lines +900 to +903
let Some(result_color) = payload
.result_color_trivia_for_jitcode_pc(root_pc)
.map(|c| c as usize)
.filter(|&c| c != u16::MAX as usize)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore the result-color audit gate

When running the result-color census, this commit removes PYRE_PCMAP_RESULT_AUDIT entirely while this site is switching inject_root_call_result to the JitCode-PC trivia reader. The commit text says RESULT remains to certify a live legacy seam, but after this change setting PYRE_PCMAP_RESULT_AUDIT silently does nothing, so divergences between the new JitCode-PC reader and the Python-PC table around this migration will no longer be asserted. Please keep the result-color gate until the intended result audit retirement lands.

Useful? React with 👍 / 👎.

The guard-capture depth twin census reports 10808/10808 eq on both the
plain and PYRE_P2_COMPILE dynasm corpus legs; production already reads
the depth twins. Remove the gate, the probe writer, the depth comparison
block, and the F3 selector assert.

Assisted-by: Claude
Assisted-by: Codex
Replace the backxlat_py_pc + result_color_at_pc_at production read with
the codewriter-baked result-color trivia twin keyed by the carried root
JitCode pc, declining on a missing or u16::MAX entry. The legacy
comparison stays under PYRE_PCMAP_RESULT_AUDIT: twin vs backxlat
consumer asserted equal over 1293 PYRE_P2_COMPILE fires (dynasm
216/216); the audit-on plain leg is green with zero fires.

Assisted-by: Claude
Assisted-by: Codex
Every production result-color read now uses the JitCode-pc-keyed twins;
the four audit assert blocks (bridge-root parent, both inline-caller
variants, inject_root_call_result) and the gate function are the last
consumers of the comparison and are removed. The asserts held over 1293
PYRE_P2_COMPILE inject fires and the full audit-on corpus legs before
removal.

Assisted-by: Claude
Assisted-by: Codex
…ia twin

recipe_parent_frame_from_recipe and reconstruct_inline_recipe read the
result-color slot through backxlat_py_pc + result_color_at_pc_at. Key
both off the carried JitCode pc via result_color_trivia_for_jitcode_pc
instead, dropping the py inversion. A whole-metadata verifier compared
the twin against the legacy reader at every block-head resume coordinate
of every jitcode the corpus builds — 9992 coordinates across 426
jitcodes, zero divergence — so the reads are unchanged. The now
twin-vs-twin recipe_parent_result_color census block is removed; the
shared recipe-resultcolor gate stays for the multi-frame callee site.

Assisted-by: Claude
Assisted-by: Codex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant