Skip to content

jit: #368 key the close-loop restart pc off the block-head twin; source inject_root_call_result colors from the trivia twin - #612

Merged
youknowone merged 2 commits into
rewrite-tracerfrom
pc-map
Jul 17, 2026
Merged

youknowone merged 2 commits into
rewrite-tracerfrom
pc-map

Conversation

@youknowone

Copy link
Copy Markdown
Collaborator

Stacked on #602 (base: rewrite-tracer). Two follow-up cutovers on the pc_map-removal frontier.

Restart-pc twin keying — #602's S6 deduplicated the WALK_END restart derivation into a single point but kept the full python_pc_for_jitcode_pc inversion. Resolve the loop-header marker with the new block_head_py_for_jitcode_pc exact-match reader instead: a resume marker is always a block-head offset (the marker twins store dense pc_map offsets and derive_resume_marker returns block-head table entries), so the inversion's exact tier is the whole resolution — a corpus census at the seam measured 430/430 exact-tier reads equal to the full inversion. A marker the table does not carry (skeleton / fixture) now restarts at the header itself, where the retired predecessor fallback could fabricate a coordinate.

inject_root_call_result cutover — the seam #589 deferred as not byte-certifiable by the default corpus. Certified here with the opt-in path exercised: a corpus census (plain + PYRE_P2_COMPILE=1) measured 2586/2586 twin reads equal to the backxlat derivation, and the audit-enforced runs below keep the assertions live at the seam. The primary read is result_color_trivia_for_jitcode_pc with the u16::MAX sentinel filter; a twin miss declines the compile; the backxlat comparison is retained under PYRE_PCMAP_RESULT_AUDIT, mirroring compute_bridge_root_parent_frame.

Verification (fresh LLBC per cycle):

  • PYRE_PCMAP_RESULT_AUDIT=1 dynasm 208/208
  • PYRE_PCMAP_RESULT_AUDIT=1 PYRE_P2_COMPILE=1 dynasm 208/208
  • plain dynasm 208/208 + cranelift 208/208
  • cargo test -p pyre-jit-trace -p pyre-jit --features dynasm green

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e3d58bdd-6f15-4b0a-8edc-fdb046d21625

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ 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.

@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: 626189e131

ℹ️ 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 on lines +13113 to +13115
Some(marker) => unsafe { &(*caller_sym.jitcode).payload }
.result_color_for_jitcode_pc_pred(marker)
.filter(|&color| color != u16::MAX)

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 Use the trivia-aware result color for call fallthroughs

When an inlined CALL's fallthrough skips bytecode trivia such as Cache/Resume/NotTaken, this marker can resolve to the block-head coordinate while the actual resume PC is the trivia-skipped semantic_fallthrough_pc; using the raw predecessor twin here can pick the result color for the unskipped marker PC. The depth path above already uses depth_trivia_for_jitcode_pc for this marker, so the result slot can be nulled/restored at the wrong color and the paused caller snapshot will carry the wrong call result in those cases.

Useful? React with 👍 / 👎.

@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: d9855e02fd

ℹ️ 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 on lines +1808 to +1810
if let Some(targets) = ca_targets.as_ref() {
for (_, target) in targets {
mark_call_assembler_target_active(target, token);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Mark the published self target, not the pending placeholder

When compiling a self-recursive CALL_ASSEMBLER loop through the new pending-self path, the entries in ca_targets still have compiled_ptr: 0 from the placeholder target. After publishing the real target above, this loop still passes that stale placeholder to mark_call_assembler_target_active, which no-ops because it cannot find a CompiledWasmLoop. In that self-recursive case the callee never records ca_active/ca_callers, so later wasm bridges are not protected by the CA-active trampoline decline and terminal-decline invalidation cannot reach existing callers.

Useful? React with 👍 / 👎.

@youknowone
youknowone changed the base branch from rewrite-tracer to main July 17, 2026 03:00
@youknowone
youknowone changed the base branch from main to rewrite-tracer July 17, 2026 03:28
The deduplicated WALK_END restart derivation still inverted the
loop-header marker with python_pc_for_jitcode_pc. Resolve the marker with
the new block_head_py_for_jitcode_pc exact-match reader instead of the
full inversion.

A resume marker is always a block-head offset (the marker twins store
dense pc_map offsets and derive_resume_marker returns block-head table
entries), so the inversion's exact tier is the whole resolution; a corpus
census at the seam measured 430/430 queries with the exact-tier read equal
to the full inversion, zero misses. A marker the table does not carry
(skeleton / fixture) now restarts at the header itself, where the retired
predecessor fallback could fabricate a coordinate.

Assisted-by: Claude
Replace the eager backxlat_py_pc + result_color_at_pc_at derivation with
the trivia-aware jitcode-keyed twin read, filtering the u16::MAX sentinel;
a twin miss declines the compile. Keep the backxlat comparison only under
PYRE_PCMAP_RESULT_AUDIT, mirroring compute_bridge_root_parent_frame's
audit block.

The sole caller sits behind the opt-in PYRE_P2_COMPILE path; a corpus
census at this seam (plain + PYRE_P2_COMPILE=1) measured 2586/2586 queries
with the twin read equal to the backxlat derivation.

Assisted-by: Claude
@youknowone
youknowone merged commit b578952 into rewrite-tracer Jul 17, 2026
13 checks passed
@youknowone
youknowone deleted the pc-map branch July 17, 2026 06:18
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