Skip to content

fix(gc): restore the raw-handle debt baseline after #7693 - #7704

Merged
proggeramlug merged 2 commits into
mainfrom
fix/7693-raw-handle-debt
Aug 9, 2026
Merged

fix(gc): restore the raw-handle debt baseline after #7693#7704
proggeramlug merged 2 commits into
mainfrom
fix/7693-raw-handle-debt

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

fix(gc): restore the raw-handle debt baseline after #7693, and convert four pairs to pay for it.

#7693's regression test asserts a sentinel's pre/post address comparison — which is precisely what across_* exists to make unnameable, so converting its four reads would delete the test's subject. It joins json_shape_template.rs as the second instance of that permitted shape.

raw_handle_debt_files.txt allows listing only when the same change converts enough pairs elsewhere that the global baseline does not rise. Four converted, each a genuine read-after-allocating-call:

  • os.rsjs_object_alloc_with_shape + the times re-read (ceiling 4 → 3)
  • util_parse_args.rsjs_string_from_bytes + the values re-read (20 → 19)
  • weakref.rsentries_array (itself allocating) + the entry re-read (7 → 6)
  • regex/match_all.rsbuild_match_all_groups_owned + the inner-array re-read (14 → 13)

Net 998 → 998, 110 modules within ceilings.

Also converts three weakref.rs js_string_from_bytes + registry-re-read sites to across_nanbox. Those do not move the counter — it matches only .get_raw_{mut,const}_ptr — but they are the same defect and the same fix, and leaving them because they are invisible to the ratchet would be optimising for the metric.

Summary by CodeRabbit

  • Bug Fixes

    • Improved runtime stability during memory-intensive operations, including regular expressions, weak references, option parsing, and system information handling.
    • Reduced the risk of invalid object references after automatic memory cleanup.
  • Documentation

    • Updated release documentation and internal quality tracking for runtime memory-handling improvements.
  • Chores

    • Incremented the application version to 0.5.1399.

Ralph Küpper added 2 commits August 9, 2026 15:06
#7693's test asserts a pre/post address comparison, the shape across_* exists
to make unnameable, so it is listed rather than converted. Four pairs converted
elsewhere to hold the baseline at 998.

Claude-Session: https://claude.ai/code/session_01Y1QZ5wUP9gRSwpiweT4Wix
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 91a5815c-e317-460a-8514-f589bcd9162c

📥 Commits

Reviewing files that changed from the base of the PR and between 3dbbcc7 and 48cef82.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • CLAUDE.md
  • Cargo.toml
  • changelog.d/7704-raw-handle-debt-after-7693.md
  • crates/perry-runtime/src/os.rs
  • crates/perry-runtime/src/regex/match_all.rs
  • crates/perry-runtime/src/util_parse_args.rs
  • crates/perry-runtime/src/weakref.rs
  • scripts/raw_handle_debt_files.txt

📝 Walkthrough

Walkthrough

The runtime now refreshes movable pointers across allocation-triggered GC activity. Raw-handle debt ceilings and changelog records were updated. Workspace version references were incremented from 0.5.1398 to 0.5.1399.

Changes

Raw handle debt reduction

Layer / File(s) Summary
Refresh pointers across allocation
crates/perry-runtime/src/os.rs, crates/perry-runtime/src/regex/match_all.rs, crates/perry-runtime/src/util_parse_args.rs, crates/perry-runtime/src/weakref.rs
Runtime allocation paths use across_mut or rooted-handle re-reads before accessing movable objects.
Update raw-handle debt baseline
scripts/raw_handle_debt_files.txt, changelog.d/7704-raw-handle-debt-after-7693.md
Debt ceilings were reduced for updated runtime files. A three-handle allowance was added for fs_options_object.rs, and the baseline remains 998 handles across 110 modules.
Update version metadata
Cargo.toml, CLAUDE.md
The workspace and documented version were updated to 0.5.1399.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • PerryTS/perry#7389: Introduced the RuntimeHandle::across_* helpers used by these runtime paths.
  • PerryTS/perry#7455: Updated GC-sensitive raw-handle allocation and pointer re-read patterns.
  • PerryTS/perry#7488: Replaced unsafe raw-handle re-reads and adjusted debt ceilings.

Suggested labels: bug

Suggested reviewers: thehypnoo

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/7693-raw-handle-debt

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

Comment @coderabbitai help to get the list of available commands.

@proggeramlug
proggeramlug merged commit b0e4a28 into main Aug 9, 2026
28 of 47 checks passed
@proggeramlug
proggeramlug deleted the fix/7693-raw-handle-debt branch August 9, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant