Skip to content

chore(gates): GC store-site verdicts for seven raw writes; bind class_field_set to the _known emitter - #14750

Merged
TheHypnoo merged 1 commit into
PerryTS:mainfrom
raliclo:fix/lint-storesite
Nov 16, 2026
Merged

TheHypnoo merged 1 commit into
PerryTS:mainfrom
raliclo:fix/lint-storesite

Conversation

@raliclo

@raliclo raliclo commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

GC store-site inventory (python3 scripts/gc_store_site_inventory.py) fails on main (CI run 43639432681, lint) for two reasons: the stem census lost track of the class-field store, so its class_field_set IR witness was reported stale although the emitter call still exists, and seven raw slot writes/copies carry no GC_STORE_AUDIT verdict. This PR fixes both. Comments and gate tables only; generated code and runtime behaviour are unchanged.

Changes

  • scripts/gc_store_site_inventory.py: 0b12532 moved the class-field store (expr/property_set.rs) onto emit_jsvalue_slot_store_pointer_tested_known, a variant the census did not list. Register it in STEM_EMITTER_ARG_INDEX (stem at index 8, same as the plain emitter) and add emit_jsvalue_slot_store_pointer_tested to STEM_FORWARDERS (it now forwards its stem parameter to _known). The census binds class_field_set again: 25 codegen barrier sites bound to 18 IR-witnessed stems. No registry entry is deleted.
  • Verdicts (each placed on the write it covers):

Proposed verdicts; please confirm the ROOT classification of the async-module record fields in particular.

Related issue

Refs #14595. Main's CI run: https://github.com/PerryTS/perry/actions/runs/43639432681

Test plan

Measured on macOS arm64:

  • Stale witness introduced by 0b12532: the gate's output mentions class_field_set at 0b12532106 and not at its parent 4a2e900fbb (the gate already failed there for other reasons). The other sites' commits above are from git log -S (where the line was added), not from a gate probe.
  • upstream/main: FAIL (7 unaudited sites + stale class_field_set witness).
  • this branch: GC store-site inventory passed (3596 files scanned, 809 audited sites, 160 allowlisted); --self-test passed.
  • Negative controls: deleting the two record-array markers brings back 2 record_array.rs findings; removing the _known entry from STEM_EMITTER_ARG_INDEX brings back the stale class_field_set error.
  • BASE_SHA=upstream/main scripts/run_lint_gates.sh (full run): FAIL set = main's minus GC store-site inventory; no new FAIL.
  • No code changes (comments only in crates/), so no crate tests were rerun for this branch.

Checklist

  • I have NOT bumped the workspace version or edited CHANGELOG.md (maintainer handles these at merge)
  • My commits follow the loose feat: / fix: / docs: / chore: 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

  • Documentation
    • Clarified notes about how runtime memory writes are handled and classified.
  • Chores
    • Updated memory-write audit coverage for additional code paths. Runtime behavior is unchanged.

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 11 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 included reviews currently available.

Learn how review limits work.

Review configuration:

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: 13639f88-5aed-498b-9311-a4bf42251178
Commits

Reviewing files that changed from the base of the PR and between 722a652 and 49ef8cc.

Files selected for processing: 6

  • changelog.d/14750-gc-store-site-verdicts.md
  • crates/perry-runtime/src/async_module.rs
  • crates/perry-runtime/src/module_require/init_guard_tests.rs
  • crates/perry-runtime/src/record_array.rs
  • crates/perry-runtime/src/typedarray/slice_ops.rs
  • scripts/gc_store_site_inventory.py

No actionable comments were generated in the recent review.

Walkthrough

The changes add GC audit comments for runtime store and copy sites, extend the inventory script to recognize a pointer-tested emitter and its forwarder, and document the audit updates. Runtime behavior is unchanged.

Changes: GC store-site audit

Layer / File(s) Summary
Audit annotations and inventory recognition
crates/perry-runtime/src/async_module.rs, crates/perry-runtime/src/module_require/init_guard_tests.rs, crates/perry-runtime/src/record_array.rs, crates/perry-runtime/src/typedarray/slice_ops.rs, scripts/gc_store_site_inventory.py, changelog.d/14750-gc-store-site-verdicts.md
Runtime comments classify module-record roots, integer guard words, and record and typed-array copies. The inventory script recognizes emit_jsvalue_slot_store_pointer_tested_known and its forwarding function. The changelog documents seven audited writes and copies and the restored class_field_set witness binding.

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

Change: Other

Possibly related PRs

  • PerryTS/perry#14604: Reports a failing GC store-site inventory gate that this PR also updates.

Suggested reviewers: proggeramlug

Merge Risk: Minimal · previous review 722a6

This change only adds GC audit annotations and teaches the inventory gate to recognize one more emitter, so runtime behavior is unchanged. It is safe to merge. Reviewers can still confirm the ROOT classification for async-module store_root.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: adding GC store-site verdicts for seven raw writes and binding the class_field_set witness to the _known emitter. It matches the changeset, which edits gate tables and…
Description check Passed The description follows the template sections: Summary, Changes, Related issue, Test plan, and Checklist. It explains the stale class_field_set witness and the seven unaudited sites, lists each change…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: adding GC store-site verdicts for seven raw writes and binding the class_field_set witness to the _known emitter. It matches the changeset, which edits gate tables and comments in the inventory script and several runtime files, and the title is concise and specific.

Full details: Description check

Explanation

The description follows the template sections: Summary, Changes, Related issue, Test plan, and Checklist. It explains the stale class_field_set witness and the seven unaudited sites, lists each change with its file and verdict, gives measured results and negative controls, and confirms the checklist items. The template's Test plan checkboxes for cargo build and cargo test are not ticked, but the author explains that no crate tests were rerun because only comments changed. The author also asks reviewers to confirm the ROOT classification.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • 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: c45f7f33-6ad7-44c7-83d7-3ee5a1414b45
Commits

Reviewing files that changed from the base of the PR and between 64257c3 and 722a652.

Files selected for processing: 6

  • changelog.d/14750-gc-store-site-verdicts.md
  • crates/perry-runtime/src/async_module.rs
  • crates/perry-runtime/src/module_require/init_guard_tests.rs
  • crates/perry-runtime/src/record_array.rs
  • crates/perry-runtime/src/typedarray/slice_ops.rs
  • scripts/gc_store_site_inventory.py

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

…_field_set to the _known emitter

The class-field store calls emit_jsvalue_slot_store_pointer_tested_known
directly, which the stem census did not list, so the class_field_set
witness read as stale. Register the _known emitter (stem at index 8) and
mark the plain emitter as a stem forwarder.

Verdicts for seven unaudited raw writes:
- async_module.rs store_root: ROOT (fields registered as global roots;
  the root barrier runs first)
- init_guard_tests.rs: POINTER_FREE (integer guard words in a test static)
- record_array.rs pop/get: POINTER_FREE (immediate record words copied
  to the caller's frame)
- typedarray/slice_ops.rs fill: POINTER_FREE (element bytes into a typed
  array data buffer)
@TheHypnoo
TheHypnoo merged commit c0086e5 into PerryTS:main Nov 16, 2026
113 of 134 checks passed
@raliclo
raliclo deleted the fix/lint-storesite branch November 17, 2026 01:36
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.

3 participants