Skip to content

test(codegen): unbreak typed_shape_descriptors after #4957 bulk-fill lowering - #4984

Merged
proggeramlug merged 1 commit into
mainfrom
fix-typed-shape-test-4957
Jun 11, 2026
Merged

test(codegen): unbreak typed_shape_descriptors after #4957 bulk-fill lowering#4984
proggeramlug merged 1 commit into
mainfrom
fix-typed-shape-test-4957

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

cargo-test is red on main: bounded_integer_array_store_omits_layout_note_and_barrier (crates/perry-codegen/tests/typed_shape_descriptors.rs) has failed since #4957 (90bc7bc68, bisect-confirmed — parent 8b6c9212d passes). It made #4981's required check fail and will do the same to every open PR until fixed.

Why it broke

The test's loop — for (let i = 0; i < arr.length; i++) arr[i] = i over a number[] — is exactly the shape #4957's new match_numeric_bulk_fill_loop recognizes. The loop now lowers to the bulk js_array_fill_f64_iota_len_extend helper, so the per-element js_array_numeric_set_f64_unboxed + js_typed_feedback_numeric_array_index_set_guard calls the test asserts on are never emitted. The new lowering looks intentional and correct; the test just wasn't updated with it.

Fix

  • Store i + 1 instead of i: still integer-classified, but neither iota nor constant, so the bulk matcher doesn't fire and the test keeps exercising the per-element guarded store path it was written to pin (all five original assertions unchanged and passing).
  • Add a companion test numeric_iota_fill_loop_uses_bulk_helper_without_barrier pinning the new Optimize numeric array raw payload helpers #4957 lowering: the iota shape emits js_array_fill_f64_iota_len_extend, no per-element raw-f64 stores, and — like the per-element path — no js_gc_note_slot_layout / js_write_barrier_slot.

Verification

  • cargo test -p perry-codegen --test typed_shape_descriptors: 16/16 pass (was 14 pass / 1 fail)
  • Full cargo test -p perry-codegen: all 13 test binaries green

Test-only change; no version bump / changelog per the maintainer-folds-at-merge convention.

cc @TheHypnoo (#4957)

…lowering

bounded_integer_array_store_omits_layout_note_and_barrier has failed on
main since #4957 (90bc7bc, bisect-confirmed): its `for (i=0; i<arr.length;
i++) arr[i] = i` body is exactly the shape the new
match_numeric_bulk_fill_loop matcher recognizes, so the loop now lowers
to `js_array_fill_f64_iota_len_extend` and the per-element
`js_array_numeric_set_f64_unboxed` the test asserts on is never emitted.
Every PR's required cargo-test check is red until this lands.

Store `i + 1` instead — integer-classified but neither iota nor constant,
so the bulk matcher doesn't fire and the test keeps exercising the
per-element guarded store path it was written for. Add a companion test
pinning the new bulk lowering itself: iota fill over `arr.length` emits
the bulk helper, no per-element stores, and (like the per-element path)
no slot-layout note or write barrier.
@proggeramlug
proggeramlug merged commit 48d6f8d into main Jun 11, 2026
13 checks passed
@proggeramlug
proggeramlug deleted the fix-typed-shape-test-4957 branch June 11, 2026 09:04
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