Skip to content

fix: restore GC root dominance scheduled gate - #9929

Closed
proggeramlug wants to merge 1 commit into
PerryTS:mainfrom
proggeramlug:fix/9925-root-dominance-gate
Closed

fix: restore GC root dominance scheduled gate#9929
proggeramlug wants to merge 1 commit into
PerryTS:mainfrom
proggeramlug:fix/9925-root-dominance-gate

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

The scheduled GC root-dominance workflow stopped before it could analyze current compiler output: the dependency corpus retained all 81 modules and about 14,000 root stores after compiler pruning reduced its function population to 5,615-5,920, while both native corpus producers still scraped STATEPOINT_REWRITE_PASSES from the pre-split inprocess.rs. Once native emission was restored, LLVM 22 also exposed quoted inlined block labels that the checker refused to parse.

This change:

  • recalibrates the dependency function floor to 5,000 while preserving the 60-module and 4,000-root-store floors;
  • adds one checked reader for the unique production statepoint pass constant anywhere under perry-codegen/src, and makes both native corpus producers use it;
  • prefers LLVM_SYS_221_PREFIX before an unversioned Homebrew LLVM in the dependency-native producer;
  • makes dependency source registration tolerate worktree path prefixes while still requiring exactly one emitted module per source;
  • parses quoted LLVM block declarations and references consistently across branches, switches, invokes, and phi edges, with a planted quoted-edge hazard in the required self-test.

Validation:

  • dependency shadow corpus: 81 modules, 5,920 functions, 14,121 root stores; 0 dominance violations; 0 unrooted-allocation violations; 23 stale-register findings within the existing budget of 118; all 40 seeded violations caught;
  • dependency native corpus: 81 modules, 53,215 safepoints, 40,008 live bundles, 227,541 relocates; 2 unrooted findings within the budget of 3, 0 stale findings, all 40 seeded violations caught;
  • curated native corpus: 158/158 sources, 186 modules, 3,368 functions, 41,183 safepoints, 99,887 relocates; 0 hazards, all 40 seeded violations caught;
  • scripts/run_lint_gates.sh: all 66 local gates passed, 2 CI-expression rows skipped; workspace warnings check and Clippy passed.

Closes #9925

Summary by CodeRabbit

  • Bug Fixes

    • Improved compatibility with quoted identifiers, preserving control-flow and data-flow analysis for a wider range of generated code.
    • Improved dependency-scale coverage detection for module names that include directory prefixes.
    • Updated dependency validation thresholds to reflect current compiler output while retaining safeguards against incomplete analysis.
  • Tests

    • Added automated linting and self-validation for statepoint configuration handling.
    • Expanded self-tests to cover quoted names, labels, control-flow edges, and hazard detection.
  • Chores

    • Improved automatic discovery and validation of compiler tooling and configuration.

@coderabbitai

coderabbitai Bot commented Sep 6, 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: Team

Run ID: 181d06ad-a173-4c0f-81af-628745d76b73

📥 Commits

Reviewing files that changed from the base of the PR and between 87dc334 and 29d52f4.

📒 Files selected for processing (7)
  • .github/workflows/gc-root-dominance.yml
  • .github/workflows/test.yml
  • scripts/gc_root_dominance_check.py
  • scripts/gc_root_dominance_corpus.sh
  • scripts/gc_root_dominance_dep_corpus.sh
  • scripts/gc_root_dominance_dep_native_corpus.sh
  • scripts/read_statepoint_rewrite_passes.py

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


📝 Walkthrough

Walkthrough

The change improves GC root dominance tooling for quoted LLVM labels, centralizes statepoint pass pipeline discovery, and updates dependency-scale corpus validation for current compiler output and emitted module names.

Changes

GC Root Dominance Validation

Layer / File(s) Summary
Quoted LLVM label parsing and validation
scripts/gc_root_dominance_check.py
The parser normalizes quoted block labels across declarations, CFG edges, and phi predecessors. The self-test verifies quoted labels and hazard reporting.
Statepoint pass source reader
scripts/read_statepoint_rewrite_passes.py, scripts/gc_root_dominance_corpus.sh, scripts/gc_root_dominance_dep_native_corpus.sh, .github/workflows/test.yml
A shared Python reader scans Rust sources for the unique statepoint rewrite pipeline. Corpus scripts use it, and CI runs its self-test and repository check.
Dependency corpus validation
scripts/gc_root_dominance_dep_corpus.sh, .github/workflows/gc-root-dominance.yml
Dark-source checks accept prefixed module names. Dependency-scale function-count floors are lowered from 6000 to 5000.

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

Merge Risk: ⚪ Minimal · up to 29d52

This restores scheduled GC root-dominance checks by handling quoted LLVM labels, reading the production statepoint pipeline consistently, and updating corpus expectations for current compiler output. No concrete merge-blocking risk remains.

Suggested reviewers: jdalton

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 38.46% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 5 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: restoring the scheduled GC root-dominance gate.
Description check ✅ Passed The description provides a clear summary, detailed changes, linked issue, validation results, and test coverage. It omits some template headings and checklist items, but the required information is su…
Linked Issues check ✅ Passed The changes directly address issue #9925 by restoring dependency-scale analysis, native statepoint corpus generation, and LLVM output parsing for the failing scheduled checks.
Out of Scope Changes check ✅ Passed The changes are within scope for issue #9925. The pass reader, LLVM label parsing, corpus discovery updates, toolchain selection, and workflow threshold changes all support restoration of the GC root-…
Full details: Docstring Coverage

Explanation

Docstring coverage is 38.46% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 5 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 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

Landed on main via merge train #9939. Validated as a tree: 66/66 lint gates, and perry-runtime/codegen/hir/stdlib all green (5,966 tests, 0 failures). Thanks!

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.

[scheduled-gate:gc-root-dominance.yml] GC Root Dominance is failing on main

1 participant