Skip to content

fix(oracle-gaps): no wall-clock cut decides an outcome - #99

Draft
KyleAMathews wants to merge 150 commits into
mainfrom
fix/gap-cli-deterministic-cuts
Draft

KyleAMathews wants to merge 150 commits into
mainfrom
fix/gap-cli-deterministic-cuts

Conversation

@KyleAMathews

@KyleAMathews KyleAMathews commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This branch makes a gap-CLI count cut decide its outcome from the cut itself, not from which tests happened to run, and it bounds every history's wall-clock backstop. It also carries the merged work of the side branches fix99-attr, fix99-b4 and main (through #176, #195 and #206). The branch is a draft and is not ready for review yet: one known random-seed failure is open (below), and the precedence constructed histories are not yet in the oracle.

What changed

Fixes

Attributions and open items

Per-job times (merged head 7038156, run 45376762468, 60 jobs)

Job Result Time
Gap report end-to-end oracle (fixed seed, 1/5) success 7.1 min
(fixed seed, 2/5) success 6.2
(fixed seed, 3/5) success 6.8
(fixed seed, 4/5) success 6.6
(fixed seed, 5/5) success 7.6
(random seed, 1/5) success 5.6 min
(random seed, 2/5) success 7.5
(random seed, 3/5) success 5.4 min
(random seed, 4/5) success 5.3 min
(random seed, 5/5) success 7.4
(determinism, 1/8) success 5.9 min
(determinism, 2/8) success 8.8
(determinism, 3/8) success 7.9
(determinism, 4/8) success 10.2 (over 10)
(determinism, 5/8) success 10.2 (over 10)
(determinism, 6/8) success 6.9
(determinism, 7/8) success 7.6
(determinism, 8/8) success 8.2
Windows gap report end-to-end oracle (fixed seed, 3/10) success 14.0 (over 10)
(fixed seed, 8/10) success 6.2
(fixed seed, 10/10) success 7.5
Framework self-oracle (1 to 9 of 9) success 2.5 to 8.7

Every other job is under 10 minutes. The table lists the jobs above 6 minutes, the random and determinism shards, and every job over 10; the run page has all 60.

Limits

  • Precedence constructed histories and their mutants are not in the oracle yet. The three histories (a passing law's unclocked spin is a kill; a clocked spin is indeterminate; a failing law's spin is blocked) and a mutant for each are the next step. Existing histories cover the states but do not yet pin the precedence.
  • The twin constructed history for seed 1919642959's slow-owner case is not recorded: its base is not recoverable from the 2,000-character cap on the History line (oracle-property: the History line is capped at 2000 characters, so a failing history cannot be filed in full #185). The seed replays stand in for it.
  • The random 3/4 daemon race is reproduced only by replay (4 of 20), not by a deterministic constructed history.
  • The authored-mutant path (judgeAuthored, model's authored branch) uses the same clocked-cut label; a failing law's spin on an authored mutant is not covered by a constructed history.
  • Three jobs run over 10 minutes (determinism 4/8 and 5/8 at 10.2 min; Windows fixed 3/10 at 14.0 min). Repacking is needed before ready.
  • Limits prose in the oracle's limits string follows main's rewrite, with a sentence for fix(oracle-gaps): no wall-clock cut decides an outcome #99. The fuller list is here.
  • Not marked ready. Ready waits for the precedence histories, the 3 over-limit jobs, and the fix99-stop merge.

This pull request and its description were written by Isaac.

KyleAMathews and others added 8 commits November 14, 2026 16:37
…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
@changeset-bot

changeset-bot Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e2aab5a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes changesets to release 1 package
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

@coderabbitai

coderabbitai Bot commented Nov 15, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

KyleAMathews and others added 18 commits November 14, 2026 23:08
… 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>
@pkg-pr-new

pkg-pr-new Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/TanStack/oracles/@tanstack/eslint-plugin-oracles@99
npm i https://pkg.pr.new/TanStack/oracles/@tanstack/oracles@99

commit: e2aab5a

… 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>
KyleAMathews and others added 6 commits November 24, 2026 17:19
…opy early

Law: M "An excluded test still runs" (its calls count toward the copy's call
budget, its timers count toward idle) and the fixture emitter, which gates the
hang on `!flaky`: a flaky test never hangs, so its later parts run.

The model returned at the first hang row of any test, flaky or not, so a flaky
test's second part (its 19,999-call loop) was never counted. Seed -880625410
(RED on 50a2641: `f0:34:if-false#0: indeterminate, owed killed`): production
counts 2 x 19,999 x 3 calls, past the 100,000 budget, and cuts the copy by spin
at the second part; the model predicted a kill by a later deterministic test.

RED: seed -880625410 on 50a2641 (r99h-cap880-1, scratch with the caps lifted,
same production and model).
Co-authored-by: Isaac <no-reply@databricks.com>
…ever hang or loop

Law: the state "a failing law left its file's other laws judging" must be entered
by the constructed brokenOwner history (P4, constructed reach). A kept test that
hangs or loops (drawn, flaky or not) cuts the copy before file b's verdict test
judges. The override is per test (tests.map), so take-back still holds.

Reach: 5f75a4a made the model count a flaky test's later parts (the
seed -880625410 repair), which exposed this builder's reliance on the base's
hang fields; with the override the constructed history enters the state again.
Co-authored-by: Isaac <no-reply@databricks.com>
Law (register C 2026-11-24, "A verdict before a cut still kills"): a law verdict
from a judging test on a reproducible route, recorded before any cut, is a kill.
A later cut, the backstop included, ends the copy but never erases it, because
the first kill decides (P3). Soft verdicts (expect.soft, unnamed assertions)
count too.

Before: a verdict was kept only on its test's row, written at the test's end, so
a copy cut mid-test (the backstop, or a loop whose budget throw the test
swallows) lost it and was a timeout. Seed 311266498 (noTypescript,
reportAndPush:20:delete-call#0): test t1 takes an expect.soft verdict in its first
positive run, then a 30,000-call loop runs on into shrinking and the backstop.

After: each verdict is also written at once as an `early` row (capture-setup
recordVerdict). A cut copy reads its early rows (check.mjs earlyVerdictsOf) and
classify counts them as failures on their routes, so a reproducible one kills.
The rowsOf map skips early rows, so completed copies are unchanged.

Limits: a backstop cut still stays a gap when nothing was observed before it
(Backstops are fine, set high).
Co-authored-by: Isaac <no-reply@databricks.com>
…not only the broken owner's

Law 3 (the failing owner's replay runs exactly its failing test) with stream.mjs,
which prints a replay line for every failing oracle file, its first failed test,
in path order. The model gave a failing-law file a replay only when it was the
broken owner, so it owed the broken owner's replay where the baseline printed the
earlier file's failing law.

RED: seed 311266498, path 1 (random seed: generated) on 5d17f35: "the replay
command ... ran [a law that fails with no mutant active], owed only [broken (b.*)
... fixed seed 999]".
Co-authored-by: Isaac <no-reply@databricks.com>
…t that spins

Law: register C 2026-11-24 ("Every built-in cut by an excluded test ends the copy
as a gap") and M "An excluded test still runs" (its calls count toward the copy's
budget). A flaky test with a 19,999-call loop in each of two parts makes about
120,000 calls under the mutant, past the 100,000 budget, so the copy is cut by
count inside the flaky test and the kill test after it never runs: `indeterminate`.

Reach: the constructed history (appended last, constructed-order.json) and the
state "a flaky test's later part spins past the call budget", declared required
and entered when an indeterminate mutant comes from a flaky test with a later part.
The shard partitions list the three new units (fixed seed, random, determinism).
Co-authored-by: Isaac <no-reply@databricks.com>
…ns a function

The previous replay rule (37af89f) gave every failing law's file a replay line.
Fixed-seed shard 5 showed that a failing file owning no function prints none
(five units: "replay command undefined ran undefined"). The replay line is the
failing owner's (law 3), so the model now expects it only for a file that owns
a function. Seed 311266498 path 1 keeps its expected replay.
Co-authored-by: Isaac <no-reply@databricks.com>
KyleAMathews and others added 3 commits November 25, 2026 08:43
… enters its state

Its state moved out of `required` (which every constructed history enters) into
the states declaration, so "every outcome class" no longer has to reach it. The
history's flaky test is in file b: file a's loops are gated on seed 1, so under a
fixed seed they never run, which is why the copy did not spin.
Co-authored-by: Isaac <no-reply@databricks.com>
…seed -880625410

A hand-built history did not reach its state (its flaky loop never spun under the
fixed seed). The constructed history is now the captured counterexample of seed
-880625410, kept whole as a constant: its flaky test "t0 > check 0" in file b runs
a 19,999-call loop and its wait in each of two parts, so the copy of mutant f0:34
is cut by count in the second part and is `indeterminate`.
Co-authored-by: Isaac <no-reply@databricks.com>
…t be taken back

The captured history of seed -880625410 cannot be kept as a constructed or a
fixed history: the arbitrary cannot take it back (canShrinkWithoutContext is
false, #185). The state "a flaky test's later part spins past the call budget"
is therefore measured, not required, and the limit is recorded in the e2e
limits. Its constructed entry, constant and shard names are removed.
Co-authored-by: Isaac <no-reply@databricks.com>
KyleAMathews and others added 6 commits November 28, 2026 22:02
…and a failing law in an ownerless file owes none

Law 3 (the failing owner's replay runs exactly its failing test) with the
replay rule of 37af89f and 76a925c: a failing oracle file prints a replay
only when it owns a function, and the baseline's replay is the first such
file's. The driver observed the baseline's replay only for brokenOwner
plans, so a failing law's replay was never compared. That is why the five
fixed-seed 20261105 units read "replay command undefined ran undefined":
the observation was absent, not production silent. With the observation on,
those five pass on 2e73987, and the baseline prints the owner's replay.

The comparison now runs both ways for plans with a failing law or a broken
owner: the replay that ran must equal the model's owed replay, and when the
model owes none, no replay may be printed.

Law: a failing law's file that owns no function prints no replay (law 3,
"the failing owner's replay"; the rule in the brief for 76a925c).
Reach: state "a failing law whose file owns no function prints no replay",
declared in the required list and entered by the constructed history "a
failing law in a file that owns no function prints no replay" (file a owns
nothing, file b owns and judges the one function).
RED: local vitest on 2e73987 production with this commit:
  `-t 'fixed seed 20261105: a (failing law|heavy failing law)'` ->
  "the replay command ... ran [a law that fails with no mutant active],
  owed none" on the new history (1 failed, 5 passed).
Limits: the replay check covers only plans with a failing law or a broken
owner; outside-tests and load-failure replays are not modelled.
Co-authored-by: Isaac <no-reply@databricks.com>
…owns a function

The baseline printed a replay for every failing test file, and the model
(law 3, "the failing owner's replay") owes one only for a failing oracle file
that owns a function. A failing law in an owner-less file therefore got a
replay line the model did not owe (RED: the constructed history "a failing
law in a file that owns no function prints no replay" on 285c7a7).

The CLI now tells the printer which failing files may replay
(owners.mjs ownsFunction, check.mjs replays), so both sides apply one rule.
The baseline's first replay is the first failing owner's, as before.
Ordinary files and the outside-tests branch are unchanged.

Law: a failing oracle file prints a replay only when it owns a function
(law 3; the replay rule of 37af89f and 76a925c).
Reach: "a failing law whose file owns no function prints no replay" (the
constructed history above; 1 of 438 tests in the fixed-seed suite).
RED: 285c7a7 on 2e73987's production, the constructed history fails with
"the replay command ... ran [a law that fails with no mutant active], owed none".
GREEN: this commit; the six failing-law units pass locally (6 passed).
Mutant: replays forced to false for every file (no replay for any failing
law) fails the owner units ("owed only [a law that fails with no mutant
active]"), see the mutant run in the pull request body.
Limits: the outside-tests and load-failure replays keep printing for any
oracle file; a whole-file owns entry counts as owning a function only when
its source has functions.
Co-authored-by: Isaac <no-reply@databricks.com>
…stic-cuts-c

main's path gates (#246) take pr.yml; the branch's shard counts are
reapplied: fixed seed 5/5, random 5/5, determinism 9/9, gap oracles fast 4/4,
windows fixed seed 11/11, with the gated jobs unchanged. The new replay
history is added to the fixed seed, random seed, determinism, and windows
partitions and to e2e-shards.mjs, since no `rest` shard takes it.

Co-authored-by: Isaac <no-reply@databricks.com>
…-file replay, and none if it owns nothing

A describe's failing hook fails its file outside its tests, so the baseline
replays the whole file (`vitest run <file>`), which runs every test that ran.
The replay check now runs for every failing-law plan (285c7a7), so these
hook plans were checked for the first time, and the model owed no replay for
them: the RED on 0f97bf7's shard 5 was "the replay command
\"vitest run tests/a.test.ts\" ran [...], owed none" for "a failing beforeAll
around a law" and "a failing afterAll around a law that calls production",
whose file owns a function.

The model now owes the whole-file replay for such a file (replayedFile: the
count of its tests the baseline ran, which the whole file runs again), and
owes none for a file that owns no function. The driver compares a whole-file
replay by its command (no `-t`) and its count.

Law: the first failing owner's replay (law 3). A failing law's file that owns
a function replays the failing test, or, when it fails outside its tests,
the whole file; one that owns no function replays nothing.
Reach: the owner-less afterAll history enters the state "a failing law whose
file owns no function prints no replay" (its build is appended at the end).
RED: local `-t 'fixed seed 20261105: a (failing|heavy failing)'` on 23fb026's
production: "a failing afterAll in a file that owns no function prints no
replay": the replay ran [hooked a law..., writes to the console streams],
owed none (1 failed, 10 passed). The owner hook cases pass (GREEN here).
Limits: the whole-file count is the baseline's, not an independent count of
the file's tests.
Co-authored-by: Isaac <no-reply@databricks.com>
…no replay outside its tests either

The baseline's file-level replay (a file that fails outside its tests, such as
a describe's failing hook) printed for every oracle file, whether or not it
owns a function. The failing-law rule (law 3) covers that file too: it is a
failing law's file, so one that owns no function prints none, as the
test-level replay already does (0f97bf7). Ordinary files are unchanged.

Law: the first failing owner's replay (law 3); a failing law's file that owns
no function prints none.
Reach: "a failing afterAll in a file that owns no function prints no replay"
(constructed; enters the state "a failing law whose file owns no function
prints no replay").
RED: ea622e9 on 23fb026's production: "the replay command
\"vitest run tests/a.test.ts\" ran [hooked a law..., writes to the console
streams], owed none".
GREEN: this commit; local `-t 'fixed seed 20261105: a (failing|heavy failing)'`
11 passed, 430 skipped.
Mutant: scratch branch scratch/r99z-mut-noreplay (a failing law prints no
replay at all); the pool result is in the pull request body.
Co-authored-by: Isaac <no-reply@databricks.com>
…w, and the ownerless state is not every-outcome

Two faults in the replay check I added (ea622e9, 0f97bf7's test pair):

1. The gate was `plan.failingLaw !== undefined`, but a plan's `failingLaw` is
   `none` by default, so every plan was checked. RED: fixed seed 20261105
   "a declaration fault: setupThrows" on ee04980: "the replay command
   \"vitest run tests/a.test.ts\" ran [], owed none".
2. The state "a failing law whose file owns no function prints no replay"
   was in `required`, so `every outcome class` must enter it, and it cannot.
   RED: fixed seed 20261105 "every outcome class" on ee04980: "did not enter a
   failing law whose file owns no function prints no replay". It is now in
   `constructedOnly`, which keeps it out of the every-outcome history and
   stays declared in `required` for its own constructed histories.

The gate is now `failsALaw(plan)`: a plan with a failing law, or a broken
owner.
Law: the replay check is for the plans that have a failing law or a broken
owner (law 3); other plans owe nothing here.
GREEN: local `-t 'fixed seed 20261105: (a declaration fault: setupThrows|every outcome class|a failing (law|heavy|afterAll|beforeAll))'`:
13 passed, 428 skipped.
Limits: the other fault plans (setupThrows, did-not-load) are not checked for
the replay rule; their replays are the outside-tests branch of 1b? (see the
pull request body).
Co-authored-by: Isaac <no-reply@databricks.com>
KyleAMathews and others added 3 commits November 29, 2026 03:16
…ne owner file" is appended, not inserted

914823c placed this constructed history before recorded ones (after "a failing
law that spins under a mutant before a passing law"), so every later history's
base (seed + index) moved. The fingerprint canary requires new constructed
histories at the end (C-6), and it failed on 2e73987 as well.

RED: CI run 46248551785 on 16085b5, job "Test" (141301218745) and "Windows unit
suites" (141301255660): "appends new constructed histories, and never inserts
one before a recorded one", the listing has "a failing law's spin in one owner
file blocks a passing kill in another" at index 98.
GREEN: this commit moves the block to the end of the constructed list; local
`pnpm exec vitest --run tests/gap-report-history-fingerprint.test.ts` 4 passed.
The recorded names (oracle-gaps/constructed-order.json, main's list) are unchanged.
The moved history's own base changes; its shard names are unchanged.
Limits: the moved history's evidence (random seed 1675767311) is re-drawn.
Co-authored-by: Isaac <no-reply@databricks.com>
…owns a unit

CI run 46251491827 on 7eec5eb, random seed 4/5, seed -1191141657 path 0
("random seed: a failing owner under its parent's config"): the baseline
printed no replay for the broken owner file b, and the model owed
"broken (b.*) $x it's fixed seed 999". b owns no function here, so under the
rule (a failing law's file that owns nothing prints no replay) the model was
wrong. The model's broken-owner branch had no ownership check.

Law: law 3, as the rule of this branch: a failing law's file that owns a unit
replays; one that owns none prints none. Authority: the maintainer's rule as
stated for this change (a failing law's file that owns no function prints no
replay); "function" is read as "function or module data", the CLI's owned
unit, so an owner of module data replays too (flagged for the maintainer).

Fixes in the same commit:
- model: the broken owner's replay is owed only when the file owns a unit
  (ownsAnyFunction); ownsAnyFunction counts module data owned by the file
  (plan.history.dataOwners).
- constructed history "a failing owner under its parent's config": the failing
  owner now owns the function (owners [b], judging in b), so its replay is
  owed; its state was unreached on the random base (no replay printed).

RED: CI 46251491827 random 4/5 (job 141312295066) and local repro of the same
seed; the model owed the replay, production printed none.
GREEN: local repro passes; `-t 'failing owner'` 9 passed; `-t 'fixed seed
20261105: a (failing|heavy failing)'` 11 passed; fingerprint canary, pr-shards
and e2e-shards checks pass.
Mutant: a production gate that prints every broken owner (no ownership) fails
the owned broken-owner units (r99z-mut3 kills the replay family; the
brokenOwner cases in the fixed seeds).
Limits: the random seed's replay is one draw; the module-data reading of
"function" is a maintainer decision and is recorded in the away-log.
Co-authored-by: Isaac <no-reply@databricks.com>
Determinism 4/9 took 10.7 minutes on CI run 46255225033 (7bd7237), over the
10-minute job limit. The shard lists were balanced by earlier weights. Each
test's measured duration comes from the verbose logs of the nine determinism
shards on the pool (16085b5, 119 tests that ran; 15 skipped on Linux have no
time and are spread by count). Longest-first assignment gives nine bins of
275 to 276 s each. The CI per-job times were not per-test, so the check is the
next CI run's per-job times.

Partitions: pr-shards and e2e-shards checks pass.
Co-authored-by: Isaac <no-reply@databricks.com>
KyleAMathews and others added 3 commits November 29, 2026 06:02
…ns x 1.65

CI run 46261301537 (14f1d34) had determinism 9/9 at 11.6 min and 8/9 at 10.2
min on nine shards. CI per-test times are not in the job logs, so the repack
uses the pool's per-test durations scaled by the measured CI factor (~1.65):
ten bins of ~6.8 min estimated CI weight. The matrix and the job name move to
/10; both shard checks pass.

Co-authored-by: Isaac <no-reply@databricks.com>
Determinism 9/10 took 10.0 min on run 46265370483 (a845b55). One unit (the
first half of "an edit sequence over the witness module", 92 s of pool time)
moves from shard 9 to the lightest shard, 7. Both shard checks pass.
Co-authored-by: Isaac <no-reply@databricks.com>
The shards of the random, determinism, and Windows fixed-seed jobs were
packed from Arclet timings scaled by an estimate. CI disagreed: determinism
9/10 ran 11.5 min on 985b804.

scripts/pack-shards-from-ci.mjs fetch reads the verbose logs of recent runs
into scripts/ci-durations.json, with the run ids. pack takes each test's
longest passing time across the runs, adds each job's measured setup, packs
longest-first into the shard counts, and writes scripts/ci-packed-shards.mjs,
which pr-shards.mjs reads. A failing test's time is charged only when no run
passed it: Windows fixed seed 3/11 "every outcome class" failed in run
46268858514 at 616 s, against 215 s and 219 s in the passing runs. A test
with no printed time is charged 300 ms.

Predicted per job: determinism 10 shards at about 7:44; random 5 shards at
about 8:41; Windows fixed seed 11 shards at 5:11 to 5:17. No shard count
changed, and the pr.yml matrices are unchanged.

The Linux fixed-seed job ran without the verbose reporter, so its log had
no test times. It keeps its hand-written shards (slowest measured job 8:03)
and now runs with --reporter=verbose, so a later pack can measure it.

Durations from runs 46268858514 (985b804), 46265370483 (a845b55), and
46261301537 (14f1d34).

Co-authored-by: Isaac <no-reply@databricks.com>
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.

1 participant