Repository navigation
ci: resolve function values and reject opaque Used by re-exports - #3311
Merged
Merged
Conversation
The re-export rule rejected `pub use` of a scoped function and a glob of its module, but `pub use mlxcel_core::utils;`, `pub use mlxcel_core::utils as shared;` and `pub use mlxcel_core::*;` passed, and each gives downstream callers a path the checker cannot resolve. A public `use` of the scoped module or of one of its ancestors now fails at the re-export. Files with a public `use` are kept past the substring pre-filter, since such a file need not spell any scoped name. A generic helper called with a turbofish under a glob import (`fused_add_rms_norm::<N>(..)`) was not counted as a use. `::<` now counts as a value delimiter. The docstring and guidelines also record that a glob-visible name rebound by a `for`, `match`, closure or tuple pattern counts as a use, which fails closed.
Member
SummaryThe PR covers all five items of #3219. The review found two false negatives in the new caller and re-export resolution, and one hardening commit fixes both: Reviewed (PR + issues)
Findings
Fixes
Security reviewThe change is a CI checker with no workflow edits. It reads repository files only and runs the annotation's grep through the existing restricted re-runner. No new subprocess, network or secret use. Performance review
Validation
|
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.
Closes #3219
as. The directcreate_causal_mask as ccmfixture already appeared in the base report, but at the first unrelated import. It now appears at the matching import on line 2. The fixture’ssrc/modelsannotation accounts for the file. A glob-derived alias outside a named roster passed on the base and now fails..map(...)fixtures, the base checker reported only the explicitly imported callback. The updated checker reports all three files. Separate cases exercise shadowing by a parameter or local and a reference after the local’s block ends.create_causal_mask_roster_count_matches_repoand its private helpers. The checker compares the recorded count with the annotation’s literal grep output.grep -vfilter or a count update.Verification on macOS
make verify-used-bypassed the repository check and all 32 fixture cases. The same fixture script against the base checker exited 1 with ten failed assertions or case outcomes.cargo test -p mlxcel-core --lib utilspassed 77 tests with Rust 1.97.1 andMLXCEL_BUILD_METAL=OFF.cargo checkandcargo fmt --checkpassed.git diff --checkpassed. With its own defaults, Ruff 0.17.6 reported the eight base regex-flag findings and one nested-condition style finding.The checker still collects block-local imports per file and does not parse complex binding patterns. The full Rust suite, GPU execution and hosted CI were not verified.