You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(runtime): wpfacts_check family SCRATCH uses perry_thread_local! (tls-budget) - #14594
tls-budget / self-test-checkers fails on every PR: 74304a9 added a raw thread_local! (SCRATCH) to crates/perry-runtime/src/wpfacts_check/family.rs, and scripts/check_thread_locals.py allows none there. This PR declares it with crate::perry_thread_local!, as the sibling wpfacts_check/life.rs does.
Changes
crates/perry-runtime/src/wpfacts_check/family.rs: thread_local! → crate::perry_thread_local! (same body, same .with() call sites).
Related issue
Introduced by 74304a9 (check mode: the family claim).
Test plan
On current main (f451fa6139):
command
main
this branch
python3 scripts/check_thread_locals.py
FAIL: family.rs: 1 raw thread_local! declaration(s), none allowed
thread-local policy OK: 479 hot declarations, 246 cold declarations in 91 recorded files, capacity 768
74304a9 added a raw `thread_local!` to
crates/perry-runtime/src/wpfacts_check/family.rs, which
`scripts/check_thread_locals.py` refuses, so `tls-budget /
self-test-checkers` fails on every PR. `crate::perry_thread_local!` takes the
same syntax and the same `.with()` calls, as `wpfacts_check/life.rs` already
does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p
No actionable comments were generated in the recent review.
Walkthrough
The check-mode family claim’s SCRATCH counter now uses crate::perry_thread_local! instead of thread_local!. Its Cell<u32> initializer is unchanged. The changelog records the change.
Changes: Thread-local declaration update
Layer / File(s)
Summary
Update the SCRATCH declaration crates/perry-runtime/src/wpfacts_check/family.rs, changelog.d/14594-family-perry-thread-local.md
SCRATCH now uses crate::perry_thread_local!; its Cell<u32> value and initializer remain unchanged. The changelog notes that tls-budget refused the raw declaration.
Issue 10709 concerns another raw thread_local! conversion and a Linux debug SIGSEGV associated with perry_thread_local!. The issue says the cause is unconfirmed; its effect on this SCRATCH change is unresolved.
Possibly related PRs
PerryTS/perry#14373: Replaces raw thread_local! declarations with crate::perry_thread_local! to address the same thread-local policy self-check failure.
Merge Risk: Minimal · up to 760ff
This is a small declaration change that satisfies the thread-local policy check without altering runtime behavior. No actionable merge risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the actual change: the family SCRATCH declaration in wpfacts_check now uses perry_thread_local! instead of a raw thread_local!. The tls-budget tag names the policy the change satisfies…
Description check
The description follows the repository template. It has a summary explaining the raw thread_local! failure and the fix, a changes list naming the file, a related issue (commit 74304a9), and a test …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the actual change: the family SCRATCH declaration in wpfacts_check now uses perry_thread_local! instead of a raw thread_local!. The tls-budget tag names the policy the change satisfies. The title is specific and matches the raw summary, objectives, and description.
Full details: Description check
Explanation
The description follows the repository template. It has a summary explaining the raw thread_local! failure and the fix, a changes list naming the file, a related issue (commit 74304a9), and a test plan with before-and-after results. The template's Checklist items are marked. The template's test-plan checkboxes for the full workspace test command and docs are not addressed, and the template's HTML comment block about version bumps is omitted. These gaps are minor because the change is a single-line declaration fix.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 091fde50-812a-47f3-a191-d0b7f002111b
Commits
Reviewing files that changed from the base of the PR and between f451fa6 and 760ffd6.
Files selected for processing: 2
changelog.d/14594-family-perry-thread-local.md
crates/perry-runtime/src/wpfacts_check/family.rs
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.
This fix is also included in #14604, which fixes the other mechanical/stale reds on main in one PR. Whichever you prefer: merge this one alone, or close it in favour of #14604.
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.
Summary
tls-budget / self-test-checkersfails on every PR: 74304a9 added a rawthread_local!(SCRATCH) tocrates/perry-runtime/src/wpfacts_check/family.rs, andscripts/check_thread_locals.pyallows none there. This PR declares it withcrate::perry_thread_local!, as the siblingwpfacts_check/life.rsdoes.Changes
crates/perry-runtime/src/wpfacts_check/family.rs:thread_local!→crate::perry_thread_local!(same body, same.with()call sites).Related issue
Introduced by 74304a9 (check mode: the family claim).
Test plan
On current
main(f451fa6139):mainpython3 scripts/check_thread_locals.pyfamily.rs: 1 raw thread_local! declaration(s), none allowedthread-local policy OK: 479 hot declarations, 246 cold declarations in 91 recorded files, capacity 768python3 scripts/check_thread_locals.py --self-testRUST_TEST_THREADS=1 cargo test --release -p perry-runtime --lib wpfacts_checkBuilt on macOS (Apple M6), nightly from
rust-toolchain.toml, LLVM 23.1.5.Checklist
feat:/fix:/docs:/chore:prefix convention used in the log🤖 Generated with Claude Code
https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p
Summary by CodeRabbit