Repository navigation
fix(#84): hygiene sweep — audit P2+P3, areas a1-a8 - #135
Merged
Merged
Conversation
added 2 commits
October 16, 2026 16:31
2026-10-09 audit: 51 P2 + 29 P3 findings, worked area by area. Most items behaviour-preserving (full suite green, bench/check_anchors.py byte-identical); the intended behaviour changes are pinned in tests/test_audit_84.py (+45, 552 -> 597). a1 CLI: --compress preflight (exit 2) + written-tag readback; --out '' exit 2; malformed --calibration named exit 2; non-numeric column named; --plan text header + workers/max-band-parallel split (turbo n_threads label); idwgrid -m guard; README table rows. a2 ingest: corrupt parquet exit 1; dup role columns exit 2; mapping RuntimeError; row-count mismatch warn; all-missing-columns one pass; __init__ rejects the five named kwargs in the **kwargs slot. a3 grid/reproject: count-accumulation lock scoped; non-default CRS pair one-shot warn; --force-memmap documented; staging names via constants (_support_tmp.tif asymmetry pinned — the a1 derivation had silently dropped it from the run-temp cleanup set, caught by two full-suite residue failures). a4 turbo: wall range keyed on regime+workers; hard-kill temp globs; classic 4GiB guard on DST size; cgroup-v1 docstring; per-box in-flight count; __all__; failed turbo run discards fresh calibration.json; presets derived from SIZING_TABLE. a5 pullpush: grid_index_mt for workers>1; saturation<=0 ValueError; downsample_sum shape validation; copy=False; shared _level_support_m. a6 compression: CPLCompressor nStructVersion check before pfn read; _decompressor() round-trip probe; _open_fresh_memmap dir -> ValueError; _gdal_path message; docstrings (stock GTiff ZSTD tiles, probe-sized files). a7 calibrate: fill cap in the transform space actually used (forced transforms no longer get a cap tuned in the auto space); transform_state / percentile_quantiles LUT pairing; per-bin CV rows ship in calibration.json (per-block cap_km copies dropped — file format change, anchor regenerated); explicit calibrate_fill_cap kwargs; icc/CVDetail/CVCurve removed; _p cached. a8 tests/docs: CHANGELOG deltas fixed (+27 -> +29); DESIGN-sparse-output section 11 lost-harness note; auto-anchor test compares decoded arrays + exact metadata (byte gate stays in bench/check_anchors.py); all six melb resolutions anchored (25/50/100/250m were unanchored); non-ZSTD --compress e2e round-trip pins (all six codecs); bench harnesses: lazy tempdir + bench/_helpers.py (no tests-package import); a2 pin's fork DeprecationWarning contained (default run ends with an empty warnings summary). Also fixed along the way: order-dependent logging failures — rebind_ppgrid_streams() in main() rebinds the rich handler to the live sys.stderr before config applies (pre-existing bug, not #84-introduced). Gates: pytest 595 passed / 2 skipped; bench/check_anchors.py PASS (byte-identical, 12 melb rasters); ruff: 3 pre-existing baseline findings, zero new.
…ocstring, old-format pin Review 20261016-043442-2332603 PASS, five minors: 1. a1 bullet declares the run_summary raw_bytes/compression_ratio semantic change (final output-CRS raster, not the work grid) + the plan disk_bytes divergence. 2. Test-count line corrected post-rebase: 578 -> 624 (+46). 3. _raw_csv_header_names docstring now matches behaviour (quoted multi-line header yields the partial first-line list, not None). 4. a2/a3 wording: named parameters (not a **kwargs slot), the PPGRID_FORCE_MEMMAP env var (not a --force-memmap flag), work/out not the 6933/3857 default (src irrelevant to the tile-skip premise). 5. New pin test_a7_old_format_calibration_loads: pre-#84 calibration.json (per-block cap_km, no rows) still validates, rebuilds, and fwd/inv round-trips — the 'older files load unchanged' claim.
…d ValueError Linux unlink(2) on a directory returns EISDIR (IsADirectoryError, already handled); BSD/macOS returns EPERM (PermissionError), which propagated and failed test_a6_memmap_dir_path_raises_valueerror on all four macOS CI runners. Catch PermissionError too, disambiguate with is_dir() so a genuine permission error on a regular file still propagates. New pin test_a6_memmap_dir_eperm_maps_to_valueerror exercises the BSD branch on every platform via a monkeypatched Path.unlink. (#84; PR #135)
marzukia
approved these changes
Oct 16, 2026
Merged
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.
Issue #84 (2026-10-09 audit): 51 P2 + 29 P3 findings, areas a1-a8. 1 commit + review-minor follow-up, 29 files, +1700/-250 vs main.
Intended behaviour changes (each pinned in tests/test_audit_84.py, +46 tests)
--compresscodec → exit 2 + written-tag readback guard; empty--out→ exit 2; malformed--calibration→ named exit 2; non-numeric role columns named in the error;run_summaryvolumetrics now sized from the final output-CRS raster (was the work grid).Pipelinerejects the five named typos as unexpected keywords (were silently ignored).PPGRID_FORCE_MEMMAPdocumented.grid_index_mtactually used forworkers > 1(provably bit-identical to the serial index, reviewer-verified);saturation <= 0→ ValueError;downsample_sumshape-validated._decompressorround-trip probed; dir-path → named ValueError.transform_state/percentile_quantilesLUTs always agree (was mismatched in one forced-percentile path);calibration.jsonformat change (per-bin CV rows, per-block cap_km copies dropped — anchor regenerated; older files load unchanged, now pinned).Bonus: pre-existing order-dependent logging failure fixed (
rebind_ppgrid_streams()inmain()).Review (adversarial, behaviour-drift lens)
20261016-043442-2332603— PASS, zero blockers/majors. Reviewer re-ran all gates (621 passed/2 skipped macOS-only, anchors byte-identical on all six melb resolutions, ruff 0.16.2 clean). Five minors + one info — all five applied in the follow-up commit (CHANGELOG wording, raw_bytes declaration, docstring fix, old-format load pin).Gates (final tip)
Base is the rewritten main (
6cd1d2b, the monky→monkytheluffy identity fix; content-identical to pre-rewrite main).