mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:25:52 +01:00
[PR #1614] d16_image_probe: validate --json upfront, write reports atomically, and harden --formats/--waves (D16-IMAGE-PROBE-JSON-AND-CLI) #1628
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1628
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1614
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/d16-image-probe-json-and-cli📝 Commits (1)
40c66fdd16_image_probe: validate --json upfront, write reports atomically, and harden --formats/--waves📊 Changes
2 files changed (+208 additions, -13 deletions)
View changed files
📝
tests/test_d16_image_probe.py(+94 -5)📝
tools/d16_image_probe.py(+114 -8)📄 Description
Item ID:
D16-IMAGE-PROBE-JSON-AND-CLI(unlisted; coordination issue #14 is at GitHub's 2,500-comment cap with no open successor at submission time, and no open PR touchestools/d16_image_probe.py).What changed
--jsonupfront before opening the hardware oracle (tools/d16_image_probe.py,validate_json_path): reject empty/whitespace paths (previously--json ""was silently ignored and--json " "wrote a literal whitespace file), NUL bytes, directories / trailing separators, and non-directory parent ancestors with exit code2before launching any GPU sweep.--jsonreports atomically and handleOSErrorcleanly (write_json_report): create missing parent directories, resolve symlinks to update targets in place, write non-regular targets (/dev/null) directly, checkO_WRONLYon existing regular files before staging, stage withfile_mode.published_mode+replace_retry.replace, enforceallow_nan=Falseand trailing\n, clean up staging files on failure, and return exit2instead of an unhandled traceback.--formatsand--wavesparsing (main): reject empty comma tokens (e.g.--formats "",--formats unorm8,,--waves 32,) with the right option name (previously--formats ""reported--frac must be in (0, 1)), strip whitespace around tokens, and deduplicate repeated formats/waves so--waves 32,32does not run wave32 twice or emit spurious self-comparisonwaves_differentries.tests/test_d16_image_probe.py): 3 new tests plus expandedtest_bad_arguments_are_a_usage_errorcovering all of the above (no game files, no GPU).Verification
KernelsandOnHardwareskipped without AMD clang / GFX10 GPU)python3 -W error -I tests/test_d16_image_probe.py -v: 14 passed, 2 skippedpython3 -W error -I tests/test_text_write_line_endings.py: passedpython3 -I scripts/check_no_game_data.py tools/d16_image_probe.py tests/test_d16_image_probe.py: cleanpython3 -m compileall -q tools/d16_image_probe.py tests/test_d16_image_probe.py: cleanClisuite oftests/test_d16_image_probe.pyagainst unpatchedmain:tools/d16_image_probe.py): 9 failures, 2 errors across the 5 CLI tests.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.