Skip to content

fix(runtime): restore -D warnings cleanliness - #8923

Merged
proggeramlug merged 2 commits into
PerryTS:mainfrom
proggeramlug:fix/8910-runtime-warnings
Aug 28, 2026
Merged

fix(runtime): restore -D warnings cleanliness#8923
proggeramlug merged 2 commits into
PerryTS:mainfrom
proggeramlug:fix/8910-runtime-warnings

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Restores perry-runtime warning cleanliness without suppressing dead-code lints. Test-only helpers are now configured explicitly, and the GC layout helpers regain their accidentally displaced regression-test callers.

Changes

  • Gate cell_has_meta_edge behind cfg(test), matching its real caller.
  • Restore the nursery and old-generation layout-record regression tests that exercise both layout-table test helpers.
  • Reattach the shape-table scanner documentation to the function it describes.

Related issue

Fixes #8910

Test plan

  • cargo fmt --all -- --check
  • cargo test -p perry-runtime --lib layout_record -- --test-threads=1
  • cargo test -p perry-runtime --lib error_cell_exposes_a_meta_edge_like_an_object -- --test-threads=1
  • RUSTFLAGS="-D warnings" cargo check -p perry-runtime --all-targets
  • RUSTFLAGS="-D warnings" cargo check -p perry --bins
  • RUSTFLAGS="-D warnings" cargo check --workspace --all-targets with the CI host-compatible excludes

Checklist

  • No workspace version, CLAUDE.md, or CHANGELOG.md bump
  • Commit follows the repository prefix convention

Summary by CodeRabbit

  • Bug Fixes

    • Restored warning-free runtime builds by limiting test-only checks to test environments.
    • Improved garbage-collection bookkeeping so obsolete records are cleaned up while active records remain protected.
  • Tests

    • Added regression coverage for memory-layout tracking during collection and allocation scenarios.
  • Documentation

    • Clarified documentation for internal runtime behavior and test coverage.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d04bcd87-c96c-44cc-a5be-8b016ba260fd

📥 Commits

Reviewing files that changed from the base of the PR and between 5a5274c and ec3bf5b.

📒 Files selected for processing (4)
  • changelog.d/8923-runtime-warnings-clean.md
  • crates/perry-runtime/src/gc/tests/dead_owner_side_tables.rs
  • crates/perry-runtime/src/object/mod.rs
  • crates/perry-runtime/src/object/shapes.rs

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


📝 Walkthrough

Walkthrough

The change restores warning-clean perry-runtime builds by gating a test-only metadata helper and adding GC layout-record regression tests. It also moves a shape-table documentation comment and adds a changelog entry.

Changes

GC layout records and warning cleanup

Layer / File(s) Summary
Layout record lifecycle tests
crates/perry-runtime/src/gc/tests/dead_owner_side_tables.rs
Adds helpers and tests for pruning dead nursery layout records and retaining live old-page records.
Test helper and documentation cleanup
crates/perry-runtime/src/object/mod.rs, crates/perry-runtime/src/object/shapes.rs, changelog.d/8923-runtime-warnings-clean.md
Restricts cell_has_meta_edge to test builds, moves the shape-table repair comment, and documents the warning-cleanup changes.

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

Merge Risk: ⚪ Minimal · up to ec3bf

This change restores regression coverage and warning-clean builds without altering production interfaces or deployment behavior. No actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: jdalton, thehypnoo

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the primary change: restoring warning-clean runtime builds.
Description check ✅ Passed The description includes the required summary, changes, related issue, test plan, and checklist. Optional screenshots are not needed, and the omitted contribution and code-of-conduct checklist items a…
Linked Issues check ✅ Passed The changes address issue #8910 by gating the genuinely test-only helper, restoring callers for the layout-table helpers, avoiding warning suppression, and documenting warning-clean validation.
Out of Scope Changes check ✅ Passed All changes support the warning-cleanliness objective. The changelog entry and documentation relocation are directly related, and no unrelated code changes are identified.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 3 files. (1 skipped: 1 …
Full details: Description check

Explanation

The description includes the required summary, changes, related issue, test plan, and checklist. Optional screenshots are not needed, and the omitted contribution and code-of-conduct checklist items are non-critical.

Full details: Docstring Coverage

Explanation

Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 3 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link
Copy Markdown
Contributor Author

Merged. This fixes a red warnings job on main that I let through.

cargo check --workspace --all-targets under -D warnings was failing on test_per_object_layout_present and test_young_layout_records in gc/layout_tables.rs being never used. Restoring their regression-test callers is the right fix — those helpers assert real layout behaviour, so deleting them to silence the lint would have traded a warning for lost coverage.

How it got in: I ran every gate check last night with SKIP_COMPILE_GATES=1 and reported "all 53 gates passed" each time. That is the script tier only; the compile tier mirrors the separate warnings and check jobs, and run_lint_gates.sh's own header documents this exact episode happening on 2026-08-18 after #8333 — "a tier you do not run is a tier that did not pass." Verified with the full run now.

Validation — runtime 2764/0 (RUST_TEST_THREADS=1); scripts/run_lint_gates.sh all 55 gates pass including the compile tier (warnings ok, clippy ok), validated together with #8922 on top of current main.

@proggeramlug
proggeramlug merged commit e173f02 into PerryTS:main Aug 28, 2026
44 of 48 checks passed
proggeramlug pushed a commit to proggeramlug/perry that referenced this pull request Aug 28, 2026
… restored

This branch deleted `test_per_object_layout_present` and
`test_young_layout_records` to satisfy `-D warnings`. PerryTS#8923 landed the other
resolution — restoring their regression-test callers — so removing them here
merges cleanly but does not compile.
proggeramlug added a commit that referenced this pull request Aug 28, 2026
… push arm ahead of the tracked resolver (wolf-ecs −11.2% / −11.9%) (#8921)

* perf(codegen): field-value arguments to sibling methods keep the proven-this clone

The this-flow walker rejected a method as a proven-`this` clone candidate
whenever an internal `this.m(...)` / `super.m(...)` call's ARGUMENTS
mentioned `this` at all, even for a declared-field read such as
`this._archChange(this._ent[id], i)`. That argument hands the callee a
field's value, never the receiver; `expr_this_safe` already rejects a bare
`this` in value position, a `this`-capturing closure and a non-field
`this.x` read on its own. wolf-ecs `addComponent`, `removeComponent` and
`createEntity` each make such a call and therefore ran their public bodies,
re-proving `this` at every property, element and method site (≈14k
instructions for ~20 source lines; the flat 54% inline self time of the
add/remove profile).

Vet the arguments with `expr_this_safe` alone. A bare `this` argument still
rejects (pinned by the new test).

Claude-Session: https://claude.ai/code/session_019WVcWKmYsUBnnFB7nBgbBJ

* perf(runtime): object-backed subclass push arm ahead of the tracked resolver

#8897's `field_push_local_bind` turns `this.packed.push(x)` into a local
`ArrayPush`, whose complete fallback is `js_array_push_f64_spec`. For an
object-backed Array subclass (wolf-ecs `Archetype`) that entry paid the
tracked resolver — a guaranteed miss on a `GC_TYPE_OBJECT` header — and
then delegated to `js_array_push_f64`, which paid it again before reaching
the dense subclass arm. Both entries now ask the dense arm first, off the
header tag the guarded element tiers already read; every rejected case
keeps the complete route.

Test: `spec_and_generic_push_entries_append_to_an_object_backed_subclass_densely`
pins, via a test-only probe counter on `try_read_tracked_gc_header`, that the
spec and generic entries reach the dense arm with exactly the fused u31
entry's probes (none).

Claude-Session: https://claude.ai/code/session_019WVcWKmYsUBnnFB7nBgbBJ

* changelog: fragment for #8921

Claude-Session: https://claude.ai/code/session_019WVcWKmYsUBnnFB7nBgbBJ

* runtime: clear main's -D warnings errors (dangling doc, test-only meta-edge probe, unused layout test helper)

main f989075 fails the workspace -D warnings check on its own: a doc comment left without an item in object/shapes.rs, cell_has_meta_edge whose only caller is a test, and an unused #[cfg(test)] layout helper. Gate/remove them so this PR's warnings job can pass.

Claude-Session: https://claude.ai/code/session_019WVcWKmYsUBnnFB7nBgbBJ

* fix(gc): keep the layout-table test helpers, whose callers #8923 restored

This branch deleted `test_per_object_layout_present` and
`test_young_layout_records` to satisfy `-D warnings`. #8923 landed the other
resolution — restoring their regression-test callers — so removing them here
merges cleanly but does not compile.

---------

Co-authored-by: Ralph Küpper <ralph@skelpo.com>
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.

release blocker: restore perry-runtime -D warnings cleanliness

1 participant