Repository navigation
fuzz: ops_sequence and corrupt_file targets that check results (#387) - #507
Merged
Merged
Conversation
ops_sequence decodes up to 32 storage operations (transact, retract, write transaction, checkpoint, reopen, crash) and compares the database with the reference model after each one. The model-based test's driver and checks move into tests/reference_model so the test and the target share one oracle; Checks::One reads one input-chosen shape per step. corrupt_file flips bytes and truncates a three-checkpoint file without fixing checksums: every query must fail or return the answers of the last generation or the one before it, all from the same one. A file cut to under one page opens as a new empty database (#506); skipped until that is fixed. Refs #387 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
PR B of #387 (spec:
docs/superpowers/specs/2026-10-09-fuzz-corpus-and-ops-target-design.md§5–§6). Refs #387.ops_sequencearbitrary::Unstructured) into up to 32 steps: transact, retract, a write transaction (commit or rollback), checkpoint, reopen (default, small cache, auto-checkpoint) and crash (open a copy of the file and WAL). The weights and pools are the same as in the proptest strategies.:as-of, and one input-chosen query shape and temporal clause against the reference model. Rejected statements must fail with the model's code.Op,Step,Probe,run) and its checks moved intotests/reference_model/mod.rs. The test and the target now use one oracle: the test runsChecks::All, the fuzzerChecks::One. A failed shape check names the probe by pool index, not by the query text, because aRefvalue's EDN contains aUuid.corrupt_file:valid-at,:as-of) and the tx count are recorded at each checkpoint.verify()runs too and must not panic.Seeds
ops_sequence: 4 inputs that between them cover every op kind.corrupt_file: no edits (read-write and read-only), a flip in each meta slot, a flip in a live internal, leaf, value and free-list page, and a truncation at the last page. The template layout is the same in every process (checked).Local runs
ops_sequence: 120 s, about 740 exec/s, clean.corrupt_file: 300 s, about 42 exec/s, clean once sub-page lengths are skipped.cargo test --test model_based_test --test property_testpasses, and the pre-push hook (fmt, clippy, tests) passes.The nightly
fuzz.ymlreads its targets fromfuzz/Cargo.toml, so both targets join the v3 run without a workflow change.🤖 Generated with Claude Code
https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h