Skip to content

AArch64 elliptic curves: remove the register allocator nothing runs - #4869

Merged
alex merged 1 commit into
mainfrom
claude/laughing-wozniak-qs1ilo
Nov 9, 2026
Merged

alex merged 1 commit into
mainfrom
claude/laughing-wozniak-qs1ilo

Conversation

@alex

@alex alex commented Nov 9, 2026

Copy link
Copy Markdown
Member

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, optimize and their helpers) that once wrote the allocated code of P-256 and P-384. The build used one definition of it, the list of registers pool, in one place.
  • keep in Impl/P256/EcdhDouble.lean, Impl/P256/EcdhTable.lean and Impl/P384/EcdhDouble.lean, and the latter's spill: they were only arguments to the allocator.

Changed to allow it

  • Proof/Weierstrass/AArch64/AllocatedFrame.lean: allocatedRegs is now the list itself instead of VerifyRegisters.pool. Same value.
  • The three modules that imported VerifyRegisters import Impl.Weierstrass.AArch64.Forward, which it passed on to them.
  • Comments in Impl/P384/EcdhDouble.lean, Impl/P384/Ops.lean and Impl/P256/VerifyAllocatedCode.lean that 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.regs and spillSlots stay: the certificates use them.

Checked

lake build (every module), lake env lean --run Emit.lean --check (unchanged), the static checks, and check_lean_public_imports.py on the edited modules.


Generated by Claude Code

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
@alex
alex added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit 4dd35c5 Nov 9, 2026
20 checks passed
@alex
alex deleted the claude/laughing-wozniak-qs1ilo branch November 9, 2026 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants