test(codegen): unbreak typed_shape_descriptors after #4957 bulk-fill lowering - #4984
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cargo-testis red onmain:bounded_integer_array_store_omits_layout_note_and_barrier(crates/perry-codegen/tests/typed_shape_descriptors.rs) has failed since #4957 (90bc7bc68, bisect-confirmed — parent8b6c9212dpasses). 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] = iover anumber[]— is exactly the shape #4957's newmatch_numeric_bulk_fill_looprecognizes. The loop now lowers to the bulkjs_array_fill_f64_iota_len_extendhelper, so the per-elementjs_array_numeric_set_f64_unboxed+js_typed_feedback_numeric_array_index_set_guardcalls the test asserts on are never emitted. The new lowering looks intentional and correct; the test just wasn't updated with it.Fix
i + 1instead ofi: 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).numeric_iota_fill_loop_uses_bulk_helper_without_barrierpinning the new Optimize numeric array raw payload helpers #4957 lowering: the iota shape emitsjs_array_fill_f64_iota_len_extend, no per-element raw-f64 stores, and — like the per-element path — nojs_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)cargo test -p perry-codegen: all 13 test binaries greenTest-only change; no version bump / changelog per the maintainer-folds-at-merge convention.
cc @TheHypnoo (#4957)