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;coreutilson 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:
scenario seed ops sha256 A inserts42 500 4b587ccce2627561c03d5db0c2c172642c9f3ed188c97fc53a215a3d0f316088B mixed7 500 9edbeec6436ee549c8a52b97f286831ed340c4bb588c6371542cdf0421e37718Matching 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 byte —
SplitMix64divergence or wrong initial nodeis_leafvalue. - 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
insertsscenario never invokesdelete, 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.shand the table above in the same commit.