Skip to content

jit: instrument carried-coordinate fallback census (#369 closure evidence) - #623

Merged
youknowone merged 1 commit into
mainfrom
rewrite-tracer
Jul 17, 2026
Merged

youknowone merged 1 commit into
mainfrom
rewrite-tracer

Conversation

@youknowone

@youknowone youknowone commented Jul 17, 2026 •

Copy link
Copy Markdown
Collaborator

Report-only fire counters behind the existing PYRE_PCMAP_PIVOT_AUDIT gate + PYRE_PCMAP_PIVOT_AUDIT_PROBE sink, covering the carried-coordinate arms that remained after #602:

  • resolve_resume_pc_with_jitcode_pc / resolve_bridge_walk_entry_pc: carried_used vs carried_none (none split into sentinel vs not-live-anchored), plus per-caller None attribution at all 8 call sites
  • expand_branch_carried: passthrough / expanded_ok / expanded_fail
  • backxlat_py_pc: pivot_hit vs legacy py-word fallback

Audit-off behavior is byte-identical (counters are gated). The corpus census taken with these counters is the closure evidence recorded on #369: carried coordinate accepted 43,968/47,996 (+1,293 bridge) per backend, every fallback/None arm 0 fires, expanded_fail = encode-side self-certification rejection only.

Verification: check.py dynasm 216/216 + cranelift 216/216 audit-off, dynasm 216/216 audit-on; cargo test green (known test_subclass_range_preorder_bounds aggregate flake, standalone pass).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Diagnostics
    • Added more detailed audit events for JIT resume and coordinate resolution outcomes.
    • Improved visibility into successful, fallback, and unavailable resolution paths.
    • Added contextual information for tracing resolution failures across snapshots, guards, bridge walks, and frame liveness checks.
  • Reliability
    • Preserved existing fallback and trace-abort behavior when resolution cannot be completed.

Assisted-by: Claude
Assisted-by: Codex
@coderabbitai

coderabbitai Bot commented Jul 17, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 32a7f236-eadc-4a3b-862b-9f0553636f22

📥 Commits

Reviewing files that changed from the base of the PR and between 4617339 and 724543b.

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

Walkthrough

This change adds pcmap_pivot_audit_record_fire instrumentation across JIT resume-PC decoding, branch-carried expansion, Python-PC translation, bridge lookup, liveness lookup, and framestack construction without changing their existing resolution outcomes.

Changes

Resume-PC audit instrumentation

Layer / File(s) Summary
Resolver outcome auditing
pyre/pyre-jit-trace/src/pyjitcode.rs
Resolution helpers now distinguish carried coordinates that decode successfully from sentinel or non-live-anchored failures.
Dispatch and caller diagnostics
pyre/pyre-jit-trace/src/jitcode_dispatch.rs
Branch-carried expansion and resume-PC caller paths emit labeled events for passthrough, expansion success or failure, and unresolved results.
State and trace consumer diagnostics
pyre/pyre-jit-trace/src/state.rs, pyre/pyre-jit-trace/src/trace_opcode.rs
Translation, bridge, liveness, and framestack paths audit successful, fallback, and unresolved resolution outcomes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: lifthrasiir

Poem

I’m a rabbit tracing hops through JIT,
Marking every pivot bit by bit.
Carried paths glow, fallbacks chime,
None outcomes leave a sign.
Audit carrots neatly fit! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding instrumentation for carried-coordinate fallback paths in JIT code.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rewrite-tracer

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.44.1)
pyre/pyre-jit-trace/src/jitcode_dispatch.rs

ast-grep timed out on this file


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

Copy link
Copy Markdown

🤖 Codex parity review

Static analysis of this diff vs the local RPython/PyPy sources (commit 724543b).
Updated: 2026-07-17T14:36:44.223Z

Files in the reviewed diff
pyre/pyre-jit-trace/src/jitcode_dispatch.rs
pyre/pyre-jit-trace/src/pyjitcode.rs
pyre/pyre-jit-trace/src/state.rs
pyre/pyre-jit-trace/src/trace_opcode.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/pyjitcode.rs:795 ↔ rpython/jit/metainterp/pyjitpl.py:174; pyre/pyre-jit-trace/src/state.rs:802 ↔ rpython/jit/metainterp/blackhole.py:312; pyre/pyre-jit-trace/src/jitcode_dispatch.rs:11580 ↔ rpython/jit/metainterp/pyjitpl.py:2610; pyre/pyre-jit-trace/src/trace_opcode.rs:4079 ↔ rpython/jit/metainterp/opencoder.py:819: the patch adds opt-in Rust filesystem audit calls (pcmap_pivot_audit_record_fire) around existing PC/liveness/resume paths. PyPy has no equivalent diagnostic side channel; the original value flow, None handling, fallback coordinates, and trace-abort behavior are unchanged.

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