tools: guard ps_helper_probe.py empty coverage and atomic --json writes #1793
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!1793
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1793/head"
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?
@kirigayakazima on GitHub · 2026-11-25 12:14 UTC · original
kirigayakazima:fix/ps-helper-probe-safety→main· +198 −31 · 2 files · 1 commits · merged 2026-11-25 17:35 UTCClaimed in the coordination issue as: PS-HELPER-PROBE-EMPTY-COVERAGE-AND-ATOMIC-JSON (#1608)
What and why
tools/ps_helper_probe.py'sanalyze(): avoidValueError: max() iterable argument is emptyand reportFalsefor coverage-dependent checks (entry EXEC,s_wqm, quad packing, lane order, interpolation accuracy, and withouts_wqmEXEC) instead of vacuously passing on empty sets.--jsonbefore opening the GPU oracle (measure()), rejecting empty/whitespace strings, trailing directory separators, existing directories, and non-directory ancestors with exit code2.--jsonatomically (tempfile.mkstempbeside the resolved symlink target, explicitnewline="\n", trailing\n,fsync,published_mode, andreplace_retry), preserving any existing file and cleaning up staging files on failure (exit2, no traceback).tests/test_ps_helper_probe.py.Tested
python -I tests/test_ps_helper_probe.py -v->Ran 10 tests in 0.068s,OK (skipped=1)(hardware test skipped without GPU runtime build; verified in a detachedupstream/mainworktree that the new tests fail before the fix:FAILED (failures=5, errors=2, skipped=1)).python -I tests/test_ci_registration.py->Ran 16 tests in 4.522s,OK.python -I tests/test_text_write_line_endings.py->Ran 3 tests in 12.592s,OK.python -I scripts/check_no_game_data.py tools/ps_helper_probe.py tests/test_ps_helper_probe.py-> exit0.python -I -m compileall -q tools/ps_helper_probe.py tests/test_ps_helper_probe.pyandgit diff --check-> clean.GPUs tested: n/a (CPU/stdlib Python tests on Windows 11 x64)
AI-assisted: yes
Checklist
needs rebase).@madvillain91 on GitHub · 2026-11-25 13:19 UTC · original · reviewed
Independent Windows 11 26H2 (26300.9711) check at
a759e1ebcagainst main384abe5b0(PR base0d80bc5df), using CPython 3.12.3 (python -I) and Git for Windows 2.56.0.windows.2. Passed test_ps_helper_probe.py (8 passed, 2 skipped -- symlink WinError 1314 without SeCreateSymbolicLinkPrivilege and AMD OnHardware gate, 0.077s), test_ci_registration.py (16/16 in 6.279s), and test_text_write_line_endings.py (3/3 in 15.168s), with check_no_game_data.py and compileall clean. Verified empty-coverage analyze() safety (no max() crash or vacuous passes), preflight --json path validation before measure(), and atomic replace_retry JSON writes with trailing LF and cleanup on failure. LGTM.@aslan2142 on GitHub · 2026-11-25 17:35 UTC · original
Merged. Thank you, @kirigayakazima. Empty coverage is guarded, and
--jsonwrites are atomic.mainand pass here; the docs, line-ending and CI/ctest registration checks pass, and so does the game-data check.mainfd33a31a2+a759e1ebc: the semantic suite passes (490 files, 6,292 tests, 0 files failed);test_ps_helper_probepass; the 15 docs and writer tests pass;check_no_game_data.pyis clean on the 2 changed files.AI-assisted (Claude Code, Claude Opus 5.5).