Skip to content

geotiff: golden corpus phase 3 PR 3, GPU backend (#1930)#2039

Merged
brendancol merged 2 commits into
mainfrom
1930-phase3-3-gpu
May 18, 2026
Merged

geotiff: golden corpus phase 3 PR 3, GPU backend (#1930)#2039
brendancol merged 2 commits into
mainfrom
1930-phase3-3-gpu

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Summary

Phase 3 PR 3 of the golden corpus plan in #1930. Mirrors phase 3 PRs 1 and 2 but reads each fixture through open_geotiff(str(path), gpu=True, on_gpu_failure='strict'), returning a CuPy-backed DataArray. The oracle's _candidate_pixels pulls the device array back to host via .get() before comparing.

The whole module pytest.importorskips cupy and skips if no CUDA device is reachable, so CI matrices without a GPU collect zero tests here. The strict on-gpu-failure mode is on so a silent CPU fallback surfaces as an exception rather than masking GPU coverage.

23 fixtures pass at level-0 parity. 7 xfailed with strict=True (the same shared codec/attrs gaps the eager and dask backends flag). 2 skipped: MinIsWhite (intentional inversion per #1797) and the example_* manifest entry without an on-disk .tif.

_GPU_SKIPS is reserved for GPU-specific gaps and is empty in the first pass. A test_gpu_candidate_is_actually_on_device belt-and-braces check confirms the result is a cupy.ndarray rather than a CPU-fallback numpy array.

Test plan

  • pytest xrspatial/geotiff/tests/test_golden_corpus_gpu_1930.py: 23 passed, 7 xfailed, 2 skipped
  • Module skips cleanly on CPU-only environments

Refs #1930. Third of six backend-wiring PRs; dask+GPU, HTTP/COG, and VRT remain.

Mirrors phase 3 PR 1 (#2036) and PR 2 (#2038) but reads each fixture
through ``open_geotiff(str(path), gpu=True, on_gpu_failure='strict')``,
returning a CuPy-backed DataArray. The oracle's ``_candidate_pixels``
pulls the device array back to host via ``.get()`` before comparing.

The whole module ``pytest.importorskip``s cupy and skips if no CUDA
device is reachable, so CI matrices without a GPU collect zero tests
here. The strict on-gpu-failure mode is on so a silent CPU fallback
surfaces as an exception rather than masking GPU coverage.

23 fixtures pass, 7 xfailed (shared codec/attrs gaps), 2 skipped
(MinIsWhite + the example_ manifest entry).

``_GPU_SKIPS`` is reserved for GPU-specific gaps and is empty for now.
A ``test_gpu_candidate_is_actually_on_device`` belt-and-braces check
confirms the result is a ``cupy.ndarray`` rather than a CPU-fallback
numpy array.
Address phase 3 PR 3 review: ``compression_jpeg_uint8_ycbcr`` lived
in ``_PARITY_GAPS`` with the reason "RGB band axis order divergence",
which describes the failure mode on the eager and dask backends.
On the GPU path with ``on_gpu_failure='strict'`` the JPEG-YCbCr
decoder raises ``OSError: broken data stream`` before the oracle
gets to compare anything, so the recorded reason no longer matches
what actually happens.

Move the entry to ``_GPU_SKIPS`` with a GPU-accurate reason. The
xfail mechanics are unchanged; this is documentation that now
matches reality. Update the module docstring to match.
@brendancol brendancol merged commit c706f13 into main May 18, 2026
5 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