D3D12.X: a view's padding does not make a second texture #2752

Open
joeypercia wants to merge 1 commit from upstream-pr/2762 into main
joeypercia commented 2026-11-26 10:53:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by joeypercia on 2026-11-26T10:53:24Z.


resource_at makes a placed texture for each new (address, description) of a view the title writes without a resource object (device #70 / #71, CreateShaderResourceViewAtX / CreateUnorderedAccessViewAtX), and keeps it for later views. Its key cleared the padding after the flags (bytes 0x34..0x38) but not the padding after Dimension (bytes 0x04..0x08). The newer retail title leaves that padding set, so the same view made another texture whenever it differed. @GreemSC counted 24,844 such twins among 80,953 textures in a 200 s run (31 %, #2743). This clears both. Part of #2743 and #2688.

There's no eviction here. A version that let earlier textures go when a view covered their memory bounded the count on an RTX 4070 Ti (about 24,000 instead of 62,822 and climbing), but it didn't lower video memory. More than half of what it let go was made again, and its one run ended in the title's own breakpoint. Details are on #2743.

What is in it (one commit, crates/xcl/src/hle/d3d12x/real.rs, crates/xcl/src/host.rs)

  • view_key clears both padding ranges of the 0x38-byte description. resource_at keys its map with it, and passes the cleared description on.
  • The activity line counts the textures kept (views without a resource: N textures kept).
  • Test padding_does_not_make_another_texture: two descriptions that differ only in their padding give one key, and a change of any other byte (dimension, width, format, flags) keeps them apart. It fails without the change (padding at 0x04).

Tested

  • NVIDIA GeForce RTX 4070 Ti (driver 621.40), and the AMD Radeon iGPU of a Ryzen 7 7800X3D (RDNA2) with XCL_ADAPTER=Radeon. Windows 11 Pro 26200, Rust 1.100.0 MSVC, DXC 1.8.2502.11. Debug builds for the tests, release for the runs.
  • cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4 on 496ef578:
    • RTX 4070 Ti: 1436 passed, 0 failed, 47 ignored.
    • RDNA2: 1435 passed, 1 failed, 47 ignored. The failure is gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, which fails the same way on main on this iGPU (#2115).
  • In the newer retail title with the same key on nvidia-dev af2cecc4 (1 GiB shader heap, through the world load), the count was 15,773 at 71 s, 42,457 at 121 s and 62,822 at 403 s. I have no count on this card without the change; the 31 % is GreemSC's (AMD / Linux, #2743).

Regression run

RTX 4070 Ti (driver 621.40), release builds, 60 s each, scripts/smoke.ps1 -Game <folder> -Title retail-title on the newer retail title, with the same settings. Both ran with the NVIDIA shader-heap profile (#2590, 1 GiB) installed on this machine. The PR's run shared the GPU with a test suite of mine for part of it. main b49be183 (this PR's base) and this PR's head (no uncommitted changes):

main:

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 4070 Ti
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1587 (PresentX 1587)
presents per 2 s (last 3): 60 58 48
device removals: 0
crashes: 0
peak commit: 15772 MB

PR:

xcl-smoke v1
commit: 496ef5780a4549fc3f15bc65340deb1db4794d6b
gpu: NVIDIA GeForce RTX 4070 Ti
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1374 (PresentX 1374)
presents per 2 s (last 3): 51 38 26
device removals: 0
crashes: 0
peak commit: 16909 MB

Not tested

  • How much the twins cost on Windows. Native D3D12 makes an unmapped reserved texture for about 3–9 KB of commit and no video memory (#2743), so on Windows this is mostly fewer objects. Under vkd3d-proton each costs more (GreemSC, #2743).
  • That every title leaves only padding in those bytes: Dimension is a 4-byte enum, followed by the 8-byte Alignment at 0x08, so 0x04..0x08 is padding in D3D12_RESOURCE_DESC.
  • AMD in a title.

AI use

  • Claude Code with Claude Opus 5.5 wrote the code, the test and this description, and ran the tests and the runs on the hardware above. GreemSC found and counted the padding twins (#2743).
<!-- greyfinch-sync:ivall/xcl:issue:5508674762 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2762). Originally posted by [joeypercia](https://github.com/joeypercia) on 2026-11-26T10:53:24Z. --- `resource_at` makes a placed texture for each new (address, description) of a view the title writes without a resource object (device #70 / #71, `CreateShaderResourceViewAtX` / `CreateUnorderedAccessViewAtX`), and keeps it for later views. Its key cleared the padding after the flags (bytes 0x34..0x38) but not the padding after `Dimension` (bytes 0x04..0x08). The newer retail title leaves that padding set, so the same view made another texture whenever it differed. @GreemSC counted 24,844 such twins among 80,953 textures in a 200 s run (31 %, #2743). This clears both. Part of #2743 and #2688. There's no eviction here. A version that let earlier textures go when a view covered their memory bounded the count on an RTX 4070 Ti (about 24,000 instead of 62,822 and climbing), but it didn't lower video memory. More than half of what it let go was made again, and its one run ended in the title's own breakpoint. Details are on #2743. **What is in it** (one commit, `crates/xcl/src/hle/d3d12x/real.rs`, `crates/xcl/src/host.rs`) - `view_key` clears both padding ranges of the 0x38-byte description. `resource_at` keys its map with it, and passes the cleared description on. - The activity line counts the textures kept (`views without a resource: N textures kept`). - Test `padding_does_not_make_another_texture`: two descriptions that differ only in their padding give one key, and a change of any other byte (dimension, width, format, flags) keeps them apart. It fails without the change (padding at 0x04). **Tested** - NVIDIA GeForce RTX 4070 Ti (driver 621.40), and the AMD Radeon iGPU of a Ryzen 7 7800X3D (RDNA2) with `XCL_ADAPTER=Radeon`. Windows 11 Pro 26200, Rust 1.100.0 MSVC, DXC 1.8.2502.11. Debug builds for the tests, release for the runs. - `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4` on `496ef578`: - RTX 4070 Ti: **1436 passed, 0 failed, 47 ignored**. - RDNA2: **1435 passed, 1 failed, 47 ignored**. The failure is `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`, which fails the same way on `main` on this iGPU (#2115). - In the newer retail title with the same key on `nvidia-dev` `af2cecc4` (1 GiB shader heap, through the world load), the count was 15,773 at 71 s, 42,457 at 121 s and 62,822 at 403 s. I have no count on this card without the change; the 31 % is GreemSC's (AMD / Linux, #2743). **Regression run** RTX 4070 Ti (driver 621.40), release builds, 60 s each, `scripts/smoke.ps1 -Game <folder> -Title retail-title` on the newer retail title, with the same settings. Both ran with the NVIDIA shader-heap profile (#2590, 1 GiB) installed on this machine. The PR's run shared the GPU with a test suite of mine for part of it. `main` `b49be183` (this PR's base) and this PR's head (no uncommitted changes): main: ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 4070 Ti title: retail-title seconds: 60 exit: 0x0 frames shown: 1587 (PresentX 1587) presents per 2 s (last 3): 60 58 48 device removals: 0 crashes: 0 peak commit: 15772 MB ``` PR: ``` xcl-smoke v1 commit: 496ef5780a4549fc3f15bc65340deb1db4794d6b gpu: NVIDIA GeForce RTX 4070 Ti title: retail-title seconds: 60 exit: 0x0 frames shown: 1374 (PresentX 1374) presents per 2 s (last 3): 51 38 26 device removals: 0 crashes: 0 peak commit: 16909 MB ``` **Not tested** - How much the twins cost on Windows. Native D3D12 makes an unmapped reserved texture for about 3–9 KB of commit and no video memory (#2743), so on Windows this is mostly fewer objects. Under vkd3d-proton each costs more (GreemSC, #2743). - That every title leaves only padding in those bytes: `Dimension` is a 4-byte enum, followed by the 8-byte `Alignment` at 0x08, so 0x04..0x08 is padding in `D3D12_RESOURCE_DESC`. - AMD in a title. **AI use** - Claude Code with Claude Opus 5.5 wrote the code, the test and this description, and ran the tests and the runs on the hardware above. GreemSC found and counted the padding twins (#2743).
luckyteagirl commented 2026-11-26 10:55:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T10:55:21Z.

Review: COMMENTED


On 496ef5780a4549fc3f15bc65340deb1db4794d6b, the new VIEW_TEXTURES activity count uses MADE.len(), but resource_at deliberately caches failed creations as a null pointer. A driver-refused descriptor therefore increases views without a resource: N textures kept even though no texture was created; repeated distinct failures can make this diagnostic grow during the OOM investigation that motivated the PR. Could the count include only non-null cached resources, or call it cache entries and report failures separately? A small map fixture with one successful pointer and one null entry could lock the meaning down. This is exact-head source review; I did not induce a D3D12 creation failure.

AI use: OpenAI Codex (GPT-6.2 Sol) found the count mismatch; OpenAI Codex (GPT-6.2 Astra) independently checked the source and wrote this review.

<!-- greyfinch-sync:ivall/xcl:review:6072874899 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2762#pullrequestreview-6072874899). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T10:55:21Z. **Review:** COMMENTED --- On `496ef5780a4549fc3f15bc65340deb1db4794d6b`, the new `VIEW_TEXTURES` activity count uses `MADE.len()`, but `resource_at` deliberately caches failed creations as a null pointer. A driver-refused descriptor therefore increases `views without a resource: N textures kept` even though no texture was created; repeated distinct failures can make this diagnostic grow during the OOM investigation that motivated the PR. Could the count include only non-null cached resources, or call it cache entries and report failures separately? A small map fixture with one successful pointer and one null entry could lock the meaning down. This is exact-head source review; I did not induce a D3D12 creation failure. AI use: OpenAI Codex (GPT-6.2 Sol) found the count mismatch; OpenAI Codex (GPT-6.2 Astra) independently checked the source and wrote this review.
thehollowedone commented 2026-11-26 11:05:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-26T10:59:27Z.


Independent Windows/NVIDIA test of PR #2762 head 496ef578, based on main b49be183. The checkout had no source changes.

Tested: RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, rustc 1.99.1 MSVC, DXC 1.8.2502.11. cargo build --offline --locked --workspace passed. cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 passed: 1,436 passed, 0 failed, 47 ignored. There were 25 GPU skip notices: 21 no wave64, 3 refused per-lane cases tracked in #1426, and 1 no heap windows. The PR's padding_does_not_make_another_texture test passed.

Not tested: a title run, matched smoke, or a measured reduction in texture count, memory, or frame time. The new unit test verifies key normalization; this suite does not by itself measure the retained-resource behavior in a retail workload.

AI use: Codex (GPT-6.2 Sol) inspected the diff, ran the commands on the hardware above, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7190111354 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2762#issuecomment-7190111354). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-26T10:59:27Z. --- Independent Windows/NVIDIA test of [PR #2762 head `496ef578`](https://github.com/xcl-dev/xcl/commit/496ef5780a4549fc3f15bc65340deb1db4794d6b), based on [`main` `b49be183`](https://github.com/xcl-dev/xcl/commit/b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7). The checkout had no source changes. **Tested:** RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, rustc 1.99.1 MSVC, DXC 1.8.2502.11. `cargo build --offline --locked --workspace` passed. `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4` passed: **1,436 passed, 0 failed, 47 ignored**. There were **25 GPU skip notices**: 21 no wave64, 3 refused per-lane cases tracked in #1426, and 1 no heap windows. The PR's `padding_does_not_make_another_texture` test passed. **Not tested:** a title run, matched smoke, or a measured reduction in texture count, memory, or frame time. The new unit test verifies key normalization; this suite does not by itself measure the retained-resource behavior in a retail workload. AI use: Codex (GPT-6.2 Sol) inspected the diff, ran the commands on the hardware above, and drafted this report.
GreemSC commented 2026-11-26 11:05:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by GreemSC on 2026-11-26T11:05:03Z.


Linux / AMD test of 496ef57: the same ~30 % fewer view-only textures under Wine, the new activity line matches an independent count, no crash.

Tested

  • RX 7900 XT 20 GB, Mesa 26.2.5 RADV, i7-12700K, 24 GB RAM (title capped at 16 GB + 1 GB swap), Linux 7.2, Proton-CachyOS Wine 11, vkd3d-proton with dxil-spirv 53aac41; xcl.exe release, cross-built for x86_64-pc-windows-msvc.
  • main b49be18 + the Wine stack this machine needs (#1732 with #867/#871/#877, #684, #1860, #2097, #2404, #2615, #2598, #751, diagnostics) + local counters, with and without this PR's diff (one conflict, in host.rs's activity block: both kept). Retail title, warm caches, 200 s, XCL_DIRECT_DXIL=1 XCL_DXC_THREADS=4 XCL_TEXTURE_LEVEL_PAGES=1. Without: 2 runs; with: 1 run.
at textures made by resource_at, without (2 runs) with this PR: local count / views without a resource: N textures kept
60 s 16,015 / 16,015 15,773 / 15,773
120 s 59,309 / 59,676 41,930 / 41,930
190 s 79,515 / 80,953 56,778 / 56,778
  • −29 % at 190 s, in line with the 31 % padding twins counted earlier on #2743.
  • The title's anonymous memory at 190 s: 12.76 / 12.47 GB without, 12.59 GB with: no difference measurable in 200 s (each entry is a few KB here).
  • With the PR: last present 198.8 s of 200, 0 crashes, 0 device removals; the intro cutscene's subtitles were on screen (seen by the machine's owner).

Not tested: Windows, NVIDIA, more than one run with the PR, runs past 200 s, a smoke pair on this machine (plain main under Wine stops at ~2.5 s).

AI use: Claude Code (Claude Opus 5.5) merged the trees, ran the runs and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7190241683 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2762#issuecomment-7190241683). Originally posted by [GreemSC](https://github.com/GreemSC) on 2026-11-26T11:05:03Z. --- **Linux / AMD test of `496ef57`: the same ~30 % fewer view-only textures under Wine, the new activity line matches an independent count, no crash.** **Tested** - RX 7900 XT 20 GB, Mesa 26.2.5 RADV, i7-12700K, 24 GB RAM (title capped at 16 GB + 1 GB swap), Linux 7.2, Proton-CachyOS Wine 11, vkd3d-proton with dxil-spirv 53aac41; `xcl.exe` release, cross-built for `x86_64-pc-windows-msvc`. - `main` `b49be18` + the Wine stack this machine needs (#1732 with #867/#871/#877, #684, #1860, #2097, #2404, #2615, #2598, #751, diagnostics) + local counters, with and without this PR's diff (one conflict, in `host.rs`'s activity block: both kept). Retail title, warm caches, 200 s, `XCL_DIRECT_DXIL=1 XCL_DXC_THREADS=4 XCL_TEXTURE_LEVEL_PAGES=1`. Without: 2 runs; with: 1 run. | at | textures made by `resource_at`, without (2 runs) | with this PR: local count / `views without a resource: N textures kept` | |---|---:|---:| | 60 s | 16,015 / 16,015 | 15,773 / 15,773 | | 120 s | 59,309 / 59,676 | 41,930 / 41,930 | | 190 s | 79,515 / 80,953 | **56,778 / 56,778** | - −29 % at 190 s, in line with the 31 % padding twins counted earlier on #2743. - The title's anonymous memory at 190 s: 12.76 / 12.47 GB without, 12.59 GB with: no difference measurable in 200 s (each entry is a few KB here). - With the PR: last present 198.8 s of 200, 0 crashes, 0 device removals; the intro cutscene's subtitles were on screen (seen by the machine's owner). **Not tested:** Windows, NVIDIA, more than one run with the PR, runs past 200 s, a smoke pair on this machine (plain `main` under Wine stops at ~2.5 s). AI use: Claude Code (Claude Opus 5.5) merged the trees, ran the runs and wrote this report.
CryingLaughing commented 2026-11-26 12:06:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by CryingLaughing on 2026-11-26T11:26:18Z.


On native D3D12 with an RTX 4080, changing only padding bytes 0x04..0x08 of one valid placed-texture description created another native resource on main. The same request reused the original resource on this head. The comparison uses the actual resource_at path and retains the resources while checking canonical COM identity.

Revision with the same test-only overlay Leading-padding request reused the original Unique native textures
Parent b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 No 3
Head 496ef5780a4549fc3f15bc65340deb1db4794d6b Yes 2

An exact repeat and the already-normalized trailing-padding control both reused the original on each revision. A second aligned title-memory address remained distinct. All resources were 64×64 RGBA8 shared-page textures.

Tested on RTX 4080 driver 621.01, i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC, DXC 1.8.2502.11. XCL_ADAPTER=4080. Overlay patch ID 9f77f5043af453cab2f6057d256816bb1c361004.

cargo test -p xcl --lib --locked -j 4 --no-run --message-format=json, then the test executable with hle::d3d12x::real::resource_at_identity_fixture::resource_at_reuses_texture_across_padding_only_changes --exact --test-threads=1 --nocapture. 1 passed, 0 failed, 0 ignored, 0 capability skips per revision. This measures resource identity. Retail memory use and the workspace suite with the overlay remain untested.

<!-- greyfinch-sync:ivall/xcl:comment:7190727078 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2762#issuecomment-7190727078). Originally posted by [CryingLaughing](https://github.com/CryingLaughing) on 2026-11-26T11:26:18Z. --- On native D3D12 with an RTX 4080, changing only padding bytes `0x04..0x08` of one valid placed-texture description created another native resource on main. The same request reused the original resource on this head. The comparison uses the actual `resource_at` path and retains the resources while checking canonical COM identity. | Revision with the same test-only overlay | Leading-padding request reused the original | Unique native textures | | --- | --- | ---: | | Parent `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7` | No | 3 | | Head `496ef5780a4549fc3f15bc65340deb1db4794d6b` | Yes | 2 | An exact repeat and the already-normalized trailing-padding control both reused the original on each revision. A second aligned title-memory address remained distinct. All resources were 64×64 RGBA8 shared-page textures. **Tested** on RTX 4080 driver 621.01, i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC, DXC 1.8.2502.11. `XCL_ADAPTER=4080`. Overlay patch ID `9f77f5043af453cab2f6057d256816bb1c361004`. `cargo test -p xcl --lib --locked -j 4 --no-run --message-format=json`, then the test executable with `hle::d3d12x::real::resource_at_identity_fixture::resource_at_reuses_texture_across_padding_only_changes --exact --test-threads=1 --nocapture`. **1 passed, 0 failed, 0 ignored, 0 capability skips per revision**. This measures resource identity. Retail memory use and the workspace suite with the overlay remain untested.
GodlyBDS commented 2026-11-26 12:07:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by GodlyBDS on 2026-11-26T11:49:39Z.


Independent RTX 3090 Ti validation of 496ef5780a4549fc3f15bc65340deb1db4794d6b on NVIDIA base af2cecc40886a8682ecf3267f5328c6dc4b66ad7, Windows 10, driver 621.40, 32 GiB RAM. This was an isolated backport. The upstream padding_does_not_make_another_texture regression passed.

I replayed the same world transition with the same 11,721 starting native PSO blobs, translated cache seed, runtime settings, GPU timestamps, DRED, and 1 GiB application-specific shader heap profile. The change was the view key normalization and cache-size counter.

Replay Outcome Last measured DXGI local usage
Control 0x887a0005 at 123.742 s, no matching Windows recovery event or DRED breadcrumbs 17,142 MiB
#2762 0x887a0006 at 111.715 s, nvlddmkm 153 and Display 4101 17,113 MiB

The #2762 run reported 41,329 retained view-at entries before removal. The control lacked that counter. The partially executed DRED list completed 56 of 921 operations, with a Dispatch next and no usable shader label for its bound PSO. The fault VA was zero. The last memory sample left about 13,230 MiB of system commit headroom. Neither replay produced a verified world frame.

This independently validates coverage of the descriptor padding case. The two retail replays are single samples and do not establish a change in cache cardinality, memory use, or device-removal frequency from this fix.

AI assistance was used to run the tests and prepare this report.

<!-- greyfinch-sync:ivall/xcl:comment:7191215772 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2762#issuecomment-7191215772). Originally posted by [GodlyBDS](https://github.com/GodlyBDS) on 2026-11-26T11:49:39Z. --- Independent RTX 3090 Ti validation of `496ef5780a4549fc3f15bc65340deb1db4794d6b` on NVIDIA base `af2cecc40886a8682ecf3267f5328c6dc4b66ad7`, Windows 10, driver 621.40, 32 GiB RAM. This was an isolated backport. The upstream `padding_does_not_make_another_texture` regression passed. I replayed the same world transition with the same 11,721 starting native PSO blobs, translated cache seed, runtime settings, GPU timestamps, DRED, and 1 GiB application-specific shader heap profile. The change was the view key normalization and cache-size counter. | Replay | Outcome | Last measured DXGI local usage | |---|---|---:| | Control | `0x887a0005` at 123.742 s, no matching Windows recovery event or DRED breadcrumbs | 17,142 MiB | | #2762 | `0x887a0006` at 111.715 s, nvlddmkm 153 and Display 4101 | 17,113 MiB | The #2762 run reported 41,329 retained view-at entries before removal. The control lacked that counter. The partially executed DRED list completed 56 of 921 operations, with a Dispatch next and no usable shader label for its bound PSO. The fault VA was zero. The last memory sample left about 13,230 MiB of system commit headroom. Neither replay produced a verified world frame. This independently validates coverage of the descriptor padding case. The two retail replays are single samples and do not establish a change in cache cardinality, memory use, or device-removal frequency from this fix. AI assistance was used to run the tests and prepare this report.
Royalflamejlh commented 2026-11-26 15:03:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-26T14:39:28Z.


Under Wine + vkd3d-proton on an RTX 4070, this pull request kept 31 % fewer textures for views without a resource (GreemSC's RADV run showed 29 to 30 %): 41,136 to 41,369 at 118 s in 3 runs, against 59,564 to 60,240 in 3 runs with the old key. In all 3 runs with it, the title reached the same stop sooner, a burst of about 7,000 dispatches after which nothing is presented: its last presents ended at 64.1 to 66.2 s against 72.0 to 76.2 s, and its first call to #101 came at 49.5 to 64.1 s against 69.9 to 74.1 s.

Setup: main b49be18 + #684 (e56dbc3, which our runs need to get this far) + this pull request (496ef578), against the same tree with view_key clearing only 0x34.. as main does, so that both trees print the count. Release, Wine 11.21 Staging + vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch, RTX 4070 12 GB, driver 615.71.09. 120 s each, the two trees in turn, A pressed once the title presented steadily, XCL_PSO_PRELOAD=0, the first-run screens completed once, no story progress.

Run Key A pressed Textures at 30 s at 60 s at 118 s First #101 Last 2 s with presents ends
1 old 16.2 s 654 49,931 60,070 69.9 s 72.0 s
2 this PR 16.2 s 611 37,804 41,245 64.1 s 66.1 s
3 old 16.4 s 654 49,478 60,240 72.4 s 74.1 s
4 this PR 16.1 s 611 37,080 41,369 52.2 s 64.1 s
5 old 16.5 s 654 44,807 59,564 74.1 s 76.2 s
6 this PR 16.0 s 611 37,634 41,136 49.5 s 66.2 s
  • The counts are the views without a resource: N textures kept line this pull request adds, read at the last line at or before each time. No run logged the resource cannot be made, so in these runs every entry the line counts is a texture.
  • #101 is the title's first call to the stub ID3D12GraphicsCommandList10::#101. In the 3 old-key runs and 10 more on the same base tonight (#684 alone, or with one or two other pull requests, A pressed at 16.2 to 18.4 s), the last presents ended at 72.0 to 86.7 s (one run, with #2611 and #2615, presented to the end) and the first #101 came at 62.2 to 83.4 s.
  • Video memory at 118 s was 10,021 to 10,059 MB local and 7,932 to 8,131 MB non-local, the same with both keys, so these runs show no saving in memory.
  • padding_does_not_make_another_texture passed under Wine. No run lost the device.

Not tested: Windows; the title past the point where it stops here; the whole test suite.

AI use: Claude Code (Claude Opus 5.5) ran the title and the tests and wrote this comment.

Posted without review by a person: the account owner was away and reads replies later.

<!-- greyfinch-sync:ivall/xcl:comment:7195134140 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2762#issuecomment-7195134140). Originally posted by [Royalflamejlh](https://github.com/Royalflamejlh) on 2026-11-26T14:39:28Z. --- Under Wine + vkd3d-proton on an RTX 4070, this pull request kept 31 % fewer textures for views without a resource (GreemSC's RADV run showed 29 to 30 %): 41,136 to 41,369 at 118 s in 3 runs, against 59,564 to 60,240 in 3 runs with the old key. In all 3 runs with it, the title reached the same stop sooner, a burst of about 7,000 dispatches after which nothing is presented: its last presents ended at 64.1 to 66.2 s against 72.0 to 76.2 s, and its first call to `#101` came at 49.5 to 64.1 s against 69.9 to 74.1 s. Setup: `main` `b49be18` + #684 (`e56dbc3`, which our runs need to get this far) + this pull request (`496ef578`), against the same tree with `view_key` clearing only `0x34..` as `main` does, so that both trees print the count. Release, Wine 11.21 Staging + vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch, RTX 4070 12 GB, driver 615.71.09. 120 s each, the two trees in turn, A pressed once the title presented steadily, `XCL_PSO_PRELOAD=0`, the first-run screens completed once, no story progress. | Run | Key | A pressed | Textures at 30 s | at 60 s | at 118 s | First `#101` | Last 2 s with presents ends | |---|---|---|---|---|---|---|---| | 1 | old | 16.2 s | 654 | 49,931 | 60,070 | 69.9 s | 72.0 s | | 2 | this PR | 16.2 s | 611 | 37,804 | 41,245 | 64.1 s | 66.1 s | | 3 | old | 16.4 s | 654 | 49,478 | 60,240 | 72.4 s | 74.1 s | | 4 | this PR | 16.1 s | 611 | 37,080 | 41,369 | 52.2 s | 64.1 s | | 5 | old | 16.5 s | 654 | 44,807 | 59,564 | 74.1 s | 76.2 s | | 6 | this PR | 16.0 s | 611 | 37,634 | 41,136 | 49.5 s | 66.2 s | - The counts are the `views without a resource: N textures kept` line this pull request adds, read at the last line at or before each time. No run logged `the resource cannot be made`, so in these runs every entry the line counts is a texture. - `#101` is the title's first call to the stub `ID3D12GraphicsCommandList10::#101`. In the 3 old-key runs and 10 more on the same base tonight (#684 alone, or with one or two other pull requests, A pressed at 16.2 to 18.4 s), the last presents ended at 72.0 to 86.7 s (one run, with #2611 and #2615, presented to the end) and the first `#101` came at 62.2 to 83.4 s. - Video memory at 118 s was 10,021 to 10,059 MB local and 7,932 to 8,131 MB non-local, the same with both keys, so these runs show no saving in memory. - `padding_does_not_make_another_texture` passed under Wine. No run lost the device. **Not tested:** Windows; the title past the point where it stops here; the whole test suite. **AI use:** Claude Code (Claude Opus 5.5) ran the title and the tests and wrote this comment. Posted without review by a person: the account owner was away and reads replies later.
Decodere commented 2026-11-26 22:02:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-26T22:02:16Z.


Independent desktop NVIDIA verification of PR #2762 at head 496ef5780a4549fc3f15bc65340deb1db4794d6b (1 commit; exact parent & merge-base: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7, pre-#2555 ancestor of main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted release tests & build (496ef578)

Command Result
cargo test --release -p xcl --lib padding_does_not_make_another_texture -- --nocapture 1 passed; 0 failed; 0 ignored; 1336 filtered out (0.00s)
cargo test --release -p xcl --lib hle::d3d12x::real:: (3 consecutive runs) 61 passed; 0 failed; 0 ignored; 1276 filtered out × 3 (0.35s, 0.36s, 0.37s)
cargo build --release -p xcl --bin xcl Clean build (1m 16s, exit 0)

Paired quiet 60 s retail smoke (title: 29640639)

Exact parent & merge-base (b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7, cached baseline on the same machine):

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1518 (PresentX 1518)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14018 MB

PR #2762 (496ef5780a4549fc3f15bc65340deb1db4794d6b):

xcl-smoke v1
commit: 496ef5780a4549fc3f15bc65340deb1db4794d6b
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1593 (PresentX 1593)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14005 MB

Runtime log observations (xcl.log)

  • 9249 log lines, 0 [ERROR] / device-removal / panic lines.
  • New activity-line counter active throughout the smoke (37 samples): steady at views without a resource: 540 textures kept by 50.2 s through 58.2 s.
  • Final draw/memory telemetry in log: 19540 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample 14004 MB committed by the process; video memory 6115 MB local, 4684 MB non-local.

Limits of coverage

  • View-key padding zeroing (bytes 4..8 after Dimension as well as trailing padding after Flags) was verified directly via padding_does_not_make_another_texture and 3× hle::d3d12x::real::, while the 60 s retail smoke exercised resource_at live (views without a resource: 540 textures kept) with zero errors or removals.
  • No multi-minute in-world soak measuring total duplicate-texture reduction vs. an instrumented pre-PR build was performed (the 60 s menu capture verifies clean runtime behavior and telemetry rather than the 200 s world-load count). Frame-count delta vs. the cached parent smoke (1593 vs. 1518) reflects normal single-run startup variance and is not attributed to this PR.

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7204295138 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2762#issuecomment-7204295138). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-26T22:02:16Z. --- Independent desktop NVIDIA verification of **PR #2762** at head `496ef5780a4549fc3f15bc65340deb1db4794d6b` (`1` commit; exact parent & merge-base: `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`, pre-`#2555` ancestor of `main`). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted release tests & build (`496ef578`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib padding_does_not_make_another_texture -- --nocapture` | `1 passed; 0 failed; 0 ignored; 1336 filtered out` (`0.00s`) | | `cargo test --release -p xcl --lib hle::d3d12x::real::` (3 consecutive runs) | `61 passed; 0 failed; 0 ignored; 1276 filtered out` × 3 (`0.35s`, `0.36s`, `0.37s`) | | `cargo build --release -p xcl --bin xcl` | Clean build (`1m 16s`, exit `0`) | ### Paired quiet 60 s retail smoke (`title: 29640639`) Exact parent & merge-base (`b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`, cached baseline on the same machine): ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1518 (PresentX 1518) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14018 MB ``` PR #2762 (`496ef5780a4549fc3f15bc65340deb1db4794d6b`): ``` xcl-smoke v1 commit: 496ef5780a4549fc3f15bc65340deb1db4794d6b gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1593 (PresentX 1593) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14005 MB ``` ### Runtime log observations (`xcl.log`) - `9249` log lines, `0` `[ERROR]` / device-removal / panic lines. - New activity-line counter active throughout the smoke (`37` samples): steady at `views without a resource: 540 textures kept` by `50.2 s` through `58.2 s`. - Final draw/memory telemetry in log: `19540 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped)`; last memory sample `14004 MB committed by the process; video memory 6115 MB local, 4684 MB non-local`. ### Limits of coverage - View-key padding zeroing (bytes `4..8` after `Dimension` as well as trailing padding after `Flags`) was verified directly via `padding_does_not_make_another_texture` and 3× `hle::d3d12x::real::`, while the 60 s retail smoke exercised `resource_at` live (`views without a resource: 540 textures kept`) with zero errors or removals. - No multi-minute in-world soak measuring total duplicate-texture reduction vs. an instrumented pre-PR build was performed (the 60 s menu capture verifies clean runtime behavior and telemetry rather than the 200 s world-load count). Frame-count delta vs. the cached parent smoke (`1593` vs. `1518`) reflects normal single-run startup variance and is not attributed to this PR. *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
CharlyRien commented 2026-11-27 21:19:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by CharlyRien on 2026-11-27T21:19:56Z.


@joeypercia a 3090 data point for the padding key, from a port, not a test of 496ef578. Our patch 0023 keys view-by-address textures without the same two ranges (desc bytes 4..8 and 0x34..), behind XCL_TEX_KEY_PAD=1, on our lab tree. No build of this head, no suite and no smoke pair here. #3000 zeroes the same two ranges (#1607 lists the two PRs as the same change and suggests this one), so this holds for both.

What differs from the PR (patch 0023): with the switch on, the texture already made for the key is served, which is what the PR's key does. With it off, our tree makes them again as before and counts them. The PR's own test was not run here.

Measured (the retail title, one run each, 420 s in the world):

  • With the switch: 82,395 textures made by address, and 74,007 pad-only duplicates served instead of made.
  • Texture evictions: 24,958, against 39,124 in the same tree without the patch (−36 %).
  • Pace: 3.50 presents/s against 3.12. GPU busy median: 245 ms per frame against 287 ms. Two runs of one setup differ by ±7 % here, so read the pace as a direction.
  • 0 device removals.

Not credited to the change: in that run the character heads were drawn again (still blue-lit). Later runs showed that on our setup whether characters are whole changes from run to run, from the DispatchX overrun (#2610). @jessenic saw 28–35k pad-only duplicates served per 430 s run on an RTX 5070 Ti, and no head back (#505, 7221855392).

Not tested

  • This head (496ef578) or #3000's head as built, the suite, a smoke pair against main.
  • AMD and Intel.

Setup: MacieGx's lab 59986ef + 47d0eac + #2934 + our patches 0001-0023 (lab-patches/fix-waits); the run without the patch is 0001-0022. Env: MacieGx's #505 env (7200417753) + XCL_PAGE_BUDGET_MB=4096 XCL_LOOK_JOIN=0 XCL_CHAIN_WHOLE=1 XCL_WATCH_TRAP=1 XCL_CALL_STATS=1 XCL_FENCE_DIRECT=1 XCL_SPARSE_MAP_NOWAIT=1 XCL_USE_RANGE_HIT=1 XCL_FILTER_INDEX=1 XCL_SPARSE_SCATTER=1; the run with the change adds XCL_TEX_KEY_PAD=1. RTX 3090 24 GB (Resizable BAR off), driver 616.56, Ryzen 9 5950X, 32 GB RAM, Windows 11 22631.

AI use: Claude Code, model Claude Opus 5.5. It wrote the patch, ran the runs, read the logs, and wrote this. The person running these tests asked for this post.

<!-- greyfinch-sync:ivall/xcl:comment:7228347772 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2762#issuecomment-7228347772). Originally posted by [CharlyRien](https://github.com/CharlyRien) on 2026-11-27T21:19:56Z. --- @joeypercia a 3090 data point for the padding key, from a port, **not a test of `496ef578`**. Our patch 0023 keys view-by-address textures without the same two ranges (desc bytes 4..8 and 0x34..), behind `XCL_TEX_KEY_PAD=1`, on our lab tree. No build of this head, no suite and no smoke pair here. #3000 zeroes the same two ranges (#1607 lists the two PRs as the same change and suggests this one), so this holds for both. **What differs from the PR** ([patch 0023](https://github.com/CharlyRien/xcl/blob/lab-patches/fix-waits/patches/0023-Lab-XCL_TEX_KEY_PAD-1-keys-view-by-address-textures-.patch)): with the switch on, the texture already made for the key is served, which is what the PR's key does. With it off, our tree makes them again as before and counts them. The PR's own test was not run here. **Measured (the retail title, one run each, 420 s in the world):** - With the switch: 82,395 textures made by address, and 74,007 pad-only duplicates served instead of made. - Texture evictions: 24,958, against 39,124 in the same tree without the patch (−36 %). - Pace: 3.50 presents/s against 3.12. GPU busy median: 245 ms per frame against 287 ms. Two runs of one setup differ by ±7 % here, so read the pace as a direction. - 0 device removals. **Not credited to the change:** in that run the character heads were drawn again (still blue-lit). Later runs showed that on our setup whether characters are whole changes from run to run, from the `DispatchX` overrun (#2610). @jessenic saw 28–35k pad-only duplicates served per 430 s run on an RTX 5070 Ti, and no head back (#505, 7221855392). **Not tested** - This head (`496ef578`) or #3000's head as built, the suite, a smoke pair against `main`. - AMD and Intel. **Setup:** MacieGx's lab `59986ef` + `47d0eac` + #2934 + our patches 0001-0023 ([`lab-patches/fix-waits`](https://github.com/CharlyRien/xcl/tree/lab-patches/fix-waits)); the run without the patch is 0001-0022. Env: MacieGx's #505 env (7200417753) + `XCL_PAGE_BUDGET_MB=4096 XCL_LOOK_JOIN=0 XCL_CHAIN_WHOLE=1 XCL_WATCH_TRAP=1 XCL_CALL_STATS=1 XCL_FENCE_DIRECT=1 XCL_SPARSE_MAP_NOWAIT=1 XCL_USE_RANGE_HIT=1 XCL_FILTER_INDEX=1 XCL_SPARSE_SCATTER=1`; the run with the change adds `XCL_TEX_KEY_PAD=1`. RTX 3090 24 GB (Resizable BAR off), driver 616.56, Ryzen 9 5950X, 32 GB RAM, Windows 11 22631. **AI use:** Claude Code, model Claude Opus 5.5. It wrote the patch, ran the runs, read the logs, and wrote this. The person running these tests asked for this post.
joeypercia commented 2026-11-28 21:03:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by joeypercia on 2026-11-28T21:03:56Z.


#3000 (@voiceovarian1-max) makes the same change (zeroing desc bytes 4..8 and 0x34.. before keying a view-by-address texture), and #1607 lists the two as one. I'm not going to rebase this after the nvidia-dev merge; whichever of the two the maintainers prefer is fine with me. @CharlyRien's RTX 3090 numbers above (about 74,000 pad-only duplicates served instead of made, 36 % fewer texture evictions) apply to both.

<!-- greyfinch-sync:ivall/xcl:comment:7245745856 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2762#issuecomment-7245745856). Originally posted by [joeypercia](https://github.com/joeypercia) on 2026-11-28T21:03:56Z. --- #3000 (@voiceovarian1-max) makes the same change (zeroing desc bytes 4..8 and 0x34.. before keying a view-by-address texture), and #1607 lists the two as one. I'm not going to rebase this after the `nvidia-dev` merge; whichever of the two the maintainers prefer is fine with me. @CharlyRien's RTX 3090 numbers above (about 74,000 pad-only duplicates served instead of made, 36 % fewer texture evictions) apply to both.
Royalflamejlh commented 2026-11-30 02:51:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-30T02:51:11Z.


@joeypercia this conflicts with main (1c5acde4) in crates/xcl/src/host.rs, which keeps it out of the merge queue (#3041). Could you rebase it onto main? The Linux branch in #3067 carries it for #2743 (one texture per view-by-address).

AI use: Claude Code (Claude Fable 5.2) made the trial merge and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7267373386 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2762#issuecomment-7267373386). Originally posted by [Royalflamejlh](https://github.com/Royalflamejlh) on 2026-11-30T02:51:11Z. --- @joeypercia this conflicts with `main` (`1c5acde4`) in `crates/xcl/src/host.rs`, which keeps it out of the merge queue (#3041). Could you rebase it onto `main`? The Linux branch in #3067 carries it for #2743 (one texture per view-by-address). AI use: Claude Code (Claude Fable 5.2) made the trial merge and wrote this.
Foniass commented 2026-12-01 08:54:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:54:08Z.


Triage (#1607) – head 496ef57

#3000 made the same change (zeroing the padding at 0x04..0x08 and 0x34..0x38 of the view-by-address desc before it keys a texture in resource_at) and was closed as a duplicate of this PR. main still zeroes only 0x34..0x38. Offsets match D3D12_RESOURCE_DESC (Dimension u32 at 0, Alignment u64 at 8, Flags u32 at 0x30), and the test checks that both padding ranges are ignored and that real fields still change the key. No problems found in the diff; the branch conflicts with main and needs a rebase.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7305935935 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2762#issuecomment-7305935935). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:54:08Z. --- **Triage (#1607)** – head 496ef57 #3000 made the same change (zeroing the padding at 0x04..0x08 and 0x34..0x38 of the view-by-address desc before it keys a texture in `resource_at`) and was closed as a duplicate of this PR. main still zeroes only 0x34..0x38. Offsets match `D3D12_RESOURCE_DESC` (Dimension u32 at 0, Alignment u64 at 8, Flags u32 at 0x30), and the test checks that both padding ranges are ignored and that real fields still change the key. No problems found in the diff; the branch conflicts with main and needs a rebase. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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/2762:upstream-pr/2762'
git switch 'upstream-pr/2762'

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/2762'
git switch 'upstream-pr/2762'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2762'
git switch 'upstream-pr/2762'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2762'
git switch 'main'
git merge --squash 'upstream-pr/2762'
git switch 'main'
git merge --ff-only 'upstream-pr/2762'
git switch 'main'
git merge 'upstream-pr/2762'
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
xcl-dev/xcl!2752
No description provided.