Skip to content

bench: restore the forty baselines #945 recorded from a macOS-only run - #1031

Closed
youknowone wants to merge 1 commit into
mainfrom
fib_recursive
Closed

bench: restore the forty baselines #945 recorded from a macOS-only run#1031
youknowone wants to merge 1 commit into
mainfrom
fib_recursive

Conversation

@youknowone

@youknowone youknowone commented Aug 4, 2026

Copy link
Copy Markdown
Owner

loops_compiled for these benches is not one number, and #945 recorded the
macOS one.

What the counter actually measures

The script's own directory is sys.path[0], so the first import fills
FileFinder._fill_cache. That function's listing loop is platform-conditional
(lib-python/3/importlib/_bootstrap_external.py:1419-1437):

platform Python-level loops in _fill_cache extra compiled loops
linux set(contents) — C level +0
darwin + {fn.lower() for fn in contents} (_CASE_INSENSITIVE_PLATFORMS) +1
win32 + for item in contents: … .add(…) as well +2

pyre/bench/synth holds 1435 entries, over the hot threshold, so those loops
compile. Byte-identical source, one dynasm binary:

same file in a dir of    1 entry   -> loops_compiled=7  guard_failures=2211
same file in a dir of  501 entries -> 7 / 2211
same file in a dir of 1001 entries -> 8 / 2213
pyre/bench/synth/arith_int_bool.py -> 8 / 2213

MAJIT_LOG=1 names the eighth loop [bcenc-audit] "_fill_cache". Compiling it
under PYPY_GC_NURSERY=2G changes nothing, so it is not a collection artifact.
Splitting arith_int_bool.py into its seven functions and summing gives exactly
7 / 10 / 2211 — the linux value — i.e. the bench itself contributes seven loops
on every platform and the eighth is the import machinery.

Not a regression

loops_aborted 0 -> 0, internal_compile_panics 0 -> 0, bridges_compiled
10 -> 10. What moves is loops_compiled up and the new loop's two guard
failures, which stay under trace_eagerness so no bridge attaches. Compiling
the loop is 1c41d1a56c4 jit: admit SET_ADD and MAP_ADD in the FOR_ITER body scan working as intended, measured on that commit and its parent — one
worktree, one CARGO_TARGET_DIR, the same probe file, and the two revisions
differ by that one file's fifteen lines:

arm loops_compiled / bridges / aborted / guards
ce42b0d5dc2 (1c41d1a56c4^, SetAdd absent from eval.rs) 7 / 10 / 0 / 2211, 3/3
1c41d1a56c4 (SetAdd admitted) 8 / 10 / 0 / 2213, 3/3

The mechanism: _fill_cache carries SET_ADD in its own code
object (the comprehension is inlined, no nested code object), and SetAdd does
not appear anywhere in pyre/pyre-jit/src/eval.rs before that commit, so the
frame was rejected whole by unsupported_jit_shape — a gate rejection, which
counts no abort, matching loops_aborted=0 on both sides.

What this PR does

Restores the forty rows (twenty benches, dynasm and cranelift) to the values
main measured identically on all three runners. #945 recorded the macOS
observation for them, so they went red on the other two: the ubuntu job moved
from 38 to 46 changed rows and windows from 25 to 44, while macOS moved from 24
to 2.

The macOS and windows counts stay unrecorded, because no single value is green
on all three — the same conclusion ae895c30c6c reached for
imp_lock_rlock_semantics, which is one of these forty.

Follow-up, not in this PR

Making all three agree means keeping _fill_cache out of the measurement — the
direct lever is splitting pyre/bench/synth/ into directories under the hot
threshold, after which every platform runs no Python-level loop there. It also
removes the standing fragility that adding or deleting bench files can move
every baseline at once.

🤖 Generated with Claude Code

`loops_compiled` for these benches is not one number. The script's own
directory is `sys.path[0]`, so the first import fills
`FileFinder._fill_cache`, whose listing loop is platform-conditional
(`lib-python/3/importlib/_bootstrap_external.py:1419-1437`): linux takes
`set(contents)` and runs no Python-level loop, darwin adds the
`{fn.lower() for fn in contents}` comprehension, and win32 adds the
`for item in contents` suffix-lowering loop on top of it. With 1431
files in `pyre/bench/synth` those loops pass the hot threshold and are
compiled, so one unchanged bench reports 7 loops on linux, 8 on macOS
and 9 on windows; the same file in a directory of 501 entries reports 7
everywhere. Compiling them is the JIT working, not a defect — but it
means the counter carries the runner's platform.

#945 recorded the macOS observation for forty rows that main measured
identically on all three runners, so they went red on the other two: the
ubuntu job moved from 38 to 46 changed rows and windows from 25 to 44,
while macOS moved from 24 to 2. Restore the values main was green with
on every runner.

The macOS and windows counts stay unrecorded because no single value is
green on all three — the same conclusion ae895c30c6c reached for
`imp_lock_rlock_semantics`, which is one of these forty.

Assisted-by: Claude
@coderabbitai

coderabbitai Bot commented Aug 4, 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: 35 minutes

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

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 Plus

Run ID: 60adeaa7-527e-42ad-aa99-f36eff112587

📥 Commits

Reviewing files that changed from the base of the PR and between 83abf4d and 5d50037.

📒 Files selected for processing (40)
  • pyre/bench/synth/arith_int_bool.cranelift.jitstats
  • pyre/bench/synth/arith_int_bool.dynasm.jitstats
  • pyre/bench/synth/ast_compile_roundtrip.cranelift.jitstats
  • pyre/bench/synth/ast_compile_roundtrip.dynasm.jitstats
  • pyre/bench/synth/gc_deque_backing_list.cranelift.jitstats
  • pyre/bench/synth/gc_deque_backing_list.dynasm.jitstats
  • pyre/bench/synth/imp_lock_rlock_semantics.cranelift.jitstats
  • pyre/bench/synth/imp_lock_rlock_semantics.dynasm.jitstats
  • pyre/bench/synth/import_from_name_path.cranelift.jitstats
  • pyre/bench/synth/import_from_name_path.dynasm.jitstats
  • pyre/bench/synth/inline_freevar_after_mayforce.cranelift.jitstats
  • pyre/bench/synth/inline_freevar_after_mayforce.dynasm.jitstats
  • pyre/bench/synth/module_getattr_descr_error.cranelift.jitstats
  • pyre/bench/synth/module_getattr_descr_error.dynasm.jitstats
  • pyre/bench/synth/module_getattr_surrogate_cls.cranelift.jitstats
  • pyre/bench/synth/module_getattr_surrogate_cls.dynasm.jitstats
  • pyre/bench/synth/operator_set_inplace_ops.cranelift.jitstats
  • pyre/bench/synth/operator_set_inplace_ops.dynasm.jitstats
  • pyre/bench/synth/pickle_ctor_args.cranelift.jitstats
  • pyre/bench/synth/pickle_ctor_args.dynasm.jitstats
  • pyre/bench/synth/print_stdout_redirect.cranelift.jitstats
  • pyre/bench/synth/print_stdout_redirect.dynasm.jitstats
  • pyre/bench/synth/pypy_dict_primitives_nonbinding.cranelift.jitstats
  • pyre/bench/synth/pypy_dict_primitives_nonbinding.dynasm.jitstats
  • pyre/bench/synth/seqiter_tuple_error_parity.cranelift.jitstats
  • pyre/bench/synth/seqiter_tuple_error_parity.dynasm.jitstats
  • pyre/bench/synth/simple_namespace_type.cranelift.jitstats
  • pyre/bench/synth/simple_namespace_type.dynasm.jitstats
  • pyre/bench/synth/sre_pattern_methods.cranelift.jitstats
  • pyre/bench/synth/sre_pattern_methods.dynasm.jitstats
  • pyre/bench/synth/sre_wasm_min.cranelift.jitstats
  • pyre/bench/synth/sre_wasm_min.dynasm.jitstats
  • pyre/bench/synth/sre_wasm_min1.cranelift.jitstats
  • pyre/bench/synth/sre_wasm_min1.dynasm.jitstats
  • pyre/bench/synth/str_encode_text_codec.cranelift.jitstats
  • pyre/bench/synth/str_encode_text_codec.dynasm.jitstats
  • pyre/bench/synth/struct_pack_unpack.cranelift.jitstats
  • pyre/bench/synth/struct_pack_unpack.dynasm.jitstats
  • pyre/bench/synth/type_dotted_name.cranelift.jitstats
  • pyre/bench/synth/type_dotted_name.dynasm.jitstats

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: 5d50037687

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

internal_compile_panics=0
loops_aborted=0
loops_compiled=8
loops_compiled=7

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 Avoid Linux-only values in the cross-platform stats gate

These values deliberately exclude the extra _fill_cache loop observed on macOS and Windows, but the default pyre/check.py invocation compares every recorded counter exactly and returns failure on any difference (_apply_snapshot_gate at pyre/check.py:1129-1148). Both pyre-check-macos and pyre-check-windows reuse that invocation as required CI jobs (.github/workflows/pyre-ci.yml:462-480), so those runners will observe their platform-specific loop/guard counts and fail these benchmarks. The import-side loop must be removed from the measurement, or the gate/baselines must represent platform-specific values, before committing Linux-only counts.

Useful? React with 👍 / 👎.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

🤖 Codex parity review

Static analysis of this diff vs the local RPython/PyPy sources (commit 5d50037).
Updated: 2026-08-04T14:07:07.944Z

The diff against the review base changes only generated jit-stats baselines (40 file(s)); nothing to review.

@youknowone

Copy link
Copy Markdown
Owner Author

Superseded by #1034, which fixed this at the source instead of at the baseline.

#1034 sets PYTHONSAFEPATH=1 on the bench child, taking the fixture's own
directory off sys.path, so the import machinery's scan of a 1400-entry
directory no longer crosses the compile threshold and no longer lands in the
counters. Verified on this host with a single dynasm binary and
pyre/bench/synth/arith_int_bool.py:

PYTHONSAFEPATH=1  ->  loops_compiled=7  bridges=10  aborted=0  guard_failures=2211
(unset)           ->  loops_compiled=8  bridges=10  aborted=0  guard_failures=2213

7 / 2211 is ubuntu's column, now reproduced on macOS — the platform ladder is
gone rather than papered over, which is strictly better than restoring the
linux rung by hand as this PR did.

All forty files this PR touches are byte-identical to main after #1034's
re-record, so nothing here is left to land. Its base has also gone stale: the
diff against main now carries 815 deletions across check.py, trace.py's
Rust counterparts and the wasm runner, i.e. it would revert #1023 / #1032 /
#1034. Closing.

commented by Claude

@youknowone youknowone closed this Aug 4, 2026
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