Recompiler: simplify typed buffer component decoding #1637

Open
coolpersonnn wants to merge 1 commit from upstream-pr/1647 into main
coolpersonnn commented 2026-11-24 18:39:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by coolpersonnn on 2026-11-24T18:39:49Z.


Part of #1269. Simplify the HLSL inlined for each dynamic typed-buffer component on the default translation path and the fallback from #1426. Each supported component fits in one dword, so the decoder can extract it directly, share signed and unsigned normalization, and expand the small packed floats without exponentiation.

What is in it

  • crates/xcl/src/gpu/recomp/emit.rs emits the smaller component decoder.
  • crates/xcl/src/gpu/recomp/tests.rs checks the format table and verifies decoded values from unaligned buffers on the GPU at -O0 and -O3.

Tested

  • Rebased head f860750 on Ryzen 9 9950X3D, RTX 5090 (621.01), Windows 11 build 26300, rustc 1.100.0 and DXC 1.8.2502.11. .\scripts\test.ps1 with XCL_ADAPTER=nvidia reported 961 passed, 0 failed and 43 ignored. The harness reported 23 GPU skips.
  • Optional XCL_SAMPLE_* fixtures were unset for the rebased suite.
GPU coverage skips on the rebased head
SKIPPED gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 arithmetic, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 compares, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu: f64, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer arithmetic, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 rounding, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer carries, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 transcendentals, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 three-source, wave64: no wave64
SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64
SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64
SKIPPED shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D)
SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows

The original measurements below were taken before this rebase.

  • Ryzen 9 9950X3D, RTX 5090 (621.01), Windows 11 build 26300, rustc 1.100.0, DXC 1.8.2502.11. Debug tests and release benchmarks/smoke.
  • .\scripts\test.ps1 with XCL_ADAPTER=nvidia and XCL_SAMPLE_RPF set reported 860 passed, 0 failed, 42 ignored. GPU skips were gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), gpu_wave32_program_in_wave64_hardware (no wave64), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • Release A/B on the HLSL path before rebasing, against 9e3831e. Ran xcl shaders <dir> --precompile --only cs --windows 4 --split 1, then --pipelines against the populated DXIL cache with XCL's PSO disk cache off. One format-heavy sample went from 427,204 to 386,108 DXIL bytes and from 17.04 to 13.30 s in the cold pipeline pass (median of two cold runs per build, one cached pair excluded). The giant -O0 sample went from 29,750,432 to 26,752,196 bytes and from 129.72 to 118.35 s for translation plus DXC. Both driver passes exceeded 90 s.

Regression run

Main

xcl-smoke v1
commit: c4d37bec1bb4286eb373aea963404a23f13401fa
gpu: NVIDIA GeForce RTX 5090
title: a93b40d7
seconds: 60
exit: 0x0
frames shown: 1082 (PresentX 1082)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15601 MB

PR head

xcl-smoke v1
commit: f860750d5221a591ed87af431e60ae4c4206a611
gpu: NVIDIA GeForce RTX 5090
title: a93b40d7
seconds: 60
exit: 0x0
frames shown: 1100 (PresentX 1100)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15438 MB

Not tested

  • AMD, Intel, native wave64, heap-window mode, or optional fixtures beyond the retail shader pack. The benchmarks cover HLSL compilation. The 60-second smoke run leaves the world-load stall unverified.

AI use

  • Codex (GPT-6 family, exact model variant unavailable) profiled the workload, wrote the code and tests, ran the checks, and prepared this description.

  • T3 Code / Antigravity resolved the current rebase. Codex (GPT-6 family, exact model variant unavailable) verified the resolution, reran the checks, and updated this description.

<!-- greyfinch-sync:ivall/xcl:issue:5478164657 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1647). Originally posted by [coolpersonnn](https://github.com/coolpersonnn) on 2026-11-24T18:39:49Z. --- Part of #1269. Simplify the HLSL inlined for each dynamic typed-buffer component on the default translation path and the fallback from #1426. Each supported component fits in one dword, so the decoder can extract it directly, share signed and unsigned normalization, and expand the small packed floats without exponentiation. **What is in it** - `crates/xcl/src/gpu/recomp/emit.rs` emits the smaller component decoder. - `crates/xcl/src/gpu/recomp/tests.rs` checks the format table and verifies decoded values from unaligned buffers on the GPU at `-O0` and `-O3`. **Tested** - Rebased head `f860750` on Ryzen 9 9950X3D, RTX 5090 (621.01), Windows 11 build 26300, rustc 1.100.0 and DXC 1.8.2502.11. `.\scripts\test.ps1` with `XCL_ADAPTER=nvidia` reported 961 passed, 0 failed and 43 ignored. The harness reported 23 GPU skips. - Optional `XCL_SAMPLE_*` fixtures were unset for the rebased suite. <details><summary>GPU coverage skips on the rebased head</summary> ```text SKIPPED gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu: no wave64 SKIPPED gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu: no wave64 SKIPPED gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu: no wave64 SKIPPED gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's)) SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 arithmetic, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's)) SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 compares, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu: f64, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's)) SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer arithmetic, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 rounding, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer carries, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 transcendentals, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 three-source, wave64: no wave64 SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64 SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64 SKIPPED shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D) SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows ``` </details> The original measurements below were taken before this rebase. - Ryzen 9 9950X3D, RTX 5090 (621.01), Windows 11 build 26300, rustc 1.100.0, DXC 1.8.2502.11. Debug tests and release benchmarks/smoke. - `.\scripts\test.ps1` with `XCL_ADAPTER=nvidia` and `XCL_SAMPLE_RPF` set reported 860 passed, 0 failed, 42 ignored. GPU skips were `gpu_geometry_wave32_prefix_count_over_a_mask` (no wave64), `gpu_wave32_program_in_wave64_hardware` (no wave64), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - Release A/B on the HLSL path before rebasing, against `9e3831e`. Ran `xcl shaders <dir> --precompile --only cs --windows 4 --split 1`, then `--pipelines` against the populated DXIL cache with XCL's PSO disk cache off. One format-heavy sample went from 427,204 to 386,108 DXIL bytes and from 17.04 to 13.30 s in the cold pipeline pass (median of two cold runs per build, one cached pair excluded). The giant `-O0` sample went from 29,750,432 to 26,752,196 bytes and from 129.72 to 118.35 s for translation plus DXC. Both driver passes exceeded 90 s. **Regression run** Main ``` xcl-smoke v1 commit: c4d37bec1bb4286eb373aea963404a23f13401fa gpu: NVIDIA GeForce RTX 5090 title: a93b40d7 seconds: 60 exit: 0x0 frames shown: 1082 (PresentX 1082) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15601 MB ``` PR head ``` xcl-smoke v1 commit: f860750d5221a591ed87af431e60ae4c4206a611 gpu: NVIDIA GeForce RTX 5090 title: a93b40d7 seconds: 60 exit: 0x0 frames shown: 1100 (PresentX 1100) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15438 MB ``` **Not tested** - AMD, Intel, native wave64, heap-window mode, or optional fixtures beyond the retail shader pack. The benchmarks cover HLSL compilation. The 60-second smoke run leaves the world-load stall unverified. **AI use** - Codex (GPT-6 family, exact model variant unavailable) profiled the workload, wrote the code and tests, ran the checks, and prepared this description. - T3 Code / Antigravity resolved the current rebase. Codex (GPT-6 family, exact model variant unavailable) verified the resolution, reran the checks, and updated this description.
nnonno91 commented 2026-11-24 19:07:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by nnonno91 on 2026-11-24T18:47:28Z.


Independent AMD check at a632fbbd10dbd1a7e0cc03f5dc48670beee32ec0.

Tested

  • AMD Radeon(TM) Graphics (Ryzen 7 9800X3D integrated GPU, driver 32.0.21042.62), Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC, SDK DXC 1.8.2502.11, debug. Selected the GPU with XCL_ADAPTER='AMD Radeon'.
  • cargo build --workspace --locked passed. cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-output reported 860 passed, 0 failed, 42 ignored. One GPU skip is included in that pass count (heap_window_out_of_memory_falls_back_to_the_switch_form, heap windows off). The bundled title test passed.
  • With XCL_REQUIRE_GPU=wave64,mesh, cargo test --locked -p xcl --lib -- buffer_format gpu_typed_buffer_loads_and_stores --test-threads=1 --show-output gave 5 passed, 0 failed, 0 ignored, 0 skips.
  • I ran the same temporary probe at the PR head and its base c160d86ef2efe3a07e4dfb473e4fa72eafb413c0: cargo test --locked -p xcl --test typed_buffer_probe -- --exact typed_buffer_formats_across_wave_sizes_and_byte_alignments --nocapture --test-threads=1. It ran the 11 fixtures from gpu_buffer_format_component_decode (including the invalid descriptor) at starting byte offsets 0, 1, 2 and 3, on wave32 and native wave64, at DXC -O0 and -O3. Both runs passed with 0 skips. Each build matched all 33,792 expected component values bit for bit across 176 dispatches.

The generated DXIL for that one synthetic dynamic-format shader was smaller in all four builds:

Shader Base bytes PR bytes
wave32 -O0 9,436 8,708
wave32 -O3 8,220 7,616
wave64 -O0 9,456 8,728
wave64 -O3 8,232 7,632

Not tested

Heap-window mode, retail shader packs and title smoke, compile or pipeline timings.

AI use

OpenAI Codex (GPT-6 family, exact variant unavailable) adapted the temporary probe, ran the tests, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7141155884 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1647#issuecomment-7141155884). Originally posted by [nnonno91](https://github.com/nnonno91) on 2026-11-24T18:47:28Z. --- Independent AMD check at `a632fbbd10dbd1a7e0cc03f5dc48670beee32ec0`. **Tested** - AMD Radeon(TM) Graphics (Ryzen 7 9800X3D integrated GPU, driver 32.0.21042.62), Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC, SDK DXC 1.8.2502.11, debug. Selected the GPU with `XCL_ADAPTER='AMD Radeon'`. - `cargo build --workspace --locked` passed. `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-output` reported **860 passed, 0 failed, 42 ignored**. One GPU skip is included in that pass count (`heap_window_out_of_memory_falls_back_to_the_switch_form`, heap windows off). The bundled title test passed. - With `XCL_REQUIRE_GPU=wave64,mesh`, `cargo test --locked -p xcl --lib -- buffer_format gpu_typed_buffer_loads_and_stores --test-threads=1 --show-output` gave **5 passed, 0 failed, 0 ignored, 0 skips**. - I ran the same temporary probe at the PR head and its base `c160d86ef2efe3a07e4dfb473e4fa72eafb413c0`: `cargo test --locked -p xcl --test typed_buffer_probe -- --exact typed_buffer_formats_across_wave_sizes_and_byte_alignments --nocapture --test-threads=1`. It ran the 11 fixtures from `gpu_buffer_format_component_decode` (including the invalid descriptor) at starting byte offsets 0, 1, 2 and 3, on wave32 and native wave64, at DXC `-O0` and `-O3`. Both runs passed with 0 skips. Each build matched all **33,792** expected component values bit for bit across **176** dispatches. The generated DXIL for that one synthetic dynamic-format shader was smaller in all four builds: | Shader | Base bytes | PR bytes | | --- | ---: | ---: | | wave32 `-O0` | 9,436 | 8,708 | | wave32 `-O3` | 8,220 | 7,616 | | wave64 `-O0` | 9,456 | 8,728 | | wave64 `-O3` | 8,232 | 7,632 | **Not tested** Heap-window mode, retail shader packs and title smoke, compile or pipeline timings. **AI use** OpenAI Codex (GPT-6 family, exact variant unavailable) adapted the temporary probe, ran the tests, and drafted this report.
DavidM1911 commented 2026-11-24 21:09:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T21:06:55Z.


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

  • cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7144495128 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1647#issuecomment-7144495128). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T21:06:55Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
throny commented 2026-11-25 10:10:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-25T09:20:34Z.


Test report for exact head f860750.

Tested

  • Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 4080 (driver 610.88, 32-lane waves), Intel i9-12900K, 64 GB; Rust 1.100.0 MSVC; DXC 1.9.2602.17; tests in debug, title runs in release.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4 on f860750 as it is (its own base): 961 passed, 0 failed, 43 ignored. SKIPPED: 23 lines (no wave64 on this adapter, and the like).
  • scripts/smoke.ps1, the retail title, 60 s, release builds, main 568e7db first, then this head:

main:

xcl-smoke v1
commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb
gpu: NVIDIA GeForce RTX 4080
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1608 (PresentX 1608)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15842 MB

PR:

xcl-smoke v1
commit: f860750d5221a591ed87af431e60ae4c4206a611
gpu: NVIDIA GeForce RTX 4080
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1565 (PresentX 1565)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16252 MB

Not tested: AMD, the head merged onto current main, a world load.

AI use: Claude Code (Claude Opus 5.5) ran this and wrote the report; the diff was read for safety by a Claude Opus 5.5 sub-agent before it was built.

<!-- greyfinch-sync:ivall/xcl:comment:7158201508 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1647#issuecomment-7158201508). Originally posted by [throny](https://github.com/throny) on 2026-11-25T09:20:34Z. --- Test report for exact head `f860750`. **Tested** - Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 4080 (driver 610.88, 32-lane waves), Intel i9-12900K, 64 GB; Rust 1.100.0 MSVC; DXC 1.9.2602.17; tests in debug, title runs in release. - `cargo build --workspace && cargo test --workspace -- --test-threads=4` on `f860750` as it is (its own base): **961 passed, 0 failed, 43 ignored**. `SKIPPED`: 23 lines (no wave64 on this adapter, and the like). - `scripts/smoke.ps1`, the retail title, 60 s, release builds, `main` `568e7db` first, then this head: main: ``` xcl-smoke v1 commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb gpu: NVIDIA GeForce RTX 4080 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1608 (PresentX 1608) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15842 MB ``` PR: ``` xcl-smoke v1 commit: f860750d5221a591ed87af431e60ae4c4206a611 gpu: NVIDIA GeForce RTX 4080 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1565 (PresentX 1565) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16252 MB ``` **Not tested:** AMD, the head merged onto current `main`, a world load. AI use: Claude Code (Claude Opus 5.5) ran this and wrote the report; the diff was read for safety by a Claude Opus 5.5 sub-agent before it was built.
futurepro62 commented 2026-11-26 06:06:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-26T05:41:00Z.


NVIDIA and AMD full-suite run, to go with the reports above by throny, since none of them covers AMD. Tested exact head f860750d (on its base c4d37be).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 956 passed, 0 failed, 43 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • The new tests ran and passed: buffer_format_components_fit_in_one_dword, gpu_buffer_format_component_decode.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 961 passed, 0 failed, 43 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main b49be183 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (#1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests, const_and_null_mask_operands_agree_with_hlsl_on_the_gpu and mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7183709638 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1647#issuecomment-7183709638). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-26T05:41:00Z. --- NVIDIA and AMD full-suite run, to go with the reports above by throny, since none of them covers AMD. Tested exact head `f860750d` (on its base `c4d37be`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests`: **956 passed, 0 failed, 43 ignored**. SKIPPED (no wave64): `a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu`, `a_per_lane_2d_or_3d_group_runs_on_the_gpu`, `coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu`, `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu`. - The new tests ran and passed: `buffer_format_components_fit_in_one_dword`, `gpu_buffer_format_component_decode`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: **961 passed, 0 failed, 43 ignored**. SKIPPED: `f16_programs_on_the_gpu` (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `--skip` leaves out tests that fail on main `b49be183` too, not because of this PR. On NVIDIA: `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651), the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests, `const_and_null_mask_operands_agree_with_hlsl_on_the_gpu` and `mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu` ([follow-up on #1651](https://github.com/xcl-dev/xcl/issues/1651#issuecomment-7146069648)) fail because `runner::skip_test` turns their skips into failures under `XCL_REQUIRE_GPU=mesh`, and `gpu::dxil::fuzz_tests` seeds 70, 545, 1019 and 1507 fail `CreateComputePipelineState` with `E_OUTOFMEMORY` on this card (drivers 616.64 and 621.40). On AMD: `fuzz_validate_and_gpu_1` fails on seed 540 (`res[833]` 0x7 vs CPU 0x6). The AMD run does not set `XCL_REQUIRE_GPU`. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
DavidM1911 commented 2026-11-26 06:06:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T05:58:11Z.


Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

<!-- greyfinch-sync:ivall/xcl:comment:7183969768 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1647#issuecomment-7183969768). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T05:58:11Z. --- Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
Pipodi commented 2026-11-30 14:38:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Pipodi on 2026-11-30T14:38:02Z.


merge-check claim
head: f860750d52

<!-- greyfinch-sync:ivall/xcl:comment:7281683703 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1647#issuecomment-7281683703). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-11-30T14:38:02Z. --- merge-check claim head: f860750d5221a591ed87af431e60ae4c4206a611
saintwolf commented 2026-11-30 14:52:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-30T14:52:30Z.


merge-check claim
head: f860750d52

<!-- greyfinch-sync:ivall/xcl:comment:7282066861 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1647#issuecomment-7282066861). Originally posted by [saintwolf](https://github.com/saintwolf) on 2026-11-30T14:52:30Z. --- merge-check claim head: f860750d5221a591ed87af431e60ae4c4206a611
saintwolf commented 2026-11-30 14:59:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-30T14:59:05Z.


merge-check
base: 9dfbe3ea66
head: f860750d52
merge: clean (trial merge 7020c6c8bcde3742d3d5ccc31b924d4d0c7981f0; git diff --check clean; +71/-17 in crates/xcl/src/gpu/recomp/emit.rs and tests.rs)
build: cargo build --workspace -> ok (39 pre-existing warnings, none from the PR's files)
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2887 passed, 1 failed, 51 ignored; SKIPPED: 27 (22 "no wave64" — wave32-only GPU, 2 "no heap windows", 1 "cannot disable the driver cache (Developer Mode)", 2 "no xgameruntime.dll"); failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, pre-existing on this machine (fails identically on base 9dfbe3ea, same "2D D16 resinfo clobbered v2/v3" assertion). Both new tests pass: buffer_format_components_fit_in_one_dword (table invariant) and gpu_buffer_format_component_decode (11 format cases from an unaligned buffer at -O0 and -O3, all 32 lanes).
review: read the whole diff. Behaviour-preserving simplification of the inlined HLSL component decoder: (1) fmt_comp extracts each component from the single dword that contains it instead of the cross-dword bits_at helper — sound because buf_format_info packs x first as least-significant and the new pure test pins every BUF_FORMATS component to one dword; (2) signed and unsigned normalisation share one divide, max endpoint derived from the same mask; (3) uf_small expands 10/11-bit packed floats by bit assembly ((112+e)<<23 | m<<(23-mb)) instead of exp2 — exact. Verified the test vectors by hand against the table (10_11_11_FLOAT packs x=11/y=11/z=10 LSB-first; its input word decodes to 2^-20, +INF, 1.0). Key evidence: the PR's two new tests copied verbatim into the base worktree pass there too, so the expected values match the shipped behaviour and the refactor is bit-exact on this GPU. No unsafe, no new dependencies. #1310 (same author) is a distinct change (decode only requested components) and will need a rebase against this one or vice versa.
performance: author measured smaller generated DXIL (427,204 -> 386,108 bytes on a format-heavy sample) and faster cold pipeline compilation (17.04 -> 13.30 s); smoke pair 1082 -> 1100 frames.
verdict: safe to merge
hardware / tool and model: RTX 4070 SUPER (driver 32.0.16.2140), Ryzen 7 7800X3D, Windows 11 build 26300, Rust 1.100.0 / OpenCode, Qwen 3.8 27B

<!-- greyfinch-sync:ivall/xcl:comment:7282242095 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1647#issuecomment-7282242095). Originally posted by [saintwolf](https://github.com/saintwolf) on 2026-11-30T14:59:05Z. --- merge-check base: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b head: f860750d5221a591ed87af431e60ae4c4206a611 merge: clean (trial merge 7020c6c8bcde3742d3d5ccc31b924d4d0c7981f0; git diff --check clean; +71/-17 in crates/xcl/src/gpu/recomp/emit.rs and tests.rs) build: cargo build --workspace -> ok (39 pre-existing warnings, none from the PR's files) tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2887 passed, 1 failed, 51 ignored; SKIPPED: 27 (22 "no wave64" — wave32-only GPU, 2 "no heap windows", 1 "cannot disable the driver cache (Developer Mode)", 2 "no xgameruntime.dll"); failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, pre-existing on this machine (fails identically on base 9dfbe3ea, same "2D D16 resinfo clobbered v2/v3" assertion). Both new tests pass: buffer_format_components_fit_in_one_dword (table invariant) and gpu_buffer_format_component_decode (11 format cases from an unaligned buffer at -O0 and -O3, all 32 lanes). review: read the whole diff. Behaviour-preserving simplification of the inlined HLSL component decoder: (1) fmt_comp extracts each component from the single dword that contains it instead of the cross-dword bits_at helper — sound because buf_format_info packs x first as least-significant and the new pure test pins every BUF_FORMATS component to one dword; (2) signed and unsigned normalisation share one divide, max endpoint derived from the same mask; (3) uf_small expands 10/11-bit packed floats by bit assembly ((112+e)<<23 | m<<(23-mb)) instead of exp2 — exact. Verified the test vectors by hand against the table (10_11_11_FLOAT packs x=11/y=11/z=10 LSB-first; its input word decodes to 2^-20, +INF, 1.0). Key evidence: the PR's two new tests copied verbatim into the base worktree pass there too, so the expected values match the shipped behaviour and the refactor is bit-exact on this GPU. No unsafe, no new dependencies. #1310 (same author) is a distinct change (decode only requested components) and will need a rebase against this one or vice versa. performance: author measured smaller generated DXIL (427,204 -> 386,108 bytes on a format-heavy sample) and faster cold pipeline compilation (17.04 -> 13.30 s); smoke pair 1082 -> 1100 frames. verdict: safe to merge hardware / tool and model: RTX 4070 SUPER (driver 32.0.16.2140), Ryzen 7 7800X3D, Windows 11 build 26300, Rust 1.100.0 / OpenCode, Qwen 3.8 27B
Pipodi commented 2026-11-30 15:30:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Pipodi on 2026-11-30T15:30:55Z.


merge-check
base: 9dfbe3ea66
head: f860750d52
merge: clean (git merge --no-ff)
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2887 passed, 1 failed, 51 ignored; the lib harness aborted once (0xc0000409, known flake), so the lib binary was rerun alone (2739 passed, 1 failed, 31 ignored) and added to the other binaries (148 passed). The failure is gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 (fails on main too, fixed by #3513). 25 SKIPPED (24 "no wave64"-style GPU skips in the lib, plus heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows). Both new tests, buffer_format_components_fit_in_one_dword and gpu_buffer_format_component_decode, pass.
new tests vs the change: with emit.rs reverted to main (uncommitted) both new tests still pass (4 passed in the buffer_format filter). That is expected for a refactor that must not change results: they pin the behaviour (they would catch a wrong decode, they do not fail on the old code).
review: read both files (emit.rs, tests.rs). It does have a per-instruction GPU test against expected values (gpu_buffer_format_component_decode, BUFFER_LOAD_FORMAT_XYZW over 11 formats at -O0 and -O3, with an unaligned byte-1 base), as CONTRIBUTING asks, plus a table test that every component of every BUF_FORMATS entry fits inside one dword, which is the premise of dropping bits_at. Checked by hand: uf_small rebuilds the f32 from the 5-bit exponent (112+e, mantissa shifted by 23-mb; subnormal m*2^(-14-mb)), same values as before; the shared UNORM/SNORM divide keeps the exact 0 and 1 endpoints and the 32-bit maxima round to the same floats as the old constants. Nit: no case for a 24-bit or 5_6_5-type format, and none for signed 32-bit SNORM; the table test covers the one-dword premise for them.
performance: fewer ALU ops per decoded component (no two-dword funnel shift, one divide instead of two); not measured.
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4090, driver 621.40; i9-13900K; Windows 11 Pro 10.0.26300; rustc 1.100.0; debug. AI use: Claude Code, Claude Opus 5.5

<!-- greyfinch-sync:ivall/xcl:comment:7283122740 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1647#issuecomment-7283122740). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-11-30T15:30:55Z. --- merge-check base: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b head: f860750d5221a591ed87af431e60ae4c4206a611 merge: clean (git merge --no-ff) build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2887 passed, 1 failed, 51 ignored; the lib harness aborted once (0xc0000409, known flake), so the lib binary was rerun alone (2739 passed, 1 failed, 31 ignored) and added to the other binaries (148 passed). The failure is gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 (fails on main too, fixed by #3513). 25 SKIPPED (24 "no wave64"-style GPU skips in the lib, plus heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows). Both new tests, buffer_format_components_fit_in_one_dword and gpu_buffer_format_component_decode, pass. new tests vs the change: with emit.rs reverted to main (uncommitted) both new tests still pass (4 passed in the `buffer_format` filter). That is expected for a refactor that must not change results: they pin the behaviour (they would catch a wrong decode, they do not fail on the old code). review: read both files (emit.rs, tests.rs). It does have a per-instruction GPU test against expected values (gpu_buffer_format_component_decode, BUFFER_LOAD_FORMAT_XYZW over 11 formats at -O0 and -O3, with an unaligned byte-1 base), as CONTRIBUTING asks, plus a table test that every component of every BUF_FORMATS entry fits inside one dword, which is the premise of dropping bits_at. Checked by hand: uf_small rebuilds the f32 from the 5-bit exponent (112+e, mantissa shifted by 23-mb; subnormal m*2^(-14-mb)), same values as before; the shared UNORM/SNORM divide keeps the exact 0 and 1 endpoints and the 32-bit maxima round to the same floats as the old constants. Nit: no case for a 24-bit or 5_6_5-type format, and none for signed 32-bit SNORM; the table test covers the one-dword premise for them. performance: fewer ALU ops per decoded component (no two-dword funnel shift, one divide instead of two); not measured. verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 4090, driver 621.40; i9-13900K; Windows 11 Pro 10.0.26300; rustc 1.100.0; debug. AI use: Claude Code, Claude Opus 5.5
Foniass commented 2026-12-01 06:23:10 +00:00 (Migrated from github.com)

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


Triage (#1607) – head f860750

No open or merged PR makes the same change. #1840, #1310, #1901 and #2210 also edit fmt_comp in gpu/recomp/emit.rs (rounding, requested components, outlining), so they will conflict with this one, but none drops bits_at or rewrites uf_small this way.
Checked the rewrite: the exponent rebase (112 + e, subnormal 2^(-14-mb)) and the shared UNORM/SNORM divisor (2^w-1 / 2^(w-1)-1 via sh + sign) match the old code; dropping bits_at relies on every BUF_FORMATS component fitting in one dword, which the new buffer_format_components_fit_in_one_dword test pins.
Recommendation: keep open.

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

<!-- greyfinch-sync:ivall/xcl:comment:7302811374 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1647#issuecomment-7302811374). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:23:10Z. --- **Triage (#1607)** – head f860750 No open or merged PR makes the same change. #1840, #1310, #1901 and #2210 also edit `fmt_comp` in `gpu/recomp/emit.rs` (rounding, requested components, outlining), so they will conflict with this one, but none drops `bits_at` or rewrites `uf_small` this way. Checked the rewrite: the exponent rebase (112 + e, subnormal 2^(-14-mb)) and the shared UNORM/SNORM divisor (2^w-1 / 2^(w-1)-1 via `sh + sign`) match the old code; dropping `bits_at` relies on every BUF_FORMATS component fitting in one dword, which the new `buffer_format_components_fit_in_one_dword` test pins. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

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

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