Repository navigation
fix(ci): reduce confirmation fixture API startup cost - #4051
Merged
Merged
Conversation
This was referenced Nov 15, 2026
Merged
schlessera
marked this pull request as ready for review
November 16, 2026 15:15
|
This PR's squash |
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.
Closes #2930
What changed
The confirmation fixture replays stable fake API responses through shell builtins after its existing stateful fake produces them once. Candidate responses are invalidated by PR commands; every virtual clock tick updates the clock response before renewal callbacks. Only the cancellation, cap and valid confirmation modes use this path. Failure-injection modes retain the stateful executable.
Why this shape
The maintainer required attributing and reducing fixture cost under controlled oversubscription, with unchanged deadlines. The dominant cost was repeatedly starting the Bun fake
ghhandler for the same four responses during cap-mode renewal. Each call still crosses a real executable boundary. All real local Git operations, remote CAS publications, sixty renewal ticks, authority/proof checks, original assertions, offline boundary, 27-second work deadline, 30-second test cap and owned process/output/scenario joins remain.Proof
Measured source base:
e1ce188d79dd47c88a4478359d38277098444a21. Bun 1.4.4 (38afee6c8), the same dependency state (the named fixture imports repository tooling and runtime built-ins) and invocation wrapper/preload on both variants. Observational timing probes were temporary and are absent from this diff: wall time around each fakeghchild exit, each realGitReservationStore.gitoperation and each scenario. No deadlines, clocks, assertions or scheduling ticks were changed for those probes.Controlled load: test process and all descendants pinned with
taskset -c 0,1; 0, 2 or 6 owned shell busy loops pinned to those same two CPUs give 0×, 1× or 3× oversubscription. Each load owner terminated and joined its exact recorded PIDs infinally. Other CPUs remained available. Runs used:Target: at least 10% margin (2.7 seconds) against the unchanged 27-second work watchdog at 3× oversubscription, i.e. every case at or below 24.3 seconds, for ten consecutive runs. Main: 0/10 pass; repaired: 10/10 pass, maximum 23.062 seconds, minimum margin 3.938 seconds (14.6%). All repaired runs retain all 55 assertions. Each main failure is the explicit work-watchdog refusal, with cleanup joined; no dangling-process or late missing-cwd notice.
Attribution
Representative matched observations, milliseconds;
ghis summed awaited fake-executable time, Git is summed real synchronous Git operation time. Mode totals also include setup, process anchoring and final reads/cleanup, so component totals are not expected to sum to the mode total.The 3× main cap sample is truncated by the watchdog, so it performs fewer operations than the repaired sample. The original full case never reaches valid mode at 3×; a separate original-source diagnostic selecting only valid mode measured 5520 ms total, 2732 ms awaited fake gh and 613 ms Git; its existing valid-mode assertions passed.
Cap-mode operation timings explain the cost rather than attributing a passing retry. Values below are aggregate milliseconds per operation class, from the same samples:
Ten consecutive 3× runs
Restored mutation
After ten repaired runs, restored the complete original fixture cost (the original fake-gh executable, without replay) under the same 3× load. The unchanged named confirmation case failed with
Integration fixture work deadline exceeded; owned cleanup joined inside the 30-second test capat 27,063.59 ms, beyond the 24,300 ms target. Restored the repair afterward; timing probes were then removed. This is the expected watchdog failure, not a module-load or setup error.Local verification
bun run test ./tests/integration-command.test.ts: 20 pass, 0 fail, 1,125 assertions, 41.44 s. Test bodies, assertions, watchdog and cleanup hooks were also compared byte-for-byte with main and are unchanged.bun run test ./tests: 2,041 pass, 64 skip, 158 fail, 203 files, exit 1, 454.15 s. The changed confirmation fixture passed. This is not full green proof.origin/maina9bcdbd6734c1733390570e2a68c10afde3b00a9: 68 pass, 2 skip, 156 fail, exit 1. All 156 failure names match the head run. The confirmation fixture is unchanged between the measured main source and this control revision. The remaining two head failures were missingzipfor artifact seeding; that tool became available between observations and those cases passed in the control. No source flake/regression claim follows from that environment change.EDQUOTon two native SDK archives. The initial dependency-absent root attempt was stopped before that install; its module-load errors are not behavioral proof. No gate or assertion was weakened.bun run check:pr --base origin/main: passed, including 656 fast-invariant tests across 25 files, 0 failures. Its exact printed receipt is below. The PR head isb17b174bd91af671a3d7e7905a12802285b0dc6c; the branch's merge base is the measured main revision above. The later main change concerns Claude title context, with no confirmation-fixture change.b17b174bd91af671a3d7e7905a12802285b0dc6c, planned basea9bcdbd6734c1733390570e2a68c10afde3b00a9. Verified the actual head checkout and aggregate:verifyand all four selected unit shards succeeded, covering 656 tests across 25 files. On pinned Bun 1.4.2, unit shard 1 ran the completetests/integration-command.test.ts: 20 pass, 0 fail, 1,125 assertions; the named confirmation case passed in 5,219.10 ms. Pack/runtime/runtime_host/browser/layout/captures/endurance were planner-unselected and intentionally skipped. This covers the requested selected fixture verification; it does not reclassify the separate environment-limited full local root run as green. Draft feedback remains diagnostic, not candidate confirmation.{"version":1,"kind":"brain-check-pr-receipt","head":"b17b174bd91af671a3d7e7905a12802285b0dc6c","base":"origin/main","mode":"focused","startedAt":"2026-11-15T20:59:48.571Z","finishedAt":"2026-11-15T21:02:03.220Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":20802.145070000002},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":157.8844140000001},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":125.68123600000399},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":17.139818000003288},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":113519.774584}]}Checklist
0.45.0read back.Anything left open
Ready for the orchestrator's candidate confirmation and landing. The existing exact-head local receipt remains unchanged; main advances inspected since its run do not change the fixture or files under
scripts/. PR and issue milestones were read back as0.45.0; the claim is retained.bun scripts/collisions.ts --json --pr 4051refreshed for headb17b174bd91af671a3d7e7905a12802285b0dc6c: 14 closure overlaps ontests/integration-command.test.ts(typecheck/unit) with #3056, #3059, #3622, #4002, #4018, #4028, #4038, #4041, #4046, #4050, #4057, #4060, #4064, #4065. No direct path or unknown collisions.