Repository navigation
fix(codegen): align export and call names - #185
Merged
Merged
Conversation
Signed-off-by: nik <[email protected]>
nihalpasham
force-pushed
the
prepare-fqdn-export-name
branch
from
June 17, 2026 04:27
49ceca7 to
7a9f43c
Compare
Collaborator
|
Thanks for the PR. The names line up now: def side and call side both key off the resolved Instance through the same legaliser.
|
meefs
pushed a commit
to meefs/cuda-oxide
that referenced
this pull request
Sep 30, 2026
…t arch (NVIDIA#185) Follow-ups to NVIDIA#183 (issue NVIDIA#172): - Extract redist archives with --skip-old-files --warning=existing-file: cross-archive path collisions become first-wins and visible in the build log instead of silently taking whichever archive extracted last. Reorder libnvvm ahead of cuda_nvcc so canonical nvvm/ files win under first-wins, and document that the list order now matters. - Assert bin/tileiras and nvvm/lib64/libnvvm.so exist after assembly so the exe-relative-lookup failure mode from NVIDIA#172 cannot silently regress on a future version bump. - Derive the Debian multiarch driver directory from uname -m instead of enumerating per-arch triplets: shorter, searches the host arch first, and covers future architectures without edits. - Point the hash bookkeeping at NVIDIA's redistrib_13.3.0.json manifest for future version bumps. Signed-off-by: Melih Elibol <[email protected]>
meefs
pushed a commit
to meefs/cuda-oxide
that referenced
this pull request
Sep 30, 2026
…NVIDIA#225, NVIDIA#185) (NVIDIA#256) Three squash merges landed from branches that had resolved a merge against main by keeping pre-merge copies of files, so each one quietly reverted an earlier, unrelated merge: - NVIDIA#239 (2482cb9) reverted NVIDIA#240 (1216aef): the const raw-pointer surface (as_ptr, program_id/num_programs, the cast_* and get_tensor_base helpers, unsafe on load_ptr_tko/store_ptr_tko), the compiler's const-pointer typing, the two GPU test files and the matching book and tutorial text. - NVIDIA#247 (5f5f4c5) reverted NVIDIA#225 (a2843e7): integer division and remainder serialization (rounding<zero> and inferred signedness on divi/remi) and its test. - NVIDIA#187 (35a9cc2) reverted NVIDIA#185 (cbf52c0): the flake.nix toolkit-assembly hardening and host-arch driver directory derivation. This re-applies all three verbatim as cherry-picks. The only overlapping file, cutile-book/guide/performance.md, merges cleanly with NVIDIA#239's own edits. A per-file scan of the last 60 merges finds no other reversal still missing at HEAD: NVIDIA#249's removal of the About page was deliberate, and the two setup-python flips in .github/workflows/pages.yml were re-applied by the later dependabot bump. Verified: cargo fmt, cargo build, and the restored GPU tests (const_pointers, program_id) plus integer_ops, memory_and_atomic_ops and optimization_hints pass on an RTX 5090 with CUDA 13.3. Signed-off-by: Melih Elibol <[email protected]> Co-authored-by: Gabriel Wu <[email protected]>
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 #184.
Problem
Definition-side export names and call-side names could diverge because they used different facts to decide between a raw FQDN and rustc's mangled symbol name. The collector sees a resolved rustc
Instance, while MIR call lowering classified generic calls from rawFnDefsubstitutions and used the rawFnDefFQDN for non-generic calls. Concrete trait impl calls can carry operand substitutions even when they resolve to a monomorphic instance, and their trait item FQDN can differ from the resolved impl FQDN. The collector also treated invalid FQDN characters as a reason to mangle, while call lowering sends non-generic FQDNs through pliron's legalizer.Fix
Use resolved rustc instance data as the single rule:
Instance::name()FQDN and let the shared pliron legalizer produce the final identifier;Diligence
Checked both duplicate naming paths:
rustc-codegen-cuda::DeviceCollector::compute_export_namenow documents that invalid FQDN characters are not a mangle trigger and that resolvedInstance::argsis the authority.mir-importer::translator::terminator::extract_func_infonow resolves the stable MIRFnDefbefore choosing FQDN vsInstance::mangled_name, and usesInstance::name()for non-generic call symbols so concrete trait impl calls target the impl definition rather than the trait item.body.rs::translate_bodyalready legalizes definition export names with the sameLegaliserinstance used by call lowering, so raw FQDNs match after legalization.Tests
Added
crates/rustc-codegen-cuda/examples/export_name_policy, a focused regression example covering:<Vec2 as DeviceMeasure>::trait_impl_value;Wrapper<Vec2>::inherent_concrete_value.Validation
Targeted validation:
scripts/smoketest.sh --compile-only --no-color --only '^export_name_policy$'