Direct DXIL: honour D16 packing in image_get_resinfo #1874

Manually merged
github merged 1 commit from gh-pr/1874/head into gh-pr/1874/base 2026-11-26 05:08:09 +00:00
Owner

@⁠emirduran707 on GitHub · 2026-11-24 22:29 UTC · original
emirduran707:dxil-resinfo-d16 → main · +43 −2 · 2 files · 1 commits · merged 2026-11-25 01:50 UTC

Both get_resinfo arms in crates/xcl/src/gpu/dxil/lower_image.rs (MSAA and non-MSAA) passed false instead of d16 to self.image_result, writing 32-bit components even when D16=1. That dropped the packed upper 16-bit halves and clobbered the trailing VGPRs. recomp/emit.rs honours d16 for image_get_resinfo, and image_result already implements 16-bit packing.

Both get_resinfo arms now pass d16 to self.image_result.

What is in it

  • crates/xcl/src/gpu/dxil/lower_image.rs: pass d16 instead of false in both get_resinfo arms (ms and non-ms).
  • crates/xcl/src/gpu/dxil/msaa_tests.rs: GPU test gpu_direct_image_get_resinfo_d16 covering 2D (64x32) and 2D MSAA array (4x4x3) image_get_resinfo with D16=1 and verifying the trailing VGPRs are preserved.

Tested

  • AMD Radeon RX 9060 XT (driver 32.0.31044.16), Ryzen 5 5600, Windows 11 Pro 26300, Rust 1.100.0; tests debug, smoke release
  • cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4 on 4070ae1 (rebased onto main 20cf130): 975 passed, 2 failed, 45 ignored; 8 SKIPPED (6 in lower_dxil::tests::{f16,f32}_programs_on_the_gpu; heap_window_out_of_memory_falls_back_to_the_switch_form; pso_measurement_compiles_an_exact_synthetic_record)
    • The 2 failures (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 seed 722 and fuzz_validate_and_gpu_3 seed 1599) fail identically on unmodified main 20cf130 on this GPU.
  • gpu_direct_image_get_resinfo_d16 before the change failed (2D D16 resinfo v0: 0x40, left: 64, right: 2097216); passes after

Regression run

main:

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

this PR:

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

Not tested

  • NVIDIA and Intel GPUs.
  • The smoke title's run is a regression check only.

AI use

  • Antigravity with Gemini 4 Neon: found the bug, wrote the fix, GPU test and this description, and ran the first test suite and smoke runs.
  • Claude Code with Claude Opus 5.5: rebased the change onto main 20cf130 (replacing a merge of main; the new test sits beside #1900's in msaa_tests.rs) and reran the suite and smoke runs above.
**@⁠emirduran707** on GitHub · 2026-11-24 22:29 UTC · [original](https://github.com/xcl-dev/xcl/pull/1874) `emirduran707:dxil-resinfo-d16` → `main` · +43 −2 · 2 files · 1 commits · merged 2026-11-25 01:50 UTC Both `get_resinfo` arms in `crates/xcl/src/gpu/dxil/lower_image.rs` (MSAA and non-MSAA) passed `false` instead of `d16` to `self.image_result`, writing 32-bit components even when `D16=1`. That dropped the packed upper 16-bit halves and clobbered the trailing VGPRs. `recomp/emit.rs` honours `d16` for `image_get_resinfo`, and `image_result` already implements 16-bit packing. Both `get_resinfo` arms now pass `d16` to `self.image_result`. **What is in it** - `crates/xcl/src/gpu/dxil/lower_image.rs`: pass `d16` instead of `false` in both `get_resinfo` arms (`ms` and non-`ms`). - `crates/xcl/src/gpu/dxil/msaa_tests.rs`: GPU test `gpu_direct_image_get_resinfo_d16` covering 2D (`64x32`) and 2D MSAA array (`4x4x3`) `image_get_resinfo` with `D16=1` and verifying the trailing VGPRs are preserved. **Tested** - AMD Radeon RX 9060 XT (driver 32.0.31044.16), Ryzen 5 5600, Windows 11 Pro 26300, Rust 1.100.0; tests debug, smoke release - `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4` on 4070ae1 (rebased onto `main` `20cf130`): 975 passed, 2 failed, 45 ignored; 8 SKIPPED (6 in `lower_dxil::tests::{f16,f32}_programs_on_the_gpu`; `heap_window_out_of_memory_falls_back_to_the_switch_form`; `pso_measurement_compiles_an_exact_synthetic_record`) - The 2 failures (`gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` seed 722 and `fuzz_validate_and_gpu_3` seed 1599) fail identically on unmodified `main` `20cf130` on this GPU. - `gpu_direct_image_get_resinfo_d16` before the change failed (`2D D16 resinfo v0: 0x40`, `left: 64`, `right: 2097216`); passes after **Regression run** main: ``` xcl-smoke v1 commit: 20cf13022f764208384c610c2ae6a3f4eed201a2 gpu: AMD Radeon RX 9060 XT title: 21222967 seconds: 60 exit: 0x0 frames shown: 1532 (PresentX 1532) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 18584 MB ``` this PR: ``` xcl-smoke v1 commit: 4070ae1d438e7ca928c1dd173d8002adbec656c0 gpu: AMD Radeon RX 9060 XT title: 21222967 seconds: 60 exit: 0x0 frames shown: 1506 (PresentX 1506) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 20083 MB ``` **Not tested** - NVIDIA and Intel GPUs. - The smoke title's run is a regression check only. **AI use** - Antigravity with Gemini 4 Neon: found the bug, wrote the fix, GPU test and this description, and ran the first test suite and smoke runs. - Claude Code with Claude Opus 5.5: rebased the change onto `main` `20cf130` (replacing a merge of `main`; the new test sits beside #1900's in `msaa_tests.rs`) and reran the suite and smoke runs above.
Both `get_resinfo` arms in `dxil/lower_image.rs` (MSAA and non-MSAA) passed
`false` instead of `d16` to `self.image_result`, writing 32-bit components
even when `D16=1` (losing the packed upper halves and clobbering the trailing
VGPRs). `recomp/emit.rs` honours `d16` for `image_get_resinfo`, and
`image_result` already implements the 16-bit packing.

Pass `d16` in both `get_resinfo` arms and add a GPU test covering 2D and
2D MSAA array `image_get_resinfo` with `D16=1`.

Assisted-by: Antigravity (Gemini 4 Neon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:08:07 +00:00
github manually merged commit 4070ae1d43 into gh-pr/1874/base 2026-11-26 05:08:09 +00:00
Author
Owner

@⁠upipibi on GitHub · 2026-11-24 22:32 UTC · original

NVIDIA counterpart to the RX 9060 XT run: RTX 3070 8 GB, driver 616.56, Windows 11, debug, fcd9414 on main 689f2db.

  • gpu_direct_image_get_resinfo_d16 (2D and 2D MSAA array): passes, 2 of 2 runs.
  • Tests matching msaa / resinfo: 6 passed, 0 failed.

AI-assisted (Claude Code). Synthetic tests only.

**@⁠upipibi** on GitHub · 2026-11-24 22:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/1874#issuecomment-7146353960) NVIDIA counterpart to the RX 9060 XT run: RTX 3070 8 GB, driver 616.56, Windows 11, debug, `fcd9414` on `main` `689f2db`. - `gpu_direct_image_get_resinfo_d16` (2D and 2D MSAA array): passes, 2 of 2 runs. - Tests matching `msaa` / `resinfo`: 6 passed, 0 failed. AI-assisted (Claude Code). Synthetic tests only.
Author
Owner

@⁠frenziedcoder on GitHub · 2026-11-24 22:41 UTC · original

NVIDIA test report for fcd9414: no new test failures (the 4 that fail also fail on 689f2db), its own test gpu_direct_image_get_resinfo_d16 passes, and a clean smoke pair on the retail title (1654 vs 1657 frames).

Tested

  • NVIDIA GeForce RTX 5080 16 GB (driver 617.14, 32-lane waves), AMD Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 25H2 (26200.9974), rustc 1.100.0 stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact head fcd94144d630ad248827d29a86ffee042141a4ae, no local changes.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4 (debug): 972 passed, 4 failed, 45 ignored; the PR's own test gpu_direct_image_get_resinfo_d16 passes. SKIPPED: gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu (no wave64), gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu (no wave64), gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu (no wave64), gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu (no wave64), gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu (no wave64), 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))), gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu (f16 arithmetic, wave64: no wave64), 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))), gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu (f16 packed, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 arithmetic, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 compares, wave64: no wave64), 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))), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 conversions, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 rounding, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 three-source, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 transcendentals, wave64: no wave64), gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu (f64, wave64: no wave64), gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu (integer arithmetic, wave64: no wave64), gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu (integer carries, wave64: no wave64), 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).
  • The 4 failures are fuzz_validate_and_gpu_0, fuzz_validate_and_gpu_1, fuzz_validate_and_gpu_2, fuzz_validate_and_gpu_3 in gpu::dxil::fuzz_tests. They fail the same way on the base 689f2db here (0x8007000E from CreateComputePipelineState on seeds 70, 545, 1019 and 1507, the NVIDIA refusal @⁠PHeitor1 reported on #1679), so this PR adds no failure.
  • test_title_draws_with_a_root_signature_under_the_debug_layer reports ok, but this machine has no D3D12 debug layer (debug layer requested but unavailable … (0x887A002D)), so it ran without the layer and is no evidence either way.

Regression run (scripts/smoke.ps1 -Seconds 60, release, the retail title of #505 at its start screen; XCL_PSO_PRELOAD=0 for both builds, because this machine's preload list holds the program of #1307)

base (689f2db, this PR's merge base with main):

xcl-smoke v1
commit: 689f2db477c3c062cf162649781640ef8a977c18
gpu: NVIDIA GeForce RTX 5080
title: 16b5e5d4
seconds: 60
exit: 0x0
frames shown: 1657 (PresentX 1657)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14602 MB

this PR:

xcl-smoke v1
commit: fcd94144d630ad248827d29a86ffee042141a4ae
gpu: NVIDIA GeForce RTX 5080
title: 16b5e5d4
seconds: 60
exit: 0x0
frames shown: 1654 (PresentX 1654)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14598 MB

Not tested: this code in the title: it is on the opt-in direct-DXIL path (XCL_DIRECT_DXIL), which the smoke runs leave unset (default HLSL backend), so they show only that nothing else regressed; the world load (the smoke runs stop at the start screen, so code that only runs later is not exercised there); AMD.

AI use: Claude Code (Claude Opus 5.5) built and ran the tests and smoke runs on my machine and wrote this report; I checked it.

**@⁠frenziedcoder** on GitHub · 2026-11-24 22:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/1874#issuecomment-7146540241) **NVIDIA test report for `fcd9414`: no new test failures (the 4 that fail also fail on `689f2db`), its own test `gpu_direct_image_get_resinfo_d16` passes, and a clean smoke pair on the retail title (1654 vs 1657 frames).** **Tested** - NVIDIA GeForce RTX 5080 16 GB (driver 617.14, 32-lane waves), AMD Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 25H2 (26200.9974), rustc 1.100.0 `stable-x86_64-pc-windows-msvc`, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact head `fcd94144d630ad248827d29a86ffee042141a4ae`, no local changes. - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4` (debug): **972 passed, 4 failed, 45 ignored**; the PR's own test `gpu_direct_image_get_resinfo_d16` passes. SKIPPED: `gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu` (no wave64), `gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu` (no wave64), `gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu` (no wave64), `gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu` (no wave64), `gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu` (no wave64), `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))), `gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu` (f16 arithmetic, wave64: no wave64), `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))), `gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu` (f16 packed, wave64: no wave64), `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu` (f32 arithmetic, wave64: no wave64), `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu` (f32 compares, wave64: no wave64), `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))), `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu` (f32 conversions, wave64: no wave64), `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu` (f32 rounding, wave64: no wave64), `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu` (f32 three-source, wave64: no wave64), `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu` (f32 transcendentals, wave64: no wave64), `gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu` (f64, wave64: no wave64), `gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu` (integer arithmetic, wave64: no wave64), `gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu` (integer carries, wave64: no wave64), `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). - The 4 failures are `fuzz_validate_and_gpu_0`, `fuzz_validate_and_gpu_1`, `fuzz_validate_and_gpu_2`, `fuzz_validate_and_gpu_3` in `gpu::dxil::fuzz_tests`. They fail the same way on the base `689f2db` here (`0x8007000E` from `CreateComputePipelineState` on seeds 70, 545, 1019 and 1507, the NVIDIA refusal @⁠PHeitor1 reported on #1679), so this PR adds no failure. - `test_title_draws_with_a_root_signature_under_the_debug_layer` reports ok, but this machine has no D3D12 debug layer (`debug layer requested but unavailable … (0x887A002D)`), so it ran without the layer and is no evidence either way. **Regression run** (`scripts/smoke.ps1 -Seconds 60`, release, the retail title of #505 at its start screen; `XCL_PSO_PRELOAD=0` for both builds, because this machine's preload list holds the program of #1307) base (`689f2db`, this PR's merge base with `main`): ``` xcl-smoke v1 commit: 689f2db477c3c062cf162649781640ef8a977c18 gpu: NVIDIA GeForce RTX 5080 title: 16b5e5d4 seconds: 60 exit: 0x0 frames shown: 1657 (PresentX 1657) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14602 MB ``` this PR: ``` xcl-smoke v1 commit: fcd94144d630ad248827d29a86ffee042141a4ae gpu: NVIDIA GeForce RTX 5080 title: 16b5e5d4 seconds: 60 exit: 0x0 frames shown: 1654 (PresentX 1654) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14598 MB ``` **Not tested:** this code in the title: it is on the opt-in direct-DXIL path (`XCL_DIRECT_DXIL`), which the smoke runs leave unset (default HLSL backend), so they show only that nothing else regressed; the world load (the smoke runs stop at the start screen, so code that only runs later is not exercised there); AMD. *AI use: Claude Code (Claude Opus 5.5) built and ran the tests and smoke runs on my machine and wrote this report; I checked it.*
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 01:08 UTC · original

Diff audit passed (lower_image.rs d16_format mask/high-half fix and test look clean), Build and test + PR description are green on 4070ae1, and AMD RDNA4 passed on this exact head.

Remaining before merge: one independent NVIDIA confirmation on the current rebased head 4070ae1 (the earlier NVIDIA runs were on pre-rebase fcd9414).

**@⁠raylitebull** on GitHub · 2026-11-25 01:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/1874#issuecomment-7149239661) Diff audit passed (`lower_image.rs` `d16_format` mask/high-half fix and test look clean), `Build and test` + `PR description` are green on `4070ae1`, and AMD RDNA4 passed on this exact head. **Remaining before merge:** one independent **NVIDIA** confirmation on the current rebased head `4070ae1` (the earlier NVIDIA runs were on pre-rebase `fcd9414`).
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 01:45 UTC · original

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!

**@⁠DavidM1911** on GitHub · 2026-11-25 01:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/1874#issuecomment-7149930246) 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!
This discussion has been locked. Commenting is limited to contributors.
No description provided.