Repository navigation
fix(mir-lower): support recursive packed AS3 carrier local projections - #1330
Conversation
Signed-off-by: Raul Estrada <[email protected]>
f210339 to
818c88d
Compare
|
The nested and array cases this adds read and write with the wrong alignment, and the kernel faults:
To land this: stamp every carrier projection with the alignment it really has (gcd of the root alignment and the byte offset, 8-byte carrier stride for array elements); unit tests asserting |
nihalpasham
left a comment
There was a problem hiding this comment.
Reviewed 818c88dc: changes requested. The landing list is in #1330 (comment).
…d-as3-local-projections
Signed-off-by: Raul Estrada <[email protected]>
|
Addressed the requested changes in 3ea241f after merging main.
The branch is ready for CI vetting and re-review. |
Signed-off-by: nihalpasham <[email protected]> # Conflicts: # cuda-oxide/crates/mir-lower/src/convert/types/mod.rs
…en packed_aggregate_abi - Delegate packed_shared_local_storage_info to packed_shared_internal_abi_info and pair its storage type with the root MIR aggregate's rustc ABI alignment. - Mutate value.ptrs[row][col] directly across a branch in consume_packed_shared_matrix and mutate nested struct/tuple fields across a branch in consume_packed_nested_shared and consume_packed_tuple_shared so carrier-local field and array stores execute at runtime without single-block store forwarding. - Add /// doc comments and tighten helper visibility across packed_shared_local_storage, addressing, packed_shared_shape, and func_abi. Signed-off-by: nihalpasham <[email protected]>
|
Thanks for addressing the alignment propagation and test items from the earlier review. Reconciled with
At |
|
/ok to test e9a2993 |
Fixes #1094
Summary
Extend the packed-AS3 carrier-local contract introduced by #1327 to support:
The implementation preserves #1327's closed-world model: the complete MIR address-use graph is validated before dialect conversion, and lowering-private physical type facts are attached only after the whole graph succeeds.
Carrier identity is never reconstructed from LLVM defining operations,
OperandsInfo, or converted GEP history.Representation and projection contract
Semantic values retain AS3 pointers while compiler-owned local storage uses the target-stable generic-pointer carrier:
Conversions remain explicit at load/store boundaries.
The verified address graph now admits:
Each projection derives its physical pointee from the already-proven parent carrier type.
mir.field_addrsupports recursive struct/tuple projections, andmir.array_element_addruses the verified physical carrier element type. Ordinary non-carrier addressing is unchanged.Bounds and fail-closed behavior
The existing 16-leaf array rewrite budget is reused. Local-storage shape admission remains independently classified, so future internal-ABI shape widening cannot implicitly widen carrier-local support.
Carrier addresses still fail closed across:
AS3 pointer vectors and arbitrary packed-AS3 memory remain unsupported.
Tests
Added focused coverage for:
packed_aggregate_abinow exercises multiple direct leaves, nested structs, nested tuples, and bounded AS3 pointer arrays through carrier-local projections.Validation
Results:
Both optimized and
CUDA_OXIDE_NO_OPT=1packed_aggregate_abiexecutions pass.addressof_sharedarrayalso continues to pass.Out of scope
This PR does not add carrier-address transport through calls, block arguments, casts, returns, or arbitrary pointer arithmetic, nor support for AS3 pointer vectors, arbitrary/device-global/kernel-entry packed-AS3 carrier storage, or AS3-containing enum locals.