Skip to content

jit-trace, interp: name the unpaired-address disarm; extra_tests: the getsizeof ABI split, an exact module-name oracle, and a slice script that runs - #1660

Merged
youknowone merged 1 commit into
mainfrom
virtualizable
Sep 2, 2026
Merged

Conversation

@youknowone

Copy link
Copy Markdown
Owner

Re-lands the part of #1651 that outlived it. That PR's merge commit 557d6de9db5 is not an ancestor of main; of the last fourteen merged PRs it is the only one whose merge is missing, so the drop was specific to it rather than a history rewrite. Two of its four subjects should not come back, and do not:

What remains is three doc comments and two snippets. git diff main..HEAD -- '*.rs' contains no non-comment line, so nothing here can move a benchmark.

One reading this leaves open

load_name_builtin_cell_fold is not among the eight ceilings #1653 refitted, and the same arithmetic moves it toward its own. Its readings were 0.4x-2.4x against a ceiling of 2.5 and a derived floor of 0.417, with pyre's execution flat at 0.28s-0.37s and pypy's spanning 0.15s-0.54s -- the spread is the denominator's. Under the new subtraction the low reading pairs with the slow pypy and rises to 0.50x-0.60x, clearing the floor, while the high reading pairs with the fast pypy and rises to 2.75x-3.13x, over the ceiling. main's own run at 6aabe92 was cancelled, so no measurement of this exists yet. It is named here rather than refitted, because refitting a gate from a prediction is the error this PR removes.

… getsizeof ABI split, an exact module-name oracle, and a slice script that runs

`disarm_unpaired_build_addrs` was called `reject_unpaired_build_addrs` in
`pyre-interpreter/src/jit_fnaddr.rs` and `pyre-jit-trace/build/prepass.rs`, and
both said it "refuses the load", which the function does not do: it writes zero
over the address and leaves the body published.  Its own doc justified zero as
a value none of the pools' uses can mistake for a real target, a call through
it faulting on the first instruction.  Zero is instead what `jitcode.py
JitCode.__init__ fnaddr=None` spells, and both consumers test for it before
they branch: a call target goes through `is_callable_fnaddr`, so the blackhole
declines it and hands the continuation back to the interpreter while the walker
declines it as `ResidualDecline::Symbolic`, and a type operand is only ever
compared, so a comparison matching no object fails the guard reading it.

`stdlib_sys` charged a two-word `PyGC_Head` to every collector-tracked type.
That header exists only in a build with a global interpreter lock; without one
the collector keeps its bits in the object header, which is what `get_sizeof`
implements and what `Py_GIL_DISABLED` names, so the expectation reads that
config var and each interpreter asserts the layout it was built with.  Behind
that assertion sat a second one, which now fails here and says why:
`sys__getframemodulename_impl` reads `PyFunction_GetModule(f->f_funcobj)`, so a
`__module__` reassigned after definition is what CPython answers, while a frame
here carries the globals it executes in and no link back to the function.
`pypy/interpreter/pyframe.py class PyFrame` carries none either -- its
`createframe(code, w_globals, outer_func)` takes the function to read its
closure alone -- so closing this is a frame-model change rather than a missing
port, and the assertion states CPython's answer rather than accepting both.
The script is not gated, so the failure is recorded where it is read rather
than turning a run red.

`builtin_slice` called `test_all_slices`, which imported a
`cpython_generated_slices` module that has never existed in this tree, so the
script ended in ModuleNotFoundError on every runner.  The function is removed
rather than given the table it wanted: every question it asks is answered more
widely by `test.test_slice`'s `test_indices`, which the CPython suite gate runs
and records as PASS, and which walks `itertools.product` over twelve
start/stop/step values against six lengths -- including `2**100` bounds and the
zero length -- against a reference implementation.  What remains is the slice
construction, repr, comparison, subscript-protocol and `__index__` coverage
that the suite does not carry, and the script now passes under cpython, dynasm
and cranelift for 0.4s, so it carries `gate=1`.

Assisted-by: Claude
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 2 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: c1b7f5f3-0fe2-42c7-b389-49dedc12bd9e

📥 Commits

Reviewing files that changed from the base of the PR and between 55e6fb8 and 81a25af.

📒 Files selected for processing (5)
  • pyre/extra_tests/snippets/builtin_slice.py
  • pyre/extra_tests/snippets/stdlib_sys.py
  • pyre/pyre-interpreter/src/jit_fnaddr.rs
  • pyre/pyre-jit-trace/build/prepass.rs
  • pyre/pyre-jit-trace/src/runtime_fnaddr_patch.rs

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 commented Sep 2, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-02T16:01:12.443605Z 81a25af PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

🤖 Codex parity review

Static analysis of this diff vs the local RPython/PyPy sources (commit 81a25af).
Updated: 2026-09-02T16:07:26.447Z

Files in the reviewed diff
pyre/extra_tests/snippets/builtin_slice.py
pyre/extra_tests/snippets/stdlib_sys.py
pyre/pyre-interpreter/src/jit_fnaddr.rs
pyre/pyre-jit-trace/build/prepass.rs
pyre/pyre-jit-trace/src/runtime_fnaddr_patch.rs

Codex did not produce a report (exit 1). Last log lines:

`lib-python/stdlib-version.txt`), where PyPy and that CPython genuinely differ.
This is usually NOT a 3.11-vs-3.14 delta but a standing PyPy-vs-CPython
divergence; "CPython did not change in 3.14" is not grounds to refile it under
1 or 2. It qualifies only when the finding carries all four of:
(a) an observable difference — return value, exception type/message/attributes,
    identity, encoding-and-errors contract, or accepted argument shapes;
(b) a cited CPython artefact — a `lib-python/3/...:line` assertion, a measured
    run at the pinned version, or C read at that tag in a named checkout. Not
    docs, not a PEP, not a comment in pyre's own source;
(c) the PyPy `file:line` that decides, showing the two upstreams actually
    differ (if PyPy contradicts itself, pyre following PyPy's own declaration
    is section 4 as ordinary parity);
(d) no PyPy-side JIT/GC/annotator hint governing the value being changed —
    `@jit.*`, `_immutable_*`, `_attrs_`, `make_sure_not_resized`,
    `unrolling_iterable`, `rgc.*`, on the function, its helpers, or the class-
    and module-level bindings they read.
Missing any of (a)-(d), or leaving pyre matching NEITHER upstream on an
adjacent observable of the same decision, keep it in section 1 or 2 and say
which test it failed. Full rule: AGENTS.md "Spec follows CPython 3.14;
implementation follows PyPy".

Scope discipline: before writing the report, run
`git diff upstream/main --name-only -- . ':(exclude)*.jitstats'` and treat that
file list as the authoritative definition of "this patch" (when an authoritative
changed-file list is appended below, use that instead of re-deriving it). The
excluded `*.jitstats` files are `pyre/check.py`'s recorded jit-stats baselines —
generated golden data with no RPython/PyPy counterpart, so no parity finding can
cite one, and a bulk re-record of them is not a change to review. Findings under
sections 1 and 2 MUST cite our-side files from that list; a divergence in any
file NOT in the list is by definition not introduced by this patch — report
it under section 3 instead, or omit it. Verify every section-1/2 citation
against the list before finalizing the report.

---

Output format requirements (so the report can be parsed mechanically and
posted/triaged automatically). Use these four headings VERBATIM, in this
order, and nothing else at heading level 2:

## 1. Regressions to PyPy parity introduced by this patch
## 2. Other mismatches introduced by this patch
## 3. Pre-existing mismatches (already present before this patch)
## 4. Structural adaptations

Under each heading, list every finding as a bullet. For each finding cite the
concrete `our_file.rs:line ↔ rpython_or_pypy_file.py:line` pair and quote the
divergence concisely. If a section has no findings, still emit the heading
followed by a single line `None.` so all four sections are always present.
Do not modify any files; produce the report only.

Authoritative changed-file list for this patch (git diff upstream/main --name-only,
minus 0 generated `*.jitstats` baseline file(s)):
pyre/extra_tests/snippets/builtin_slice.py
pyre/extra_tests/snippets/stdlib_sys.py
pyre/pyre-interpreter/src/jit_fnaddr.rs
pyre/pyre-jit-trace/build/prepass.rs
pyre/pyre-jit-trace/src/runtime_fnaddr_patch.rs
warning: Codex could not find bubblewrap on PATH. Install bubblewrap with your OS package manager. See the sandbox prerequisites: https://developers.openai.com/codex/concepts/sandboxing#prerequisites. Codex will use the bundled bubblewrap in the meantime.
ERROR: You've hit your usage limit. Visit https://chatgpt.com/codex/settings/usage to purchase more credits or try again at Sep 7th, 2026 2:28 AM.
ERROR: You've hit your usage limit. Visit https://chatgpt.com/codex/settings/usage to purchase more credits or try again at Sep 7th, 2026 2:28 AM.

@codspeed-hq

codspeed-hq Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 10 untouched benchmarks
⏩ 6 skipped benchmarks1


Comparing virtualizable (81a25af) with main (55e6fb8)

Open in CodSpeed

Footnotes

  1. 6 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@youknowone
youknowone merged commit 8221c2a into main Sep 2, 2026
19 of 21 checks passed
@youknowone
youknowone deleted the virtualizable branch September 2, 2026 22:34
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