Repository navigation
Shard the zero-cost gate and reuse baseline work across runs - #2365
Merged
Merged
Conversation
The full gate takes 30 to 75 minutes on one Sandbox, which made it the longest step of a validation round. It can now be split and merged: - --shard=i/n splits the bench and corpus programs (the self-hosted compiler runs in shard 1, or alone with --set=self), and scripts/zero-cost-merge.mjs merges the shards' --json reports into one verdict, recomputing the compile-time intervals over every shard. - --record-baseline-cache records the baseline's artifact hashes once; --baseline-cache skips the baseline build of every program whose candidate artifacts hash the same. The record is tied to the built baseline checkout, toolchain and paths. - The candidate-source self build overlaps the comparison builds on hosts with room for it. pnpm test:sandbox can reuse a prepared snapshot's LLVM helper and runtime pack (SCRIPTC_SANDBOX_NATIVE_REFERENCE) when their inputs are identical, and retries rate-limited Sandbox creation with backoff. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
A recorded baseline entry now holds a hash of its program's inputs: the entry file and its relative imports (paths and contents) and the optimization level. --baseline-cache uses an entry only when the program still hashes the same, so a program or an import that changed since the record builds its baseline, instead of a recorded build error or artifact hash of the old sources settling the comparison as both-fail or identical. Records take schema 2; older records are ignored.
This branch was successfully deployed
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.
A full validation round for a large change took agents about 3 hours in one 8-vCPU Sandbox; the zero-cost gate alone took 30 to 75 minutes of it. This makes the gate shardable and lets runs share baseline work.
--shard=i/nnow splits the bench and corpus programs (the self-hosted compiler runs in shard 1, or alone with--set=self).scripts/zero-cost-merge.mjsmerges shard--jsonreports into one verdict and recomputes the compile-time intervals over all shards.--record-baseline-cache=<file>builds only the baseline and records per-program artifact hashes;--baseline-cache=<file>skips the baseline build when the candidate's artifacts hash the same (or both sides fail with the same error). The record is keyed on a fingerprint of the built baseline checkout, toolchain and paths and is ignored on mismatch. The self program always builds both sides (its builds are timed).pnpm test:sandbox:SCRIPTC_SANDBOX_NATIVE_REFERENCEreuses a prepared snapshot's LLVM helper and runtime pack when their source inputs are identical, and rate-limited Sandbox creation (the team limit is a few hundred vCPUs per minute) retries with backoff instead of failing the lane.Measured on om/s3-pr1 (dc1e8ac) against 641f779, with six 32-vCPU gate shards plus a self shard: each bench+corpus shard took 3.0–5.1 min, the self shard 9.7 min, against 52 min for the unsharded gate in one 8-vCPU Sandbox.
Tests:
tests/harness/zero-cost-gate.test.ts(cache settlement, merge),tests/harness/sandbox-config.test.ts(native reference); lint and format clean.🤖 Generated with Claude Code