GPU: mirror descriptor heaps copied as bytes #305

Open
github-bot wants to merge 2 commits from github-bot/gh-305 into main AGit
Owner

@⁠Flyander on GitHub · 2026-11-24 23:26 UTC · original
Flyander:fix/mirror-title-heap-byte-copies → main · +211 −0 · 4 files · 2 commits · open

Summary

The host descriptor heap is updated when descriptor APIs call mirror(). A title can also copy the runtime's descriptor record directly into a placed shader-visible heap as bytes; that bypasses mirror() and leaves the corresponding host slot null or stale.

  • Track placed shader-visible heaps in runtime GPU memory using the existing write-watch and guarded-page paths.
  • Before each host submission, mirror slots covered by changed pages, including raw byte copies.
  • Add a D3D12-backed regression test that copies a sampler record into a placed heap without calling CreateSampler for the destination.

Verification

  • cargo test --locked --workspace — passed; includes 111 GPU tests and 210 shader tests.
  • cargo clippy --locked --workspace --all-targets --all-features -- -D warnings — passed.
  • cargo xtask policy — 169 files passed.
  • Focused D3D12 regression test — passed on the local host GPU.

Scope

This closes the raw-copy synchronization path. It has not been shown to resolve the nondeterministic missing walls or roof reported in #62; this PR does not include a full title run.

**@⁠Flyander** on GitHub · 2026-11-24 23:26 UTC · [original](https://github.com/fxceless/victory-fork/pull/305) `Flyander:fix/mirror-title-heap-byte-copies` → `main` · +211 −0 · 4 files · 2 commits · open ## Summary The host descriptor heap is updated when descriptor APIs call `mirror()`. A title can also copy the runtime's descriptor record directly into a placed shader-visible heap as bytes; that bypasses `mirror()` and leaves the corresponding host slot null or stale. - Track placed shader-visible heaps in runtime GPU memory using the existing write-watch and guarded-page paths. - Before each host submission, mirror slots covered by changed pages, including raw byte copies. - Add a D3D12-backed regression test that copies a sampler record into a placed heap without calling `CreateSampler` for the destination. ## Verification - `cargo test --locked --workspace` — passed; includes 111 GPU tests and 210 shader tests. - `cargo clippy --locked --workspace --all-targets --all-features -- -D warnings` — passed. - `cargo xtask policy` — 169 files passed. - Focused D3D12 regression test — passed on the local host GPU. ## Scope This closes the raw-copy synchronization path. It has not been shown to resolve the nondeterministic missing walls or roof reported in #62; this PR does not include a full title run.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:40:22 +00:00
Author
Owner

@⁠yualk on GitHub · 2026-11-25 07:18 UTC · original

I checked the integrated raw-copy path at a26859fc5f512e0db0d7522d3da821c038378ab7. In HostHeap::mirror_copied, the fingerprint comes from the captured record, but mirror() reads the header from the current slot again. In an owned deterministic Windows D3D12 regression with two valid sampler records, publishing captured clamp A while the current slot contains wrap B installs B. Restoring A and sending its captured bytes again deduplicates against A's fingerprint, leaving B installed. No unmap, title data, or GPU draw is needed for this test.

A narrow local follow-up decodes the header from the same record that was fingerprinted while preserving the normal API mirror and deferred view rules. The new installed-key regression fails on a26859f and passes on RTX and explicit WARP with that follow-up; stable raw publication, capped range and ordinary descriptor-copy tests still pass. This checks coherent host slot selection, not shader-sampled output, world rendering or FPS. AI-assisted.

**@⁠yualk** on GitHub · 2026-11-25 07:18 UTC · [original](https://github.com/fxceless/victory-fork/pull/305#issuecomment-7155715463) I checked the integrated raw-copy path at `a26859fc5f512e0db0d7522d3da821c038378ab7`. In `HostHeap::mirror_copied`, the fingerprint comes from the captured record, but `mirror()` reads the header from the current slot again. In an owned deterministic Windows D3D12 regression with two valid sampler records, publishing captured clamp A while the current slot contains wrap B installs B. Restoring A and sending its captured bytes again deduplicates against A's fingerprint, leaving B installed. No unmap, title data, or GPU draw is needed for this test. A narrow local follow-up decodes the header from the same record that was fingerprinted while preserving the normal API mirror and deferred view rules. The new installed-key regression fails on `a26859f` and passes on RTX and explicit WARP with that follow-up; stable raw publication, capped range and ordinary descriptor-copy tests still pass. This checks coherent host slot selection, not shader-sampled output, world rendering or FPS. AI-assisted.
Author
Owner

@⁠iGoldenNinja on GitHub · 2026-11-25 07:26 UTC · original

RTX 5080 16 GB, NVIDIA driver 617.14 and Windows 11 Pro 25H2 build 26200.9974, Series X diagnostics. I tested the raw descriptor mirroring path as integrated in main a26859f, against 8dd30ab. Both used the default second-stage relay and reached player control. The same five-minute prison replay had its first camera input within 23 ms after player selection and later input offsets within 16 ms.

The a26859f log reported a median 48,168 mirrored records/frame and 57.15 ms/frame across 257 reporting windows. PresentMon had 3.27 FPS / 523.28 ms P99 on a26859f and 3.93 FPS / 440.99 ms P99 on 8dd30ab. The wall and ceiling drew on both at the same interior angle. Stepped shoulder artifacts remained. DRED reported no removal. This comparison covers the full main commit, so it leaves the performance impact of isolated mirroring open.

Replay method and counters. OpenAI Codex (GPT-6) ran the replay and drafted this report.

**@⁠iGoldenNinja** on GitHub · 2026-11-25 07:26 UTC · [original](https://github.com/fxceless/victory-fork/pull/305#issuecomment-7155863424) RTX 5080 16 GB, NVIDIA driver 617.14 and Windows 11 Pro 25H2 build 26200.9974, Series X diagnostics. I tested the raw descriptor mirroring path as integrated in main `a26859f`, against `8dd30ab`. Both used the default second-stage relay and reached player control. The same five-minute prison replay had its first camera input within 23 ms after player selection and later input offsets within 16 ms. The `a26859f` log reported a median **48,168 mirrored records/frame and 57.15 ms/frame** across 257 reporting windows. PresentMon had **3.27 FPS / 523.28 ms P99** on `a26859f` and **3.93 FPS / 440.99 ms P99** on `8dd30ab`. The wall and ceiling drew on both at the same interior angle. Stepped shoulder artifacts remained. DRED reported no removal. This comparison covers the full main commit, so it leaves the performance impact of isolated mirroring open. [Replay method and counters](https://github.com/iGoldenNinja/victory-fork/blob/53c154d9ba61c701753a95b70ea2125c252ab62f/docs/ssd-a26859f-5080.md). OpenAI Codex (GPT-6) ran the replay and drafted this report.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/descriptor.rs
  • crates/victory-gpu/src/host.rs
  • crates/victory-gpu/src/watch.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/305/head:github-bot/gh-305'
git switch 'github-bot/gh-305'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-305'
git switch 'github-bot/gh-305'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-305'
git switch 'github-bot/gh-305'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-305'
git switch 'main'
git merge --squash 'github-bot/gh-305'
git switch 'main'
git merge --ff-only 'github-bot/gh-305'
git switch 'main'
git merge 'github-bot/gh-305'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.