Repository navigation
Conversation
catminou4
left a comment
There was a problem hiding this comment.
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
What shaders write beside a root UAV in its pages goes…: write-scope tracking beyond root UAV — memory-safety relevant; Windows-only.
VIctory V2: community PRs, merged and testedOpen PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch. Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1). Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help: Unofficial community fork of Marvisak/VIctory, GPL-3.0. |
|
Independent synthetic verification on Windows with an RTX 3080 (driver 621.24). I tested this PR at
All inputs were synthetic. No title run or frame timing was performed. AI-assisted (OpenAI Codex). |
|
Automated triage for the maintainers. Merge candidate. The head is rebased ( Nit: the doc comment above Generated by Claude Code |
|
Update for the triage of Reproduced. Two new tests write through the root UAV on the inner copy and through the page table in the same page. Expected Fix. At submission, the pages of the root UAV's range that the page table reads from another copy are declared as written in that copy too. They are snapshotted and go back byte for byte, so both writes are kept (the first option suggested). Tests. The four root UAV tests pass on an RTX 3060 and on WARP. With this fix turned off the two new ones fail again with the values above. Not run with the title, and no frame time measured. A similar loss remains for writes declared without AI-assisted (Claude Code). |
e841f64 to
1baff76
Compare
|
Rebased onto The two failing GPU tests ( |
…itle memory A marked page touched by a root UAV's range is left to the range's byte-for-byte copy-back, which covered only the range's own bytes: what shaders wrote elsewhere in its first and last page was lost. The range is taken out to whole pages of its copy. A page another copy is read from (a buffer holding it in part inside a bigger one) goes back as any other marked page: the range's snapshot is of a copy the shaders do not write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… back A root UAV on a buffer that holds its page in part goes back from that buffer's copy, the page from the bigger one the page table names. The first marks the page changed, so the second kept the title's bytes and lost what shaders wrote through the table; in memory that is not tracked it put its whole page back over the root UAV's bytes. At submission the pages of the range read from another copy are now declared as written there too, and go back by their bytes before and after the run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1baff76 to
2a3016a
Compare
… pages goes back to title memory
Problem
In programs that use title memory, shaders mark the 64 KiB pages they write, and each marked page goes back after the submission. Pages that a root UAV's range touches are left out (
Map::precise), since the range goes back byte for byte. That loses writes in two cases:shortcut:onMap::precise). A bigger root UAV loses the rest of the page its 1 MiB window ends in.shadow::findgives the innermost buffer, but the page table names the copy holding the whole page. For a buffer that holds its page only in part inside a bigger one, what shaders write through the page table is in the bigger copy. The snapshot is of the small one, and the page is skipped: those writes are lost.Change
Map::precisetakes the range out to whole pages, cut to the copy, for the refresh, the snapshot and the skip alike. Only bytes the GPU changed go back, as before.Layout::others,Step::GpuWrites): refreshed, snapshotted, and copied back byte for byte with the existingShadow::writingandcopy_back. So the bytes written through the root UAV and those written through the page table both go back, whether or not the memory is write-watched.The second point (
e841f64) answers the triage of9d41eb7, which was right. There the bigger copy's page went back throughcopy_back_page, after the root UAV's bytes. In tracked memory that write-back had marked the page changed, so the page-table writes were lost. In untracked memory the whole page went back over the root UAV's bytes.Cost: per root UAV, at most two more pages of its own copy are snapshotted and compared (the range is up to 1 MiB), plus a page-table lookup for each page of the range at submission. Pages read from another copy are also snapshotted and compared there.
Tests
Four synthetic tests write through the page table and mark pages as translated shaders do. All pass now on an RTX 3060 (Windows 11) and on WARP.
[1, 2, 3, 4][0, 2, 0, 4](main)[1, 2][0, 0](main)[1, 2][1, 0](9d41eb7)[1, 2][0, 2](9d41eb7)The last two are new. They also check that the GPU wrote both copies, submit the list again and twice in one submission, and check that a title write beside those bytes is kept. With only the second point of the change turned off they fail as in the table.
On the RTX 3060:
cargo test --workspace --locked --no-fail-fast: the same 5 tests fail as onmain, all NVIDIA ones reported before (dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_views, twostride_tests,gathers_at_a_level_match_the_hardware).cargo test -p victory-gpu --lockedwith GPU: capped view heaps keep the full dynamic range (NVIDIA) #1751 applied locally: 147 passed, 0 failed, 2 ignored.cargo xtask policypass.Not verified
Not covered
The same loss happens when the inner copy's write is declared without
Map::precise(tested by replacing that call withrefreshandgpu_writes, with the same root UAV:[1, 0]tracked,[0, 2]untracked). This PR does not touch that path.Next to #1869 and #1865, which change the lookup and the bitmap of the same loop, not which bytes go back: a textual conflict is likely, and I can rebase on whichever lands.
AI-assisted (Claude Code).
🤖 Generated with Claude Code