Skip to content

test(oracle-gaps): bound the e2e tail; one edit sequence over the witness module - #39

Merged
KyleAMathews merged 7 commits into
mainfrom
feat/e2e-witness-edit-sequence
Nov 12, 2026
Merged

KyleAMathews merged 7 commits into
mainfrom
feat/e2e-witness-edit-sequence

Conversation

@KyleAMathews

Copy link
Copy Markdown
Contributor

The end-to-end gap oracle no longer generates a history that has both the witness module and law 9's edit steps. One constructed history keeps that combination in every campaign. This bounds the slow tail of the random units. It also makes every campaign judge law 9 over the witness module's outcome classes. The fixed-seed units that a pull request runs get cheaper too: 245 s locally, against 325 s on main.

Why the tail was long

The witness module holds the functions whose outcome classes generated histories rarely reach: hangs, slow kills, crashes, and framework errors. A cold run of a package with it takes about 20 s locally. Each edit step adds a cold run and a daemon check. A sample of 50,000 histories from the old grammar showed this:

  • 7.1% of histories had the witness module and at least 5 steps.
  • About one campaign in six drew a witness history with 8 or more steps.

On CI that is more than 10 minutes for one history.

The same mechanism made some fixed-seed units slow. A constructed history is built from a generated history, and after #37 two of them drew a base with the witness module and steps. "A declaration fault: missingSource" took 89 s, and "a declaration fault: brokenVitest" took 47 s.

What changes

  • The grammar narrows. A generated history with the witness module takes no steps. A map with an inverse does this, so fast-check still takes every kept history back and shrinks it.
  • One edit sequence over the witness module. The constructed history "an edit sequence over the witness module" has three steps:
    1. A test edit. The daemon then recomputes file a's runs, the hangs among them.
    2. A helper edit, which changes only file b. The daemon then reuses file a's timed-out runs.
    3. A revert.
  • A new required state. The history enters "a timed-out run reused after an edit". On the parent grammar the fixed-seed campaign reached it 0 times.
  • The brokenVitest fault takes no witness module, because its build adds steps.
  • A stated limit. The oracle's header and law.limits say that law 9 judges the witness module's outcome classes along this one sequence only. They name this oracle as the owner of the gap and the maintainer decision of 2026-11-11.

Cost and shards

The fixed-seed units, measured locally under the e2e lock:

unit main (908b1f9) this branch
an edit sequence over the witness module none 85 s
an edit sequence through the daemon 54 s 45 s
a declaration fault: missingSource 89 s under 1 s
a declaration fault: brokenVitest 47 s 7 s
all fixed-seed units 325 s 245 s

The two CI shards of the fixed seed (scripts/pr-shards.mjs) are repacked. The first takes the two edit sequences, and the second takes the other 30 units. Run as CI runs them, they took 140 s and 119 s locally. The shards' check passes, and the shards together select exactly what -t "fixed seed" selects.

The future full matrix (scripts/e2e-shards.mjs) puts the new history's three units in e2e-1 (determinism, 189 s), e2e-4 (fixed seed), and e2e-5 (random seed). Its check passes. Those shards are now above the 522 s of its packing, so they need a new packing from a full run before CI runs them.

What the history found

The history's first fixed-seed run found an intermittent law 9 violation. After the helper edit, the daemon reported a stale kill. #37 fixed that defect. With #37, this history's fixed-seed unit and determinism unit pass.

Verification

  • The fast gap suites pass (33,807 tests).
  • Both fixed-seed shards pass under the e2e lock (2 and 30 units).
  • Both shard checks pass.

This pull request and its description were written by Isaac.

KyleAMathews and others added 7 commits November 11, 2026 11:39
…ness module

A generated history with the witness module takes no steps: each step
adds a cold run of the witness module, and about one campaign in six drew
a history past the test's limit. The constructed history "an edit
sequence over the witness module" (test, helper, revert) keeps law 9
judged over the witness module's outcome classes in every campaign, and
enters the new required state "a timed-out run reused after an edit".
The grammar narrows through a map with an unmapper, so fast-check still
takes every history back. The limit is stated in the header and in
law.limits (maintainer decision, 2026-11-11, option M).

Held until D: the construction costs about 160 s locally, and its first
fixed-seed run found an intermittent law 9 violation (a stale daemon
kill after the helper edit), which is fixed separately.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
The constructed history "an edit sequence over the witness module" is a
fixed-seed, a random, and a determinism unit. They go to e2e-4, e2e-5,
and e2e-1, measured at 97 s, about 97 s, and 189 s locally under load.
That puts those shards near 620 to 710 s in the measured run's terms,
past the packing's 522 s, so the shards need a new longest-first packing
from a full run before CI runs them.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
With the witness module's edit sequence (85 s locally) and the generated
witness histories now taking no steps, the fixed-seed units cost 245 s;
the two edit sequences are 130 s of it, the other 30 units 115 s.

Co-authored-by: Isaac <no-reply@databricks.com>
@changeset-bot

changeset-bot Bot commented Nov 12, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2cc8316

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 no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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 12, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f8d87cea-a431-47d9-a8e7-6e7af9bffc84
  • 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

@pkg-pr-new

pkg-pr-new Bot commented Nov 12, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 2cc8316

@KyleAMathews
KyleAMathews merged commit 09f5b9d into main Nov 12, 2026
16 checks passed
@KyleAMathews
KyleAMathews deleted the feat/e2e-witness-edit-sequence branch November 12, 2026 07:31
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