D3D12.X: faster title texture uploads (reused upload memory, faster detiling) #451

Manually merged
github merged 4 commits from gh-pr/451/head into gh-pr/451/base 2026-11-26 04:22:15 +00:00
Owner

@⁠1984742628 on GitHub · 2026-11-24 00:31 UTC · original
1984742628:perf/reuse-upload-memory → main · +365 −28 · 3 files · 4 commits · merged 2026-11-24 01:56 UTC

A retail title that rewrites textures with the CPU (kept in step with its memory by title_textures) fell to 1 – 3 frames a second on an NVIDIA RTX 3070 Ti once it streamed them. The time went to uploading those textures inside the title's own submit and present: D3D12 objects made and released for every upload, then detiling every texel through a full offset computation, one texture after another. This PR makes the uploads reuse their D3D12 objects and detiles faster and in parallel, and now also carries #440's linear fast path (by @⁠emirduran707, see the 4th commit), which speeds up the linear levels this PR's per-row form only helped 3×. In back-to-back runs of the title the combined change is the only build that reaches the title's 30 fps cap at the end of a 60 s run.

What is in it

  • D3D12.X: title texture uploads reuse their queue's buffer and list (gpu/texture.rs): upload_batch made an upload buffer per texture and an allocator, a list and a fence per batch – each a call that waits for the video memory manager, 200 – 650 ms apiece while the title streamed (timed in its runs). Each upload queue now keeps one persistently mapped upload buffer (grown only when a batch needs more; textures at 512-byte aligned offsets), its allocator and list (reset) and a fence. When a batch's wait times out, the set is retired and kept alive instead of released under the GPU, which removed the device. record_upload_states keeps its behaviour for its other callers.
  • Textures: detiling a mip level computes column and row parts once (gpu/tiling.rs): Chain::detile_level computed Layout::offset_z for every element (divisions, modulos, six lookups). The x-only parts are now computed once per level and the y/slice parts once per row: two lookups and an XOR per element, byte for byte the same result.
  • D3D12.X: the title textures of a big batch are detiled on several threads (hle/d3d12x/title_textures.rs): batches of 1 MB or more are detiled on up to 8 threads (half the cores), in order; smaller batches stay on the calling thread.
  • Textures: linear levels are detiled a row at a time (gpu/tiling.rs, authored by @⁠emirduran707, from #440 be722a7): a linear level (mode 0, no base swizzle, not in a mip tail) has contiguous rows, so they are copied whole, in front of the per-row loop above; which elements are copied from a source cut short is unchanged. #440 can be closed if this lands.
  • Tests: detile_level_matches_element_by_element (every swizzled mode, element size, pipe configuration and level including mip tails, a base swizzle, two slices, a source cut short), linear_levels_detile_by_rows_as_by_elements (from #440: every element size, padded rows, every mip, a source cut short inside a row and inside an element), gpu_upload_batches_reuse_the_queues_upload_buffer (two batches of three textures – mips, an odd size, BC7 – read back exactly, and the second batch made no new upload buffer), a_batch_detiled_on_several_threads_matches_one_thread (2, 3 and 8 threads against one).

Tested

  • hardware (GPU + driver, CPU), Rust version, debug / release: NVIDIA GeForce RTX 3070 Ti 8 GB (driver 32.0.16.2124), AMD Ryzen 9 7950X (16 cores / 32 threads), 32 GB RAM, Windows 11 10.0.26100, rustc 1.98.0; tests in debug, timings and title runs in release.
  • cargo test --workspace -- --test-threads=4 at 1f282c7 with no uncommitted changes: 680 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2, both "no wave64": gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware). The XCL_SAMPLE_* variables were not set, so the tests on game data did nothing.
  • Each commit builds with its tests on its own.
  • detile_level alone (a local timing test, not committed; best of 7, release, the levels @⁠emirduran707 timed):
level main 2997c9a #440 be722a7 this PR before #440 2cefc88 this PR 1f282c7
3840x2160 R8, linear 66.0 ms 0.87 ms 13.5 ms 0.86 ms
1920x1080 R8, linear 16.5 ms 0.22 ms 3.7 ms 0.23 ms
2048x2048 RGBA8, 64KB_S, 8 pipes 41.2 ms 41.9 ms 15.7 ms 15.1 ms
  • The retail title, scripts/smoke.ps1 60 s, two runs per build one after another (same session, no input): main 260 / 292 frames (last 6 s: 3 – 5 presents per 2 s); #440 alone 231 / 295 (0 – 5); this PR before #440 552 / 553 (1); this PR 670 / 1011 (60, the title's 30 fps cap). No crash or device removal in any of them. The frame counts vary from run to run and between sessions (main showed 720 in the regression run below, in an earlier session), so only runs of one session are compared.

Regression run
scripts/smoke.ps1 -Game <the title's folder> -Xcl target\release\xcl.exe (60 s), built from main and from this PR's head with no uncommitted changes. (Windows PowerShell 5.1 does not set $PSScriptRoot in the parameter default, hence -Xcl.)

main:

xcl-smoke v1
commit: a6f5f7a74cc620c1f88a9e3669a633d10c3c8212
gpu: NVIDIA GeForce RTX 3070 Ti
title: RetailGame
seconds: 60
exit: 0x0
frames shown: 720 (PresentX 721)
presents per 2 s (last 3): 30 29 26
device removals: 0
crashes: 0
peak commit: 14594 MB

PR:

xcl-smoke v1
commit: 1f282c737b5637b58de4847cacde208d23504ed7
gpu: NVIDIA GeForce RTX 3070 Ti
title: RetailGame
seconds: 60
exit: 0x0
frames shown: 1094 (PresentX 1105)
presents per 2 s (last 3): 53 60 59
device removals: 0
crashes: 0
peak commit: 15156 MB

Not tested

  • One title; two runs per build in the comparison, one in the regression run: frame counts vary a lot between runs and sessions.
  • Not tested on AMD or Intel GPUs here (#440's own runs were on an RX 9060 XT).
  • tests/texture_states.rs (upload barriers checked by the D3D12 debug layer) skips here: the debug layer is not installed.
  • The title's intro video (the linear planes #440 targets) was not started by hand in these runs.
  • The upload buffer is kept per queue for the process and only grows (up to a batch: BATCH_BYTES, 256 MB, plus one texture); it is not shrunk.

AI use

  • Claude Code with Claude Opus 5.5: profiled the title's runs (per-thread CPU, thread dumps named from a symbol build), wrote the first three commits and their tests, placed #440's change in front of the per-row loop, ran the test suite, the timings, the title runs and the regression runs above, and wrote the commit messages and this description. The 4th commit is @⁠emirduran707's #440 (its own commit says Claude Code with Claude Opus 5.5).
**@⁠1984742628** on GitHub · 2026-11-24 00:31 UTC · [original](https://github.com/xcl-dev/xcl/pull/451) `1984742628:perf/reuse-upload-memory` → `main` · +365 −28 · 3 files · 4 commits · merged 2026-11-24 01:56 UTC A retail title that rewrites textures with the CPU (kept in step with its memory by `title_textures`) fell to 1 – 3 frames a second on an NVIDIA RTX 3070 Ti once it streamed them. The time went to uploading those textures inside the title's own submit and present: D3D12 objects made and released for every upload, then detiling every texel through a full offset computation, one texture after another. This PR makes the uploads reuse their D3D12 objects and detiles faster and in parallel, and now also carries #440's linear fast path (by @⁠emirduran707, see the 4th commit), which speeds up the linear levels this PR's per-row form only helped 3×. In back-to-back runs of the title the combined change is the only build that reaches the title's 30 fps cap at the end of a 60 s run. **What is in it** - `D3D12.X: title texture uploads reuse their queue's buffer and list` (`gpu/texture.rs`): `upload_batch` made an upload buffer per texture and an allocator, a list and a fence per batch – each a call that waits for the video memory manager, 200 – 650 ms apiece while the title streamed (timed in its runs). Each upload queue now keeps one persistently mapped upload buffer (grown only when a batch needs more; textures at 512-byte aligned offsets), its allocator and list (reset) and a fence. When a batch's wait times out, the set is retired and kept alive instead of released under the GPU, which removed the device. `record_upload_states` keeps its behaviour for its other callers. - `Textures: detiling a mip level computes column and row parts once` (`gpu/tiling.rs`): `Chain::detile_level` computed `Layout::offset_z` for every element (divisions, modulos, six lookups). The x-only parts are now computed once per level and the y/slice parts once per row: two lookups and an XOR per element, byte for byte the same result. - `D3D12.X: the title textures of a big batch are detiled on several threads` (`hle/d3d12x/title_textures.rs`): batches of 1 MB or more are detiled on up to 8 threads (half the cores), in order; smaller batches stay on the calling thread. - `Textures: linear levels are detiled a row at a time` (`gpu/tiling.rs`, authored by @⁠emirduran707, from #440 `be722a7`): a linear level (mode 0, no base swizzle, not in a mip tail) has contiguous rows, so they are copied whole, in front of the per-row loop above; which elements are copied from a source cut short is unchanged. #440 can be closed if this lands. - Tests: `detile_level_matches_element_by_element` (every swizzled mode, element size, pipe configuration and level including mip tails, a base swizzle, two slices, a source cut short), `linear_levels_detile_by_rows_as_by_elements` (from #440: every element size, padded rows, every mip, a source cut short inside a row and inside an element), `gpu_upload_batches_reuse_the_queues_upload_buffer` (two batches of three textures – mips, an odd size, BC7 – read back exactly, and the second batch made no new upload buffer), `a_batch_detiled_on_several_threads_matches_one_thread` (2, 3 and 8 threads against one). **Tested** - hardware (GPU + driver, CPU), Rust version, debug / release: NVIDIA GeForce RTX 3070 Ti 8 GB (driver 32.0.16.2124), AMD Ryzen 9 7950X (16 cores / 32 threads), 32 GB RAM, Windows 11 10.0.26100, rustc 1.98.0; tests in debug, timings and title runs in release. - `cargo test --workspace -- --test-threads=4` at `1f282c7` with no uncommitted changes: 680 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2, both "no wave64": `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`). The `XCL_SAMPLE_*` variables were not set, so the tests on game data did nothing. - Each commit builds with its tests on its own. - `detile_level` alone (a local timing test, not committed; best of 7, release, the levels @⁠emirduran707 timed): | level | main `2997c9a` | #440 `be722a7` | this PR before #440 `2cefc88` | this PR `1f282c7` | |---|---|---|---|---| | 3840x2160 R8, linear | 66.0 ms | 0.87 ms | 13.5 ms | 0.86 ms | | 1920x1080 R8, linear | 16.5 ms | 0.22 ms | 3.7 ms | 0.23 ms | | 2048x2048 RGBA8, 64KB_S, 8 pipes | 41.2 ms | 41.9 ms | 15.7 ms | 15.1 ms | - The retail title, `scripts/smoke.ps1` 60 s, two runs per build one after another (same session, no input): main 260 / 292 frames (last 6 s: 3 – 5 presents per 2 s); #440 alone 231 / 295 (0 – 5); this PR before #440 552 / 553 (1); this PR 670 / 1011 (60, the title's 30 fps cap). No crash or device removal in any of them. The frame counts vary from run to run and between sessions (main showed 720 in the regression run below, in an earlier session), so only runs of one session are compared. **Regression run** `scripts/smoke.ps1 -Game <the title's folder> -Xcl target\release\xcl.exe` (60 s), built from main and from this PR's head with no uncommitted changes. (Windows PowerShell 5.1 does not set `$PSScriptRoot` in the parameter default, hence `-Xcl`.) main: ``` xcl-smoke v1 commit: a6f5f7a74cc620c1f88a9e3669a633d10c3c8212 gpu: NVIDIA GeForce RTX 3070 Ti title: RetailGame seconds: 60 exit: 0x0 frames shown: 720 (PresentX 721) presents per 2 s (last 3): 30 29 26 device removals: 0 crashes: 0 peak commit: 14594 MB ``` PR: ``` xcl-smoke v1 commit: 1f282c737b5637b58de4847cacde208d23504ed7 gpu: NVIDIA GeForce RTX 3070 Ti title: RetailGame seconds: 60 exit: 0x0 frames shown: 1094 (PresentX 1105) presents per 2 s (last 3): 53 60 59 device removals: 0 crashes: 0 peak commit: 15156 MB ``` **Not tested** - One title; two runs per build in the comparison, one in the regression run: frame counts vary a lot between runs and sessions. - Not tested on AMD or Intel GPUs here (#440's own runs were on an RX 9060 XT). - `tests/texture_states.rs` (upload barriers checked by the D3D12 debug layer) skips here: the debug layer is not installed. - The title's intro video (the linear planes #440 targets) was not started by hand in these runs. - The upload buffer is kept per queue for the process and only grows (up to a batch: `BATCH_BYTES`, 256 MB, plus one texture); it is not shrunk. **AI use** - Claude Code with Claude Opus 5.5: profiled the title's runs (per-thread CPU, thread dumps named from a symbol build), wrote the first three commits and their tests, placed #440's change in front of the per-row loop, ran the test suite, the timings, the title runs and the regression runs above, and wrote the commit messages and this description. The 4th commit is @⁠emirduran707's #440 (its own commit says Claude Code with Claude Opus 5.5).
`gpu::texture::upload_batch` made a new upload buffer for every texture
and a new command allocator, command list and fence for every batch,
and released them all again. Each of these D3D12 calls waits for the
video memory manager. While a retail title streamed textures the CPU
writes, they took 200 - 650 ms apiece (timed in the title's runs), and
its frames fell to 1 - 3 a second.

Each upload queue now keeps an `Uploader`: one persistently mapped
upload buffer that the batch's textures share (each at a 512-byte
aligned offset; it grows only when a batch needs more room), an
allocator and list that are reset, and a fence whose value counts up.
When the wait for a batch times out, the uploader is retired and kept
alive instead of released: the GPU may still read the buffer and run
the list, and releasing them under it removed the device.

`record_upload_states` is split into `layout` and `record_into`; it
keeps its behaviour (a buffer of its own) for its other callers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`Chain::detile_level` called `element_at` / `Layout::offset_z` for every
element: a `div_ceil`, several divisions and modulos and six table
lookups each. Once the upload buffers were reused, it was most of a
retail title's render thread while the title streamed textures the CPU
writes (thread samples, frames named from a symbol build).

The parts of the offset that depend on x alone (block column and the
x and high-x pattern bits) are now computed once per level, those that
depend on y and the slice once per row, leaving two lookups and an XOR
per element. The result is the same: a new test compares it with
`element_at` for every mode, element size, pipe configuration and level
(mip tails too), with a base swizzle, two slices and a source cut short.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`title_textures::upload_all` read and detiled each texture of a batch
one after another, inside the title's own submit and present. Batches of
1 MB or more are now detiled on up to 8 threads (half the cores), each
taking the next texture; the results keep the batch's order. Smaller
batches stay on the calling thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Chain::detile_level computed the address of every element and copied it
on its own. A linear level (mode 0) keeps each row's elements contiguous,
so its rows are now copied whole; which elements are copied when the
source is cut short is unchanged. Swizzled modes, a base swizzle and
levels in a mip tail keep the per-row form of the previous commit.

A retail title's intro video is three linear R8 planes per frame
(3840x2160 and two 1920x1080), uploaded on every frame through the
kept-in-step title textures: release, one plane 56.9 ms -> 1.2 ms and
14.4 ms -> 0.3 ms, about 85 ms -> 2 ms a frame. The video played at
3.5 fps on an RX 9060 XT with the element-by-element form.

Test: linear levels give the same bytes by rows as by elements, for
every element size, padded rows, every mip and a cut-short source.

From #440 (be722a7), placed in front of the per-row loop of this PR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:22:13 +00:00
github manually merged commit 1f282c737b into gh-pr/451/base 2026-11-26 04:22:15 +00:00
Author
Owner

@⁠emirduran707 on GitHub · 2026-11-24 00:37 UTC · original

This overlaps #440 in Chain::detile_level (they conflict textually), but the two speed up different layouts, so they combine rather than compete. detile_level alone, single thread, release, on a Ryzen 5 5600 (local timing test, not committed; same harness on both heads):

level main this PR (2cefc88) #440 (be722a7)
3840x2160 R8, linear (an intro-video plane) 56.9 ms 21.2 ms 1.2 ms
1920x1080 R8, linear 14.4 ms 5.0 ms 0.3 ms
2048x2048 RGBA8, 64KB_S, 8 pipes 48.4 ms 16.0 ms 48.4 ms (unchanged)

A linear level's rows are contiguous, so #440 copies them whole; your per-row form is what the swizzled modes need. Whichever lands first, I'll rebase #440 onto it as a linear fast path in front of your loop (a few lines plus its equivalence test) – or feel free to fold it into this PR if you prefer, and I'll close #440.

AI use: Claude Code with Claude Opus 5.5 ran the timings and wrote this comment.

**@⁠emirduran707** on GitHub · 2026-11-24 00:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/451#issuecomment-7118264003) This overlaps #440 in `Chain::detile_level` (they conflict textually), but the two speed up different layouts, so they combine rather than compete. `detile_level` alone, single thread, release, on a Ryzen 5 5600 (local timing test, not committed; same harness on both heads): | level | `main` | this PR (2cefc88) | #440 (be722a7) | |---|---|---|---| | 3840x2160 R8, linear (an intro-video plane) | 56.9 ms | 21.2 ms | 1.2 ms | | 1920x1080 R8, linear | 14.4 ms | 5.0 ms | 0.3 ms | | 2048x2048 RGBA8, 64KB_S, 8 pipes | 48.4 ms | 16.0 ms | 48.4 ms (unchanged) | A linear level's rows are contiguous, so #440 copies them whole; your per-row form is what the swizzled modes need. Whichever lands first, I'll rebase #440 onto it as a linear fast path in front of your loop (a few lines plus its equivalence test) – or feel free to fold it into this PR if you prefer, and I'll close #440. AI use: Claude Code with Claude Opus 5.5 ran the timings and wrote this comment.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-24 00:40 UTC · original

Tested

Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (NVIDIA 621.35), Rust 1.99.1 MSVC, debug. Commit 2cefc889

cargo test --locked -p xcl --lib -- detile_level_matches_element_by_element gpu_upload_batches_reuse_the_queues_upload_buffer a_batch_detiled_on_several_threads_matches_one_thread --test-threads=1 --nocapture: 3 passed, 0 failed, 0 ignored, zero reported skips. The GPU check matched the readbacks from both batches and confirmed the second batch reused the staging buffer. The two CPU checks matched the element-by-element detiler and the single-threaded batch output.

Not tested

Full workspace suite, AMD, retail titles, and performance.

AI use

Codex with GPT-6.2 Sol ran the tests and drafted this report.

**@⁠thehollowedone** on GitHub · 2026-11-24 00:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/451#issuecomment-7118315487) **Tested** Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (NVIDIA 621.35), Rust 1.99.1 MSVC, debug. [Commit 2cefc889](https://github.com/ivall/xcl/pull/451/commits/2cefc889564d5216618f65f9f2c3c32ce1d64f64) `cargo test --locked -p xcl --lib -- detile_level_matches_element_by_element gpu_upload_batches_reuse_the_queues_upload_buffer a_batch_detiled_on_several_threads_matches_one_thread --test-threads=1 --nocapture`: 3 passed, 0 failed, 0 ignored, zero reported skips. The GPU check matched the readbacks from both batches and confirmed the second batch reused the staging buffer. The two CPU checks matched the element-by-element detiler and the single-threaded batch output. **Not tested** Full workspace suite, AMD, retail titles, and performance. **AI use** Codex with GPT-6.2 Sol ran the tests and drafted this report.
Author
Owner

@⁠1984742628 on GitHub · 2026-11-24 00:41 UTC · original

This overlaps #440 in Chain::detile_level (they conflict textually), but the two speed up different layouts, so they combine rather than compete. detile_level alone, single thread, release, on a Ryzen 5 5600 (local timing test, not committed; same harness on both heads):

level main this PR (2cefc88) #440 (be722a7)
3840x2160 R8, linear (an intro-video plane) 56.9 ms 21.2 ms 1.2 ms
1920x1080 R8, linear 14.4 ms 5.0 ms 0.3 ms
2048x2048 RGBA8, 64KB_S, 8 pipes 48.4 ms 16.0 ms 48.4 ms (unchanged)
A linear level's rows are contiguous, so #440 copies them whole; your per-row form is what the swizzled modes need. Whichever lands first, I'll rebase #440 onto it as a linear fast path in front of your loop (a few lines plus its equivalence test) – or feel free to fold it into this PR if you prefer, and I'll close #440.

AI use: Claude Code with Claude Opus 5.5 ran the timings and wrote this comment.

Do you want to merge our PRs?

**@⁠1984742628** on GitHub · 2026-11-24 00:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/451#issuecomment-7118329710) > This overlaps #440 in `Chain::detile_level` (they conflict textually), but the two speed up different layouts, so they combine rather than compete. `detile_level` alone, single thread, release, on a Ryzen 5 5600 (local timing test, not committed; same harness on both heads): > > level `main` this PR ([2cefc88](https://github.com/ivall/xcl/commit/2cefc889564d5216618f65f9f2c3c32ce1d64f64)) #440 ([be722a7](https://github.com/ivall/xcl/commit/be722a7ab8306a1d952405abaeab67b2c941ae2f)) > 3840x2160 R8, linear (an intro-video plane) 56.9 ms 21.2 ms 1.2 ms > 1920x1080 R8, linear 14.4 ms 5.0 ms 0.3 ms > 2048x2048 RGBA8, 64KB_S, 8 pipes 48.4 ms 16.0 ms 48.4 ms (unchanged) > A linear level's rows are contiguous, so #440 copies them whole; your per-row form is what the swizzled modes need. Whichever lands first, I'll rebase #440 onto it as a linear fast path in front of your loop (a few lines plus its equivalence test) – or feel free to fold it into this PR if you prefer, and I'll close #440. > > AI use: Claude Code with Claude Opus 5.5 ran the timings and wrote this comment. Do you want to merge our PRs?
Author
Owner

@⁠PHeitor1 on GitHub · 2026-11-24 00:44 UTC · original

Tested 2cefc88 merged onto main 2997c9a.

RTX 5060 Ti 8 GB (Blackwell, 32-lane waves), NVIDIA 621.24, Ryzen 5 5600X, Windows 11 Pro 26300 (native, Graphics Tools + XGameRuntime installed, so the debug-layer tests run), rustc 1.100.0 MSVC, debug, cargo test --workspace --no-fail-fast -- --test-threads=4, no XCL_SAMPLE_*.

Pass: 679 passed, 0 failed, 41 ignored. SKIPPED: only the 2 no wave64 tests (gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware). Build clean.

Run and written with Claude Code (Claude Opus 5.5).

**@⁠PHeitor1** on GitHub · 2026-11-24 00:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/451#issuecomment-7118382938) Tested `2cefc88` merged onto `main` `2997c9a`. RTX 5060 Ti 8 GB (Blackwell, 32-lane waves), NVIDIA 621.24, Ryzen 5 5600X, Windows 11 Pro 26300 (native, Graphics Tools + XGameRuntime installed, so the debug-layer tests run), rustc 1.100.0 MSVC, debug, `cargo test --workspace --no-fail-fast -- --test-threads=4`, no `XCL_SAMPLE_*`. **Pass:** 679 passed, 0 failed, 41 ignored. SKIPPED: only the 2 `no wave64` tests (`gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`). Build clean. _Run and written with Claude Code (Claude Opus 5.5)._
Author
Owner

@⁠TheHoracio on GitHub · 2026-11-24 00:46 UTC · original

Test report on AMD RDNA3: RX 7800 XT (16 GB, wave32 and wave64), driver 32.0.32015.7029, Ryzen 7 9800X3D, Windows 11 Pro 10.0.26300, Rust 1.100.0 MSVC, DXC 1.9.2602.17, debug build. No retail data was used. The PR's own runs are all on NVIDIA, so this adds an AMD GPU with 64-lane waves.

Tested: the PR head 2cefc88 as it is (on its base a6f5f7a).

  • cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4: 679 passed, 0 failed, 41 ignored, no SKIPPED tests (the two no wave64 tests run here).
  • The three new tests pass: gpu_upload_batches_reuse_the_queues_upload_buffer (GPU), detile_level_matches_element_by_element and a_batch_detiled_on_several_threads_matches_one_thread.

Not tested: a regression run on a title, a release build, the head merged onto current main.

AI use: Claude Code ran the commands and drafted this comment; the runs are real runs on the hardware above.

**@⁠TheHoracio** on GitHub · 2026-11-24 00:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/451#issuecomment-7118413023) Test report on **AMD RDNA3**: RX 7800 XT (16 GB, wave32 and wave64), driver 32.0.32015.7029, Ryzen 7 9800X3D, Windows 11 Pro 10.0.26300, Rust 1.100.0 MSVC, DXC 1.9.2602.17, debug build. No retail data was used. The PR's own runs are all on NVIDIA, so this adds an AMD GPU with 64-lane waves. **Tested:** the PR head `2cefc88` as it is (on its base `a6f5f7a`). - `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4`: **679 passed, 0 failed, 41 ignored**, no SKIPPED tests (the two `no wave64` tests run here). - The three new tests pass: `gpu_upload_batches_reuse_the_queues_upload_buffer` (GPU), `detile_level_matches_element_by_element` and `a_batch_detiled_on_several_threads_matches_one_thread`. **Not tested:** a regression run on a title, a release build, the head merged onto current `main`. AI use: Claude Code ran the commands and drafted this comment; the runs are real runs on the hardware above.
Author
Owner

@⁠1984742628 on GitHub · 2026-11-24 01:03 UTC · original

Thanks @⁠emirduran707, good catch. The two changes fit together: your linear fast path is now the 4th commit of this PR (1f282c7, with you as author), placed in front of the per-row loop, so linear levels take your row copy and swizzled ones take the per-row form. Your linear_levels_detile_by_rows_as_by_elements test came along unchanged, and the whole suite passes at 1f282c7 (680 passed, 0 failed, 41 ignored).

Combined numbers, measured on an RTX 3070 Ti and a Ryzen 9 7950X:

detile_level alone (release, best of 7, the levels you timed):

level main 2997c9a #440 be722a7 #451 before #440 2cefc88 combined 1f282c7
3840x2160 R8, linear 66.0 ms 0.87 ms 13.5 ms 0.86 ms
1920x1080 R8, linear 16.5 ms 0.22 ms 3.7 ms 0.23 ms
2048x2048 RGBA8, 64KB_S, 8 pipes 41.2 ms 41.9 ms 15.7 ms 15.1 ms

The retail title, scripts/smoke.ps1 60 s, two runs per build back to back in one session:

build frames shown presents per 2 s at the end
main 260 / 292 3 – 5
#440 alone 231 / 295 0 – 5
#451 before #440 552 / 553 1
combined 670 / 1011 60 (the title's 30 fps cap)

None of the runs crashed or removed the device. Frame counts vary a lot from run to run, so only runs from the same session are compared. I didn't start the title's intro video by hand, so your video case was measured only through the timings above.

If this lands, #440 can be closed. The PR description is updated to match.

(Written with Claude Code, Claude Opus 5.5; I checked the numbers against the runs.)

**@⁠1984742628** on GitHub · 2026-11-24 01:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/451#issuecomment-7118715303) Thanks @⁠emirduran707, good catch. The two changes fit together: your linear fast path is now the 4th commit of this PR (`1f282c7`, with you as author), placed in front of the per-row loop, so linear levels take your row copy and swizzled ones take the per-row form. Your `linear_levels_detile_by_rows_as_by_elements` test came along unchanged, and the whole suite passes at `1f282c7` (680 passed, 0 failed, 41 ignored). Combined numbers, measured on an RTX 3070 Ti and a Ryzen 9 7950X: `detile_level` alone (release, best of 7, the levels you timed): | level | main `2997c9a` | #440 `be722a7` | #451 before #440 `2cefc88` | combined `1f282c7` | |---|---|---|---|---| | 3840x2160 R8, linear | 66.0 ms | 0.87 ms | 13.5 ms | 0.86 ms | | 1920x1080 R8, linear | 16.5 ms | 0.22 ms | 3.7 ms | 0.23 ms | | 2048x2048 RGBA8, 64KB_S, 8 pipes | 41.2 ms | 41.9 ms | 15.7 ms | 15.1 ms | The retail title, `scripts/smoke.ps1` 60 s, two runs per build back to back in one session: | build | frames shown | presents per 2 s at the end | |---|---|---| | main | 260 / 292 | 3 – 5 | | #440 alone | 231 / 295 | 0 – 5 | | #451 before #440 | 552 / 553 | 1 | | combined | 670 / 1011 | 60 (the title's 30 fps cap) | None of the runs crashed or removed the device. Frame counts vary a lot from run to run, so only runs from the same session are compared. I didn't start the title's intro video by hand, so your video case was measured only through the timings above. If this lands, #440 can be closed. The PR description is updated to match. (Written with Claude Code, Claude Opus 5.5; I checked the numbers against the runs.)
Author
Owner

@⁠grahamster2 on GitHub · 2026-11-24 01:10 UTC · original

Tested on an RTX 3080 against main and the two other PRs for the same fix (#455, #465). #451 is the only one that speeds up the intro video here: about 4.5 → 20 fps (it takes 21 s instead of ~100 s), and world streaming starts at 60 s instead of 140 s. There were no device removals. The local patch from the #283 comment, on db1ddb2, gave 30 fps in the earlier test, so this head is slower than that patch was.

Setup: RTX 3080 10 GB, driver 610.88, 32 GB RAM with ~15–17 GB used by other programs. Release builds of main 2997c9a (code-identical to a6f5f7a) and of #451 2cefc88, #455 07e6199 and #465 1152852. Each PR was tested on its own. The retail title ran 180 s per run with XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PRESS_A_AT=14,17,21 on a warm cache. Numbers are from the activity (2 s) lines; the earlier patch test on db1ddb2 is here.

main #451 #455 #465
Runs 2 2 3 (2 ended in a device removal) 2
Intro video, presents per 2 s 8–10 (≈4.5 fps) 37–43 (≈20 fps) 8–11 (≈4.7 fps) 8–10 (≈4.5 fps)
Intro video, start → end 20 → 119 / 121 s 20 → 41 / 41 s 20 → 113 s 20 → 118 / 117 s
World streaming starts 140 / 140 s 60 / 60 s 134 s 138 / 136 s
Max presents per 2 s after that 35 / 35 45 / 58 47 55 / 48
Commit at the end 23.7 / 24.0 GB 24.5 / 24.4 GB 24.1 GB 24.5 / 25.1 GB
  • Every completed run was stopped by my watchdog (it kills XCL when free RAM falls below 1.5 GB). That happened 15–25 s after world streaming started, at about 24 GB commit, in every build. It's this machine's RAM limit, so the "after that" row covers only those seconds.
  • #455: 2 of 3 runs ended in a device removal. The removal was 0x887a0006 (DEVICE_HUNG), at 13.5 s and 11.0 s, before the intro video. The log line is D3D12 device removed: 0x887a0006 … – the title is stopped, and then the process ends with status 0x887a0006. main and the other PRs had no removals in their runs.
  • smoke.ps1, 60 s: it presses nothing, so every build stays on the menu, and all four look the same there.
smoke commit frames shown last 3 removals crashes peak commit
main 2997c9a 1532 60 60 60 0 0 14613 MB
#451 2cefc88 1590 60 61 60 0 0 14723 MB
#455 07e6199 1518 61 60 59 0 0 14589 MB
#465 1152852 1528 60 59 61 0 0 14663 MB

All smoke runs reported exit: 0x0 and gpu: NVIDIA GeForce RTX 3080. I left the title line out of the table.

Not tested:

  • Picture correctness: I can't see the screen.
  • Anything past ~20 s of world streaming, because of the RAM limit.
  • Combinations of the PRs.

The same numbers are posted on the other PRs: #455, #465.

Test runs and this report: Claude Code (Claude Opus 5.5).

**@⁠grahamster2** on GitHub · 2026-11-24 01:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/451#issuecomment-7118836420) Tested on an RTX 3080 against `main` and the two other PRs for the same fix (#455, #465). **#451 is the only one that speeds up the intro video here:** about 4.5 → 20 fps (it takes 21 s instead of ~100 s), and world streaming starts at 60 s instead of 140 s. There were no device removals. The local patch from the #283 comment, on db1ddb2, gave 30 fps in the earlier test, so this head is slower than that patch was. **Setup:** RTX 3080 10 GB, driver 610.88, 32 GB RAM with ~15–17 GB used by other programs. Release builds of `main` 2997c9a (code-identical to a6f5f7a) and of #451 2cefc88, #455 07e6199 and #465 1152852. Each PR was tested on its own. The retail title ran 180 s per run with `XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PRESS_A_AT=14,17,21` on a warm cache. Numbers are from the `activity (2 s)` lines; the earlier patch test on db1ddb2 is [here](https://github.com/ivall/xcl/pull/283#issuecomment-7118348035). | | main | #451 | #455 | #465 | |---|---|---|---|---| | Runs | 2 | 2 | 3 (2 ended in a device removal) | 2 | | Intro video, presents per 2 s | 8–10 (≈4.5 fps) | **37–43 (≈20 fps)** | 8–11 (≈4.7 fps) | 8–10 (≈4.5 fps) | | Intro video, start → end | 20 → 119 / 121 s | 20 → 41 / 41 s | 20 → 113 s | 20 → 118 / 117 s | | World streaming starts | 140 / 140 s | 60 / 60 s | 134 s | 138 / 136 s | | Max presents per 2 s after that | 35 / 35 | 45 / 58 | 47 | 55 / 48 | | Commit at the end | 23.7 / 24.0 GB | 24.5 / 24.4 GB | 24.1 GB | 24.5 / 25.1 GB | - **Every completed run was stopped by my watchdog** (it kills XCL when free RAM falls below 1.5 GB). That happened 15–25 s after world streaming started, at about 24 GB commit, in every build. It's this machine's RAM limit, so the "after that" row covers only those seconds. - **#455: 2 of 3 runs ended in a device removal.** The removal was `0x887a0006` (DEVICE_HUNG), at 13.5 s and 11.0 s, before the intro video. The log line is `D3D12 device removed: 0x887a0006 … – the title is stopped`, and then the process ends with status 0x887a0006. `main` and the other PRs had no removals in their runs. - `smoke.ps1`, 60 s: it presses nothing, so every build stays on the menu, and all four look the same there. | smoke | commit | frames shown | last 3 | removals | crashes | peak commit | |---|---|---|---|---|---|---| | main | 2997c9a | 1532 | 60 60 60 | 0 | 0 | 14613 MB | | #451 | 2cefc88 | 1590 | 60 61 60 | 0 | 0 | 14723 MB | | #455 | 07e6199 | 1518 | 61 60 59 | 0 | 0 | 14589 MB | | #465 | 1152852 | 1528 | 60 59 61 | 0 | 0 | 14663 MB | All smoke runs reported `exit: 0x0` and `gpu: NVIDIA GeForce RTX 3080`. I left the title line out of the table. **Not tested:** - Picture correctness: I can't see the screen. - Anything past ~20 s of world streaming, because of the RAM limit. - Combinations of the PRs. The same numbers are posted on the other PRs: [#455](https://github.com/ivall/xcl/pull/455#issuecomment-7118837037), [#465](https://github.com/ivall/xcl/pull/465#issuecomment-7118837330). Test runs and this report: Claude Code (Claude Opus 5.5).
Author
Owner

@⁠Chrysana on GitHub · 2026-11-24 01:05 UTC · original · edited 2026-11-24 01:11 UTC

Test report for #451 at 2cefc88 on AMD RDNA4 (the "Not tested" item), with the retail title reaching the intro video.

Setup: AMD Radeon RX 9070 XT 16 GB, driver 32.0.32015.2008 (the CPU's integrated Radeon is also present; XCL ran on the RX 9070 XT), Ryzen 7 9800X3D, 31 GB RAM, Windows 11 25H2 build 26200.9974, rustc 1.100.0 x86_64-pc-windows-msvc, DXC 1.9.2602.17 (SDK 10.0.26100). Retail title 1.0.2.1. Debug build for the tests, release build for the runs.

Tests: cargo test --workspace --no-fail-fast -- --test-threads=4 at 2cefc88: 679 passed, 0 failed, 41 ignored. SKIPPED: test_title_draws_with_a_root_signature_under_the_debug_layer and uploads_start_from_each_subresources_state, both because the D3D12 debug layer isn't installed here.

Title runs: scripts/smoke.ps1 -Game <folder> -Seconds 60 with XCL_PRESS_A_AT=14,17,21. Every run reaches the Bink intro (21 kept-in-step textures in each run's log). The picture was checked by eye only on main, where the video plays. Two rounds of main, #451, #440 and #458, interleaved, same machine, same saved state:

build frames, round 1 / round 2 last 20 s
main a6f5f7a 489 / 497 ~5.5 fps
#451 2cefc88 1489 / 1515 30 fps
#440 be722a7 1261 / 1269 ~28 fps
#458 a173fe0 1082 / 1085 ~12 fps (from its older base, see #458)

No device removal or crash in any run. Peak commit was 16150 / 16023 MB with this PR against 15824 / 15815 MB on main (+2 %).

Regression run (round 1):

main:

xcl-smoke v1
commit: a6f5f7a74cc620c1f88a9e3669a633d10c3c8212
gpu: AMD Radeon RX 9070 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 489 (PresentX 490)
presents per 2 s (last 3): 10 12 10
device removals: 0
crashes: 0
peak commit: 15824 MB

PR:

xcl-smoke v1
commit: 2cefc889564d5216618f65f9f2c3c32ce1d64f64
gpu: AMD Radeon RX 9070 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1489 (PresentX 1489)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16150 MB

Not tested: gameplay past the video; picture correctness beyond what the person watching saw; any title other than this one.

AI use: Claude Code with Claude Opus 5.5 built the commits, ran the tests and the title runs, and wrote this report. The runs were made on my machine.

**@⁠Chrysana** on GitHub · 2026-11-24 01:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/451#issuecomment-7118753499) · edited 2026-11-24 01:11 UTC Test report for #451 at `2cefc88` on **AMD RDNA4** (the "Not tested" item), with the retail title reaching the intro video. **Setup:** AMD Radeon RX 9070 XT 16 GB, driver 32.0.32015.2008 (the CPU's integrated Radeon is also present; XCL ran on the RX 9070 XT), Ryzen 7 9800X3D, 31 GB RAM, Windows 11 25H2 build 26200.9974, rustc 1.100.0 `x86_64-pc-windows-msvc`, DXC 1.9.2602.17 (SDK 10.0.26100). Retail title 1.0.2.1. Debug build for the tests, release build for the runs. **Tests:** `cargo test --workspace --no-fail-fast -- --test-threads=4` at `2cefc88`: 679 passed, 0 failed, 41 ignored. `SKIPPED`: `test_title_draws_with_a_root_signature_under_the_debug_layer` and `uploads_start_from_each_subresources_state`, both because the D3D12 debug layer isn't installed here. **Title runs:** `scripts/smoke.ps1 -Game <folder> -Seconds 60` with `XCL_PRESS_A_AT=14,17,21`. Every run reaches the Bink intro (21 kept-in-step textures in each run's log). The picture was checked by eye only on main, where the video plays. Two rounds of main, #451, #440 and #458, interleaved, same machine, same saved state: | build | frames, round 1 / round 2 | last 20 s | |---|---|---| | main `a6f5f7a` | 489 / 497 | ~5.5 fps | | **#451 `2cefc88`** | **1489 / 1515** | **30 fps** | | #440 `be722a7` | 1261 / 1269 | ~28 fps | | #458 `a173fe0` | 1082 / 1085 | ~12 fps (from its older base, see #458) | No device removal or crash in any run. Peak commit was 16150 / 16023 MB with this PR against 15824 / 15815 MB on main (+2 %). **Regression run** (round 1): main: ``` xcl-smoke v1 commit: a6f5f7a74cc620c1f88a9e3669a633d10c3c8212 gpu: AMD Radeon RX 9070 XT title: retail-title seconds: 60 exit: 0x0 frames shown: 489 (PresentX 490) presents per 2 s (last 3): 10 12 10 device removals: 0 crashes: 0 peak commit: 15824 MB ``` PR: ``` xcl-smoke v1 commit: 2cefc889564d5216618f65f9f2c3c32ce1d64f64 gpu: AMD Radeon RX 9070 XT title: retail-title seconds: 60 exit: 0x0 frames shown: 1489 (PresentX 1489) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16150 MB ``` **Not tested:** gameplay past the video; picture correctness beyond what the person watching saw; any title other than this one. **AI use:** Claude Code with Claude Opus 5.5 built the commits, ran the tests and the title runs, and wrote this report. The runs were made on my machine.
Author
Owner

@⁠1bugproof on GitHub · 2026-11-24 01:21 UTC · original

please review @⁠ivall / @⁠theaustinayers / @⁠Mavixot

**@⁠1bugproof** on GitHub · 2026-11-24 01:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/451#issuecomment-7119022520) please review @⁠ivall / @⁠theaustinayers / @⁠Mavixot
Author
Owner

@⁠grahamster2 on GitHub · 2026-11-24 01:29 UTC · original

Follow-up on the RTX 3080 now that #486 is merged: yes, #451 still helps on top of #486. With main alone the intro video plays at ~6 fps. With main + #451 it plays at 30 fps, and world streaming starts ~60 s earlier.

Builds:

  • main 7ebf1b8, which includes #486.
  • main 7ebf1b8 with this PR's head 1f282c7 merged locally (not pushed). It merges without conflicts.

The setup is the same as in my comment above: the retail title, 180 s, XCL_NETWORK=0 XCL_ACTIVITY=1, warm cache, and a watchdog that stops the run when free RAM falls below 1.5 GB.

main 7ebf1b8 (#486) main 7ebf1b8 + #451 1f282c7
Intro video, presents per 2 s 10–14 (≈6 fps) 58–60 (30 fps)
Intro video, start → end 24 → 95 s / 20 → 93 s 22 → 37 s / 20 → 33 s
World streaming starts 116 / 112 s 56 / 52 s
Max presents per 2 s after that 43 / 41 49 / 47
Device removals 0 0

For comparison, on 2997c9a (before #486) main played the video at ~4.5 fps and #451 2cefc88 at ~20 fps. #486 alone raises it to only ~6 fps on this card, not 30.

Two extra #451 runs aren't in the table. I ran them with the same XCL_PRESS_A_AT=14,17,21 as main. In both, the title read the gamepad for the first time only at ~21 s, so the press before the video came too early. The title then sat on that screen for the rest of the 180 s, at 60 presents per 2 s and 14.7 GB commit. Neither run had a crash or a removal. The two runs in the table used 21,25,31 and 14,17,21,25,31; the extra presses didn't cut the video short.

Not tested: picture correctness (I can't see the screen), and anything past the first ~20 s of world streaming, because of the RAM limit.

Test runs and this report: Claude Code (Claude Opus 5.5).

**@⁠grahamster2** on GitHub · 2026-11-24 01:29 UTC · [original](https://github.com/xcl-dev/xcl/pull/451#issuecomment-7119144407) Follow-up on the RTX 3080 now that #486 is merged: **yes, #451 still helps on top of #486.** With `main` alone the intro video plays at ~6 fps. With `main` + #451 it plays at 30 fps, and world streaming starts ~60 s earlier. **Builds:** - `main` 7ebf1b8, which includes #486. - `main` 7ebf1b8 with this PR's head 1f282c7 merged locally (not pushed). It merges without conflicts. The setup is the same as in [my comment above](https://github.com/ivall/xcl/pull/451#issuecomment-7118836420): the retail title, 180 s, `XCL_NETWORK=0 XCL_ACTIVITY=1`, warm cache, and a watchdog that stops the run when free RAM falls below 1.5 GB. | | main 7ebf1b8 (#486) | main 7ebf1b8 + #451 1f282c7 | |---|---|---| | Intro video, presents per 2 s | 10–14 (≈6 fps) | 58–60 (30 fps) | | Intro video, start → end | 24 → 95 s / 20 → 93 s | 22 → 37 s / 20 → 33 s | | World streaming starts | 116 / 112 s | 56 / 52 s | | Max presents per 2 s after that | 43 / 41 | 49 / 47 | | Device removals | 0 | 0 | For comparison, on 2997c9a (before #486) `main` played the video at ~4.5 fps and #451 2cefc88 at ~20 fps. #486 alone raises it to only ~6 fps on this card, not 30. **Two extra #451 runs aren't in the table.** I ran them with the same `XCL_PRESS_A_AT=14,17,21` as `main`. In both, the title read the gamepad for the first time only at ~21 s, so the press before the video came too early. The title then sat on that screen for the rest of the 180 s, at 60 presents per 2 s and 14.7 GB commit. Neither run had a crash or a removal. The two runs in the table used `21,25,31` and `14,17,21,25,31`; the extra presses didn't cut the video short. Not tested: picture correctness (I can't see the screen), and anything past the first ~20 s of world streaming, because of the RAM limit. Test runs and this report: Claude Code (Claude Opus 5.5).
Author
Owner

@⁠Alpha325 on GitHub · 2026-11-24 01:51 UTC · original

I tested PR head 1f282c737b5637b58de4847cacde208d23504ed7 on Radeon RX 9060 XT with a local test-only fixture. The existing reuse test covers two batches that fit the same buffer. This fixture forces the buffer to grow and checks that a rejected item doesn't disturb the other uploads.

  1. A small upload allocated a 4 MiB staging buffer.
  2. A second batch contained a valid 6 MiB texture, a texture with one byte missing, and another valid texture. The buffer grew to 8 MiB, and the batch reported only index 1 as failed.
  3. GPU readback matched both valid uploads byte for byte. The rejected texture retained its previous contents. A later small upload reused the same 8 MiB buffer and also read back exactly.

Results: 17 focused upload and detiling tests passed, with 0 failures, 0 ignored, and no skips. Windows 11, Radeon driver 32.0.32029.2010, Rust 1.100.0 MSVC x64, release. Synthetic fixtures only. This covers buffer growth, reuse, and per-item error handling. I did not measure performance or test GPU timeouts.

AI use: OpenAI Codex (GPT-6.2 Sol) wrote the fixture, ran the tests, and drafted this report.

**@⁠Alpha325** on GitHub · 2026-11-24 01:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/451#issuecomment-7119518932) I tested PR head `1f282c737b5637b58de4847cacde208d23504ed7` on Radeon RX 9060 XT with a local test-only fixture. The existing reuse test covers two batches that fit the same buffer. This fixture forces the buffer to grow and checks that a rejected item doesn't disturb the other uploads. 1. A small upload allocated a 4 MiB staging buffer. 2. A second batch contained a valid 6 MiB texture, a texture with one byte missing, and another valid texture. The buffer grew to 8 MiB, and the batch reported only index `1` as failed. 3. GPU readback matched both valid uploads byte for byte. The rejected texture retained its previous contents. A later small upload reused the same 8 MiB buffer and also read back exactly. **Results:** 17 focused upload and detiling tests passed, with 0 failures, 0 ignored, and no skips. Windows 11, Radeon driver `32.0.32029.2010`, Rust 1.100.0 MSVC x64, release. Synthetic fixtures only. This covers buffer growth, reuse, and per-item error handling. I did not measure performance or test GPU timeouts. **AI use:** OpenAI Codex (GPT-6.2 Sol) wrote the fixture, ran the tests, and drafted this report.
Author
Owner

@⁠tiagonleal on GitHub · 2026-11-24 01:57 UTC · original

After the merge, for the record: #440, #451 and #458 side by side on the retail title's intro video (RTX 5070 Ti)

The three PRs sped up the same path (title_textures::refresh → Chain::detile_level). I measured them against each other on the retail title (one machine, one procedure) before this was merged; the numbers agree with the choice, and #458 (still open) is below #451 here.

Setup: NVIDIA GeForce RTX 5070 Ti 16 GB (driver 32.0.16.1742, 32-lane waves), Ryzen 7 9800X3D, 31 GB RAM, Windows 11 Pro build 26300, rustc 1.100.0 MSVC, DXC 1.8.2502.11 (SDK 10.0.26100), cargo build --release -p xcl. Title 1.0.2.1, unpacked, learned coherent window and warm DXIL cache (same for every build).

Builds: main 2997c9a; #440 be722a7; #451 1f282c7; #458 a173fe0 as it is and merged onto main 2997c9a. #440 and #451 are on a6f5f7a, which differs from 2997c9a only in the README.

Procedure: xcl run for 100 s with XCL_NETWORK=0, XCL_ACTIVITY=1, XCL_PRESS_AT=30:A (A on the account picker; the intro video starts right after). Intro fps = presents per second in the activity windows from 38 to 48 s. Two rounds, builds alternated (main, #440, #451, #458, #458 on main, then again).

build intro fps (round 1 / 2) leaves the intro (commit +1 GB) presents in 100 s peak commit
main 6.5 / 4.2 not within 100 s 888 / 882 15.6 / 15.0 GB
#440 18.9 / 25.2 66 / 60 s 1238 / 1405 25.2 / 25.4 GB
#451 28.5 / 29.9 56 / 56 s 1753 / 1868 30.4 / 30.5 GB
#458 27.4 / 22.5 58 / 62 s 1474 / 1530 26.8 / 26.8 GB
#458 on main 22.7 / 22.8 60 / 62 s 1514 / 1484 26.8 / 27.2 GB
  • On main, in the three XCL_THREAD_DUMP_AT dumps taken during the intro (45, 50, 55 s), the same title thread is the only one running, and it is in Chain::detile_level under title_textures::refresh: in Layout::offset_z in two dumps, in the copy in the third (frames named from the release PDB's public symbols).
  • All three PRs fix it on this machine. #451 is the only one at the title's 30 fps cap in both rounds and leaves the intro first. The higher peak commit of the PRs comes from the title getting further in the same 100 s (the loading after the intro), not from the change itself.
  • No crash and no device removal in any of the 10 runs.
  • A 300 s run of #451 with XCL_FRAME_DUMP=60 shows the intro, then the loading screen art at 103–123 s; it then stops presenting at ~140 s and ends at 168.9 s in the #232 watchdog write (+0x23cf683, +0x2215c35 on the stack). That is #232, not this PR (posted there).

Not tested: AMD, other CPUs, the PRs' unit tests on this machine (only the title runs above), debug builds, a full cargo test --workspace on each head.

AI use: Claude Code (Claude Opus 5.5) built the five binaries, ran the title and the thread dumps on my machine, computed the numbers from the logs and wrote this comment.

**@⁠tiagonleal** on GitHub · 2026-11-24 01:57 UTC · [original](https://github.com/xcl-dev/xcl/pull/451#issuecomment-7119614623) **After the merge, for the record: #440, #451 and #458 side by side on the retail title's intro video (RTX 5070 Ti)** The three PRs sped up the same path (`title_textures::refresh` → `Chain::detile_level`). I measured them against each other on the retail title (one machine, one procedure) before this was merged; the numbers agree with the choice, and #458 (still open) is below #451 here. **Setup:** NVIDIA GeForce RTX 5070 Ti 16 GB (driver 32.0.16.1742, 32-lane waves), Ryzen 7 9800X3D, 31 GB RAM, Windows 11 Pro build 26300, rustc 1.100.0 MSVC, DXC 1.8.2502.11 (SDK 10.0.26100), `cargo build --release -p xcl`. Title 1.0.2.1, unpacked, learned coherent window and warm DXIL cache (same for every build). **Builds:** `main` 2997c9a; #440 `be722a7`; #451 `1f282c7`; #458 `a173fe0` as it is and merged onto `main` 2997c9a. #440 and #451 are on `a6f5f7a`, which differs from 2997c9a only in the README. **Procedure:** `xcl run` for 100 s with `XCL_NETWORK=0`, `XCL_ACTIVITY=1`, `XCL_PRESS_AT=30:A` (A on the account picker; the intro video starts right after). Intro fps = presents per second in the activity windows from 38 to 48 s. Two rounds, builds alternated (main, #440, #451, #458, #458 on main, then again). | build | intro fps (round 1 / 2) | leaves the intro (commit +1 GB) | presents in 100 s | peak commit | |---|---|---|---|---| | `main` | 6.5 / 4.2 | not within 100 s | 888 / 882 | 15.6 / 15.0 GB | | #440 | 18.9 / 25.2 | 66 / 60 s | 1238 / 1405 | 25.2 / 25.4 GB | | **#451** | **28.5 / 29.9** | **56 / 56 s** | **1753 / 1868** | 30.4 / 30.5 GB | | #458 | 27.4 / 22.5 | 58 / 62 s | 1474 / 1530 | 26.8 / 26.8 GB | | #458 on `main` | 22.7 / 22.8 | 60 / 62 s | 1514 / 1484 | 26.8 / 27.2 GB | - On `main`, in the three `XCL_THREAD_DUMP_AT` dumps taken during the intro (45, 50, 55 s), the same title thread is the only one running, and it is in `Chain::detile_level` under `title_textures::refresh`: in `Layout::offset_z` in two dumps, in the copy in the third (frames named from the release PDB's public symbols). - All three PRs fix it on this machine. #451 is the only one at the title's 30 fps cap in both rounds and leaves the intro first. The higher peak commit of the PRs comes from the title getting further in the same 100 s (the loading after the intro), not from the change itself. - No crash and no device removal in any of the 10 runs. - A 300 s run of #451 with `XCL_FRAME_DUMP=60` shows the intro, then the loading screen art at 103–123 s; it then stops presenting at ~140 s and ends at 168.9 s in the #232 watchdog write (`+0x23cf683`, `+0x2215c35` on the stack). That is #232, not this PR (posted there). **Not tested:** AMD, other CPUs, the PRs' unit tests on this machine (only the title runs above), debug builds, a full `cargo test --workspace` on each head. AI use: Claude Code (Claude Opus 5.5) built the five binaries, ran the title and the thread dumps on my machine, computed the numbers from the logs and wrote this comment.
Author
Owner

@⁠ArturoWolff on GitHub · 2026-11-24 14:01 UTC · original

Follow-up to the AMD growth/reuse test: reuse worked here too. The remaining cost I could isolate was temporary overlap when a completed upload buffer grows, not retained memory after the batch.

On a Linux RTX 4060 (8 GB, NVIDIA 620.73.04, GE-Proton11-14), I ran a game-free RGBA8 fixture on 47efa2ecea0a12934719ae69b81930cf02a4b1c3: four batches needing 4, 8, 8 and 4 MiB, same destination textures on both builds. At the 4 → 8 MiB step:

Driver-reported allocation order (vkd3d memory type 2) After growth
Main allocate replacement → 12 MiB; free old buffer → 8 MiB 8 MiB
Private change release completed undersized buffer → 0 MiB; allocate replacement → 8 MiB 8 MiB

The later equal/smaller batches made no new type-2 allocations. All six 4 MiB texture readbacks per build matched the expected bytes. A separate destruction-notifier test confirmed the old resource was gone before replacement creation only on the changed build. The change is limited to the synchronous upload_batch path: release only a completed cached buffer that is too small, and drop the batch-local reference before publishing the uploader back to the pool. No change to in-flight or timed-out work.

gpu/texture.rs is unchanged between that tested revision and 930e8b4 (source comparison only). Not a measured retail saving, a reduction in final footprint, or a Windows smoke result. If investigating this on a title, the useful measurement is the old/new capacity of the same completed uploader at growth; matching allocation sizes in a driver log alone don't identify the owner.

AI use: Hermes Agent (gpt-6.2-astra) built the private fixture and candidate, ran the tests, and checked the driver logs and readbacks.

**@⁠ArturoWolff** on GitHub · 2026-11-24 14:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/451#issuecomment-7133719121) Follow-up to the [AMD growth/reuse test](https://github.com/ivall/xcl/pull/451#issuecomment-7119518932): reuse worked here too. The remaining cost I could isolate was **temporary overlap when a completed upload buffer grows**, not retained memory after the batch. On a Linux RTX 4060 (8 GB, NVIDIA 620.73.04, GE-Proton11-14), I ran a game-free RGBA8 fixture on `47efa2ecea0a12934719ae69b81930cf02a4b1c3`: four batches needing 4, 8, 8 and 4 MiB, same destination textures on both builds. At the 4 → 8 MiB step: | | Driver-reported allocation order (vkd3d memory type 2) | After growth | |---|---|---| | Main | allocate replacement → 12 MiB; free old buffer → 8 MiB | 8 MiB | | Private change | release completed undersized buffer → 0 MiB; allocate replacement → 8 MiB | 8 MiB | The later equal/smaller batches made no new type-2 allocations. All six 4 MiB texture readbacks per build matched the expected bytes. A separate destruction-notifier test confirmed the old resource was gone **before** replacement creation only on the changed build. The change is limited to the synchronous `upload_batch` path: release only a completed cached buffer that is too small, and drop the batch-local reference before publishing the uploader back to the pool. No change to in-flight or timed-out work. `gpu/texture.rs` is unchanged between that tested revision and `930e8b4` (source comparison only). Not a measured retail saving, a reduction in final footprint, or a Windows smoke result. If investigating this on a title, the useful measurement is the old/new capacity of the **same completed uploader** at growth; matching allocation sizes in a driver log alone don't identify the owner. AI use: Hermes Agent (gpt-6.2-astra) built the private fixture and candidate, ran the tests, and checked the driver logs and readbacks.
This discussion has been locked. Commenting is limited to contributors.
No description provided.