buffer_swizzle_probe: upfront atomic JSON validation, CLI guards, and translator wave parity #1634
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1634"
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-25T06:36:13Z.
Item ID:
BUFFER-SWIZZLE-PROBE-JSON-AND-CLIClaim: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7154914906
Summary
Harden CLI validation, JSON report writing, and result classification in
tools/buffer_swizzle_probe.py:--jsonvalidation (validate_json_path): reject empty/whitespace paths, directories, trailing path separators, non-directory parent blockers, and unwritable existing files with exit2before running translator or GPU sweeps (previously--json ""was silently ignored,--json " "created a literal whitespace file, and directory/parent failures only errored after running all sweeps).write_json_report): serialize upfront withallow_nan=Falseand LF endings, handle non-regular targets like/dev/nulldirectly, preserve symlink targets by resolving links before staging, applyfile_mode.published_mode, and publish viareplace_retry.replace.--groupand--hw-archupfront (exit2), deduplicate unknown group diagnostics, check string harnessERRORs before wave comparisons so a compile failure in one wave reportsERRORinstead ofWAVE_DIFF, and enforce wave32/64 parity (WAVE_DIFF/WAVE_SAME) in--oracle translatormode as well as hardware mode.tests/test_buffer_swizzle_probe.py): added 4 test methods covering upfront--jsonvalidation, atomic/symlink/NaN//dev/nullwrites, empty--group/--hw-arch, translator wave parity, and error precedence.Verification
python3 -W error -I tests/test_buffer_swizzle_probe.py -v: 12/12 passedmain:ran=12 failures=3 errors=7python3 -I tests/test_text_write_line_endings.py: 3/3 passedpython3 -I scripts/check_no_game_data.py tools/buffer_swizzle_probe.py tests/test_buffer_swizzle_probe.py: passedpython3 -m compileall -q tools/buffer_swizzle_probe.py tests/test_buffer_swizzle_probe.py: passedImported from ubiquitarianism/leonida. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T06:36:24Z.
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 GeorgiyDemo on 2026-11-25T06:50:23Z.
Tested
deae588bcon Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), againstmain42537e7b6(Python GPU probe; hardware oracle not run):tests/test_buffer_swizzle_probe.py: 12 passed, 10 subtests passed at this head.main: 10 failed, 10 passed, 2 subtests — the upfront--jsonvalidation, CLI guards, translator wave parity and atomic-report handling are not there.AI-assisted; synthetic fixtures only, no game data.
Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-25T10:01:25Z.
Independent verification (Windows, Python 3.11.9
-I -W error): upfront--jsonvalidation rejects bad paths pre-oracle (live-probed), atomic write via mkstemp+published_mode+replace_retry symlink-aware, CLI guards, and the "translator wave parity" claim is real —run_translatorper-wave dicts get WAVE_DIFF/WAVE_SAME when hw waves absent, string harness errors take precedence,hw_refpicks the mismatched wave's result.test_buffer_swizzle_probe.py12 OK;--self-test22 cases ok; live--oracle translatorrun produced valid LF JSON; bad-CLI all exit 2; compileall + line-endings + check_no_game_data clean. AI-assisted verification.Imported from ubiquitarianism/leonida. Originally posted by sodove on 2026-11-28T11:26:56Z.
#1634 | head
deae588bccf900026bbd7da5678eecf92c682eb0|python3 -I tests/test_buffer_swizzle_probe.py -v| red: 12 run, 3 failures, 7 errors | green: 12 passed | Red → greenThe suite reproduced validation and output/report handling failures on main, then passed all 12 tests, including the translator wave-parity case.
Copied the PR tests onto clean main
4a54aedcb6b66525e0c9f72a6ea10263337c9141for the baseline, then merged that main into the recorded PR head and reran those files. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Unittest failure/error counts include subtests where applicable. AI-assisted with OpenAI Codex. Batch claim.Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T11:43:03Z.
Merged, thank you @IlyassRS3! This PR (buffer_swizzle_probe: upfront atomic JSON validation, CLI guards, and translator wave parity) passed its own tests with main merged in during sodove's verification of this shader batch, so it went in with the batch.
AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.