mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:15:51 +01:00
[PR #1664] d16_format_probe: harden CLI parsing, atomic JSON write, and unknown-arch exit #1678
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#1678
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/1664
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/d16-format-probe-json-and-cli📝 Commits (1)
7330209d16_format_probe: harden CLI parsing, atomic JSON write, and unknown-arch exit📊 Changes
2 files changed (+175 additions, -13 deletions)
View changed files
📝
tests/test_d16_format_probe.py(+87 -0)📝
tools/d16_format_probe.py(+88 -13)📄 Description
Item ID:
D16-FORMAT-PROBE-JSON-AND-CLI(claimed in https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7155954875)Summary
tools/d16_format_probe.py):--hw-archand--jsonvalues with argparse exit code2.--formatsand--wavesentries, reject empty/trailing-comma tokens (unorm8,,,64), and deduplicate repeated formats/waves while preserving order so the GPU sweep does not execute duplicate work.--jsonvalidation & atomic report writing:validate_report_path()and called it before opening the hardware oracle so a blocked parent path (e.g. a regular file ancestor) fails fast withERROR: cannot write ...(exit2) without running the GPU sweep, while preserving the existingap.errordirectory check.write_report()to serialize strictly (allow_nan=False) with a trailing, support non-regular targets like/dev/null, preserve symlink targets and existing file mode viafile_mode.published_mode(), fsync temp files, and atomically replace viareplace_retry.replace().ValueErrorfromasm.family(oracle.arch)inside thetry/finallyblock so unknown architectures close the oracle cleanly and exit77instead of raising an unhandled traceback.tests/test_d16_format_probe.py):--jsonparent fail-fast before opening the oracle, empty/malformed CLI tokens & deduplication & unknown-arch exit77, and atomic write behavior (symlink/mode preservation, trailing LF,/dev/null, andNaNrejection without clobbering existing output).Checklist & Verification
python3 -I scripts/check_no_game_data.py tools/d16_format_probe.py tests/test_d16_format_probe.pypassed)python3 -W error -I tests/test_d16_format_probe.py:Ran 26 tests ... OK (skipped=2)tests/test_d16_format_probe.pyagainst unpatchedmaintools/d16_format_probe.py):Ran 26 tests ... FAILED (failures=10, errors=1, skipped=2)python3 -m compileall -q make_game.py tools tests: passedpython3 -I tests/test_text_write_line_endings.py:Ran 3 tests ... OK🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
ref = {}releases (TEST-REF-MOVE-ONLY) #1771