Repository navigation
Description
Problem
The packed-AS3 internal device ABI can recursively handle direct shared-memory pointer leaves and leaves nested through structs and tuples.
Fixed arrays remain excluded, even though the target-stable storage machinery already supports recursively rebuilding arrays and replacing AS3 pointer leaves with generic pointers at the physical return boundary.
Allowing arbitrary arrays without a bound would be undesirable: a compact source type such as [&shared T; N] expands into one extract/cast/insert sequence per shared-pointer element when the return carrier is rebuilt.
Proposed scope
Extend the packed-AS3 internal ABI admission logic to support fixed arrays containing AS3 pointer leaves, subject to an explicit array-expansion budget.
The semantic value inside the function should continue to use the original packed aggregate with AS3 pointers.
Internal device arguments should retain the existing flattened argument ABI. At the return boundary, the target-stable storage machinery should recursively rebuild admitted arrays and replace their AS3 pointer leaves with generic pointers.
Use a maximum of 16 array-expanded AS3 pointer leaves per packed return carrier.
Direct AS3 leaves and struct/tuple nesting remain outside this array-specific budget because their code shape is proportional to the source structure.
Out of scope
Keep the following fail-closed:
- fixed arrays requiring more than 16 array-expanded AS3 pointer conversions;
- vectors containing AS3 pointer leaves;
- kernel-entry ABI changes;
- whole-value packed AS3 loads/stores;
- packed-AS3 field projections that require local materialization;
- enums and other unrelated aggregate kinds.
Acceptance criteria
- A packed struct containing a fixed array of AS3 pointer leaves can be returned by value from an internal device function when the array-expanded AS3 leaf count is within the supported bound.
- Arrays nested through otherwise supported struct/tuple shapes are handled recursively.
- A return carrier requiring exactly 16 array-expanded AS3 pointer conversions is accepted.
- A return carrier requiring more than 16 array-expanded AS3 pointer conversions is rejected.
- AS3 pointer vectors remain rejected.
- The physical return carrier contains generic-pointer replacements for every admitted AS3 array element.
- The semantic SSA aggregate continues to contain AS3 pointers.
- Internal device argument flattening remains unchanged.
- Existing recursive/multi-leaf packed-AS3 regressions continue to pass.
Activity