Coverage gap
write_geotiff_gpu and to_geotiff(gpu=True) accept seven overview_resampling modes: mean, nearest, min, max, median, mode, cubic. Six have direct end-to-end coverage:
mean: test_cog_overview_nodata_1613, test_features
nearest: test_features, test_cog::test_gpu_overview_resampling_nearest
min / max / median: test_overview_resampling_min_max_median_2026_05_11
cubic: test_signature_parity_1631::test_write_geotiff_gpu_cubic_overview_round_trip
mode is the odd one out. The branch in _block_reduce_2d_gpu (xrspatial/geotiff/_gpu_decode.py:3051-3056) and the matching write_geotiff_gpu(cog=True, overview_resampling='mode') / to_geotiff(gpu=True, ..., overview_resampling='mode') paths have no tests. test_mode_overview_perf.py exercises the CPU _block_reduce_2d helper, not the GPU one.
If someone dropped the mode dispatch from _block_reduce_2d_gpu, the function would fall through to the mean reshape branch and emit wrong overview pixels for integer rasters. Nothing in the suite would catch it.
Secondary gap
write_geotiff_gpu(compression_level=...) is documented as "Accepted for API compatibility but currently ignored -- nvCOMP does not expose level control". to_geotiff threads the kwarg through to write_geotiff_gpu unchanged. No test pins the contract: the kwarg has to be accepted for every codec, out-of-range values should not raise on the GPU writer (the CPU writer rejects compression_level=999 with ValueError), and the file should still round-trip. If someone wired the GPU writer up to the same range validator as the CPU writer, every to_geotiff(gpu=True, compression_level=X) caller would break silently for in-range levels and noisily for out-of-range ones.
Severity
Cat 4 (parameter coverage) HIGH for the mode branch: documented codec on a shipped public API with no test. MEDIUM for the compression_level accepted-but-ignored contract: a regression would change the GPU writer's behaviour against its docstring.
Fix
Add test_gpu_writer_overview_mode_and_compression_level.py covering:
_block_reduce_2d_gpu(method='mode') direct call, matching CPU reference output bit-for-bit.
write_geotiff_gpu(cog=True, overview_resampling='mode') end-to-end round trip on an integer raster.
to_geotiff(gpu=True, cog=True, overview_resampling='mode') dispatcher thread-through.
- GPU-vs-CPU writer pixel parity for
overview_resampling='mode' on integer input.
write_geotiff_gpu(compression_level=N) accepted-but-ignored for an in-range and out-of-range level on zstd and deflate.
to_geotiff(gpu=True, compression_level=N) dispatcher thread-through.
Filed by the test-coverage sweep on 2026-05-12. Source unchanged; test-only fix.
Coverage gap
write_geotiff_gpuandto_geotiff(gpu=True)accept sevenoverview_resamplingmodes:mean,nearest,min,max,median,mode,cubic. Six have direct end-to-end coverage:mean:test_cog_overview_nodata_1613,test_featuresnearest:test_features,test_cog::test_gpu_overview_resampling_nearestmin/max/median:test_overview_resampling_min_max_median_2026_05_11cubic:test_signature_parity_1631::test_write_geotiff_gpu_cubic_overview_round_tripmodeis the odd one out. The branch in_block_reduce_2d_gpu(xrspatial/geotiff/_gpu_decode.py:3051-3056) and the matchingwrite_geotiff_gpu(cog=True, overview_resampling='mode')/to_geotiff(gpu=True, ..., overview_resampling='mode')paths have no tests.test_mode_overview_perf.pyexercises the CPU_block_reduce_2dhelper, not the GPU one.If someone dropped the
modedispatch from_block_reduce_2d_gpu, the function would fall through to themeanreshape branch and emit wrong overview pixels for integer rasters. Nothing in the suite would catch it.Secondary gap
write_geotiff_gpu(compression_level=...)is documented as "Accepted for API compatibility but currently ignored -- nvCOMP does not expose level control".to_geotiffthreads the kwarg through towrite_geotiff_gpuunchanged. No test pins the contract: the kwarg has to be accepted for every codec, out-of-range values should not raise on the GPU writer (the CPU writer rejectscompression_level=999withValueError), and the file should still round-trip. If someone wired the GPU writer up to the same range validator as the CPU writer, everyto_geotiff(gpu=True, compression_level=X)caller would break silently for in-range levels and noisily for out-of-range ones.Severity
Cat 4 (parameter coverage) HIGH for the
modebranch: documented codec on a shipped public API with no test. MEDIUM for thecompression_levelaccepted-but-ignored contract: a regression would change the GPU writer's behaviour against its docstring.Fix
Add
test_gpu_writer_overview_mode_and_compression_level.pycovering:_block_reduce_2d_gpu(method='mode')direct call, matching CPU reference output bit-for-bit.write_geotiff_gpu(cog=True, overview_resampling='mode')end-to-end round trip on an integer raster.to_geotiff(gpu=True, cog=True, overview_resampling='mode')dispatcher thread-through.overview_resampling='mode'on integer input.write_geotiff_gpu(compression_level=N)accepted-but-ignored for an in-range and out-of-range level onzstdanddeflate.to_geotiff(gpu=True, compression_level=N)dispatcher thread-through.Filed by the test-coverage sweep on 2026-05-12. Source unchanged; test-only fix.