Skip to content

test: tier budgets, remaining scenarios, oracle shop corpus and maintained adapter, TESTING.md (T-13..T-16) - #403

Merged
jsam merged 2 commits into
mainfrom
fm/t-bundle-b
Oct 6, 2026
Merged

jsam merged 2 commits into
mainfrom
fm/t-bundle-b

Conversation

@jsam

@jsam jsam commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Implements the remaining test-strategy issues in one PR: tier budgets (T-13), the remaining scenarios (T-14), the oracle's shop corpus and maintained adapter (T-15), and the TESTING.md rewrite (T-16).

Closes #347, closes #348, closes #349, closes #350.

CI workflow parts skipped. Hosted CI is paused (#396), so no workflow file changes. The budget step is make test-budget / scripts/check-test-budget.py; wiring it into ci.yml after Per-binary test times is one step once CI resumes. Checks were run locally (below).

T-13 Tier budgets (#347)

  • tests/budget.toml: unit = 60, component = 180, scenarios = 120, specs = 60, oracle_pr = 20 seconds, tolerance 25 percent, and the path-to-tier map (src/ unit, tests/scenarios/ scenarios, tests/differential_oracle/ oracle_pr, other tests/ component; doc tests unit). A binary that maps to no tier fails the check.
  • scripts/check-test-budget.py sums each tier from the finished in time of every binary in a cargo test log and from the spec runner's new Specs finished in line. It fails a tier over budget + 25 percent, names that tier's slowest binaries, and writes tests-timing.json (schema inputlayer.test-timing.v1). It reads downloaded GitHub Actions job logs as-is (timestamps stripped). make test-budget runs the PR gate's tests (unit-test, then every spec on the debug binaries) and checks them.
  • oracle_pr is 20 s, not 15. Firstmate's decision on calibration: CI measured 14.4/16.8/19.9 s before this PR, and the shop corpus adds about 1.3 s.
  • Acceptance 2 is not met; recorded as decided. On three recent CI Tests logs (jobs 112041704631, 112043367292, 112065632388) the component tier was 147.4/154.5/184.6 s against its 225 s limit. With 30 s added to ws_cancel_tests it reads 177/184/215 s, so the check still passes. Run-to-run noise (147-185 s) rules out tightening the tier instead. The follow-up is a per-binary growth check against a measured baseline: Testing: per-binary test time growth check against a measured baseline (T-13 follow-up) #398. On those same logs (acceptance 1) unit is 56-70 s, scenarios 16-18 s and oracle 14-20 s, all within limits.
  • The shop pack's 200 ms budget is now a perf fixture. shop_install is in the perf gate's default fixtures. It installs Fixture::shop_pack(Size::Small) (from the testkit, sent as Fixture::programs(), the same programs install sends) into fresh graphs, 20 per round, checking the anchor rows. A new [ceilings] table in perf-gate/policy.toml holds shop_install.install_us.p50 to an absolute 200,000 µs. A breach fails the gate whatever the baseline did; a ceiling whose fixture did not run is not judged. The report gets a "Ceilings (absolute)" table, with unit tests for breach, hold and not-run.

T-14 Remaining scenarios (#348)

Scenario Test Required today Expected failure
S10 embedding change updates a live similarity rule vectors::s10_* move item 1 (4 rows out, 4 in; item 1 stays its own neighbour), closer candidate (1 in, displaced 1 out), delete (refill); every delta exact against a fresh query and the write's revision; every answer equals brute-force cosine search; a second run on a fresh engine delivers identical snapshot, deltas and revisions near read evaluates the rule (#327); vector read at: r (#315, then #328)
S11 index on a view follows the view vectors::s11_* the view's rows through a base write, a rule replacement and a restart index on the view (#325): today .index create view_idx on low_vec(V) is refused "No schema found for relation 'low_vec'"
S13 failover mid-scenario failover::s13_* sync-shipping primary + follower on the shop pack; agents on both hear the stock write and the expect_revision claim; after killing the primary the follower holds every acknowledged change, equals both agents' views, refuses writes store_read_only; a claim at the dead primary's revision is refused and applies nothing promotion and a once-only claim on the new primary (#285): POST /v1/replication/promote is 404
S14 limits refuse cleanly while others continue limits::s14_* 20 agents hear the writer's delta while one connection is refused four times, three ways: cross product over max_query_memory_bytes (resource_exhausted, in flight during the write), a 1,025-deep term (validation, "nesting exceeds the limit"), top_k 3e17 (validation), a 6,000-fact write past max_graph_memory_bytes (resource_exhausted, nothing applied); the refused connection keeps answering; all 20 hear the next write none
S16 mode equivalence modes::s16_*, make test-scenarios-modes S9b's live history in recompute the same history in maintained mode with identical snapshots, deltas, revisions and write replies (#309: mode not available). make test-scenarios-modes runs the whole suite once per mode, maintained allowed to fail until V9 (#315)

Testkit additions: EngineBuilder::try_views returning Violation::Unavailable (new variant; views() keeps its panic), Refusal::parse_errors / Refusal::names (a refused unparsable program's validation_errors, so S14 can tell the nesting limit from another parse error), Fixture::programs public. make test-scenarios added.

Findings while writing them (behaviour as it is, asserted as such):

T-15 Oracle corpus and maintained adapter (#349)

  • tests/differential_oracle/shop.rs adds the shop pack as a corpus pack: the pack with writes through each construct and a restart, plus S9's and S9b's histories. corpus::check_shop_pack runs them through every adapter (shop_pack_corpus_agrees_across_all_adapters), and the reference must model all of it. S9's writes are defined there once: tests/scenarios/retraction.rs now pairs them with the deltas each step must deliver, and oracle_check takes the same History.
  • maintained adapter: RecomputeAdapter::open_maintained on an EngineHost::open_in(Mode::Maintained). INPUTLAYER_ORACLE_VIEWS=maintained make oracle-test adds it to every history (and runs the soak's server in that mode). On main every oracle test fails with engine.views = "maintained": mode not available on this engine (V2 #309 adds it), never a pass. V2 sets engine.views in engine.rs::config.

T-16 Documentation (#350)

  • TESTING.md replaced, using the strategy draft's structure (tiers with budgets and where each runs, the "where a new test belongs" decision table, rules, flake policy, scenario catalogue S1-S18 with status), carrying over everything accurate from the old file. Every make target it names exists (checked by script). D1's edit at the old TESTING.md:228 ("rule catalog changes") is kept.
  • CONTRIBUTING: pre-PR section points at the decision table, the benchmark-host pre-PR, the milestone 9 mode matrix and maintained oracle, removing XFAIL markers, and the budgets. The stale Testing section (examples/datalog/) is now the tier table.
  • docs/internals/README.md: stale test counts (and the nonexistent 01_basics/ list) replaced by a pointer to TESTING.md.

Local checks (lean debug, MemoryMax=16G, CARGO_BUILD_JOBS=8)

Check Result
make fmt-check pass
make lint (clippy, all targets, -D warnings) pass
make perf-gate-check (perf-gate clippy + 68 unit tests incl. ceiling tests) pass
make pre-pr-selftest (Makefile/scripts changed) pass, 5 tests
make unit-test (whole workspace: 90 binaries incl. scenarios 42 passed / 1 ignored-in-debug saturation, oracle 10) pass. XFAIL list: #285, #309, #314, #315, #316, #317, #318, #320, #325, #327
specs, all, debug binaries (run_snapshot_tests.sh --debug --skip-build) 1,148 passed, 0 failed, 7 skipped (pending)
scenario suite repeated 5x on 4 pinned cores 5/5 pass (46-49 s each on this devbox)
INPUTLAYER_ORACLE_VIEWS=maintained make oracle-test fails as required, every test naming "mode not available"
budget check on the local run unit 49 s, scenarios 16 s, oracle 16 s within; component 331 s and specs 92 s over on this busy devbox (fsync-bound nesting_depth_tests 118 s, wal_transaction_recovery 54 s), as TESTING.md says a busy box runs 2-3x the CI runner. The CI logs above are the calibrated measure
RUSTDOCFLAGS=-D warnings cargo doc -p inputlayer-testkit pass. Workspace make doc-check fails on main already (src/storage_engine/snapshot.rs:48 private intra-doc link from #390, untouched here)
perf gate shop_install A/A, release server, 10 rounds, local devbox pinned to 8 cores (load 15-27) ceiling PASS: p50 70.7 ms vs 200 ms
SDK suites not run: no SDK, protocol or spec-doc inputs changed

One unexplained one-off in the first full run: the oracle's subscription[group] engine refused a rule insert with ENOENT on corpus case 14_aggregations/16_empty_agg_edge_cases while a second oracle run was going on. Four oracle reruns and the full rerun passed. Tracked as a flake: #401.

Benchmark host: the release shop_install run is queued under ~/perf-gate-remote/lock (~/bench/t-bundle-b-out/, about 18 jobs ahead); its report goes on this PR as a comment when it lands.

jsam added 2 commits October 6, 2026 05:52
…ained adapter, TESTING.md (T-13..T-16)

T-13 (#347): tests/budget.toml and scripts/check-test-budget.py sum each
tier's run time from a cargo test log (and the spec runner's new
"Specs finished in" line), fail a tier 25 percent over budget and write
tests-timing.json; make test-budget runs the PR gate's tests and checks.
The perf gate's shop_install fixture installs the shop pack and holds its
p50 to an absolute 200 ms ceiling (new [ceilings] in policy.toml).

T-14 (#348): scenarios S10/S11 (vectors), S13 (failover), S14 (limits)
and S16 (mode matrix, make test-scenarios-modes), each green or an
expected failure naming its issue.

T-15 (#349): the oracle's corpus gains the shop pack and S9's histories
(shared with the scenario), and INPUTLAYER_ORACLE_VIEWS=maintained adds
a maintained adapter that reports the mode as unavailable until V2.

T-16 (#350): TESTING.md replaced (tiers, decision table, budgets, flake
policy, scenario catalogue), CONTRIBUTING pre-PR and testing sections,
stale test counts removed from docs/internals/README.md.
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.

Testing: Documentation (T-16) Testing: Oracle corpus and maintained adapter (T-15) Testing: Remaining scenarios (T-14) Testing: Tier budgets (T-13)

1 participant