Repository navigation
Conversation
Signed-off-by: Raul Estrada <raulestradaa@gmail.com>
uurl
force-pushed
the
fix/as7-tuple-normalization
branch
from
October 8, 2026 08:55
ff2b278 to
95133c9
Compare
This branch has not been deployed
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.
Summary
Fix MIR tuple construction when a pointer operand uses a CUDA address space that differs from the address space expected by the tuple's declared element type.
Previously, constructing a tuple containing a cluster-shared (AS7) pointer could fail MIR verification because the tuple expected a generic (AS0) pointer.
Fixes #1453.
Root Cause
The MIR importer already normalizes pointer representations when constructing structs, enums, and arrays. However,
AggregateKind::Tuplewas missing the corresponding normalization step.As a result,
MirConstructTupleOpcould receive operands whose address spaces did not match the declared tuple element types.The failure was reproduced with:
Changes
MirConstructTupleOp.cast_to_expected_pointer_type_if_neededhelper.MirPointerKind::RawConst.clusterexample with a tuple containing a cluster-shared pointer passed through a device function.verify-code-shape.shto verify the tuple round-trip call in LLVM IR.The implementation follows the existing pointer normalization approach used for other MIR aggregates.
Regression Coverage
The reproduction uses
cluster::map_shared_rankto obtain an AS7 pointer and constructs a tuple containing that pointer:Before the fix, this triggers a MIR verification failure.
After the fix, the importer inserts the required pointer cast before tuple construction, and compilation succeeds.
The regression verifies the device-function call in LLVM IR. Later PTX optimization may eliminate the call, so the test does not require it to remain in the final PTX.
Validation
All checks passed:
cargo test -p mir-importer: 1164 passed, 0 failed.cargo clippy -p mir-importer --all-targets -- -D warnings: PASS.cargo fmt --all -- --check: PASS.git diff --check: PASS.clustercompile-only smoketest (sm_90): PASS.cluster/verify-code-shape.sh: PASS.cargo oxide run cluster: PASS on an NVIDIA GeForce RTX 5060 Laptop GPU.CUDA_OXIDE_NO_OPT=1 cargo oxide run cluster: PASS.The DSMEM ring exchange test produced the expected values for all four cluster blocks.
The final compile-only smoketest also passed after removing the experimental instrumentation used during the investigation.
Scope
This PR addresses tuple operand normalization in the MIR importer.
It does not modify
mir-loweror the aggregate-memory cast fallback investigated in #883.