Skip to content

Commit 46f567f

Browse files
authored
Cover write_geotiff_gpu compression modes (zstd default + jpeg) (#1646) (#1647)
* Test write_geotiff_gpu compression modes (#1646) Cover the documented compression= modes that had no targeted round-trip tests: - zstd (the default, "fastest on GPU"): pixel-exact round-trip on int32 plus default-codec pinning via TIFF tag 259. - jpeg (nvJPEG with Pillow fallback): round-trip for 3-band uint8 RGB and single-band uint8 with mean-abs-diff bounds; pin compression tag 7. Exercises the live nvJPEG encoder on a GPU host, not just the Pillow fallback. - deflate + none: plain round-trips outside the COG / nodata-sentinel paths so a regression in the basic tiled assembly is visible. - Cross-codec parity: zstd, deflate, none must produce pixel-identical read-backs for the same input (catches predictor / codec mis-wiring). 11 tests, all passing on the GPU host. Update .claude/sweep-test-coverage-state.csv to record pass 7. * Address Copilot review feedback on #1647 - Rewrite test_write_geotiff_gpu_zstd_default_matches_explicit so the docstring matches what it asserts: pin the compression tag and the decoded-array equality, not byte-for-byte file equality (the writer may legitimately vary tile padding/ordering between runs). - Swap the JPEG RGB test input from random uint8 noise to a deterministic smooth gradient (mirroring test_jpeg.py::_gradient_rgb). Tighten the mean-abs-diff bound from 50 to 8 for RGB and to 5 for the monochrome variant; the looser bound only existed because random noise is the worst case for JPEG. - Add test_write_geotiff_gpu_jpeg_uses_nvjpeg_when_available: spy on _gpu_decode._nvjpeg_batch_encode via monkeypatch and assert it fires at least once when libnvjpeg is loadable. Without this spy a regression breaking nvJPEG would silently fall through to the Pillow fallback and the round-trip tests would still pass. The new test is guarded by _nvjpeg_only so it only runs on hosts where libnvjpeg is actually loadable.
1 parent 2ca76db commit 46f567f

2 files changed

Lines changed: 397 additions & 1 deletion

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module,last_inspected,issue,severity_max,categories_found,notes
2-
geotiff,2026-05-11,,HIGH,2;3;4,"Pass 6 (2026-05-11): added test_overview_resampling_min_max_median_2026_05_11.py covering Cat 4 HIGH parameter-coverage gap on overview_resampling=min/max/median. CPU end-to-end paths were already covered by test_cog_overview_nodata_1613::test_cpu_cog_overview_aggregations_ignore_sentinel; the GPU end-to-end paths and the direct CPU+GPU block-reducer branches had no targeted tests, so a regression on those code paths would ship undetected. 26 tests, all passing on GPU host: block-reducer unit tests (finite + partial-NaN), end-to-end COG writes for both to_geotiff and write_geotiff_gpu, CPU/GPU parity for to_geotiff(gpu=True), CPU nodata-sentinel regression check, and ValueError error-path tests for unknown method names on both backends. Pass 5 (2026-05-11): added test_degenerate_shapes_backends_2026_05_11.py covering Cat 3 HIGH geometric gaps (1x1 / 1xN / Nx1 reads on dask+numpy, GPU, dask+cupy backends; 1x1 / 1xN / Nx1 writes through write_geotiff_gpu) and Cat 2 MEDIUM NaN/Inf gaps (all-NaN read on GPU + dask+cupy, Inf / -Inf reads on all non-eager backends, NaN sentinel mask on dask read path including sentinel block split across chunk boundary). 23 tests, all passing on GPU host. Prior passes still hold: pass 4 (r4) closed read_geotiff_gpu/dask name= + max_pixels= kwargs (Cat 4), pass 3 (r3) closed read_vrt GPU/dask+GPU backend dispatch (Cat 1) and dtype/name kwargs (Cat 4)."
2+
geotiff,2026-05-11,,HIGH,2;3;4,"Pass 7 (2026-05-11): added test_gpu_writer_compression_modes_2026_05_11.py closing Cat 4 HIGH gap on write_geotiff_gpu compression= modes. The writer documents zstd (default, fastest GPU), deflate, jpeg, and none, but only deflate + none had round-trip tests; the default zstd and the jpeg (nvJPEG/Pillow) paths shipped without targeted coverage. 11 new tests, all passing on GPU host: zstd round-trip + default-codec pinning, jpeg round-trip on 3-band RGB uint8 + 1-band greyscale, TIFF compression-tag header check across none/deflate/zstd/jpeg, plain deflate + none round-trips outside the COG/sentinel paths, and a cross-codec lossless parity check (zstd/deflate/none agree pixel-exact). nvJPEG path was exercised live, not just the Pillow fallback. Pass 6 (2026-05-11): added test_overview_resampling_min_max_median_2026_05_11.py covering Cat 4 HIGH parameter-coverage gap on overview_resampling=min/max/median. CPU end-to-end paths were already covered by test_cog_overview_nodata_1613::test_cpu_cog_overview_aggregations_ignore_sentinel; the GPU end-to-end paths and the direct CPU+GPU block-reducer branches had no targeted tests, so a regression on those code paths would ship undetected. 26 tests, all passing on GPU host: block-reducer unit tests (finite + partial-NaN), end-to-end COG writes for both to_geotiff and write_geotiff_gpu, CPU/GPU parity for to_geotiff(gpu=True), CPU nodata-sentinel regression check, and ValueError error-path tests for unknown method names on both backends. Pass 5 (2026-05-11): added test_degenerate_shapes_backends_2026_05_11.py covering Cat 3 HIGH geometric gaps (1x1 / 1xN / Nx1 reads on dask+numpy, GPU, dask+cupy backends; 1x1 / 1xN / Nx1 writes through write_geotiff_gpu) and Cat 2 MEDIUM NaN/Inf gaps (all-NaN read on GPU + dask+cupy, Inf / -Inf reads on all non-eager backends, NaN sentinel mask on dask read path including sentinel block split across chunk boundary). 23 tests, all passing on GPU host. Prior passes still hold: pass 4 (r4) closed read_geotiff_gpu/dask name= + max_pixels= kwargs (Cat 4), pass 3 (r3) closed read_vrt GPU/dask+GPU backend dispatch (Cat 1) and dtype/name kwargs (Cat 4)."
33
reproject,2026-05-10,,HIGH,1;4;5,"Added 39 tests: LiteCRS direct coverage, itrf_transform behaviour/roundtrip/array, itrf_frames, geoid_height numerical correctness + raster happy-path, vertical helpers (ellipsoidal<->orthometric/depth), reproject() lat/lon and latitude/longitude dim propagation. Note: _merge_arrays_cupy is imported but unused (no cupy merge dispatch in merge()); flagged as feature gap not test gap."

0 commit comments

Comments
 (0)