Repository navigation
free-ci-health: a split shard's overrun compares wall time with its prediction over jobs (GST-1653) - #4085
Merged
Conversation
…rediction over jobs (GST-1653) shardOverruns compared a shard's wall-clock elapsedMs with predictedMs, the shard's serial seed sum. free-tests.yml plans every shard at --shard-jobs 4, so the 1.5x warning only fired after about a 6x slowdown. The prediction is now divided by the plan shard's jobs, ciHealthSummary carries jobs through, and the warning names the parallel job count. k=1 output is unchanged. Rewritten on main from #4051, which fixes #3851. Co-authored-by: Indra Prasetya <[email protected]> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
Contributor
|
Follow-up with the exact detail, because the trailer is already there but does not resolve to an account. Commit That address has no numeric id prefix, so GitHub never mapped it to an account, and after I renamed the account from The line that does resolve is: If amending |
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.
What changed
A 4-job shard that ran 1.6x its share now warns; before, it needed about 6x.
Before/after as text: A 4-job shard that ran 1.6x its share now warns; before, it needed about 6x
--ci-verify's shard-overrun warning now measures a shard's wall time against its seed prediction divided by the shard's parallel job count.shardOverrunsandoverrunWarninginscripts/lib/free-ci-health.tsusepredictedMs / jobs,ciHealthSummarypasses the plan shard'sjobsthrough, and the warning saysacross N parallel jobswhen k > 1. With nojobs(k = 1) the behavior and the message are unchanged.docs/TESTING_INTERNALS.mdstates the rule beside the 1.5x / 30 s thresholds.Why
Issue #3851 reports that the overrun warning stayed silent on slow shards. free-tests.yml plans every shard at
--shard-jobs 4, so the check compared a shard's wall time with its serial seed sum and only fired after about a 6x slowdown. The warning is the signal that the duration seed has gone stale, and it now fires at the 1.5x it promises.Blast radius
Only the
--ci-verifyjob-summary line changes, and it never fails a run.ciHealthSummaryhas one caller (scripts/test-free-shards.ts:2032), and the plan'sjobsis validated byplannedShardJobsProblembefore this code reads it (file read). No network, secrets, permissions, workflows, install scripts or dependencies are touched.Credit
Rewritten on main from @indraoverflow's #4051 (read as text only, not checked out), credited with a Co-authored-by trailer on 5e2964d.
Tests
Two new cases in
test/free-seed-ratchet.test.ts:shardOverrunsat jobs = 1 and jobs = 4 (written first; the jobs = 4 case failed on main), andciHealthSummarycarrying a plan's jobs = 4. The full free suite is carried from CI run 42249997890/1 (1613 files). Locally the three focused files were green,bun run typecheckwas clean, andbun run typecheck:testshowed no new diagnostics against the baseline.Approvals
No approvals recorded for branch capy/gst-1653-shard-overrun-jobs.
Summary
A split CI shard is now judged against the share of the seed it actually runs, so a stale duration seed shows up in the job summary again. One commit (5e2964d) changes the comparison, its message, two tests and one docs sentence, plus a changelog.d fragment.
Test Coverage
All new code paths have test coverage (deterministic map: the one changed runtime file has a changed test naming it). Two new cases in
test/free-seed-ratchet.test.ts:shardOverrunsat jobs = 1 and jobs = 4 (the jobs = 4 case failed on main), andciHealthSummarycarrying a plan's jobs = 4.Tests ran: free 1613 (files, carried from CI run 42249997890/1)
Pre-Landing Review
Pre-Landing Review: 1 issues — 0 auto-fixed, 1 asked (0 fixed, 1 skipped), 0 deferred, 0 noted
REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=0 fixed=0 scope=frozen ledgers_read=2 dispatches=1 est_input_tokens=2735
Gate edits: none detected (2 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review: completed (openai/gpt-6.1-sol as host subagent): approve with a follow-up, nothing blocking. Native adversarial (claude-opus-5-5): ship as-is.
Review notes
None of these would fail a test, break production or lose data or secrets, so under the crew's blocking floor they ship as notes and were not fixed in this PR.
scripts/lib/free-ci-health.ts:36; red-team, adversarial and outside voice agree).assignSubShardspacks whole files into k groups and runsSLOW_UNDER_LOADfiles in a trailing serial sub-shard, so the true floor is the largest packed group plus the serial tail, not sum/k. TodaySLOW_UNDER_LOADis empty andTREE_MUTATINGfiles sit in the exclusive k = 1 shard; on the real seed at 10 shards x 4 jobs each shard's largest group matches sum/4, so a seed-accurate run raises no false warning. A very imbalanced shard (for example one 60 s file plus three 1 s files) or a futureSLOW_UNDER_LOADentry would warn falsely. Follow-up: carry a per-shard expected wall time in the plan at--ci-plantime from the same packer plus the serial sum.ciHealthSummary). It runs beforeverifyFreeCiResultsrejects a result whosejobsdisagrees with the plan, so only the diagnostic of an already-failing run can be misleading. Follow-up: use the result'sjobs.elapsedMswith sum/4.Exploratory QA
Functional smoke on
shardOverruns/overrunWarning(2 probes, both pass, verdict pass): a 4-job shard at 160 s vs 100 s warns withacross 4 parallel jobswhile 140 s does not;jobs: 0and a missingjobsfall back to serial with no divide-by-zero, the 30 s floor still applies, and a 40 s shard split 4 ways that takes 40 s warns. Limits:ciHealthSummaryend to end is covered by the committed unit test, not probed; the serial tail was not probed (SLOW_UNDER_LOADis empty).Issues
Fixes #3851
Refs #4051
Verification Results
No plan is bound to this branch, so there are no Step 8.1 obligations to verify.
TODOS
No TODO items completed in this PR.
Documentation
Scope: the committed diff against 8d7091a (the free-CI shard-overrun prediction now accounts for split shards). Nothing was staged, unstaged or untracked.
Result: current.
docs/TESTING_INTERNALS.mdalready says that a shard split by--shard-jobs kis predicted as its serial seed sum divided by k, which matchesscripts/lib/free-ci-health.ts. No other doc covers this behavior.Debt: none.
Test plan
bun run test(free lane): carried from CI run 42249997890/1 at tree b51619a4dd6f, 1613 filesgstack-pregate --allow-repo-commands: pass (secrets, strays, literals, timing, guards typecheck/module-size/conflict-markers, 24 of 24 selected files reused from the CI run)bun test test/free-seed-ratchet.test.ts test/shard-jobs.test.ts test/test-free-shards.test.ts: green before /ship (focused files, all cases);bun run typecheckclean