geotiff tests: consolidate GPU writer cluster (Sub-PR B)#2473
Open
brendancol wants to merge 4 commits into
Open
geotiff tests: consolidate GPU writer cluster (Sub-PR B)#2473brendancol wants to merge 4 commits into
brendancol wants to merge 4 commits into
Conversation
Closes part of #2438 (Sub-PR B). Cluster 14 of long-tail epic #2424. Fold 8 GPU writer test files into a new xrspatial/geotiff/tests/gpu/test_writer.py: - test_gpu_writer_attrs_1563.py (write-path attrs parity) - test_gpu_writer_band_first_1580.py ((band, y, x) layout remap) - test_gpu_writer_compression_modes_2026_05_11.py (zstd, deflate, jpeg, none) - test_gpu_writer_cpu_fallback_codecs_2026_05_12.py (lzw, packbits, lz4, lerc, jpeg2000) - test_gpu_writer_nan_sentinel_1599.py (NaN-to-sentinel rewrite) - test_gpu_writer_overview_inplace_1948.py (cupy.putmask in COG loop) - test_gpu_writer_overview_mode_and_compression_level_1740.py - test_to_geotiff_gpu_fallback_1674.py (gpu=True exception classification) Tests-only. The shared requires_gpu marker from _helpers/markers.py replaces the per-file _gpu_available / _gpu_only helpers. 87 tests collected, matching the baseline sum across the eight source files. The release-gate row for writer.gpu and the geotiff.rst experimental codec note now cite gpu/test_writer.py.
brendancol
commented
May 27, 2026
Contributor
Author
brendancol
left a comment
There was a problem hiding this comment.
PR Review: geotiff tests: consolidate GPU writer cluster (Sub-PR B)
Blockers
None.
Suggestions
None.
Nits
xrspatial/geotiff/tests/gpu/test_writer.py:37--importlib.utilis imported at module scope but the only remaining caller is_nvjpeg_available. The original per-file_gpu_availablehelpers also used it; here the GPU detection delegates to_helpers/markers.py, so it only feeds the nvjpeg probe. Could be moved inside_nvjpeg_available, but a stdlib import at module scope is the more conventional choice and I would leave it.xrspatial/geotiff/tests/gpu/test_writer.py:1398-- the source-locate path intest_gpu_writer_overview_loop_uses_putmask_1948now walksparent.parent.parent / "_writers" / "gpu.py"(the original usedparent.parent). The audit file calls this out, but a one-line comment in the test docstring would put the explanation where the next reader actually lands. Optional.
What looks good
- Every test name from the eight source files is present in the new file. 68 unique functions, 87 parametrise-expanded cases, matching the pre-consolidation baseline.
_make_int_da(Section 3, 64x64 int32) and_make_int_da_small(Section 4, 32x32 uint16) are deliberately kept distinct so the test inputs each section saw stay the same. Merging the two helpers would have changed inputs.- Per-file
_gpu_available/_gpu_onlyhelpers are replaced with the sharedrequires_gpumarker from_helpers/markers.py, matching the convention from #2470. The fallback-section tests keep no@_gpu_onlydecorator on purpose (they monkeypatchwrite_geotiff_gpu), as they did originally. - Release-gate citations in
docs/source/reference/release_gate_geotiff.rstanddocs/source/reference/geotiff.rstpoint at the new file.pytest xrspatial/geotiff/tests/release_gates/: 158 passed, 1 xfailed locally. CLUSTER_AUDIT_GPU_B.mdmaps every old test to its new location and will be deleted in the final pre-merge commit per the epic's hard gate.
Checklist
- All original test names migrated
- Tests-only PR as scoped (no source changes)
-
requires_gpumarker correctly applied - Path resolution in source-locate test verified (walks to
_writers/gpu.py) - Helper defaults preserved per source file
- Release-gate citation updated; release-gate parity test passes
- Audit file created for the epic gate
Address review nit: the overview-loop source-locate test walks parent.parent.parent (not the original parent.parent) because the consolidated file lives one level deeper under tests/gpu/. Make that explicit in the docstring so future readers do not assume the walk is wrong.
brendancol
commented
May 27, 2026
Contributor
Author
brendancol
left a comment
There was a problem hiding this comment.
Follow-up review
Picked up at commit 1e286ff.
Blockers
None.
Suggestions
None.
Nits
None remaining. The earlier nit on the source-locate path docstring was addressed in 1e286ff with a short path note. The importlib.util module-scope import was kept (conventional placement for a stdlib import; the helper that uses it is defined later in the file).
Re-run
pytest xrspatial/geotiff/tests/gpu/test_writer.py: 87 passed.pytest xrspatial/geotiff/tests/release_gates/: 158 passed, 1 xfailed.
Ready as-is from the review side. Merging gated only on CI and the final pre-merge audit-file deletion per the epic #2424 hard gate.
Final pre-merge commit per the epic #2424 hard gate: the audit file that maps every old file::test to its new file::test_id is deleted before merge. The audit served the review and is now baked into the PR diff itself.
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.
Closes part of #2438 (Sub-PR B). Cluster 14 of long-tail epic #2424.
Summary
Fold 8 GPU writer test files into a new
xrspatial/geotiff/tests/gpu/test_writer.py:test_gpu_writer_attrs_1563.py(write-path attrs parity)test_gpu_writer_band_first_1580.py((band, y, x) layout remap + auto-dispatch)test_gpu_writer_compression_modes_2026_05_11.py(zstd, deflate, jpeg, none)test_gpu_writer_cpu_fallback_codecs_2026_05_12.py(lzw, packbits, lz4, lerc, jpeg2000)test_gpu_writer_nan_sentinel_1599.py(NaN-to-sentinel rewrite)test_gpu_writer_overview_inplace_1948.py(cupy.putmask in COG loop)test_gpu_writer_overview_mode_and_compression_level_1740.pytest_to_geotiff_gpu_fallback_1674.py(gpu=True exception classification)Tests-only. The shared
requires_gpumarker from_helpers/markers.pyreplaces the per-file_gpu_available/_gpu_onlyhelpers. 87 tests collected, matching the baseline sum.The release-gate
writer.gpurow and the experimental GPU codec note indocs/source/reference/geotiff.rstnow citegpu/test_writer.py.Verification
pytest xrspatial/geotiff/tests/gpu/test_writer.py -v: 87 passed on a CUDA-equipped host.pytest --collect-only xrspatial/geotiff/tests/gpu/test_writer.py: 87 tests collected.pytest xrspatial/geotiff/tests/release_gates/test_stable_features.py: 158 passed, 1 xfailed.Test plan
gpu/test_writer.pycollects and runs locally.Companion PRs
One of four sub-PRs against issue #2438. Sub-PRs A (
gpu/test_reader.py), C (gpu/test_codec.py), and D (gpu/test_kernels_and_kwargs.py) are independent; merge order does not matter.