Skip to content

Adapt to the monomorphized quartz CPU (stacked on #1) - #2

Draft
JasonGross wants to merge 4 commits into
mit-plv:mainfrom
JasonGross:fable/stdlib-bits-mono
Draft

JasonGross wants to merge 4 commits into
mit-plv:mainfrom
JasonGross:fable/stdlib-bits-mono

Conversation

@JasonGross

Copy link
Copy Markdown

Stacked on #1 (its two commits come first; the diff against #1 is the last commit). Pins the quartz submodule to mit-plv/quartz#3 (the monomorphized CPU on stdlib bits) and adapts to it: one deleted import, and the Opaque markers in QuartzImpl.v now cover the helper constants instead of the record definitions, because quartz's CPU now calls fifo1.full and friends directly. No proof script changes; all 100 files build, no admits, the same single axiom for Demo.noninterference as on main.

Written by Claude Fable 5.1.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YJbiRBkJtM7x6PvYV6hmEm

JasonGross and others added 4 commits September 15, 2026 22:12
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
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