Skip to content

fix(gates): shape-descriptor census follows the bag-first read and ignores census-only lets - #14758

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

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

Conversation

@raliclo

@raliclo raliclo commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

shape_descriptor_census.py (lint step "Object-header shape-descriptor census") fails on main for two reasons. Both are pinned authority edges that no longer match code that kept the same invariant under a new spelling:

  1. 4d4391a (Keyed property access and bag-first own reads at unproven sites (K, KP) #14679) routes probe_get_at's nonordinary receiver (no ordinary layout record) to bag_first_get instead of straight to array_named_get. The census pinned the old call, so it reports shape descriptor authority surface missing: nonordinary read routes to the checked array path. The new path still never reads the receiver through a record it does not have. bag_own answers only from the bag's own layout record (array named / closure props), and declines when there is none or it is not probe-ready. Every decline goes on to array_named_get or array_named_get_past_bag. The census now pins those three edges instead of the one.
  2. 00fb540 (runtime: build-time init snapshot census (instr-only): Supabase check differ=0, D 1,643 (93.9%), production bytes = main #13935) added a #[cfg(perry_gc_instruments)] census key-naming let to perry_probe_get and perry_probe_get_binding. The census requires those bodies to be exactly probe_get::<…>(dir, obj_biased, key_bits, hash), so it reports perry_probe_get bypasses the receiver-layout authority. This error was hidden behind (1) on current main, and ci: fix main's mechanical and stale reds (fmt, clippy, tokio-ban, tls-budget, Windows dladdr, stale ledgers); list the GC-audit reds for their authors #14604 listed it. The census now drops a brace-free let under that cfg before the full match. Such a let does not exist in production builds. An instrument-only statement that could return or branch still fails.

Seen in main's CI run 43639432681. Part of the lint cleanup tracked alongside #14595.

Changes

  • scripts/shape_descriptor_census.py:
    • DISPATCH_CHECKS: probe_get_at pins bag_first_get, plus new bag_own (resolves the bag's own record, declines on null) and bag_first_get (both declines route to the checked array path) entries. The existing sabotage self-check covers each new entry automatically: it deletes each pattern and expects a rejection.
    • without_instrument_lets() is applied to the two perry_probe_get* bodies before the full match.

Related issue

Refs #14595, #14604. Main CI run 43639432681.

Test plan

# upstream/main 64257c3159
$ python3 scripts/shape_descriptor_census.py
::error::shape_descriptor_census: shape descriptor authority surface missing: nonordinary read routes to the checked array path      # exit 1
# introducing commits (gate run at the commit and at its parent):
#   2f3a3ddb8d: no "nonordinary read" error / 4d4391a1b0: reported
#   f187438c19: exit 0 / 00fb540ce7: "perry_probe_get bypasses the receiver-layout authority"

# this branch (includes the census's built-in sabotage self-checks)
$ python3 scripts/shape_descriptor_census.py      # exit 0

# negative controls (each edit to layout_probe.rs, then reverted):
#  a production statement in perry_probe_get ("if key_bits == 0 { return 0.0; }")
::error::shape_descriptor_census: perry_probe_get bypasses the receiver-layout authority
#  an instrument-only let with a block ("#[cfg(perry_gc_instruments)] let _x = { return 0.0 };")
::error::shape_descriptor_census: perry_probe_get bypasses the receiver-layout authority
#  bag_first_get's Err(false) arm answers hole() instead of array_named_get
::error::shape_descriptor_census: shape descriptor authority surface missing: a bag decline routes to the checked array path
#  bag_own resolves the receiver's record instead of the bag's
::error::shape_descriptor_census: shape descriptor authority surface missing: bag-first read resolves the bag's own layout record

Proposed; please confirm. (1) records my reading that the bag-first arm keeps the authority. The bag is an ordinary object read through its own descriptor record. (2) treats census-only lets as outside the production body.

  • BASE_SHA=upstream/main scripts/run_lint_gates.sh (macOS arm64): 21 FAIL lines on the branch vs 22 on main 64257c3; the only difference is the gate this PR fixes ([Object-header shape-descriptor census] python3 scripts/shape_descriptor_census.py); no new FAIL.

Scripts only; no crate changes, so no changelog fragment.

Checklist

  • I have NOT bumped the workspace version or edited CHANGELOG.md
  • My commits follow the loose feat: / fix: / docs: / chore: prefix convention
  • 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

  • Tests
    • Expanded validation of specialized reads, including layout resolution and fallback behavior when a read is declined.
    • Improved checks for probe delegation while preserving coverage of instrument-only control flow.

@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 1 minute.

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: a3051dbc-a273-4f60-bf77-db076908f72a
Commits

Reviewing files that changed from the base of the PR and between 7c5b544 and 4d9ef17.

Files selected for processing: 1

  • scripts/shape_descriptor_census.py

No actionable comments were generated in the recent review.

Walkthrough

The shape descriptor census updates its checks for nonordinary read dispatch. It also removes eligible instrument-only let statements before checking probe delegation.

Changes: Census checks

Layer / File(s) Summary
Nonordinary read dispatch
scripts/shape_descriptor_census.py
Checks now require the bag-first exotic path, lookup of the bag’s own layout record, and checked array access when a bag read declines.
Probe delegation matching
scripts/shape_descriptor_census.py
The probe-delegation check removes brace-free #[cfg(perry_gc_instruments)] let statements before matching the function body. Other instrument-only control flow remains subject to the full match.

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

Change: Bug fix

Merge Risk: Minimal · previous review 7c5b5

This updates an internal census check to match recent code changes and does not affect production behavior. No merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the shape-descriptor census script now follows the bag-first read path and ignores census-only instrument lets. It matches the raw summary and objectives. The title is…
Description check Passed The description follows the template's main sections: Summary, Changes, Related issue, and Test plan, with a checklist. It explains both failing census edges, the new DISPATCH_CHECKS entries, and the …
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: the shape-descriptor census script now follows the bag-first read path and ignores census-only instrument lets. It matches the raw summary and objectives. The title is 91 characters, which is longer than ideal, but it stays specific and readable.

Full details: Description check

Explanation

The description follows the template's main sections: Summary, Changes, Related issue, and Test plan, with a checklist. It explains both failing census edges, the new DISPATCH_CHECKS entries, and the without_instrument_lets helper. It gives reproducible command output and negative controls. The template's comment-only Screenshots section is omitted, which is optional. The Test plan checkboxes for cargo build and cargo test are not ticked, and the author does not explain why those steps were skipped, since the PR touches only scripts. The description also contains a 'Proposed; please confirm' note that asks reviewers to check two interpretive points.

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: e0e25b4f-6bd0-453e-a204-eb1a6e6f19ee
Commits

Reviewing files that changed from the base of the PR and between c71b7fd and 7c5b544.

Files selected for processing: 1

  • scripts/shape_descriptor_census.py

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

2fae3aa on main repointed probe_get_at's pin at bag_first_get and admitted the instruments-only census lets in perry_probe_get*. The two edges behind that route are still unpinned: bag_own answers only from the bag's own layout record, and every bag decline goes on to array_named_get / array_named_get_past_bag. Pin both; the census sabotage check deletes each pattern and expects a rejection.
@TheHypnoo
TheHypnoo force-pushed the fix/lint-shapecensus branch from 7c5b544 to 4d9ef17 Compare November 16, 2026 14:18
@TheHypnoo
TheHypnoo merged commit 77247b8 into PerryTS:main Nov 16, 2026
158 of 198 checks passed
@raliclo
raliclo deleted the fix/lint-shapecensus 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