GPU: what shaders write beside a root UAV in its pages goes back to title memory #1961

Open
oVolkra wants to merge 3 commits from upstream-pr/1963 into main
oVolkra commented 2026-11-25 01:47:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oVolkra on 2026-11-25T01:47:25Z.


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:

  • Beside the range. The whole page is skipped, but only the range's own bytes are snapshotted. Writes before its first byte or after its last one in those pages never reach title memory (the shortcut: on Map::precise). A bigger root UAV loses the rest of the page its 1 MiB window ends in.
  • Another copy owns the page. shadow::find gives 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::precise takes 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.
  • At submission, the pages of the range that the page table reads from another copy are declared as written in that copy too (Layout::others, Step::GpuWrites): refreshed, snapshotted, and copied back byte for byte with the existing Shadow::writing and copy_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.
  • A marked page is skipped only for a range of the copy the page table names for it, which now includes those declared pages.

The second point (e841f64) answers the triage of 9d41eb7, which was right. There the bigger copy's page went back through copy_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.

Test Expected Before
Beside the range [1, 2, 3, 4] [0, 2, 0, 4] (main)
Another copy owns the page, page-table writes only [1, 2] [0, 0] (main)
Root UAV and page table in one page, tracked [1, 2] [1, 0] (9d41eb7)
Root UAV and page table in one page, untracked [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 on main, all NVIDIA ones reported before (dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views, two stride_tests, gathers_at_a_level_match_the_hardware).
  • cargo test -p victory-gpu --locked with #1751 applied locally: 147 passed, 0 failed, 2 ignored.
  • Both clippy runs and cargo xtask policy pass.

Not verified

  • Not run with the title, and no frame time measured.

Not covered

The same loss happens when the inner copy's write is declared without Map::precise (tested by replacing that call with refresh and gpu_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

<!-- greyfinch-sync:Marvisak/VIctory:issue:5483537527 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1963). Originally posted by [oVolkra](https://github.com/oVolkra) on 2026-11-25T01:47:25Z. --- ## 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: - **Beside the range.** The whole page is skipped, but only the range's own bytes are snapshotted. Writes before its first byte or after its last one in those pages never reach title memory (the `shortcut:` on `Map::precise`). A bigger root UAV loses the rest of the page its 1 MiB window ends in. - **Another copy owns the page.** `shadow::find` gives 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::precise` takes 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. - At submission, the pages of the range that the page table reads from another copy are declared as written in that copy too (`Layout::others`, `Step::GpuWrites`): refreshed, snapshotted, and copied back byte for byte with the existing `Shadow::writing` and `copy_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. - A marked page is skipped only for a range of the copy the page table names for it, which now includes those declared pages. The second point (`e841f64`) answers the triage of `9d41eb7`, which was right. There the bigger copy's page went back through `copy_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. | Test | Expected | Before | |---|---|---| | Beside the range | `[1, 2, 3, 4]` | `[0, 2, 0, 4]` (`main`) | | Another copy owns the page, page-table writes only | `[1, 2]` | `[0, 0]` (`main`) | | Root UAV and page table in one page, tracked | `[1, 2]` | `[1, 0]` (`9d41eb7`) | | Root UAV and page table in one page, untracked | `[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 on `main`, all NVIDIA ones reported before (`dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views`, two `stride_tests`, `gathers_at_a_level_match_the_hardware`). - `cargo test -p victory-gpu --locked` with #1751 applied locally: 147 passed, 0 failed, 2 ignored. - Both clippy runs and `cargo xtask policy` pass. ## Not verified - Not run with the title, and no frame time measured. ## Not covered The same loss happens when the inner copy's write is declared without `Map::precise` (tested by replacing that call with `refresh` and `gpu_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](https://claude.com/claude-code)
catminou4 commented 2026-11-25 02:10:31 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T02:10:31Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:Marvisak/VIctory:review:6050613598 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1963#pullrequestreview-6050613598). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T02:10:31Z. **Review:** COMMENTED --- 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.
DesertGamer commented 2026-11-25 03:03:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DesertGamer on 2026-11-25T02:17:35Z.


VIctory V2: community PRs, merged and tested

Open 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).

⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.

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:
https://DesertGamer/VIctory-V2

Unofficial community fork of Marvisak/VIctory, GPL-3.0.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7150542458 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1963#issuecomment-7150542458). Originally posted by [DesertGamer](https://github.com/DesertGamer) on 2026-11-25T02:17:35Z. --- ### VIctory V2: community PRs, merged and tested Open 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). :warning: Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk. 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: https://DesertGamer/VIctory-V2 *Unofficial community fork of Marvisak/VIctory, GPL-3.0.*
BaggyALPHA commented 2026-11-25 03:03:26 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by BaggyALPHA on 2026-11-25T02:23:01Z.


Independent synthetic verification on Windows with an RTX 3080 (driver 621.24). I tested this PR at 9d41eb7 on 940d32f with #1751 (4521591) applied to clear the two already-reproduced NVIDIA descriptor-heap failures.

  • cargo test -p victory-gpu --locked -- --test-threads=1: 145 passed, 0 failed, 2 ignored. Both root UAV copy-back regressions passed.
  • As a negative control I kept both tests and temporarily restored the pre-fix range and page-skip logic locally. Both tests failed with the same data loss described in the PR. This confirms the tests exercised the hardware path on this setup.

All inputs were synthetic. No title run or frame timing was performed.

AI-assisted (OpenAI Codex).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7150651216 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1963#issuecomment-7150651216). Originally posted by [BaggyALPHA](https://github.com/BaggyALPHA) on 2026-11-25T02:23:01Z. --- Independent synthetic verification on Windows with an RTX 3080 (driver 621.24). I tested this PR at `9d41eb7` on `940d32f` with #1751 (`4521591`) applied to clear the two already-reproduced NVIDIA descriptor-heap failures. - `cargo test -p victory-gpu --locked -- --test-threads=1`: 145 passed, 0 failed, 2 ignored. Both root UAV copy-back regressions passed. - As a negative control I kept both tests and temporarily restored the pre-fix range and page-skip logic locally. Both tests failed with the same data loss described in the PR. This confirms the tests exercised the hardware path on this setup. All inputs were synthetic. No title run or frame timing was performed. AI-assisted (OpenAI Codex).
Marvisak commented 2026-11-25 09:06:15 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T08:21:59Z.


Automated triage for the maintainers.

Merge candidate. The head is rebased (2a3016a) and merges cleanly into current main. It removes the shortcut: on Map::precise (memory.rs). The root UAV range is now widened to whole 64 KiB pages, cut to the copy, for the refresh, the gpu_writes snapshot and the marked-page skip alike. A new Step::GpuWrites (host.rs) uses Layout::others to find, at submission, the pages of that range that the page table reads from another copy. It declares them written in that copy too, so they go back byte for byte through the existing Shadow::writing/copy_back. The missed-page skip now matches on the copy as well as the address. main's #2172 widened marked refreshes but left this shortcut in place, so the PR does not duplicate it. The four synthetic tests cover the data loss the PR describes, including the same-page tracked and untracked cases from the earlier triage. CI (check) passes on this head.

Nit: the doc comment above none_missed in memory.rs tests is over-indented.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7156935884 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1963#issuecomment-7156935884). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T08:21:59Z. --- <!-- victory-triage v1 head=2a3016a423dadcce85eafc2d0b75bfeb1202e36a verdict=merge-candidate at=2026-11-26T01:20:10Z --> Automated triage for the maintainers. **Merge candidate.** The head is rebased (`2a3016a`) and merges cleanly into current `main`. It removes the `shortcut:` on `Map::precise` (`memory.rs`). The root UAV range is now widened to whole 64 KiB pages, cut to the copy, for the refresh, the `gpu_writes` snapshot and the marked-page skip alike. A new `Step::GpuWrites` (`host.rs`) uses `Layout::others` to find, at submission, the pages of that range that the page table reads from another copy. It declares them written in that copy too, so they go back byte for byte through the existing `Shadow::writing`/`copy_back`. The missed-page skip now matches on the copy as well as the address. `main`'s #2172 widened marked refreshes but left this shortcut in place, so the PR does not duplicate it. The four synthetic tests cover the data loss the PR describes, including the same-page tracked and untracked cases from the earlier triage. CI (`check`) passes on this head. Nit: the doc comment above `none_missed` in `memory.rs` tests is over-indented. --- _Generated by [Claude Code](https://claude.ai/code)_
oVolkra commented 2026-11-25 11:05:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oVolkra on 2026-11-25T10:40:09Z.


Update for the triage of 9d41eb7: it was right about the second case, and e841f64 fixes it.

Reproduced. Two new tests write through the root UAV on the inner copy and through the page table in the same page. Expected [1, 2]; 9d41eb7 gave [1, 0] in tracked memory and [0, 2] in untracked memory, as described.

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. cargo test -p victory-gpu --locked with #1751 applied locally: 147 passed, 0 failed, 2 ignored. Without it, only the two NVIDIA descriptor-heap tests fail. Both clippy runs and cargo xtask policy pass, and CI passes on e841f64.

Not run with the title, and no frame time measured. A similar loss remains for writes declared without Map::precise, which this PR does not touch. The description is updated with the details.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7160011046 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1963#issuecomment-7160011046). Originally posted by [oVolkra](https://github.com/oVolkra) on 2026-11-25T10:40:09Z. --- Update for the triage of `9d41eb7`: it was right about the second case, and `e841f64` fixes it. **Reproduced.** Two new tests write through the root UAV on the inner copy and through the page table in the same page. Expected `[1, 2]`; `9d41eb7` gave `[1, 0]` in tracked memory and `[0, 2]` in untracked memory, as described. **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. `cargo test -p victory-gpu --locked` with #1751 applied locally: 147 passed, 0 failed, 2 ignored. Without it, only the two NVIDIA descriptor-heap tests fail. Both clippy runs and `cargo xtask policy` pass, and CI passes on `e841f64`. Not run with the title, and no frame time measured. A similar loss remains for writes declared without `Map::precise`, which this PR does not touch. The description is updated with the details. AI-assisted (Claude Code).
oVolkra commented 2026-11-25 20:06:12 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oVolkra on 2026-11-25T19:21:54Z.


Rebased onto main (219878a) to resolve the merge conflicts.

The two failing GPU tests (dynamic_slots_are_held_until_released and lists_share_a_table_and_copies_keep_their_views) also fail on main without these changes.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7172192733 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1963#issuecomment-7172192733). Originally posted by [oVolkra](https://github.com/oVolkra) on 2026-11-25T19:21:54Z. --- Rebased onto `main` (219878a) to resolve the merge conflicts. The two failing GPU tests (`dynamic_slots_are_held_until_released` and `lists_share_a_table_and_copies_keep_their_views`) also fail on `main` without these changes.
fuzeofficlal commented 2026-11-26 19:11:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T19:11:33Z.

Review: CHANGES_REQUESTED


Reviewed 2a3016a423da both standalone and merged cleanly onto 63bcca43 on Windows 11 with an NVIDIA RTX 5090 and Microsoft WARP (with and without VICTORY_D3D12_DEBUG=1).

The core write-back logic in crates/victory-gpu/src/draw.rs, memory.rs:96-119, memory.rs:230-250, and host.rs:974,1354,2371-2386 looks solid: writes_beside_a_root_uav_in_its_pages_go_back, withholding::*, and an additional probe exercising a mid-page 1 MiB root UAV window (verifying writes before the start, inside the window, past the 1 MiB tail in its final page, and in the following page while preserving untouched sentinels in the same pages) all pass on both RTX 5090 and WARP with zero Debug Layer messages.

However, both newly added run_both tests (writes_through_a_root_uav_and_the_page_table_in_one_page_both_go_back and writes_through_a_root_uav_and_the_page_table_in_one_untracked_page_both_go_back) reproducibly crash the test binary with DXGI_ERROR_DEVICE_HUNG (0x887A0006) -> host::fail() abort (0xC0000409, STATUS_STACK_BUFFER_OVERRUN) on both RTX 5090 and Microsoft WARP, both at pure PR head 2a3016a4 and merged onto 63bcca43, with and without VICTORY_D3D12_DEBUG=1.

Root cause

crates/victory-gpu/src/memory.rs:1382 calls:

host.execute(&[&list, &list]);

Host::execute (crates/victory-gpu/src/host.rs:1256-1265, without VICTORY_GPU_TIMING) submits [&list, &list] in a single ID3D12CommandQueue::ExecuteCommandLists(group) call with group.len() == 2 containing the same ID3D12CommandList pointer twice. Submitting the same command list more than once within a single ExecuteCommandLists call is invalid in D3D12 (a command list may only be re-executed across separate ExecuteCommandLists calls), causing GetDeviceRemovedReason() to return 0x887A0006 (DXGI_ERROR_DEVICE_HUNG) right after WaitForSingleObject, which aborts the process at host.rs:1314-1321.

Verified fix options

  • If the test is meant to verify re-submitting list after title writes (confirming found.take() cleared the first run and the next run refreshes/preserves title writes): replacing host.execute(&[&list, &list]); at memory.rs:1382 with host.execute(&[&list]); (or two distinct recorded lists host.execute(&[&list, &list2]);) immediately passes both tests on RTX 5090 and WARP under VICTORY_D3D12_DEBUG=1 with GetDeviceRemovedReason() == Ok(()) and log_messages() == None.
  • If Host::execute itself is intended to support a title passing the same HostList twice in one ExecuteCommandLists batch (as noted in host.rs:2383 and host.rs:1330): split groups in Host::execute (host.rs:1245-1265) whenever a command list repeats within the current group so each self.queue.ExecuteCommandLists call receives unique command-list handles.

Happy to re-verify once either fix is pushed!

<!-- greyfinch-sync:Marvisak/VIctory:review:6079358652 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1963#pullrequestreview-6079358652). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T19:11:33Z. **Review:** CHANGES_REQUESTED --- Reviewed `2a3016a423da` both standalone and merged cleanly onto `63bcca43` on Windows 11 with an NVIDIA RTX 5090 and Microsoft WARP (with and without `VICTORY_D3D12_DEBUG=1`). The core write-back logic in `crates/victory-gpu/src/draw.rs`, `memory.rs:96-119`, `memory.rs:230-250`, and `host.rs:974,1354,2371-2386` looks solid: `writes_beside_a_root_uav_in_its_pages_go_back`, `withholding::*`, and an additional probe exercising a mid-page 1 MiB root UAV window (verifying writes before the start, inside the window, past the 1 MiB tail in its final page, and in the following page while preserving untouched sentinels in the same pages) all pass on both RTX 5090 and WARP with zero Debug Layer messages. However, both newly added `run_both` tests (`writes_through_a_root_uav_and_the_page_table_in_one_page_both_go_back` and `writes_through_a_root_uav_and_the_page_table_in_one_untracked_page_both_go_back`) reproducibly crash the test binary with **`DXGI_ERROR_DEVICE_HUNG` (`0x887A0006`) -> `host::fail()` abort (`0xC0000409`, `STATUS_STACK_BUFFER_OVERRUN`)** on **both** RTX 5090 and Microsoft WARP, both at pure PR head `2a3016a4` and merged onto `63bcca43`, with and without `VICTORY_D3D12_DEBUG=1`. ### Root cause `crates/victory-gpu/src/memory.rs:1382` calls: ```rust host.execute(&[&list, &list]); ``` `Host::execute` (`crates/victory-gpu/src/host.rs:1256-1265`, without `VICTORY_GPU_TIMING`) submits `[&list, &list]` in a **single** `ID3D12CommandQueue::ExecuteCommandLists(group)` call with `group.len() == 2` containing the same `ID3D12CommandList` pointer twice. Submitting the same command list more than once within a single `ExecuteCommandLists` call is invalid in D3D12 (a command list may only be re-executed across separate `ExecuteCommandLists` calls), causing `GetDeviceRemovedReason()` to return `0x887A0006` (`DXGI_ERROR_DEVICE_HUNG`) right after `WaitForSingleObject`, which aborts the process at `host.rs:1314-1321`. ### Verified fix options - **If the test is meant to verify re-submitting `list` after title writes** (confirming `found.take()` cleared the first run and the next run refreshes/preserves title writes): replacing `host.execute(&[&list, &list]);` at `memory.rs:1382` with `host.execute(&[&list]);` (or two distinct recorded lists `host.execute(&[&list, &list2]);`) immediately passes both tests on RTX 5090 and WARP under `VICTORY_D3D12_DEBUG=1` with `GetDeviceRemovedReason() == Ok(())` and `log_messages() == None`. - **If `Host::execute` itself is intended to support a title passing the same `HostList` twice in one `ExecuteCommandLists` batch** (as noted in `host.rs:2383` and `host.rs:1330`): split `groups` in `Host::execute` (`host.rs:1245-1265`) whenever a command list repeats within the current group so each `self.queue.ExecuteCommandLists` call receives unique command-list handles. Happy to re-verify once either fix is pushed!
Dukestar69 commented 2026-11-26 23:10:12 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T23:10:12Z.

Review: APPROVED


LGTM — verified on RTX 5090 (Windows / D3D12) against origin/main (63bcca4).

  • Copying back shader writes beside a root UAV in its pages cleanly preserves adjacent GPU writes into title memory.
  • cargo test -p victory-gpu --lib draw:: -- --test-threads=1: all passed.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6081366178 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1963#pullrequestreview-6081366178). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-26T23:10:12Z. **Review:** APPROVED --- LGTM — verified on RTX 5090 (Windows / D3D12) against `origin/main` (`63bcca4`). - Copying back shader writes beside a root UAV in its pages cleanly preserves adjacent GPU writes into title memory. - `cargo test -p victory-gpu --lib draw:: -- --test-threads=1`: all passed. - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
oVolkra commented 2026-11-27 09:39:18 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oVolkra on 2026-11-27T09:39:18Z.


Thanks for the detailed review and root-cause analysis!

Pushed a fix using option 2 in crates/victory-gpu/src/host.rs:

  • Added unique_runs to split each ExecuteCommandLists group whenever a command-list handle repeats within the group, so each ExecuteCommandLists call receives unique handles and signals/waits on its own fence value (*submitted += 1).
  • Kept both run_both tests in crates/victory-gpu/src/memory.rs (host.execute(&[&list, &list])) as-is, and added a unit test host::batch::unique_runs_splits_only_on_repeated_handles.

Verified on Windows 11:

  • VICTORY_D3D12_DEBUG=1 cargo test -p victory-gpu --locked -- unique_runs writes_through_a_root_uav_and_the_page_table_in_one --test-threads=1: 3 passed, 0 failed.
  • cargo test -p victory-gpu --locked -- --test-threads=1: 232 passed, 2 failed (dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views, same pre-existing failures on main), 1 ignored.
  • cargo clippy --workspace --all-targets --locked -- -D warnings, cargo clippy -p victory-gpu --features diagnostics --all-targets --locked -- -D warnings, and cargo xtask policy (190 files ok) all pass.

Ready for another look!

AI-assisted (Gemini / Antigravity).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7214936261 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1963#issuecomment-7214936261). Originally posted by [oVolkra](https://github.com/oVolkra) on 2026-11-27T09:39:18Z. --- Thanks for the detailed review and root-cause analysis! Pushed a fix using option 2 in `crates/victory-gpu/src/host.rs`: - Added `unique_runs` to split each `ExecuteCommandLists` group whenever a command-list handle repeats within the group, so each `ExecuteCommandLists` call receives unique handles and signals/waits on its own fence value (`*submitted += 1`). - Kept both `run_both` tests in `crates/victory-gpu/src/memory.rs` (`host.execute(&[&list, &list])`) as-is, and added a unit test `host::batch::unique_runs_splits_only_on_repeated_handles`. Verified on Windows 11: - `VICTORY_D3D12_DEBUG=1 cargo test -p victory-gpu --locked -- unique_runs writes_through_a_root_uav_and_the_page_table_in_one --test-threads=1`: 3 passed, 0 failed. - `cargo test -p victory-gpu --locked -- --test-threads=1`: 232 passed, 2 failed (`dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views`, same pre-existing failures on `main`), 1 ignored. - `cargo clippy --workspace --all-targets --locked -- -D warnings`, `cargo clippy -p victory-gpu --features diagnostics --all-targets --locked -- -D warnings`, and `cargo xtask policy` (`190 files ok`) all pass. Ready for another look! AI-assisted (Gemini / Antigravity).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1963:upstream-pr/1963'
git switch 'upstream-pr/1963'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1963'
git switch 'upstream-pr/1963'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1963'
git switch 'upstream-pr/1963'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1963'
git switch 'main'
git merge --squash 'upstream-pr/1963'
git switch 'main'
git merge --ff-only 'upstream-pr/1963'
git switch 'main'
git merge 'upstream-pr/1963'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
Marvisak/VIctory!1961
No description provided.