Repository navigation
fix(oracle-gaps): no wall-clock cut decides an outcome - #99
Draft
KyleAMathews wants to merge 102 commits into
Draft
KyleAMathews wants to merge 102 commits into
KyleAMathews wants to merge 102 commits into
Conversation
…s not wait Determinism under load (2026-11-13): a run's outcome must not depend on how long a run took. A constructed history, "a slow owner's kill and another owner's kill", has one mutant that file a's random-route test and file b's fixed-seed test both kill. Its driver also runs the slow twin: the same package, where a's test waits 3 s past its first budget wherever the output differs and then judges as before. The law compares the two reports, `randomAlso` included. On main, a's slow copy is cut at its first budget and queued for a confirmation, b's kill decides the mutant first, and a's random failure is never recorded: the twin reports `randomAlso: false` where the package reports `true`. `slowTwin` is constructed-only (no generated history draws it; `histories` takes it back without it). Co-authored-by: Isaac <no-reply@databricks.com>
…t, and a timer under load Deterministic cuts, option A (register M, 2026-11-14): no wall-clock cut decides an outcome, so a mutant's copies are judged by count, not by time. Three laws are added to the end-to-end oracle, each RED on the parent commit before any production change. - The budget witness w_slowpair becomes a work-budget witness: its two owners' tests call the function PAIR_LOOPS times where their output differs. Each copy stays inside its call budget, the two together pass the mutant's work budget (WORK_FLOOR), so the mutant is a timeout by count, whatever the clock says. The model judges the budget in owner order, a kill before the budget runs out still deciding. - A slow kill whose test waits 16 s, past Vitest's 15 s per-test limit, is killed: no limit that the CLI leaves to Vitest decides the outcome. - A copy whose test starts a timer, spins under load, then waits for the timer, is killed and never cut as idle (the idle law is state, not time). Constructed-only test fields (slowMs, loops, busy) are held by the drawn test record at neutral constants and taken back to them by the histories' map, so no generated history draws them (generator rule, 2026-11-14). The constructed histories are appended at the end of the list, and the slow owner's history moved there from the middle of it. Co-authored-by: Isaac <no-reply@databricks.com>
…he work budget The first RED (9412eac) lets each copy of w_slowpair make 37,500 calls beyond its first. At three site evaluations a call that is 112,500 per copy, past the 100,000 call budget, so main cuts each copy by count and the mutant is a timeout on either side; the work law is not reached. At 30,000 calls a copy makes 60,000 to 90,000 site evaluations, inside its budget, and the two copies together pass the work budget, so main must report survived. Co-authored-by: Isaac <no-reply@databricks.com>
…-clock budget Register M entry "Deterministic cuts, option A" (2026-11-14): no wall-clock cut decides an outcome; a mutant's budget is a work count, and the wall-clock budget is only a backstop that reports a gap. The model's wall-clock clause (two budgets: a slow owner file's confirmations past --mutant-limit predict a timeout) is removed as the repair the M entry requires. This is not a model change to match production: the clause's authority is the retired confirmation path, and the M entry retires it. Consequence, a RED on main: the constructed history "a slow kill past Vitest's 15 s limit" (a 16 s wait where its output differs) now predicts `killed`, and main reports `timeout` for it, because main's confirmation is cut by the mutant budget at 15 s (diagnostic on a scratch branch: the copy's outcome is "run time limit", not Vitest's "Test timed out"). Also: a test that awaits its busy witness is async (the emitter marks it so), so the baseline loads. Co-authored-by: Isaac <no-reply@databricks.com>
…states are listed apart
Register M entry "Deterministic cuts, option A" (2026-11-14), with the
coordinator's ruling 3 (fallback): a test that Vitest's own limit ends
("Test timed out") is reported as a backstop gap, like a timed-out run. It
is `timeout` after any kill, and it never keeps a kill from deciding. The
previous rule read a Vitest timeout only when every failing test had one,
so a timed-out test beside a verdict-less failure was `crashed`, and a
timed-out test beside an unregistered kill was not a timeout at all. The
`every` branch and the `!timeout` filter are now redundant and removed.
Law: a run's outcome does not depend on how long a test took (determinism
under load); a clock limit may only report a gap.
RED: the classify oracle on the parent classify.mjs (HEAD before this commit,
built from the same fixtures) fails with "mutant m0: unregistered-kill, owed
timeout", and the parent's crashed/timeout split fails the same law.
Mutant: timeout checked before the kills (scratch copy): the classify oracle
fails, "mutant m0: timeout, owed killed"; the mutant is rejected.
GREEN: the classify oracle passes (276 tests). The model counts a timeout
message only in a file that loaded, as production does (a file that fails to
load gives no tests).
The e2e oracle's states "a slow owner's kill reported as when it did not
wait", "a slow kill past fifteen seconds killed" and "a copy waiting on a
timer under load killed" are listed as separate: they have their own
histories, so "every outcome class" must not enter them.
Co-authored-by: Isaac <no-reply@databricks.com>
Register M entry "Deterministic cuts, option A" (2026-11-14). A copy runs until it finishes, goes idle, or spins; the only wall-clock limit is a backstop that reports a gap and never decides a kill. - No first budget and no confirmation: a copy runs once, to its end, under the backstop limit (hang-limit plus three seconds per second of the file's unmutated time). The cut marking and the confirming run are removed. - G1 becomes a work budget: a mutant's copies, summed in their owner files' report order, may do at most max(WORK_FLOOR, 10 x the owners' unmutated calls) site evaluations (WORK_FLOOR = CALL_FLOOR, 100,000). Past it, the copy that crosses and every later copy is a timeout, so a kill among them does not count. This is deterministic because the work is a count; the owner order is the report's, not the completion order. - The wall-clock mutant budget (--mutant-limit) is a backstop checked after all copies: no kill and elapsed over budget is a timeout; it never decides a kill. - Defaults (coordinator rulings, 2026-11-14): --hang-limit 60 s, --mutant-limit 180 s, --test-timeout 65 s (hang-limit plus 5 s). Cost to state: an unmutated hang that no CLI limit cuts now fails after 65 s, not 15 s; under option A an idle hang is cut by `no progress` in about 500 ms, so only a busy hang with no instrumented site waits for the backstop. - --first-limit is validated and retired: it prints a note and changes nothing. - A test that Vitest's own limit ends is a backstop gap (classify.mjs; its RED and mutant are in the prior commit, 4b063c8). Correction to 4b063c8's message: that message said the parent's crashed/timeout split fails the classify oracle. I did not run that case. The verified RED is the one in 4b063c8's body: the parent gives "unregistered-kill" where the model owes "timeout". Co-authored-by: Isaac <no-reply@databricks.com>
… in the test The counter-witness (register, 2026-11-13 "Determinism under load"; the 2026-11-14 entry "Deterministic cuts, option A") was a copy whose test spun for 600 ms and then waited 2 s on a timer. Its spin kept event-loop utilization above 5%, which alone keeps a copy from looking idle, so the timer check never mattered: mutant 2 (elapsed-only idle, the timer checks disabled) passed the witness. The witness now waits on one timer due 3 s out, inside the horizon, with nothing else in the test. A copy with its timer pending is never idle; only that check stands between it and an idle cut. A loaded variant, if wanted, is a CPU hog outside the worker. The state is "a copy waiting on a timer killed"; the constructed field is timerWait (a constructed-only test field, taken back to null; no generated test draws it). Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com> # Conflicts: # packages/oracles/oracle-gaps/gap-report-model-oracle.mjs # packages/oracles/oracle-gaps/gap-report-oracle.property.test.mjs # packages/oracles/scripts/pr-shards.mjs
|
| Name | Type |
|---|---|
| @tanstack/oracles | Minor |
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
… copies Register C entry "Deterministic cuts, outcome rule (under M option A)", 2026-11-14: a copy cut by a clock or by its call count ends the mutant's copies; no later copy runs. The model now predicts that: a copy that spins (a count) stops the owner files after it, so a later owner's kill does not count and the outcome is a timeout. Witness: a constructed history whose one function spins in the mutant (the until loop of w_spin) with two owners, a and b. Owner a's copy spins first; owner b's judging test would kill. Production (main at this commit) runs b's copy after a's spin and reports killed. The model owes timeout. RED: on this commit, the new witness fails (the CLI reports killed where the model owes timeout; pool run dc-rule-red-*). Limits: the model's rule covers copies cut by a count; a wall-clock cut (the backstop and Vitest's limit) is a backstop gap under the same rule, and its own witness is pending (finding 4, the H1 witness). Co-authored-by: Isaac <no-reply@databricks.com>
…ant, uncharged Register C entry "Deterministic cuts, outcome rule (under M option A)", 2026-11-14: only counts and states decide a mutant's outcome. - A copy cut by a clock or by its call count (its own timeout, or Vitest's "Test timed out") is never charged, and it ends the mutant's copies: no later copy runs, and a kill among later copies does not count (review B2). - A copy's work is the calls of its deterministic, unclocked tests (`baseline.work`, classify.mjs), and the owner files' most-working tests set the budget and the call budget (review B3). - The mutant-level elapsed-seconds backstop is removed: it summed cached units' stored seconds, so a daemon reuse could differ from a cold run (review finding 3). Each copy's own wall cut remains the backstop. Whether --mutant-limit still has a role is open (it now only affects identity). - Model: a copy cut by a count or a clock ends the owner files (no later file runs), so the model owes the same outcome. Witness: a constructed history with two owners, each making 30,000 extra calls; owner a's copy is under the budget, owner b's would kill but passes the budget, so the mutant is a timeout by count. The reversed-sum mutant (review H2, 968bfd7) is the mutant it must fail. Not witnessed here: a spin in an earlier owner ahead of a kill in a later one. A spin witness was tried first and removed: the later owner runs the same spinning function, so it spins too and never kills, and the witness passed on the parent. Finding 4's backstop witness (H1) is pending. Co-authored-by: Isaac <no-reply@databricks.com>
…r copy, wall cuts end the mutant Register C entry "Deterministic cuts, outcome rule (under M option A)", as refined by the coordinator: a copy ending in "no progress" (a state) or a spin past its call budget (a count) is a deterministic timeout for that copy. It is charged nothing (the rows of a cut copy are not kept, and the per-copy call budget already bounds it), and the next owner's copy still runs, so a later kill decides. Only a wall-clock cut (the CLI backstop, or Vitest's "Test timed out") ends the remaining copies, as a backstop gap that is never charged. - Model: runsOf tags each cut with its kind (wall, count, state); judge ends the owner files only on a wall cut. - Check: spin and idle copies settle with spin or idle set; cutByTime covers wall cuts only. - --mutant-limit is retired (validated, noted, changes nothing); the driver no longer passes it. - Constructed history "a backstop cut ends the copies ahead of a later kill": owner a's copy waits past a 2 s backstop; owner b would kill, and does not run. The state "a backstop cut ends the copies ahead of a later kill" is entered. Open: "a declaration fault: noTypescript" (shard 3) streams 161 gap lines where the model expects 159; a per-mutant check is pending. It is a model and CLI disagreement, not a duplicate line (the scratch diagnostic found no repeated line). Co-authored-by: Isaac <no-reply@databricks.com>
…ot in scope there) Co-authored-by: Isaac <no-reply@databricks.com>
…p, never a silent one Review finding 5 (register L8). The 10 s close waits in closeContexts and in replace continued silently after a close was still pending. Now each close waits up to the 60 s backstop; a close still pending is an error that names the backstop gap, and no replacement is warmed while the old context is still closing. Closes that finish are unchanged. Witness: none. A pending close needs a context whose close never settles, which costs 60 s per run; it is a limit of this change (the coverage is by inspection of closeWithin and its two callers). Co-authored-by: Isaac <no-reply@databricks.com>
…oes idle Owner a's copy now awaits a promise that never resolves, while a repeating timer stays due inside its horizon, so the copy is never idle and no site spins. Only the backstop cuts it, on every machine. The witness no longer depends on whether a 12 s wait lands inside the backstop band (register 2026-11-14, outcome rule item 5). Co-authored-by: Isaac <no-reply@databricks.com>
…ress, or work budget A copy's cut is now recorded as its cause and carried into the mutant's timeout detail, results.json, and the gap line (cause: ...). The model predicts the cause of each timeout: a backstop cut (a wall-clock limit), a spin past the copy's call budget (a count, outcome rule item 4), no progress (a state), or the mutant's work budget. The model had no per-copy call budget, so the work-budget history's 4-sites-per-call mutant was a spin and not a work-budget timeout; the model now predicts that. ORACLE_GAPS_PROFILE rows carry each copy's cause, its file's measured time, its limit and its duration. RED: the e2e oracle, with the cause predicted and production unchanged, fails on the backstop history (its timeout is cut by run time limit). Co-authored-by: Isaac <no-reply@databricks.com>
…s as constants The deterministic-cuts constructed fields are constants in every drawn record, so no draw changes: the tests line hashes the records without them and is main's (e9029433a23d1f10). slowMs, loops, timerWait and pulse each get a line after the others, with its neutral value checked on every generated test, and hangMs is a drawn constant (null where generated) with its own line. The constructed histories #99 adds are appended after main's 26, by name and index. Co-authored-by: Isaac <no-reply@databricks.com>
…e current cuts --help and the index header give the defaults (--test-timeout 65000, --hang-limit 60000) and mark --first-limit and --mutant-limit retired. The README, the changeset and the e2e law 4 text describe the backstop, the call and work counts, and the cause each timeout names. Stale states and names are renamed (confirmations, the first budget, the 15 s limit): a slow kill after a 16 s wait, and a mutant's copies past its work budget. MUTANT_LIMIT_MS, unused, is removed. The determinism twin is described as a determinism check: it passes on its parent, so the outcome rule's RED is the classify oracle's. Co-authored-by: Isaac <no-reply@databricks.com>
… and counts The README's gap section and the changeset's bullet describe the counts and the backstop, the cause each timeout names (on the gap line too), and the retired options, in place of the confirmation budget. The classify oracle's gap-line law (in bfca29a) accepts a timeout's cause suffix. Co-authored-by: Isaac <no-reply@databricks.com>
Resolves the constructed list (main's 29 histories first, then the five #99 histories at 29 to 33), the drawn record (main's pauseEngages and warmReplaced, then hangMs), the take-back, the limits text (main's Windows notes, with #99's work-budget wording), and the shard lists (#99's histories in shard 4, main's test.projects line in shard 5). The fingerprint canary passes. Co-authored-by: Isaac <no-reply@databricks.com>
…; the Windows shards list the new histories The constructed backstop (hangMs) is a drawn constant now, so its take-back returns the drawn value (null), which the arbitrary can take back. The fixed-seed shards of main are kept as they are: the new histories fall into the Linux rest shard, and the Windows partition, which is exact, lists them in shard 10. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
…n the CLI arguments Co-authored-by: Isaac <no-reply@databricks.com>
…'d timer An unref'd timer is not among the process's active resources, so only the copy's own pending-timer record keeps it busy (the idle rule, held state, M 2026-11-15). The witness is a constructed history of its own; the reach state is recorded. Co-authored-by: Isaac <no-reply@databricks.com>
…dition A copy is idle when no counted timer is due within its horizon, no timer is listed beyond its test's base, and no I/O handle is open (M entry 2026-11-15). Sample lateness and the event loop's utilization no longer reset the window: a busy synchronous or microtask loop blocks the sampler, so it cannot look idle. The held-state witnesses (a copy waiting on a timer, ref'd or unref'd) keep the copy busy, and the mutants that ignore a due timer are killed. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
…ef'd timer history The e2e shard check named the removed history 'a slow kill past Vitest's 15 s limit' and had no shard for the unref'd timer history, so CI's test:oracle-gaps:shards failed. The check now partitions the e2e tests exactly. Co-authored-by: Isaac <no-reply@databricks.com>
commit: |
… wall-clock cut With the idle rule decided by state (M entry, 2026-11-15), a timer due beyond the copy's horizon does not keep it busy, so it is idle and cut as no progress. The model's wall-clock cut for such a wait was stale; the load experiment's 12 s copies gave the same outcome on three repeats under a concurrent run (the model owed a backstop cut). Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
… 655 s) Run 45196802964 (86afd01) measured determinism 7/7 at 655 s, the one job over the 10-minute limit. Its 15 units summed to 638 s, of which the constructed unit "a later owner's test listed first beside an earlier owner's hang" was 166.6 s, the rest shard's largest after the two witness halves. Naming it in shard 1 (318 s of units) moves it out of the rest shard. Estimated: 7/7 about 8 min, 1/7 about 9 min. `pr-shards.mjs check` and `e2e-shards.mjs check` pass. Co-authored-by: Isaac <no-reply@databricks.com>
…nd as a backstop (RED, K21) Constructed history from the #184 seed -606020990 ("a stale authored mutant and a reformat"). Its flaky owner test calls the function 30,000 more times where the output differs. The copy is under the call budget, so it must finish and its owner's kill decides. Production cuts it at the e2e backstop (20 s) and reports `timeout`, owed `unregistered-kill`. Law: K21, maintainer ruling 2026-11-23 ("Backstops are fine, set high"): the backstop is set above the slowest legal copy, and a backstop cut in a constructed or generated history is a defect. RED: fixed seed 20261105 "a flaky owner's loop calls under the call budget" fails with `src/sut.ts:C1.run:35:delete-call#0: timeout, owed unregistered-kill`. Co-authored-by: Isaac <no-reply@databricks.com>
…py's budget (F1, K21) Law: a test excluded from judging still runs, so its calls count toward the call budget (#176 F1). Production's `mostCalls` takes every non-background row, flaky rows included, and a copy's spin counts every call it makes. The model's runsOf dropped flaky tests before counting, so it never saw their 30,000 loop calls. Change: flaky tests keep their runs, with no verdicts, no hang, and no charge to the work budget (production charges only deterministic rows). A spin on such a run is a gap, since its count could not be separated from the clock (production's countOnly). The model now matches production's spin. Evidence (Law / Reach / RED / GREEN / Mutant / Limits): - Law: F1 (#176), register 2026-11-23 K21 ("Backstops are fine, set high"). - Reach: constructed "a flaky owner's loop calls under the call budget" (seed -606020990 history, appended last, reach state declared). Generated histories with a flaky test that has loops reach it by the history's fields. - RED (cf0bd37, before this commit): fixed seed 20261105 fails with `src/sut.ts:C1.run:35:delete-call#0: timeout, owed unregistered-kill`. - GREEN (this commit): the constructed unit passes; seed -606020990 "random seed: a stale authored mutant and a reformat" passes; seed 2027172067 "random seed: generated" passes (GAP_E2E_SHRINKS=0). - Mutant: the pre-F1 model (flaky tests excluded), restored from HEAD: the constructed unit fails with the same Difference. - Limits: the cut is a count spin (`cause: spin`), not the backstop; the 20 s backstop is not the cause and is not changed. The full e2e suite runs in CI. Co-authored-by: Isaac <no-reply@databricks.com>
…test's run never judges work (B1, B6) B1: the flaky-loops constructed units (cf0bd37) were in no shard, so both `e2e-shards.mjs check` and `pr-shards.mjs check` failed. They go in e2e-4 and in the Windows fixed-seed shard 3. Both checks pass. B6: inertFlaky kept `rose`, so a flaky run could classify a survivor as `extra-work` (judgesWork does not exclude flaky tests). Production judges work only from baseline.work (classify.mjs:447-450), which excludes flaky rows. The flaky run now sets `rose: false`. Witness: not reached by a history (reach not measured); the fixed flaky unit and seed -606020990 still pass. Authority: M "Count-only kills" (2026-11-16), M 2026-11-13 (flaky reads the clock), and the 2026-11-23 C entry "An excluded test still runs" (awaiting ratification). Co-authored-by: Isaac <no-reply@databricks.com>
…e oracle's limits (N1, N2) The model leaves flaky tests out of hangs and of judgment (a generator narrowing). An excluded test still runs (M, register 2026-11-23): its calls count toward the call budget and its runs judge nothing. A flaky no-progress hang is judged as finishing while production kills it (L1, owner #149), and no oracle sees it. This repository has no coverage map, so the limit lives in the oracle's own `limits`. Co-authored-by: Isaac <no-reply@databricks.com>
…n (B2, removed before merge) Co-authored-by: Isaac <no-reply@databricks.com>
…r's hang under four contexts (B4) Law: a mutant's owner copies run in sorted owner order, and the first kill decides (register 2026-11-14, "Deterministic cuts, outcome rule"; G44, O13). Production takes the owners by path (classify.mjs targetsOf). Finding: the requested mutant, which drops only the targetsOf byPath sort, is equivalent. passOf (classify.mjs) sorts units by file before their rows join the baseline map, so reachedBy is already in path order on every run, and targetsOf's sort is redundant. No history can separate the two orders for that mutant. Dropping both sorts makes the copies run in context-join order; that mutant is non-equivalent. Witness: w_hangpair, owner files p (hangs where it would judge) and q (kills), in a constructed `pair` witness mode that the generator never draws. Four contexts join q ahead of p, so the sorted order and the join order disagree and the verdict changes. Shards: e2e-4 and the Windows fixed-seed shard 3. Law: copies run in sorted owner order (G44, O13; register 2026-11-14). Reach: state "an earlier owner's hang killed by no progress before a later owner's kill": 1 constructed history (reach ledger, fixed seed 20261105); 0 generated, because the generator never draws the pair mode. RED: scratch mutant (both sorts removed, uncommitted) on the unit "fixed seed 20261105: a later owner's kill joined before an earlier owner's hang under four contexts": "Difference: src/sut.ts:w_hangpair:34:if-false#0: killed by a behavioral law, owed no progress". The classify oracle also fails 18 units under the same mutant. GREEN: the same unit on this commit, unchanged production: 1 passed, about 3 s; the random and determinism units pass (4 s and 5 s). Mutant: requested mutant (targetsOf sort dropped only) survives the unit and the classify oracle (291 passed): equivalent, as above. Join mutant (both sorts dropped): rejected by the unit and the classify oracle. Limits: generated histories never reach the pair mode, so the state has no generated reach. The full fixed-seed campaign (377+ units) was not run here; CI covers it. Only one owner order (sorted over join) is exercised, with four contexts. The requested first-appearance mutant is an equivalent mutant and is not killed. Co-authored-by: Isaac <no-reply@databricks.com>
… order The classify oracle listed a mutant's verdict tests before its cut tests, so a gap could name a later file's test ahead of an earlier file's cut test. Report order (law 7) is by file path, then the file's own order, for every list a result names. Production (classify.mjs) already does that; the model now does too. Law: report order (law 7 of oracle-gaps.report-classify; register "Report order" in classify.mjs, and the model's own "in report order" comment). Reach: constructed history "an unregistered kill whose cut test is in an earlier file" enters the new state "unregistered-kill named in report order" (declared in required). Generated campaigns do not reach it; the state is constructed-only. RED: that constructed unit fails on the unchanged model with message "Register the route of `t0`..." does not name "`it's t0`". GREEN: the constructed unit passes; the full gap-report-classify file passes (294 of 294); CI's random seed 1301071465 path replays green. Mutant: the previous verdict-first concatenation is the RED run above. Limits: the constructed history covers two owner files with unknown routes; a cut and a verdict on the same file, and the authored-mutant owner order (judgedAuthored, which does not sort its owners), are not covered here. Co-authored-by: Isaac <no-reply@databricks.com>
This was referenced Nov 23, 2026
… last (B4) Law: copies run in sorted owner order (register 2026-11-14, "Deterministic cuts, outcome rule"; G44, O13). Production takes the owners by path (classify.mjs targetsOf, passOf). The witness is drawn now, so the generator reaches it, as "Randomness wins" (2026-11-16) requires for a field that changes what runs. Change: the history record gets a drawn field `pair` after `heavy` (true in one of five draws). The model adds w_hangpair to a history with `pair` set and keeps it out of the `true` witness mode. The constructed history sets `pair: true` and `witness: false`. Literal records and the constructed wrapper default `pair` to false, since fast-check requires every record key. history-fingerprint.json gains a `pair` line before `tests.pendingIo` in both lists; the canary passes and every earlier line is unchanged. Context count: already drawn before this change (`contexts`, 4 in 28 of 30). Not moved, since moving it would change later fields' draws. Reach: state "an earlier owner's hang killed by no progress before a later owner's kill". - Constructed: 1 (fixed seed 20261105, reach ledger). Unit GREEN in about 3 s. - Generated, fixed seed 20261105, 2 draws: 0 (no pair draw in the first two). - Generated, fixed seed 20261105, 20 draws (ORACLE_RUNS_MULTIPLIER=10): 0. Two pair draws; one has ownerless=true, which strips owners so the witness is unowned; the other has budget 'one' (unverified as the cause). - Generated, three random-seed units (2 draws each): 0 in each; seeds not printed on pass. - Drawn pair rate: 20%. ownerless (50%) leaves the witness unowned. RED: scratch mutant (passOf and targetsOf sorts dropped, uncommitted) on "fixed seed 20261105: a later owner's kill joined before an earlier owner's hang under four contexts": "Difference: src/sut.ts:w_hangpair:34:if-false#0: killed by a behavioral law, owed no progress". GREEN: the same unit on this commit, unchanged production: 1 passed. Mutant: the requested mutant (targetsOf sort dropped only) survives the unit (1 passed); it is equivalent, since passOf sorts before reachedBy. Shards: e2e-shards and pr-shards `check` pass. Unit times: 2-3 s each. Limits: generated reach is 0 in every sample run here; the drawn dimension reaches only through the 20%*50% pair-owned draw, and a non-ownerless draw did not show the state. The full suite was not re-measured. Co-authored-by: Isaac <no-reply@databricks.com>
Law: no wall-clock cut decides an outcome, and no legal history ends at the backstop (M, 2026-11-23, "Backstops are fine, set high"; I15, R49). The model's rule that predicted a no-progress cut for a finite slow copy (a wait past the backstop plus 6 s) is removed: under the ruling no legal history is cut there. Constructed history (appended last, C-6): a slow kill whose test waits 22 s where its output differs. Its copy terminates under the call budget. The 20 s base gives its horizon less than the wait, so production cuts it as no progress (a kill by state) where the model expects the owner's kill. Reach: "a slow kill after a 22 s wait killed", declared in required and ownHistoryStates, entered by the constructed history only. RED (head f893c81, base 20 s, this commit): npx vitest --run --config oracle-gaps/vitest.config.mjs gap-report-oracle -t "a slow kill after a 22 s wait" fixed seed 20261105: FAIL "src/sut.ts:f0:31:if-false#0: killed by no progress, owed a behavioral law". The hostile mutant is the old 20 s base, the head production; it fails this history. Limits: the base stays 20 s in this commit. Production and the base change in the next commit (GREEN there). Shard placement: e2e-shards and pr-shards check both pass. Co-authored-by: Isaac <no-reply@databricks.com>
…ver stores a backstop cut (B2, K21)
Law: no wall-clock cut decides an outcome; a backstop cut is a gap, and
no legal history ends at it (M, 2026-11-23, "Backstops are fine, set high";
I15, R49). The daemon reruns a unit cut by the wall clock (I8, I12).
Derivation (documented at check.mjs `limitFor`):
- Measured on CI, per-call diagnostic (temporary job, removed before merge),
inside real gap-CLI copies, 100,000 counted calls per repetition, five
repetitions:
Windows (windows-latest): one counted switch call 9.9 to 60.9 ns;
one site evaluation in real clamp code 13.7 to 62.9 ns (2.5 sites
per clamp call).
Linux (ubuntu-latest): see the PR body (measured on its own run).
- Per-site allowance: 63 ns worst, margin 3, 0.0002 ms (SITE_BACKSTOP_MS).
It prices the call budget above CALL_FLOOR: 3 x 100,000 x 63 ns is 19 ms
at the floor, so the fixed base is the whole backstop for a small file.
- Base: 60 s, the fixed allowance for a copy's start and its non-site
waits: three times the longest legal wait the suite draws (16 s),
rounded up. Each file adds three of its unmutated seconds (unchanged).
- The e2e driver's base (FULL_LIMIT_MS) is the production base, 60 s, not
20 s: the 22 s history is legal, and a 20 s base cut it.
- Vitest's per-test limit (--test-timeout) defaults to the base plus 5 s
(65 s, as before), so the two move together.
Daemon: `remember` stores a unit cut by the wall clock no more (the
retention hook still sees every stored unit, L2). A count or state cut is
stored as before (the timed-out spin reuse of R55 (a) is unchanged).
Model: the rule that predicted a no-progress cut for a finite slow copy
(a wait past the backstop plus 6 s) is removed, and the driver's base is
60 s. Authority: M, 2026-11-23.
GREEN (this commit, base 60 s, production and model):
gap-report-oracle -t "a slow kill after a 22 s wait": fixed seed,
random seed and determinism pass (3 passed). The unit's copy finishes
and its owner's kill decides.
Witnesses (the existing edit sequence over the witness module, 12 tests):
pass, so the daemon change keeps the R55 states.
Limits:
- A legal copy whose call budget exceeds CALL_FLOOR by more than the
per-site allowance can exceed the derived backstop: real test code costs
more per site than the cheapest instrumented code measured. Recorded
as a limit for the maintainer (heavy files, 100 times the most calls).
- Vitest's per-test limit is the base plus 5 s; the budget term is not in
it, so an async copy awaiting past 65 s is cut as "Test timed out" before
the backstop. Recorded.
- No witness yet for the daemon's storage change: the oracle has no law
that compares a daemon's reuse counts with the model.
Co-authored-by: Isaac <no-reply@databricks.com>
The diagnostic has measured the per-call cost on both CI runners (run 45219880267): Windows 9.9 to 60.9 ns per switch call and 13.7 to 62.9 ns per site; Linux 10.1 to 56.4 ns and 14.3 to 48.8 ns. The worst of both is 63 ns, which SITE_BACKSTOP_MS uses (63 ns times 3). Co-authored-by: Isaac <no-reply@databricks.com>
…ndeterminate
A spin's count cut by an excluded (flaky) or clocked test, with no deterministic,
unclocked owner test reaching the mutant, was labelled `timeout`. `timeout` is
the backstop gap only (M-24, G11), and an excluded test judges nothing ("An
excluded test still runs", M 2026-11-23), so the mutant has no judging test and
is indeterminate (G11: only nondeterministic tests reached it).
Law: M-24 (timeout is the backstop only); "An excluded test still runs"; G11
(indeterminate). Not changed: a spin cut where a deterministic, unclocked test
reaches the mutant stays `timeout` (open question, reported).
Reach: constructed history "a count cut by a flaky test with no deterministic
reach" (appended last, C-6); its state is declared in required.
RED: on the unchanged classify.mjs the witness fails with
mutant m0: ["timeout",null,null,"spin"], owed ["survived","indeterminate"].
GREEN: classify file 297 of 297; #200 and #178 full main histories, neutralized,
replayed twice each on this branch: 1 passed each.
Mutant: restoring the `timeout` label for a spin with no deterministic reach is
the RED run above.
Limits: a clocked-only spin (non-flaky) now also becomes indeterminate, and the
e2e model still owes `timeout` for it (not run here). A spin with a
deterministic reach is unchanged.
Co-authored-by: Isaac <no-reply@databricks.com>
… deterministic test reached The e2e model owed `timeout` for a spin whose count only a clocked test made, while classify (be74532) owes indeterminate. The register says timeout is the backstop only (M-24), and an excluded or clocked test judges nothing. The e2e model now owes indeterminate for a timeout by spin with no reaching test that is deterministic and unclocked. Its three states that named the old label are renamed to the indeterminate states, and their producers read the survivor class. Law: M-24; "An excluded test still runs" (M 2026-11-23); G11 (indeterminate). Reach: the existing constructed histories "a clocked copy that spins", "a heavy test that reads the clock after its work" and "a spin after a short async read" enter the renamed states. RED: "a clocked copy that spins" fails on the previous head with "Difference: src/sut.ts:f0:31:delete-call#0: indeterminate, owed timeout". Mutant: the old `timeout` label in classify.mjs (ee8a11d) fails the same unit with "timeout, owed indeterminate". GREEN: those three units pass (12 of 12 in the three-unit filter); the spin units (fixed seed and random seed, 8 each) pass. Limits: the full e2e file was not run. The two-part witness for seed 61620462 is not in this commit. Co-authored-by: Isaac <no-reply@databricks.com>
…ngest legal wait (B2, B3) Law: no legal copy reaches its backstop, and a backstop cut is a gap (M, 2026-11-23, "Backstops are fine, set high"; I15, R49). A legal wait is due inside the copy's idle horizon only when the limit exceeds it, so the limit of a history is three times its longest legal wait, at least a floor. Production keeps its 60 s default (args.mjs BACKSTOP_BASE_MS). Derivation (model `backstopOf`, driver passes it as --hang-limit): hangMs (drawn or constructed) when set, else max(BACKSTOP_FLOOR_MS = 10 s, 3 x max(SLOW_MS, legalWaitOf(test)...)). legalWaitOf: slowMs (SLOW_MS for a heartbeat hold), ioWait and pendingIo test/short (SLOW_MS), timerWait.waitMs. Runner waits and PAST_HORIZON waits are not legal. Mutant hang (pulse) now costs its history's limit, not 60 s, and ends only at the backstop, as a gap (recorded in the oracle's limits). Reach: "a slow kill after a 22 s wait killed" (its longest legal wait is its own 22 s, limit 66 s), fixed seed and random seed. RED (hostile mutant, scratch, not committed): backstopOf = the 10 s floor for that history. Result: "killed by no progress, owed a behavioral law" (fails). GREEN: gap-report-oracle -t "a slow kill after a 22 s wait": 3 passed. Local slow units, GAP_E2E_SHRINKS=0, maxWorkers 2: "every outcome class", "a later owner's test listed first beside an earlier owner's hang", "an edit sequence over the witness module" (both halves), "a declaration fault: noTypescript": 21 passed (1287 s). Fingerprint canary: 3 passed (no drawn field changed). e2e-shards check and pr-shards check pass. eslint clean on both files. Limits: - The drawn hangMs of 40 s (one history in four) stays an explicit override, so its pulse hangs cost 40 s. Changing its draw would move the fingerprint. - The floor (10 s) is a judgment, not measured per copy; per-copy latency is not recorded. - A legal copy above its limit by a non-wait cost is not covered; no history reaches it by construction (3 x wait). Co-authored-by: Isaac <no-reply@databricks.com>
…ample (RED) Law: a copy whose property test spins past the call budget in a later run is cut by count, and the verdict is a built-in law on the route the test was on at the cut; the model must count every run that the fixture's property makes (numRuns 20, seed 1, fast-check's run rules). Authority: the fixture's own declaration (gap-report-model-oracle.mjs, campaign emitter, fcTest.prop with numRuns 20 and seed 1), fast-check's run semantics, and the capture's spin rule (capture-setup.mjs, "the route it registered"). Reach: the constructed history "a property test's later run spins into bounded work" (the exact captured history, seed 61620462 path 0). Its declared state enters when the CLI reports an unregistered kill by bounded work on a property test. RED: GAP_E2E_SHRINKS=0 pnpm exec vitest ... -t "fixed seed 20261105: a property test's later run spins into bounded work" fails twice: src/sut.ts:f0:34:loop-false#0: unregistered-kill, owed killed Mutant: the model is unchanged, so the RED is the mutant (one-run model). Limits: this commit is test-only and red by design. The model change follows in the next commit. No production change. Co-authored-by: Isaac <no-reply@databricks.com>
… times (B3) Law: every determinism unit runs in exactly one job (pr-shards check). Only the packing changes; no test is added, removed, or narrowed. Evidence (B3): CI run 45241549820 at a1e1c14 (per-backstop limit in place) put the determinism jobs at 714 s (7/7), 574 s (1/7), 395 s (5/7), 323 s (3/7 and 6/7), 515 s (2/7), 264 s (4/7): 3103 s in all. The units' times come from the reporter's per-unit ms in those jobs' logs. Six shards now hold 470 s of measured weight each (first-fit decreasing); the rest (283 s and the untimed units) stays in shard 7, `rest`. Check: node scripts/pr-shards.mjs check: 7 partitions split their tests exactly. eslint clean. Limits: the weights are one run's times (a random unit's cost follows its seed); the job time is confirmed only by the next CI run. Co-authored-by: Isaac <no-reply@databricks.com>
…ure numRuns 20, seed 1) Law: an asProp test runs once per run of its fast-check property. Its loops and judging apply in the runs whose n is positive, and a count cut is judged on the route active when the copy's calls pass the budget (capture-setup.mjs `spin`: the route it registered at the cut). Authority: the fixture's own declaration (gap-report-model-oracle.mjs, campaign emitter: fcTest.prop with numRuns 20 and seed 1), fast-check's run rules (a soft verdict continues the property, a hard one stops it), and the capture's cut rule. The model computes the run sequence with fast-check itself (fc.sample with the emitter's arbitrary and parameters). Checked against the wrapper: @fast-check/vitest's test.prop under seed 1 yields the same first 20 n values (8 10 0 1 3 10 2 8 8 10 7 0 9 3 2 0 4 1 7 3) as fc.sample. Reach: the constructed history "a property test's later run spins into bounded work" (exact capture of seed 61620462 path 0). RED (parent 7f5e218): GAP_E2E_SHRINKS=0 ... -t "fixed seed 20261105: a property test's later run spins into bounded work", exit 1, twice: src/sut.ts:f0:34:loop-false#0: unregistered-kill, owed killed GREEN (this commit): the same unit exit 0; the random and determinism units of the same history exit 0; seed 61620462 path 0 replay ("random seed: every outcome class") exit 0 (it failed before); fast units (static, classify, probe-form, mutant-validity, path-spelling): 33917 of 33917 pass. Mutants on the constructed history (each run once): A, one run per property (the previous model): exit 1 (loop-false#0 differs). C, the cut names the test's last route: exit 1 (binary-swap#0 differs). B, the n gate ignored (every run loops when output differs): exit 0, SURVIVES. Limits: mutant B is not killed by any history the grammar draws. loops is 0 or 30,000 (generator), and the first run has n = 8 > 0, so the second run already passes the call budget in both models with the same route and verdict. A history that distinguishes the gate needs a generator change (loops values between 0 and 30,000) or a second property; this is a grammar decision for the maintainer, not a model rule. Also not covered: the work-budget overflow path still names one route per row (production capture, check.mjs's rule names every route with counted calls); the overflow is not reached by this history. Co-authored-by: Isaac <no-reply@databricks.com>
… (B3) Law: unchanged (pr-shards check: every determinism unit in exactly one job). Evidence (B3): the first repack (4626959's predecessor, a1e1c14's weights) ran at 3,103 s of weight over seven jobs and CI put the determinism jobs at 391 to 610 s at 4626959: 2/7 at 610 s, 6/7 at 544 s, 3/7 at 541 s. The same units summed to 3,408 s in that run (about 10% more than the first run). The new packing uses each unit's mean over the two runs (3,255 s in all): six shards hold 490 s each and the rest 317 s, so a job should be about 510 s plus setup. Check: node scripts/pr-shards.mjs check: 7 partitions split their tests exactly. eslint clean. Co-authored-by: Isaac <no-reply@databricks.com>
…d model
Law: a property test's count cut lands on the route the copy is on when its
calls pass the budget, and the run with n = 0 adds only its own calls (the n
gate, from the fixture's `when`). Authority: the fixture's emitter (`when`
gates loops and judging), fast-check's run rules, and the spin rule of
capture-setup.mjs.
Generator: `loops` gains the value 19,999, appended last. With a = loops + 1,
runs 1 and 2 (n = 8, 10) reach 80,000 calls, under the 100,000 budget; run 3
(n = 0) adds 2 calls and reaches 80,002. The gated model passes the budget at
100,002 in run 4's first part (case route). An ungated model passes it at
120,000 in run 3's enumerated part, another route and verdict.
Canary: history-fingerprint.json re-recorded. Only the `tests` line changed, in
both lists (02cea0c59a5c4124 -> dcba3d60f14af32d), and the canary passes 3 of 3.
constructed-order.json now records the full registered order (112 names). It
had 90 names: 18 names that this branch registered earlier were never recorded,
so a new name could not follow the recorded tail. Those 18 are recorded now.
Reach: C-7 "a property test's count cut lands in its first part after a run
with no positive n" (the captured C-6 history at loops 19,999), appended last.
RED (mutants of the final model, each run once, GAP_E2E_SHRINKS=0, fixed seed
20261105 unit of C-7):
A, one run per property (the previous model): exit 1, loop-false#0 "killed
by bounded work, owed a behavioral law".
B, the n gate ignored: exit 1, loop-false#0 "killed, owed unregistered-kill".
This was the survivor of 07ac382 (exit 0); now killed.
C, cut names the test's last route: exit 1, loop-false#0 "killed, owed
unregistered-kill".
GREEN (final model): C-7 fixed exit 0; C-7 random exit 0; C-7 determinism exit 0;
canary 3 of 3; fast units (static, classify, probe-form, mutant-validity,
path-spelling) 33917 of 33917; shards: 5 e2e shards and 7 pr partitions check.
Limits: the work-budget overflow route (one route per row in the capture, where
check.mjs names every route with counted calls) is not reached by any history.
Recorded in the gap e2e oracle's limits, with the witness it needs. The loops
change shifts the draws of every fixed and random seed; seed-based replays of
histories other than the captured C-6 literal differ from before.
Co-authored-by: Isaac <no-reply@databricks.com>
…perty runs, classify report order Conflicts: the per-history backstop removed the model's slow-past-backstop return, and fix99-attr added per-part marks there; kept the marks. Both branches appended constructed histories and limits text; kept both, in branch order. Co-authored-by: Isaac <no-reply@databricks.com>
Conflicts: both branches appended constructed histories and pr-shards names; kept both, in branch order. The 22 s backstop history, new on this branch, moves after fix99-attr's recorded histories so constructed-order.json stays an append-only record; both new names are appended. Fingerprint canary, e2e-shards check and pr-shards check pass. Co-authored-by: Isaac <no-reply@databricks.com>
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.
Summary
Deterministic cuts for the gap CLI. No wall-clock cut decides an outcome.
bounded workandno progress, on the route of the test that ran.timeout).This round: the merge gate's findings (review of a07e6e9 and 864818b)
baseline.workand its row is unclockedioFilesgate and theioflag are deletedstopNowends through the single ending (end)stopNowfailsan authored mutant whose owner spins; mutant "authored copies uncounted" failsRules (v21.2 IDs; register entries in quotes)
Changes
Idle (
capture-setup.mjs)inithook records which code started each timer, handle and request. A resource is the test's in either case:console.logcaused it.quiet);beforeEachbase;setImmediatewrapper.ioFiles) and the row'sioflag are deleted (merge gate H2). The set came from a 50 ms sampler, so whether a file's copies were checked for idleness followed timing. Now every copy, operator or authored, gets idle detection, and the test's own I/O keeps it busy while it is open (R50, R51).Kills (
classify.mjs,check.mjs)bounded workon the routes of its counted tests.killed, and its later copies do not run. On another route the result is random-only or unregistered.baseline.work(its unmutated runs agreed, read no clock, and made equal counts) and the copy had read no clock when it spun (countOnly, in the check). Otherwise the spin names no test and stays a gap:timeout, causespin. This covers a test that reads the clock only after its work, and a nondeterministic test's spin.cutVerdictsnames the key and the clock state of the cut row, and decides nothing.(cause: backstop).The unsupervised stop (
index.mjs, merge gate M1)a stream log lost after its note, then stoppedwith 2 done lines on each stream. A Windows-only scratch workflow printed the streams (run 44114696928, 3 of 3):done stopped (SIGINT), then the refusalthe stream log … cannot be written (EISDIR)anddone refused.stopNowwrote its stopped line throughwriteStream. The append to the log, which is now a directory, threw a refusal out of the stop handler, anduncaughtExceptionended the run a second time throughendWith. The previous guess (closeWithinin the stop path) was wrong.end). Once an ending has begun, nothing ends the run again (R10, I7), and a log that cannot take the line is skipped, as for any ending.Determinism
two batches each read a capture row while its worker wrote itnow passes its determinism unit.readGapLine(#115)(cause: <cause>)and judges it equal todetail.a stdout gap line names another cause. It is bound to the historya clocked copy that spins, because a timeout line is now rare in generated histories.Draws (M "Randomness wins")
hangMs,slowMs,loops,timerWaitandpulse. Each set includes the values that the constructed histories use, so a constructed history takes back as a drawn one.pendingIoswitches test-only hooks, so it stays a constant (the hook exception).Draws added in this round
heavy(merge gate H1): each of the history's own tests calls its function 10,000 more times before each campaign's call, in every run. It is drawn for 1 history in 16 (M "Randomness wins").resolvegives it only to the history's own tests, never to the witness module's, a test.prop or the shared-state witness. A constructed history whose work budget decides its state sets it to 0.timed: 'after'(the clock read after the test's work) andpendingIo: 'short'(a pipe read held for two sampler samples, before production, in every run; it switches the SAMPLES hook, so it stays constructed). The pipe-read hold takes its sample count as an argument.An authored copy counts calls (
check.mjs, #167)spinDataloop. An authored copy counted no calls, so only the backstop could stop it.countOnlyjudges its spin, as for an operator copy.Clocked by state (
capture-setup.mjs, follow-up ruling)ioDone).sawIois deleted; the sampler still decides idle.timed: 'read'(a constructed clock path: a short async read before production) is clocked, and a verdict test of file b whose data read is async (promise or callback) is clocked where its output differs. A clocked row judges no work.Merges
origin/mainwas merged eight times in all: eec7f77 (test(oracle-gaps): judge stdout gap lines against results.json, by id #115), 9aed105 (fix(oracle-gaps): copies resolve when the vitest config sets root #103), fac63df (fix(oracle-gaps): retire a batch's copies from Vitest's state #61), 2552d6a (fix(oracle-gaps): probe code is never work (#102) #121, fix(oracle-gaps): prefix an internal error's lines, and judge the stream law for them #128) 5523123 (test(oracle-gaps): two checks at once are recorded by role, not by process order (#82) #126, in b48a33c), 9881146 (fix(oracle-gaps): close the merged-PR conformance gaps (drawn fields, F-D, cold fallback) #131, in 61c3186), af156d9 (ci(oracles): run the e2e oracle's random and determinism units on every PR #90, in 28fda03, repaired in af91fdc), 97a4e7a (fix(oracle-gaps): a ?. read of a nullish object infects its site #147, in 83a0b3a), 30928ee (fix(oracles): constructed histories run fixed and drawn bases from their own streams; generated draws don't depend on them #122, in 384b0fd) and 6d05f05 (fix(oracle-gaps): a stopped run removes its session directory (#150) #164, in cb1de4f). Main's fields, histories and shard placements come first, then fix(oracle-gaps): no wall-clock cut decides an outcome #99's.spinDatacopy that schedules its error first (spinThrows) has made a timer, so its spin is a gap. The statea check through the daemon worked past its CLI's boundread a first budget's cut, which fix(oracle-gaps): no wall-clock cut decides an outcome #99 retires; it now reads that the check computed file a's runs again (R7 repair clause). That witness costs 86 s under fix(oracle-gaps): no wall-clock cut decides an outcome #99, so it moves to a lighter Linux shard (90f29a2).check.mjskeeps fix(oracle-gaps): no wall-clock cut decides an outcome #99's deletion ofconfirmAlone, and main'sevidence.ranstays inunitandunitsBatch. The grammar keeps main'sholdOverlapbefore fix(oracle-gaps): no wall-clock cut decides an outcome #99'shangMs.Windows shard 7: the diagnosis
The failing history is
a declaration fault: brokenOwner. It has a native addon, so it runs in theforkspool. The diagnostic was run 43781834633, job 133020579174, on scratch/dc-win-idle-log at 37b6359..oracle-gaps-*-a.test.ts) listed aSimpleWriteWrap, 4 ×PipeWrapand 2 ×Timeout. They showedio: true, base 1 and no timer due.io: false, 4 ×PipeWrapand 2 ×TimeoutorImmediate. They showed base 1, with timers due at 0 or −1 ms.tests/a.test.tsalso had a sample with aSimpleWriteWrapandio: true. That put file a in the set of I/O files, so no copy of file a was checked for idleness. (This round deletes that set.) Every hang of file a then ran to the backstop. In shard 2 this also hit M163 and M165 (w_hangkill).SimpleWriteWrapis a pending stream write. On POSIX a small pipe write completes at once.Evidence
Law
Reach
Constructed histories, each with a fixed-seed, a random-seed and a determinism unit. All reach their states on macOS and on the pool.
a copy waiting on a pipe it openeda copy waiting on I/O it opened killeda copy beside the runner's pending write… cut as no progressa copy beside the runner's pending timer… cut as no progressa clocked copy that spinsa spin whose count could follow the clock timed outan authored mutant whose owner hangsan authored mutant killed by no progressa heavy test that reads the clock after its worka spin of a test that reads the clock after its work timed outheavy, the until loop,timed: 'after', no judginga heavy test that reads the clock firsta heavy clocked test's copy past the call floor killed by its lawheavy, the until loop,timed: 'clock'a hang in a file whose test does a short reada hang in a file whose test did a short read killed by no progressa clocked owner beside a counted one under the work budgeta clocked owner's work left out of the work budgeta stream log lost after its note, then stopped, unsupervisedan unsupervised run stopped after its stream log was lostkilled by bounded work,killed by no progress,a random-only kill by a built-in lawanda spin whose count could follow the clock timed out.Reach lost and gained at the fixed seed
Fixed-seed units, fec5d43 against d046d1b:
a hang alone timed out,a hang in one owner and a survivor in another timed out,a mutant's copies past its work budget timed out,a kill past the work budget in a later owner does not count,a setup error beside a timeout under one budget).authored agreement-only-killandauthored unregistered-kill, not required.Reach lost and gained at the fixed seed, this round
Fixed-seed units on the pool, b48a33c (before this round's oracle changes) against 497c58e:
a start refuses a stale claim,an authored mutant killed by no progressandrefused nonLiteral. Each is still reached by its own constructed history.Reach lost and gained across #122 and #164
Fixed-seed units on the pool, 7176ab6 against cb1de4f (109 units, from 107: #164's two new histories):
a run after a stopped one that left its sessionis nowa run after a killed one that left its session.a run after a killed CLI that left its own sessionanda stop before the CLI starts, after a stopped check.RED
a copy waiting on a pipe it openedcut as no progress, owed killed.a copy beside the runner's pending write:cut by backstop, owed no progress.a copy beside the runner's pending timer:cut by backstop, owed no progress.timeout, owed killed. The classify oracle's three new histories givetimeout.a clocked copy that spins:delete-call#0: killed, owed timeout. The classify clocked spin: a bounded-work kill, owedtimeout (spin).the authored mutant a1 is timeout, owed killed. It was found as random seed −313313556,a declaration fault: apiLessTypescript, path 0:1:1:1.readGapLine(merge with test(oracle-gaps): judge stdout gap lines against results.json, by id #115):does not read as a kind, a line, an id, and a change.an authored mutant whose owner spins:the authored mutant a1 is timeout, owed killed(macOS, 67 s).a spin after a short async read:delete-call#0: killed, owed timeout, 3 of 3 runs (the sampler missed the read; a run whose sample lands on it gives the gap, so the outcome followed timing).a heavy test that reads the clock after its work:binary-swap#0: killed, owed not-judged.a heavy test that reads the clock first:binary-swap#0: timeout, owed killed.a hang in a file whose test does a short read:if-false#0: timeout, owed killed(the backstop, after 54 s).a stream log lost after its note, then stopped, unsupervised:the lost log's run printed 2 done lines on stdout and 2 on stderr. This matches Windows 9/10 at 864818b and the scratch run's streams.GREEN (pool), this round
pr-shards check(5 partitions) ande2e-shards check(5 shards).GREEN (pool), earlier rounds
Mutants
Each one fails the oracle.
a clocked copy that spinsan authored mutant whose owner hangsbaseline.workonly (the head's base), scratch/fix99c-mut-base 294f3e39binary-swap#0: timeout, owed not-judgedandtimeout, owed killeda heavy test that reads the clock after its work:delete-call#0: killed, owed timeouta hang in a file whose test does a short read:if-false#0: timeout, owed killeda clocked owner beside a counted one under the work budget:if-false#0: killed, owed not-judgedan authored mutant whose owner spins:the authored mutant a1 is timeout, owed killeda spin after a short async read:delete-call#0: killed, owed timeout(2 of 2)stopNow(c651a6a, the RED)stopNowthat only swallows the log's error, with no single endingWeight
Minified, with gzip −9 bytes in parentheses. "d1ff18b" is this PR's head before this work.
capture-setup.mjscheck.mjsclassify.mjsThis round, esbuild 0.28.2 minify, with gzip −9 bytes in parentheses:
capture-setup.mjscheck.mjsclassify.mjsindex.mjscheck.mjs+44 (+10) andcapture-setup.mjs−16 (−11). DeletingioFilesand theiorow flag pays forcountOnlyand main's two-run budget loop.index.mjs+29 (+20).stopNownow sharesendwithendWith, in place of its own three writes. A guard copied intostopNowwould remove the shared path and add about the same bytes.capture-setup.mjsgrowth is the three test-only hooks (about 1,000 bytes).Async hooks cost
forks: chainedsetImmediate+4–40%,nextTick+30 ms per 100,000,fs.stat+13–76 ms per 5,000. Synchronous code is unchanged.Limits
a daemon pause that cannot engage, is also determinism: a daemon pause that cannot engage gives different traces across runs (intermittent, added by #73) #105.random seed: generated, a stopped run that says completed where SIGABRT is owed (random seed: setupThrows: a stopped run exits SIGABRT but its done line says completed (seed -1659558018), on main too #117, on main).random-only-kill), random seed: an ambiguous authored mutant: field-drop judged not-distinguished, owed indeterminate (seed 333199054), on main too #116, random seed: generated (seed 4): a timeout classification counterexample, on main too #120, and the new random seed: a stale authored mutant and a reformat: delete-call#0 crashed, owed framework-error (seed -88071026), on main too #127 (reportAndPush delete-call#0: crashed, owed framework-error, seed −88071026, which replays on main).oneofdraw shift. Appended constructed histories and the new draws shift every seed's histories. Filed replay lines stop replaying on the head that merges second. This is accepted under "Randomness wins".timed, before production orafterits work), it does a short read of its own before production (pendingIo: 'short'), or it waited where an earlier campaign's output changed. A clock read by production code inside the spin itself is not modeled. A heavy test exists only as 10,000 more calls before each campaign's call.daemon.mjsandoverlap-hold.mjsare main's;index.mjschanges only the stop's single ending and comments). Per M "Main's determinism failures", it does not block.random seed: an edit sequence through the daemon: authored mutant a2 runs to its backstop (timeout, owed killed). It is reproducible on fix(oracle-gaps): no wall-clock cut decides an outcome #99 and is not caused by the clocked-by-state hook. The same seed draws another history on main, so attributing it to the base waits for a replay by history (Automate base replay of random counterexamples (R42) #157).baseline.workleaves it out. Its no-progress verdict still kills, because built-in verdicts skip the nondeterminism filter. The classify oracle's model predicts the same, and the e2e model generates no hang in a nondeterministic test, so no oracle sees it.stopNowthat only swallowed the log's error would survive (measured, 2 of 2)._handle(a dgram socket) is not found as the test's.IDLE_MS) for a reply on the runner's channel has no test-owned timer or I/O open. Examples: a file snapshot, a dynamicimport(),vi.importActual, and a mocked module'simportOriginal, each a module fetch over the worker RPC. Under M-24 such a copy is killed by no progress. On a loaded main thread the reply can take that long, so the kill can follow load (I15). Owner: Idle: a test that waits on the runner's RPC (a dynamic import, vi.importActual) past 500 ms is killed by no progress #148.node_modules/vite/andpackages/oracles/src/are machinery for ownership and forclocked. Two cases can hide a test's own work: a package under test that uses Vite as a library (a plugin test that callscreateServerorbuild), and this package's own sources when the CLI is run on them. In those cases production timers and I/O are the runner's unless their trigger chain is the test's, and a wait on them alone is a no-progress kill. A production clock read there also leaves the row unclocked. Code that Vite's module runner serves keeps its own path in its frames, so the rule is sound for it. No history generates either case. The e2e Limits record the same.runAloneruns each copy with noidleMs, so a hang there runs to its backstop. Its spin row is read withoutcaptureLines' whole-row guard (runner law L1). No history reaches the path with a hang._idleStartand_idleTimeoutagainst the sampler's interval, so a late sample sees a timer as due later. That matters only within a sample's lateness of the horizon, the backstop band.classify.mjs(timedOutTest) and, new in fix(oracle-gaps): no wall-clock cut decides an outcome #99,check.mjs(cutByTime), which also ends the mutant's later copies (L2, D82). A test whose own failure message quotes that text makes the mutant a backstop gap and drops the later owners' kills. No history generates such a message.trackPromises: falseis not checked on CI's Node 24.8.0. If Node ignores it, promises fire the hook and return at once.every outcome class, the warm and abort stops, so no rebalance can shorten it; it is P12's open item for that unit (see P12: Windows e2e shard 2/10 (every outcome class alone) takes 10 min #118 for shard 2's twin).a capture row read while the worker wrote it, the torn-row hold not reached. It passed on the previous run. Filed as Windows: the torn-row witness can miss its hold when the poll count's rename collides with the hold's read (intermittent) #138, an intermittent win32 rename race in the gap CLI: a run under load can end non-zero (an internal error) where it should complete #83 hook.every outcome class, the abort stop(fix(oracle-gaps): supervise the check on win32; log each CLI run in the e2e driver #79, on main too).Process
-c core.hooksPath=.huskyby mistake, which is a hook bypass, so its pre-commit hook did not run. Its one file,packages/oracles/oracle-gaps/gap-report-oracle.property.test.mjs, passes eslint and prettier unchanged. It was pushed, so it is not amended.Co-authored-bytrailer.gap-report-model-oracle.mjskeeps a wrappedruns.filter(…)thatprettier --writejoins onto one line. The hook's lint-staged step runs prettier, so a commit made through it is always prettier-clean.prettier --checkpasses onpackages/oracles/oracle-gaps,scriptsandtests.scratch/fix99c-win-lostlog, with a workflow of its own (046d013, then 4567e73 with the fix). It is not part of this PR.Test plan
RED, GREEN and mutants for idle ownership, timers, kills, count-only and the authored hang.
Pool, head 9ecef3f: e2e shards 1 to 3, units, fast gap oracles.
Fingerprint canary;
pr-shards check(5 partitions) ande2e-shards check(5 shards).Windows scratch run (before the last merges).
This PR's CI on a07e6e9 (run 43947367739): every job passes except Windows shard 4 (main's fix(oracle-gaps): supervise the check on win32; log each CLI run in the e2e driver #79) and one intermittent failure on Windows shard 9 (Windows: the torn-row witness can miss its hold when the poll count's rename collides with the hold's read (intermittent) #138).
This round: RED on the oracle-only commits, GREEN, and one mutant for each of H1 (two), H2, M1 and M4.
Pool, 497c58e: e2e fixed-seed shards 1 to 3, plus the new histories' random-seed and determinism units.
Windows scratch workflow for M1: RED 3 of 3 (run 44114696928), GREEN 3 of 3 (run 44116272205).
Pool, 83a0b3a (after merging fix(oracle-gaps): close the merged-PR conformance gaps (drawn fields, F-D, cold fallback) #131, ci(oracles): run the e2e oracle's random and determinism units on every PR #90 and fix(oracle-gaps): a ?. read of a nullish object infects its site #147): fixed-seed shards 1 to 4 exit 0 (22, 21, 22, 41 passed); determinism shards 1 to 7 exit 0; random shards 1 to 3 exit 0; static 1 and 2, the classify group (33,736), units (117) and lint exit 0. Random shard 4 found one counterexample, filed as random seed: an edit sequence through the daemon: authored mutant a2 runs to its backstop (timeout, owed killed), seed 964713679 on #99 #167 (an authored copy runs to its backstop; the base replay needs Automate base replay of random counterexamples (R42) #157).
c910dc3 spreads fix(oracle-gaps): no wall-clock cut decides an outcome #99's random and determinism units over the lighter shards (the pool's determinism rest shard took 672 s).
CI on c910dc3 (run 44293831466): every job under 10 min; random 1/4 hit random seed: a declaration fault: brokenOwner: a daemon still serves the package after --stop-daemon (seed 69762063, on #99) #171 (main's).
Pool, cb1de4f: fixed seed 4/4, random 4/4, determinism 7/7, static 2/2, the classify group (33,739), units (117), and the partition checks, all exit 0. The longest is determinism 7 at 477 s.
CI on cb1de4f (run 44462540755). Every job passes except:
every outcome class;devBuild binary-swapnot-observed, owed indeterminate;random seed: every outcome class does not enter three owner-kill states (seed -1851858881), on main too #180 and random seed: a stale authored mutant and a reformat: devBuild binary-swap not-observed, owed indeterminate (seed -1828075873), on main too #181 are main's, not fix(oracle-gaps): no wall-clock cut decides an outcome #99's: replayed by their full histories, they fail on main 6d05f05 too, 3 of 3. So they do not block.
P12: determinism 7/7 took 12:03, over 10 min. Its rest shard holds main's heavy units plus fix(oracle-gaps): no wall-clock cut decides an outcome #99's remaining ones.
This pull request and its description were written by Isaac.
Round: issue #182 (random seed counterexample, seed 2027172067)
Fixes #182
judge()took owner files in first-appearance order of the history's test list, so a later owner's test listed first ran first. Production sorts by path. The model is the wrong side (44c0dbd7).a later owner's test listed first beside an earlier owner's hangentersa copy cut as no progress before a later owner's spin(1 per unit, all three units). Generated reach, corrected: the earlier 0 came from a detector that required the first listed test to be file b. Fixed in fb09ef0 (the state now reads spinData, fsRead and the CLI result). Local seed 2027172067 reports 1. CI run 44594450749 (4c29fa8), the generated units, reports 0 in 3 of 3 reach lines (fixed seed 20261105 in two jobs, random seed in one). So the generator reaches the state for that seed, but the CI draws did not.11d5aa3d. Fixed seed 20261105 fails withw_hangkill:202:if-false#0: killed by no progress, owed bounded work.44c0dbd7. Constructed unit passes (57 s,GAP_E2E_SHRINKS=0); seed 2027172067 passes (49 s); fast gap oracles 33,911 tests pass (413 s, 2 workers); fingerprint canary passes.targetsOfis rejected:killed by bounded work, owed no progress. The first-appearance order mutant survives, because production'sreachedByalready listsafirst. Not a kill; recorded as a limit.constructed-order.jsonis a stale prefix (90 of 109 recorded): constructed-order.json is a stale prefix: 19 constructed histories are unrecorded #183. Windows fixed-seed 2/10 and 5/10 fail on main as well (see CI notes).CI follow-up (run 44588135077 at 44c0dbd; fix in 97ddc05)
a copy cut as no progress before a later owner's spin, generated histories, CI run 44594450749 (4c29fa8, detector of fb09ef0): 0 of 3 generated reach lines (fixed seed 20261105 in two jobs, random seed in one); seed 2027172067 locally: 1. Constructed history: 1 per unit. The generator does reach the state for some draws; the CI draws did not. No generator dimension is added.97ddc059(e2e-4).e2e-shards.mjs check: "5 shards partition the e2e tests".random seed: a daemon pause that cannot engage, seed -1120189360,Difference: src/sut.ts:D_ARR:31:arithmetic-swap#0: not-observed, owed indeterminate. PR 99 at 97ddc05 fails twice; origin/main at 6d05f05 passes twice (GAP_E2E_SHRINKS=0). The generators differ, so the drawn histories could not be compared (main prints no history on a pass). Filed as random seed: a daemon pause that cannot engage: D_ARR not-observed fails on PR 99 at seed -1120189360, passes on main #184. It blocks until attributed: determinism: a daemon pause that cannot engage gives different traces across runs (intermittent, added by #73) #105 covers the determinism unit of this history, not this classification law. Relation to determinism: a daemon pause that cannot engage gives different traces across runs (intermittent, added by #73) #105 is open.CI follow-up 2 (merge head 86afd01; merges origin/main 7b6bae1)
skills/oracles-setup/SKILL.md).Difference: src/sut.ts:D_ARR:31:arithmetic-swap#0: not-observed, owed indeterminate) fails twice, so main has the same failure.a stale authored mutant and a reformat, seed -606020990: fix(oracle-gaps): no wall-clock cut decides an outcome #99's own. The exact history fails on fix(oracle-gaps): no wall-clock cut decides an outcome #99 twice. The neutral form fails only whenloopson the flaky test is kept:loops30000 withpulseneutral fails;pulsetrue withloopsneutral passes. Decision pending (backstop band, K21, with the maintainer).C0.run:55:delete-call#0: timeout, owed indeterminate(twice). The earlier pass was a different draw.: main 7b6bae1 failsC0.run:55:delete-call#0: timeout, owed indeterminate, twice; fix(oracle-gaps): no wall-clock cut decides an outcome #99 passes, twice.f0:35:delete-call#0: timeout, owed indeterminate(twice).: main 6d05f05 failsf0:35:delete-call#0: timeout, owed indeterminate; fix(oracle-gaps): no wall-clock cut decides an outcome #99 passes, twice.1:2:1on fix(oracle-gaps): no wall-clock cut decides an outcome #99 is rejected ("Unable to replay, got wrong path"), because fix(oracle-gaps): no wall-clock cut decides an outcome #99's generator no longer draws the same history at that path. Remains open; needs a replay by history.CI follow-up 3 (head 6bacce3)
a later owner's test listed first beside an earlier owner's hang(166.6 s) moves from the rest shard to determinism 1/7 (318 s of units). Estimated: 7/7 about 8 min, 1/7 about 9 min. Both shard checks pass. Re-measured on CI at the head.K21 (backstop): ruling, status, and the seed -606020990 correction
cf0bd376's message says production "cuts it at the e2e backstop (20 s)". That was wrong. The replay shows a count spin (cause: spin) after about 3.5 s of unit time, because the flaky owner's 30,000 loop calls count toward the copy's call budget. The commit cannot be amended (published). This body supersedes its diagnosis.5335adf7); a flaky run never setsrose(commite7ebdc0b, B6); a spin on a flaky run is a gap, since its count could not be told from the clock (productioncountOnly).cf0bd376(timeout, owed unregistered-kill). Hostile mutant (pre-F1 model, restored from HEAD): same Difference. GREEN5335adf7: the constructed unit, seed -606020990 and seed 2027172067 pass.Coverage and limits (N1, N2)
inertFlakykeeps a hang only forcut === 'count'. A flaky no-progress hang is judged as finishing, while production kills it. The generator never draws a flaky hang (gap-report-model-oracle.mjsnear 5957-5960). Owner Gap CLI: a nondeterministic test's no-progress verdict kills, and a copy run alone has no idle detection #149. No oracle sees it. Recorded here; the coverage map lives in the DB repository, not in this one.gap-report-model-oracle.mjsnear 5957-5960 and 5969-5971), a generator narrowing. Recorded here for the coverage map.6bacce39moved one unit to 1/7. The time at the final head must be re-measured on CI before merge.C0.run:55:delete-call#0: timeout, owed indeterminate(twice). The earlier pass was a different draw. / Gap e2e: a drawn base of 'a declaration fault: apiLessTypescript' judges a mutant as timeout, owed indeterminate #178): the replays pass on fix(oracle-gaps): no wall-clock cut decides an outcome #99 by seed and path, but fix(oracle-gaps): no wall-clock cut decides an outcome #99 changes the draws (K18), and the failing main history is truncated (oracle-property: the History line is capped at 2000 characters, so a failing history cannot be filed in full #185). The Fixes lines are not yet supported by a full-history replay. Until that is shown, they stay open (see the B5 status below).Round: review gate 4 (head 5335adf), status
random seed: generated(seed 1301071465, path 243:...) fails on fix(oracle-gaps): no wall-clock cut decides an outcome #99 with the same Difference; the path is not replayable on main (wrong path), and the failing law lives in fix(oracle-gaps): no wall-clock cut decides an outcome #99-changed classify.mjs, so it is fix(oracle-gaps): no wall-clock cut decides an outcome #99's own; the wrong side is open.every outcome class(seed 61620462) anda reset check after its warm daemon was replaced(seed 36869583,D_OBJ:30:field-drop#0) are not yet attributed.Round: B2 and B3 (K21 backstop, CI time), head a2400c5
Law. No wall-clock cut decides an outcome; a backstop cut is a gap, and no legal history ends at it (M 2026-11-23, "Backstops are fine, set high"; I15, R49). The daemon never stores a unit cut by the wall clock (I8, I12).
Measured per-call cost (CI, temporary diagnostic job, run 45219880267, removed in
a2400c53). Inside real gap-CLI copies, 100,000 counted calls per repetition:windows-latest)ubuntu-latest)Derivation (documented at
check.mjslimitFor). Per-site allowance 63 ns (worst, Windows) × margin 3 =SITE_BACKSTOP_MS0.0002 ms, applied to the call budget aboveCALL_FLOOR. CALL_FLOOR × 63 ns × 3 is 19 ms, so the base is the whole backstop for a small file. Base 60 s is the fixed allowance for a copy's start and non-site waits (three times the longest legal wait the suite draws, 16 s, rounded up). Each file's unmutated seconds add three, as before. The e2e driver's base (FULL_LIMIT_MS) and the production default (args.mjsBACKSTOP_BASE_MS) are both 60 s. Vitest's per-test limit isBACKSTOP_BASE_MS + 5 s(65 s, as before).Why not the brief's bare formula. The call budget is 100 times the file's most calls, so a floor-only term does not cover a legal copy above CALL_FLOOR. The per-site term above covers it at the measured cost.
Model and daemon.
1f6b6348).check.mjsremember). The retention hook still sees every stored unit. Spin and no-progress cuts are still stored, so R55 (a)'s "a timed-out run reused after an edit" (a spin reuse) holds.RED and GREEN (constructed history, appended last, C-6). "a slow kill after a 22 s wait, past the old backstop": a copy waits 22 s and terminates under its call budget.
f893c81cwith the old 20 s base and the new model: fixed seed FAILS, "src/sut.ts:f0:31:if-false#0: killed by no progress, owed a behavioral law". The old backstop is the hostile mutant: it fails this history.292ea221(60 s base): fixed seed, random seed and determinism pass.Limits (open).
B3: CI time per job (run 45219880267, head
292ea221; the final heada2400c53differs only in removing the diagnostic job). Limit 10 min; target about 9 min.The 60 s base adds time to never-finishing copies. The #182 backstop history (determinism 1/7, 339 s) and the witness-module histories are the heaviest. Giving the hang witnesses a 2 s base cuts time but changes outcomes: the
w_iowaitcopy's legal I/O wait is longer than 2 s and is then cut where it should be killed (checked locally, reverted). Rebalancing the shards does not reach 9 min without cutting that cost. B3 is not met. This is reported to the maintainer as a cost of the higher backstop, as the brief requires.Shard partition. Both
e2e-shards.mjs checkandpr-shards.mjs checkpass at head.Windows shard 5/10. It fails on
every outcome class, the abort stop(SIGABRT). It failed on earlier runs before this change (45206108417, 45209800215, 45212505691, 45213410720), so it is the Windows 5/10 failure that the register attributes to main (#201), not the backstop.This pull request and its description were written by Isaac.