From 36ad7c64f76cb80b1ec0cba5e0afaeacf8f6e5bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralph=20K=C3=BCpper?= Date: Mon, 31 Aug 2026 12:25:02 +0200 Subject: [PATCH] fix(ci): point the thread-local ratchet at cycle_malloc_trim.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `main` is red on `self-test-checkers`, which blocks the check on every open PR. Reproduced against a pristine `origin/main` worktree, so it is not any one PR's diff: crates/perry-runtime/src/gc/cycle_malloc_trim.rs: 1 raw `thread_local!` block(s), none allowed. crates/perry-runtime/src/gc/cycle.rs: recorded as having 1 cold `thread_local!` block(s), but has none. Both halves are the same event. #9245 (mine) added 20 lines to `cycle.rs`, which pushed it past the 2000-line cap, so the merge split `cycle_malloc_trim.rs` out of it. The `#[cfg(test)]` malloc-trim counters moved with the split and the allowlist was not regenerated, leaving a stale entry for the old path and an unrecorded one for the new. Recorded rather than converted: `TEST_MALLOC_TRIM_CALLS` and `TEST_MALLOC_TRIM_EXECUTED` are both `#[cfg(test)]` counters, so they are cold by construction and `crate::perry_thread_local!` would buy nothing — its point is keeping a hot address out of `_tlv_get_addr`, and these are never on a shipping path. `--update` also refreshes `_hot_declarations` 275 -> 278. That is a recount of `perry_thread_local!` uses added since the file was last regenerated, not a change of mine; the number moving up means more declarations are on the hot macro, which is the direction the ratchet wants. After: thread-local policy OK, 278 hot declarations, 125 raw blocks in 88 recorded cold files, capacity 768. --- scripts/thread_local_cold_allowlist.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/thread_local_cold_allowlist.json b/scripts/thread_local_cold_allowlist.json index 5704ac366d..1af43a286c 100644 --- a/scripts/thread_local_cold_allowlist.json +++ b/scripts/thread_local_cold_allowlist.json @@ -1,6 +1,6 @@ { "_comment": "Files still declaring raw `thread_local!`. Every entry is a declaration that pays `_tlv_get_addr` on Darwin; the count is a ratchet, so adding one to an already-listed file fails too. New code should use `crate::perry_thread_local!` \u2014 see crates/perry-runtime/src/tls_hot.rs. Regenerate with scripts/check_thread_locals.py --update.", - "_hot_declarations": 275, + "_hot_declarations": 278, "files": { "crates/perry-runtime/src/agent.rs": 1, "crates/perry-runtime/src/arena/block.rs": 2, @@ -29,7 +29,7 @@ "crates/perry-runtime/src/fs/stream.rs": 1, "crates/perry-runtime/src/gc/barrier/mod.rs": 2, "crates/perry-runtime/src/gc/barrier_arming.rs": 1, - "crates/perry-runtime/src/gc/cycle.rs": 1, + "crates/perry-runtime/src/gc/cycle_malloc_trim.rs": 1, "crates/perry-runtime/src/gc/fromspace_scan.rs": 1, "crates/perry-runtime/src/gc/layout.rs": 1, "crates/perry-runtime/src/gc/layout_tables.rs": 1,