tools/buffer_store_probe: write --json report atomically (BUFFER-STORE-PROBE-ATOMIC-JSON) #1998
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1998"
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:53:26Z.
Claimed in the coordination issue as: BUFFER-STORE-PROBE-ATOMIC-JSON (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7170105485)
What and why
Updates \ ools/buffer_store_probe.py::write_json_report\ to write via a sibling \ empfile.NamedTemporaryFile(..., encoding="utf-8", newline="\n")\ and \os.replace\ (with temp-file cleanup on failure), so an existing report is never truncated on error. Adds a regression test in \ ests/test_buffer_store_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-25T19:10:31Z.
Review: APPROVED
Verified on the PR branch: python3 -m unittest discover -s tests -p 'test_buffer_store_probe*.py' -> 10 tests OK, including the new atomic-write/replace-failure preservation test and the retargeted disk-full OSError test. write_json_report now stages through NamedTemporaryFile and os.replace, so a failure leaves any previous report untouched. Advisory: branch carries ~29 older commits not on current main; rebase before merge for clean history.
Imported from ubiquitarianism/leonida. Originally posted by sodove on 2026-11-28T10:11:28Z.
#1998 | head
cac1f1fe993052690f9f9e0439622162a23ca8d2|python3 -I tests/test_buffer_store_probe.py -v| red: 10 run, 1 failure, 1 error | green: 13 passed | Red → greenThe atomic-write and output-error cases failed on main. The merged test file also picked up additional tests from main.
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:25Z.
Merged, thank you @Ch1mpleo!
What it does: tools/buffer_store_probe: write --json report atomically (BUFFER-STORE-PROBE-ATOMIC-JSON)
How it was checked: sodove tested this PR at head
cac1f1fe9on 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 (1 failure, 1 error); with the PR, green (13 OK).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.