-
-
Notifications
You must be signed in to change notification settings - Fork 158
fix(ci): unbreak the thread-local policy gate, and stop counting #[cfg(test)] declarations
#7824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+178
−26
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| **The thread-local policy gate is green again, and now measures what it claims to.** | ||
| `scripts/check_thread_locals.py` was failing on `main`, which blocked | ||
| `tls-budget`'s documented promotion to a required context — a gate that runs, | ||
| reports failure, and cannot block anything. Two of the eight raw `thread_local!` | ||
| blocks were real, and they were not the ones reported: `array/indexing.rs`, | ||
| `map.rs`, `set.rs` and `registry_latch_probes.rs` are all `#[cfg(test)]` and do | ||
| not exist in a shipping build, while `gc/schedule.rs`'s `SAFEPOINT_COUNTER` | ||
| (every safepoint) and `SCHEDULE_NEXT_CANDIDATE_BYTES` (every poll) were live and | ||
| paying `_tlv_get_addr` on Darwin. Those two now use | ||
| `crate::perry_thread_local!`. The scan no longer counts `#[cfg(test)]` | ||
| declarations at all — recording one as "cold" records the wrong fact, since it | ||
| is not cold but absent — covering the attribute directly above a block, an | ||
| inline `#[cfg(test)] mod`, and a whole file declared `#[cfg(test)] mod <stem>;` | ||
| (closed transitively, so `gc/tests/mod.rs` carries its subtree). Because an | ||
| over-broad exclusion would make the gate pass *by seeing less*, `--self-test` | ||
| now checks each shape in both directions — gated is skipped, and removing the | ||
| gate makes the same declaration fail again — proving six rejection directions | ||
| instead of four. The allowlist regeneration is provably one-way (101 → 91 | ||
| entries, 157 → 129 blocks, nothing added and no count increased), which also | ||
| retires three already-stale entries: `gc/zeal.rs` from #7741's removal of | ||
| `PERRY_GC_ZEAL`, plus `arena/quarantine.rs` and `gc/oldgen_defrag.rs`. (#7814) |
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Parse Rust block boundaries without counting braces in literals or comments.
brace_spantreats every{and}as syntax. A}in a string before a test-onlythread_local!ends the inline module span early. The scanner then counts a declaration that cannot ship. A{can also extend the span and hide a shipping declaration.Use a Rust-aware lexical scan that ignores comments and literals before matching braces. Add a
--self-testcase with braces inside a string or comment.Also applies to: 191-201, 363-395
🤖 Prompt for AI Agents