Commit 7501b67
authored
rasterize: sweep-test-coverage pass 2 -- NaN/Inf burns, nested GC, GPU multi-column (#2256)
* rasterize: sweep-test-coverage pass 2 (2026-05-21)
Adds test_rasterize_coverage_2026_05_21.py with 58 tests closing the
remaining public-API coverage gaps after pass-1 (2026-05-17):
- Cat 2 HIGH +/-Inf and NaN burn values across all four backends:
+Inf / -Inf burn under default merge; Inf + finite under sum stays
Inf; Inf + (-Inf) under sum collapses to NaN; min(Inf, 1.0) and
max(-Inf, 1.0) pick the finite value; Inf-as-bound rejected with
the same ValueError as NaN-as-bound (pass-1 only tested NaN bound).
NaN-burn polygon, point, and line each pin the rasterized cell.
- Cat 1 MEDIUM nested GeometryCollection across all four backends.
rasterize.py:1995 documents recursive unpacking but only flat GCs
were tested. Deeply-nested-3-levels eager test pins that the
recursion depth limit is not 1 or 2.
- Cat 1 MEDIUM columns= (multi-column properties) parity on cupy and
dask+cupy (TestMultiColumn covered numpy / dask+numpy only). Pin
three-column props on GPU so the (N, P) loop survives the kernel
boundary.
- Cat 3 LOW rectangular-pixel parity (resolution=(rx, ry), rx != ry)
across all four backends.
Tests surfaced a cross-backend bug: GPU max/min merge silently
suppresses NaN burn values (CPU keeps NaN per IEEE; GPU returns the
finite value or the -inf buffer init). Filed as issue #2255 and
pinned both observables in paired CPU / GPU tests so the divergence
is visible in CI until the GPU kernels are aligned.
Source untouched. All 58 new tests pass on a CUDA host; pre-existing
417 rasterize tests still pass.
* rasterize tests: address self-review nits on coverage pass 2
Three nit-level fixes from the post-PR review of #2256, none affecting
test intent or coverage:
- test_inf_bounds_rejected: tighten regex to "Invalid bounds:.*must be
finite" so a future refactor that adds a different "must be finite"
check (e.g. on resolution at rasterize.py:3101) earlier in the call
cannot accidentally satisfy the assertion via the wrong code path.
- TestNaNBurnValues docstring: pull the issue #2255 reference up from
the per-test comment so the GPU/CPU NaN-merge divergence is flagged
on the class as well as on the asymmetric paired tests.
- test_deeply_nested_gc: parametrize over numpy and dask+numpy so the
recursive GeometryCollection pre-classification check covers the
per-tile graph builder too, not just the eager path.
All 59 tests in the file pass (was 58, +1 from the new dask_numpy
parametrization).1 parent d13754a commit 7501b67
2 files changed
Lines changed: 574 additions & 1 deletion
0 commit comments