Skip to content

fix(codegen): update the disposed-Uint8Array proof to the helper #6092 emits#6839

Open
TheHypnoo wants to merge 2 commits into
mainfrom
fix/native-proof-uint8array-fallback-symbol
Open

fix(codegen): update the disposed-Uint8Array proof to the helper #6092 emits#6839
TheHypnoo wants to merge 2 commits into
mainfrom
fix/native-proof-uint8array-fallback-symbol

Conversation

@TheHypnoo

Copy link
Copy Markdown
Member

What

native_owned_uint8array_get_fallback_uses_uint8array_helper in crates/perry-codegen/tests/native_proof_buffer_views.rs has been failing on main since #6092. It asserted the emitted IR contains call i32 @js_uint8array_get; codegen emits call double @js_uint8array_index_get_value.

Why the emit changed

#6092 (fixing #6088) moved the unproven-bounds JS-value read off the i32 accessor deliberately. js_uint8array_get answers an out-of-range read with the 0 byte-sentinel; a JS-value buf[i] must read undefined, per IntegerIndexedExotic [[Get]]. The comment at crates/perry-codegen/src/expr/index_get.rs:1494 spells this out. The proof was not updated with it.

The property under test is unchanged: a disposed native Uint8Array view must fall back through the Uint8Array-shaped accessor, never the Buffer-shaped one. The second assertion — no js_buffer_get — passes untouched.

Second change

The sibling inline-path test forbade only js_uint8array_get. After #6092 that is no longer the symbol a slow-path regression would emit, so the assertion had gone blind. It now forbids both helpers.

Why it sat red

Integration suites under crates/*/tests/ don't run per-PR (#5960). This one surfaces only when a PR touches perry-codegen and pulls the suite into e2e-scoped — which is how #6837 found it.

Also included

crates/perry-hir/src/lower/builder_fold.rs is the one file failing cargo fmt --check on main. Reformatted, so this PR's lint job can pass on its own.

Verification

cargo test -p perry-codegen — 30/30 in native_proof_buffer_views, and every other suite in the crate green except typed_feedback::typed_feedback_trace_dump_runs_before_entry_return, which is a separate pre-existing failure on main (assertion failed: dump_pos < ret_pos) and is not touched here.

…emits

`native_owned_uint8array_get_fallback_uses_uint8array_helper` has been red on
main since #6092. That PR moved the unproven-bounds JS-value read off the i32
`js_uint8array_get` accessor — whose out-of-range answer is the `0`
byte-sentinel — onto `js_uint8array_index_get_value`, which reads `undefined`
per IntegerIndexedExotic `[[Get]]` (#6088). The proof still asserted the old
symbol.

Nothing about the property under test changes: the disposed native view must
fall back through the Uint8Array-shaped accessor, never the Buffer-shaped one.
The second assertion, that no `js_buffer_get` appears, still passes untouched.

The sibling inline-path test only forbade `js_uint8array_get`, so after #6092 a
regression that took the slow path would have gone unnoticed. It now forbids
both helpers.

Integration suites under `crates/*/tests/` don't run per-PR (#5960), which is
why this sat red for weeks — it surfaces only when a PR touches perry-codegen
and pulls the suite into `e2e-scoped`.

Also reformats crates/perry-hir/src/lower/builder_fold.rs, the one file failing
`cargo fmt --check` on main, so this PR's lint job can pass on its own.
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@TheHypnoo, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 29 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e403a425-575e-4791-8f2a-3390efd9af03

📥 Commits

Reviewing files that changed from the base of the PR and between 8b2c736 and 4826aaf.

📒 Files selected for processing (3)
  • changelog.d/6839-native-proof-uint8array-symbol.md
  • crates/perry-codegen/tests/native_proof_buffer_views.rs
  • crates/perry-hir/src/lower/builder_fold.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/native-proof-uint8array-fallback-symbol

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

bug Confirmed defect or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant