Skip to content

Refresh CUDA 13.4 bindings (cybind !561, !574, !580) - #2953

Merged
rwgk merged 5 commits into
mainfrom
rwgk/maint/post_mr574_public_refresh
Sep 30, 2026
Merged

rwgk merged 5 commits into
mainfrom
rwgk/maint/post_mr574_public_refresh

Conversation

@rwgk

@rwgk rwgk commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Description

Regenerate the CUDA 13.4 bindings using cybind MR !580.

Supersedes #2950.

All changed files are generated; none was edited by hand.

This refresh brings in three behavior changes:

  • Embedded driver and runtime struct/union wrappers now retain their parent while pointing into its C storage. This fixes dangling child pointers when a caller keeps a child after dropping its parent. — cybind !574 88a61d6d, 3ac802c4
  • Twenty-two driver/runtime pointer-array getters now return copies of the top-level structs instead of wrappers pointing into the parent's array. Saved elements therefore survive a parent-array resize or release. This changes write-through behavior: modifying a returned element no longer changes the parent array; callers must assign the modified array back. Pointers inside a copied struct are still shallow copies. — cybind !574 88a61d6d, 3ac802c4
  • nvml.NvlinkFirmwareInfo.firmware_version now exposes only numValidEntries elements rather than all 100 slots. Its setter accepts up to 100 elements and sets the count automatically. The generated num_valid_entries Python property (including its setter) is removed. — cybind !561 a7b0b86a

Compatibility review

The first fix adds _owner fields to 241 public Cython cdef class declarations; regeneration also adds two fields to CUmemDecompressParams_st. These declarations change extension-type layouts. The cuda.bindings support policy exposes the Cython cimport layer and warns that a new minor release may require downstream rebuilds. The repository's ABI checker treats changed class sizes and fields as errors. If these bindings are released as a 13.4.x patch, please assess whether prebuilt Cython consumers can continue using them or whether this fix needs an ABI-preserving approach or a minor release.

The pointer-array getters' change from live views to copies and removal of NvlinkFirmwareInfo.num_valid_entries also need Python API compatibility review for a patch release. The latter is an additional effect of regeneration, not part of the two driver/runtime lifetime fixes.

@rwgk rwgk added this to the cuda.bindings next milestone Sep 26, 2026
@rwgk rwgk added the cuda.bindings Everything related to the cuda.bindings module label Sep 26, 2026
@rwgk rwgk self-assigned this Sep 26, 2026
@copy-pr-bot

copy-pr-bot Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@rwgk

rwgk commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 20f1320

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor
Doc Preview CI
Preview removed because the pull request was closed or merged.

@rwgk

rwgk commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 6f04788

@rwgk
rwgk marked this pull request as ready for review September 26, 2026 21:55
@rwgk rwgk added the bug Something isn't working label Sep 26, 2026 — with ChatGPT Codex Connector
…CHANGES) after adding commit 797a08ab9d2262fb11ba7d7207e1a66495f818fc to cybind !580
@rwgk rwgk changed the title Refresh CUDA 13.4 bindings with corrected cybind templates Refresh CUDA 13.4 bindings (cybind !561, !574, !580) Sep 27, 2026
@rwgk
rwgk requested a review from mdboom September 30, 2026 15:04
@mdboom

mdboom commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

All of the ABI breakage in this PR is at the lowpp layer, for which we make no ABI guarantees. The ABI breakage is real, but it's in service of fixing a real use-after-free pitfall that should be fixed. The policy the agent is referring to is:

The module exposes a Cython layer from which types and functions could be cimport'd. While we strive to keep this layer stable, due to Cython limitations a new minor release of this module could require Cython layer users to rebuild their projects and update their pinning to this module.

I can see how it's confused by Cython layer here -- it doesn't mean all Cython code, it specifically means cydriver.pxd etc., vs. driver.pxd.

As for this, this is an API change, but required for a bugfix:

The pointer-array getters' change from live views to copies and removal of NvlinkFirmwareInfo.num_valid_entries also need Python API compatibility review for a patch release. The latter is an additional effect of regeneration, not part of the two driver/runtime lifetime fixes.

We should add a breaking change note for this (I'll push another commit here).

@rwgk
rwgk enabled auto-merge (squash) September 30, 2026 19:37
@rwgk
rwgk merged commit 254fa4a into main Sep 30, 2026
215 of 225 checks passed
@rwgk
rwgk deleted the rwgk/maint/post_mr574_public_refresh branch September 30, 2026 21:49
github-actions Bot pushed a commit that referenced this pull request Oct 1, 2026
Removed preview folders for the following PRs:
- PR #2939
- PR #2953
- PR #2962
- PR #2966
- PR #2968
- PR #2969
- PR #2972
- PR #2974
- PR #2976
- PR #2977
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cuda.bindings Everything related to the cuda.bindings module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants