8000 docs(spec): Kani proofs of the storage encodings (#627) by adityamukho · Pull Request #689 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

docs(spec): Kani proofs of the storage encodings (#627) - #689

Merged
adityamukho merged 2 commits into
v3from
docs/627-kani-spec
Oct 22, 2026
Merged

adityamukho merged 2 commits into
v3from
docs/627-kani-spec

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

Spec for #627: docs/superpowers/specs/2026-10-22-kani-storage-encoding-design.md.

Prototyped and measured with Kani 0.68.0 on the bench machine before writing it.

  • In scope: 12 harnesses over the byte encoders. On v3: put_int, put_uint, put_tx_desc, put_valid_to and float_bits in keys.rs. On both branches: encode_value. All 12 prove in 33 s wall time with -j 8, 1.1 GB peak.
  • Left out: the Reader decoders, strings, packed pages and WAL framing. CBMC does not finish on them even at tiny bounds: 13–27 GB, with timeouts from 10 to 60 minutes. Building an anyhow::Error alone doesn't finish, and none of the stubs tried help. A 3-byte string order check builds a 105 M-clause formula. §5 has the measurements.
  • CI: kani.yml runs on PRs that touch the encoders and nightly per branch, using the grammar-verifier.yml pattern.
  • Finding: encode_value sorts NaN among the negative floats. This is latent, because every use is an exact match or an equality check. It is filed separately as low severity, not data-integrity (§6).
  • Delivery: this spec, then a v3 PR, then a main backport with the encode_value harnesses (§7).

Refs #627

🤖 Generated with Claude Code

https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz

adityamukho and others added 2 commits October 22, 2026 11:58
Prototyped and measured on the bench machine: 12 encoder harnesses prove
in 33 s; decoders, strings, packed pages and WAL framing do not finish
under CBMC and are left to the fuzz and property tests. Finds that
encode_value sorts NaN among negative floats (latent; filed separately).

Refs #627

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz
Codex review: pending EAVT/AEVT scans order by value_bytes within an
(entity, attribute) run; runs are decided whole, so only row order within
a run changes. Injectivity holds on each harness's domain, not across NaN
payloads. Reference #688.

Refs #627

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz
@adityamukho
adityamukho merged commit 75a3fac into v3 Oct 22, 2026
23 of 24 checks passed
@adityamukho
adityamukho deleted the docs/627-kani-spec branch October 22, 2026 06:45
@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!

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