Simplify crossed dispatch and add SMT-derived cases

Drop the redundant begin.offset split in crossedCompleteOvershoot and
the rE > 0 guard in closedFormForwardSaturated; both are implied by
the call-site invariants.

Add an SMT-derived empty-interval case as the smt_cases CTest and as a
committed fuzz_readable seed.  run-fuzz.sh now loads the read-only seed
corpus alongside the writable one.

Rename exhaustive to sweep and document that it is exhaustive only
over its bounded family of instances.
This commit is contained in:
andrew committed 2026-11-18 13:03:55 -05:00
1 parent 7a41d1f647
commit a0b68d148b
9 files changed
+72 -50

No files matched your search

Binary file not shown.
+10
View File
@@ -0,0 +1,10 @@
# Hand-picked readable instances that the deterministic sweep and the
# Lean-generated corpus did not cover. Format matches `oracle/golden.txt` and
# is consumed by `diff_corpus`.
#
# z3 model for the `cardKO` empty-interval mutation (`NatInf::of(0)` ->
# `NatInf::of(1)` in `fast.cpp`): a reversed, truncated read whose reported
# prefix contains keys at or above `begin.key`. The mutated cardinality flips
# `finiteUnderCond` and moves the upper endpoint from `after(firstKey)` to
# `begin.key`.
610100 -1 610080 3 1 1 3 6102 6101 61 => 61 610200
@@ -1,13 +1,15 @@
// Released under Apache 2.0 license as described in the file LICENSE.
// A deterministic exhaustive sweep of small readable instances, comparing the
// literal translation with the summarised implementation.
// A deterministic sweep over a finite class of small readable instances,
// comparing the literal translation with the summarised implementation.
//
// The fuzzers sample readable instances; this test enumerates them: every
// sorted database (up to four keys) over a fixed universe of interesting keys,
// every selector key (including ⊥ and ⊤) paired with offsets in [-3, 5], and
// every readable result (the complete traversal, each nonempty truncated
// prefix, or the empty result when the traversal is empty) in both directions.
// It is exhaustive over this bounded family, but not over the input space.
// The fuzzers sample readable instances; this test enumerates a fixed finite
// family: every sorted database (up to four keys) over a fixed universe of
// interesting keys, every selector key (including ⊥ and ⊤) paired with offsets
// in [-3, 5], and every readable result (the complete traversal, each nonempty
// truncated prefix, or the empty result when the traversal is empty) in both
// directions.
//
// Together with `golden_test`, `diff_corpus`, and `extreme_test`, this covers
// every line and branch side of `src/fast.cpp`.
@@ -110,6 +112,6 @@ int main() {
run(db, keys, cases, bad);
}
std::printf("exhaustive: %lld cases, %lld mismatches\n", cases, bad);
std::printf("sweep: %lld cases, %lld mismatches\n", cases, bad);
return bad == 0 ? 0 : 1;
}