Repository navigation
Add the simplest memory implementation with its MemorySpec simulation proof (stacked on #2) - #3
Draft
JasonGross wants to merge 5 commits into
Draft
JasonGross wants to merge 5 commits into
JasonGross wants to merge 5 commits into
Conversation
A plain `dune build` at the root recurses into quartz/test, whose rules run the quartz tests and need a slang binary that is not part of a granite checkout, so the build fails before compiling anything of granite. The default alias now covers core, app, isaSpec, quartz/lang and quartz/examples, which is what quartz's own root dune file does. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJbiRBkJtM7x6PvYV6hmEm
Bit vectors are stdlib's bits n := Zmod (2^n) (rocq-stdlib >= 9.1), widths are Z, and the quartz submodule moves to the quartz commit that makes the same change (mit-plv/quartz#2), so that granite and quartz share one representation and rocq-stdpp-bitvector is no longer a dependency. core/Bits.v provides what stdpp.bitvector.definitions provided: the bits notation, a Number Notation whose literals are constructor-shaped so that closed constants still compute with Zmod.of_small_Z opaque (simpl/cbn through of_small_Z are exponential in the nesting depth), EqDecision/Countable/Inhabited/Finite instances, and the granite-specific helpers on top of Zmod. Sections over an abstract width take a Finite (bits idx_sz) hypothesis whose proof term is canonical, because hint-generated instances differ between files and then fail to unify. Proof scripts change only where the two sides of a simulation used to be syntactically equal by construction and now differ in spelling: quartz interprets equality tests as Zmod.eqb while granite's programs compare with Zmod.unsigned _ =? Zmod.unsigned _, so the scripts unfold Zmod.eqb (and nonzero of an embedded boolean) before the case splits that must hit both sides. Auto-generated hypothesis names follow the new types, and two `clear`s that implicitly kept section variables through the type of a kept hypothesis are made explicit or dropped. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJbiRBkJtM7x6PvYV6hmEm
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJbiRBkJtM7x6PvYV6hmEm
Bump the quartz submodule to fable/monomorphize (201186a), which stacks Andres's monomorphization work on the stdlib-bits port. Two things in that work reach granite. lang/let_lift.v is gone, so QuartzImpl_helpers no longer imports it. The cpu program in Processor.v now calls the helper constants directly (fifo1.full, btb.predPc, ...) instead of going through the record implementations, so making fifo1.impl and the other records opaque no longer keeps quartz's side of the lowering lemmas folded while granite's simulation specs still spell the record projections. QuartzImpl makes the constants opaque instead: with the records transparent both sides reduce to the same fn.interp of the constant, and the proof scripts go through unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJbiRBkJtM7x6PvYV6hmEm
…imulation proof MemoryImpl is a memory with no cache, write-through stores, one outstanding load and a one-slot response buffer; its control state, and hence RespReady, Full and the timing of responses, is a function of the leakage trace alone (ctrl_exec_leakage). MemoryImplSimulates instantiates MemorySpec's SpecParams by replaying the implementation on the trace and proves Simulates.simulates between MemoryImpl.spec and MemorySpec.spec, so the implementation can stand in for the memory model of the pipeline proofs. This is Andres Erbsen's gist https://gist.github.com/andres-erbsen/d2a697b60e8455af7110bb4aa0ecafe8 ported from stdpp bitvectors to stdlib bits: bv Params.width is bits Params.width, and bv_0 _ and the applied zeroes are the zeroes literal. Nothing else changed; simulates is closed under the global context. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJbiRBkJtM7x6PvYV6hmEm
This was referenced Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
app/MemoryImpl.vandapp/MemoryImplSimulates.v: the simplest memory that satisfiesMemorySpec(no cache, write-through stores, one outstanding load, a one-slot response buffer, withctrl_exec_leakageshowing that its schedule depends on the leakage trace alone), and the proof that it simulatesMemorySpec.specwith the spec'sSpecParamsinstantiated by replaying the implementation on the trace.This is the gist from the #1 thread (https://gist.github.com/andres-erbsen/d2a697b60e8455af7110bb4aa0ecafe8) ported to stdlib
bits: only thebv Params.width,bv_0 _and appliedzeroesspellings changed.Print Assumptions simulates(andctrl_exec_leakage,public_resps_deterministic): closed under the global context.Stacked on #2, whose first commits are #1: only the last commit, b5b2ba5, is new here.
Written by Claude Fable 5.1.
🤖 Generated with Claude Code
https://claude.ai/code/session_01YJbiRBkJtM7x6PvYV6hmEm