8000 test(storage): Kani proofs of encode_value (#627) — backport by adityamukho · Pull Request #691 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

test(storage): Kani proofs of encode_value (#627) — backport - #691

Merged
adityamukho merged 3 commits into
mainfrom
test/627-kani-v2
Oct 22, 2026
Merged

adityamukho merged 3 commits into
mainfrom
test/627-kani-v2

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

Refs #627. Backport of #690 (v3) per the spec (docs/superpowers/specs/2026-10-22-kani-storage-encoding-design.md §3.2, §7 step 3). Test-only: no library, v7 format or WAL change.

What

  • src/storage/index/verification.rs (5 Kani harnesses, identical to v3): encode_value — Null = [0x00]; Boolean/Integer/Float/Ref each with its own type byte and order-preserving (non-NaN floats by total_cmp); every NaN encodes the same. On main, encode_value is the value_bytes of the on-disk v7 indexes.
  • Cargo.toml: [workspace.lints.rust] unexpected_cfgs check-cfg for cfg(kani).
  • .github/workflows/kani.yml: byte-identical to v3's. This copy drives both nightly crons (06:00 main, 18:00 v3), since scheduled runs use the default branch's file. The keys.rs path filters are inert on main.
  • Docs: TEST_COVERAGE.md, CLAUDE.md, CHANGELOG.md [Unreleased] → Tests.

Left out: the 7 keys.rs harnesses on v3 — main has no keys.rs (v8 key encoding). Where NaN sorts in encode_value is not asserted: it sorts before -0.0, filed as #688 (doc-only, no result depends on it).

Verification

  • Bench machine, Kani 0.68.0, the workflow's args: Complete - 5 successfully verified harnesses, 0 failures, 5 total. 14 s wall, 0.5 GB peak RSS.
  • Mutation: Ref bytes reversed → encode_value_ref_preserves_order fails (all 5 mutations checked on v3, identical code).
  • cargo build (no unexpected cfg warning), clippy -D warnings, fmt, pre-push tests clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz

adityamukho and others added 3 commits October 22, 2026 21:46
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz
@codecov
codecov Bot commented Oct 22, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@adityamukho
adityamukho merged commit 9179fd0 into main Oct 22, 2026
23 checks passed
@adityamukho
adityamukho deleted the test/627-kani-v2 branch October 22, 2026 17:32
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