Direct DXIL: size a compute program's LDS block from its LDS_SIZE #2148

Open
grahamster2 wants to merge 2 commits from upstream-pr/2158 into main
grahamster2 commented 2026-11-25 06:32:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by grahamster2 on 2026-11-25T06:32:44Z.


Stacked on #2146; only the last commit (55d06c1) belongs here, please review that one.

The direct DXIL backend (XCL_DIRECT_DXIL) declares its xcl_lds with 8192 words for every program, as the HLSL kernel did before #2146. This sizes it by the same rule: a compute program's COMPUTE_PGM_RSRC2.LDS_SIZE plus the same reserved top words, rounded up to a power of two. The exchange words, XCL_WT and the address mask in lds_index move to the new block's top. LDS_SIZE 0 and the other stages keep 8192 words.

Part of #675.

What is in it

  • Lw::lds_words, set in setup_storage from the entry's lds_bytes (gpu/dxil/lanes.rs, kernel.rs, lower.rs), and used by the mask in lds_index (lower_mem.rs).
  • gpu_compute_lds_ring_in_a_block_of_the_programs_size also runs the direct translation. It covers the kernels direct_or runs (wave32, and wave64 in the split form) and checks that @xcl_lds has the HLSL block's size. With the old 8192-word block, the test fails.
  • bench_compute_lds_block (ignored, next to bench_split_wave64): the 32 KB block against the LDS_SIZE block, in a loop with an LDS store and load and an exchange per iteration.

Tested

  • RTX 3080 10 GB (driver 610.88), Ryzen 5 7600X, Windows 11 Pro 26200, rustc 1.94.0.
  • cargo test --workspace -- --test-threads=4 at 55d06c1: 1156 passed, 0 failed, 47 ignored. The SKIPPED tests are the same as in #2146 (no wave64).
  • XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- --test-threads=4: 1099 passed, 1 failed, 27 ignored. The failure, gpu_image_get_resinfo_1d_array, also fails with XCL_DIRECT_DXIL=1 at 52577f9, so it is not from this change.
  • bench_compute_lds_block, 2^18 threads x 8192 iterations, 64-thread groups, 32 KB block -> LDS_SIZE block:
backend wave32 wave64, split form
HLSL (#2146) 7.8 -> 3.5 ms 39.4 -> 12.4 ms
direct DXIL (this PR) 10.3 -> 2.3 ms 16.5 -> 5.5 ms

256-thread groups: 1.0x to 1.27x.

Regression run
Both runs with XCL_DIRECT_DXIL=1 (the path this changes).

main (cbc296a):

xcl-smoke v1
commit: cbc296ab65a2661a61e3e2da109134bcd5319f60
gpu: NVIDIA GeForce RTX 3080
title: 5d6132ca
seconds: 60
exit: 0x0
frames shown: 1576 (PresentX 1577)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15317 MB

this PR (55d06c1):

xcl-smoke v1
commit: 55d06c1e02831b09a931d383b7f6ea4bb6793b9e
gpu: NVIDIA GeForce RTX 3080
title: 5d6132ca
seconds: 60
exit: 0x0
frames shown: 1623 (PresentX 1623)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15370 MB

Not tested

  • AMD (native wave64).
  • Each backend picks its own exchange slot size: HLSL from what it emits, direct DXIL from a scan of the program. A program with a ds_bpermute, a coherent s_load or a two-word reduction tail can get a different slot size, and then a different block in the two backends. Each layout still fits its own block, and the test covers the one-word slot.
  • Out-of-range LDS addresses wrap within the smaller block, as in #2146.

AI use

  • Claude Code with Claude Opus 5.5: the code, the tests and this description. A separate Claude Sonnet review of the diff led to gating the direct half of the test to the kernels direct_or runs, and to matching @xcl_lds exactly.
<!-- greyfinch-sync:ivall/xcl:issue:5486429476 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2158). Originally posted by [grahamster2](https://github.com/grahamster2) on 2026-11-25T06:32:44Z. --- Stacked on #2146; only the last commit (55d06c1) belongs here, please review that one. The direct DXIL backend (`XCL_DIRECT_DXIL`) declares its `xcl_lds` with 8192 words for every program, as the HLSL kernel did before #2146. This sizes it by the same rule: a compute program's `COMPUTE_PGM_RSRC2.LDS_SIZE` plus the same reserved top words, rounded up to a power of two. The exchange words, `XCL_WT` and the address mask in `lds_index` move to the new block's top. LDS_SIZE 0 and the other stages keep 8192 words. Part of #675. **What is in it** - `Lw::lds_words`, set in `setup_storage` from the entry's `lds_bytes` (`gpu/dxil/lanes.rs`, `kernel.rs`, `lower.rs`), and used by the mask in `lds_index` (`lower_mem.rs`). - `gpu_compute_lds_ring_in_a_block_of_the_programs_size` also runs the direct translation. It covers the kernels `direct_or` runs (wave32, and wave64 in the split form) and checks that `@xcl_lds` has the HLSL block's size. With the old 8192-word block, the test fails. - `bench_compute_lds_block` (ignored, next to `bench_split_wave64`): the 32 KB block against the LDS_SIZE block, in a loop with an LDS store and load and an exchange per iteration. **Tested** - RTX 3080 10 GB (driver 610.88), Ryzen 5 7600X, Windows 11 Pro 26200, rustc 1.94.0. - `cargo test --workspace -- --test-threads=4` at 55d06c1: 1156 passed, 0 failed, 47 ignored. The SKIPPED tests are the same as in #2146 (no wave64). - `XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- --test-threads=4`: 1099 passed, 1 failed, 27 ignored. The failure, `gpu_image_get_resinfo_1d_array`, also fails with `XCL_DIRECT_DXIL=1` at 52577f9, so it is not from this change. - `bench_compute_lds_block`, 2^18 threads x 8192 iterations, 64-thread groups, 32 KB block -> LDS_SIZE block: | backend | wave32 | wave64, split form | |---|---|---| | HLSL (#2146) | 7.8 -> 3.5 ms | 39.4 -> 12.4 ms | | direct DXIL (this PR) | 10.3 -> 2.3 ms | 16.5 -> 5.5 ms | 256-thread groups: 1.0x to 1.27x. **Regression run** Both runs with `XCL_DIRECT_DXIL=1` (the path this changes). main (cbc296a): ``` xcl-smoke v1 commit: cbc296ab65a2661a61e3e2da109134bcd5319f60 gpu: NVIDIA GeForce RTX 3080 title: 5d6132ca seconds: 60 exit: 0x0 frames shown: 1576 (PresentX 1577) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15317 MB ``` this PR (55d06c1): ``` xcl-smoke v1 commit: 55d06c1e02831b09a931d383b7f6ea4bb6793b9e gpu: NVIDIA GeForce RTX 3080 title: 5d6132ca seconds: 60 exit: 0x0 frames shown: 1623 (PresentX 1623) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15370 MB ``` **Not tested** - AMD (native wave64). - Each backend picks its own exchange slot size: HLSL from what it emits, direct DXIL from a scan of the program. A program with a ds_bpermute, a coherent s_load or a two-word reduction tail can get a different slot size, and then a different block in the two backends. Each layout still fits its own block, and the test covers the one-word slot. - Out-of-range LDS addresses wrap within the smaller block, as in #2146. **AI use** - Claude Code with Claude Opus 5.5: the code, the tests and this description. A separate Claude Sonnet review of the diff led to gating the direct half of the test to the kernels `direct_or` runs, and to matching `@xcl_lds` exactly.
JJAutoCompare commented 2026-11-25 07:05:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T07:01:24Z.


Tested

PR #2158, stacked on #2146, was open at 55d06c1e02831b09a931d383b7f6ea4bb6793b9e before and after testing. The assigned checkout was clean and detached at that SHA. The initial GitHub API response and final public PR page agreed with the live Git pull ref. The PR describes same-head RTX 3080 coverage. The discussion contained no equivalent Arc A770 coverage.

STOR-WINLAB ran Windows 11 Enterprise Evaluation 26200.9974 on a Ryzen 7 3800X with an Intel Arc A770, driver 32.0.101.9175. Rust and Cargo were 1.100.0 on x86_64-pc-windows-msvc (rustc 0ef1bc386). Both runs loaded DXC and DXIL 1.9.2609.5 from %LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64.

Cargo used the unoptimized test profile with CARGO_BUILD_JOBS=2, CARGO_INCREMENTAL=0, CARGO_PROFILE_DEV_DEBUG=0, CARGO_PROFILE_TEST_DEBUG=0 and the exclusive target L:/XclTooling/pr1947-1831ec4-t3-97236edf/target. TEMP and TMP both used L:/XclTooling/pr2158/temp. The build finished outside the Arc mutex in 59.47 s. The invocation used -NoProfile -ExecutionPolicy RemoteSigned for that PowerShell process.

cargo test --locked -p xcl --lib -j 2 --no-run --message-format=json
$fixtureExe = 'L:/XclTooling/pr1947-1831ec4-t3-97236edf/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe'
$env:XCL_ADAPTER = 'A770'
$env:XCL_DXC_DIR = Join-Path $env:LOCALAPPDATA 'XclTooling/dxc-1.9.2609/bin/x64'
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
    $env:XCL_DIRECT_DXIL = '1'
    & $fixtureExe --exact gpu::recomp::tests::gpu_compute_lds_ring_in_a_block_of_the_programs_size --nocapture --test-threads=1
    $env:XCL_DIRECT_DXIL = '0'
    & $fixtureExe --exact gpu::recomp::tests::gpu_compute_lds_ring_in_a_block_of_the_programs_size --nocapture --test-threads=1
}
XCL_DIRECT_DXIL Passed Failed Ignored Skipped Filtered out Fixture time Exit
1 1 0 0 0 1126 1.60 s 0
0 1 0 0 0 1126 1.01 s 0

The fixture explicitly compiles HLSL through DXC and translates direct DXIL under both environment settings. The two invocations therefore repeat the same assertions. The existing STOR-WINLAB A770 capability log records a D3D12 wave-lane range of 8 to 32, so the fixture exercised wave32 and split wave64 for 64×1×1, 256×1×1 and 8×8×1 thread groups. For each of the six configurations, the fixture checked the direct DXIL @xcl_lds declaration against the HLSL block size and compared each backend’s per-thread ring and first-lane exchange result to the expected integer arithmetic. This exercises the fixture’s one-word exchange slot.

The executable SHA-256 was 896E8C588C18A5363FF54AD4B25C76842C9B260409AA28D89C9772E0825B74D9 before waiting for the Arc mutex, after acquiring it and after both runs. The Arc mutex and target were released after testing.

Combined: 2 passed, 0 failed, 0 ignored, 0 skipped.

Not tested

Native wave64, other adapters, other exchange layouts, negative cases, runtime backend selection, broader test suites, benchmarks, retail titles and smoke/regression runs.

AI use

T3 Code / Codex (gpt-6.2-sol) ran the checked-in fixture, verified its assertion coverage and prepared this report.

<!-- greyfinch-sync:ivall/xcl:comment:7155403751 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2158#issuecomment-7155403751). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T07:01:24Z. --- ## Tested [PR #2158](https://github.com/xcl-dev/xcl/pull/2158), stacked on #2146, was open at `55d06c1e02831b09a931d383b7f6ea4bb6793b9e` before and after testing. The assigned checkout was clean and detached at that SHA. The initial GitHub API response and final public PR page agreed with the live Git pull ref. The PR describes same-head RTX 3080 coverage. The discussion contained no equivalent Arc A770 coverage. STOR-WINLAB ran Windows 11 Enterprise Evaluation 26200.9974 on a Ryzen 7 3800X with an Intel Arc A770, driver `32.0.101.9175`. Rust and Cargo were `1.100.0` on `x86_64-pc-windows-msvc` (rustc `0ef1bc386`). Both runs loaded DXC and DXIL `1.9.2609.5` from `%LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64`. Cargo used the unoptimized test profile with `CARGO_BUILD_JOBS=2`, `CARGO_INCREMENTAL=0`, `CARGO_PROFILE_DEV_DEBUG=0`, `CARGO_PROFILE_TEST_DEBUG=0` and the exclusive target `L:/XclTooling/pr1947-1831ec4-t3-97236edf/target`. `TEMP` and `TMP` both used `L:/XclTooling/pr2158/temp`. The build finished outside the Arc mutex in 59.47 s. The invocation used `-NoProfile -ExecutionPolicy RemoteSigned` for that PowerShell process. ```powershell cargo test --locked -p xcl --lib -j 2 --no-run --message-format=json $fixtureExe = 'L:/XclTooling/pr1947-1831ec4-t3-97236edf/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe' $env:XCL_ADAPTER = 'A770' $env:XCL_DXC_DIR = Join-Path $env:LOCALAPPDATA 'XclTooling/dxc-1.9.2609/bin/x64' & 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { $env:XCL_DIRECT_DXIL = '1' & $fixtureExe --exact gpu::recomp::tests::gpu_compute_lds_ring_in_a_block_of_the_programs_size --nocapture --test-threads=1 $env:XCL_DIRECT_DXIL = '0' & $fixtureExe --exact gpu::recomp::tests::gpu_compute_lds_ring_in_a_block_of_the_programs_size --nocapture --test-threads=1 } ``` | `XCL_DIRECT_DXIL` | Passed | Failed | Ignored | Skipped | Filtered out | Fixture time | Exit | | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | | `1` | 1 | 0 | 0 | 0 | 1126 | 1.60 s | 0 | | `0` | 1 | 0 | 0 | 0 | 1126 | 1.01 s | 0 | The fixture explicitly compiles HLSL through DXC and translates direct DXIL under both environment settings. The two invocations therefore repeat the same assertions. The existing STOR-WINLAB A770 capability log records a D3D12 wave-lane range of 8 to 32, so the fixture exercised wave32 and split wave64 for 64×1×1, 256×1×1 and 8×8×1 thread groups. For each of the six configurations, the fixture checked the direct DXIL `@xcl_lds` declaration against the HLSL block size and compared each backend’s per-thread ring and first-lane exchange result to the expected integer arithmetic. This exercises the fixture’s one-word exchange slot. The executable SHA-256 was `896E8C588C18A5363FF54AD4B25C76842C9B260409AA28D89C9772E0825B74D9` before waiting for the Arc mutex, after acquiring it and after both runs. The Arc mutex and target were released after testing. **Combined: 2 passed, 0 failed, 0 ignored, 0 skipped.** ## Not tested Native wave64, other adapters, other exchange layouts, negative cases, runtime backend selection, broader test suites, benchmarks, retail titles and smoke/regression runs. ## AI use T3 Code / Codex (`gpt-6.2-sol`) ran the checked-in fixture, verified its assertion coverage and prepared this report.
DavidM1911 commented 2026-11-25 08:08:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T07:20:25Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7155751018 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2158#issuecomment-7155751018). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T07:20:25Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
DarkPanda69 commented 2026-11-25 08:08:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DarkPanda69 on 2026-11-25T07:33:50Z.


Tested: gpu_compute_lds_ring_in_a_block_of_the_programs_size passes on AMD with native 64-lane waves (the case the PR lists as untested), and on an RTX 3060.

  • RX 9070 XT (RDNA4, driver 32.0.32029.2010, waves 32..64): ok, so its wave64 cases ran natively (not split) with the program-sized LDS block. Whole gpu:: filter: 586 passed, 2 failed, 23 ignored. The 2 failures are the AMD fuzz seeds 722 and 1599 tracked in #2115, which fail the same way on main.
  • RTX 3060 (driver 32.0.16.1088, waves 32 only): ok. 588 passed, 0 failed, 23 ignored.

Head 55d06c1 applied on main 568e7db, debug, cargo test -p xcl --lib -- gpu:: --test-threads=4 with XCL_ADAPTER set to each card. The HLSL half (#2146) passed the same way on this card earlier.
Not tested: occupancy or speed on AMD (correctness only), a title.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7156000953 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2158#issuecomment-7156000953). Originally posted by [DarkPanda69](https://github.com/DarkPanda69) on 2026-11-25T07:33:50Z. --- Tested: `gpu_compute_lds_ring_in_a_block_of_the_programs_size` passes on AMD with native 64-lane waves (the case the PR lists as untested), and on an RTX 3060. - RX 9070 XT (RDNA4, driver 32.0.32029.2010, waves 32..64): ok, so its wave64 cases ran natively (not split) with the program-sized LDS block. Whole `gpu::` filter: 586 passed, 2 failed, 23 ignored. The 2 failures are the AMD fuzz seeds 722 and 1599 tracked in #2115, which fail the same way on `main`. - RTX 3060 (driver 32.0.16.1088, waves 32 only): ok. 588 passed, 0 failed, 23 ignored. Head `55d06c1` applied on `main` `568e7db`, debug, `cargo test -p xcl --lib -- gpu:: --test-threads=4` with `XCL_ADAPTER` set to each card. The HLSL half (#2146) passed the same way on this card earlier. Not tested: occupancy or speed on AMD (correctness only), a title. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
emirduran707 commented 2026-11-25 22:06:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-25T21:14:57Z.


Independent AMD RDNA4 (native wave64) test report on exact head 55d06c1e02831b09a931d383b7f6ea4bb6793b9e (clean detached checkout, no local changes).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1154 passed, 2 failed, 47 ignored; 8 SKIPPED (6 in lower_dxil::tests::{f16,f32}_programs_on_the_gpu refused by per-lane form; heap_window_out_of_memory_falls_back_to_the_switch_form; pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.
    • The PR's test passed: gpu::recomp::tests::compute_lds_block_takes_the_programs_lds_size.
    • The 2 failures (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 seed 722 and fuzz_validate_and_gpu_3 seed 1599) are pre-existing on unmodified main on this GPU.

Regression run (60 s retail-title smoke, XCL_NETWORK=0, release)

xcl-smoke v1
commit: 55d06c1e02831b09a931d383b7f6ea4bb6793b9e
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1562 (PresentX 1562)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16794 MB

(Matched main 68a284a baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)

Not tested

  • D3D12 debug layer; Intel GPUs.

AI use

  • Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7174814512 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2158#issuecomment-7174814512). Originally posted by [emirduran707](https://github.com/emirduran707) on 2026-11-25T21:14:57Z. --- Independent AMD RDNA4 (native wave64) test report on exact head `55d06c1e02831b09a931d383b7f6ea4bb6793b9e` (clean detached checkout, no local changes). **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2602.17; tests debug, smoke release. - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4`: **1154 passed, 2 failed, 47 ignored; 8 SKIPPED** (6 in `lower_dxil::tests::{f16,f32}_programs_on_the_gpu` refused by per-lane form; `heap_window_out_of_memory_falls_back_to_the_switch_form`; `pso_measurement_compiles_an_exact_synthetic_record`). All native wave64 GPU tests ran and passed. - The PR's test passed: `gpu::recomp::tests::compute_lds_block_takes_the_programs_lds_size`. - The 2 failures (`gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` seed 722 and `fuzz_validate_and_gpu_3` seed 1599) are pre-existing on unmodified `main` on this GPU. **Regression run** (60 s retail-title smoke, `XCL_NETWORK=0`, release) ``` xcl-smoke v1 commit: 55d06c1e02831b09a931d383b7f6ea4bb6793b9e gpu: AMD Radeon RX 9060 XT title: 21222967 seconds: 60 exit: 0x0 frames shown: 1562 (PresentX 1562) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16794 MB ``` (Matched `main` `68a284a` baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.) **Not tested** - D3D12 debug layer; Intel GPUs. **AI use** - Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
Decodere commented 2026-11-27 09:04:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T09:04:06Z.


Independent desktop NVIDIA verification of PR #2158 at head 55d06c1e02831b09a931d383b7f6ea4bb6793b9e (2 commits stacked on PR #2146: 52577f993895afe1cc3e492a063b6f73821ee57c -> 55d06c1e02831b09a931d383b7f6ea4bb6793b9e; exact parent & merge-base: cbc296ab65a2661a61e3e2da109134bcd5319f60, pre-#2555 ancestor of main).

Environment

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

Targeted release tests & build (55d06c1e)

Command Result
cargo test --release -p xcl --lib compute_lds_block_takes_the_programs_lds_size -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1126 filtered out × 3 (0.00s × 3, 0 skipped)
cargo test --release -p xcl --lib gpu_compute_lds_ring_in_a_block_of_the_programs_size -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1126 filtered out × 3 (0.60s, 0.53s, 0.54s, 0 skipped; live RTX 4060 execution across HLSL and direct-DXIL backends)
cargo test --release -p xcl --lib gpu::dxil:: -- --test-threads=4 (3 consecutive runs) 122 passed; 0 failed; 3 ignored; 1002 filtered out × 3 (4.08s, 4.19s, 4.35s, 0 skipped)
cargo build --release -p xcl Clean build (1m 28s, exit 0, 0 new warnings)

Paired quiet 60 s retail smoke (title: 29640639)

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

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

PR #2158 (55d06c1e02831b09a931d383b7f6ea4bb6793b9e):

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

Limits of coverage

  • Sizing direct-DXIL compute xcl_lds blocks from COMPUTE_PGM_RSRC2.LDS_SIZE plus top-reserved runtime words (matching stacked HLSL PR #2146) was directly verified on desktop RTX 4060 via compute_lds_block_takes_the_programs_lds_size (3/3), gpu_compute_lds_ring_in_a_block_of_the_programs_size (3/3, live GPU execution), and gpu::dxil:: (122/122 × 3).
  • The ignored bench_compute_lds_block microbenchmark was not run; the 60 s retail smoke confirms zero runtime regression on title: 29640639 (single-run frame/commit delta vs. cached parent reflects normal startup variance, not this PR).

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

<!-- greyfinch-sync:ivall/xcl:comment:7214241611 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2158#issuecomment-7214241611). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-27T09:04:06Z. --- Independent desktop NVIDIA verification of **PR #2158** at head `55d06c1e02831b09a931d383b7f6ea4bb6793b9e` (`2` commits stacked on PR #2146: `52577f993895afe1cc3e492a063b6f73821ee57c` -> `55d06c1e02831b09a931d383b7f6ea4bb6793b9e`; exact parent & merge-base: `cbc296ab65a2661a61e3e2da109134bcd5319f60`, pre-`#2555` ancestor of `main`). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12, Wave32-only Ada), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted release tests & build (`55d06c1e`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib compute_lds_block_takes_the_programs_lds_size -- --nocapture` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1126 filtered out` × 3 (`0.00s` × 3, `0` skipped) | | `cargo test --release -p xcl --lib gpu_compute_lds_ring_in_a_block_of_the_programs_size -- --nocapture` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1126 filtered out` × 3 (`0.60s`, `0.53s`, `0.54s`, `0` skipped; live RTX 4060 execution across HLSL and direct-DXIL backends) | | `cargo test --release -p xcl --lib gpu::dxil:: -- --test-threads=4` (3 consecutive runs) | `122 passed; 0 failed; 3 ignored; 1002 filtered out` × 3 (`4.08s`, `4.19s`, `4.35s`, `0` skipped) | | `cargo build --release -p xcl` | Clean build (`1m 28s`, exit `0`, `0` new warnings) | ### Paired quiet 60 s retail smoke (`title: 29640639`) Exact parent & merge-base (`cbc296ab65a2661a61e3e2da109134bcd5319f60`, cached baseline on the same machine): ``` xcl-smoke v1 commit: cbc296ab65a2661a61e3e2da109134bcd5319f60 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1572 (PresentX 1572) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14509 MB ``` PR #2158 (`55d06c1e02831b09a931d383b7f6ea4bb6793b9e`): ``` xcl-smoke v1 commit: 55d06c1e02831b09a931d383b7f6ea4bb6793b9e gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1569 (PresentX 1569) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14521 MB ``` ### Limits of coverage - Sizing direct-DXIL compute `xcl_lds` blocks from `COMPUTE_PGM_RSRC2.LDS_SIZE` plus top-reserved runtime words (matching stacked HLSL PR #2146) was directly verified on desktop RTX 4060 via `compute_lds_block_takes_the_programs_lds_size` (`3/3`), `gpu_compute_lds_ring_in_a_block_of_the_programs_size` (`3/3`, live GPU execution), and `gpu::dxil::` (`122/122` × 3). - The ignored `bench_compute_lds_block` microbenchmark was not run; the 60 s retail smoke confirms zero runtime regression on `title: 29640639` (single-run frame/commit delta vs. cached parent reflects normal startup variance, not this PR). *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
voiceovarian1-max commented 2026-11-27 11:14:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by voiceovarian1-max on 2026-11-27T11:14:18Z.


A retail measurement of the same idea, not of this PR's head: our tree sizes the LDS block from LDS_SIZE the same way (direct DXIL and HLSL; our commit), and we compared it with the 32 KB block inside one run of a retail title's world.

Setup: RTX 4070 Ti 12 GB (32-lane waves only), NVIDIA 620.73.04, Linux + Proton Experimental (Wine 11.0) + vkd3d-proton 3.1, XCL_DIRECT_DXIL=1, the GPU profile on (it serialises the queues). Each of 13 hot compute programs ran its fitted pipeline on odd frames and the 32 KB one on even frames; 5 of them have an LDS size that changes.

Result (30 windows of 2 s)

  • The title's busiest compute program, which allocates 512 B of LDS: 60.8 -> 40.2 ms per call, -34 % (per-window median -36 %, range -55 % to +8 %). With 32 KB, only ~3 of its groups fit on an SM.
  • The other 12: within ±5 % (medians within ±1.3 %).
  • Not measured: the world's frame rate with this alone (our frames there were not bound by shader time).

Written with Claude Code (Claude Opus 5.5) from our run records.

<!-- greyfinch-sync:ivall/xcl:comment:7216841048 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2158#issuecomment-7216841048). Originally posted by [voiceovarian1-max](https://github.com/voiceovarian1-max) on 2026-11-27T11:14:18Z. --- A retail measurement of the same idea, not of this PR's head: our tree sizes the LDS block from LDS_SIZE the same way (direct DXIL and HLSL; [our commit](https://github.com/voiceovarian1-max/xcl/commit/50876a8b)), and we compared it with the 32 KB block inside one run of a retail title's world. **Setup:** RTX 4070 Ti 12 GB (32-lane waves only), NVIDIA 620.73.04, Linux + Proton Experimental (Wine 11.0) + vkd3d-proton 3.1, `XCL_DIRECT_DXIL=1`, the GPU profile on (it serialises the queues). Each of 13 hot compute programs ran its fitted pipeline on odd frames and the 32 KB one on even frames; 5 of them have an LDS size that changes. **Result** (30 windows of 2 s) - The title's busiest compute program, which allocates 512 B of LDS: 60.8 -> 40.2 ms per call, **-34 %** (per-window median -36 %, range -55 % to +8 %). With 32 KB, only ~3 of its groups fit on an SM. - The other 12: within ±5 % (medians within ±1.3 %). - Not measured: the world's frame rate with this alone (our frames there were not bound by shader time). Written with Claude Code (Claude Opus 5.5) from our run records.
throny commented 2026-11-27 14:42:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-27T14:42:12Z.


Two contributors checked independently and found that #2937 solves the same problem in a different way: #1607, group D149. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.

This is a hint from the community triage in #1607, not a maintainer decision.

AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.

<!-- greyfinch-sync:ivall/xcl:comment:7221119952 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2158#issuecomment-7221119952). Originally posted by [throny](https://github.com/throny) on 2026-11-27T14:42:12Z. --- <!-- xcl-1607-hint:D149 --> Two contributors checked independently and found that #2937 solves the same problem in a different way: #1607, group D149. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
throny commented 2026-11-28 03:30:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T03:30:51Z.


merge-check claim
head: 55d06c1e02

<!-- greyfinch-sync:ivall/xcl:comment:7233134036 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2158#issuecomment-7233134036). Originally posted by [throny](https://github.com/throny) on 2026-11-28T03:30:51Z. --- merge-check claim head: 55d06c1e02831b09a931d383b7f6ea4bb6793b9e
throny commented 2026-11-28 03:57:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T03:57:15Z.


merge-check
base: e429936c
head: 55d06c1e02
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> does not compile: 15 errors E0063 "missing field lds_bytes in initializer of CsInterface" in test code main has gained since this PR's base (the first at gpu/dxil/robustness_tests.rs:106). No test ran.
review: blocking: the PR adds the field CsInterface::lds_bytes and does not update the full struct literals in tests that main has since (the library builds, the tests do not). Otherwise, by reading: a size of 0 keeps the old block, the maximum is capped at it, the exchange base cannot underflow, and the split and safe-barrier forms clamp accesses. Not blocking: in the plain wave32 form without the safe barrier an access just past the declared size is masked, not clamped, so it now lands on other words of the smaller block, where the console would read 0 and drop the write (before, it hit spare space). Not verified: the 512-byte granularity of the declared size. The diff contains #2146, which this PR is stacked on. For the maintainer: #2937 (open) solves the same problem as an opt-in switch.
performance: default for every compute program that declares LDS, not opt-in: a smaller shared block, no added ALU work found. It changes translator sources: every tester re-translates all shaders once.
verdict: not yet: rebase and update the test literals (or give them a default); I will rerun on the new head.
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).

<!-- greyfinch-sync:ivall/xcl:comment:7233543726 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2158#issuecomment-7233543726). Originally posted by [throny](https://github.com/throny) on 2026-11-28T03:57:15Z. --- merge-check base: e429936c head: 55d06c1e02831b09a931d383b7f6ea4bb6793b9e merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> does not compile: 15 errors E0063 "missing field lds_bytes in initializer of CsInterface" in test code main has gained since this PR's base (the first at gpu/dxil/robustness_tests.rs:106). No test ran. review: blocking: the PR adds the field CsInterface::lds_bytes and does not update the full struct literals in tests that main has since (the library builds, the tests do not). Otherwise, by reading: a size of 0 keeps the old block, the maximum is capped at it, the exchange base cannot underflow, and the split and safe-barrier forms clamp accesses. Not blocking: in the plain wave32 form without the safe barrier an access just past the declared size is masked, not clamped, so it now lands on other words of the smaller block, where the console would read 0 and drop the write (before, it hit spare space). Not verified: the 512-byte granularity of the declared size. The diff contains #2146, which this PR is stacked on. For the maintainer: #2937 (open) solves the same problem as an opt-in switch. performance: default for every compute program that declares LDS, not opt-in: a smaller shared block, no added ALU work found. It changes translator sources: every tester re-translates all shaders once. verdict: not yet: rebase and update the test literals (or give them a default); I will rerun on the new head. hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
KOLESNiii commented 2026-11-28 15:16:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T15:16:58Z.


merge-check claim
head: 55d06c1e02

<!-- greyfinch-sync:ivall/xcl:comment:7241346641 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2158#issuecomment-7241346641). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-28T15:16:58Z. --- merge-check claim head: 55d06c1e02831b09a931d383b7f6ea4bb6793b9e
KOLESNiii commented 2026-11-29 19:39:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-29T19:39:29Z.


merge-check
base: 0fe06eb0f0
head: 55d06c1e02
merge: conflicts: crates/xcl/src/gpu/dxil/kernel.rs, crates/xcl/src/gpu/recomp/tests.rs
build: not run (conflicts)
tests: not run (conflicts)
review: not run (conflicts). Note for the rebase: on the earlier main 309c3ec5 the merge was clean but its test binaries failed with error[E0063] missing field lds_bytes in the CsInterface initializers main added since this PR's base (d9403543, 86a90eeb: robustness_tests.rs:106/146/160, recomp/pso.rs:1183, recomp/tests.rs:7110/7118/7125 and more); each needs lds_bytes: 0 or ..Default::default().
performance: not assessed (conflicts)
verdict: not yet: conflicts with 0fe06eb0
hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc. Claude Code: Claude Opus 5.5 (coordination, draft).

<!-- greyfinch-sync:ivall/xcl:comment:7261452322 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2158#issuecomment-7261452322). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-29T19:39:29Z. --- merge-check base: 0fe06eb0f05459007ebfffc67bb9983acb3a832d head: 55d06c1e02831b09a931d383b7f6ea4bb6793b9e merge: conflicts: crates/xcl/src/gpu/dxil/kernel.rs, crates/xcl/src/gpu/recomp/tests.rs build: not run (conflicts) tests: not run (conflicts) review: not run (conflicts). Note for the rebase: on the earlier main 309c3ec5 the merge was clean but its test binaries failed with error[E0063] missing field `lds_bytes` in the `CsInterface` initializers main added since this PR's base (d9403543, 86a90eeb: robustness_tests.rs:106/146/160, recomp/pso.rs:1183, recomp/tests.rs:7110/7118/7125 and more); each needs `lds_bytes: 0` or `..Default::default()`. performance: not assessed (conflicts) verdict: not yet: conflicts with 0fe06eb0 hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc. Claude Code: Claude Opus 5.5 (coordination, draft).
Foniass commented 2026-12-01 06:17:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:17:55Z.


Review (head 55d06c1e, diff read, not a merge-check; it conflicts with main, so not built or run):

  • Duplicates #3478, which sizes direct DXIL compute LDS from LDS_SIZE on current main. #3478 handles the safe-barrier words main now keeps in setup_storage (8189-8190) and main's lds_index clamp (ada50ec5), sizes the block exactly instead of rounding to a power of two, and has an off switch (XCL_DECLARED_LDS=0) and a ComputePolicyKey field.
  • This PR conflicts in lanes.rs, kernel.rs, lower_mem.rs and tests.rs, has no barrier-word handling, is stacked on #2146, and adds CsInterface::lds_bytes where #3478 adds lds_dwords for the same data.

Fine: the direct layout was right for its base, and bench_compute_lds_block plus the assertion that the direct block matches the HLSL one are worth carrying into #3478 or a follow-up. Recommendation: close in favour of #3478.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7302713220 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2158#issuecomment-7302713220). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:17:55Z. --- Review (head 55d06c1e, diff read, not a merge-check; it conflicts with main, so not built or run): - **Duplicates #3478**, which sizes direct DXIL compute LDS from LDS_SIZE on current main. #3478 handles the safe-barrier words main now keeps in `setup_storage` (8189-8190) and main's `lds_index` clamp (ada50ec5), sizes the block exactly instead of rounding to a power of two, and has an off switch (`XCL_DECLARED_LDS=0`) and a `ComputePolicyKey` field. - This PR conflicts in `lanes.rs`, `kernel.rs`, `lower_mem.rs` and `tests.rs`, has no barrier-word handling, is stacked on #2146, and adds `CsInterface::lds_bytes` where #3478 adds `lds_dwords` for the same data. Fine: the direct layout was right for its base, and `bench_compute_lds_block` plus the assertion that the direct block matches the HLSL one are worth carrying into #3478 or a follow-up. Recommendation: close in favour of #3478. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2158:upstream-pr/2158'
git switch 'upstream-pr/2158'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2158'
git switch 'upstream-pr/2158'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2158'
git switch 'upstream-pr/2158'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2158'
git switch 'main'
git merge --squash 'upstream-pr/2158'
git switch 'main'
git merge --ff-only 'upstream-pr/2158'
git switch 'main'
git merge 'upstream-pr/2158'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!2148
No description provided.