db-10 — Verification

Prerequisites

  • macOS or Linux with Apple Clang / clang ≥ 14 / gcc ≥ 11.
  • cmake ≥ 3.20.
  • Rust toolchain ≥ 1.74.
  • Go ≥ 1.22.
  • shasum, xxd, awk (default on macOS; coreutils on Linux).

One command

cd db-10-btree-fundamentals
scripts/verify.sh        # unit tests, all three languages
scripts/cross_test.sh    # cross-language sha256 match

Both should print === OK === / === ALL OK === and exit 0.

Per-language drill-down

Rust

cd db-10-btree-fundamentals/src/rust
cargo test --quiet
cargo build --release

Expected: all inline tests pass. The btreectl binary lands in target/release/btreectl.

Go

cd db-10-btree-fundamentals/src/go
go test ./...
go build ./cmd/btreectl

Expected: ok github.com/10xdev/dse/db10 <duration>.

C++

cd db-10-btree-fundamentals/src/cpp
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j
ctest --test-dir build --output-on-failure

Expected: 100% tests passed, 0 tests failed out of 1 and the test_btree10 target prints OK.

What "green" means

A green run guarantees:

  • All inline unit tests pass in Rust, Go, and C++.

  • The cross-language test produces byte-identical serialized trees for both canonical scenarios:

    scenarioseedopssha256
    A inserts425004b587ccce2627561c03d5db0c2c172642c9f3ed188c97fc53a215a3d0f316088
    B mixed75009edbeec6436ee549c8a52b97f286831ed340c4bb588c6371542cdf0421e37718

    Matching sha256 across three independent implementations proves agreement on the PRNG, the lexicographic compare, the proactive- split insert, the proactive-rebalance delete, and the precise tree shape after the workload.

  • The spot-check confirms the stream is non-empty and contains an expected key prefix, guarding against the regression where all three languages "successfully" produce the same five-byte empty-tree header.

When verification fails

  • Cross-language sha256 mismatch on the very first byteSplitMix64 divergence or wrong initial node is_leaf value.
  • Mismatch deep in the stream after matching headers — split or rebalance asymmetry; almost always a borrow-vs-merge decision that goes one way in two languages and the other in the third.
  • One language's scenario A matches but scenario B does not — a delete-path bug specific to that language. The inserts scenario never invokes delete, so it would not exercise the faulty path.
  • All three sha256s match each other but disagree with the baked-in expected hashes — a legitimate algorithm change. Make sure it was intentional, then update cross_test.sh and the table above in the same commit.