Repository navigation
Remove ci/check_variants.py - #4549
Merged
Merged
Conversation
Dispatch is now verified code: each function's generated dispatcher runs the best implementation the CPU supports, and a generic caller is emitted for every variant of what it calls without anyone listing it. What the script still checked, from the names of the generated functions, is that no hand-written caller calls only a baseline implementation and that no combination of variants goes unused: speed and code size, never correctness, at the cost of exceptions of its own (`NEVER_WITH`, the handling of qualified names and aliases). CLAUDE.md keeps the rule that callers are generic over the variants of what they call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHE2dqL6Q2PDogxfD5f
This was referenced Nov 7, 2026
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.
This answers your question on #4536: with dispatch in verified code, we don't need
check_variantsany more.What it still checked, and why that isn't worth a check
Generic/<Iface>/…is emitted for every variant of its interface, and the generated dispatcher runs the best one. The check could only catch a hand-written caller that calls the baseline. That costs speed, never correctness, and CLAUDE.md keeps the rule ("Never add a caller that calls only the baseline implementation").Its upkeep was the problem: name-based heuristics (internal functions' families, qualified parts, aliases) and exceptions (
NEVER_WITH) kept growing.Changes
ci/check_variants.pyandci/test_check_variants.py, its Static checks step, and its rows inci/README.md.NEVER_WITHfrom CLAUDE.md, and the skill section on the script fromadding-a-primitive.VerifiedGarbageTest/Dispatch.lean, whose ranking guards stay;Proof/MlKem1024/Contract.leanandProof/Weierstrass/Point0Contract.lean(comments only, so their importers rebuild once in CI).Follow-ups
_FEATURESconstants (Rust.internalFile) exist only for this script. With it gone they have no users, so the emitter should stop writing them.Checks
Every remaining Static checks step passes. The edited Lean modules build.
Generated by Claude Code