Repository navigation
Variants and registrations list their implementations best first - #4682
Merged
Merged
Conversation
Each list of variants (`Proof/Variants/<Iface>/<Target>.lean`) and each registration file with several implementations of a function now lists them in the order `Dispatch.lean` ranks them, best first, so that the dispatchers can try them in that order instead (the trusted change that does so comes next). Where a product of two lists gives an order of its own (FFDH on x86-64), the nesting is the one that keeps it. AES-GCM-SIV on x86-64 lists its AVX2 copies before the instances without them, and emits neither an instance without them that needs every feature its copy needs (`hasNarrow`), nor those of an AES-GCM variant that differs from one before it only in what AES-GCM-SIV does not call (`sivImpls`): the dispatcher never chose them, and each was another name of the function it chose (an `alias`). Part of #4548. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHFjAR7Byf513R4zuFy
The same items, in the order their registration files now list them, and without AES-GCM-SIV's ten unreachable instances on x86-64 (each was another name of the function its dispatcher chose). Every dispatcher is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHFjAR7Byf513R4zuFy
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.
Part of #4548. This prepares the next PR, which makes each dispatcher try a function's implementations in the order its registration file lists them, and deletes
Dispatch.lean's suffix ranking. There are no trust changes here: nothing underTCB/orSpec/changes.What changes
Proof/Variants/<Iface>/<Target>.leanis now ordered best first, matchingDispatch.lean's ranking.hasNarrow), or one for an AES-GCM variant that differs from an earlier one only in what AES-GCM-SIV doesn't call (sivImpls).alias) of the function its dispatcher calls. That removes ten functions, none of which the Rust code names.Generated crates
218 generated files change: the same items in a different order, minus those ten AES-GCM-SIV functions. Every dispatcher is unchanged, including the order of its arms; I compared each dispatcher with
main's.Checks
lake buildandEmit.leanpass.check_lean_public_imports.pypasses.cargo clippy --all-targets -- -D warningsandcargo testpass.Generated by Claude Code