tools: guard ps_helper_probe.py empty coverage and atomic --json writes #1793
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!1793
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/ps-helper-probe-safety"
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 successfully merged and closed
Claimed in the coordination issue as: PS-HELPER-PROBE-EMPTY-COVERAGE-AND-ATOMIC-JSON (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7162059721)
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).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).