Skip to content

Add a bridge-recursion overflow parity fixture - #728

Merged
youknowone merged 1 commit into
mainfrom
fib_recursive
Jul 22, 2026
Merged

youknowone merged 1 commit into
mainfrom
fib_recursive

Conversation

@youknowone

Copy link
Copy Markdown
Collaborator

Summary

Adds a synthetic parity fixture for the depth-1 bridge self-recursive inline
lift (PYRE_FBW_BRIDGE_REC_INLINE, default on) landed in #704.

#704's A/B was validated on fib, which never overflows the machine int, so it
never exercised an overflow guard inside the bridge-inlined recursive frame.
This fixture closes that gap: a tail-recursive exact-integer callee whose
acc * 2 + 1 crosses the machine-int boundary partway down the recursion, so a
GuardNoOverflow resumes inside the frame the lift inlines on a guard-failure
bridge. The synthetic parity suite runs it byte-exact against CPython/PyPy on
each backend, so a silent overflow-guard resume miscompile on that shape fails
the check.

No # pyre-check: max-pypy-ratio= gate: with the lift on, this exact shape
admits an abort that folds back to residual (loops_aborted 0→6 vs the residual
path's single clean bridge), so it is perf-neutral-to-negative — a correctness
fixture, not a timing gate.

Verification

  • check.py --backend dynasm --synthetic-pattern bridge_recursion_overflow.py:
    PASS.
  • check.py --backend cranelift ...: PASS.
  • CPython == PyPy == backend output (byte-exact); dynasm 286-suite unaffected.
  • Non-vacuous + lift-sensitive: loops_aborted=6 with the lift on vs 1 with
    PYRE_FBW_BRIDGE_REC_INLINE=0 — the fixture exercises exactly the shape the
    lift admits.

🤖 Generated with Claude Code

`pyre/bench/synth/bridge_recursion_overflow.py`: a tail-recursive exact-integer
callee whose `acc * 2 + 1` overflows the machine int inside the frame the
depth-1 bridge self-recursive inline lift (`PYRE_FBW_BRIDGE_REC_INLINE`, default
on) inlines on a guard-failure bridge, so an overflow guard resumes inside that
frame. The synthetic parity suite runs it byte-exact against CPython/PyPy on
each backend. No `max-pypy-ratio` gate: with the lift on, this shape admits an
abort that folds back to residual, so it is a correctness fixture, not a timing
gate.

Assisted-by: Claude
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 41 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: 66c79e8e-d1c5-455f-8521-dd02d20f03bf

📥 Commits

Reviewing files that changed from the base of the PR and between 067bf69 and ee43c41.

📒 Files selected for processing (1)
  • pyre/bench/synth/bridge_recursion_overflow.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fib_recursive

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 ee43c41).
Updated: 2026-07-22T16:47:17.029Z

Files in the reviewed diff
pyre/bench/synth/bridge_recursion_overflow.py

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

None.

@youknowone
youknowone merged commit 72976e1 into main Jul 22, 2026
30 of 31 checks passed
@youknowone
youknowone deleted the fib_recursive branch July 22, 2026 16:57
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