Skip to content

perf(ci): overlap token rotation and reuse server integration builds - #1072

Merged
athvin merged 4 commits into
mainfrom
perf/server-ci-scheduling
Nov 9, 2026
Merged

athvin merged 4 commits into
mainfrom
perf/server-ci-scheduling

Conversation

@athvin

@athvin athvin commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Closes #1071

What

Overlap the real token-rotation wait with the early server integration slice, and run every server integration case in those two existing jobs. Preserve ordered Cargo output and normal compiler-cache keys in the free-runner experiment.

Why

After optimizing DuckDB, server integration became the backend critical path. Its late slice waited 61 real seconds near the end, while server-rest rebuilt the server in a second feature graph. The first ARM experiment also exposed measurement attribution errors despite passing tests.

Proof

make check passed locally after refreshing onto 83ffb0a7. Both real Postgres/DuckLake slices passed locally with exact coverage matching the original 137 integration results (135 passed, two existing ignored). All 62 CI helper tests, actionlint, workflow-shell and skills gates passed. The full hosted backend gate passed in 3m51s. The selected-package runner passed with 1,051 correctly attributed results. Both real-service slices passed again on 83ffb0a7, with the same 137 exact name/status results.

Risk & rollback

Only the token-rotation test runs in a separate process; it owns its database and HTTP listeners. Its real clock, production refresh floor and assertions remain intact. Normal required jobs stay on free x86 GitHub runners. Revert this PR to restore scheduling.

Post-merge ledger

Closed by: Codex · session Codex:01a1bef1-8627-7c21-8a86-6c4743d8906f on Mac-46 · 2026-11-09T23:22:21Z

  • main is green with this change on it — blocked — backend run 42717888857 passed on merge 50de124e in 4m09s (249s); all 137 integration identities/statuses match local and PR results. Infra and devcontainer passed. Frontend 42717888912 remains red after one failed-shard rerun: the unchanged mobile-Safari marketing volume test fails at line 48. Attributed outside this CI-only diff and tracked in Stabilize marketing audit and volume interaction tests #1074; do not describe the whole pipeline as green.
  • images — n/a — only CI workflows, CI helpers and the profiling reference changed; none matches images.yml push paths.
  • deploy — n/a — no image or deployment inputs changed, so no rollout is triggered. The earlier native-profile change was deployed and verified under perf(ci): optimize DuckDB test execution and eliminate redundant builds #1066.
  • the push-only surface no pull request can pre-test — corrected main-only runner experiment 42718540424 passed all six jobs. No deploy/image inputs changed; latest drift 42637742835 and kind 42575735163 were green, with no new applicable scheduled run during this watch. The unrelated frontend failure is recorded above.
  • the board card — Overlap server integration waits and preserve compiler-cache measurement fidelity #1071 closed through the merged PR and Product Roadmap reports Done; no manual status move.
  • follow-ups — Measure CI and deployment latency over 20 post-rollout runs #1036 tracks the 20-run median/p95 after rollout; Stabilize marketing audit and volume interaction tests #1074 records the unrelated paused marketing-audit browser flake observed here and passed on unchanged-code rerun.
  • what was learned is written down — the committed backend-ci-profile.md records profiling, local validation, exhaustive integration coverage, archive/storage decisions and the 3m51s hosted run; it links this ledger for the final 4m09s main result and corrected hardware verdict.

Specific to this change

  • First complete hosted backend run 42715632742 passed in 3m51s versus the preceding merged 4m56s (22.0% faster), or 53.0–55.0% faster than the original 8m11–8m33. Server early / late / rest jobs took 184 / 201 / 112 seconds; both server builds had 100% cache hits and all 137 integration results were retained. Main confirmation follows after merge.

  • Corrected six-job free-runner comparison: 42718540424, all six jobs passed first attempt on 50de124e. Each had 1,061 identical attributed results, identical compiler/version and coverage digest, zero warm Rust/native misses and zero cache errors. x86 samples 131.557 / 131.230 / 142.074s, median 131.557s; ARM 118.782 / 114.897 / 115.751s, median 115.751s (12.01% faster for this selected-package build/test gate). This falls below the predeclared 15% migration threshold and is not a full-backend ARM result; retain existing free x86 runners. x86 priming also reused every Rust/native object from normal CI; ARM priming populated previously missing Rust objects. Do not compare unlike priming cache states as a hardware benchmark.

  • Main performance confirmation: 4m09s, versus preceding merged 4m56s (15.9% less elapsed time), and original 8m11–8m33 (49.3–51.5% less elapsed time). Together with the full PR run at 3m51s, report approximately four minutes, not a p95 guarantee. Server early/late/rest walls 188/227/142s; early/late execution 67.273/110.460s, both with zero compiler-cache misses.

  • Local disposable Postgres/RustFS containers and temporary read-only kubeconfig removed; profiling data, logs, symbols and interactive flame graphs retained in /tmp/er-backend-profile-evidence.

Context — coverage and measurements

Follow-up to #1066. That change reduced full backend runs from 8m11–8m33 to 4m42/4m57/4m56 without dropping coverage. The committed backend-ci-profile.md reference contains the profile methodology, alternatives and measurements; final hosted observations are recorded in this ledger.

The runner builds one exact er-server integration artifact, discovers every test and partitions the complete list. Missing services, missing or ambiguous artifacts, a missing rotation anchor, invalid lists, compile errors and failed children fail the gate. A subprocess barrier test proves both early processes start before either waits. The CLI/entity-diff package tests remain unfiltered because their database test names do not all start with pg_. Server lib/bin/doc coverage remains in the ordinary selected-package gate.

Original local early/late/rest execution took 61.523/154.354/10.290 seconds. Final new slices took 62.863/50.842 seconds and exact name/status lists matched all 137 original results. Workstation contention means these are correctness evidence, not a reliable hosted speedup estimate. Hosted full-gate measurements decide adoption.

The initial hardware trial passed all actual tests but two ARM machines rejected misattributed target identities: stderr Cargo headings overtook buffered stdout test output. Merge both streams before relaying and test their ordering. Remove explicit CARGO_TARGET_DIR/CARGO_TERM_COLOR because sccache hashes them even with the normal target path. Guard against a nonstandard environment before deleting only the disposable hosted checkout target. No normal runner architecture changes here.

The fresh optimized compile-once/archive experiment passed 45 jobs with identical coverage, but including producer/transfer cost its median was 202s versus 178s for existing cached builds (13.48% slower). Retain separate builds. Local disk/tmpfs Postgres trials showed no repeatable benefit; preserve ordinary storage and bootstrap coverage.

@athvin
athvin force-pushed the perf/server-ci-scheduling branch from aecf392 to 03c9f03 Compare November 9, 2026 23:03
@athvin
athvin merged commit 50de124 into main Nov 9, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Overlap server integration waits and preserve compiler-cache measurement fidelity

2 participants