Mirror copied descriptors from the fingerprinted record #792

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

@⁠yualk on GitHub · 2026-11-25 07:41 UTC · original
yualk:fix-coherent-copied-descriptor → main · +302 −4 · 3 files · 2 commits · open

Defect

HostHeap::mirror_copied fingerprints captured record bytes, then rereads the live guest slot through mirror. If the live record changes A→B between those operations, it caches fingerprint A while installing B. When A later reappears, deduplication suppresses the repair.

Fix

Decode the same immutable 12-byte header that was fingerprinted and pass it to the existing mirror_record path. Ordinary API-driven mirroring is unchanged.

Reproduction

The test interns valid point-clamp A and point-wrap B records, captures A while the live slot contains B, and consumes the published sampler in a fenced D3D12 shader. A 2×1 texture contains independent bytes [17, 231]; the shader also reads a stable clamp and a same-shaped wrap decoy.

  • Parent: [17, 231, 61] — changed slot incorrectly samples wrap B.
  • Fixed, RTX 5070 Ti: [231, 231, 61].
  • Fixed, WARP: [231, 231, 61].

The direct list retires, the fence completes, and device status remains valid before UAV readback. Existing copied-view/cap/stable controls also pass.

Limits

This proves captured bytes → installed descriptor → GPU-consumed sampler value in the owned fixture. It does not claim that a specific title draw reaches a byte-copied sampler or that it fixes lighting/gameplay by itself.

**@⁠yualk** on GitHub · 2026-11-25 07:41 UTC · [original](https://github.com/fxceless/victory-fork/pull/792) `yualk:fix-coherent-copied-descriptor` → `main` · +302 −4 · 3 files · 2 commits · open ## Defect `HostHeap::mirror_copied` fingerprints captured record bytes, then rereads the live guest slot through `mirror`. If the live record changes A→B between those operations, it caches fingerprint A while installing B. When A later reappears, deduplication suppresses the repair. ## Fix Decode the same immutable 12-byte header that was fingerprinted and pass it to the existing `mirror_record` path. Ordinary API-driven mirroring is unchanged. ## Reproduction The test interns valid point-clamp A and point-wrap B records, captures A while the live slot contains B, and consumes the published sampler in a fenced D3D12 shader. A 2×1 texture contains independent bytes `[17, 231]`; the shader also reads a stable clamp and a same-shaped wrap decoy. - Parent: `[17, 231, 61]` — changed slot incorrectly samples wrap B. - Fixed, RTX 5070 Ti: `[231, 231, 61]`. - Fixed, WARP: `[231, 231, 61]`. The direct list retires, the fence completes, and device status remains valid before UAV readback. Existing copied-view/cap/stable controls also pass. ## Limits This proves captured bytes → installed descriptor → GPU-consumed sampler value in the owned fixture. It does not claim that a specific title draw reaches a byte-copied sampler or that it fixes lighting/gameplay by itself.
Hash and decode the same page snapshot instead of reading a second guest header.
Add a deterministic valid-record regression for the stuck old slot after its original bytes return.
Verify the focused regression on RTX and WARP plus the stable copy and range controls.
- execute the copied sampler through a fenced D3D12 shader
- distinguish clamp, wrap, and same-shaped decoy bytes
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:51:15 +00:00
Author
Owner

@⁠iGoldenNinja on GitHub · 2026-11-25 07:57 UTC · original · edited 2026-11-25 08:37 UTC

Independent RTX 5080 hardware check, NVIDIA 617.14, Windows 11 Pro 25H2 build 26200.9974, Ryzen 9 5900X. I copied only this PR's two synthetic sampler fixtures and HLSL file onto parent 9376fd6 and compared it with clean head 7793886.

  • The parent failed both assertions. Its fenced shader readback was [17, 231, 61].
  • The PR head passed both assertions and returned [231, 231, 61].

This reproduces the changed sampler value on the RTX 5080 with the stable clamp and decoy outputs agreeing. Test scope and pinned revisions. OpenAI Codex (GPT-6) ran the tests and drafted this report.

Gameplay follow-up on the same hardware. Both builds used the same local archive and replay support and byte-matched warm caches, with default readback. Both reached the first controllable prison room and finished a matched 90-second route. Parent 9376fd6 displayed 322 application frames at 3.56 FPS and 470.38 ms P99. PR head 7793886 displayed 320 at 3.54 FPS and 493.93 ms P99. Both refused the same eight D3D12 pipelines (E_INVALIDARG), with no logged device removal. The matched view still showed the sharp room lighting boundary and stepped character edges. This was one run per build, with no live instrumentation for the descriptor mismatch. Full comparison

**@⁠iGoldenNinja** on GitHub · 2026-11-25 07:57 UTC · [original](https://github.com/fxceless/victory-fork/pull/792#issuecomment-7156451156) · edited 2026-11-25 08:37 UTC Independent RTX 5080 hardware check, NVIDIA 617.14, Windows 11 Pro 25H2 build 26200.9974, Ryzen 9 5900X. I copied only this PR's two synthetic sampler fixtures and HLSL file onto parent `9376fd6` and compared it with clean head `7793886`. - The parent failed both assertions. Its fenced shader readback was `[17, 231, 61]`. - The PR head passed both assertions and returned `[231, 231, 61]`. This reproduces the changed sampler value on the RTX 5080 with the stable clamp and decoy outputs agreeing. [Test scope and pinned revisions](https://github.com/iGoldenNinja/victory-fork/blob/3f03966e6997c938dd4a7cd7e5760dbeca8fd116/docs/nvidia-pr792-5080.md). OpenAI Codex (GPT-6) ran the tests and drafted this report. **Gameplay follow-up on the same hardware.** Both builds used the same local archive and replay support and byte-matched warm caches, with default readback. Both reached the first controllable prison room and finished a matched 90-second route. Parent `9376fd6` displayed 322 application frames at 3.56 FPS and 470.38 ms P99. PR head `7793886` displayed 320 at 3.54 FPS and 493.93 ms P99. Both refused the same eight D3D12 pipelines (`E_INVALIDARG`), with no logged device removal. The matched view still showed the sharp room lighting boundary and stepped character edges. This was one run per build, with no live instrumentation for the descriptor mismatch. [Full comparison](https://github.com/iGoldenNinja/victory-fork/blob/dc5668930e24c7b4c70515b06604c5960bcaa8ad/docs/nvidia-pr792-5080.md)
Author
Owner

@⁠ArturoWolff on GitHub · 2026-11-25 09:13 UTC · original

Reproduced yualk’s sampler result on Linux without game assets or a physical GPU (GE-Proton11-14, Mesa llvmpipe 26.3.1). Same two tests, same shader binary, same prefix and adapter:

Descriptor implementation Fenced readback: changed / clamp / decoy Tests
Parent 9376fd6 + PR fixtures 17 / 231 / 61 both failed their expected-value assertions
PR 7793886 231 / 231 / 61 both passed

For anyone repeating this on llvmpipe: the unmodified test binary stopped at D3D12 host/heap setup. Requesting feature level 11_0 in the test host only got the record test through, but CreateRootSignature still returned 0x80004005 on the cs_5_1 path. For the comparison above, both builds used that same test-host change and the PR’s unchanged HLSL precompiled via DXC (-T cs_6_0 -E main, SHA-256 422709d38d1b2b66b4b32dda6ac80ea2fbfedeaabb06e8b2ffd20a44962aff97). No changes to either revision’s descriptor implementation. Only the changed slot flipped, matching the Windows results above. This checks the sampler after dispatch, not a retail draw, lighting, or frame time.

AI disclosure: Hermes Agent ran the Linux comparison and wrote this comment for ArturoWolff.

**@⁠ArturoWolff** on GitHub · 2026-11-25 09:13 UTC · [original](https://github.com/fxceless/victory-fork/pull/792#issuecomment-7158034467) Reproduced yualk’s sampler result on Linux without game assets or a physical GPU (GE-Proton11-14, Mesa llvmpipe 26.3.1). Same two tests, same shader binary, same prefix and adapter: | Descriptor implementation | Fenced readback: changed / clamp / decoy | Tests | |---|---|---| | Parent `9376fd6` + PR fixtures | `17 / 231 / 61` | both failed their expected-value assertions | | PR `7793886` | `231 / 231 / 61` | both passed | For anyone repeating this on llvmpipe: the unmodified test binary stopped at D3D12 host/heap setup. Requesting feature level 11_0 in the **test host only** got the record test through, but `CreateRootSignature` still returned `0x80004005` on the `cs_5_1` path. For the comparison above, both builds used that same test-host change and the PR’s unchanged HLSL precompiled via DXC (`-T cs_6_0 -E main`, SHA-256 `422709d38d1b2b66b4b32dda6ac80ea2fbfedeaabb06e8b2ffd20a44962aff97`). No changes to either revision’s descriptor implementation. Only the changed slot flipped, matching the Windows results above. This checks the sampler after dispatch, not a retail draw, lighting, or frame time. AI disclosure: Hermes Agent ran the Linux comparison and wrote this comment for ArturoWolff.
Author
Owner

@⁠timorjay on GitHub · 2026-11-25 16:12 UTC · original

Downstream hardware check on an RTX 5090 D v2 (24 GB, NVIDIA 617.42), in an offline Windows 11 Sandbox. Flamingo 229a052c also has a batched mirror_copied_page path. I adapted yualk’s test so its changed sampler goes through that path, and ran the same two synthetic tests and HLSL against both builds.

Build Changed sampler Direct clamp control Second texture control
Flamingo 229a052c, tests added 17 231 61
Same revision, using the captured record in both copy paths 231 231 61

The first texture contains 17 and 231. The copied record specifies clamp, while the live slot has changed to wrap. The GPU readback distinguishes the two. The descriptor test also failed on the original and passed on the patched build. All three GPU values were read after the fence completed.

For forks carrying the batched path, it needs to use the same captured header as the fingerprint, just like the single-record path in this PR. In two views of the same in-game checkpoint I saw no FPS gain from the change. Thanks for supplying the original fixture and fix.

AI-assisted with Codex.

**@⁠timorjay** on GitHub · 2026-11-25 16:12 UTC · [original](https://github.com/fxceless/victory-fork/pull/792#issuecomment-7167680248) Downstream hardware check on an RTX 5090 D v2 (24 GB, NVIDIA 617.42), in an offline Windows 11 Sandbox. Flamingo `229a052c` also has a batched `mirror_copied_page` path. I adapted yualk’s test so its changed sampler goes through that path, and ran the same two synthetic tests and HLSL against both builds. | Build | Changed sampler | Direct clamp control | Second texture control | | --- | ---: | ---: | ---: | | Flamingo `229a052c`, tests added | 17 | 231 | 61 | | Same revision, using the captured record in both copy paths | 231 | 231 | 61 | The first texture contains 17 and 231. The copied record specifies clamp, while the live slot has changed to wrap. The GPU readback distinguishes the two. The descriptor test also failed on the original and passed on the patched build. All three GPU values were read after the fence completed. For forks carrying the batched path, it needs to use the same captured header as the fingerprint, just like the single-record path in this PR. In two views of the same in-game checkpoint I saw no FPS gain from the change. Thanks for supplying the original fixture and fix. AI-assisted with Codex.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/descriptor/host.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/792/head:github-bot/gh-792'
git switch 'github-bot/gh-792'

Merge

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