Repository navigation
Description
Context
browser_determinism repeats every changed browser, layout and story spec five times under CPU load. It splits the work into shards by each project/file pair's reviewed cost (BROWSER_DETERMINISM_PARTITIONS, scripts/proof-shards.ts:68: 300 s capacity per shard, unweightedSeconds: 10). The costs live in scripts/browser-shard-costs.json. The repeat step itself is capped at 20 minutes (.github/workflows/ci.yml:746-750).
packages/ui-react/tests/browser/hit-reach.trust-settings.pointer.tsx (added by 70970e41a, #4425) has no entry in scripts/browser-shard-costs.json for any of its three projects (rail-coarse, rail-fine, rail-mixed). The planner therefore costs each pair at the 10 s default. Under load, one pass of the file takes about 40 s per project (74 tests).
A PR whose diff changes this spec along with a few others gets one shard and times out. Observed on #4482, a sync of main into an integration branch whose diff carries #4425's specs (run 45146578319, job browser_determinism (1)):
- the planner printed
Repeating 5 changed project/file pair(s) 5 time(s) each … 48.9 weighted s per pass, 244.4 s estimated, budget 300 sand listed all threehit-reach.trust-settings.pointer.tsxpairs asno reviewed weight: costed at the 10s default; - the step ran 15 file passes, every one green, and was cancelled at its 20-minute limit.
The job fails on a timeout, not a test failure, and the shard count was decided by the missing weight. #4425's own PR passed the job in about eight minutes, with fewer pairs selected.
Scope
- Add reviewed costs for the three
hit-reach.trust-settings.pointer.tsxpairs toscripts/browser-shard-costs.json, measured the way the file's other entries are, with its recorded provenance. - Check whether any other browser, layout or story spec on
mainhas no reviewed cost, and add those too.
Out of scope
- Changing the partitioning algorithm, the 300 s capacity, the 20-minute step limit or the 10 s default.
- Any test's content.
Acceptance criteria
scripts/browser-shard-costs.jsonhas a reviewed cost for everyrail-coarse,rail-fineandrail-mixedpair ofhit-reach.trust-settings.pointer.tsx.- With those costs, the plan for the CONTRACT: chore: merge main into the G1a integration branch (#4201) #4482 selection (the five pairs above) uses more than one shard. A unit test over the planner shows this: with the entries present it plans more than one shard, and with them removed it plans one.
- Every browser, layout and story spec on
mainhas a reviewed cost, or the PR lists the ones that do not and says why.
Verification
bun run test ./tests/browser-determinism.test.ts, which covers planBrowserPartitions (it already has an unweighted-default case, "a pair without a reviewed weight costs the stated default", to model the new case on), plus bun run test ./tests/browser-shards.test.ts for the cost file, and a draft PR whose browser_determinism plan lists the new weights.
Contract impact
None.
2026-11-23 triage at main a3395c4b2: verified BROWSER_DETERMINISM_PARTITIONS (scripts/proof-shards.ts:68), the 20-minute step limit (.github/workflows/ci.yml:747), and that scripts/browser-shard-costs.json has no trust-settings.pointer entry. Corrected the planner test pointer. Standalone: #2753 assigns shard balancing to the closed #1849, and no open epic owns it.
Activity
schlessera commentedon Nov 23, 2026
Claimed for implementation. Claim token:
claim-6bd67265. Branch:chore/4201-g1a-sync-main.Fixed on the G1a integration branch through the sync PR #4482, whose browser_determinism it unblocks; reaches main with the G1a landing. Collisions: none checked beyond #4482.
ci: weigh every browser and layout pair from main's run at the sync p…
test(ci): hold the #4484 control at the weights that planned the job (#…
test(ci): prove the #4484 split on fixed measured weights (#4484)
test(ci): the measured #4484 weights plan two partitions, not three (#…