Coverage gap
The GPU writer write_geotiff_gpu documents nine compression= modes (none, deflate, lzw, jpeg, packbits, zstd, lz4, jpeg2000/j2k, lerc). Only four (none, deflate, zstd, jpeg) have direct round-trip tests in test_gpu_writer_compression_modes_2026_05_11.py.
The remaining five codecs route through dedicated branches in gpu_compress_tiles (xrspatial/geotiff/_gpu_decode.py:2974-3019) that fall back to the CPU compressor when no GPU accelerator exists:
compression='jpeg2000'/'j2k' -> _nvjpeg2k_batch_encode with jpeg2000_compress fallback
compression='lerc' -> lerc_compress (CPU only, no GPU library)
compression='lzw' -> cpu_compress via the trailing fallback branch
compression='packbits' -> cpu_compress via the trailing fallback branch
compression='lz4' -> cpu_compress via the trailing fallback branch
The trailing fallback branch is the same one nvCOMP-failures land in. A regression in any of these wiring points (eg. dropping a codec from the dispatch, swapping the routed compression tag, or returning the wrong-sized tile buffer) would ship undetected because:
- The internal reader uses the same compression-tag lookup so it would decode a wrong-tagged file correctly.
- No external interop check (GDAL / rasterio / libtiff) currently exercises these codecs from the GPU writer.
- The implicit smoke tests in the suite only exercise
none/deflate/zstd/jpeg.
Severity: HIGH
Cat 4 (parameter coverage) HIGH. The untested modes are documented and shipped; users picking the GPU writer for an integer raster have a reasonable case for lzw or lerc over zstd.
Fix
Add test_gpu_writer_cpu_fallback_codecs_2026_05_12.py covering:
- Round-trip pixel equality for
lzw, packbits, lz4, lerc, jpeg2000 through write_geotiff_gpu.
- TIFF Compression tag verification for each codec (catches wrong-tag-emission bugs not visible to the internal reader).
- Cross-backend parity vs the matching CPU
to_geotiff codec output (decoded array equality).
- Availability-guarded skips on
LERC_AVAILABLE / LZ4_AVAILABLE / JPEG2000_AVAILABLE.
Filed by the test-coverage sweep on 2026-05-12 (pass 11). Source unchanged; this is a test-only fix.
Coverage gap
The GPU writer
write_geotiff_gpudocuments ninecompression=modes (none,deflate,lzw,jpeg,packbits,zstd,lz4,jpeg2000/j2k,lerc). Only four (none,deflate,zstd,jpeg) have direct round-trip tests intest_gpu_writer_compression_modes_2026_05_11.py.The remaining five codecs route through dedicated branches in
gpu_compress_tiles(xrspatial/geotiff/_gpu_decode.py:2974-3019) that fall back to the CPU compressor when no GPU accelerator exists:compression='jpeg2000'/'j2k'->_nvjpeg2k_batch_encodewithjpeg2000_compressfallbackcompression='lerc'->lerc_compress(CPU only, no GPU library)compression='lzw'->cpu_compressvia the trailing fallback branchcompression='packbits'->cpu_compressvia the trailing fallback branchcompression='lz4'->cpu_compressvia the trailing fallback branchThe trailing fallback branch is the same one nvCOMP-failures land in. A regression in any of these wiring points (eg. dropping a codec from the dispatch, swapping the routed compression tag, or returning the wrong-sized tile buffer) would ship undetected because:
none/deflate/zstd/jpeg.Severity: HIGH
Cat 4 (parameter coverage) HIGH. The untested modes are documented and shipped; users picking the GPU writer for an integer raster have a reasonable case for
lzworlercoverzstd.Fix
Add
test_gpu_writer_cpu_fallback_codecs_2026_05_12.pycovering:lzw,packbits,lz4,lerc,jpeg2000throughwrite_geotiff_gpu.to_geotiffcodec output (decoded array equality).LERC_AVAILABLE/LZ4_AVAILABLE/JPEG2000_AVAILABLE.Filed by the test-coverage sweep on 2026-05-12 (pass 11). Source unchanged; this is a test-only fix.