8000 test: prove format-v8 scalar key decoders (#693) by adityamukho · Pull Request #784 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

test: prove format-v8 scalar key decoders (#693) - #784

Merged
adityamukho merged 3 commits into
v3from
feature/693-decoder-proofs
Oct 29, 2026
Merged

adityamukho merged 3 commits into
v3from
feature/693-decoder-proofs

Conversation

@adityamukho
@adityamukho adityamukho commented Oct 29, 2026 •
Copy link
Copy Markdown
Collaborator

Summary

Prove the format-v8 scalar key decoders before the v3.0.0 cut, as requested in #693. The earlier issue note deferred this to avoid rework before the v8 key format settled; it did not identify a correctness prerequisite for waiting.

  • Extract nonallocating pure decoders for unsigned/signed integers, descending transaction counts, valid-to times, float payloads, and scalar tagged values. Keep Reader's key bytes, public API, INT-049 messages, and cursor positions unchanged.
  • Add 17 Kani decoder harnesses to the 12 existing encoder harnesses. They prove symbolic round trips with a suffix and bounded malformed-input behavior. Keep String/Set and anyhow mapping under differential, fuzz, and property coverage.
  • Compare the refactored reader against a test-only copy of the old reader on every 0–2 byte input, seeded longer inputs, and explicit boundary cases, including String/Set escapes and error positions.
  • Synchronize the v3 docs and cap the Kani workflow at the measured -j 4. The matching default-branch workflow change merged in ci: cap scheduled Kani proof concurrency (#693) #783; the version-scoped docs-site companion is docs: describe v3 scalar key decoder proofs (#693) minigraf-docs#83 (draft until this code lands).

The approved design and plan are committed in docs/superpowers/specs/2026-10-29-693-decoder-proofs.md and docs/superpowers/plans/2026-10-29-693-decoder-proofs.md. Claude reviewed both before implementation and reviewed the final diff; its follow-up reported no remaining findings.

Verification on the bench machine

  • cargo kani --lib -j 4 --output-format terse -Z unstable-options --harness-timeout 10m: 29/29 passed; slowest final harness 72 s. The measured 29-harness set used 7.6 GiB aggregate CBMC peak RSS at -j 4, under the 16 GiB CI runner budget.
  • cargo test: 1,983 active tests passed; the final patch has 17 ignored tests. Final strengthened key tests also passed separately: 24 passed, both default and test-hooks.
  • cargo clippy --all-features -- -D warnings, cargo fmt --all --check, and WASI test compilation (cargo test --target wasm32-wasip1 --lib --tests --no-run) passed.
  • cargo build --release: 1,258,936 bytes versus the 1,259,520-byte gate (584-byte margin); baseline was 1,258,712 bytes (+224 bytes).
  • One-off same-binary optimized diagnostic on two NUMA nodes (removed after measurement so ignored timing code does not lower patch coverage): scalar integer decode 25.0 ns old / 19.4 ns new; six-component key decode 108 ns old / 49 ns new. Committed B+tree point-read Criterion medians in an idle same-node ABBA run were 30.9/32.1 µs baseline and 32.4/31.5 µs changed, with overlapping results. The 100k in-memory attribute scan was within about 1%. The in-memory point control varied, but that path uses FactStorage without v8 key decoding.

Refs #693. The issue should close when this v3 PR merges, following the repository's non-default-branch issue policy.

@codecov
codecov Bot commented Oct 29, 2026 •
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.37759% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/storage/keys/legacy_verification.rs 98.73% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@adityamukho
adityamukho merged commit 9117392 into v3 Oct 29, 2026
20 checks passed
@adityamukho
adityamukho deleted the feature/693-decoder-proofs branch October 29, 2026 02:20
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

0