Skip to content

fix: unstick main's red lint and cargo-test gates - #8695

Merged
proggeramlug merged 1 commit into
mainfrom
merge/b11
Aug 24, 2026
Merged

fix: unstick main's red lint and cargo-test gates#8695
proggeramlug merged 1 commit into
mainfrom
merge/b11

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Lands #8685main was red on lint and cargo-test independently of any in-flight PR, because three checkers went stale after correct code landed.

I confirmed the red first rather than taking the title on faith: on ae68a5bc8, addr_class_inventory.py and shape_descriptor_census.py both fail, and codegen_env_vars_are_build_cache_inputs fails 1/4. All three are fixed here (full lint set green, build-cache tests 4/4).

The three staleness causes

  • shape_descriptor_census.py still asserted the pre-perf(codegen): trim two redundant operations from the PIC property-get hit path #8665 fail-closed shape in the generic property-read PIC, and its callsite baseline was missing two legitimate object_header_size_bytes(...) sites that perf(codegen): refresh rooted arrays, gate super-scope, and count store safepoints #8680 added in inline_dyn_typed_array.rs.
  • addr_class_inventory.py's lone-valid-obj-ptr rule reimplemented a 1-line lookahead instead of reusing the comment/blank-aware band_predicate_near helper the handle-floor rule already uses. I checked both flagged sites in array/subclass.rs (237 and 453) — each is a correctly-paired is_valid_obj_ptr guard followed three lines later by try_read_gc_header, which the 1-line lookahead structurally could not see past. Genuine false positives.
  • codegen_env_vars_are_build_cache_inputs failed on two unclassified env vars: PERRY_CONST_ARRAY_DESCRIPTOR (changes emitted IR → a build-cache input) and PERRY_DIALECT_DUMP (read only on an already-fatal dialect-construction failure, so it cannot affect a successful build's bytes → excluded).

On the ratchet baseline

A rule change that reduces hits deserves scrutiny, since the failure direction of an under-counting scanner is green. Two checks:

  • addr_class_inventory.py --self-test passes, so the rule can still fail.
  • The baseline was regenerated from the merged tree rather than hand-merged through its conflict, and every change is in the strict direction — four entries removed outright, class_registry/construct.rs 5 → 3, nothing loosened.

Validation

  • All 30 lint-job checkers pass (not just the subset I'd been running — see note below)
  • cargo test -p perry --bin perry commands::compile::build_cache::tests::: 4/4
  • perry-codegen --lib 1199/0, perry-runtime --lib 2655/0 at RUST_TEST_THREADS=1
  • Squashed tree verified identical to the validated tree

Version bump stripped per maintainer policy (Cargo.toml, CLAUDE.md, Cargo.lock now byte-identical to main); the changelog fragment was renamed from 8684- to its own PR number.

Note for my own process: two of the three stale checkers were tripped by #8680, which I merged, and neither addr_class_inventory.py nor shape_descriptor_census.py was in the gate subset I'd been running locally. I've regenerated my local gate set from test.yml so all 30 run from here on.

Summary by CodeRabbit

  • Bug Fixes

    • Improved build-cache accuracy so relevant compiler configuration changes trigger fresh builds.
    • Strengthened safety checks for object-pointer handling and shape-descriptor validation.
    • Corrected validation baselines to reflect current compiler behavior.
  • Tests

    • Added coverage for nested and sibling conditional guards.
    • Added checks that detect incorrect authority-validation logic.
  • Documentation

    • Documented fixes for previously failing main-branch quality gates.

Lands #8685. main was red on `lint` and `cargo-test` independently of any
in-flight PR: three checkers went stale after correct code landed.

- `shape_descriptor_census.py` still asserted the pre-#8665 fail-closed
  shape in the generic property-read PIC, and its callsite baseline was
  missing two legitimate `object_header_size_bytes(...)` sites that #8680
  added in `inline_dyn_typed_array.rs`.
- `addr_class_inventory.py`'s `lone-valid-obj-ptr` rule reimplemented a
  1-line lookahead instead of reusing the comment/blank-aware
  `band_predicate_near` helper the `handle-floor` rule already uses. That
  flagged two correctly-paired `is_valid_obj_ptr` + `try_read_gc_header`
  guards in `array/subclass.rs` as false positives.
- `codegen_env_vars_are_build_cache_inputs` failed on two unclassified
  env vars: `PERRY_CONST_ARRAY_DESCRIPTOR` (changes emitted IR, so a
  build-cache input) and `PERRY_DIALECT_DUMP` (read only on an already
  fatal dialect-construction failure, so excluded).

The addr-class ratchet baseline was regenerated from the merged tree
rather than hand-merged through its conflict. Every change is in the
strict direction: four entries removed outright and
`class_registry/construct.rs` 5 -> 3, nothing loosened. The rule still
detects real violations (`--self-test` passes).

Version bump stripped per maintainer policy; the changelog fragment was
renamed to its own PR number.
@proggeramlug
proggeramlug merged commit 10d9ca5 into main Aug 24, 2026
@proggeramlug
proggeramlug deleted the merge/b11 branch August 24, 2026 04:28
@coderabbitai

coderabbitai Bot commented Aug 24, 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: cb8f4f50-c32b-4a5e-b8ac-5b5d952a0835

📥 Commits

Reviewing files that changed from the base of the PR and between ae68a5b and ff083e7.

📒 Files selected for processing (6)
  • changelog.d/8685-fix-main-red-lint-cargo-test.md
  • crates/perry/src/commands/compile/build_cache.rs
  • scripts/addr_class_inventory.py
  • scripts/addr_class_ratchet_baseline.txt
  • scripts/shape_descriptor_census.py
  • scripts/shape_descriptor_census_baseline.json

📝 Walkthrough

Walkthrough

The PR fixes several main-gate assertions. It updates build-cache environment handling, makes pointer-guard detection brace-aware, strengthens generic read PIC validation, and refreshes related baselines and changelog entries.

Changes

Main gate corrections

Layer / File(s) Summary
Build-cache environment classification
crates/perry/src/commands/compile/build_cache.rs, changelog.d/8685-fix-main-red-lint-cargo-test.md
Adds PERRY_CONST_ARRAY_DESCRIPTOR as a cache input and classifies PERRY_DIALECT_DUMP as diagnostic-only.
Address-class guard analysis
scripts/addr_class_inventory.py, scripts/addr_class_ratchet_baseline.txt
Adds brace-aware handling for nested, sibling, and else if predicates. Updates the inventory self-tests and ratchet baseline.
Shape-descriptor census validation
scripts/shape_descriptor_census.py, scripts/shape_descriptor_census_baseline.json
Requires a direct ShapeId-to-zero comparison, adds a sabotage test, and records two additional header-size callsites.

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

✨ 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 merge/b11

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.

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