geotiff tests: consolidate backend-parity cluster#2408
Merged
Conversation
Fold the backend-parity cluster (the largest by lines in the test suite) into parity/test_backend_matrix.py and parity/test_pixel_equality.py. Folded files (deleted in this commit): * test_backend_parity_matrix.py * test_backend_full_parity_2211.py * test_backend_pixel_parity_matrix_1813.py * test_backend_kwarg_parity_1561.py * test_attrs_finalization_parity_2211.py * test_attrs_parity_1548.py * test_miniswhite_backend_parity_1797.py Updates docs/source/reference/release_gate_geotiff.rst rows that cited the old paths; verified by test_release_gate_2321. Adds a temporary CLUSTER_AUDIT_PR4.md mapping old to new test ids; deleted before merge. Closes #2398. Refs epic #2390 (PR 4).
brendancol
commented
May 26, 2026
Contributor
Author
brendancol
left a comment
There was a problem hiding this comment.
PR Review: PR #2408 (geotiff tests: consolidate backend-parity cluster)
Blockers
None. Tests-only restructure; the full geotiff suite passes (5705 passed, 68 skipped, 6 xfailed, 1 xpassed), pytest xrspatial/geotiff/tests/parity/ -v passes (438 passed, 43 skipped), and test_release_gate_2321::test_release_gate_cites_only_existing_test_files is green.
Suggestions
xrspatial/geotiff/tests/parity/test_backend_matrix.py:1057-1066:_FP_GEOREF_KEYSand_FP_NODATA_KEYSare defined but never read after the merge. Only_FP_CANONICAL_METADATA_KEYSis consumed (by_fp_assert_canonical_metadata_attrs). Drop the two unused tuples or wire them into the helper they were meant to drive.xrspatial/geotiff/tests/parity/test_backend_matrix.py:1042-1050:_FP_FIXTURES_DIRis defined only when_HAS_YAML and _HAS_RASTERIO._fp_fixture_path()at line 1274 references it unconditionally. Caller paths are gated, so this works today, but a missing_FP_FIXTURES_DIR = Nonefallback leaves a NameError trap for a future refactor. Add the fallback.xrspatial/geotiff/tests/parity/test_backend_matrix.py:1-13(docstring): says "Covers three layers of parity" but the file is now four sections (high-risk matrix + error sub-matrix, full-corpus parity, canonical-attrs parity, pass-through TIFF tag parity). Update the count or list each section.xrspatial/geotiff/tests/parity/test_backend_matrix.py: the appended Full-Parity section uses_fp_prefix and the Attrs section uses_ap_prefix; the base matrix section uses no prefix. Fine for collision avoidance, but_fp_is_nan_sentineletc. duplicate logic already present in the base section. Either rename the duplicates or replace them with calls into the base helpers.xrspatial/geotiff/tests/CLUSTER_AUDIT_PR4.md: needs deleting in a final commit before approval, per the audit plan. Make sure that lands.xrspatial/geotiff/tests/parity/test_pixel_equality.pymodule docstring (lines 3-16): the bullet list has four items but the sentence above says "three concerns share the file". Fix the count.
Nits
xrspatial/geotiff/tests/parity/test_pixel_equality.py:27:from pathlib import Pathis now used only twice. Inline the type hint or leave as-is.xrspatial/geotiff/tests/parity/test_backend_matrix.py:65-66:from pathlib import Pathis imported alongsideimport pathlib. One is redundant.Pathis used in type hints;pathlibis used by the appended FP section. Pick one.- Both consolidated files redeclare a per-file
_skip_no_gpueven though_helpers/markers.pyalready exportsrequires_gpufor the same purpose. Switch to the shared marker in a follow-up to remove the duplication (skip-reason wording differs slightly, so the swap needs a deliberate decision). xrspatial/geotiff/tests/parity/test_backend_matrix.py:1140-1158: the_fp_read_*functions all take a_fixture_idparameter they ignore. Use*_instead of named-and-ignored.
What looks good
- The base matrix harness and the error sub-matrix moved verbatim, so parametrize ids stay stable for anyone tracking failures across the rename.
- Markers source-of-truth is now
_helpers/markers.py; the per-file_gpu_available()duplicates are gone in both consolidated files. - Release-gate doc citations got updated, and
test_release_gate_2321::test_release_gate_cites_only_existing_test_filesverifies the move at collection time. Future test renames will fail loudly. CLUSTER_AUDIT_PR4.mdtraces every old test id to a new one and justifies the one dropped row (test_backend_specific_keys_carveout_is_documented).- The
_fp_/_ap_namespacing on appended internals avoids collisions with the base section's_materialise,_BACKENDS,_FIXTURES, etc.
Checklist
- Algorithm matches reference -- tests-only restructure, no algorithm changes.
- All implemented backends produce consistent results -- the consolidated suite is itself the parity gate; 438 parity tests pass.
- NaN handling is correct --
_fp_assert_pixels_closeusesequal_nan=True; the_is_nan_sentinelhelper is unchanged. - Edge cases covered by tests -- inherited from the seven source files; nothing dropped beyond the one documented case.
- Dask chunk boundaries handled correctly -- inherited.
- No premature materialization or unnecessary copies -- inherited.
- Benchmark exists or is not needed -- not needed (test reorganisation).
- README feature matrix updated -- not applicable.
- Docstrings present and accurate -- mostly, see the "three layers" / "three concerns" nits.
* Fix module docstrings on test_backend_matrix.py and test_pixel_equality.py: three -> four sections. * Drop unused _FP_GEOREF_KEYS and _FP_NODATA_KEYS constants; only _FP_CANONICAL_METADATA_KEYS is consumed. * Add _FP_FIXTURES_DIR = None fallback so the gated path never raises NameError if a future refactor drops the guard. * Replace per-file _skip_no_gpu definition with the shared requires_gpu marker from _helpers/markers.py in both files. * Replace the ignored _fixture_id parameter on _fp_read_* with *_ so the unused-arg signal is gone. * Drop redundant ``from pathlib import Path`` in test_backend_matrix.py; alias Path = pathlib.Path to keep existing signatures working.
brendancol
commented
May 26, 2026
Contributor
Author
brendancol
left a comment
There was a problem hiding this comment.
Follow-up review (post-fix)
Disposition of original findings
Suggestions:
- Unused
_FP_GEOREF_KEYS/_FP_NODATA_KEYS: fixed. Both tuples removed (commit a3b5137). _FP_FIXTURES_DIRNameError trap: fixed. Added_FP_FIXTURES_DIR = Nonefallback in the else branch.- "three layers" docstring drift on test_backend_matrix.py: fixed. Now lists the four sections.
- Helper duplication (
_fp_is_nan_sentineletc.): dismissed. After a second pass, the FP/AP helpers use different tolerance and sentinel semantics from the base section's helpers; the base section does not actually define_is_nan_sentinel, so there is nothing to deduplicate. No code change. CLUSTER_AUDIT_PR4.mddeletion: fixed. Deleted in commit 8d249d2.- "three concerns" docstring on test_pixel_equality.py: fixed.
Nits:
- Redundant
from pathlib import Pathalongsideimport pathlib: fixed. AliasedPath = pathlib.Pathafter the imports. Pathimport in test_pixel_equality.py only used twice: dismissed. Used in fixture builder signatures; inliningpathlib.Patheverywhere is noisier than keeping the alias.- Per-file
_skip_no_gpuvs sharedrequires_gpu: fixed. Both files now_skip_no_gpu = requires_gpufrom_helpers/markers.py. _fixture_idunused parameter on_fp_read_*: fixed. Signature is now(path, *_).
Other actions
- Merged
origin/main(a8e73cc) into the branch; no conflicts. pytest xrspatial/geotiff/tests/parity/ -q: 438 passed, 43 skipped.
No new findings.
# Conflicts: # docs/source/reference/release_gate_geotiff.rst
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2398. Part of epic #2390 (PR 4).
Summary
Fold the backend-parity cluster, the largest by line count in the geotiff test suite, into
parity/test_backend_matrix.pyandparity/test_pixel_equality.py.Folded files (deleted in this PR):
test_backend_parity_matrix.py(matrix harness, error sub-matrix)test_backend_full_parity_2211.py(golden-corpus full-parity gate)test_backend_pixel_parity_matrix_1813.py(strict pixel-byte parity + cross-entry-point routing)test_backend_kwarg_parity_1561.py(kwarg threading through the dispatcher)test_attrs_finalization_parity_2211.py(canonical attrs parity across eager/dask/GPU/VRT)test_attrs_parity_1548.py(pass-through TIFF tag attrs parity across 4 backends)test_miniswhite_backend_parity_1797.py(MinIsWhite local/dask/HTTP/GPU parity)Left for later:
test_vrt_backend_parity_2321.py, VRT-specific, picked up by PR 6.Notes
_helpers/markers.py; the local_gpu_available()duplicates were removed.numpy-int16-single-band,stripped-uint8-none), no issue numbers in ids._fp_(full parity) and_ap_(attrs parity) prefixes to avoid name clashes with the base harnesses.docs/source/reference/release_gate_geotiff.rstrows that cited old paths now point at the consolidated files;test_release_gate_2321::test_release_gate_cites_only_existing_test_filesverifies this.CLUSTER_AUDIT_PR4.mdmaps old to new test ids. Deleted in a final commit before approval.Verification
Backend coverage: numpy, cupy, dask+numpy, dask+cupy, VRT, HTTP/fsspec. GPU and dask+GPU rows skip explicitly with a loud reason when cupy + CUDA are unavailable.
Test plan
pytest xrspatial/geotiff/tests/parity/ -vpassespytest xrspatial/geotiff/tests/ -x -qpassestest_release_gate_2321::test_release_gate_cites_only_existing_test_filespassesgit diff --statshows old cluster files deleted, not left behind