Repository navigation
RV32-IM: Unroll proofs to allow for later SLOTHY-fication - #1475
Draft
hanno-becker wants to merge 4 commits into
Draft
hanno-becker wants to merge 4 commits into
hanno-becker wants to merge 4 commits into
Conversation
hanno-becker
force-pushed
the
rv-unroll
branch
from
October 19, 2026 10:17
c3abe19 to
465c242
Compare
Contributor
CBMC Results (ML-DSA-65, REDUCE-RAM)
Full Results (397 configurations)
|
Contributor
CBMC Results (ML-DSA-87, REDUCE-RAM)
Full Results (397 configurations)
|
Contributor
CBMC Results (ML-DSA-44, REDUCE-RAM)
Full Results (397 configurations)
|
Contributor
CBMC Results (ML-DSA-44)
Full Results (397 configurations)
|
Contributor
CBMC Results (ML-DSA-65)
Full Results (397 configurations)
|
Contributor
CBMC Results (ML-DSA-87)
Full Results (397 configurations)
|
hanno-becker
force-pushed
the
rv-unroll
branch
from
October 19, 2026 12:15
465c242 to
efa34cb
Compare
hanno-becker
force-pushed
the
rv-unroll
branch
3 times, most recently
from
October 25, 2026 19:48
19c5f32 to
0c59d29
Compare
An instruction loop often applies the same arithmetic simplifier after each step. Building SIMD_SIMPLIFY_TAC inside the instruction callback rebuilds its rewrite conversion each time. The abbreviation variant also rebuilt that conversion for every selected register equation. Prepare the ARM/x86 step and SIMD tactics once before their loops. Move conversion construction and definition selection out of the abbreviation helper's per-fact callback. Still read local arithmetic equations from the current context: these change during execution. No converter-builder cache is needed. Prepared conversions capture the basic rewrite table; prepare again if it or the arithmetic rules change. Keep ordinary whole-context abbreviation, machine code and proof claims. Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>
After the NTT output congruence has been reduced to a real polynomial, REAL_INTEGER_TAC proves integer closure from the expression's structure. It does not consult context facts, but its recursive subgoals still carried the large execution context. Discard that context immediately before the four ARM/x86 NTT and INTT integer-closure calls. Leave instruction reasoning, congruence rewriting, output bounds and HOL Light's tactic unchanged. Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>
The HOL Light proofs take their shared tactics from a pinned source package. Use the published hanno-becker revision a87e6f9f and its unpacked source hash, so the shell needs no local checkout override. Import independent CLARIFY_TAC facts, context rewrite reuse, faster nonoverlap and frame handling, and guarded immutable reads. Include opt-in frame seeding, parent snapshots and MEMOIZED_TOP_DEPTH_CONV. Existing TOP_DEPTH_CONV callers keep their behavior. The shared safety driver abbreviates the event-trace witness while its saved justifications are assembled, then removes the temporary definition. This applies unconditionally; custom drivers can still use WITH_DEFERRED_ABBREVS_TAC explicitly. Our RV32 driver remains explicit. The shared SIMD abbreviation helper prepares its conversion once per prepared tactic, not per register fact. Upstream ARM/x86 SIMD loops retain their prepared tactics; the analogous local changes precede this pin in the history. Also import upstream AES-GCM support and buffer-size division parsing. These do not replace the local ML-DSA assembly or proof scripts. Keep masked-address facts for all RISC-V instructions; do not restore the JALR-only shortcut. Profiling, frame omission, goal-only abbreviation and converter-builder caches remain excluded. Change the source revision and hash. Keep HOL Light and the cross toolchain unchanged. Full routine proofs and timings were not rerun for this pin update. Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>
The forward NTT, inverse NTT and pointwise Montgomery proofs used loop invariants for fixed instruction sequences. Shared execution support now allows each complete core to be executed symbolically. The resulting exact output words feed the existing arithmetic theorems, which prove the mathematical result and output bounds. Switch all five production machine proofs in one change. Execute 9369/12439 forward NTT, 11936/15774 inverse NTT and 2821 pointwise instructions, including branches and inverse NTT's final scaling loop. Use scoped context rewriting and parent memory snapshots, explicit permitted-frame seeding and guarded immutable input reads. Prepare the scalar simplifier once per instruction loop. Fold arithmetic expressions while expanding the output layout. Prepare one conversion from the final context before splitting the 256 coefficient goals. MEMOIZED_TOP_DEPTH_CONV shares equality proofs for repeated subterms across those goals; do not cache construction of the converter itself. A different context or basic rewrite table requires a new conversion. Keep ordinary whole-context arithmetic abbreviations. Use the block-based safety driver with ~defer_witness:true. A short name stands for the complete trace function while saved instruction proofs are assembled; WITH_DEFERRED_ABBREVS_TAC removes its defining equation afterwards. Keep intermediate frame tracking and memory-access bounds. Retain routine bytecode and all public core, callable and safety claims, including the MUL/MULH timing caveat. Add helper parameter, scoped-option and hypothesis checks. Document APIs and reproduction. Do not add phase profiling, frame omission or goal-only abbreviations. Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>
hanno-becker
force-pushed
the
rv-unroll
branch
from
October 25, 2026 20:07
0c59d29 to
acf0c72
Compare
This branch has not been deployed
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.
Re-import updated s2n-bignum with better symbolic execution infrastructure. This speeds up symex so much that we can fully unroll the RV32-IM proofs.
Other proofs benefit as well, though not uniformly: