mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:30:52 +01:00
[PR #2262] d3d12_device_calls: validate --out upfront and publish reports atomically #2266
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2266
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2262
Author: @kirigayakazima
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/d3d12-device-calls-safety📝 Commits (1)
6dd813dd3d12_device_calls: validate --out upfront and publish reports atomically📊 Changes
2 files changed (+217 additions, -13 deletions)
View changed files
📝
tests/test_d3d12_device_calls.py(+147 -0)📝
tools/d3d12_device_calls.py(+70 -13)📄 Description
Claimed in the coordination issue as: D3D12-DEVICE-CALLS-UPFRONT-OUT-AND-ATOMIC-REPORTS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7190884297)
What and why
tools/d3d12_device_calls.pypreviously read and scanned the PE image before validating--outorsame_report_path(...), and wrote<image>.device_calls.jsonand.txtdirectly in place withopen(..., "w"). An unusable--outor self-overwrite path wasted a full PE decode (or created an empty--outdirectory on unreadable images), and an interrupted or failing write could truncate or partially update the report pair.--out(non-empty and directory ancestors), input/report path collisions (same_report_path), and directory-occupied report paths before reading or scanning the input image, deferringos.makedirsuntil scan output is ready to write..jsonand.txtoutputs into UTF-8 LF temp files inside--out, copy/probe permissions viafile_mode.published_mode(...), replace both viareplace_retry.replace(...), and clean up any leftover staged files on error.--out/ collision / directory-target errors, unopened invalid images, and preservation of prior reports on staging failure.Tested
python -I tests/test_d3d12_device_calls.py -v(19 tests passed)upstream/mainbaseline negative control: failed with the new CLI tests before the fixpython -I tests/test_ci_registration.py,python -I tests/test_text_write_line_endings.py,python -I scripts/check_no_game_data.py,python -I -m compileall -q, andgit diff --cached --checkGPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.