Repository navigation
Lean: remove the scripts that wrote the allocated AArch64 code - #4863
Merged
Merged
Conversation
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
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.
lean/GenerateP256Ecdh.lean,lean/GenerateP256Verify.leanandlean/GenerateP384Ecdh.leanare 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.leanonce and wrote the result as literals,Impl/P256/EcdhAllocatedCode.lean,Impl/P256/VerifyAllocatedCode.leanandImpl/P384/EcdhAllocatedCode.lean.Why they do not belong
lake build, not the emitter, not CI. They sat besideEmit.leanonly because a script that is not a module cannot be underVerifiedGarbage/.GenerateP256Verify.leandoes not compile: Elliptic curves: remove dead declarations and modules #4348 removedVerifyAllocated.keepas dead, which only this script used, and the script never importedVerifyRegisters.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 --checkpasses unchanged.lean/README.md'sfill-privateexample named a script that is gone.Not done here
With the scripts gone, most of
Impl/P256/VerifyRegisters.lean(everything butpool) and thekeepfunctions ofImpl/P256/EcdhDouble.leanandEcdhTable.leanare used by nothing in the build. Removing them is a dead-declaration change toImpl/, like #4348, and is not in this PR.Checked
lake build,lake env lean --run Emit.lean --check, the static checks, andcheck_lean_public_imports.pyon the edited module.Generated by Claude Code