Skip to content

rubyspec-gate's expected-PASS list can be split into shards - #8012

Merged
matz merged 2 commits into
matz:masterfrom
yosefbennywidyo:rubyspec-gate-shard
Oct 8, 2026
Merged

matz merged 2 commits into
matz:masterfrom
yosefbennywidyo:rubyspec-gate-shard

Conversation

@yosefbennywidyo

@yosefbennywidyo yosefbennywidyo commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

make gate takes a while even in parallel: splitting it across fork Actions jobs (corpus in TEST_SHARD slices, one job per rubyspec-gate suite, props, bench, optcarrot) gets it down to about 11-14 minutes, except for one leg. rubyspec-gate's language suite has no way to split: it runs every expected-PASS example (1,025 today) in one job, and stays the longest leg even with 4 workers.

RUBYSPEC_SHARD=k/n keeps only every n-th expected-PASS example per suite (0-indexed offset k-1), so a CI fork can run language (or any suite) as two or more parallel jobs instead of one. Each shard still runs the gate's own checks per suite ("every listed example ran", "no regression"); running every k from 1 to n covers the full expected-PASS list exactly once, so the shards' combined result is the same gate the unsharded target runs. Without the variable, make rubyspec-gate is unchanged.

The variable is validated before use: CodeRabbit caught, on the fork PR, that an out-of-range RUBYSPEC_SHARD (k=0, k>n, or n=0) made the awk filter match no line, and a non-numeric one crashed awk outright -- in both cases the recipe kept going with an empty expected-PASS list, and the gate's own "ran == want, no regression" check passed vacuously ("all 0 expected-PASS examples still pass" reads as a real pass). The variable is now rejected up front unless it is k/n with both positive integers and k <= n.

Verified locally on core/range (200 expected-PASS examples): a 1/2+2/2 split and a 1/3+2/3+3/3 split each reproduce the full example set with no overlap and no gaps, every shard passes with 0 regressions, and a run without RUBYSPEC_SHARD is byte-for-byte identical to the one before this change. The same partition math checked against language's actual expectations file (1,025 -> 513 + 512, union equal to the full list). The validation was checked against the actual failure modes (RUBYSPEC_SHARD=bogus, =0/2, =5/2) before and after the fix.

Related: #6762 proposes widening what the gate covers; no overlap with this change, since #6762 is about which examples get enrolled, not about splitting execution of an already-enrolled suite.

Gate ran sharded on the fork: https://github.com/yosefbennywidyo/spinel/actions/runs/37731651385 (17 jobs, all green, ~14 min). The commit's own Gate: trailer records it:

Gate: green tree 196d31629368 master 9c7ea3c (linux-x86_64 gcc-13.3.0) tests 6421/0


🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added support for splitting expected passing tests into numbered shards. Shards cover the full test list when run together, while each shard retains its existing run-count and regression checks.
    • Invalid shard values are rejected; leaving the setting unset runs the full test list.

yosefbennywidyo and others added 2 commits October 8, 2026 10:54
make gate's slowest leg is rubyspec-gate's language suite, which runs
every expected-PASS example in one pass with no way to split it
across CI jobs. RUBYSPEC_SHARD=k/n keeps only every n-th expected-PASS
example per suite (0-indexed offset k-1), so a fork running the gate's
legs as parallel jobs can split language's 1,025 examples into two (or
more) jobs instead of one. Each shard still runs its own "every listed
example ran" and "no regression" check; running k=1..n covers the full
expected-PASS list exactly once, so the shards' combined result is the
same gate the unsharded target runs. Without the variable, the target
is unchanged.

Verified locally on core/range: a 1/2+2/2 and a 1/3+2/3+3/3 split each
reproduce the full 200-example expected-PASS set with no overlap and
no gaps, every shard passes with 0 regressions, and an unsharded run
is byte-for-byte identical to the one before this change. The same
partitioning math checked against language's actual expectations file
(1,025 examples -> 513 + 512, union equal to the unsharded list).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
An out-of-range RUBYSPEC_SHARD (k=0, k>n, or n=0) made the awk filter
match no line, and a non-numeric one crashed awk outright -- in both
cases the recipe kept going with an empty expected-PASS list, and the
gate's own "ran == want, no non-PASS" check passed vacuously: "all 0
expected-PASS examples still pass" reads as a real pass.

Reject the variable up front unless it is k/n with k and n both
positive integers and k <= n, before it ever reaches the awk filter.

Found by CodeRabbit on the fork PR; verified the vacuous-pass failure
mode by hand before fixing it (RUBYSPEC_SHARD=0/2 and =5/2 each gave
an empty shard with no error from the unguarded version).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Gate: green tree 196d316 master 9c7ea3c (linux-x86_64 gcc-13.3.0) tests 6421/0
@coderabbitai

coderabbitai Bot commented Oct 8, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bf39e649-5db0-402f-9d9a-fc79924bc3e0
📥 Commits

Reviewing files that changed from the base of the PR and between 106c965 and 819e369.

📒 Files selected for processing (1)
  • Makefile
 _____________________________________________________________________________________________________________________
< Use a project glossary. Create and maintain a single source of all the specific terms and vocabulary for a project. >
 ---------------------------------------------------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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 github-actions Bot added the gate: verified The head commit's Gate trailer names the tree its merge with master gives label Oct 8, 2026
@matz
matz merged commit fc7ef47 into matz:master Oct 8, 2026
4 of 5 checks passed
@yosefbennywidyo
yosefbennywidyo deleted the rubyspec-gate-shard branch October 8, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gate: verified The head commit's Gate trailer names the tree its merge with master gives

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants