Repository navigation
fix(mir-lower): support bounded packed AS3 arrays - #1073
Merged
Merged
Conversation
Signed-off-by: Raul Estrada <[email protected]>
The MIR-shape predicate replaced a post-conversion field scan that skipped zero-sized fields before classifying. Restore that parity on the MIR side so a zero-sized non-struct field (e.g. [u8; 0]) does not knock a previously-admitted packed struct out of the ABI lane.
Signed-off-by: Raul Estrada <[email protected]>
This was referenced Aug 20, 2026
nihalpasham
force-pushed
the
fix/packed-as3-array-internal-abi
branch
from
August 20, 2026 11:56
15d33f0 to
5e1605a
Compare
Collaborator
|
nihalpasham
approved these changes
Aug 20, 2026
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.
Closes #1072
Depends on #1064
This PR is stacked on #1064. Until #1064 merges, GitHub's diff against
mainalso includes the recursive/multi-leaf packed-AS3 changes from that PR.The incremental change in this PR is the bounded fixed-array support.
Summary
Extend the recursive packed-AS3 internal device ABI support with bounded fixed arrays of shared-memory pointer leaves.
Packed structs can now be returned from internal device functions when their supported recursive shape contains fixed AS3 pointer arrays whose total array-expanded shared-pointer leaf count does not exceed 16.
The function body continues to operate on the semantic packed aggregate containing AS3 pointers. Internal device arguments retain the existing flattened argument ABI. At the return boundary, the existing target-stable storage machinery recursively rebuilds admitted arrays and replaces their AS3 leaves with generic pointers.
Implementation
This change widens
packed_shared_internal_abi_infowithout duplicating the existing recursive storage or value-coercion machinery.The classifier now:
target_stable_storage_typeremains responsible for the recursive AS3 -> generic storage rewrite and already reconstructs arrays element by element at the physical value boundary.The packed aggregate construction path continues to keep semantic AS3 pointers in SSA. No address-space conversion is introduced during semantic aggregate construction.
Tests
Added coverage for:
Validation performed:
cargo fmt --all -- --checkgit diff --checkcargo test -p mir-lower packed_shared_internal_abi -- --nocapturecargo test -p mir-lower packed_struct_construction_with -- --nocapturecargo test -p mir-lower --all-targetscargo clippy -p mir-lower --all-targets -- -D warningscargo oxide build packed_aggregate_abicargo oxide run packed_aggregate_abicargo oxide run addressof_sharedarrayThe packed-AS3 classifier coverage passes with 8 tests, including the explicit vector rejection and both sides of the array rewrite bound.
The
mir-lowersuite passes 260 unit tests and 117 lowering tests.The end-to-end
packed_aggregate_abiregression passes onsm_120a, including the bounded-array packed shared internal ABI path.Out of scope
This PR intentionally does not add support for:
Those remain separate work.