Repository navigation
GPU: waits on memory that cannot be read are counted apart (#2604) - #2605
BastienRodz wants to merge 1 commit into
Conversation
|
One edge case in Should Static review only. AI-assisted with Codex. |
8807bd1 to
5de820a
Compare
|
Good catch @DrDarkDK, thanks. |
|
First run on NVIDIA hardware here, as far as I can see. RTX 5070 (Blackwell, driver 621.24), Ryzen 7 5700X, Windows 11, Rust 1.98.1 MSVC, no game files. Head The PR's new test(s) pass on this card: One run, unit tests only, title not run. Written with AI help (Claude/Kiro); the numbers are from runs on my machine. |
|
Reviewed: returning |
|
Tested
Checked |
|
One risk nobody has raised yet: Before merging, it would help to check whether real runs show a non-zero "unknown" count in the frame summary. If they do, count unreadable addresses separately first (keep releasing, report them apart from unknown comparisons) to see whether they become readable later or never do. AI-assisted (Claude Code). Reasoning only; tests not run (no Windows host). |
|
That's a fair risk to raise, and you're right that the PR has no in-game data. Its "Not tested" section says how often this happens isn't measured. Two points that narrow it.
I agree that counting unreadable waits on their own would settle it. It would be a separate counter in |
|
Automated triage for the maintainers. Thanks for splitting it.
Holding such work until the memory can be read is left for a follow-up, once a title run shows non-zero Verdict: merge candidate (a recommendation to look, not an approval). CI: passing. Generated by Claude Code |
5de820a to
c5d0230
Compare
|
Rebased on
How to read a title run:
|
`ValueWait::holds` returns `None` both for a comparison we do not know and for memory that cannot be read, and `Held::pump` counted every `None` as an unknown comparison, while the doc comment said unreadable memory was "taken as not holding" (Marvisak#2604). Whether titles make waits on memory not yet readable, and whether it becomes readable later, could not be seen. The pump now counts them apart (`Pumped::unreadable`, summed in the frame's `Account` and named in its warning next to `forced`) and still lets the work run, as `main` does; an `ALWAYS` wait never reads and is not counted. The doc comment says so. Holding such work back can follow once runs show the memory becomes readable. Test: `unreadable_waits_are_counted_apart_and_do_not_hold_work`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
c5d0230 to
74ccd68
Compare
|
Split as suggested, as
Holding such work until the memory reads can come as a follow-up once a run shows the count is non-zero and the memory becomes readable. The title and description are updated. |
|
Independent local verification (Windows 11, Rust 1.100.0/MSVC, head
Only the synthetic unreadable-wait scenario was exercised; no real D3D12 device, WARP adapter or game data was involved. AI-assisted (Hy4 flash). GPU/driver: N/A (CPU-only hold/queue bookkeeping). No game data used. |
What's wrong
ValueWait::holds(9cc37c5) returnsNoneboth for a comparison we do not know and for memory that cannot be read. Its doc comment says the first is "taken as holding" and the second "taken as not holding".Held::pumpcan't tell the two apart: it counts everyNoneas an unknown comparison and lets the work run. So a wait on memory that isn't readable yet runs at once and is reported as an unknown comparison. Nobody can see whether titles make such waits, or whether that memory becomes readable later.What the fix does
This keeps
main's behaviour, as the triage suggested: such work still runs at once. The change makes the case visible:Held::pumpcounts waits on unreadable memory apart, asPumped::unreadable. AnALWAYSwait never reads its memory and is not counted.queue.rs'sAccountsums them per frame. The frame's warning reportsunreadablenext toforced,unknownandmappings, and a frame with only such waits is no longer skipped.holdsnow says what the code does.Holding the work back until the memory reads, the earlier version of this PR, can follow once a title run shows such waits happen and their memory becomes readable.
Tests
New
hold::tests::unreadable_waits_are_counted_apart_and_do_not_hold_work:unreadable1 andunknown0;ALWAYSwait on the same memory runs and is not counted.hold::tests(11),queue::tests(5) andfence::tests(2) pass under Wine 10 (they need no device), andcargo clippy --workspace --all-targets --locked -- -D warningsis clean.Not tested
No title run. The counter is what such a run would report.
Fixes #2604
AI-assisted (Claude Code). No game data used.
🤖 Generated with Claude Code