GPU: normalized placed-texture key can reuse stale backing on the first list after VA recommit #574

Open
opened 2026-11-26 03:46:39 +00:00 by github-bot · 2 comments
Owner

@⁠yualk on GitHub · 2026-11-25 02:22 UTC · original

Reproduced on c96b4f2b8365bf43d54ab074940923ef8267f4c6 with a title-free D3D12 fixture, in fresh processes on NVIDIA 10de:2c05 and WARP 1414:008c. This is about the backing/upload lifetime, not the continued raw-key comparisons addressed by #502.

  • Reserve and commit one 64 KiB writable mapping. Fill it with 0x5a. Translate a placed SRV through descriptor::host::placed_texture: linear 4×4 RGBA8, one mip, resource words [3, filler, 0, 0, 4, 0, 4, 0x10001, 28, 1, 0, 1, 0, !filler]. The SRV uses dimension 4, one mip and the actual mapped VA. Use padding pairs for filler=17 and 31. Force real host creation, record texture::upload followed by a copy-source transition and texture readback, and wait for each list. Both padding variants return 64 bytes of 0x5a. KINDS[6] and HOST_TEXTURES[0] deltas are 2 each with VICTORY_PLACED_FILLER=1, 1 each with it unset. A same-VA format=30 control gets a separate backing in both cases.
  • With the earlier GPU work completed, decommit the VA, call watch::title_memory_remapped, recommit the same VA, notify again, and fill it with 0xa5. Translate the same SRV shape with a previously unseen filler=47. Run the same fenced upload/readback routine twice. No texture::host_written injected; host_wrote is false.
Mode Reused old wrapper First list Next list
VICTORY_PLACED_FILLER=1 no a5 × 64 a5 × 64
Default normalized yes 5a × 64 a5 × 64

This isolates reuse of an already-uploaded wrapper across a mapping change. texture::upload can record only a deferred refresh for an already-uploaded clean staging object, so the first list reads the old GPU bytes; the next list sees the update. A valid deduplication fix should preserve the 2→1 backing result within one mapping lifetime and deliver new bytes on the first eligible list after remap. The fixture joins the placed translation and upload/readback boundaries; it does not prove a title pass or an indexed-slot shader read, a memory-cliff attribution, or any frame-rate effect.

**@⁠yualk** on GitHub · 2026-11-25 02:22 UTC · [original](https://github.com/fxceless/victory-fork/issues/574) Reproduced on `c96b4f2b8365bf43d54ab074940923ef8267f4c6` with a title-free D3D12 fixture, in fresh processes on NVIDIA `10de:2c05` and WARP `1414:008c`. This is about the backing/upload lifetime, not the continued raw-key comparisons addressed by #502. - Reserve and commit one 64 KiB writable mapping. Fill it with `0x5a`. Translate a placed SRV through `descriptor::host::placed_texture`: linear 4×4 RGBA8, one mip, resource words `[3, filler, 0, 0, 4, 0, 4, 0x10001, 28, 1, 0, 1, 0, !filler]`. The SRV uses dimension 4, one mip and the actual mapped VA. Use padding pairs for `filler=17` and `31`. Force real host creation, record `texture::upload` followed by a copy-source transition and texture readback, and wait for each list. Both padding variants return 64 bytes of `0x5a`. `KINDS[6]` and `HOST_TEXTURES[0]` deltas are 2 each with `VICTORY_PLACED_FILLER=1`, 1 each with it unset. A same-VA `format=30` control gets a separate backing in both cases. - With the earlier GPU work completed, decommit the VA, call `watch::title_memory_remapped`, recommit the same VA, notify again, and fill it with `0xa5`. Translate the same SRV shape with a previously unseen `filler=47`. Run the same fenced upload/readback routine twice. No `texture::host_written` injected; `host_wrote` is false. | Mode | Reused old wrapper | First list | Next list | |---|---|---|---| | `VICTORY_PLACED_FILLER=1` | no | `a5` × 64 | `a5` × 64 | | Default normalized | yes | `5a` × 64 | `a5` × 64 | This isolates reuse of an already-uploaded wrapper across a mapping change. `texture::upload` can record only a deferred refresh for an already-uploaded clean staging object, so the first list reads the old GPU bytes; the next list sees the update. A valid deduplication fix should preserve the 2→1 backing result within one mapping lifetime and deliver new bytes on the first eligible list after remap. The fixture joins the placed translation and upload/readback boundaries; it does not prove a title pass or an indexed-slot shader read, a memory-cliff attribution, or any frame-rate effect.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:46:39 +00:00
Author
Owner

@⁠yualk on GitHub · 2026-11-25 02:27 UTC · original

Follow-up control: ran the same remap and fenced readback through production draw::readable (ResourceType::Srv), including the alias check and shader-resource transition. Both adapters reproduce the same result: raw a5/a5, normalized 5a/a5. The remap was under the runtime mapping write guard. This still checks table preparation and exact physical bytes, not a shader invocation or title scene.

**@⁠yualk** on GitHub · 2026-11-25 02:27 UTC · [original](https://github.com/fxceless/victory-fork/issues/574#issuecomment-7150754913) Follow-up control: ran the same remap and fenced readback through production `draw::readable` (`ResourceType::Srv`), including the alias check and shader-resource transition. Both adapters reproduce the same result: raw `a5`/`a5`, normalized `5a`/`a5`. The remap was under the runtime mapping write guard. This still checks table preparation and exact physical bytes, not a shader invocation or title scene.
Author
Owner

@⁠YaBulochka on GitHub · 2026-11-25 18:40 UTC · original

A real game reproduces what reads like this on RADV, if it helps: rectangular tiles of unrelated texture content on characters, stable across frames and moving with the model, while the rest of the same texture is correct.

Build: main d510ee4 + #1052 + #1011 + #1010 + #1054, x86_64-pc-windows-gnu, --features diagnostics.
Environment: CachyOS kernel 7.3.5, Ryzen 5 9600X, 30 GB, Radeon RX 7600 XT 8 GB, RADV (Mesa 27.0.0), Wine 11.22, vkd3d-proton built from master, package 1.0.2.1.
Switches: VICTORY_INDIRECT_GATHER=1 VICTORY_HEAP_WORKER=1 VICTORY_RELAY=2 VICTORY_CARD_FETCH_INFLIGHT=1 VICTORY_CARD_FETCH_INFLIGHT_MB=256 VICTORY_TEXTURE_BUDGET_MB=4096 VICTORY_CARD_BUFFERS_MB=512, VKD3D_CONFIG=host_import_fallback.

Counters from the same run:

  • memory, placed textures: 296 of them were asked for again with other filler words in their description;
  • title textures have no host copy yet: 5,438 (7,045 MB) with no budget set, 369 with VICTORY_TEXTURE_BUDGET_MB=6144, ~20,000 (11,260 MB) while a new area streams;
  • VRAM 8,125-8,135 MB of 8,176 MB at that budget (99.5%), 7,153 MB (87%) at 4,096 + card buffers 512;
  • frames 1.8-5.1 s, GPU 40-1,200 ms of it.

The tiles appear while VRAM is essentially full and streaming is active, which is why this looked like #574 to me rather than a shader-side sampling bug: the sampled content behaves like older bytes of the same placed range. If it is the normalized key, is there a switch to bypass the normalization (or to force the description to be re-asked) so I can A/B it on this machine? I filed the visual side separately as #1072 and can close that one if you would rather keep it here.

No game files, dumps or screenshots are included; counters and behaviour only.

**@⁠YaBulochka** on GitHub · 2026-11-25 18:40 UTC · [original](https://github.com/fxceless/victory-fork/issues/574#issuecomment-7171225036) A real game reproduces what reads like this on RADV, if it helps: rectangular tiles of unrelated texture content on characters, stable across frames and moving with the model, while the rest of the same texture is correct. **Build:** `main` `d510ee4` + #1052 + #1011 + #1010 + #1054, `x86_64-pc-windows-gnu`, `--features diagnostics`. **Environment:** CachyOS kernel 7.3.5, Ryzen 5 9600X, 30 GB, Radeon RX 7600 XT 8 GB, RADV (Mesa 27.0.0), Wine 11.22, vkd3d-proton built from master, package 1.0.2.1. **Switches:** `VICTORY_INDIRECT_GATHER=1 VICTORY_HEAP_WORKER=1 VICTORY_RELAY=2 VICTORY_CARD_FETCH_INFLIGHT=1 VICTORY_CARD_FETCH_INFLIGHT_MB=256 VICTORY_TEXTURE_BUDGET_MB=4096 VICTORY_CARD_BUFFERS_MB=512`, `VKD3D_CONFIG=host_import_fallback`. Counters from the same run: - `memory, placed textures: 296 of them were asked for again with other filler words in their description`; - `title textures have no host copy yet`: 5,438 (7,045 MB) with no budget set, 369 with `VICTORY_TEXTURE_BUDGET_MB=6144`, ~20,000 (11,260 MB) while a new area streams; - VRAM 8,125-8,135 MB of 8,176 MB at that budget (99.5%), 7,153 MB (87%) at 4,096 + card buffers 512; - frames 1.8-5.1 s, GPU 40-1,200 ms of it. The tiles appear while VRAM is essentially full and streaming is active, which is why this looked like #574 to me rather than a shader-side sampling bug: the sampled content behaves like older bytes of the same placed range. If it is the normalized key, is there a switch to bypass the normalization (or to force the description to be re-asked) so I can A/B it on this machine? I filed the visual side separately as #1072 and can close that one if you would rather keep it here. No game files, dumps or screenshots are included; counters and behaviour only.
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/fxceless--victory-fork#574
No description provided.