8000 docs: Wave 3 Reliability doc sync — 935 tests, Wave 3 complete by adityamukho · Pull Request #260 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,72 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Wave 3 Reliability — 2026-05-17

### Summary

Six PRs hardening the v1.0.0 codebase: WAL fault injection, storage/migration resilience, query correctness (property-based + coverage gates), long-haul smoke testing, and XTDB/Datomic semantic compatibility. No API changes, no file-format changes, no new runtime dependencies.

**PR #254 — #209 + #210 + #214: WAL Fault Injection**

- `FaultInjectingBackend` (`#[cfg(test)]`-only wrapper around `StorageBackend`) — configurable write-fail, flush-fail, read-fault injection
- 9 new WAL fault tests: write-fail propagation, flush-fail without data corruption, read-fault on WAL replay, CRC corruption discard, checkpoint atomicity under backend failure, partial checkpoint recovery via WAL replay, multi-writer serialisation, concurrent write+checkpoint, backend error propagation as `Err` not panic

**PR #257 — #215 + #216 + #217: Storage & Migration Resilience**

- `tests/migration_matrix_test.rs` — 5 migration tests: v7 round-trip, v3 empty migrate, corrupt magic returns `Err`, unsupported version returns `Err`, WAL replay idempotent
- `tests/index_corruption_test.rs` — 5 corruption-resilience tests: checksum mismatch triggers index rebuild, btree leaf/internal corrupt pages return `Err` without panic, root pointer mismatch handled, non-critical corruption still serves queries on good data
- 5 new concurrency stress tests in `tests/concurrency_test.rs`: stress readers during writer, failed write then success, rollback after partial work, open/write/checkpoint/query loop per thread, nightly stress loop (`#[ignore]`)

**PR #256 — #212 + #213 + #219: Property-Based Testing & Coverage Gates**

- `tests/property_test.rs` (proptest, `cfg(not(wasm32))`): 3 property tests — EAV model correctness vs naive reference evaluator, bi-temporal monotonicity, retract visibility invariant
- `.github/workflows/coverage-gates.yml` — per-module branch coverage thresholds; CI fails if coverage drops below gate

**PR #258 — #220: Long-Haul Smoke Suite**

- `tests/smoke_test.rs` (`#[ignore]` nightly): `smoke_large_graph_10_cycles` — 500 entities × 10 attributes × 10 update cycles; 7 invariants: active count (333), retracted count, fact count bounds, temporal snapshot integrity, prepared query consistency, recursive rule transitive closure, WAL checkpoint round-trip
- `.github/workflows/smoke.yml` — nightly 5am UTC, 15-min timeout, runs `--include-ignored`

**PR #259 — #221: XTDB & Datomic Compatibility Corpus**

- `tests/xtdb_compat_test.rs` — 10 semantic ports (Apache 2.0): EAV, tx-time `:as-of`, valid-time `:valid-at`, retraction (current + historical), Datalog join, negation, recursive rules, parameterised queries, combined bi-temporal
- `tests/datomic_compat_test.rs` — 9 independently written semantic ports: datom model, multi-entity attribute, tx-time `:as-of`, retract-entity, multi-variable `:find`, ground-value binding, parameterised query (prepared), named reusable rules, predicate expression filter

### Tests

935 tests passing (943 total, 8 ignored: 6 or+neg-cycle stratification doc tests, 1 nightly concurrency stress, 1 nightly smoke).

---

## Wave 2 Optimizer & Benchmarks — 2026-05-16

### Summary

Three optimisation PRs extending the Wave 1 performance work. No API changes, no file-format changes, no new runtime dependencies. Test count unchanged at 850.

**PR #249 — #207 + #206: Predicate Push-Down & Mixed Rule Optimization**

- `optimizer::plan()` extended to accept `Expr` (predicate/arithmetic) clauses; they are interleaved at the earliest position where all their variables are bound, minimising intermediate binding sets
- `StratifiedEvaluator` gains mixed-rule path: when a rule stratum contains both positive-only rules and rules with `not`/`not-join`, the evaluator now evaluates all positive rules first and applies negation filters in a second pass within the same stratum — eliminates a class of ordering-dependent bugs in cross-stratum negation

**PR #251 — #205: Cost-Based `not`/`or` Ordering**

- `optimizer::plan()` assigns selectivity estimates to `not`/`not-join` and `or`/`or-join` clauses; they are sorted after their ground-variable producers but before unconstrained pattern scans
- `not`/`not-join` blocks placed after the patterns that produce their join variables (was: end of plan regardless); `or`/`or-join` blocks placed by estimated output cardinality

**PR #253 — #229: SIMD Benchmarking & Crossover Analysis**

- `benches/simd_helpers.rs`: `valid_time_filter_simd`, `as_of_filter_simd`, `sum_simd_i64` — portable SIMD kernels using `wide::i64x4` / `u64x4`
- Criterion benchmark groups: `simd_temporal`, `simd_as_of`, `simd_aggregate` — scalar vs. SIMD crossover analysis at 1K–1M facts
- Analysis result: SIMD crossover occurs at ~8K–16K facts per query; scalar path preferred below that threshold; SIMD integration deferred to post-1.0 backlog pending real-workload profiling

### Tests

850 tests passing (844 passing + 6 ignored: confirmed `or`+neg-cycle stratification bug, deferred to post-1.0 backlog). All Wave 2 PRs are optimisations; no new integration tests added.

---

## Wave 1 Performance — 2026-05-15

### Summary
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
8000
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@ Auto-migrates v1/v2/v3/v4/v5/v6 → v7 on open/checkpoint.

## Test Coverage

**850 tests passing** (unit + integration + doc).
**935 tests passing** (unit + integration + doc).
See `TEST_COVERAGE.md` for the full per-file breakdown.

**Testing conventions** — see the Testing Conventions section below before writing any tests.

## Key Files for the Next Phase

Phase 8 is complete — v1.0.0 released. Phase 9 (Ecosystem & Tooling) is next.
Phase 8 is complete — v1.0.0 released. Wave 3 Reliability is complete. Phase 9 (Ecosystem & Tooling) is next.

Phase 9 relevant areas (see `ROADMAP.md` for full spec):
- `examples/` — end-to-end annotated examples (agentic memory, offline-first mobile, browser PWA)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ let r2 = pq.execute(&[("tx", BindValue::TxCount(2)), ("entity", BindValue::Entit

```bash
cargo run # interactive Datalog REPL
cargo test # run 850 tests
cargo test # run 935 tests
cargo run < demos/demo_recursive.txt # recursive rules demo
```

Expand Down
6 changes: 4 additions & 2 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -1662,6 +1662,8 @@ When evaluating features, ask:
- ✅ Phase 8.3d: Complete (April 2026) — Node.js `minigraf` on npm, 795 tests
- ✅ Phase 8: Complete (May 2026) — v1.0.0
- ✅ Wave 1 Performance: Complete (May 2026) — hash-join cluster + selective B+Tree lookup (#202, #203, #204, #208), 850 tests
- ✅ Wave 2 Optimizer & Benchmarks: Complete (May 2026) — predicate push-down (#207, #206), cost-based not/or ordering (#205), SIMD crossover analysis (#229), 850 tests
- ✅ Wave 3 Reliability: Complete (May 2026) — WAL fault injection, migration matrix, index corruption resilience, property-based testing, coverage gates, long-haul smoke, XTDB/Datomic compat (#209, #210, #212, #213, #214, #215, #216, #217, #219, #220, #221), 935 tests
- 🎯 Phase 9: Ongoing (Ecosystem — integration examples, cookbook, GraphRAG/LangChain examples)

**Note**: This is a hobby project. Timeline is flexible but realistic.
Expand All @@ -1681,7 +1683,7 @@ When evaluating features, ask:
- ✅ 8.3c: C FFI (GitHub Releases) — v0.24.0
- ✅ 8.3d: Node.js (npm) — v0.25.0

**Next**: Phase 9 — Ecosystem & Tooling (post-release optimisation and benchmarking first)
**Next**: Phase 9 — Ecosystem & Tooling (Wave 3 Reliability complete; moving to ecosystem, examples, and cookbook)

**Key Decisions Made**:
- ✅ Datalog query language (simpler, better for temporal)
Expand All @@ -1697,4 +1699,4 @@ See [GitHub Issues](https://github.com/project-minigraf/minigraf/issues) for spe

---

**Last Updated**: Wave 1 Performance Complete (May 2026) — 850 tests passing, v1.0.0
**Last Updated**: Wave 3 Reliability Complete (May 2026) — 935 tests passing, v1.0.0
Loading
Loading
0