Skip to content

geotiff: cover degenerate-shape reads on dask and GPU backends#2973

Merged
brendancol merged 1 commit into
mainfrom
deep-sweep-test-coverage-geotiff-degenerate-read-01
Jun 5, 2026
Merged

geotiff: cover degenerate-shape reads on dask and GPU backends#2973
brendancol merged 1 commit into
mainfrom
deep-sweep-test-coverage-geotiff-degenerate-read-01

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Summary

The eager numpy reader already covers degenerate-shape sources (1x1, 1xN, Nx1), and the dask streaming write path covers writing degenerate dask rasters. What was missing is the read side on the non-eager backends:

  • the windowed dask reader (chunks=) splitting a single-pixel dimension into chunks,
  • the GPU reader (gpu=True) launching its decode kernels on a degenerate grid,
  • and the dask+gpu combination.

The smallest dask-read source in the existing suite is 8x8 / 2x32, and the parity-matrix fixtures are 32x32 / 64x64, so these shapes never reached the windowed read or the GPU launch.

I probed all three backends on these shapes first. They read correctly today, so this is a coverage gap rather than a bug, and no source code changes.

What was added

xrspatial/geotiff/tests/read/test_degenerate_shapes.py, 18 tests:

  • dask read across chunk sizes that meet, split, and exceed the degenerate dimension, each asserting pixel parity against the eager read
  • dask read coord / transform / CRS preservation
  • GPU read and dask+gpu read, both checked against the eager read

The fixture passes an explicit attrs['transform'] because the writer cannot infer a pixel size from a single-element coord axis.

Validation

All 18 tests pass on a CUDA host. The 6 GPU and dask+gpu cells ran rather than skipped, and the 1x1 GPU read goes through a grid-size-1 kernel launch. flake8 clean.

Found by the test-coverage deep-sweep against the geotiff module.

The eager numpy reader already covers 1x1 / 1xN / Nx1 sources, and the
dask streaming write path covers writing degenerate dask rasters. The
read side on the non-eager backends was untested: the windowed dask
reader (chunks=) splitting a single-pixel dimension into chunks, the GPU
reader (gpu=True) launching its decode kernels on a degenerate grid, and
the dask+gpu combination. The smallest dask-read source in the existing
suite is 8x8 / 2x32; the parity matrix fixtures are 32x32 / 64x64.

These paths work today, so this is a coverage gap rather than a bug fix.
Add read/test_degenerate_shapes.py: dask read across chunk sizes that
meet, split, and exceed the degenerate dimension; coord / transform /
CRS parity; GPU read and dask+gpu read. Each cell asserts pixel parity
against the eager numpy read. The fixture supplies an explicit
attrs['transform'] because the writer cannot infer a pixel size from a
single-element coord axis.

Test-only; no source changes.
@github-actions github-actions Bot added the performance PR touches performance-sensitive code label Jun 5, 2026
@brendancol brendancol merged commit 04a16d4 into main Jun 5, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance PR touches performance-sensitive code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant