8000 test(storage): Wave 3 PR 3 — migration matrix, index corruption, concurrency stress (#215, #216, #217) by adityamukho · Pull Request #255 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

test(storage): Wave 3 PR 3 — migration matrix, index corruption, concurrency stress (#215, #216, #217) - #255

Merged
adityamukho merged 17 commits into
mainfrom
wave3/pr3-storage
May 16, 2026
Merged

adityamukho merged 17 commits into
mainfrom
wave3/pr3-storage

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

Wave 3 PR 3 — Storage / Migration Reliability

Closes #215, #216, #217.

Changes

  • tests/migration_matrix_test.rs — 5 tests (test: add index corruption recovery and rebuild fixtures #215):

    • v7_round_trip_is_idempotent — write, checkpoint, reopen, verify facts survive
    • v3_empty_migrates_without_error — minimal v3 header opens without error
    • corrupt_magic_fails_loudly — bad magic returns Err with descriptive message
    • unsupported_version_fails_loudly — version=99 returns Err
    • wal_replay_after_migration_is_idempotent — WAL replayed correctly after crash simulation
  • tests/index_corruption_test.rs — 5 tests (test: add legacy file-format migration matrix and corruption fixtures #216):

    • corrupted_header_checksum_does_not_panic — checksum flip: no panic; facts readable if open succeeds
    • corrupted_btree_leaf_page_does_not_panic — leaf page XOR: no panic
    • corrupted_btree_internal_page_does_not_panic — internal page XOR: no panic
    • root_page_pointer_mismatch_does_not_panic — u64::MAX root pointer: no panic
    • query_results_after_non_critical_corruption_match_original — non-critical corruption: facts still readable
  • tests/concurrency_test.rs — 5 new stress tests appended (test: add concurrency stress tests for read/write transactions and rollback paths #217):

    • stress_readers_during_writer — 8 reader threads + 1 writer (50 facts), Arc<AtomicBool> termination
    • failed_write_followed_by_successful_write — parse error doesn't corrupt DB state
    • rollback_after_partial_work — WriteTransaction::rollback() leaves no side effects
    • open_write_checkpoint_query_loop_per_thread — 4 independent threads × 20 facts each
    • stress_open_write_loop_nightly — #[ignore] nightly: 8 threads × 200 facts

Test counts

Suite Tests Status
migration_matrix_test 5 ✅ all pass
index_corruption_test 5 ✅ all pass
concurrency_test (new) 4 CI + 1 #[ignore] ✅ CI pass

🤖 Generated with Claude Code

adityamukho and others added 17 commits May 15, 2026 15:19
…le optimization)

Covers issues #207 and #206: extends optimizer::plan() to accept Expr
clauses and interleave them at the earliest position where their variables
are bound, and routes the StratifiedEvaluator mixed-rules path through
the updated planner.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d rules)

TDD plan covering optimizer.rs, matcher.rs, executor.rs, evaluator.rs,
and a new Criterion benchmark. 9 tasks, each with exact file paths,
code blocks, and expected test output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…#205)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add a concise 'WASM omission' comment at every existing and planned
#[cfg(not(feature = "wasm"))] ordering gate explaining why sorting is
disabled on WASM targets (small datasets, deterministic behaviour).
The full rationale lives in the selectivity_score() doc comment;
all other sites reference it with a short cross-reference.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers all 11 issues (#209, #210, #212, #213, #214, #215, #216, #217,
#219, #220, #221) across 6 PRs. Key decisions: cargo-fuzz for binary
fuzzing, FaultInjectingBackend wrapper for fault injection, proptest +
reference evaluator for semantic property tests, cargo-llvm-cov for
coverage gates.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- PR 1: foundation (FaultInjectingBackend, fuzz/ crate, proptest)
- PR 2: WAL cluster (#209, #210, #214)
- PR 3: storage/migration (#215, #216, #217)
- PR 4: query correctness (#221, #213, #212)
- PR 5: long-haul smoke suite (#220)
- PR 6: XTDB/Datomic compat corpus (#219)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…hread loops)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…view

- corrupted_header_checksum_does_not_panic: add query assertion in Ok branch
- corrupt_magic_fails_loudly: assert error message describes corrupt magic

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
codecov Bot commented May 16, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@adityamukho
adityamukho merged commit 212b195 into main May 16, 2026
36 checks passed
@adityamukho
adityamukho deleted the wave3/pr3-storage branch May 16, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant

0