Skip to content

cuda.bindings: backport CUDA 12 runtime maintenance fixes - #3182

Draft
rwgk wants to merge 3 commits into
rwgk/cb12-on-main-07-maintenance-policyfrom
rwgk/cb12-on-main-08-runtime-maintenance
Draft

rwgk wants to merge 3 commits into
rwgk/cb12-on-main-07-maintenance-policyfrom
rwgk/cb12-on-main-08-runtime-maintenance

Conversation

@rwgk

@rwgk rwgk commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

codex on behalf of Ralf:

Highlights

Apply three existing current-major helper fixes to the CUDA 12 runtime. Each fix has its own commit, keeping these three runtime changes separate from the packaging/CI migration and workflow security updates.

  • Accept byte-string compiler options alongside strings in the nested-resource helper.
  • Retain borrowed coredump setter buffers and free getter-owned storage.
  • Propagate exceptions raised inside registered handle getters instead of misreporting an unknown handle type.

Provenance and Review Scope

These are backports of fixes already implemented for the current bindings major. They are separate from, and not prerequisites for, making #3174–#3176 function together.

Fix Earlier upstream change Coverage retained here
Byte-string compiler options #1665, #1698 nvJitLink bytes-options test and NVVM parameterized case
Coredump buffer ownership #2399 Existing API tests; no new instrumented memory/lifetime regression test
Registered handle-getter errors #2551 Regression proving an internal KeyError propagates

An ordinary coredump round trip would also pass with the getter leak; the existing functional tests do not prove its absence. This is a validation gap for the memory-ownership fix.

Stack / Review Boundary

Previous: #3178. The stack overview lists all six open PRs and the intended workflow.

#3174 through #3176 are intended to land together, with separate review scopes and cumulative CI at #3176; the first two are incomplete intermediate states. Release routing (#3177), maintenance policy (#3178), and the runtime fixes (#3182) follow that group. The complete proposed source tree is at #3182.

Baseline: main 03b4153574b3.

Counterpart Review

Compared the CUDA 12 _internal/utils.pyx, _lib/utils.pxd/.pxi, utils/__init__.py, and their focused tests with the corresponding CUDA 13 implementations. These are handwritten helper adaptations of the existing current-major fixes; generated API differences are preserved. The process-global coredump test serialization is handled separately in #3176 for both roots.

The affected files remain cuda_bindings_12/cuda/bindings/_internal/utils.pyx, _lib/utils.pxd, _lib/utils.pxi, and utils/__init__.py, with tests/test_nvjitlink.py, test_nvvm.py, and test_utils.py; the corresponding CUDA 13 helper/test files supply the existing behavior being ported. The main/security refresh adds no fourth runtime fix.

Validation

Current local checks pass in full Git checkouts: 333 CI-tool tests at #3176, 346 at #3182, and 15 focused packaging tests. Full pre-commit run --all-files passes at both refreshed heads, including actionlint and Lychee. The tooling suite includes Git-based Pixi workspace discovery; it is not an archive-only suite. The local CUDA 13.4 TestVenv build and full QA run passed, covering Pathfinder, CUDA 13 bindings, PTDS, Cython interoperability, and Core. CUDA 12 native coverage is provided by the hosted matrix.

Current hosted CI for the complete stack: run, attempt 3, at 341d286d865b012976898347c6728fda1e6c6a98 - passed, 105/105 jobs. This covers the cumulative stack and its runtime backports, rather than hosted release publication or backport execution.

One existing Windows Python 3.14t/Core row needed two failed-job retries: first for an access violation in incremental linking, then for a different graph-lifetime failure. Both cases passed on the final attempt and also passed at #3176; the affected Core sources are unchanged from main. No tests were skipped, serialized, or weakened for these retries. The graph failure remains a separate Core investigation; the passing retry does not establish that the suspected registry race is fixed.

The focused runtime regressions listed above are selected by the CUDA 12 test coverage. Existing coredump API tests do not instrument allocations or prove the absence of a leak; that ownership-validation gap remains explicit. The three runtime changes stay isolated from the preceding CI and documentation revisions.

Checklist

  • Existing regression tests move with the corresponding runtime changes.
  • The description records provenance, scope, and validation limits.

@rwgk rwgk added this to the cuda.bindings next milestone Oct 21, 2026
@rwgk rwgk added bug Something isn't working cuda.bindings Everything related to the cuda.bindings module labels Oct 21, 2026
@rwgk rwgk self-assigned this Oct 21, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 21, 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 Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 7856417

@github-actions

Copy link
Copy Markdown
Contributor

@mdboom
mdboom force-pushed the rwgk/cb12-on-main-08-runtime-maintenance branch from 7856417 to b01e4ad Compare October 23, 2026 15:04
@rwgk
rwgk force-pushed the rwgk/cb12-on-main-08-runtime-maintenance branch 2 times, most recently from cc44420 to 4f6212a Compare October 26, 2026 00:20
@rwgk

rwgk commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 4f6212a

@rwgk
rwgk force-pushed the rwgk/cb12-on-main-08-runtime-maintenance branch from 4f6212a to dd7d842 Compare October 26, 2026 21:35
@rwgk

rwgk commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test dd7d842

@rwgk
rwgk force-pushed the rwgk/cb12-on-main-08-runtime-maintenance branch from dd7d842 to 775392e Compare October 27, 2026 00:23
@rwgk

rwgk commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 775392e

rwgk added 3 commits October 29, 2026 20:13
Carry forward the runtime behavior from #1665/#1698 with its nvJitLink regression and NVVM bytes-options case. Extracted from #3173 so source integration can be reviewed independently.

Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
Carry forward #2399: retain borrowed setter bytes and release getter-owned storage. Keep this runtime maintenance separate from the build integration.

Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
Carry forward #2551 and its regression test. A KeyError inside a registered getter must propagate instead of being reported as an unknown handle type.

Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
@rwgk
rwgk force-pushed the rwgk/cb12-on-main-08-runtime-maintenance branch from 775392e to 341d286 Compare October 30, 2026 03:20
@rwgk

rwgk commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 341d286

This branch has not been deployed

No deployments
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.

1 participant