# Native front-coding verification

Verified on 2026-11-17 against unmodified LevelDB 1.23 commit
99b3c03b3284f5886f9ef9a4ef703d57373e61be. Harness: CC0-1.0.
LevelDB remains under its upstream BSD license and is not redistributed here.

The 658 constructed cases compare complete serialized block bytes with the
accounting model, then use LevelDB's own reader for sequential decoding and
seeking every inserted key. They include 640 small-domain subset/interval pairs,
three published ledgers, three UTF-8 cases and twelve long-prefix cases crossing
127/128 and 16383/16384 byte boundaries. The empty block is included.
Published totals are 76, 48 and 34 bytes for restart intervals 1, 2 and 4.

All values are empty and keys are raw byte strings in bytewise order. This does
not execute DB::Put, internal-key encoding, file I/O, whole-block compression,
failure recovery or a throughput benchmark. It verifies this finite test domain,
not every input or every LevelDB version.

## Reproduce

Place the model, native C++ probe and native JavaScript driver in one directory.
Use Node, CMake, Git and a C++11 compiler. The observed compiler was GCC 13.3.0.
Run from that directory:

```sh
git clone --depth 1 --branch 1.23 https://github.com/google/leveldb.git leveldb
git -C leveldb rev-parse HEAD
# Verify the full commit above before building.
cmake -S leveldb -B native-build -DLEVELDB_BUILD_TESTS=OFF -DLEVELDB_BUILD_BENCHMARKS=OFF -DLEVELDB_INSTALL=OFF -DCMAKE_BUILD_TYPE=Debug -DHAVE_SNAPPY=OFF -DHAVE_CRC32C=OFF -DHAVE_TCMALLOC=OFF
cmake --build native-build --target leveldb -j 2
g++ -std=c++11 -Wall -Wextra -Werror -O0 -g -Ileveldb -Ileveldb/include -Inative-build/include front-coding-native.cc native-build/libleveldb.a -pthread -o front-coding-native
node front-coding-native.mjs ./front-coding-native
```

The driver produces a machine-readable receipt with exact input/output SHA-256
hashes. Compare it with front-coding-native.json. No random seed is needed.
