Textures: Detile volume mips directly into pitched upload memory #3701

Merged
bmjask merged 2 commits from upstream-pr/3701 into main 2026-12-03 02:26:09 +00:00
bmjask commented 2026-12-02 15:38:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T15:38:24Z.


What is in it

Volume mips now write directly into the mapped row layout. This removes a temporary allocation and a second CPU pass over the mip. Row padding stays untouched, missing whole elements are zeroed, and the GPU upload still occurs.

Tested

  • Windows, Intel Core i9-12900K, RTX 4090, NVIDIA 610.88, Rust 1.100.0, release.
  • Pitched output was checked against individual tiled element addresses. Texture upload tests passed. The combined development checkout passed 214 focused tests with zero failures and two ignored before the individual changes were split onto main.
  • On a 129 × 97 × 19 RGBA8 mip, the temporary-plus-row-copy path took 1.439 ms and the direct pitched path took 1.256 ms (12.7% lower). Both use the same detile algorithm and produced identical bytes including padding. This CPU fixture uses ordinary RAM. Reported values are medians of 31 paired samples with alternating order.
  • Reproduce with cargo test --release --locked -p xcl --lib bench_volume_detile_pitched_upload -- --ignored --nocapture --test-threads=1.

Mapped D3D12 upload benchmark

A 129 × 97 × 19 RGBA8 mip took 2.443 ms with a reconstruction of the previous per-element detile plus row copy, 1.281 ms with contiguous-run detiling plus row copy, and 1.213 ms with contiguous-run detiling directly into the pitched upload allocation. Direct writes reduced time by 50.4% against the first path and 5.4% against the second. Most of the gain came from copying contiguous runs. The direct path beat the contiguous-run temporary path in all five runs. Warm-up verifies all output bytes and padding against the reference.

Release build on an i9-12900K and RTX 4090 (610.88). Each value is the median of five independent process medians, with 30 timed samples per method and run, with the order and destination region varied. XCL allocated a native D3D12 upload buffer. The device reported WRITE_COMBINE and Windows reported PAGE_READWRITE | PAGE_WRITECOMBINE (0x404). Both focused checks passed in each process on the combined development checkout. These are CPU staging times.

Reproduce with cargo test --release --locked -p xcl --lib bench_volume_detile_pitched_upload_mapped -- --ignored --test-threads=1 --nocapture.

Regression run

Main

xcl-smoke v1
commit: 5eaadb54c14e0fc29597b2a1689d7dbd83491303
gpu: NVIDIA GeForce RTX 4090
title: upload-regression
seconds: 60
exit: 0x0
frames shown: 1449 (PresentX 1449)
presents per 2 s (last 3): 51 16 48
device removals: 0
crashes: 0
peak commit: 23474 MB

PR head

xcl-smoke v1
commit: a276a5617b7c102da616ff01dbbb03d6266a00b6
gpu: NVIDIA GeForce RTX 4090
title: upload-regression
seconds: 60
exit: 0x0
frames shown: 1435 (PresentX 1435)
presents per 2 s (last 3): 55 12 48
device removals: 0
crashes: 0
peak commit: 23767 MB

The mapped benchmark and pitched-output oracle cover the zero pipe/packer configuration. Thick layouts with single-element runs, nonzero console pipe configurations, and eight-byte elements remain unmeasured on the mapped heap. AMD hardware was unavailable. The benchmark helper in runner.rs is byte-identical on #3701 and #3702; a three-way merge of these heads reported no conflict.

Not tested

The full GPU workspace suite and a matched in-world frame-time comparison for this individual PR.

AI use

OpenAI Codex (GPT-6) implemented and reviewed the change, ran the focused tests and benchmark, and prepared this PR.

<!-- greyfinch-sync:ivall/xcl:issue:5609729103 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3701). Originally posted by [bmjask](https://github.com/bmjask) on 2026-12-02T15:38:24Z. --- **What is in it** Volume mips now write directly into the mapped row layout. This removes a temporary allocation and a second CPU pass over the mip. Row padding stays untouched, missing whole elements are zeroed, and the GPU upload still occurs. **Tested** - Windows, Intel Core i9-12900K, RTX 4090, NVIDIA 610.88, Rust 1.100.0, release. - Pitched output was checked against individual tiled element addresses. Texture upload tests passed. The combined development checkout passed 214 focused tests with zero failures and two ignored before the individual changes were split onto main. - On a 129 × 97 × 19 RGBA8 mip, the temporary-plus-row-copy path took 1.439 ms and the direct pitched path took 1.256 ms (12.7% lower). Both use the same detile algorithm and produced identical bytes including padding. This CPU fixture uses ordinary RAM. Reported values are medians of 31 paired samples with alternating order. - Reproduce with `cargo test --release --locked -p xcl --lib bench_volume_detile_pitched_upload -- --ignored --nocapture --test-threads=1`. **Mapped D3D12 upload benchmark** A 129 × 97 × 19 RGBA8 mip took 2.443 ms with a reconstruction of the previous per-element detile plus row copy, 1.281 ms with contiguous-run detiling plus row copy, and 1.213 ms with contiguous-run detiling directly into the pitched upload allocation. Direct writes reduced time by 50.4% against the first path and 5.4% against the second. Most of the gain came from copying contiguous runs. The direct path beat the contiguous-run temporary path in all five runs. Warm-up verifies all output bytes and padding against the reference. Release build on an i9-12900K and RTX 4090 (610.88). Each value is the median of five independent process medians, with 30 timed samples per method and run, with the order and destination region varied. XCL allocated a native D3D12 upload buffer. The device reported WRITE_COMBINE and Windows reported PAGE_READWRITE | PAGE_WRITECOMBINE (0x404). Both focused checks passed in each process on the combined development checkout. These are CPU staging times. Reproduce with `cargo test --release --locked -p xcl --lib bench_volume_detile_pitched_upload_mapped -- --ignored --test-threads=1 --nocapture`. **Regression run** Main ``` xcl-smoke v1 commit: 5eaadb54c14e0fc29597b2a1689d7dbd83491303 gpu: NVIDIA GeForce RTX 4090 title: upload-regression seconds: 60 exit: 0x0 frames shown: 1449 (PresentX 1449) presents per 2 s (last 3): 51 16 48 device removals: 0 crashes: 0 peak commit: 23474 MB ``` PR head ``` xcl-smoke v1 commit: a276a5617b7c102da616ff01dbbb03d6266a00b6 gpu: NVIDIA GeForce RTX 4090 title: upload-regression seconds: 60 exit: 0x0 frames shown: 1435 (PresentX 1435) presents per 2 s (last 3): 55 12 48 device removals: 0 crashes: 0 peak commit: 23767 MB ``` The mapped benchmark and pitched-output oracle cover the zero pipe/packer configuration. Thick layouts with single-element runs, nonzero console pipe configurations, and eight-byte elements remain unmeasured on the mapped heap. AMD hardware was unavailable. The benchmark helper in runner.rs is byte-identical on #3701 and #3702; a three-way merge of these heads reported no conflict. **Not tested** The full GPU workspace suite and a matched in-world frame-time comparison for this individual PR. **AI use** OpenAI Codex (GPT-6) implemented and reviewed the change, ran the focused tests and benchmark, and prepared this PR.
Foniass commented 2026-12-02 18:19:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T18:19:59Z.


merge-check
base: 5eaadb54c1
head: 4aac1176b7
merge: clean
build: ok
tests: 2975 passed, 0 failed, 53 ignored; 28 skipped, the same as on main
review: 2 high, 3 medium (below)
performance: 60 s smoke run: 1422 → 1681 frames (118 % of main), peak commit 17184 → 16434 MB, no device removal, no crash
title run: not run
verdict: not yet: it is a draft, PR description is red, and 2 high findings (below): a default-path change with no smoke runs or suite run yet, and the speed-up measured on ordinary RAM, not the write-combined upload heap
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5


In short: Adds Chain::detile_volume_into, which detiles one volume mip straight into rows of a given pitch, copying runs of elements that sit together in memory; detile_volume uses it, and the D3D12.X volume upload writes into the mapped upload buffer instead of a temporary Vec. By reading, the output matches the old path byte for byte, and the suite and smoke run below are clean. It changes every volume upload, though, and the speed-up was measured on ordinary RAM.

High

  1. A default-path change with no evidence yet. Every 3D texture upload (texture_upload.rs ~683-692) and every other detile_volume caller (texture.rs:99, title_textures.rs:3455, xg.rs:740) takes the new path, but the smoke runs and the GPU suite are "pending". Add both smoke blocks and the suite counts.
  2. The speed-up was measured on the wrong memory. The benchmark (tiling.rs ~1386) writes to ordinary RAM, but the real target is a write-combined D3D12_HEAP_TYPE_UPLOAD buffer (~815). The old path wrote whole rows; the new one writes run by run, which can be a single element on thick layouts, so the 12.7 % figure says nothing about the real path. Measure into an upload heap.

Medium

  1. The test covers one pipe layout only. pitched_volume_matches_element_addresses_and_preserves_padding (~1347) is a sound element-by-element oracle (padding, guard bytes, a source truncated mid-element, an empty source), but it uses only PipeConfig {0,0} and never elem_log2 = 3. With the real pipe configs (texture.rs:22-23) the hx/hy/hz XOR terms are non-zero, and run contiguity depends on them. Add those configs.
  2. Conflicts with #901 and #1624. #901 also rewrites detile_volume/tile_volume as block runs, and #1624 changes the base_xor masking in offset_z, which effective_run relies on.
  3. Commit and description. The subject has no area prefix, there is no issue link, "Not tested" names no GPU vendor, and AI use gives no exact model ("OpenAI Codex").
Checked and fine
  • By reading, the output matches the old path byte for byte: zeros for missing or partial elements, padding left alone, bpe == 1<<e.
  • Runs never cross a tile or base_xor boundary, and tail mips that start partway into a run are handled.
  • The destination bounds asserts are correct.
  • The unsafe slice stays inside the footprint plan_item reserved for that piece.
  • Alignments are unchanged.
How this was tested
  • Merged onto main 5eaadb54, then cargo build --workspace and cargo test --workspace --no-fail-fast -- --test-threads=4.
  • The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar).
  • scripts/smoke.ps1: 60 s of a retail title on main 5eaadb54 and on this merge; presents per 2 s at the end: 60 60 60.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7354388902 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3701#issuecomment-7354388902). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-02T18:19:59Z. --- merge-check base: 5eaadb54c14e0fc29597b2a1689d7dbd83491303 head: 4aac1176b74554b5c4867d4b8a2d634c36cd1333 merge: clean build: ok tests: 2975 passed, 0 failed, 53 ignored; 28 skipped, the same as on main review: 2 high, 3 medium (below) performance: 60 s smoke run: 1422 → 1681 frames (118 % of main), peak commit 17184 → 16434 MB, no device removal, no crash title run: not run verdict: not yet: it is a draft, `PR description` is red, and 2 high findings (below): a default-path change with no smoke runs or suite run yet, and the speed-up measured on ordinary RAM, not the write-combined upload heap hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 --- **In short:** Adds `Chain::detile_volume_into`, which detiles one volume mip straight into rows of a given pitch, copying runs of elements that sit together in memory; `detile_volume` uses it, and the D3D12.X volume upload writes into the mapped upload buffer instead of a temporary Vec. By reading, the output matches the old path byte for byte, and the suite and smoke run below are clean. It changes every volume upload, though, and the speed-up was measured on ordinary RAM. #### High 1. **A default-path change with no evidence yet.** Every 3D texture upload (`texture_upload.rs` ~683-692) and every other `detile_volume` caller (`texture.rs:99`, `title_textures.rs:3455`, `xg.rs:740`) takes the new path, but the smoke runs and the GPU suite are "pending". Add both smoke blocks and the suite counts. 2. **The speed-up was measured on the wrong memory.** The benchmark (`tiling.rs` ~1386) writes to ordinary RAM, but the real target is a write-combined `D3D12_HEAP_TYPE_UPLOAD` buffer (~815). The old path wrote whole rows; the new one writes run by run, which can be a single element on thick layouts, so the 12.7 % figure says nothing about the real path. Measure into an upload heap. #### Medium 3. **The test covers one pipe layout only.** `pitched_volume_matches_element_addresses_and_preserves_padding` (~1347) is a sound element-by-element oracle (padding, guard bytes, a source truncated mid-element, an empty source), but it uses only `PipeConfig {0,0}` and never `elem_log2 = 3`. With the real pipe configs (`texture.rs:22-23`) the `hx/hy/hz` XOR terms are non-zero, and run contiguity depends on them. Add those configs. 4. **Conflicts with #901 and #1624.** #901 also rewrites `detile_volume`/`tile_volume` as block runs, and #1624 changes the `base_xor` masking in `offset_z`, which `effective_run` relies on. 5. **Commit and description.** The subject has no area prefix, there is no issue link, "Not tested" names no GPU vendor, and AI use gives no exact model ("OpenAI Codex"). <details><summary>Checked and fine</summary> - By reading, the output matches the old path byte for byte: zeros for missing or partial elements, padding left alone, `bpe == 1<<e`. - Runs never cross a tile or `base_xor` boundary, and tail mips that start partway into a run are handled. - The destination bounds asserts are correct. - The unsafe slice stays inside the footprint `plan_item` reserved for that piece. - Alignments are unchanged. </details> <details><summary>How this was tested</summary> - Merged onto main `5eaadb54`, then `cargo build --workspace` and `cargo test --workspace --no-fail-fast -- --test-threads=4`. - The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar). - `scripts/smoke.ps1`: 60 s of a retail title on main `5eaadb54` and on this merge; presents per 2 s at the end: 60 60 60. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
capy-ai[bot] commented 2026-12-02 20:10:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by capy-ai[bot] on 2026-12-02T20:10:08Z.


Code review (head a276a5617b, diff read only — not built or tested on Windows/GPU, not a merge-check)

No code or memory-safety bugs found; merges cleanly onto origin/main (5ad98adb).

  • Implementation looks sound: Chain::detile_volume_into handles zero dimensions, validates destination bounds, respects effective_run() and tail-mip run origins ((run - (x + l.origin.0) % run)), zeroes missing/partial trailing elements in reused upload buffers, and leaves row padding intact. In texture_upload.rs, plan_item reserves pitch * l.height * l.depth bytes per volume piece, so the from_raw_parts_mut slice stays in bounds and disjoint across workers.
  • Remaining coverage & benchmark gaps (non-blocking):
    • Both pitched_volume_matches_element_addresses_and_preserves_padding and the new mapped WC upload benchmark only exercise PipeConfig { pipes_log2: 0, pkrs_log2: 0 } (and not elem_log2 = 3), so real console pipe configs and thick effective_run() == 1 layouts aren't covered against write-combined memory.
    • Note that #3701 and #3702 both add the identical with_upload_pair helper at crates/xcl/src/gpu/recomp/runner.rs:566 (whichever lands second will need a quick rebase/dedup), and tiling.rs also overlaps with open #901.
    • Minor repo hygiene: title/commit still lack an area prefix (D3D12.X: / Textures:), AI use names OpenAI Codex without the exact model name, and the two #[ignore] timing tests live in mod tests rather than crates/xcl/benches/.
  • Still needed for merge: full Windows workspace test suite, an AMD check (gpu:both), and a real title run past loading on head a276a5617b.

AI use: Capy, Google Gemini 4 Neon (static code review only; not built or tested on Windows/GPU).

<!-- greyfinch-sync:ivall/xcl:comment:7357319174 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3701#issuecomment-7357319174). Originally posted by [capy-ai[bot]](https://github.com/apps/capy-ai) on 2026-12-02T20:10:08Z. --- Code review (head `a276a5617b`, diff read only — not built or tested on Windows/GPU, not a merge-check) No code or memory-safety bugs found; merges cleanly onto `origin/main` (`5ad98adb`). - **Implementation looks sound:** `Chain::detile_volume_into` handles zero dimensions, validates destination bounds, respects `effective_run()` and tail-mip run origins (`(run - (x + l.origin.0) % run)`), zeroes missing/partial trailing elements in reused upload buffers, and leaves row padding intact. In `texture_upload.rs`, `plan_item` reserves `pitch * l.height * l.depth` bytes per volume piece, so the `from_raw_parts_mut` slice stays in bounds and disjoint across workers. - **Remaining coverage & benchmark gaps (non-blocking):** - Both `pitched_volume_matches_element_addresses_and_preserves_padding` and the new mapped WC upload benchmark only exercise `PipeConfig { pipes_log2: 0, pkrs_log2: 0 }` (and not `elem_log2 = 3`), so real console pipe configs and thick `effective_run() == 1` layouts aren't covered against write-combined memory. - Note that `#3701` and `#3702` both add the identical `with_upload_pair` helper at `crates/xcl/src/gpu/recomp/runner.rs:566` (whichever lands second will need a quick rebase/dedup), and `tiling.rs` also overlaps with open `#901`. - Minor repo hygiene: title/commit still lack an area prefix (`D3D12.X:` / `Textures:`), `AI use` names `OpenAI Codex` without the exact model name, and the two `#[ignore]` timing tests live in `mod tests` rather than `crates/xcl/benches/`. - **Still needed for merge:** full Windows workspace test suite, an AMD check (`gpu:both`), and a real title run past loading on head `a276a5617b`. AI use: Capy, Google Gemini 4 Neon (static code review only; not built or tested on Windows/GPU).
Kalmarv commented 2026-12-02 20:42:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-02T20:42:29Z.


merge-check
base: 5ad98adbc3 (current main)
head: a276a5617b
merge: clean (aacfe7c7c; runner.rs auto-merged)
build: cargo check -p xcl --all-targets -> ok (39 lib / 19 lib-test warnings, same as main 5ad98adbc); git diff --check clean
tests: cargo test -p xcl --lib -- --test-threads=1 gpu::tiling:: -> 22 passed, 0 failed, 2 ignored (the two manual benches); includes pitched_volume_matches_element_addresses_and_preserves_padding. Full workspace suite and GPU tests not run here; Foniass's full suite on 4aac1176b (this code without the bench commit) passed 2975/0.
review:

  • The output matches main by reading.
    • Missing elements read as zero as before. A source that ends mid-element copies whole elements only and zeroes the rest (tiling.rs:657ff), as main's per-element mem.get(o..o+e) did.
    • Padding stays untouched.
    • The other detile_volume callers (texture.rs, title_textures.rs, xg.rs) go through detile_volume_into with pitch == row, so their output is the same.
  • The upload slice stays in bounds. from_raw_parts_mut(to + p.at, pitch * l.height * l.depth) (texture_upload.rs:689-691) is exactly what plan_item reserves for the piece (*at += pitch * h * depth, :485), and l.height is checked against GetCopyableFootprints' row count (:462).
  • Run contiguity is safe for real pipe configs by construction.
    • run_elems (tiling.rs:174-188) only grows while none of oy/oz/hx/hy/hz touches the run's low address bits and while ox is linear within it, capped at block_w.
    • So an effective_run() run aligned on x + origin.0 is contiguous for any layout, including depth and pipe XOR terms. The 2D detiler already relies on the same primitive.
    • The 3D oracle test (:1347) still only uses PipeConfig{0,0}. Looping it over a real config, as parts_of_some_bytes_are_the_blocks_they_are_in does with {5,3} (:1101), would pin that for 3D at no cost.
  • Short runs into WC memory. On layouts where effective_run() == 1, the upload buffer gets one e-byte store per element (sequential within a row). The mapped benchmark covers only mode 5 RGBA8, a long-run case; one short-run mode would show the default path doesn't regress there.
  • Overlap with #901, which also rewrites detile_volume/tile_volume: whichever lands second needs a rebase.

performance: not run here; no GPU work in this check. The description's smoke pair shares a disturbed main block with #3702/#3703 (presents 51/16/48). Foniass's 5070 Ti pair on 4aac1176b (the same code without the bench commit), 1,422 -> 1,681 frames, 0 removals, is the usable one.
verdict: safe to merge: correct by reading and its tests pass on current main; a real PipeConfig in the 3D oracle test would be a good addition.
hardware / tool and model: NVIDIA GeForce RTX 5070 Ti, driver 32.0.16.1074, AMD Ryzen 9 9950X, Windows 11 Pro 26200 / Claude Code (claude-opus-5-5)

<!-- greyfinch-sync:ivall/xcl:comment:7358183155 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3701#issuecomment-7358183155). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-02T20:42:29Z. --- merge-check base: 5ad98adbc360225ac8a57ad9661e16fe8df9d8dd (current main) head: a276a5617b7c102da616ff01dbbb03d6266a00b6 merge: clean (aacfe7c7c; runner.rs auto-merged) build: cargo check -p xcl --all-targets -> ok (39 lib / 19 lib-test warnings, same as main 5ad98adbc); git diff --check clean tests: cargo test -p xcl --lib -- --test-threads=1 gpu::tiling:: -> 22 passed, 0 failed, 2 ignored (the two manual benches); includes pitched_volume_matches_element_addresses_and_preserves_padding. Full workspace suite and GPU tests not run here; Foniass's full suite on 4aac1176b (this code without the bench commit) passed 2975/0. review: - **The output matches `main` by reading.** - Missing elements read as zero as before. A source that ends mid-element copies whole elements only and zeroes the rest (`tiling.rs:657`ff), as `main`'s per-element `mem.get(o..o+e)` did. - Padding stays untouched. - The other `detile_volume` callers (`texture.rs`, `title_textures.rs`, `xg.rs`) go through `detile_volume_into` with `pitch == row`, so their output is the same. - **The upload slice stays in bounds.** `from_raw_parts_mut(to + p.at, pitch * l.height * l.depth)` (`texture_upload.rs:689-691`) is exactly what `plan_item` reserves for the piece (`*at += pitch * h * depth`, `:485`), and `l.height` is checked against `GetCopyableFootprints`' row count (`:462`). - **Run contiguity is safe for real pipe configs by construction.** - `run_elems` (`tiling.rs:174-188`) only grows while none of `oy`/`oz`/`hx`/`hy`/`hz` touches the run's low address bits and while `ox` is linear within it, capped at `block_w`. - So an `effective_run()` run aligned on `x + origin.0` is contiguous for any layout, including depth and pipe XOR terms. The 2D detiler already relies on the same primitive. - The 3D oracle test (`:1347`) still only uses `PipeConfig{0,0}`. Looping it over a real config, as `parts_of_some_bytes_are_the_blocks_they_are_in` does with `{5,3}` (`:1101`), would pin that for 3D at no cost. - **Short runs into WC memory.** On layouts where `effective_run() == 1`, the upload buffer gets one `e`-byte store per element (sequential within a row). The mapped benchmark covers only mode 5 RGBA8, a long-run case; one short-run mode would show the default path doesn't regress there. - **Overlap with #901**, which also rewrites `detile_volume`/`tile_volume`: whichever lands second needs a rebase. performance: not run here; no GPU work in this check. The description's smoke pair shares a disturbed `main` block with #3702/#3703 (presents 51/16/48). Foniass's 5070 Ti pair on `4aac1176b` (the same code without the bench commit), 1,422 -> 1,681 frames, 0 removals, is the usable one. verdict: safe to merge: correct by reading and its tests pass on current main; a real PipeConfig in the 3D oracle test would be a good addition. hardware / tool and model: NVIDIA GeForce RTX 5070 Ti, driver 32.0.16.1074, AMD Ryzen 9 9950X, Windows 11 Pro 26200 / Claude Code (claude-opus-5-5)
lucsoft commented 2026-12-02 20:43:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by lucsoft on 2026-12-02T20:43:31Z.


merge-check claim
head: a276a5617b

<!-- greyfinch-sync:ivall/xcl:comment:7358211389 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3701#issuecomment-7358211389). Originally posted by [lucsoft](https://github.com/lucsoft) on 2026-12-02T20:43:31Z. --- merge-check claim head: a276a5617b7c102da616ff01dbbb03d6266a00b6
lucsoft commented 2026-12-02 23:13:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by lucsoft on 2026-12-02T23:13:26Z.


merge-check
base: 5ad98adbc3
head: a276a5617b
merge: clean (merge commit 69f5c95f, auto-merge in runner.rs, git diff --check clean)
build: cargo build --release -p xcl && cargo test --workspace --release --no-run (x86_64-pc-windows-gnu) -> ok
tests: lib 2798 passed, 17 failed, 15 ignored, 31 died; integration 134 passed, 6 failed, 20 ignored, 2 exes died (main 5ad98adb: lib 2797 / 17 / 13 / 31; +1 passed = pitched_volume_matches_element_addresses_and_preserves_padding, +2 ignored = the manual benches). The one extra integration death is d3d12_resource_and_sync: glibc "free(): corrupted unsorted chunks" right after its GetGPUVirtualAddress-of-a-committed-texture line, the same message at the same point as an earlier main run here. Over all runs here (2 threads) it died in 4 of 10 on this PR (suite 1/1, rerun 2/3, alternating A/B 1/6) and in 0 of 6 on main 5ad98adb in that A/B. The test creates no 3D texture, so detile_volume / detile_volume_into (volume textures only) do not run in it; I read it as the known Linux-side abort, but the rate here was higher than on main. Under Wine, one test module per process with --test-threads=2, not 4. Skipped: 8 tests, the same set as on main (no dxc.exe, no D3D12 debug layer, heap windows opt-in, driver cache cannot be disabled, stale-blob probe refused, Close does not refuse an open pipeline-statistics query x2, SetPredication ignored for copies). failing: every failure also fails on main 5ad98adb in the same setup (suite-diff by test name: 0 only on this PR): 31 died = 29 split-wave/DXIL GPU tests that abort in dxil-spirv without #3707 (module::split 10, mask_exchange 5, lower_dxil 5, recomp 4, robustness 2, idioms 2, lower 1), hle::netoff 1, and the known serialize_root_signature hang (not run), 17 failed = Wine/RADV-specific (title_textures group 4, list_x 3, recomp 2, lower_dxil 2, and single ones in root_signature, driver_cache, descriptor_heap, device_x, round, fuzz); integration: gpu_compute_e2e died, e2e x2, frame_clock, gpu_two_pass_cache_e2e, pls_quota, tls_slot_zero fail on main too
title run: retail title, RX 7800 XT (RADV, Wine), 480 s run, past the loading screen into the in-engine intro cutscenes / prologue (world rendering from 131 s: first 2 s window with >= 1000 draws), 350 s there, no crash, no device removal, 0 amdgpu page faults or ring timeouts, 0.80 presents/s there (2724 frames in total). Run on this merge result + #3707 (912ff558) on top: main 5ad98adb alone aborts ~3 s in under vkd3d-proton (dxil-spirv, the helper functions #3707 inlines), so did this merge without it (exit 0x3 at ~3.3 s). main 5ad98adb + #3707 the same way: 359 s there, no crash, 0.59 presents/s, 2182 frames.
review: read the whole diff (+200/-10). detile_volume_into writes each row straight into the upload footprint in runs of effective_run() elements, shortened for tail-mip origins ((x + origin.0) % run), instead of detiling into a temporary Vec and copying rows. In fill_hashed the destination slice is pitch * height * depth, which is exactly what plan_item reserved for a volume piece (rect = 0..width, row_bytes = width * bpe checked against GetCopyableFootprints), and the asserts (pitch >= row, last row fits) hold for it. Short sources: a run that runs past mem copies the whole elements left and zero-fills the rest, same bytes as the old per-element path (old: fresh zeroed Vec), and row padding stays untouched. The new test compares against per-element addressing for modes 0, 5, 9, 24 (with base_xor) and truncated/empty sources; other 3D swizzle modes rely on element_at_z being contiguous within effective_run() and are not covered by the test. with_upload_pair is #[cfg(test)]. No findings.
performance: removes a temporary allocation + one full copy per uploaded volume mip; cannot cost frame time or memory. Title run 0.80 presents/s vs 0.59 on the base (noise at this rate).
verdict: safe to merge
hardware / tool and model: AMD Radeon RX 7800 XT (RADV NAVI32, Mesa 26.3.1), Ryzen 7 7800X3D, NixOS (Linux 7.3.5) with Wine staging 11.21 + vkd3d-proton 3.1 / Claude Code, claude-opus-5-5

<!-- greyfinch-sync:ivall/xcl:comment:7361720087 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3701#issuecomment-7361720087). Originally posted by [lucsoft](https://github.com/lucsoft) on 2026-12-02T23:13:26Z. --- merge-check base: 5ad98adbc360225ac8a57ad9661e16fe8df9d8dd head: a276a5617b7c102da616ff01dbbb03d6266a00b6 merge: clean (merge commit 69f5c95f, auto-merge in runner.rs, git diff --check clean) build: cargo build --release -p xcl && cargo test --workspace --release --no-run (x86_64-pc-windows-gnu) -> ok tests: lib 2798 passed, 17 failed, 15 ignored, 31 died; integration 134 passed, 6 failed, 20 ignored, 2 exes died (main 5ad98adb: lib 2797 / 17 / 13 / 31; +1 passed = pitched_volume_matches_element_addresses_and_preserves_padding, +2 ignored = the manual benches). The one extra integration death is d3d12_resource_and_sync: glibc "free(): corrupted unsorted chunks" right after its GetGPUVirtualAddress-of-a-committed-texture line, the same message at the same point as an earlier main run here. Over all runs here (2 threads) it died in 4 of 10 on this PR (suite 1/1, rerun 2/3, alternating A/B 1/6) and in 0 of 6 on main 5ad98adb in that A/B. The test creates no 3D texture, so detile_volume / detile_volume_into (volume textures only) do not run in it; I read it as the known Linux-side abort, but the rate here was higher than on main. Under Wine, one test module per process with --test-threads=2, not 4. Skipped: 8 tests, the same set as on main (no dxc.exe, no D3D12 debug layer, heap windows opt-in, driver cache cannot be disabled, stale-blob probe refused, Close does not refuse an open pipeline-statistics query x2, SetPredication ignored for copies). failing: every failure also fails on main 5ad98adb in the same setup (suite-diff by test name: 0 only on this PR): 31 died = 29 split-wave/DXIL GPU tests that abort in dxil-spirv without #3707 (module::split 10, mask_exchange 5, lower_dxil 5, recomp 4, robustness 2, idioms 2, lower 1), hle::netoff 1, and the known serialize_root_signature hang (not run), 17 failed = Wine/RADV-specific (title_textures group 4, list_x 3, recomp 2, lower_dxil 2, and single ones in root_signature, driver_cache, descriptor_heap, device_x, round, fuzz); integration: gpu_compute_e2e died, e2e x2, frame_clock, gpu_two_pass_cache_e2e, pls_quota, tls_slot_zero fail on main too title run: retail title, RX 7800 XT (RADV, Wine), 480 s run, past the loading screen into the in-engine intro cutscenes / prologue (world rendering from 131 s: first 2 s window with >= 1000 draws), 350 s there, no crash, no device removal, 0 amdgpu page faults or ring timeouts, 0.80 presents/s there (2724 frames in total). Run on this merge result + #3707 (912ff558) on top: main 5ad98adb alone aborts ~3 s in under vkd3d-proton (dxil-spirv, the helper functions #3707 inlines), so did this merge without it (exit 0x3 at ~3.3 s). main 5ad98adb + #3707 the same way: 359 s there, no crash, 0.59 presents/s, 2182 frames. review: read the whole diff (+200/-10). detile_volume_into writes each row straight into the upload footprint in runs of effective_run() elements, shortened for tail-mip origins ((x + origin.0) % run), instead of detiling into a temporary Vec and copying rows. In fill_hashed the destination slice is pitch * height * depth, which is exactly what plan_item reserved for a volume piece (rect = 0..width, row_bytes = width * bpe checked against GetCopyableFootprints), and the asserts (pitch >= row, last row fits) hold for it. Short sources: a run that runs past mem copies the whole elements left and zero-fills the rest, same bytes as the old per-element path (old: fresh zeroed Vec), and row padding stays untouched. The new test compares against per-element addressing for modes 0, 5, 9, 24 (with base_xor) and truncated/empty sources; other 3D swizzle modes rely on element_at_z being contiguous within effective_run() and are not covered by the test. with_upload_pair is #[cfg(test)]. No findings. performance: removes a temporary allocation + one full copy per uploaded volume mip; cannot cost frame time or memory. Title run 0.80 presents/s vs 0.59 on the base (noise at this rate). verdict: safe to merge hardware / tool and model: AMD Radeon RX 7800 XT (RADV NAVI32, Mesa 26.3.1), Ryzen 7 7800X3D, NixOS (Linux 7.3.5) with Wine staging 11.21 + vkd3d-proton 3.1 / Claude Code, claude-opus-5-5
Foniass commented 2026-12-03 02:19:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T02:19:41Z.


merge-check
base: 078358a058
head: a276a5617b
merge: clean
build: ok
tests: 3007 passed, 0 failed, 54 ignored; 28 skipped, the same as on main
review: 4 medium, 1 nit (below)
performance: 60 s smoke run: 1669 → 1681 frames (100 % of main), peak commit 17577 → 18074 MB, no device removal, no crash
title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 228 s there, 0 device removals, 0 crashes, 3 presents/s; run with XCL_SKIP_CS=95cc13288a27a96e (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590)
verdict: safe to merge: no blocking finding (the points below are medium or nits), the suite passes and the smoke run is clean
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5


In short: Detiles each volume mip straight into the pitched upload memory, copying runs of contiguous elements, instead of building a Vec and copying it row by row. Since the earlier merge-check it has added smoke blocks and a benchmark on a real write-combined upload heap, and by reading the output still matches the old path element for element. Nothing blocks; the oracle test still uses only the zero pipe config.

Medium

  1. Test covers only the zero pipe config. pitched_volume_matches_element_addresses_and_preserves_padding (tiling.rs ~1347) still uses only PipeConfig {0, 0} and never elem_log2 = 3. With the real pipe configs (texture.rs:22-23), hx/hy/hz are non-zero and runs get shorter. Add those configs to the oracle loop; it runs on the CPU and is cheap (earlier finding still open).
  2. Thick layouts on write-combined memory are unmeasured. The mapped benchmark uses mode 5 with 4-byte elements, where runs are long. On thick layouts a run can be a single element, so the upload heap gets 4- or 8-byte writes where main wrote whole rows. Add a thick mode to bench_volume_detile_pitched_upload_mapped, or say under Not tested that it may be slower there.
  3. Still overlaps #901 and #1624. Both are still open. #901 rewrites detile_volume as block runs, and #1624 changes the base_xor masking that effective_run relies on. Agree which lands first (earlier finding still open).
  4. Description and commit gaps. The first commit has no area prefix ("Detile volume mips…"; use Textures:). There is no issue link and no full-suite count for this head, and the Not tested section names no GPU vendor (AMD is mentioned only under Regression run).

Nit

  1. Two manual benchmarks as #[ignore] tests. bench_volume_detile_pitched_upload (ordinary RAM) is now superseded by the mapped one. Drop it, and consider benches/ for the mapped one.
Checked and fine
  • Earlier finding fixed: smoke blocks of main and this head are in the PR (1449 to 1435 frames, peak commit 23474 to 23767 MB, no device removal or crash)
  • Earlier finding fixed: the speed-up is now measured into a native D3D12 upload heap reported as write-combined (1.281 to 1.213 ms against contiguous runs plus a row copy)
  • By reading, the output matches the old path byte for byte: missing or partial elements read as zeros, and row padding is left alone
  • The bounds assert in detile_volume_into is exact, and the slice built in fill_hashed (pitchhd) stays inside what plan_item reserved (at += pitchhdepth)
  • run_elems already leaves out the oy/oz/hx/hy/hz bits, so runs stay contiguous for nonzero pipe configs by construction
  • with_upload_pair is test-only and identical to #3702's, so the two PRs merge together cleanly
How this was tested
  • Merged onto main 078358a0, then cargo build --workspace and cargo test --workspace --no-fail-fast -- --test-threads=4.
  • The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar).
  • scripts/smoke.ps1: 60 s of a retail title on main 078358a0 and on this merge; presents per 2 s at the end: 60 60 60.
  • Title run: the release build of this merge launched the retail title with XCL_RUN_SECONDS=300 and scripted A presses counted from the first frame (XCL_PRESS_BASE=frame, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7365341285 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3701#issuecomment-7365341285). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-03T02:19:41Z. --- merge-check base: 078358a058f7ba5d16690dba8dc4e55d2c88ae0a head: a276a5617b7c102da616ff01dbbb03d6266a00b6 merge: clean build: ok tests: 3007 passed, 0 failed, 54 ignored; 28 skipped, the same as on main review: 4 medium, 1 nit (below) performance: 60 s smoke run: 1669 → 1681 frames (100 % of main), peak commit 17577 → 18074 MB, no device removal, no crash title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 228 s there, 0 device removals, 0 crashes, 3 presents/s; run with `XCL_SKIP_CS=95cc13288a27a96e` (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590) verdict: safe to merge: no blocking finding (the points below are medium or nits), the suite passes and the smoke run is clean hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 --- **In short:** Detiles each volume mip straight into the pitched upload memory, copying runs of contiguous elements, instead of building a Vec and copying it row by row. Since the earlier merge-check it has added smoke blocks and a benchmark on a real write-combined upload heap, and by reading the output still matches the old path element for element. Nothing blocks; the oracle test still uses only the zero pipe config. #### Medium 1. **Test covers only the zero pipe config.** pitched_volume_matches_element_addresses_and_preserves_padding (tiling.rs ~1347) still uses only PipeConfig {0, 0} and never elem_log2 = 3. With the real pipe configs (texture.rs:22-23), hx/hy/hz are non-zero and runs get shorter. Add those configs to the oracle loop; it runs on the CPU and is cheap (earlier finding still open). 2. **Thick layouts on write-combined memory are unmeasured.** The mapped benchmark uses mode 5 with 4-byte elements, where runs are long. On thick layouts a run can be a single element, so the upload heap gets 4- or 8-byte writes where main wrote whole rows. Add a thick mode to bench_volume_detile_pitched_upload_mapped, or say under Not tested that it may be slower there. 3. **Still overlaps #901 and #1624.** Both are still open. #901 rewrites detile_volume as block runs, and #1624 changes the base_xor masking that effective_run relies on. Agree which lands first (earlier finding still open). 4. **Description and commit gaps.** The first commit has no area prefix ("Detile volume mips…"; use Textures:). There is no issue link and no full-suite count for this head, and the Not tested section names no GPU vendor (AMD is mentioned only under Regression run). #### Nit 5. **Two manual benchmarks as #[ignore] tests.** bench_volume_detile_pitched_upload (ordinary RAM) is now superseded by the mapped one. Drop it, and consider benches/ for the mapped one. <details><summary>Checked and fine</summary> - Earlier finding fixed: smoke blocks of main and this head are in the PR (1449 to 1435 frames, peak commit 23474 to 23767 MB, no device removal or crash) - Earlier finding fixed: the speed-up is now measured into a native D3D12 upload heap reported as write-combined (1.281 to 1.213 ms against contiguous runs plus a row copy) - By reading, the output matches the old path byte for byte: missing or partial elements read as zeros, and row padding is left alone - The bounds assert in detile_volume_into is exact, and the slice built in fill_hashed (pitch*h*d) stays inside what plan_item reserved (at += pitch*h*depth) - run_elems already leaves out the oy/oz/hx/hy/hz bits, so runs stay contiguous for nonzero pipe configs by construction - with_upload_pair is test-only and identical to #3702's, so the two PRs merge together cleanly </details> <details><summary>How this was tested</summary> - Merged onto main `078358a0`, then `cargo build --workspace` and `cargo test --workspace --no-fail-fast -- --test-threads=4`. - The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar). - `scripts/smoke.ps1`: 60 s of a retail title on main `078358a0` and on this merge; presents per 2 s at the end: 60 60 60. - Title run: the release build of this merge launched the retail title with `XCL_RUN_SECONDS=300` and scripted A presses counted from the first frame (`XCL_PRESS_BASE=frame`, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
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!3701
No description provided.