mask_channels: validate dimensions/buffers and --json paths, preserve symlinks and /dev/null (MASK-CHANNELS-VALIDATION-AND-ATOMIC-IO) #1597
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1597"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by IlyassRS3 on 2026-11-25T05:30:08Z.
Item:
MASK-CHANNELS-VALIDATION-AND-ATOMIC-IO(unclaimed — coordination issue #14 is at GitHub's 2,500-comment cap with no successor open issue yet, and 0 open PRs touchtools/mask_channels.py).Summary
blobs()(len(mask) == width * height) andchannel_counts()(len(rgba) == width * height * 4) so zero/negative/mismatched inputs raiseValueErrorinstead ofZeroDivisionErroror silently skewed statistics.--jsonbefore decoding the DDS texture: reject empty/whitespace strings (""," ") and trailing-separator directory paths (new_dir/).--jsonpublishing via_write_json_report(): resolve symlinks so symlinked report paths update their target in place, write non-regular targets (such as/dev/null) directly, check write permissions on existing regular files before staging, usereplace_retry.replacewithallow_nan=Falseand trailing\n, and publish before printing stdout.Verification
python3 -W error -I tests/test_mask_channels.py -v: 13/13 passed.python3 -I tests/test_text_write_line_endings.py: 3/3 passed.python3 -I scripts/check_no_game_data.py tools/mask_channels.py tests/test_mask_channels.py: passed.python3 -m compileall -q tools/mask_channels.py tests/test_mask_channels.py: passed.tests/test_mask_channels.pyagainst unpatchedmain:tools/mask_channels.py):failures=10, errors=0across all 4 new regression tests.AI-assisted: yes
GPUs tested: none (CPU-only Python texture-mask analysis tool; synthetic RGBA8 DDS only, no game data)
Imported from ubiquitarianism/leonida. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T05:30:19Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T10:33:49Z.
Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18).
Targeted batch of 18 PRs (their tests, the tests importing the changed modules, the docs tests) on main
3ca0707: no new failure, Linux / Python 3.13.AI-assisted (Claude Code, Claude Opus 5.5)