Skip to content

Lean: remove the scripts that wrote the allocated AArch64 code - #4863

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

lean/GenerateP256Ecdh.lean, lean/GenerateP256Verify.lean and lean/GenerateP384Ecdh.lean are deleted.

Why they existed

They are what the PRs that added the register-allocated AArch64 code (#1203, #1306, #2867) used to produce it: each ran the allocator of Impl/P256/VerifyRegisters.lean once and wrote the result as literals, Impl/P256/EcdhAllocatedCode.lean, Impl/P256/VerifyAllocatedCode.lean and Impl/P384/EcdhAllocatedCode.lean.

Why they do not belong

  • Those three files are the implementation. The proofs check their instruction lists against the raw arithmetic, whatever wrote them, so the scripts are no part of what is verified or emitted.
  • Nothing builds or runs them: not lake build, not the emitter, not CI. They sat beside Emit.lean only because a script that is not a module cannot be under VerifiedGarbage/.
  • So nothing kept them working. GenerateP256Verify.lean does not compile: Elliptic curves: remove dead declarations and modules #4348 removed VerifyAllocated.keep as dead, which only this script used, and the script never imported VerifyRegisters.

The other two do still run, and write byte for byte what is checked in. I deleted them all the same, rather than leave two of three files with a generator: say if you would rather keep those two.

Also changed

  • Impl/P384/EcdhDouble.lean's module comment named the script; it now says what the code is. Comment only: Emit.lean --check passes unchanged.
  • lean/README.md's fill-private example named a script that is gone.

Not done here

With the scripts gone, most of Impl/P256/VerifyRegisters.lean (everything but pool) and the keep functions of Impl/P256/EcdhDouble.lean and EcdhTable.lean are used by nothing in the build. Removing them is a dead-declaration change to Impl/, like #4348, and is not in this PR.

Checked

lake build, lake env lean --run Emit.lean --check, the static checks, and check_lean_public_imports.py on the edited module.


Generated by Claude Code

lean/GenerateP256Ecdh.lean, GenerateP256Verify.lean and GenerateP384Ecdh.lean
ran the register allocator of Impl/P256/VerifyRegisters.lean once, to write
Impl/P256/EcdhAllocatedCode.lean, Impl/P256/VerifyAllocatedCode.lean and
Impl/P384/EcdhAllocatedCode.lean. Those files are the implementation: the
proofs check their instruction lists against the raw arithmetic, whatever
wrote them. Nothing builds or runs the scripts, and GenerateP256Verify.lean
no longer compiled (#4348 removed VerifyAllocated.keep, which only it used).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TKUFHEGP56j2eAMhXoFNTU
@alex
alex enabled auto-merge November 9, 2026 20:53
@alex
alex added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit 9b5e4af Nov 9, 2026
20 checks passed
@alex
alex deleted the claude/laughing-wozniak-qs1ilo branch November 9, 2026 21:01
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