Repository navigation
d3d12: a guard page fails a copy and stays a guard page (D3D12-GPU-SAFECOPY-GUARD-PAGE-REARM) - #2709
Conversation
…_* variables d3d12/docs/findings.md was reachable from d3d12/README.md alone, so a night of runs repeated measurements it already holds. Index it, point AGENTS.md at it, say how to measure (a switch by turns inside one run), and list the variables the runtime names from its own sources: 415 of 669 were in no Markdown file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The launcher column saw one way of assigning of four, three kinds were wrong, names read by turns through a constant, a function or asked_for! were missing, and test modules with a brace in a raw string were cut short. measuring_fps.md now says how to give LEONIDA_AB to the launcher and what GPU_TIMING and PROFILE need. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/test_tool_stdout_encoding.py asks it of every tool. d3d12_run_fps.py came in with ProjectLeonida#2594 without it, which left that test red on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Title memory has guard pages: stack guards, and guards the title sets up itself. A copy, put or merge of title memory (safecopy, under the write-catch handler in watch.rs) that touched one took STATUS_GUARD_PAGE_VIOLATION, which clears the page's guard flag. The handler sent every fault inside a copy to the copy's failing exit, whatever the code, and nothing set the flag again: the page stayed an ordinary page, so the title's next touch of it no longer raised the guard fault it was set up for. A guard fault inside a copy now sets the guard flag again on its page, with the protection the page has, and fails the copy as before. The re-arm checks that the page is still committed and that VirtualProtect succeeds; a re-arm that fails, or a guard fault with no address, is counted (NOT_REARMED) and the first one is logged. A guard fault outside a copy still goes on to the next handler. Tests: the source and destination cases for copy, put and merge (all four fail on main with "...cleared the guard flag" / "the guard flag was consumed"), and a_page_that_cannot_be_guarded_again_is_counted. Port of zocram4cc's fix and tests in the sibling VIctory tree (TaynanGT/Vice-Tay fa11650 and c277533, GPL-3.0). Co-Authored-By: zocram4cc <79211006+zocram4cc@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent Wine verification. I merged
CPU tests using synthetic allocations. AI-assisted with OpenAI Codex. |
…ring docs: how to measure the D3D12 runtime's frame rates, and its LEONIDA_* variables (DOCS-D3D12-MEASURING)
|
Merged AI-assisted: yes |
|
Independent check on Windows (not the author), at
The PR's diff adds no unit test (source-only in Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711, NVIDIA RTX 4070 Ti SUPER (driver 621.01), Rust 1.98.1 pinned. AI-assisted: yes (opencode). |
|
Verified on Windows, for a merge (not the author). AI-assisted (Claude Code agent Head
One run of several pull requests together covers each at its head ( |
|
Merging (after #2589, #2766). Head |
Claimed in the coordination issue as: D3D12-GPU-SAFECOPY-GUARD-PAGE-REARM (#2570 (comment))
What and why
Title memory has guard pages: stack guards, and guards the title sets up itself. When a copy, put or merge of title memory (
safecopy, running under the write-catch handler inwatch.rs) touches one, it takesSTATUS_GUARD_PAGE_VIOLATION, and Windows clears the page's guard flag as it raises that. The handler sent every fault inside a copy to the copy's failing exit, whatever the code, and nothing set the flag again. The page stayed an ordinary page, so the title's own next touch of it no longer raised the guard fault the title set it up for: a stack that can't grow, or a guard the title waits on that never fires.The change:
rearm_guardchecks that the page is still committed and thatVirtualProtectsucceeds. If it can't re-arm, or the fault carried no address, it counts the case inNOT_REARMEDand logs the first one.This is a port of zocram4cc's fix and tests from the sibling VIctory tree (TaynanGT/Vice-Tay
fa11650andc277533, GPL-3.0), credited as co-author. In their traced runs, a lost guard was linked to silent exits a few minutes into the world under Proton. That link is their reading of a trace, not something reproduced here.Tested
safecopy::tests: a guard page in the source of a copy, and in the destination of a copy, a put and a merge. Each checks that the call fails and the page is still a guard page. Onmain(454df8e) all four fail on native Windows ("the guard flag was consumed" / "...cleared the guard flag"); with the change they pass.watch::rearm_tests::a_page_that_cannot_be_guarded_again_is_counted: a committed page is guarded again, a decommitted one is not, and both that case and a fault with no address are counted.cargo test -p leonida-gpu --lib: 564 passed, 0 failed, 50 ignored.cargo clippy -p leonida-gpu --all-targets(with and without--all-features): no warning in the changed lines. The warningswatch.rsalready has are untouched.GPUs tested: n/a (CPU unit tests)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code