From a7f5bb00fc5fecb680c1081860b093776a1736ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralph=20K=C3=BCpper?= Date: Wed, 30 Sep 2026 12:01:58 +0000 Subject: [PATCH] fix(lint): re-record thread-local ratchet; rename test-local class id (follow-up to #11674) check_thread_locals.py: async_hooks.rs 7->6, gc/layout_tables.rs 3->2, node_stream_constructors.rs 3->2, stale gc/layout.rs entry removed. All counts only go down. Fails windows-build's GC structural audits and tls-budget's self-test job. class_id_collisions.py: #11674's test-local ANON_CLASS_ID (0x0075_5eed) in static_shapes_tests.rs read as a drifted mirror of put_value.rs's unrelated test-local ANON_CLASS_ID; renamed to REP_SEED_ANON_CLASS_ID. --- changelog.d/11706-main-reds-after-11674.md | 1 + .../src/object/static_shapes_tests.rs | 19 +++++++++++++------ scripts/thread_local_cold_allowlist.json | 9 ++++----- 3 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 changelog.d/11706-main-reds-after-11674.md diff --git a/changelog.d/11706-main-reds-after-11674.md b/changelog.d/11706-main-reds-after-11674.md new file mode 100644 index 0000000000..ec53291278 --- /dev/null +++ b/changelog.d/11706-main-reds-after-11674.md @@ -0,0 +1 @@ +Repair two ratchet reds left on `main` after #11674 and the shapes P4 series. The thread-local ratchet is re-recorded: `async_hooks.rs` 7→6, `gc/layout_tables.rs` 3→2, `node_stream_constructors.rs` 3→2, and a stale `gc/layout.rs` entry is dropped. These reds failed Windows GC structural audits and tls-budget. #11674's test-local `ANON_CLASS_ID` in `static_shapes_tests.rs` is renamed to `REP_SEED_ANON_CLASS_ID`, which clears the class-id audit's false mirror-drift report against `put_value.rs`. diff --git a/crates/perry-runtime/src/object/static_shapes_tests.rs b/crates/perry-runtime/src/object/static_shapes_tests.rs index 15709b208b..adf026d852 100644 --- a/crates/perry-runtime/src/object/static_shapes_tests.rs +++ b/crates/perry-runtime/src/object/static_shapes_tests.rs @@ -65,7 +65,7 @@ fn a_rep_literal_seed_is_the_shape_its_lazy_mints_reach_and_keeps_its_f64_lanes( use crate::object::field_rep::{slot_rep, with_slot_rep, REP_F64}; use crate::object::shapes::object_shape_stamp; let _lock = crate::gc::global_side_table_test_lock(); - const ANON_CLASS_ID: u32 = 0x0075_5eed; + const REP_SEED_ANON_CLASS_ID: u32 = 0x0075_5eed; let rep = with_slot_rep(with_slot_rep(0, 0, REP_F64), 1, REP_F64); let requested = SHAPE_ID_BASE + 0x5678; let id = seed_with_rep(requested, &["lt5s_a", "lt5s_b"], rep); @@ -76,27 +76,34 @@ fn a_rep_literal_seed_is_the_shape_its_lazy_mints_reach_and_keeps_its_f64_lanes( // The literal's module-init mint WITHOUT a static id (a module whose // guards embed none): the lazy mint of the same facts is the seeded id. - unsafe { crate::object::js_register_anon_shape_class_id(ANON_CLASS_ID) }; + unsafe { crate::object::js_register_anon_shape_class_id(REP_SEED_ANON_CLASS_ID) }; let packed = b"lt5s_a\0lt5s_b\0"; let keys = crate::object::js_build_class_keys_array( - ANON_CLASS_ID, + REP_SEED_ANON_CLASS_ID, 2, packed.as_ptr(), packed.len() as u32, 0, ) as u64; assert_eq!( - shapes::js_object_shape_id_for_class_keys(keys, 2, ANON_CLASS_ID, rep), + shapes::js_object_shape_id_for_class_keys(keys, 2, REP_SEED_ANON_CLASS_ID, rep), requested, "the literal's lazy mint must resolve to the seeded id" ); // ...and its static request (module init with the id) hits. assert_eq!( - js_object_shape_id_for_class_keys_static(keys, 2, 2, ANON_CLASS_ID, requested, rep), + js_object_shape_id_for_class_keys_static( + keys, + 2, + 2, + REP_SEED_ANON_CLASS_ID, + requested, + rep + ), requested ); // The all-`Any` sibling is other facts: never the static id. - let any = shapes::js_object_shape_id_for_class_keys(keys, 2, ANON_CLASS_ID, 0); + let any = shapes::js_object_shape_id_for_class_keys(keys, 2, REP_SEED_ANON_CLASS_ID, 0); assert_ne!( any, requested, "the rep is identity: Any lanes are another shape" diff --git a/scripts/thread_local_cold_allowlist.json b/scripts/thread_local_cold_allowlist.json index 51951cb404..61ad52aeeb 100644 --- a/scripts/thread_local_cold_allowlist.json +++ b/scripts/thread_local_cold_allowlist.json @@ -1,12 +1,12 @@ { "_comment": "Files still declaring raw `thread_local!`. The count is the number of DECLARATIONS that survive into a shipping build \u2014 each one pays `_tlv_get_addr` per read on Darwin \u2014 and it is a ratchet, so adding a `static` to an already-listed file fails whether or not it opens a new block. 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": 528, + "_hot_declarations": 522, "files": { "crates/perry-runtime/src/agent.rs": 1, "crates/perry-runtime/src/arena/block.rs": 5, "crates/perry-runtime/src/arena/page_meta/mod.rs": 2, "crates/perry-runtime/src/async_context.rs": 3, - "crates/perry-runtime/src/async_hooks.rs": 7, + "crates/perry-runtime/src/async_hooks.rs": 6, "crates/perry-runtime/src/builtins/console.rs": 4, "crates/perry-runtime/src/builtins/formatting.rs": 9, "crates/perry-runtime/src/builtins/formatting/boxed_primitives.rs": 1, @@ -31,8 +31,7 @@ "crates/perry-runtime/src/gc/barrier_arming.rs": 3, "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": 3, + "crates/perry-runtime/src/gc/layout_tables.rs": 2, "crates/perry-runtime/src/gc/malloc.rs": 2, "crates/perry-runtime/src/gc/mod.rs": 3, "crates/perry-runtime/src/gc/promote_in_place.rs": 11, @@ -53,7 +52,7 @@ "crates/perry-runtime/src/node_http2_constants.rs": 1, "crates/perry-runtime/src/node_inspector.rs": 2, "crates/perry-runtime/src/node_repl.rs": 1, - "crates/perry-runtime/src/node_stream_constructors.rs": 3, + "crates/perry-runtime/src/node_stream_constructors.rs": 2, "crates/perry-runtime/src/node_stream_tests.rs": 24, "crates/perry-runtime/src/node_submodules/blob.rs": 4, "crates/perry-runtime/src/node_submodules/diagnostics.rs": 10,