Add generate-time suite sharding (--shard-count / --shard-index)#161
Merged
Conversation
Splits the generated suite into N deterministic, disjoint slices so a CI matrix can compile and run them on separate runners in parallel. Assignment is a stable FNV-1a hash of the test file name (not string.GetHashCode, which is per-process randomized), so shard k always holds the same files across runs/machines/OSes, shards never overlap, and their union is the full suite. Strict and non-strict variants of a file share a shard. Wired through TestSuiteGeneratorOptions, the generator, and the console tool. Added partition/determinism/validation tests; existing snapshots unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds optional sharding to
generateso a CI matrix can compile and run independent slices of the suite on separate runners in parallel.What
--shard-count(default 1 = no sharding) and--shard-index([0, shard-count)) on thegeneratecommand, plumbed throughTestSuiteGeneratorOptions.string.GetHashCode(), which is per-process randomized on modern .NET. So shard k always contains the same files across runs, machines and operating systems; shards never overlap; and their union is exactly the full suite. Strict and non-strict variants of a file share a shard, and a shard generated on one OS can be reused (e.g. from a cross-OS cache) by test jobs on any other.Validation
Console run against a real test262 checkout,
--shard-count 4:New tests cover partition (no overlap / no loss), determinism, and argument validation. Existing snapshot tests are unaffected (10/10 pass).
Motivation
Consumed by Jint to shard its ~99.5k-case Test262 run across parallel GitHub Actions runners (the suite execution dominates CI wall-clock, and free runners are capped at 4 vCPU which NUnit already saturates — so horizontal sharding is the only lever left).
🤖 Generated with Claude Code