Skip to content

Delete Lean modules that nothing uses - #590

Merged
alex merged 1 commit into
mainfrom
claude/serene-fermat-kqbts6
Oct 2, 2026
Merged

alex merged 1 commit into
mainfrom
claude/serene-fermat-kqbts6

Conversation

@alex

@alex alex commented Oct 2, 2026

Copy link
Copy Markdown
Member

Summary

Deletes proofs and code that nothing reaches: no registration file, generic file, variant or test imports them, directly or indirectly. lake build still checks them today, because the library's glob builds every module under VerifiedGarbage.*, so they cost CI time without verifying anything that ships.

These were found while reviewing the repo for duplication that points to missing abstractions; the dead copies were a by-product of that review.

Removed: 12 files, 1,677 lines deleted, 0 added

  • Proof/Poly1305/AArch64/{Update,Finalize}.lean (about 1,150 lines): radix-26 update/finalize proofs. The AArch64 artifact registers only the Radix64 code and proofs. Their materialize_code literals in Proof/Poly1305/AArch64/Lit.lean go too, since only they used them.
  • Proof/X448/AArch64/{Verified,Lit}.lean: the non-Weak x448 artifact proof. Artifacts/X448/AArch64.lean registers only Weak.
  • Proof/ChaCha20/AArch64/Neon/{Block,Quarter,RoundSpec,Rounds}.lean and Impl/ChaCha20/AArch64/Neon.lean: a single-block NEON implementation and its proof, never registered.
    • Neon/Lanes.lean stays, because Neon4/Rounds.lean uses its lemmas.
    • Lanes no longer imports the deleted code, which it never used.
  • Proof/MlKem/X86_64/PairOut.lean: unused loop lemmas.

How the dead modules were found: a script built the import graph from every root and listed the modules no root reaches. The roots are Artifacts/, Generic/, Variants/, TCB/, VerifiedGarbageTest/ and the top-level Emit.lean, CheckEd25519.lean and VerifiedGarbage.lean.

Deliberately kept, though no root imports them:

Follow-ups (not in this PR): some dead theorems sit inside modules that are still live.

  • Proof/X448/AArch64/Main.lean's correct proves the superseded non-Weak x448. It is the only reason Main imports Ladder, FinalSwap and Inv.
  • Proof/Poly1305/AArch64/Blocks.lean proves the radix-26 blocks. The Radix64 proofs import it for shared lemmas only.

Cutting these needs the shared parts split out first; it is left for a separate change.

No changes to Spec/ or TCB/. The generated src/asm/ is unchanged, since none of the deleted code was registered.

Validation

  • lake build of every registration file that imports an edited module, plus what they import: 1,399 modules, all passing.
    • Artifacts/{Poly1305,X448,ChaCha20}/AArch64
    • Artifacts/MlKem/X86_64
    • Generic/ChaCha20Xor/AArch64/ChaCha20Poly1305
  • python3 ci/check_lean_imports.py and python3 ci/check_lean_speed.py pass.
  • No other references to the deleted paths or modules exist in the repository: Lean, CI scripts and docs were searched.
  • Not run locally: the full lake build and Emit.lean --check. CI runs both.

🤖 Generated with Claude Code

https://claude.ai/code/session_016m94ApXKUeS9mmGwopxjrB


Generated by Claude Code

Remove proofs, and the code they alone verified, that no registration
file, generic file, variant or test reaches:

* Proof/Poly1305/AArch64/{Update,Finalize}: the radix-26 update and
  finalize proofs, superseded by Radix64 (the artifact registers only
  Radix64's), with their code literals in Proof/Poly1305/AArch64/Lit.
* Proof/X448/AArch64/{Verified,Lit}: the non-Weak x448 artifact proof;
  only Weak is registered.
* Proof/ChaCha20/AArch64/Neon/{Block,Quarter,RoundSpec,Rounds} and
  Impl/ChaCha20/AArch64/Neon: the single-block NEON implementation,
  never registered. Neon/Lanes stays (Neon4 uses its lemmas) and no
  longer imports the deleted code.
* Proof/MlKem/X86_64/PairOut: unused loop lemmas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016m94ApXKUeS9mmGwopxjrB
@alex
alex enabled auto-merge October 2, 2026 12:23
@alex
alex added this pull request to the merge queue Oct 2, 2026
Merged via the queue into main with commit 6a77cd6 Oct 2, 2026
36 checks passed
@alex
alex deleted the claude/serene-fermat-kqbts6 branch October 2, 2026 12:46
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