GPU: mirror descriptor heaps copied as bytes #305

Open
Flyander wants to merge 2 commits from upstream-pr/305 into main
Flyander commented 2026-11-24 23:26:57 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Flyander on 2026-11-24T23:26:57Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6593492697 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/305). Originally posted by [Flyander](https://github.com/Flyander) on 2026-11-24T23:26:57Z. --- ## 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.
yualk commented 2026-11-25 08:08:58 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by yualk on 2026-11-25T07:18:26Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7155715463 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/305#issuecomment-7155715463). Originally posted by [yualk](https://github.com/yualk) on 2026-11-25T07:18:26Z. --- 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.
iGoldenNinja commented 2026-11-25 08:08:59 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by iGoldenNinja on 2026-11-25T07:26:31Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7155863424 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/305#issuecomment-7155863424). Originally posted by [iGoldenNinja](https://github.com/iGoldenNinja) on 2026-11-25T07:26:31Z. --- 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 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/305:upstream-pr/305'
git switch 'upstream-pr/305'

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/305'
git switch 'upstream-pr/305'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/305'
git switch 'upstream-pr/305'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/305'
git switch 'main'
git merge --squash 'upstream-pr/305'
git switch 'main'
git merge --ff-only 'upstream-pr/305'
git switch 'main'
git merge 'upstream-pr/305'
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
fxceless/victory-fork!305
No description provided.