Repository navigation
fix(cuda-bindings): preserve complete struct layouts with libclang 22 - #1684
Merged
Merged
Conversation
Signed-off-by: Melih Elibol <[email protected]>
elibol
requested review from
binarybana,
cryos,
kkraus14,
nihalpasham,
roivanov and
rparolin
as code owners
October 30, 2026 23:31
20 tasks
Signed-off-by: Melih Elibol <[email protected]>
Signed-off-by: Melih Elibol <[email protected]>
Signed-off-by: Melih Elibol <[email protected]>
Collaborator
Author
|
Merging now that CI is green; changes under |
6 tasks
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.
Older bindgen can emit a one-byte placeholder instead of the fields of a forward-declared C struct when using libclang 22. This produces incorrect CUDA bindings and failing layout checks. Upgrade
cuda-bindingsto bindgen 0.72.1, which includes the upstream type-completeness fix in rust-lang/rust-bindgen#3278.The regression test uses a self-contained C typedef chain and verifies that both fields of the completed struct survive binding generation. With bindgen 0.69.5 and libclang 22 it fails because only
_addressis emitted; with 0.72.1 it passes. It runs as part of the existingcuda-bindingstest suite. Use libclang 22 to exercise the original failure.The large diff is generated lockfile maintenance: 263 affected workspace/example lockfiles now resolve the updated shared bindings dependency. Package additions are limited to the new bindgen and its required rustc-hash version; obsolete transitive dependencies disappear. Archived benchmarks that use separately published crates are unchanged.
Validation:
cuda-bindingstests pass, including a CUDA 13.3/libclang 21 compatibility run. Bindgen now emits compile-time layout assertions, so validation includes compiling the generated bindings rather than filtering for old runtime layout-test names.--offline --locked; the example lockfile consistency gate also passes after aligning six existing rustc-hash pins with the other examples; dependency policy checks pass for the host, Tile, SIMT, backend, and device-only workspaces.Target: cuTile Rust v0.5.0.