Repository navigation
[PR] fix: stabilize Windows CI flakes — verif detect-once solver cache + deterministic #286 migration savedAt (#4140 instances 3&4) - #4269
Merged
Conversation
…eterministic #286 migration savedAt (#4140 instances 3&4) Instance 3 (verif solver-detection flake, red instead of skip): solveSmt2 re-ran the full solver ladder on every call, so a test's guard-probe and its body solves made independent availability decisions; a probe-yes/solve-no flip surfaced as an uncaught throw at the body. Now the decisive solver is cached per process (detect-once): guard-probe and body solves share one stable verdict, and steady-state calls spawn one solver instead of re-walking the ladder (less pressure on loaded CI runners). verif-generic-append-stability now skips (with warning) if the solver is lost mid-test after passing the guard, matching the existing bug3691 idiom, instead of throwing into a red leg. Instance 4 (#286 persist-migration timing flake): the collision test relied on two back-to-back wall-clock writes plus a 1000ms nudge to make A strictly newer than B; under loaded CI the writes can land >=1s apart and flip the winner. Now both files get explicit, well-separated savedAt pins (A newer by a full minute), deterministic regardless of write timing. Test-only; no production behavior change.
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.5075-pr.4269.cda1d97This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr4269.tgz
npm install -g packageInstall instructions are refreshed on each push. |
3 tasks
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.749-master.5e290f2 # this exact build
npm install -g billion-context@master # always the newest merged build
|
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.
Part of #4140 — fixes instances 3 & 4 (the two new flake signatures added to that checklist). Does not close #4140: instance 1 (rmdir race) still has no linked fix, and instance 2 (#4079 egress-fuse) plus instance 5 (
pi-omp-fork-adoptdrain-cancel) are both covered by in-flight PR #3563.查重: 无 — open+closed issue search ("verif solver detection", "#286 persist migration savedAt") plus an open-PR scan (verif/solver/savedAt/persist/migration/4140/detect/windows-ci keywords) found no competing work. Closest verif PRs (#4258 symbolic-port double-wrap, #3861 module kickoff) touch different files/mechanisms.
Instance 3 — verif solver-detection flake (red instead of clean skip)
Root cause.
solveSmt2(verif/solve.ts) re-ran the full solver ladder (cvc5-via-python → z3) on every call with no caching. A test's guard-probe and its later body solves therefore made independent availability decisions; when the probe said "available" but a body solve's fresh detection failed, the body'ssolveSmt2threwno solver availableuncaught → a red leg, or (per the owner's rerun data) a malformed TAPnot ok … # SKIP no SMT solver availableline that falls out of every tally bucket. Either way it violates the KDD #14 contract "no-solver environment auto-skips, never red."Fix.
verif/solve.ts: the first decisive solver is remembered per process; guard-probe and body solves share one stable verdict, and steady-state calls spawn one solver instead of re-walking the ladder (less spawn pressure on loaded CI runners — the load-sensitive flake class). First-decisive-wins semantics are preserved exactly.tests/verif-generic-append-stability.test.ts: each of the three body solves now degrades tot.skip("solver unavailable mid-test: …")if the solver is lost after the guard, matching the existingbug3691:88idiom — so even the residual "probe-yes/solve-no" case emits a clean skip, never an uncaught throw (which also fixes the malformed-TAP-line manifestation).Instance 4 — #286 persist-migration timing flake
Root cause. The collision test wrote A(req=7) then B(req=1) back-to-back and nudged
envB.savedAt -= 1000, relying on real-clock proximity of the two writes to make A strictly newer. Under loaded CI the two writes can land ≥1s apart, flipping the winner →expected 7, actual 1.migrateLegacyIdspicks byenvelope.savedAt >= prev.savedAt(newest wins).Fix (test-only). Both files now get explicit, well-separated
savedAtpins (A newer than B by a full minute), so the winner is deterministic regardless of wall-clock jitter. No production change —src/persist.tsuntouched.Behavior changes (old → new)
verif-generic-append-stabilitywas an uncaught throw → red leg / malformed TAP line. Now a cleant.skip()with a warning. In solver-present environments results are byte-identical (first-decisive-wins preserved); only the degraded no-solver path changes.Verification (local, targeted)
npm run typecheck— green (exit 0).tests/verif-generic-append-stability.test.ts— passes against a real solver (validates the solve.ts refactor end-to-end: detection cache + fast path + full walk).tests/proxy-persist.test.ts— the 会话身份不稳定:credential/upstream 维度导致长会话状态孤儿化(sessions 缺失) #286 migration subtest passes; 5 other failing subtests (debounce/flushSync/id-match) fail identically without this change (sandbox.tmpENOTDIR artifacts) — pre-existing/environmental, not a regression here. Authoritative full-suite verdict = remote CI.Note — sibling verif tests (tracked, not dropped)
The same "unprotected body solve" shape exists in ~7 other solver-gated verif tests (
responses-ingress,conflict-watch,snapshot-render,induction-append-stability,wire-anthropic-roundtrip,wire-google-rebuild-stability,view-latch-discipline). The detect-once cache already removes their primary exposure (independent per-call re-detection). Their optional body-hardening is left out to keep this diff single-purpose; recommend folding it into #3563's Windows-harness sweep or a small follow-up.No new config/env/CLI surface.