Public: anyone can read this; the crew can change it.
The gate waits on its slowest shard: split test files by how long they take, not how many bytes they are #515
Check · Review · Land · Live done — Landed and live in production.
The gate now assigns test files to shards by how long each one took, not by its size in bytes. Run locally, the three shards finished within 1.07× of each other. The under-75s target can't be met: the gate has grown to 41 files on 3 CPUs, and `test/studio.test.ts` alone takes about 190–200s.
shipped production is serving it deploy d5b2fe2
Sign in to join this conversation.
new above
offline
The gate now assigns test files to shards by how long each one took, not by its size in bytes. Run locally, the three shards finished within 1.07× of each other. The under-75s target can't be met: the gate has grown to 41 files on 3 CPUs, and
test/studio.test.tsalone takes about 190–200s.What changed
scripts/shards.ts):-
parseTimesreadsscripts/test-times.json(test file → seconds). -weighergives each file its measured time. A file missing from the table is weighed by its size in bytes, converted to seconds at the rate the table's own files show. -splitFilesstill places the longest file first into the least-loaded shard, and the same file list and table always give the same split.bun run check:record(orscripts/check.ts --record) runs the samecheck.runstring fromforge.json, with--recordadded toscripts/test-shards.ts. Each file then runs as its ownbun test, as many at a time as the gate runs shards. The table is rewritten only if every file passes, and files the run didn't cover keep their old times. The file list still lives only inforge.json, and I didn't touch it.Slowest shard Xs, fastest Ys.test/shards.test.ts): they pin that:- a known slow file sits alone when a fast file of the same size exists; - a file missing from the table still lands in a shard, with its weight checked against a hand calculation (7.5s); - eleven kinds of malformed table are refused, and the split still runs on bytes; - the checked-in table parses and names only files that exist.
Measured I recorded the table on this machine with
--record, then ran the full gate withbun run check:On this machine's timings, the old byte split would have given 208/432/390s across three shards.
One test failed in that local gate run: "a mirror whose git is not ready yet is fetched again, and lands" in
test/fork-flow.test.ts. The file passed 15/15 run alone, both in the record run and in a separate run, and its test depends on timing. I didn't change it. The forge numbers for this branch will appear in this pull's own check log on theSlowest shard … fastest …line.What I chose not to do
test/studio.test.tstakes about 190s on its own, so the whole check can't get under the issue's 75s target. That target was set when the gate had 23 files. I didn't shorten that file or any other test.To try it:
bun test test/shards.test.ts, thenbun run checkand read the two summary lines at the end of the log.🤖 Generated with Claude Code
Closes #307
Closes #307