From 69a7e541e27e17f738289ff2b0852d36eb003824 Mon Sep 17 00:00:00 2001 From: jdalton Date: Thu, 30 Jul 2026 16:05:52 -0400 Subject: [PATCH 1/2] test(gc): assert the child relocation, not a whole-process copied count (#7060) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit large_object_old_born_array_slot_write_keeps_young_child_alive asserted copied_objects == 1 against a whole-nursery quantity; host startup can leave other young objects reachable through the dirtied old page (4249 on macOS arm64), failing the test on a pristine tree. The property under test — the old-to-young edge kept THIS child alive and rewrote THIS slot — is already pinned by the rewritten asserts, so the exact count becomes a lower bound. Siblings in the family were each run solo on the affected host and pass, so their exact counts stay. --- crates/perry-runtime/src/gc/tests/copying.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/perry-runtime/src/gc/tests/copying.rs b/crates/perry-runtime/src/gc/tests/copying.rs index b6778abcc2..e4ada935d8 100644 --- a/crates/perry-runtime/src/gc/tests/copying.rs +++ b/crates/perry-runtime/src/gc/tests/copying.rs @@ -1310,7 +1310,13 @@ fn large_object_old_born_array_slot_write_keeps_young_child_alive() { assert_copied_minor_trace(&trace, true, CopiedMinorFallbackReason::None, false); assert_ne!(rewritten, child); assert!(crate::arena::pointer_in_nursery(rewritten)); - assert_eq!(trace.copying_nursery.copied_objects, 1); + assert!( + trace.copying_nursery.copied_objects >= 1, + "minor must copy at least the young child; copied_objects is a whole-process \ + count and host startup can leave other young objects reachable through the \ + dirtied old page (4249 observed on macOS arm64, #7060) — the child-specific \ + relocation is pinned by the `rewritten` asserts above" + ); assert!( remembered_set_size() > 0, "old-to-survivor edge must remain remembered after copied minor" From 285f00f44281a351524222b115040b1c5c78b991 Mon Sep 17 00:00:00 2001 From: jdalton Date: Thu, 30 Jul 2026 16:08:15 -0400 Subject: [PATCH 2/2] docs: changelog fragment for #7092 --- changelog.d/7092-gc-test-copied-count.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/7092-gc-test-copied-count.md diff --git a/changelog.d/7092-gc-test-copied-count.md b/changelog.d/7092-gc-test-copied-count.md new file mode 100644 index 0000000000..39ec2ec0d6 --- /dev/null +++ b/changelog.d/7092-gc-test-copied-count.md @@ -0,0 +1 @@ +**GC test de-flaked on macOS** — `large_object_old_born_array_slot_write_keeps_young_child_alive` asserted an exact whole-nursery `copied_objects == 1`, which fails on hosts whose startup allocations stay reachable through the dirtied old page (4249 observed on macOS arm64, #7060). The child-specific relocation is already pinned by the `rewritten` asserts, so the exact count is now a lower bound. Test-only change; no runtime behavior affected.