tools/ps_helper_probe: validate --json upfront and write atomically (PS-HELPER-PROBE-ATOMIC-JSON) #1997
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1997"
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 Ch1mpleo on 2026-11-25T17:52:16Z.
Claimed in the coordination issue as: PS-HELPER-PROBE-ATOMIC-JSON (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7170082835)
What and why
Adds \alidate_json_path\ and atomic \write_json_report\ (with \NamedTemporaryFile(..., newline="\n")\ +
eplace_retry\ and temp-file cleanup on failure) to \ ools/ps_helper_probe.py, validating --json\ upfront before \measure(), plus regression tests in \ ests/test_ps_helper_probe.py.
Tested
GPUs tested: n/a (CPU-only Python tool & unit tests)
AI-assisted: yes
Checklist
eeds rebase).
Imported from ubiquitarianism/leonida. Originally posted by MSedgeMC on 2026-11-25T18:58:10Z.
Review: COMMENTED
Verified on the PR branch: both NEW tests pass individually (tests.test_ps_helper_probe.CliAndJsonTests.test_validate_json_path_and_upfront_refusal and .test_atomic_json_write_and_replace_failure_preserves_existing -> 1 test OK each). The upfront --json path validation and staging+os.replace write are sound. However the full branch suite is red: python3 -m unittest discover -s tests -p 'test_ps_helper_probe*.py' -> 12 tests, 1 failure in test_symlinked_json_updates_target_in_place (os.path.islink false). That test is NOT on current main (branch carries ~29 older commits); main's own 6 tests pass with 1 skip. Please rebase onto current main and confirm green before merge — I'm not approving a red branch.
Imported from ubiquitarianism/leonida. Originally posted by Ch1mpleo on 2026-11-25T19:37:17Z.
Thanks @MSedgeMC — \write_json_report\ now delegates directly to _write_json_atomic\ so symlinked --json\ targets are updated in place via \os.path.realpath. Re-verified: \python -I tests/test_ps_helper_probe.py\ (12 tests: 10 passed, 2 hardware tests skipped on Windows).
Imported from ubiquitarianism/leonida. Originally posted by sodove on 2026-11-28T10:11:24Z.
#1997 | head
d198dd508ecf9cb9e64ca6141d5fe5efc38272b8|python3 -I tests/test_ps_helper_probe.py -v| red: 12 run, 2 errors, 1 skip | green: 11 passed, 1 skipped | Baseline exception → passThe baseline raised errors in the new JSON-output tests. The optional live pixel-shader hardware-oracle case skipped on both sides in WSL. The reported pass covers the remaining checks.
Pinned main
33db04a7010e81c40a7a6a15624525aa0c4a3a58, merged into this PR head. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Full suite: not run. AI-assisted: OpenAI Codex. Batch claim.Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T10:48:58Z.
Merged, thank you @Ch1mpleo!
What it does: tools/ps_helper_probe: validate --json upfront and write atomically (PS-HELPER-PROBE-ATOMIC-JSON)
How it was checked: sodove tested this PR at head
d198dd508on main33db04a70: the PR's own test fails on main and passes with this PR merged in (his result is linked from the batch summary in #1608). We then re-ran the same test locally on Windows 11 and got the same verdict: on main, red (2 errors); with the PR, green (12 OK, 2 skips).CI: the red jobs on this PR fail the same way on main, or on the older main it was built on (the
cs_dpp_cmp.asmtranslator fixture, since fixed on main, and the Windows runner's Visual Studio setup), so none comes from this change.Merged one by one with 20 other PRs of the same reviewed batch, pinned to the tested head.
AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.