Summary
The morphology module (erode, dilate, opening, closing, gradient, white/black top-hat) already has solid backend and edge-case coverage, but a few edge inputs are never exercised by the test suite. The source handles them correctly today, so these are regression guards rather than bug reports.
Gaps found by /sweep-test-coverage
- Infinite inputs (+Inf / -Inf). No test passes Inf to any morphology function. Inf interacts with the min/max kernel and with the NaN-propagation branch (the
v != v check), so a future refactor of that branch could silently break Inf handling and no test would catch it.
- All-NaN raster. The all-NaN case is not tested. Every cell sees only NaN neighbours and should return NaN.
- Degenerate strip rasters (Nx1 and 1xN). The single-pixel (1x1) case is covered, but column and row strips are not. These exercise the dask map_overlap path where one dimension is narrower than the overlap depth.
- Integer-dtype input. The numpy path casts to float64 via astype; no test confirms integer input is accepted and promoted.
Proposed fix
Add tests only, no source changes. Cover the four gaps above on numpy and, where applicable, dask / cupy / dask+cupy using the cross-backend helpers in general_checks.py.
Summary
The morphology module (erode, dilate, opening, closing, gradient, white/black top-hat) already has solid backend and edge-case coverage, but a few edge inputs are never exercised by the test suite. The source handles them correctly today, so these are regression guards rather than bug reports.
Gaps found by /sweep-test-coverage
v != vcheck), so a future refactor of that branch could silently break Inf handling and no test would catch it.Proposed fix
Add tests only, no source changes. Cover the four gaps above on numpy and, where applicable, dask / cupy / dask+cupy using the cross-backend helpers in general_checks.py.