Describe the bug
In xrspatial/geotiff/_backends/gpu.py, three CPU-fallback call sites to _read_to_array drop caller-supplied kwargs (allow_rotated, window, band, max_pixels):
- line 684 (planar=2 per-band GPU decode fallback)
- line 697 (sparse-tile fallback)
- line 771 (post GPU-decode-failure fallback)
Each call is currently:
arr_cpu, _cpu_fallback_geo = _read_to_array(
source, overview_level=overview_level)
The later _gpu_apply_window_band(...) call repairs shape for window/band after the fact, but it cannot repair allow_rotated=False. By the time control returns to GPU code the CPU parser has already raised NotImplementedError on the rotated ModelTransformation. Callers who pass a raised max_pixels can also still trip the default 1B-pixel cap inside the fallback.
The stripped-layout branch at gpu.py:491 already forwards window, band, and max_pixels correctly (see comment referencing #1732). The three tiled-fallback sites missed the same fix, plus allow_rotated.
Expected behavior
The three CPU-fallback call sites should forward all four caller-supplied kwargs:
arr_cpu, _cpu_fallback_geo = _read_to_array(
source,
overview_level=overview_level,
window=window,
band=band,
max_pixels=max_pixels,
allow_rotated=allow_rotated,
)
Regression coverage:
- rotated-file fallback succeeds when
allow_rotated=True. This currently xfails in test_allow_rotated_no_crs_2122.py::test_cupy_rotated_read_drops_crs.
- caller-supplied
max_pixels raise is honored on the fallback path.
- caller-supplied
window/band reach the fallback. The assertion can sit at the _read_to_array boundary so it does not rely on _gpu_apply_window_band masking the bug.
Affected paths
- Sparse tiled files (
has_sparse_tile=True)
- PlanarConfiguration=2 multi-band tiled files when the per-band stage-2 GPU decode fails
- Any tiled file when both
gpu_decode_tiles_from_file and gpu_decode_tiles raise under on_gpu_failure='auto'
Additional context
Surfaced by a code review sweep of the geotiff module. Sibling finding to #2122, which fixed the eager numpy / dask / dask+cupy paths for allow_rotated. The test_cupy_rotated_read_drops_crs xfail in test_allow_rotated_no_crs_2122.py was filed against this same defect and will flip to a pass once the kwargs are forwarded.
Describe the bug
In
xrspatial/geotiff/_backends/gpu.py, three CPU-fallback call sites to_read_to_arraydrop caller-supplied kwargs (allow_rotated,window,band,max_pixels):Each call is currently:
The later
_gpu_apply_window_band(...)call repairs shape forwindow/bandafter the fact, but it cannot repairallow_rotated=False. By the time control returns to GPU code the CPU parser has already raisedNotImplementedErroron the rotatedModelTransformation. Callers who pass a raisedmax_pixelscan also still trip the default 1B-pixel cap inside the fallback.The stripped-layout branch at gpu.py:491 already forwards
window,band, andmax_pixelscorrectly (see comment referencing #1732). The three tiled-fallback sites missed the same fix, plusallow_rotated.Expected behavior
The three CPU-fallback call sites should forward all four caller-supplied kwargs:
Regression coverage:
allow_rotated=True. This currently xfails intest_allow_rotated_no_crs_2122.py::test_cupy_rotated_read_drops_crs.max_pixelsraise is honored on the fallback path.window/bandreach the fallback. The assertion can sit at the_read_to_arrayboundary so it does not rely on_gpu_apply_window_bandmasking the bug.Affected paths
has_sparse_tile=True)gpu_decode_tiles_from_fileandgpu_decode_tilesraise underon_gpu_failure='auto'Additional context
Surfaced by a code review sweep of the geotiff module. Sibling finding to #2122, which fixed the eager numpy / dask / dask+cupy paths for
allow_rotated. Thetest_cupy_rotated_read_drops_crsxfail intest_allow_rotated_no_crs_2122.pywas filed against this same defect and will flip to a pass once the kwargs are forwarded.