Repository navigation
AArch64 elliptic curves: remove the register allocator nothing runs - #4869
Merged
Merged
Conversation
Impl/P256/VerifyRegisters.lean is the allocator that wrote the allocated code of P-256 and P-384 (Impl/P256/EcdhAllocatedCode.lean, VerifyAllocatedCode.lean, Impl/P384/EcdhAllocatedCode.lean). Only the scripts #4863 removed ran it: of the module, the build used the list of registers `pool` alone, which Proof/Weierstrass/AArch64/AllocatedFrame.lean now states itself (`allocatedRegs`). With it go the definitions that were only its arguments: `keep` of Impl/P256/EcdhDouble.lean, Impl/P256/EcdhTable.lean and Impl/P384/EcdhDouble.lean, and the latter's `spill`. No Spec/, TCB/ or generated crate changes: Emit.lean --check passes unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHEGP56j2eAMhXoFNTU
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.
The follow-up #4863 named: with the scripts that ran it gone, the register allocator in
Impl/is dead code. 313 lines removed, 15 added.Removed
Impl/P256/VerifyRegisters.lean, the whole module: the allocator (ssa,stores,dependencies,schedule,allocate,optimizeand their helpers) that once wrote the allocated code of P-256 and P-384. The build used one definition of it, the list of registerspool, in one place.keepinImpl/P256/EcdhDouble.lean,Impl/P256/EcdhTable.leanandImpl/P384/EcdhDouble.lean, and the latter'sspill: they were only arguments to the allocator.Changed to allow it
Proof/Weierstrass/AArch64/AllocatedFrame.lean:allocatedRegsis now the list itself instead ofVerifyRegisters.pool. Same value.VerifyRegistersimportImpl.Weierstrass.AArch64.Forward, which it passed on to them.Impl/P384/EcdhDouble.lean,Impl/P384/Ops.leanandImpl/P256/VerifyAllocatedCode.leanthat pointed at the allocator now say what the code is.What this gives up
The allocated instruction lists (
Impl/P256/EcdhAllocatedCode.lean,VerifyAllocatedCode.lean,Impl/P384/EcdhAllocatedCode.lean) stay exactly as they are, and the proofs still check them against the raw arithmetic. But nothing in the repository can produce them again: changing that arithmetic now means writing new allocated code by other means, or bringing the allocator back from history.Not a trust change
No
Spec/,TCB/or generated crate changes.P384.EcdhDouble.regsandspillSlotsstay: the certificates use them.Checked
lake build(every module),lake env lean --run Emit.lean --check(unchanged), the static checks, andcheck_lean_public_imports.pyon the edited modules.Generated by Claude Code