[PR #2004] tools/f16_widen_probe: write --json report atomically (F16-WIDEN-PROBE-ATOMIC-JSON) #2012

Open
opened 2026-11-26 21:19:44 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2004
Author: @Ch1mpleo
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: fix/f16-widen-probe-atomic-json


📝 Commits (1)

  • c97e981 tools/f16_widen_probe: write --json report atomically (F16-WIDEN-PROBE-ATOMIC-JSON)

📊 Changes

2 files changed (+35 additions, -2 deletions)

View changed files

📝 tests/test_f16_widen_probe.py (+20 -1)
📝 tools/f16_widen_probe.py (+15 -1)

📄 Description

Claimed in the coordination issue as: F16-WIDEN-PROBE-ATOMIC-JSON (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7170181036)

What and why

Updates \ ools/f16_widen_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. Updates the OSError test and adds an atomic-replace regression test in \ ests/test_f16_widen_probe.py.

Tested

  • \python -m compileall -q tools/f16_widen_probe.py tests/test_f16_widen_probe.py\ — exit 0.
  • \python -I tests/test_f16_widen_probe.py\ — 12 tests, OK (Windows 11 x64, Python 3.14.7).
  • \python -I scripts/check_no_game_data.py tools/f16_widen_probe.py tests/test_f16_widen_probe.py\ — exit 0.

GPUs tested: n/a (CPU-only Python tool & unit tests)

AI-assisted: yes

Checklist

  • Based on current \main\ and merges cleanly (a conflicting pull request is labeled
    eeds rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of \docs/design.md, with how it was confirmed. (n/a — no translator change)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/2004 **Author:** [@Ch1mpleo](https://github.com/Ch1mpleo) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/f16-widen-probe-atomic-json` --- ### 📝 Commits (1) - [`c97e981`](https://github.com/ubiquitarianism/leonida/commit/c97e981f3661a5d1a64b29277ca53e75795924c8) tools/f16_widen_probe: write --json report atomically (F16-WIDEN-PROBE-ATOMIC-JSON) ### 📊 Changes **2 files changed** (+35 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_f16_widen_probe.py` (+20 -1) 📝 `tools/f16_widen_probe.py` (+15 -1) </details> ### 📄 Description Claimed in the coordination issue as: F16-WIDEN-PROBE-ATOMIC-JSON (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7170181036) ### What and why Updates \ ools/f16_widen_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. Updates the OSError test and adds an atomic-replace regression test in \ ests/test_f16_widen_probe.py\. ### Tested - \python -m compileall -q tools/f16_widen_probe.py tests/test_f16_widen_probe.py\ — exit 0. - \python -I tests/test_f16_widen_probe.py\ — 12 tests, OK (Windows 11 x64, Python 3.14.7). - \python -I scripts/check_no_game_data.py tools/f16_widen_probe.py tests/test_f16_widen_probe.py\ — exit 0. GPUs tested: n/a (CPU-only Python tool & unit tests) AI-assisted: yes ### Checklist - [x] Based on current \main\ and merges cleanly (a conflicting pull request is labeled \ eeds rebase\). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of \docs/design.md\, with how it was confirmed. (n/a — no translator change) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#2012
No description provided.