Skip to content

Conversation

mdboom
Copy link
Contributor

@mdboom mdboom commented Oct 2, 2025

As a way of detecting changes in "Cython ABI" (which is loosely defined, see #1030), this adds the contents of the __pyx_capi__ dictionary to JSON files in the repository, and then adds a unit test to detect any changes.

I think this may be useful as a first defense against ABI changes, however it's not a complete solution. This can not detect changes in structs or enums used across Cython modules.

There is also the risk of annoyance any time new functions are added, which is a completely "ABI safe" operation, but we need to update the baselines in order to detect unsafe operations (deletions) in the future. An alternative approach might be to download a baseline wheel and compare the ABI against it directly -- that could be done in CI but would be harder to run locally.

Closes #1030

Copy link
Contributor

copy-pr-bot bot commented Oct 2, 2025

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

Contributors can view more details about this message here.

@mdboom
Copy link
Contributor Author

mdboom commented Oct 2, 2025

/ok to test

Copy link

github-actions bot commented Oct 2, 2025

@cpcloud
Copy link
Contributor

cpcloud commented Oct 2, 2025

@kkraus14
Copy link
Collaborator

kkraus14 commented Oct 2, 2025

Would this have caught the issues mentioned in #1030?

Yes, symbols would have been removed from __pyx_capi__ when they were changed to be externed.

@mdboom
Copy link
Contributor Author

mdboom commented Oct 2, 2025

This theoretically would detect the change as described here. It's basically reverse engineering what Cython does when it does its custom "dynamic linking". I would have liked to have tested it directly, but it's surprisingly hard to build 11.7 today, and there don't seem to be any wheels or conda packages available.

@mdboom
Copy link
Contributor Author

mdboom commented Oct 3, 2025

/ok to test

@leofang leofang added P1 Medium priority - Should do test Improvements or additions to tests cuda.bindings Everything related to the cuda.bindings module triage Needs the team's attention labels Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuda.bindings Everything related to the cuda.bindings module P1 Medium priority - Should do test Improvements or additions to tests triage Needs the team's attention
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI: Add integration tests to cover cuda.bindings ABI stability
4 participants