GPU tests expect ValueError from dataclasses.replace on init=False fields; Python 3.13 raises TypeError
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- machine-learning, testing
Research direction
Read the two pytest.raises(ValueError) assertions in tests/xpois/test_ois.py around line 478 and tests/xfit/test_models.py around line 921. Check how the tests exercise dataclasses.replace() with init=False fields, then run these GPU tests with CuPy on Python 3.12 and 3.13. Done when both tests accept the exception behavior on both versions and their other assertions still pass.
Written by the indexing model from the issue text.
Description
Two GPU tests assert the exception type that dataclasses.replace() raised on Python 3.12 when a field declared with init=False is passed. Python 3.13 raises TypeError where 3.12 raised ValueError, so both tests fail on 3.13 with CuPy installed.
Observed on one GPU host with Python 3.13.7, CuPy 14.1.1 and CUDA 13 at main (ffb1d38):
tests/xpois/test_ois.py:479: in test_solve_constant_kernel_device_matches_cpu_and_stays_on_device
replace(result, solver="spatial-als")
E TypeError: field solver is declared with init=False, it cannot be specified with replace()
tests/xfit/test_models.py:929: in test_fit_dipoles_device_matches_portable_result_without_bulk_d2h
replace(device, **{name: value})
E TypeError: field schema is declared with init=False, it cannot be specified with replace()
Both sites are inside with pytest.raises(ValueError): (test_ois.py:478-479, test_models.py:921-929, the loop over schema, solver, backend, result_location). Every other assertion in the two tests passes, and the same two tests pass on Python 3.12.
CI does not see it: the Python 3.13 and 3.14 matrix entries run without CuPy, so these GPU tests skip there, and the GPU job runs Python 3.12.
Suggested fix: expect (TypeError, ValueError) at both sites, or assert on the message ("declared with init=False"), which is the same on both versions. The library behavior is unchanged; only the expected exception type in the tests depends on the interpreter.
- Dominant language
- Python
- Stars
- 18
- Forks
- 9
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 90
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NVIDIA/cuPhoton
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
xray linear prediction: lightly damped modes are dropped by the `decay >= 0` root filter under noise; proposal for a synthetic fixture with Cramer-Rao validation and per-GPU baselinesPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
NVIDIA/cuPhoton#1 · 6 comments ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
iceboundrock/AutoForge#304 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
fossasia/visdom-dev#77 ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
aws-cloudformation/cfn-lint#4890 ·
Maintainers usually reply within 2 days