Skip to content

ci(test-shards): place Test Core bins by predicted wall, and cut the CLI into 4 slices on the refreshed dataset - #25968

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-lvcw23
Oct 26, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-lvcw23

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread

Part of #25870. This PR carries two steps: (1) wall-based bin placement, and (2) the refreshed dataset with the CLI cut into 4 slices. #25870 stays open, because its acceptance is measured on 3 consecutive spec-touching PRs after landing. The prediction below is not that measurement.

Supersedes #25960. It carries the shard-timings-refresh lane's commit 92343f5 (chore(ci): refresh the Test Core shard-timings dataset) unchanged. That refresh cannot land alone, because pin 3c refuses it at 3 slices (step 2).

Diagnosis — which of the three, with run ids

The long shards are always the three that carry a @objectstack/cli file-level slice. Read from gh api …/runs/N/jobs step timings on 56 pull_request runs (2026-10-25 18:54Z – 2026-10-26 05:44Z), and from the slice leg's own Duration / turbo Time: lines on the 18 slice-shard jobs of six packages/spec-touching runs.

The slowest shard on a spec-touching PR breaks down like this (minutes):

run (spec PR) slowest setup closure whole-package leg cli slice leg (turbo Time:)
40274911131 (#25903) 5/8 28.8 ~1.5 6.0 5.7 15.4
40271593540 (#25944) 4/8 28.1 ~1.5 5.5 3.4 17.3
40269339195 (#25813) 4/8 28.5 ~1.5 5.6 3.4 17.5
40266487909 (#25903) 5/8 28.5 ~1.5 5.9 5.6 15.4
40263851511 (#25813) 3/8 26.8 ~1.5 6.3 4.5 14.3
40261969569 (#25830) 3/8 25.7 ~1.5 6.0 4.3 13.6

(whole-package leg = Run this shard's tests minus the slice leg's turbo Time:.)

Three causes, all real, in this order of size:

  1. The cli slice leg itself, 13.6–17.5 min. vitest cuts the CLI by file COUNT (BaseSequencer.shard: sha1 of the path, then equal-count chunks), so the three slices are not equal: across the six runs they measured 518–1047 s, the heaviest ~1.27× the mean (~820 s). Total cli 2406–2542 s against a pinned 2899 s (0.83–0.88×).
  2. The dependency closure, 5.5–6.3 min, against 0.4–1.0 min on shards that skip declarations. @objectstack/cli is in ci.yml's DTS_READERS, so every slice shard builds the whole cli closure WITH .d.ts, and a PR run reads no remote cache, so that build is cold (ci.yml: local cold closure 5m59s with declarations, 1m24s without).
  3. A whole-package leg of 2.2–5.7 min run before the slice — the partitioner's doing. partition() balanced bins by their SUM of predicted seconds. A slice runs serially after the four-wide whole leg, so the step is ~ wholeSum / 2.9 + slice (the ci(test-shards): widen Test Core from 6 to 8 shards once @objectstack/spec is file-sharded — the "6 is enough" arithmetic predates the cli slices (full-battery slowest shard ≈ 1937 s → ≈ 1452 s) #25376 wall model). Balancing sums filled every slice shard up to the mean with ~900 s of whole packages: predicted step 1277 s on the three slice shards against 643 s on the other five (committed dataset, full list).

Stale weights are not the cause: on the refreshed dataset (#25960, the shard-timings-refresh lane's 2026-10-26 output) the sum-placed split still predicts 1107 s on the slice shards against 518 s elsewhere — the same 2.1× gap.

Step 1: wall-based placement (cause 3)

In scripts/partition-test-shards.mjs, with no workflow or package edit:

Predicted test steps, full list (turbo ls, dogfood excluded), via planRun():

dataset before (slice shards / others) after (slice shards / others)
committed (2026-10-23) 1277 s / 643 s 966 s / 830 s
#25960 refresh (2026-10-26) 1107 s / 518 s 899 s / 642 s

Measured-based expectation for the six spec runs above: removing the whole-package leg takes the slowest shard from 25.7–28.8 min to ~22.3–25.1 min. The other five shards absorb the moved packages (their slowest was 17.5 min; +~2.5 min of four-wide work each).

Step 2: the refreshed dataset, and the CLI at 4 slices

The refresh (92343f5, 14 runs, newest 40272142430) measures @objectstack/cli at 2697.45s. Pin 3c (sliceCountProblems, the serial-floor derivation of #22075) then refuses 3 slices:

n one slice vs the heaviest other serial task (@objectstack/metadata-protocol 670.12s; spec and runtime run as two tasks) limit 1.3x = 871.16s
3 899.15s 1.34x refused: "Raise it to 4" (this is #25960's red, job 121437007857)
4 674.36s 1.01x meets, and 3 does not, so 4 is the smallest

So the change is FILE_SHARDED_PACKAGES cli 3 → 4, with PREVIOUS_FILE_SHARDED_PACKAGES set to the outgoing {cli: 3} per the map's own rule, so the refresh lane still decodes the 3-slice summaries retained from before the change. The docblocks carry the new derivation table. The bin-sum floor and the wall model agree on this dataset, and no ratio or bound moved. Predicted test-step walls on the full list are 738s on all 8 shards (max/mean 1.00x), and every bin is within the density cap.

Predicted from measurement, not from the model. vitest's BaseSequencer.shard (sha1 of the path relative to the package root, sorted, equal-count chunks) reproduced locally over vitest list --filesOnly (506 files) matches run 40274911131's three slice jobs file for file: 169/169/168 files on jobs 121415631670/…679/…708. From those jobs' per-file times, with the wall taken as 0.39 × the per-file sum (vitest's Duration over its tests sum on the same jobs: 0.403/0.381/0.390):

split predicted slice walls measured (vitest Duration) heaviest / mean
3 ways 789 / 691 / 926 s 812.65 / 673.01 / 921.52 s 1.15
4 ways 487 / 616 / 673 / 630 s — 1.12

The heaviest slice falls 27%. Applied to the six spec runs (slowest = setup ~1.5 + that run's cold DTS closure + ~1.1 min of whole leg, the wall model's 738 − 674 s, + 0.727 × that run's heaviest slice):

run (spec PR) slowest before predicted after both steps
40274911131 (#25903) 28.8 19.8
40271593540 (#25944) 28.1 20.7
40269339195 (#25813) 28.5 20.9
40266487909 (#25903) 28.5 19.7
40263851511 (#25813) 26.8 19.3
40261969569 (#25830) 25.7 18.5

That gives 18.5–20.9 min, with three of six at or under 20. The cost: a fourth shard now builds the CLI's DTS closure (~5.8 min cold). The 738s walls above count test time only, not that build. The per-file read of 5/8 lacks 11 files that print before the 5,000-line log tail; their 172.2s (vitest tests minus the captured sum) is spread evenly over them.

If the readings stay above ~20 min

What is left on a slice shard is the cold DTS closure (5.5–6.3 min) plus the heaviest slice. The next steps, neither taken here:

  • B. Declarations only where a slice reads them. Three CLI test files read built .d.ts. With the split now reproducible, a slice holding none of them could build DTS-off (~1 min instead of ~5.8). This edits ci.yml, so it is Tier H.
  • C. Weight-balanced CLI slices (a sequencer splitting by measured file time): heaviest/mean 1.12 → ~1.0. It needs a per-file weight source that the dataset does not carry today.

Acceptance notes

  • Deliberate leftovers in .github/workflows/ci.yml (Tier H, untouched): the Test Core header still says each slice is "placed at its PLAIN weight so every bin keeps the whole-package split's density", and its "3 slices" wording (the drift-step comment, "a shard carrying one of its 3 slices is predicted a third of that"; the timeout history) is now stale. Correcting either makes a PR Tier H, so both are left for whichever step edits ci.yml. The partitioner's own headers carry the corrected statements.
  • Slice shards now come out as shards 1–4 on the full list (LPT places the heaviest loads first). Shard numbers carry no meaning beyond the per-shard Turbo seed key.

Tests

  • node scripts/partition-test-shards.mjs --self-test at b323410 → self-test OK (75 measured packages -> 78 shard items, 8 shards, predicted test-step walls 738/738/738/738/738/738/738/739s, max/mean 1.00x <= 1.3x, …, file-level slices: @objectstack/cli x4).
  • Step 1 revert proof (scripts/ablation-replace.mjs, bin choice back to total, on the committed dataset): the self-test reds with balance: at 8 shards the slowest predicted test step is 1.45x the mean (1277s vs 881s). Restored blob == HEAD, and git diff HEAD is empty.
  • Step 2 revert proof: the refreshed dataset with cli at 3 reds pin 3c with @objectstack/cli: sliced 3 ways at 2697.45s, one slice is 899s -- past 1.3x the heaviest other serial task (670s, so 871s) … Raise it to 4. (the same red as chore(ci): refresh the Test Core shard-timings dataset #25960's job 121437007857).
  • scripts/test-shard-timings.json is byte-identical to 92343f5 (git diff 92343f5b b3234103 -- scripts/test-shard-timings.json is empty).
  • Sibling self-tests are green at b323410: measure-test-shard-timings (decodes through both maps), check-test-completeness, ci/select-shard-timings-run, nightly-tiers, check-test-suite-ceilings, ci/select-shard-packages.selftest.sh.

Gates

  • Local derived set at b323410 (node scripts/pm/dispatch-gates.mjs --commands, merge-base origin/main cdd4eea): all 35 families exit 0. The --ran reconciliation reads 35 derived famil(ies) accounted for — 35 run, 0 NOT-MEASURED. Step 1 alone (8ca31e0) ran its 33 families the same way.
  • Everything else (Lint & Repo Gates, Test Core, …) belongs to CI and is read from this PR's check-runs.

Clause-②: no
Metadata-protocol: none

🤖 Generated with Claude Code

https://claude.ai/code/session_01NPH84ZP1jWcst3tpRwfrJL


Generated by Claude Code

…ce shard carries no whole-package leg ahead of its serial slice

A shard runs its whole packages four at a time and then each file-level slice
alone, so its tests step reads ~wholeSum / 2.9 + slice (the #25376 wall model).
partition() balanced plain sums, which filled every slice shard up to the mean
with whole packages that ran before the slice. It now places by load (a slice
counts 2.9x its weight); a split with no slice is placed byte-identically.

Claude-Session: https://claude.ai/code/session_01NPH84ZP1jWcst3tpRwfrJL
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Oct 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对

Verdict: ACCEPT at head ec177ae84c75d8991ce06b0b4008cb97344902ae. This lands the cheapest step only. #25870 stays open for the remaining gap.

Checklist

Gate readings at head ec177ae

  • 34 success, 16 skipped, 0 failing.
  • Lint & Repo Gates, TypeScript Type Check, Test Core (all 8 shards) and Governed Surface Queue Guard are success.
  • The skipped checks are UI and opt-in jobs filtered out by path.

Seat's own readings, in a detached worktree at ec177ae

  • node scripts/partition-test-shards.mjs --self-test → self-test OK (… predicted test-step walls 966/966/966/830/830/830/829/829s, max/mean 1.10x …).
  • Revert proof: I set the bin choice back to total, and the self-test fails with balance: … slowest predicted test step is 1.45x the mean (1277s vs 881s). The worktree was restored afterwards, with an empty diff.
  • The PR says a list with no slice gets a byte-identical split. I tested that with 900 random slice-free lists (5–80 packages each, at 3, 6 and 8 shards), comparing partition() at the head against origin/main. 0 lists differed.
  • Diagnosis: the PR body has the per-run table (6 spec-touching runs with ids). Stale weights are ruled out by numbers from the chore(ci): refresh the Test Core shard-timings dataset #25960 refresh dataset, which the card asked for.

Deviations / follow-ups (named, not fixed here)


Generated by Claude Code

claude and others added 3 commits October 26, 2026 07:24
Regenerated by .github/workflows/shard-timings-refresh.yml from the test-core-run-summary artifacts of 14 accumulated run(s) (40272142430 40266979145 40262173089 40257470166 40242835329 40238189261 40233481335 40228747755 40223991179 40219252911 40214410982 40209651657 40204927516 40200279306), newest 40272142430 at 2a728ba. Generated, never hand-edited.
…he 2026-10-26 refresh

The refreshed dataset measures @objectstack/cli at 2697.45s. At 3 slices one
slice is 899s, past 1.3x the heaviest other serial task
(@objectstack/metadata-protocol, 670.12s, so 871s), and pin 3c refuses the
refresh. At 4 a slice is 674s and meets; 3 does not, so 4 is the smallest.

PREVIOUS_FILE_SHARDED_PACKAGES carries the outgoing {cli: 3}, so the refresh
lane still decodes the 3-slice summaries retained from before this change.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NPH84ZP1jWcst3tpRwfrJL
@github-actions github-actions Bot added size/l and removed size/m labels Oct 26, 2026
@objectstack-fleet objectstack-fleet Bot changed the title ci(test-shards): place Test Core bins by predicted wall, so a CLI slice shard runs no whole-package leg before its slice ci(test-shards): place Test Core bins by predicted wall, and cut the CLI into 4 slices on the refreshed dataset Oct 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对 (delta re-review)

Verdict: ACCEPT at head b32341039f093b50bbe98b7f38ae7e568921cb07. This replaces the ACCEPT given at ec177ae8. Step 1 (wall placement) is unchanged since that review. This review covers step 2 only.

The delta

Gate readings at head b323410

Seat's own readings at b323410, in a detached worktree

  • --self-test → self-test OK (… 78 shard items, 8 shards, predicted test-step walls 738/738/738/738/738/738/738/739s, max/mean 1.00x …, file-level slices: @objectstack/cli x4).
  • Revert proof: with cli set back to 3, pin 3c turns red with the same text chore(ci): refresh the Test Core shard-timings dataset #25960 showed in CI (sliced 3 ways at 2697.45s, one slice is 899s -- past … 871s … Raise it to 4.). The worktree was restored afterwards, with an empty status.
  • This also clears chore(ci): refresh the Test Core shard-timings dataset #25960's red "Shard partitioner self-test" (Lint · CI, release & engine gates), because the refreshed weights cannot land at cli ×3.

Still open on #25870 (named, not done here)

  • The PR predicts the slowest shard at 18.5–20.9 min on the six spec runs it lists. The prediction comes from a reproduction of vitest's sha1 split, file for file, against run 40274911131. The card's acceptance is a measurement, though: 3 consecutive spec-touching pull_request runs after landing.
  • The ci.yml Test Core header ("PLAIN weight", "3 slices") is stale. It is a deliberate leftover, because correcting it makes a PR Tier H.

Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 26, 2026 08:07
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 26, 2026 08:07
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit f36f619 Oct 26, 2026
54 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-lvcw23 branch October 26, 2026 08:35
os-zhuang pushed a commit that referenced this pull request Oct 26, 2026
…6-10-23 dataset (undo #25968) (#26077)

<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D5ZEhycrEz6EHUjW1whANXQ)_

Fixes #26074

Clause-②: no
Metadata-protocol: none

## What

This is a clean revert of f36f619 (#25968). It changes two files and
nothing else: `scripts/partition-test-shards.mjs` goes back to plain-sum
bin placement, and `scripts/test-shard-timings.json` goes back to the
2026-10-23 dataset with cli in 3 slices. Neither file has a later commit
on `main`. No other file imports the exports this removes
(`WHOLE_LEG_PARALLELISM`, `loadOf`, `wallOf`).

## Why

Since the first queue build on the #25968 layout (08:16Z), full Test
Core `merge_group` builds have gone red 5 times in 27. On the old
layout, 05:00–08:10Z, they went red 0 times in 19. Every red ejects its
PR and rebuilds every entry queued behind it, so throughput fell from
12–13 merges an hour to 6. The failing tests are all load-sensitive:

- objectql `src/hook-run-as.test.ts` (cold `import('./index.js')`): Test
timed out in 5000ms
- plugin-security
`src/objects/shipped-sets-identity-default-row-scope.test.ts`: Test
timed out in 5000ms
- cli `test/hook-timeout-override-refusal.test.ts` CONTROL: the `vitest
list` child exits 1

The heads that failed passed when they went back in unchanged.

The #25870 thread replayed `planRun()` on both trees. Before, five
whole-package shards carried about 1866 s of four-wide work each, and
plugin-security sat on a cli-slice shard with 899 s. After, four
whole-package shards carry about 2141 s each, and objectql and
plugin-security share one shard. The suite-duration ceiling annotations
show the effect: plugin-security reads 605–611 s against a ceiling of
474, plugin-auth 617–928 s against 600, driver-sql 603–612 s against
451, and objectql 1102 s against 952.

## Cost and rollback

The slowest spec-PR shard goes back to about 25–29 min, from about 20.
#25870 stays open for a placement that takes contention into account.
Rollback means re-landing f36f619 as it is.

## Verification

- `node scripts/partition-test-shards.mjs --self-test`: OK. 75 measured
packages, 77 items, 8 shards, max/mean 1.00x, bins about 1866 s, all
within the 2899.02 s density cap, cli x3.
- `node scripts/check-commit-card-trailers.mjs --range
origin/main..HEAD`: pass.
- The other gates are left to this PR's own CI run.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01SrpCjPfYv8N9P9EJvoDyN9

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…ve shards (objectstack-ai#38258)

<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DDypKu7B9nwbu5WuV7AEio8)_

Part of objectstack-ai#36646
Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户无感:合并队列里"核心测试"这一项从十台机器分到十二台,带命令行切片的那几台不再先跑一堆别的包,预计全量构建的这一项提前约三分钟结束。
- 属于"合并队列速度预算"这张每周自动生成的提速卡(队列中位数 22.9 分钟,预算 22 分钟),本单只做其中两项已裁定的措施。
- 出错时表现为某台测试机变慢或测试分配报错,不会漏测;只改了流水线配置和分配脚本,整单回退即可撤回。
- 要你做的:这是受管的流水线文件,需要你审阅并亲手合并。

## What changes

Levers A and B of the routing in the release comment on objectstack-ai#36646
(7232820216), on one branch; C and E are not taken, D is left.

- **A — wall-aware slice placement**
(`scripts/partition-test-shards.mjs`, new `placeByWall()` /
`wallOfBin()`, called from `placeItems()`). A split that carries a CLI
slice is no longer balanced on bin sums. Slices go first, one per shard,
then whole packages land on the slice-free shards while each whole leg
stays within `WHOLE_LEG_CAP_SECONDS` (1868 s) and `LOAD_SENSITIVE_APART`
stays apart; only past that do they spill, least modelled wall first (so
onto a non-reader slice shard before the reader slice's, whose
declaration closure is 270 s of serial wall). A split with no slice is
still the plain LPT split, byte for byte, and the density-cap repair
(`refineToCap`) still runs after either placement.
- **B — Test Core 10 → 12 shards** (`.github/workflows/ci.yml`, the
`test` job and `test-gate`): the matrix fallback roster, the job name,
`--shard k/12`, the attestation `--total 12` / artifact names, the
gate's `--leg test/12` and planned-roster fallback, and the
timing-capture/cache-prune labels. `SHARD_COUNT` is read from the matrix
(`scripts/ci-shard-matrix.mjs`), so the partitioner, the planner and the
timings selector follow without a literal of their own.
`scripts/pm/landing-k.mjs`'s self-test pins the shard job's name, so
that pin moves to `/12`.
- Both have to land together: at ten shards, placing by wall pushes
seven whole legs to 1866-1868 s, which is the density PR objectstack-ai#25968 was
reverted at. The new self-test pin refuses any whole leg within 5% of
the cap. At twelve, the nine slice-free shards hold every whole package
at 1515-1520 s, below the 1696 s they carry at ten today.
- Comments updated where they state the count (the `test` job header
gains a TWELVE paragraph; `plan-test-core-shards.mjs` header; the
`SHARD_COUNT` docblock carries the figures).

## Tests

<details><summary>Partitioner self-test: new battery and
ablations</summary>

- New battery `a split that carries a slice is placed by wall (objectstack-ai#36646)`
(8 cases). 3 cases grade the committed dataset as CI splits it: no whole
package beside a slice except the reader slice's riders; the non-reader
slice shards' heaviest modelled wall falls while the split's heaviest
does not rise; no whole leg within 5% of the cap. 5 are fixtures: the
spill order, the load-sensitive pair, a package that fits no bin, slice
spread, and the no-slice identity. The battery floor goes 18 → 19.
- Two existing pins re-stated for the new placement. (1) The
reader-slice room pin (3e) now asserts the reader shard carries only its
riders, not "300 s less than the other slice shards", which read 53 s
against 0/0 s once those carry nothing. (2) The closure-allowance
refusal fixture now uses a cap under the split's own mean, because the
repair starting from the wall placement can descend below "densest − 1
s".
- `node scripts/partition-test-shards.mjs --self-test`: `self-test OK
(82 measured packages -> 84 shard items, 12 shards, max/mean 1.18x <=
1.3x, floor 1314s, bins
1662.99/827.08/827.08/1514.98/1517.07/1517.11/1517.79/1518.22/1517.51/1518.58/1517.13/1519.68s
within the 2481.24s density cap, whole legs
53/0/0/1515/1517/1517/1518/1518/1518/1519/1517/1520s within 1868s,
file-level slices: @objectstack/cli x3)`.
- Ablation 1, through `scripts/ablation-replace.mjs`: `placeItems`
routed back to `partition()`. The mutation landed (anchor 1 → 0, blob
18e0110 → adfbed35e9c3), the self-test exited 1 on `wall placement:
the committed dataset at 12 shards puts whole packages beside a slice
(@objectstack/service-settings on shard 5, …)`, and the file was
restored to blob 18e0110 with an empty `git diff HEAD`.
- Ablation 2: the whole-leg cap filter dropped from `placeByWall`. The
mutation landed (blob → e76084fdaefa) and the self-test exited 1 on `the
spill fixture split as [c 1/2 | c 2/2 | w,x,y,z]`. Restored the same
way. The committed dataset does not spill at twelve, so only the fixture
can catch this one.
- Other self-tests green on this tree: `plan-test-core-shards` (23
cases), `ci-shard-matrix` (27, `live: test=12`),
`check-shard-attestation` (360), `select-shard-timings-run`, `landing-k`
(47).

</details>

## Acceptance notes

- **Affected job, before and after (advisory, per AGENTS.md).**
- Before, measured: `queue-duration.mjs --since 7d` at 2026-11-28T10:09Z
over 1319 all-green SHAs gives p50 **22.9** and p90 **32.3** min (over
both). Its slowest critical-run job is `Test Core (3/10)` at a 19.6 min
median.
- On the 60 latest green merge_group CI runs (2026-11-28), 42 started
Test Core, and their slowest Test Core job reads p50 21.9 min measured.
- After, modelled, not measured: each run's own package list is replayed
through `planShards()`, before at 10 and after at 12, with a whole-leg
fit from those runs' logs (297 legs: `-45 + 0.326*sum + 0.351*heaviest`,
median error 20.6%) and each run's measured slice legs.
- Result: the slowest Test Core job goes 19.2 → 18.3 min modelled (A+B).
B alone is 19.1, and A alone at ten is 19.1, but A alone puts the whole
legs at the cap. On the 28 runs that started all ten shards: 22.1 → 19.1
modelled.
- Applied to those runs' measured job ends, the CI run wall over all 60
goes p50 25.7 → 25.0 and p90 34.1 → 29.1. Projected onto the 7-day
reading: queue p50 about 22.2 min, p90 under the 32-min alarm. That is
not yet under the 22-min budget.
- **A real post-merge reading is owed**: the next weekly
`queue-duration-budget` run, or `node --use-env-proxy
scripts/ci/queue-duration.mjs --since <merge time>` once a few hundred
queue SHAs have run at twelve.
- **What still sets the floor.**
- After this change the reader slice's shard (CLI 1/3 plus its 270 s
declaration closure) is the heaviest modelled Test Core shard.
- In the sample, the runtime shard (`Test Core (3/10)`:
`@objectstack/runtime` alone measured 19.5-22 min) was the slowest on 9
of 28 all-ten runs. Neither lever moves a single package's own wall.
- The Dogfood Regression Gate shards (17 min median) and Test UI also
stay where they are.
- So reaching under 22 needs a separate lever on one of those. That is
not this PR, and `Part of` leaves the card open for the weekly reading.
- **Cost.** Two more runners on a full plan, ~+3.6 runner-min at the
per-shard overhead the `test` job header already measures. Shards 11 and
12 start with a cold per-shard Turbo cache key until `main`'s push runs
seed them, and every shard's package set moves once, so the first queue
runs after merge read slower than steady state.
- The shard-timings refresh judges each run at its own `Test Core (k/N)`
width, so the ten-wide runs stay readable. Its next refresh needs
twelve-wide runs to accumulate.
- `scripts/ci/queue-budget.json` is untouched.
- `skip-changeset`: the diff ships nothing from any published package
(root `scripts/` and `.github/` only).

## Verification

Read first:

1. `scripts/partition-test-shards.mjs`, `placeByWall()` and
`placeItems()`. The risk is the candidate filter: the cap and the apart
pair, then the fallbacks.
2. `.github/workflows/ci.yml`, the `test` job's `strategy.matrix` and
`test-gate`'s `--leg test/12` and `OS_TEST_PLAN`. Every `/10` literal of
the job has to move together.
3. The new 3f battery in the same script's self-test.

Two-minute check: `node scripts/partition-test-shards.mjs --self-test`
prints `12 shards`, and whole legs `53/0/0/1515/…/1520s within 1868s`,
so the three slice shards carry their slices only.

---
_Generated by [Claude
Code](https://claude.ai/code/session_016WV4cxRDKprCtjpEdtiPFW)_

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/l skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants