Skip to content

docs(formal-verification): DMA memcpy - #926

Open
nicole-graus wants to merge 5 commits into
feat/dma-memcpyfrom
feat/dma-memcpy-formal-verification
Open

docs(formal-verification): DMA memcpy#926
nicole-graus wants to merge 5 commits into
feat/dma-memcpyfrom
feat/dma-memcpy-formal-verification

Conversation

@nicole-graus

Copy link
Copy Markdown
Collaborator

Motivation

#874 adds a new fixed table, and nothing independently checks that its AIR proves what a memcpy actually is.

Description

Adds docs/verification/dma/:

  • Oracle — a four-level reference model (byte semantics / row decomposition / MEMW multiset / guest chunking), anchored on libc memmove and CPython slice assignment over 3,855 differential cases each, plus an 8-mutant sensitivity sweep.
  • Gate — a field-exact z3 model of the AIR: 6 row-level checks, 6 chain checks with DmaNext modelled as a free bijection rather than an assumed chain, 10 premise controls each with a named forgery, and a completeness sweep over every length 0–256.
  • Audit — 100 executable claims tying the gate, the spec and the Rust together, mutation-tested against 6 source mutants.

Plus two Rust tests driving the real collect_dma_memcpy_ops against the oracle's emitted vectors, and a make verify-dma target.

No shipped constraint, column, bus interaction or executor path changes.

No soundness gap found. The first commit reported one; the second retracts it —DmaNext binds each 64-bit value as two 32-bit bus elements, not one packed field element, so the limbs are already pinned and the alias the gate exhibited is unreachable. The retraction is kept in the docs as the campaign's main lesson.

How to test

make verify-dma
cargo test -p lambda-vm-prover --lib dma

Needs pip install z3-solver (validated on 5.0.0; the audit alone needs no solver).

@nicole-graus nicole-graus changed the title Feat/dma memcpy formal verification docs(formal-verification): DMA memcpy Aug 11, 2026
@MauroToscano

Copy link
Copy Markdown
Contributor

Depends on #923 — that should merge first.

This places its campaign under formal_verification/<chip>/, but that convention doesn't exist on main: formal_verification/ is introduced by #923, which is still open. #923 also extends tooling/loc (main.rs +45, report.rs +115) to read_dir("formal_verification") and report each subdirectory as a verified gate — tooling/ on main has no reference to formal_verification at all.

Merged ahead of #923, this would create the directory itself, with nothing counting it and no baseline README to point at.

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.

2 participants