Repository navigation
ci-flake: refresh unit-shard wall weights and keep the manifest YAML parse off the CPU guard - #24406
Merged
Merged
Conversation
…parse off the CPU guard Two independent guards tripped on main run 41468678725 (2026-11-02), no pytest failures: 1. Shard 1 wall 730s over the 720s budget. The deal's p90 wall table was five days stale (2026-10-27, PR #23796): 302 files added since were priced at the 1.66s default, including test_batch_vendor_outage_drills.py at a measured 74.7s p90, so the deal leveled on fiction; and shard 1's pyright reservation was under-measured (shipped 90s; remeasured over 16 main runs 2026-11-02: median 96s, p75 100s, max 113s). Regenerate the table from the last 20 main runs (41386368018..41438174663), raise the reservation to the measured 100s (load offset 360->400), and move DEFAULT_WEIGHT to the fresh 1.70s mean. Projected worst shard: 687s, level across all six (702s under the stale table). A perfectly leveled deal still projects ~687s against 720s with about +/-45s observed runner variance, so residual overage risk is structural (the suite has grown past 6 shards x 4 lanes at this budget); the 7th-shard/budget lever stays a deliberate owner decision on card margin50-variable-margin. 2. Shard 6 fast-unit CPU guard: test_prod_binds_no_nllb_translation_endpoint measured 1.03s CPU against the 1.00s limit with all 40 tests passing. The runtime_env.yaml parse under SafeLoader costs ~0.33s CPU locally and ~1s on a CI runner; apply the autouse CSafeLoader fixture that test_backend_runtime_env_validator.py already ships for large manifests (same safe schema, measured 0.044s locally, ~7x cheaper).
There was a problem hiding this comment.
1 issue found across 3 files
Confidence score: 5/5
- The phase comment in
backend/scripts/run-unit-ci.shstill says shard 1 pays ~90s, while the runner models typecheck at ~100s. Update the comment so the CI tuning documentation stays consistent.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="backend/scripts/run-unit-ci.sh">
<violation number="1" location="backend/scripts/run-unit-ci.sh:126">
P3: The runner now models typecheck as ~100s, but its later phase comment still says shard 1 pays ~90s. Update the stale comments so CI tuning documentation stays consistent.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| weight = {path: measured.get(path, DEFAULT_WEIGHT) for path in paths} | ||
| load, count, assigned = [0.0] * total, [0] * total, {} | ||
| # Only shard 1 runs the type check when CI fans out (see below): its ~90s of | ||
| # Only shard 1 runs the type check when CI fans out (see below): its ~100s of |
There was a problem hiding this comment.
P3: The runner now models typecheck as ~100s, but its later phase comment still says shard 1 pays ~90s. Update the stale comments so CI tuning documentation stays consistent.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/scripts/run-unit-ci.sh, line 126:
<comment>The runner now models typecheck as ~100s, but its later phase comment still says shard 1 pays ~90s. Update the stale comments so CI tuning documentation stays consistent.</comment>
<file context>
@@ -123,11 +123,13 @@ if os.path.isfile(table):
weight = {path: measured.get(path, DEFAULT_WEIGHT) for path in paths}
load, count, assigned = [0.0] * total, [0] * total, {}
-# Only shard 1 runs the type check when CI fans out (see below): its ~90s of
+# Only shard 1 runs the type check when CI fans out (see below): its ~100s of
# fixed pre-test wall is charged to shard 1's load here (x4 because a shard's
-# wall is its load spread over 4 worker lanes) so every shard finishes level.
</file context>
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
Root fixes for the two CI guards that tripped on main run 41468678725 (2026-11-02, no pytest failures):
Backend unit shard 1 wall 730s over the 720s budget. The deal's p90 wall table (
backend_unit_shard_weights.tsv) was five days stale (2026-10-27, PR ci(backend): rebalance unit shards by wall weight, LPT slices, one typecheck #23796): 302 files added to main since were priced at the 1.66sDEFAULT_WEIGHT, includingtest_batch_vendor_outage_drills.pyat a measured 74.7s p90, so the deal leveled on fiction. Shard 1's pyright reservation was also under-measured: shipped 90s, remeasured over 16 main runs at median 96s / p75 100s / max 113s.DEFAULT_WEIGHT1.66 → 1.70 (fresh mean below the 2s floor).Backend unit shard 6 fast-unit CPU guard:
test_translation_config.py::test_prod_binds_no_nllb_translation_endpointmeasured 1.03s CPU against the 1.00s limit (all 40 tests in the file passed). Thebackend/deploy/runtime_env.yamlparse underyaml.SafeLoadercosts ~0.33s CPU locally and ~1s on a CI runner. This applies the autouseCSafeLoaderfixture thattest_backend_runtime_env_validator.pyalready ships for large manifests — same safe YAML schema, measured 0.044s locally (~7x cheaper). Locally the test now measures 0.15s CPU.Measured evidence
shardbudget/scripts). Typecheck delta: per-run shard-1 overhead minus sibling median, 16 runs with parseable spans.process_time, best of 3): SafeLoader 0.326s → CSafeLoader 0.044s for the 4592-line runtime_env.yaml.test_translation_config.py,test_backend_unit_ci_runner.py,test_workflow_contracts.py— all pass, no fail-limit offenders.Residual risk (owner decision, not this PR)
A perfectly leveled deal still projects ~687s against the 720s budget with roughly ±45s observed runner variance (green-run shard walls 433–698s; the failing run 730s), so occasional overage remains structurally possible — the suite has grown past what 6 shards × 4 lanes fits comfortably at this budget. The 7th-shard / budget-raise lever and splitting the 74.7s
test_batch_vendor_outage_drills.py(runtime_image-split precedent) stay deliberate owner decisions, tracked on cardmargin50-variable-margin.Failure-Class: none
Both guards were measurement-staleness flakes on green tests; no product failure class applies.