Fix #2050: Fix __eq__ implementations#2067
Open
mdboom wants to merge 2 commits into
Open
Conversation
|
rwgk
approved these changes
May 13, 2026
Contributor
rwgk
left a comment
There was a problem hiding this comment.
Cursor GPT-5.4 Extra High Fast
Findings
- No issues found. For the scope of PR 2067, the tests look reasonably complete.
cuda_core/tests/test_event.pycovers both sides of theIPCEventDescriptor.__eq__fix: unrelated-type comparisons now follow Python's rich-comparison protocol, and same-type comparisons still preserve the intended value semantics.cuda_core/tests/test_strided_layout.pydoes the same for_StridedLayout: it exercises==,!=, reverse comparison, and the direct__eq__NotImplementedcontract, plus a same-type equality/inequality smoke test.
Assumptions
cuda_core/tests/test_object_protocols.pydoes not includeIPCEventDescriptoror_StridedLayoutin the shared equality matrix, so these focused tests are the primary regression coverage for those two types.- That looks acceptable for this PR because the production change is narrowly scoped to those two
__eq__implementations.
Verification
- Ran
TestVenv/bin/python -m pytest cuda_core/tests/test_event.py -qand got28 passed, 2 skipped. - Ran
TestVenv/bin/python -m pytest cuda_core/tests/test_strided_layout.py -qand got689 passed. - The added coverage matches the regression described in issue
#2050and also checks that same-type equality behavior remains intact.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This bug was found with the static type-checking in #2061.
__eq__overrides have to handle /any/ type being passed into them, and should not blindly access members of what is passed in.