let the test suite run as a shard so CI can split it across jobs #1945
All Vouch review confidence checks passed
Residual risk 0.38 = Change Risk (0.43) × (1 − Review Confidence (0.11)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 362 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 7% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.353
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #1945"
general
weight: 0.35
copilot-pull-request-reviewer[bot]
run-tests.sh --shard=I/Nruns every Nth test, so the suite can be split across parallel CI jobs. Opt-in: without the flag nothing changes.Measured on
features types basics(147 tests):| run | wall |
| --- | --- |
| unsharded | 77.5 s |
| 4 shards, in parallel | ~19 s each |
The four shards came to 37 + 37 + 37 + 36 = 147, exactly the unsharded total, so the partition has no gaps or overlap. Round-robin rather than contiguous blocks keeps them balanced, since neighbouring tests cost about the same. Default run still prints
== running 147 tests on 6 parallel workers ==with no shard note and the same 147 passed.Why sharding, rather than tuning the existing run
I measured before changing anything.
Parallelism is already saturated. On a 6-core box, same 147 tests:
|
-j| wall || --- | --- |
| 4 | 77.5 s |
| 8 | 74.9 s |
| 12 | 74.7 s |
3.6% from tripling the workers, so raising
-jin CI buys nothing.The cost is per-test compiler work. A cold build of a small program, from
--time-report=json:| phase | time | share |
| --- | --- | --- |
| cc | 475 ms | 36% |
| codegen | 336 ms | 26% |
| semantic (11 modules) | 240 ms | 18% |
| link | 41 ms | 3% |
| parse + lex | 12 ms | 1% |
The C compiler is already tcc, the fastest option, and
ccis the only part the.salam-buildobject cache can remove.Sharing that cache between tests does not work. Each test builds in its own throwaway job directory. Pointing several tests at one directory looked promising - rebuilding the same file reports
cc: 0.0 ms- but a different test in a warmed directory reportsmodules_built: 11, modules_cached: 0and takes 1.24 s against 1.28 s cold. Different tests pull different module sets and different generic instantiations, so the hit rate is nil. Even a perfect cache would only reach the 612 ms semantic+codegen floor, about 35%.So the remaining lever is wall-clock across machines, which is what this enables.
Two ways to use it
Neither is in this PR - the first touches the release workflow while a release is in flight, and the second is a CI-cost decision that is yours.
1. Shard the release gate.
Validate full test suitetakes 494 s on Linux x86_64 and 859-1076 s on the Windows runners. Four shards would put that near 130 s and 270 s. It needs the gate moved out of the platform build jobs into jobs that download the existingsalam-linuxartifact.2. Run the suite on pull requests.
compiler-release.ymlis the only workflow that runsrun-tests.sh, and its gate is behindstartsWith(github.event.head_commit.message, 'release:'). The suite therefore never runs on a pull request. That is whyuchar_cast,timereport/json,big_struct_valuesand the___chkstk_msfailure all reached a release attempt before anyone saw them. Sharded, a PR-time gate costs about two minutes of wall-clock over four jobs.