Skip to content

cuda_core: derive error enum explanations from bindings docstrings#1860

Draft
rwgk wants to merge 1 commit intoNVIDIA:mainfrom
rwgk:enum_explanations_from_docstrings
Draft

cuda_core: derive error enum explanations from bindings docstrings#1860
rwgk wants to merge 1 commit intoNVIDIA:mainfrom
rwgk:enum_explanations_from_docstrings

Conversation

@rwgk
Copy link
Copy Markdown
Collaborator

@rwgk rwgk commented Apr 5, 2026

Closes #1712

This PR grows out of the validation work under #1805. That work showed that, starting with cuda-bindings 13.2.0, driver/runtime error enums expose __doc__ text that is a practical replacement for the hand-maintained explanation dicts once a small amount of normalization is applied.

Summary

  • use cleaned enum __doc__ strings for driver/runtime error explanations in cuda_core when cuda-bindings >= 13.2.0
  • keep the CTK 13.1.1 explanation tables frozen as fallback for older bindings
  • centralize the version gate + cleanup logic in enum_explanations_helpers.py
  • update cuda_utils coverage to verify representative enums expose __doc__ and that explanation text is attached to raised CUDAErrors
  • remove the obsolete toolshed/reformat_cuda_enums_as_py.py

Use cleaned driver/runtime enum __doc__ text from cuda-bindings 13.2.0+ as the primary source for CUDA error explanations in cuda_core, while freezing the 13.1.1 explanation tables as fallback for older bindings. Centralize the version-gated selection and docstring cleanup helpers, update the driver/runtime explanation modules to use them, add tests that verify representative enums expose __doc__ and that cuda_utils attaches the explanation text, and remove the obsolete enum-reformat toolshed helper script.

Made-with: Cursor
@rwgk rwgk added this to the cuda.core v0.7.0 milestone Apr 5, 2026
@rwgk rwgk self-assigned this Apr 5, 2026
@rwgk rwgk added bug Something isn't working P0 High priority - Must do! cuda.core Everything related to the cuda.core module labels Apr 5, 2026
@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot bot commented Apr 5, 2026

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
Copy link
Copy Markdown
Collaborator Author

rwgk commented Apr 5, 2026

/ok to test

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 5, 2026

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.core Everything related to the cuda.core module P0 High priority - Must do!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Move enum explanations and health checks from cuda_core to cuda_bindings

1 participant