Skip to content

Add check for pre-release generated content - #2373

Draft
mdboom wants to merge 4 commits into
NVIDIA:mainfrom
mdboom:prerelease-checks
Draft

Add check for pre-release generated content#2373
mdboom wants to merge 4 commits into
NVIDIA:mainfrom
mdboom:prerelease-checks

Conversation

@mdboom

@mdboom mdboom commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Now that our generator behaves differently, this is an extra check for pre-release content.

@mdboom mdboom self-assigned this Jul 15, 2026
@mdboom mdboom added the CI/CD CI/CD infrastructure label Jul 15, 2026
@github-actions

Copy link
Copy Markdown

@mdboom
mdboom requested a review from rwgk July 20, 2026 13:10
@Andy-Jost

Copy link
Copy Markdown
Contributor

This check can silently miss pre-release content:

  1. _VERSION_RE only recognizes generated across versions from … to …. Sealed files such as nvrtc.pyx use generated with version 13.3.0, so regenerating them with 13.4 would pass unnoticed.
  2. When a generated marker exists but the version header is unrecognized, the script silently succeeds. It should fail closed so future header-format changes cannot bypass the check.

Could we support both current header formats and add focused tests for each, plus the unrecognized-header case?

@rwgk

rwgk commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

@mdboom I looked more closely, I believe these are the only essential changes in scope for this PR:

  • Parse both current header formats:
    • generated across versions from ... to X.Y.Z
    • generated with version X.Y.Z

The second format is used by six files: driver, runtime, and nvrtc, each as .pyx and .pxd. (This is also exactly Andy’s first point, and what I shared earlier offline.)

  • For all sealed files, ensure that the check fails if version information cannot be determined with certainty, unless it is fully understood why the version information is missing. Concretely, currently there are 69 sealed files: 59 multi-version, 6 single-version, and 4 with no CTK metadata:
    • cuda_bindings/cuda/bindings/_internal/_fast_enum.py:5
    • cuda_bindings/docs/source/module/driver.rst:4
    • cuda_bindings/docs/source/module/nvrtc.rst:4
    • cuda_bindings/docs/source/module/runtime.rst:4

If it's not easy to add CTK metadata to those files, it would seem OK to explicitly exempt them, but to reject every other sealed file with zero, multiple, or unrecognized version headers. That accommodates the status quo while also ensuring that future generator-format drift fails loudly. — I believe this is also exactly Andy's second point.

@mdboom

mdboom commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

If it's not easy to add CTK metadata to those files, it would seem OK to explicitly exempt them

This is a good call-out that we are missing this information in docs. Those need to be checked as well (because they would leak info about new APIs). I will fix that on the generator side and then plug that hole here.

@mdboom

mdboom commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

We need generator MR 497 to be merged first, generate its changes here, and then this check should be complete and work.

@mdboom
mdboom marked this pull request as draft July 28, 2026 14:47
@copy-pr-bot

copy-pr-bot Bot commented Jul 28, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD CI/CD infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants