Skip to content

test: pin fixes reported in #12135 and #10394 with regression tests - #14953

Merged
TheHypnoo merged 4 commits into
PerryTS:mainfrom
raliclo:fix/pin6-regressions
Nov 18, 2026
Merged

TheHypnoo merged 4 commits into
PerryTS:mainfrom
raliclo:fix/pin6-regressions

Conversation

@raliclo

@raliclo raliclo commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

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.

Changes

Issue Fixing commit(s) Test Fails without the fix
#12135 18a1274 crates/perry-runtime/src/gc/tests/dead_owner_side_tables.rs :: tenured_owner_still_in_the_nursery_is_pruned_on_a_minor 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".
#10394 5a12983 (microtask), ea61b44 (timer) tests/parity/node-suite/worker_threads/test_gap_10394_async_message_handler_resumes.ts (+ fixtures/async_message_handler_worker.ts) 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.

Related issue

Fixes #12135
Fixes #10394

Considered and left out:

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.

# #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)

Checklist

  • I have NOT bumped the workspace version or edited CHANGELOG.md
  • My commits follow the loose prefix convention used in the log
  • I've read CONTRIBUTING.md and agree to the Code of Conduct

🤖 Generated with Claude Code

https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p

Summary by CodeRabbit

  • Tests
    • 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.

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

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.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: Minimal · previous review 0db50

This change adds regression tests for two existing fixes and does not alter runtime behavior. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed 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 Passed 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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 16f0ebcc-a399-4b25-b8bd-3b6632398988
Commits

Reviewing files that changed from the base of the PR and between f026dac and 0db502c.

Files selected for processing: 4

  • changelog.d/14953-pin-12135-10394-regressions.md
  • crates/perry-runtime/src/gc/tests/dead_owner_side_tables.rs
  • 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

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.

@TheHypnoo TheHypnoo added area:runtime-gc perry-runtime: values, heap, GC, linking effort:S Hours: one local fix impact:low Edge case or single test type:chore Refactor, CI, docs, cleanup labels Nov 18, 2026
ralic and others added 4 commits November 18, 2026 21:46
…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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p
@TheHypnoo
TheHypnoo force-pushed the fix/pin6-regressions branch from 0db502c to df1cb0f Compare November 18, 2026 21:21
@TheHypnoo
TheHypnoo merged commit 8168270 into PerryTS:main Nov 18, 2026
99 of 107 checks passed
@raliclo
raliclo deleted the fix/pin6-regressions branch November 18, 2026 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:runtime-gc perry-runtime: values, heap, GC, linking effort:S Hours: one local fix impact:low Edge case or single test type:chore Refactor, CI, docs, cleanup

Projects

None yet

3 participants