Skip to content

fuzz: widen api_surface values and check root against a reference - #958

Draft
citizen-stig wants to merge 2 commits into
thrumdev:masterfrom
citizen-stig:fuzz/api-surface-root
Draft

citizen-stig wants to merge 2 commits into
thrumdev:masterfrom
citizen-stig:fuzz/api-surface-root

Conversation

@citizen-stig

Copy link
Copy Markdown
Contributor

Depends on #956

What

Two gaps in the api_surface fuzz target:

  1. Value sizes were 0, 1, 4096 or 4097 bytes only. It never produced normal inline values (2–1332 bytes), never hit the leaf overflow threshold (MAX_LEAF_VALUE_SIZE = 1332) and never produced multi-page overflow values. Sizes now cover 0, 1–32, 33–1331, 1332–1333 (both sides of the threshold), 1334–4096, 4097–8192 and 8193–32768 bytes.
  2. The root was never checked. The target only compared in-session reads. After every commit it now compares db.root() with nomt_core::update::build_trie over a BTreeMap model of the committed state, using Blake3Hasher::hash_value for value hashes. Bugs that corrupt the trie without breaking reads are now caught.

Not changed

No reopen or rollback in api_surface; grow_hashtable already covers those. Witnesses returned by finish() are still not verified.

Run

cargo +nightly fuzz run api_surface -- -max_total_time=600 -fork=8

🤖 Generated with Claude Code

citizen-stig and others added 2 commits October 22, 2026 10:01
Values now cover inline sizes, both sides of the leaf overflow threshold and
multi-page overflow values (up to 32 KiB) instead of only 0/1/4096/4097 bytes.
After every commit the database root is compared with build_trie over a
model of the committed state.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant