cvt_norm_mods_probe: upfront atomic JSON validation, RuntimeError handling, and result count guard #1638
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1638"
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:42:38Z.
Item ID:
CVT-NORM-MODS-PROBE-JSON-AND-GUARDSClaim: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7155043403
Summary
Harden JSON reporting, CLI validation, and harness error handling in
tools/cvt_norm_mods_probe.py:--jsonvalidation (validate_json_path): reject empty/whitespace paths, directories, trailing path separators, non-directory parent blockers, and unwritable existing files with exit2before openinghw_oracle(previously--json " "created a literal whitespace file and non-directory parent blockers only failed after running all GPU sweeps).write_json_report): serialize upfront withallow_nan=Falseand LF endings, handle non-regular targets like/dev/nulldirectly, resolve symlinks before staging to preserve symlink targets, applyfile_mode.published_mode, and publish viareplace_retry.replace.--hw-archupfront (exit2).RuntimeErrorfromoracle.run()cleanly (harness error: ..., exit2) while still closing the oracle infinally.len(raw_results) != len(meta)inevaluate_results()as a harness error instead of silently truncating viazip()and reportingmismatches=0.tests/test_cvt_norm_mods_probe.py): added 3 test methods covering upfront--json/--hw-archvalidation, atomic/symlink/NaN//dev/nullwrites, result count mismatch, andRuntimeErrorhandling.Verification
python3 -W error -I tests/test_cvt_norm_mods_probe.py -v: 15 passed, 2 skipped (AMD clang / llvm-mc absent)main:ran=17 failures=1 errors=6 (skipped=2)python3 -I tests/test_text_write_line_endings.py: 3/3 passedpython3 -I scripts/check_no_game_data.py tools/cvt_norm_mods_probe.py tests/test_cvt_norm_mods_probe.py: passedpython3 -m compileall -q tools/cvt_norm_mods_probe.py tests/test_cvt_norm_mods_probe.py: passedImported from ubiquitarianism/leonida. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T06:42:46Z.
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 whoalin1 on 2026-11-25T10:01:41Z.
Independent verification (Windows, Python 3.11.9
-I -W error):--jsonvalidated beforeopen_oracle(test asserts oracle never opened),--hw-archempty guard, oracle RuntimeError -> harness error exit 2 with finally-close, result-count mismatch now yields aharness_errorsentry instead of silent zip truncation, atomic write pattern identical to the verified series.test_cvt_norm_mods_probe.py17 OK (2 env skips, matches body); bad-CLI probes 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:27:01Z.
#1638 | head
61949ea7e90952d7b9a4d25ede9053b4cfcabd50|python3 -I tests/test_cvt_norm_mods_probe.py -v| red: 17 run, 1 failure, 6 errors | green: 17 passed | Red → greenThe merged file passed all CLI, report and reference-model tests, including the AMD clang and llvm-mc assembly checks.
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:45Z.
Merged, thank you @IlyassRS3! This PR (cvt_norm_mods_probe: upfront atomic JSON validation, RuntimeError handling, and result count guard) 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.