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
test: pin fixes reported in #12135 and #10394 with regression tests - #14953
This PR adds regression tests for two issues that are already fixed on main but had no test pinning the fix. It is test-only and changes no runtime code.
Main with only the fix reverted, i.e. if flags & GC_FLAG_TENURED != 0 { return false; } put back into PostTraceProbe::owner_is_dead. The test panics with "an unmarked TENURED owner still in the nursery is dead after a minor".
Release builds of the old commits, 5/5 runs each. At 796d6a5 (= 5a12983^) the output is timeout after ["sync -> sync"]. At 5a12983 (= ea61b44^) it is timeout after ["sync -> sync","microtask -> microtask"]. At ea61b44 and on main all five cases pass.
an unmarked TENURED array still in the nursery, which must be pruned;
a marked one, which must survive;
an old-generation one, which must survive.
Async worker_threads message handlers never resume after the first await — worker RPC replies are never sent #10394. A worker's async parentPort'message' handler awaits one of: nothing, a job, a timer, two timers in a row, or import("node:fs/promises") followed by fs.stat. Then it replies. The parent sends each request only after the previous reply arrives, so the output order is fixed. The 10 s guard timer only turns a lost reply into printable output; nothing is decided by timing.
crates/perry/tests/issue_10854_worker_async_onmessage.rs already covers the microtask case for the global onmessage. Nothing covered the timer case or the parentPort path.
A changelog fragment is added because the PR touches crates/.
macOS arm64, LLVM 22.1.8, Node 26.12.1. Main is cba7eaf, built with cargo build-perry --release && scripts/gc_call_effects/sidecars.sh target/release.
# #12135, on main: 6/6 runs pass
RUST_TEST_THREADS=1 cargo test --release -p perry-runtime --lib -- gc::tests::dead_owner_side_tables
# test ...::tenured_owner_still_in_the_nursery_is_pruned_on_a_minor ... ok
# test result: ok. 41 passed; 0 failed; 6 ignored
# the same command with the TENURED refusal re-added to gc/dead_owner.rs
# test ...::tenured_owner_still_in_the_nursery_is_pruned_on_a_minor ... FAILED
# panicked at .../dead_owner_side_tables.rs:349:5:
# an unmarked TENURED owner still in the nursery is dead after a minor
# #10394, on main: 5/5 runs pass
python3 scripts/parity.py run tests/parity/node-suite/worker_threads/test_gap_10394_async_message_handler_resumes.ts --mode fast
# pass=1
# old commits: cargo build --release -p perry -p perry-runtime-static -p perry-stdlib-static,
# then the case compiled with that build, 5 runs per commit (results in the table above)
Added regression coverage for pruning stale side-table entries during minor garbage collection while preserving entries for live and old-generation objects.
Added worker-thread checks for message handlers resuming after awaiting promises, timers, and filesystem operations.
These changes expand test coverage; they do not change application behavior.
No actionable comments were generated in the recent review.
Walkthrough
This pull request adds regression tests for minor-GC side-table pruning and asynchronous worker_threads message handlers. It also adds a changelog entry. The changes add tests only and do not change runtime behavior.
Changes: Minor-GC side-table pruning
Layer / File(s)
Summary
Pruning regression test and changelog entry crates/perry-runtime/src/gc/tests/dead_owner_side_tables.rs, changelog.d/14953-pin-12135-10394-regressions.md
The test checks that pruning removes an unmarked nursery owner’s entry even when its header is TENURED, while retaining entries for a marked nursery owner and an old-generation owner. The changelog describes this test and the async worker regression test.
Async worker message handlers
Layer / File(s)
Summary
Async message handling and reply test tests/parity/node-suite/worker_threads/fixtures/async_message_handler_worker.ts, tests/parity/node-suite/worker_threads/test_gap_10394_async_message_handler_resumes.ts
The worker performs the operation for each message kind before replying. The test sends the five request kinds sequentially, checks each reply, and exits with status 1 if a reply does not arrive within 10 seconds.
This change adds regression tests for two existing fixes and does not alter runtime behavior. No merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title is a short, single sentence that names the main change: regression tests pinning two existing fixes (#12135 and #10394). It is accurate. The changeset adds only test code, a changelog fragme…
Description check
The description covers the template's main content: a summary, a detailed changes table, related issues, and a test plan. The Related issue section gives 'Fixes #12135' and 'Fixes #10394'. The test pl…
Linked Issues check
Both active direct issues are covered by coding requirements that this PR addresses with automated tests. Runtime fixes are already present at the reviewed head (0db502c), so the PR does not need r…
Out of Scope Changes check
The PR changes are test-related and directly support the two linked issues. The changes are: a new regression test in crates/perry-runtime/src/gc/tests/dead_owner_side_tables.rs for #12135; a new pa…
Full details: Title check
Explanation
The title is a short, single sentence that names the main change: regression tests pinning two existing fixes (#12135 and #10394). It is accurate. The changeset adds only test code, a changelog fragment, and a parity fixture, and the title says test. It uses a conventional 'test:' prefix that matches the repository log convention.
Full details: Description check
Explanation
The description covers the template's main content: a summary, a detailed changes table, related issues, and a test plan. The Related issue section gives 'Fixes #12135' and 'Fixes #10394'. The test plan lists commands and results and includes the rustfmt and lint notes. The template's checklist items are present and checked. The author did not fill in the template's Summary-only format exactly, and the template's test-plan checkboxes (cargo build --release, full cargo test --workspace, and docs/fixture items) are not ticked or addressed. The author also did not explain why the full workspace test command and the release build were skipped. These gaps are minor because the PR is test-only.
Resolution
Optionally, state whether the workspace-wide 'cargo build --release' and 'cargo test --workspace' checks from the template were run, or why they were skipped. Also tick or annotate the template's conditional checklist items (fixture and docs) so reviewers can see they do not apply.
Full details: Linked Issues check
Explanation
Both active direct issues are covered by coding requirements that this PR addresses with automated tests. Runtime fixes are already present at the reviewed head (0db502c), so the PR does not need runtime changes.
[#12135] Requirement: the minor dead-owner probe must agree with the sweep for TENURED owners, so address-keyed entries for in-place-tenured Eden objects are pruned. Source at head: PostTraceProbe::owner_is_dead in crates/perry-runtime/src/gc/dead_owner.rs no longer refuses TENURED owners. It uses physical nursery classification (classify_heap_generation) for minors. The new test tenured_owner_still_in_the_nursery_is_pruned_on_a_minor in gc/tests/dead_owner_side_tables.rs drives prune_dead_owner_side_tables_post_trace(false, false) with ELEMENT_SHAPES records for an unmarked TENURED nursery owner (pruned), a marked owner (kept), and an old-generation owner (kept). The author reports that the test fails when the refusal is restored.
[#10394] Requirement: async parentPort message handlers must resume after await and send replies. The new parity case test_gap_10394_async_message_handler_resumes.ts with fixtures/async_message_handler_worker.ts covers the sync, microtask, timer, two-timer, and import('node:fs/promises') plus stat paths. The author reports failures on 796d6a5 and 5a12983 and passes on ea61b44 and main (5/5 runs each). Head source shows the worker-side event-loop wiring (WorkerSender::send calls notify_agent_loop; the comments describe the worker's own await loop). I did not re-read the worker-loop body in full, so the runtime fix rests on this evidence and the reported runs.
Unresolved scope notes: #12135 also asks for an audit of other young-logged side tables (closure props, descriptors). The PR does not address that audit, and the issue frames it as related work, not as a requirement of this PR. The #10394 'suggested direction' is a suggestion, not a requirement.
Full details: Out of Scope Changes check
Explanation
The PR changes are test-related and directly support the two linked issues. The changes are: a new regression test in crates/perry-runtime/src/gc/tests/dead_owner_side_tables.rs for #12135; a new parity case and worker fixture under tests/parity/node-suite/worker_threads/ for #10394; and a changelog fragment changelog.d/14953-pin-12135-10394-regressions.md, which the repository convention requires for crates/ changes. The PR does not change runtime code. The head source of dead_owner.rs and worker_threads.rs was inspected only to confirm the existing fixes. No unrelated changes were found in the summary.
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.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.
…erryTS#12135)
18a1274 made the post-trace minor probe decide by physical heap
generation instead of refusing every TENURED owner. Its test went away
with the function-class table in 2b6785a, so nothing pinned the rule.
The new test drives the real fan-out with ELEMENT_SHAPES records and
fails with the TENURED refusal put back.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p
PerryTS#10394)
A worker's async 'message' handler must resume after awaiting a job, one
or two timers, or a promise-based fs call, and post its reply. Each
request is sent after the previous reply arrives, so the output order is
fixed. The case fails before 5a12983 (no continuation runs) and
before ea61b44 (a timer await never resumes).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p
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
This PR adds regression tests for two issues that are already fixed on
mainbut had no test pinning the fix. It is test-only and changes no runtime code.Changes
crates/perry-runtime/src/gc/tests/dead_owner_side_tables.rs::tenured_owner_still_in_the_nursery_is_pruned_on_a_minorif flags & GC_FLAG_TENURED != 0 { return false; }put back intoPostTraceProbe::owner_is_dead. The test panics with "an unmarked TENURED owner still in the nursery is dead after a minor".tests/parity/node-suite/worker_threads/test_gap_10394_async_message_handler_resumes.ts(+fixtures/async_message_handler_worker.ts)timeout after ["sync -> sync"]. At 5a12983 (= ea61b44^) it istimeout after ["sync -> sync","microtask -> microtask"]. At ea61b44 and on main all five cases pass.mainpinned the rule after that. The new test drives the realprune_dead_owner_side_tables_post_trace(false, false)fan-out withELEMENT_SHAPESrecords for three owners:await— worker RPC replies are never sent #10394. A worker's asyncparentPort'message'handler awaits one of: nothing, a job, a timer, two timers in a row, orimport("node:fs/promises")followed byfs.stat. Then it replies. The parent sends each request only after the previous reply arrives, so the output order is fixed. The 10 s guard timer only turns a lost reply into printable output; nothing is decided by timing.crates/perry/tests/issue_10854_worker_async_onmessage.rsalready covers the microtask case for the globalonmessage. Nothing covered the timer case or theparentPortpath.crates/.Related issue
Fixes #12135
Fixes #10394
Considered and left out:
mainbycrates/perry/tests/issue_6764_async_hooks_prototype_metadata.rs::async_hooks_constructors_expose_real_prototype_methods; the issue is that test failing on Linux. It is Linux-only and not run here.tests/parity/node-suite/worker_threads/test_gap_worker_12285_natural.tsalready has the issue's shape: a worker that posts and returns, while the parent waits for'exit'. Showing that it hangs on the parent commit needs two more builds and about 30 runs per side, which did not fit this round. On main: 0 hangs in 30 runs of a 5-sequential-workeronce(w, "exit")repro (macOS).URLSearchParams.prototypemethods are still non-enumerable and alphabetically ordered, andSymbol(nodejs.util.inspect.custom)is missing.Test plan
macOS arm64, LLVM 22.1.8, Node 26.12.1. Main is cba7eaf, built with
cargo build-perry --release && scripts/gc_call_effects/sidecars.sh target/release.perry-runtime's lib tests do not link on currentmain:___data_start,___start_perry_*and the other ELF image symbols are undefined. I ran the gc: minor dead-owner probe refuses TENURED owners, so address-keyed entries for in-place-tenured Eden objects go stale while the address is still mapped #12135 test with fix(runtime): declare the ELF image symbols on Linux only, so perry-runtime's lib tests link on macOS #14931's diff applied locally. That diff is not part of this PR.node-suite/worker_threadsgains one passing case.scripts/run_lint_gates.sh; CI'slintjob covers it.WebSocketServerthat closes first. It is not included because everyhttpserver listen on currentmainfails on this machine withEAGAIN. Builds of b77aba6 and earlier listen fine. That is being looked at separately.Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p
Summary by CodeRabbit