Recompiler: D16 format loads of UNORM / SNORM data round once to nearest #2017

Merged
upipibi merged 2 commits from upstream-pr/2027 into main 2026-11-29 13:59:25 +00:00
upipibi commented 2026-11-25 01:14:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-25T01:14:00Z.


Known: this PR's D16 normalization uses a 64-bit divide (d16_fmt in dxil/lower_mem.rs, norm16_rep in recomp/emit.rs), so every shader with a D16 load declares Int64 (SFI0 0x8000) in both backends. A 32-bit fix with tests is on upipibi/xcl branch fix/d16-norm16-no-int64 (af15e87, one commit on #2027's head; RTX 3070: gpu_buffer_d16 2/2 with XCL_DIRECT_DXIL=0 and =1, lib suite 1170 passed, 0 failed; a no-GPU test checks that the Int64 flag is clear for all 20 UNORM / SNORM D16 buffer and tbuffer loads). It isn't pushed here because a push needs a new title smoke pair, which I can't make.

Part of #2026 (XCL-BT-020's third item, #1488). The image half follows in a second PR.

A D16 buffer format load packed a UNORM / SNORM channel with f32tof16 of the decoded f32. That's two roundings, and on D3D12 the second one rounds toward zero. RDNA2 rounds code / (2^w − 1) once, to nearest even. So about half of all codes came back one unit in the last place low: 16_UNORM 0x0801 gave 0x2800, where RDNA2 gives 0x2801.

Overlap with #2360 (#1607 group D102): both round UNORM / SNORM codes to f16 once, to nearest. This PR also truncates the other non-integer channels to f16 (f16_rtz), where #2360 rounds them to nearest. NWProgramming00 measured buffer_load_format_d16_x on an RDNA2 gfx1036 (#1607 comment): the hardware truncates 32_FLOAT (6,011 of 6,011 values), and rounds normalized codes once to nearest.

What is in it

  • recomp/emit.rs: norm16_rep and d16_fmt in the prelude. The FormatLoad D16 channel goes through d16_fmt instead of f32tof16.

    • The code is recovered from the decoded value as round(f · (2^w − 1)).
    • code / (2^w − 1) has a binary expansion that repeats the w-bit code. So its first 32 bits, floor((code << 32) / (2^w − 1)), decide the rounding, and a tie can't happen.
    • SNORM uses |v| / (2^(w−1) − 1) and adds the sign.
    • Channels that aren't UNORM/SNORM, and DST_SEL 0/1, stay on f32tof16.
  • dxil/lower_mem.rs: the same as Lw::d16_fmt, at the three D16 format-load sites.

  • recomp/tests.rs: gpu_buffer_d16_loads_of_16_bit_norms_round_once, with 64 lanes each loading their own 16_UNORM and 16_SNORM code, against exact single rounding.

  • Second commit (b0aae2e): float channels of a D16 format load truncate with f16_rtz on both paths, instead of passing through f32tof16 / legacyF32ToF16. That conversion's rounding is the host's: it truncates on the RTX 3070 and WARP, but under vkd3d-proton it rounds to nearest (Marvisak/VIctory#2006), while RDNA2 truncates (boykopovar/AnyPS5#22750). New test gpu_buffer_d16_loads_of_32_bit_floats_truncate: 32_FLOAT values the two roundings tell apart (1 + 1.5 / 1.75 ulp, 65535, ±70000, a denormal half-way), plus -1.5 and +inf.

Tested

  • At 0cab3ef (rebased onto main 426a5a74, the first main with green CI after 5478c4a7, whose two failing tests main fixed in 0d13b071), RTX 3070 (616.56): gpu_ suite (--skip gpu_sparse_vram) 145 passed, 0 failed with XCL_DIRECT_DXIL=0 and with =1. main 426a5a74 gives 143 passed on both.
  • At b0aae2e, RTX 3070 (616.56): the d16 tests pass with XCL_DIRECT_DXIL=0 and 1 (6 of 6). gpu_ tests: 134 passed with 0; with 1, 133 passed and 1 failed: gpu_image_get_resinfo_1d_array, which fails on main too (#2046). This GPU already truncates, so the new test passes with or without the second commit here. Its value is on hosts that round to nearest (vkd3d-proton, and AMD per dxil/ops.rs).
  • Python model of norm16_rep/d16_fmt against exact rational rounding: every code at w = 2…16, UNORM and SNORM, with the decoded value off by up to ±2 ULP (524,272 checks). No mismatches.
  • RTX 3070 (Ampere, driver 616.56), Windows 11, debug, on main 5ce558f (rebased; #1947 now keys the translated cache on the gpu/dxil sources, so there is no TRANSLATOR_VERSION bump):
    • new test: main fails with 57 of 128 halves one ULP low (for example 16_SNORM 0x5b5b: 0x39b5, want 0x39b6). This branch passes, with XCL_DIRECT_DXIL=0 and 1.
    • gpu_ tests (--skip gpu_sparse_vram), with the whole stack (#2027, #2030, #2042): 135 passed with XCL_DIRECT_DXIL=0; with 1, 134 passed and 1 failed, gpu_image_get_resinfo_1d_array, which fails the same way on main 5ce558f (#2046 fixes it).
    • dxil:: and buffer_format units: 138 passed.

Regression run
Pair for the current head 0cab3ef against main 1a0bbe3, run by thehollowedone (comment, thanks): RTX 3080 Ti (621.35), stock scripts/smoke.ps1, clean release builds, 60 s offline. Pasted unedited.

xcl-smoke v1
commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6
gpu: NVIDIA GeForce RTX 3080 Ti
title: retail-private-fixture
seconds: 60
exit: 0x0
frames shown: 1641 (PresentX 1641)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14266 MB
xcl-smoke v1
commit: 0cab3ef3b46a9b522fd8838051f2c404baa5fa62
gpu: NVIDIA GeForce RTX 3080 Ti
title: retail-private-fixture
seconds: 60
exit: 0x0
frames shown: 1639 (PresentX 1639)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14365 MB

Earlier: Toons29's pair, comment, was for b0aae2e, before the rebase onto main 5478c4a7..

Not tested

  • AMD, titles. Conflicts with #1977 in the same packing expressions (it saturates the integer side, this changes the float side); whichever merges second keeps both.

AI use

  • AI-assisted (Claude Code, Claude Opus 5.5): wrote the change, the tests and this description, and ran the tests above. Synthetic tests only; no game files.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5483191833 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2027). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T01:14:00Z. --- **Known:** this PR's D16 normalization uses a 64-bit divide (`d16_fmt` in `dxil/lower_mem.rs`, `norm16_rep` in `recomp/emit.rs`), so every shader with a D16 load declares Int64 (SFI0 `0x8000`) in both backends. A 32-bit fix with tests is on `upipibi/xcl` branch `fix/d16-norm16-no-int64` (`af15e87`, one commit on #2027's head; RTX 3070: `gpu_buffer_d16` 2/2 with `XCL_DIRECT_DXIL=0` and `=1`, lib suite 1170 passed, 0 failed; a no-GPU test checks that the Int64 flag is clear for all 20 UNORM / SNORM D16 buffer and tbuffer loads). It isn't pushed here because a push needs a new title smoke pair, which I can't make. Part of #2026 (XCL-BT-020's third item, #1488). The image half follows in a second PR. A D16 buffer format load packed a UNORM / SNORM channel with `f32tof16` of the decoded f32. That's two roundings, and on D3D12 the second one rounds toward zero. RDNA2 rounds `code / (2^w − 1)` once, to nearest even. So about half of all codes came back one unit in the last place low: 16_UNORM `0x0801` gave `0x2800`, where RDNA2 gives `0x2801`. **Overlap with #2360** (#1607 group D102): both round UNORM / SNORM codes to f16 once, to nearest. This PR also truncates the other non-integer channels to f16 (`f16_rtz`), where #2360 rounds them to nearest. NWProgramming00 measured `buffer_load_format_d16_x` on an RDNA2 gfx1036 ([#1607 comment](https://github.com/xcl-dev/xcl/issues/1607#issuecomment-7170937871)): the hardware truncates 32_FLOAT (6,011 of 6,011 values), and rounds normalized codes once to nearest. **What is in it** - `recomp/emit.rs`: `norm16_rep` and `d16_fmt` in the prelude. The FormatLoad D16 channel goes through `d16_fmt` instead of `f32tof16`. - The code is recovered from the decoded value as `round(f · (2^w − 1))`. - `code / (2^w − 1)` has a binary expansion that repeats the `w`-bit code. So its first 32 bits, `floor((code << 32) / (2^w − 1))`, decide the rounding, and a tie can't happen. - SNORM uses `|v| / (2^(w−1) − 1)` and adds the sign. - Channels that aren't UNORM/SNORM, and DST_SEL 0/1, stay on `f32tof16`. - `dxil/lower_mem.rs`: the same as `Lw::d16_fmt`, at the three D16 format-load sites. - `recomp/tests.rs`: `gpu_buffer_d16_loads_of_16_bit_norms_round_once`, with 64 lanes each loading their own 16_UNORM and 16_SNORM code, against exact single rounding. - Second commit (`b0aae2e`): float channels of a D16 format load truncate with `f16_rtz` on both paths, instead of passing through `f32tof16` / `legacyF32ToF16`. That conversion's rounding is the host's: it truncates on the RTX 3070 and WARP, but under vkd3d-proton it rounds to nearest (Marvisak/VIctory#2006), while RDNA2 truncates (boykopovar/AnyPS5#22750). New test `gpu_buffer_d16_loads_of_32_bit_floats_truncate`: 32_FLOAT values the two roundings tell apart (1 + 1.5 / 1.75 ulp, 65535, ±70000, a denormal half-way), plus -1.5 and +inf. **Tested** - At `0cab3ef` (rebased onto `main` `426a5a74`, the first `main` with green CI after `5478c4a7`, whose two failing tests main fixed in `0d13b071`), RTX 3070 (616.56): `gpu_` suite (`--skip gpu_sparse_vram`) 145 passed, 0 failed with `XCL_DIRECT_DXIL=0` and with `=1`. `main` `426a5a74` gives 143 passed on both. - At `b0aae2e`, RTX 3070 (616.56): the `d16` tests pass with `XCL_DIRECT_DXIL=0` and `1` (6 of 6). `gpu_` tests: 134 passed with `0`; with `1`, 133 passed and 1 failed: `gpu_image_get_resinfo_1d_array`, which fails on `main` too (#2046). This GPU already truncates, so the new test passes with or without the second commit here. Its value is on hosts that round to nearest (vkd3d-proton, and AMD per `dxil/ops.rs`). - Python model of `norm16_rep`/`d16_fmt` against exact rational rounding: every code at `w` = 2…16, UNORM and SNORM, with the decoded value off by up to ±2 ULP (524,272 checks). No mismatches. - RTX 3070 (Ampere, driver 616.56), Windows 11, debug, on `main` `5ce558f` (rebased; #1947 now keys the translated cache on the `gpu/dxil` sources, so there is no `TRANSLATOR_VERSION` bump): - new test: `main` fails with 57 of 128 halves one ULP low (for example 16_SNORM `0x5b5b`: `0x39b5`, want `0x39b6`). This branch passes, with `XCL_DIRECT_DXIL=0` and `1`. - `gpu_` tests (`--skip gpu_sparse_vram`), with the whole stack (#2027, #2030, #2042): 135 passed with `XCL_DIRECT_DXIL=0`; with `1`, 134 passed and 1 failed, `gpu_image_get_resinfo_1d_array`, which fails the same way on `main` `5ce558f` (#2046 fixes it). - `dxil::` and `buffer_format` units: 138 passed. **Regression run** Pair for the current head `0cab3ef` against `main` `1a0bbe3`, run by thehollowedone ([comment](https://github.com/xcl-dev/xcl/pull/2027#issuecomment-7162262812), thanks): RTX 3080 Ti (621.35), stock `scripts/smoke.ps1`, clean release builds, 60 s offline. Pasted unedited. ``` xcl-smoke v1 commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6 gpu: NVIDIA GeForce RTX 3080 Ti title: retail-private-fixture seconds: 60 exit: 0x0 frames shown: 1641 (PresentX 1641) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14266 MB ``` ``` xcl-smoke v1 commit: 0cab3ef3b46a9b522fd8838051f2c404baa5fa62 gpu: NVIDIA GeForce RTX 3080 Ti title: retail-private-fixture seconds: 60 exit: 0x0 frames shown: 1639 (PresentX 1639) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14365 MB ``` Earlier: Toons29's pair, [comment](https://github.com/xcl-dev/xcl/pull/2027#issuecomment-7159566180), was for `b0aae2e`, before the rebase onto `main` `5478c4a7`.. **Not tested** - AMD, titles. Conflicts with #1977 in the same packing expressions (it saturates the integer side, this changes the float side); whichever merges second keeps both. **AI use** - AI-assisted (Claude Code, Claude Opus 5.5): wrote the change, the tests and this description, and ran the tests above. Synthetic tests only; no game files. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
nnonno91 commented 2026-11-25 02:08:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by nnonno91 on 2026-11-25T01:18:36Z.


Tested

Independent Windows/D3D12 check on exact head d7bd99057d01219b23acb0ec52a68d2e11e88c77. Windows 11 25H2 (26200.9974), Ryzen 7 9800X3D, AMD Radeon(TM) Graphics (32.0.21042.62, native wave64), and GeForce RTX 5090 (32.0.16.1742, split wave64). Rust 1.100.0 x64 MSVC, DXC/DXIL 1.8.2502.11, unoptimized dev/test profiles with debug info off.

  • cargo build --workspace --locked passed at the PR head.
  • cargo test --locked -p xcl --lib gpu::recomp::tests::gpu_buffer_d16_loads_of_16_bit_norms_round_once -- --exact --test-threads=1 --nocapture passed on each GPU with XCL_DIRECT_DXIL=0 and 1 (1 passed, 0 failed, 0 ignored, 0 skipped per run). With only the test added to parent de36462e0b1043b915a418d4591ed1e397622ede, all four baseline runs failed as expected (57 of 128 half values differed in each).
  • cargo test --locked -p xcl --test d16_norm_gpu_probe -- --exact all_16_bit_normalized_buffer_codes_match_exact_rounding --test-threads=1 --nocapture compared all 65,536 codes per format for 16-bit UNORM and SNORM. The temporary compute shader used BUFFER_LOAD_FORMAT_D16_X for both formats and wrote one packed pair to a separate output region per input. The CPU reference found the nearest binary16 value with exact integer cross-products. Both HLSL + DXC and Direct DXIL ran in each test. Each probe process passed (1 passed, 0 failed, 0 ignored, 0 skipped), with the parent run explicitly checking for the old rounding error.
Mismatched values per GPU and backend Parent PR head
16_UNORM 31,740 / 65,536 0 / 65,536
16_SNORM 30,716 / 65,536 0 / 65,536

The counts were identical on both adapters and both backends. For example, 16_UNORM 0x0801 changed from 0x2800 to the expected 0x2801.

Not tested

Real-title smoke runs, full workspace test suite, other channel widths, and image format loads. The exhaustive probe covers single-channel 16-bit buffer inputs.

AI use

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

<!-- greyfinch-sync:ivall/xcl:comment:7149416150 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2027#issuecomment-7149416150). Originally posted by [nnonno91](https://github.com/nnonno91) on 2026-11-25T01:18:36Z. --- **Tested** Independent Windows/D3D12 check on exact head `d7bd99057d01219b23acb0ec52a68d2e11e88c77`. Windows 11 25H2 (26200.9974), Ryzen 7 9800X3D, AMD Radeon(TM) Graphics (32.0.21042.62, native wave64), and GeForce RTX 5090 (32.0.16.1742, split wave64). Rust 1.100.0 x64 MSVC, DXC/DXIL 1.8.2502.11, unoptimized dev/test profiles with debug info off. - `cargo build --workspace --locked` passed at the PR head. - `cargo test --locked -p xcl --lib gpu::recomp::tests::gpu_buffer_d16_loads_of_16_bit_norms_round_once -- --exact --test-threads=1 --nocapture` passed on each GPU with `XCL_DIRECT_DXIL=0` and `1` (1 passed, 0 failed, 0 ignored, 0 skipped per run). With only the test added to parent `de36462e0b1043b915a418d4591ed1e397622ede`, all four baseline runs failed as expected (57 of 128 half values differed in each). - `cargo test --locked -p xcl --test d16_norm_gpu_probe -- --exact all_16_bit_normalized_buffer_codes_match_exact_rounding --test-threads=1 --nocapture` compared **all 65,536 codes per format** for 16-bit UNORM and SNORM. The temporary compute shader used `BUFFER_LOAD_FORMAT_D16_X` for both formats and wrote one packed pair to a separate output region per input. The CPU reference found the nearest binary16 value with exact integer cross-products. Both HLSL + DXC and Direct DXIL ran in each test. Each probe process passed (1 passed, 0 failed, 0 ignored, 0 skipped), with the parent run explicitly checking for the old rounding error. | Mismatched values per GPU and backend | Parent | PR head | | --- | ---: | ---: | | 16_UNORM | 31,740 / 65,536 | 0 / 65,536 | | 16_SNORM | 30,716 / 65,536 | 0 / 65,536 | The counts were identical on both adapters and both backends. For example, 16_UNORM `0x0801` changed from `0x2800` to the expected `0x2801`. **Not tested** Real-title smoke runs, full workspace test suite, other channel widths, and image format loads. The exhaustive probe covers single-channel 16-bit buffer inputs. **AI use** OpenAI Codex (GPT-6 family, exact variant unavailable) prepared and ran the temporary probe, checked the outputs, and drafted this report.
JJAutoCompare commented 2026-11-25 02:08:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T01:30:03Z.


Tested

Independent Intel Arc A770 verification for #2026 on clean PR head d7bd99057d01219b23acb0ec52a68d2e11e88c77. Windows 11 Enterprise Evaluation 25H2 (26200.9974), Ryzen 7 3800X, Arc A770 driver 32.0.101.9175, Rust/Cargo 1.100.0 (x86_64-pc-windows-msvc), and DXC/DXIL 1.9.2609.5.

  • Prebuilt with cargo test --locked -p xcl --lib --no-run (exit 0). The test profile was unoptimized, with CARGO_BUILD_JOBS=2, CARGO_INCREMENTAL=0, CARGO_PROFILE_DEV_DEBUG=0, and CARGO_PROFILE_TEST_DEBUG=0.
  • With XCL_ADAPTER=A770, XCL_REQUIRE_GPU=wave64, and XCL_DXC_DIR set to the 1.9.2609 package, ran the prebuilt lib-test executable under the shared Arc lock. For each test below, the command was & $exe gpu::recomp::tests::<name> --exact --nocapture --test-threads=1, in a separate process for each listed XCL_DIRECT_DXIL setting.
Test 0 (HLSL + DXC) 1 (direct DXIL for kernel execution)
gpu_buffer_d16_loads_of_16_bit_norms_round_once Pass Pass
gpu_typed_buffer_loads_and_stores Pass Pass
buffer_format_d16_packs_and_unpacks_halves Pass Pass
buffer_format_table_matches_llvm Pass

7 passed, 0 failed, 0 ignored, 0 skipped across seven processes. The rounding regression checked 64 UNORM and 64 SNORM output halves per backend.

  • Ran powershell -NoProfile -ExecutionPolicy Bypass -File L:/XclTooling/pr2027/reference.ps1 -Source <worktree>/crates/xcl/src/gpu/recomp/tests.rs. The reference used exact integer distances between adjacent binary16 values to check all 128 committed fixture values. It also compared a CPU model of the PR conversion against that reference for all 65,536 codes per format at five binary32 magnitude offsets (−2 through +2 ULP, clamped at zero). Each format had 327,680 comparisons and zero mismatches.

Not tested

Exhaustive GPU output, other normalized channel widths, D16 image loads, the parent commit, the full workspace suite, and retail-title smoke runs.

AI use

Codex (gpt-6.2-sol) wrote and ran the temporary reference check, ran the focused tests, and wrote this report.

Follow-up on 83d3d05

Tested

Independent STOR-WINLAB Arc A770 rerun for xcl-dev/xcl#2027 at 83d3d05107998927f48efe501584dacfd934c14c. GitHub showed the PR open at that exact head before and after the run. The worktree was clean and detached at the same SHA throughout testing. The existing JJAutoCompare Arc result in comment 7149616157 covers d7bd99057d01219b23acb0ec52a68d2e11e88c77. The PR discussion and reviews had no equivalent exact-head Arc result.

Windows 11 Enterprise Evaluation 25H2 x64 (26200.9974), AMD Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust and Cargo 1.100.0 (stable-x86_64-pc-windows-msvc, rustc 0ef1bc386), DXC and DXIL 1.9.2609.5. Cargo used the unoptimized test profile with two jobs and debug info and incremental compilation disabled.

cargo test --locked -p xcl --lib --no-run completed outside the Arc lock (exit 0). Under & 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { ... }, ran the exact prebuilt command below in separate processes for XCL_DIRECT_DXIL=0 and 1, with XCL_ADAPTER=A770, XCL_REQUIRE_GPU=wave64, and the specified DXC directory.

& $exe gpu::recomp::tests::gpu_buffer_d16_loads_of_16_bit_norms_round_once --exact --nocapture --test-threads=1
Backend Passed Failed Ignored Skipped Filtered Child exit Test time
HLSL + DXC (0) 1 0 0 0 1,119 0 1.06 s
Direct DXIL (1) 1 0 0 0 1,119 0 0.47 s

Each run matched all 128 expected binary16 values across 64 UNORM and 64 SNORM inputs. The wrapper logged both settings, and the stock fixture's runner::run_code uses the direct translator without fallback when enabled. Both stderr logs show the DXC version because the fixture checks DXC availability before dispatch. The wrapper exited 0 and logged the mutex release.

Not tested

Other buffer widths or codes outside the fixture, image loads, filtered sampling, other shaders or adapters, the parent commit, the full workspace suite, and retail-title smoke runs.

AI use

T3 Code / Codex (gpt-6.2-sol) inspected the existing fixture and backend routing, ran the two tests, and wrote this report.

Raw evidence in L:/XclTooling/pr2027/run-20261125T041438211Z: environment.log, prebuild.{stdout.log,stderr.log,exit.txt}, direct-0.{stdout.log,stderr.log,exit.txt}, direct-1.{stdout.log,stderr.log,exit.txt}, and gpu-wrapper.{stdout.log,stderr.log,exit.txt}.

<!-- greyfinch-sync:ivall/xcl:comment:7149616157 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2027#issuecomment-7149616157). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T01:30:03Z. --- **Tested** Independent Intel Arc A770 verification for #2026 on clean PR head `d7bd99057d01219b23acb0ec52a68d2e11e88c77`. Windows 11 Enterprise Evaluation 25H2 (26200.9974), Ryzen 7 3800X, Arc A770 driver `32.0.101.9175`, Rust/Cargo 1.100.0 (`x86_64-pc-windows-msvc`), and DXC/DXIL `1.9.2609.5`. - Prebuilt with `cargo test --locked -p xcl --lib --no-run` (exit 0). The test profile was unoptimized, with `CARGO_BUILD_JOBS=2`, `CARGO_INCREMENTAL=0`, `CARGO_PROFILE_DEV_DEBUG=0`, and `CARGO_PROFILE_TEST_DEBUG=0`. - With `XCL_ADAPTER=A770`, `XCL_REQUIRE_GPU=wave64`, and `XCL_DXC_DIR` set to the 1.9.2609 package, ran the prebuilt lib-test executable under the shared Arc lock. For each test below, the command was `& $exe gpu::recomp::tests::<name> --exact --nocapture --test-threads=1`, in a separate process for each listed `XCL_DIRECT_DXIL` setting. | Test | `0` (HLSL + DXC) | `1` (direct DXIL for kernel execution) | | --- | --- | --- | | `gpu_buffer_d16_loads_of_16_bit_norms_round_once` | Pass | Pass | | `gpu_typed_buffer_loads_and_stores` | Pass | Pass | | `buffer_format_d16_packs_and_unpacks_halves` | Pass | Pass | | `buffer_format_table_matches_llvm` | Pass | | **7 passed, 0 failed, 0 ignored, 0 skipped** across seven processes. The rounding regression checked 64 UNORM and 64 SNORM output halves per backend. - Ran `powershell -NoProfile -ExecutionPolicy Bypass -File L:/XclTooling/pr2027/reference.ps1 -Source <worktree>/crates/xcl/src/gpu/recomp/tests.rs`. The reference used exact integer distances between adjacent binary16 values to check all 128 committed fixture values. It also compared a CPU model of the PR conversion against that reference for all 65,536 codes per format at five binary32 magnitude offsets (−2 through +2 ULP, clamped at zero). Each format had 327,680 comparisons and zero mismatches. **Not tested** Exhaustive GPU output, other normalized channel widths, D16 image loads, the parent commit, the full workspace suite, and retail-title smoke runs. **AI use** Codex (`gpt-6.2-sol`) wrote and ran the temporary reference check, ran the focused tests, and wrote this report. ## Follow-up on 83d3d05 **Tested** Independent STOR-WINLAB Arc A770 rerun for xcl-dev/xcl#2027 at `83d3d05107998927f48efe501584dacfd934c14c`. GitHub showed the PR open at that exact head before and after the run. The worktree was clean and detached at the same SHA throughout testing. The existing JJAutoCompare Arc result in comment 7149616157 covers `d7bd99057d01219b23acb0ec52a68d2e11e88c77`. The PR discussion and reviews had no equivalent exact-head Arc result. Windows 11 Enterprise Evaluation 25H2 x64 (26200.9974), AMD Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust and Cargo 1.100.0 (`stable-x86_64-pc-windows-msvc`, rustc `0ef1bc386`), DXC and DXIL 1.9.2609.5. Cargo used the unoptimized test profile with two jobs and debug info and incremental compilation disabled. `cargo test --locked -p xcl --lib --no-run` completed outside the Arc lock (exit 0). Under `& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { ... }`, ran the exact prebuilt command below in separate processes for `XCL_DIRECT_DXIL=0` and `1`, with `XCL_ADAPTER=A770`, `XCL_REQUIRE_GPU=wave64`, and the specified DXC directory. ```powershell & $exe gpu::recomp::tests::gpu_buffer_d16_loads_of_16_bit_norms_round_once --exact --nocapture --test-threads=1 ``` | Backend | Passed | Failed | Ignored | Skipped | Filtered | Child exit | Test time | | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | | HLSL + DXC (`0`) | 1 | 0 | 0 | 0 | 1,119 | 0 | 1.06 s | | Direct DXIL (`1`) | 1 | 0 | 0 | 0 | 1,119 | 0 | 0.47 s | Each run matched all 128 expected binary16 values across 64 UNORM and 64 SNORM inputs. The wrapper logged both settings, and the stock fixture's `runner::run_code` uses the direct translator without fallback when enabled. Both stderr logs show the DXC version because the fixture checks DXC availability before dispatch. The wrapper exited 0 and logged the mutex release. **Not tested** Other buffer widths or codes outside the fixture, image loads, filtered sampling, other shaders or adapters, the parent commit, the full workspace suite, and retail-title smoke runs. **AI use** T3 Code / Codex (gpt-6.2-sol) inspected the existing fixture and backend routing, ran the two tests, and wrote this report. Raw evidence in `L:/XclTooling/pr2027/run-20261125T041438211Z`: `environment.log`, `prebuild.{stdout.log,stderr.log,exit.txt}`, `direct-0.{stdout.log,stderr.log,exit.txt}`, `direct-1.{stdout.log,stderr.log,exit.txt}`, and `gpu-wrapper.{stdout.log,stderr.log,exit.txt}`.
raylitebull commented 2026-11-25 02:08:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T01:34:45Z.


Diff audit on d7bd990 looks strong (norm16_rep/d16_fmt in recomp/emit.rs + dxil/lower_mem.rs matches exact single rounding across all 65,536 16-bit UNORM/SNORM codes on AMD iGPU, RTX 5090, RTX 3070, and Intel Arc A770).

Remaining before merge:

  1. Rebase onto main to clear CONFLICTING/DIRTY (also drop the manual TRANSLATOR_VERSION = 9 bump in kernel.rs, as #1947 now auto-hashes gpu/dxil sources via XCL_DIRECT_DXIL_SOURCE_ID).
  2. Add paired xcl-smoke v1 blocks (main and PR) so PR description passes (or ask another contributor with a retail title to post them).
<!-- greyfinch-sync:ivall/xcl:comment:7149709348 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2027#issuecomment-7149709348). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T01:34:45Z. --- Diff audit on `d7bd990` looks strong (`norm16_rep`/`d16_fmt` in `recomp/emit.rs` + `dxil/lower_mem.rs` matches exact single rounding across all 65,536 16-bit UNORM/SNORM codes on AMD iGPU, RTX 5090, RTX 3070, and Intel Arc A770). **Remaining before merge:** 1. Rebase onto `main` to clear `CONFLICTING`/`DIRTY` (also drop the manual `TRANSLATOR_VERSION = 9` bump in `kernel.rs`, as `#1947` now auto-hashes `gpu/dxil` sources via `XCL_DIRECT_DXIL_SOURCE_ID`). 2. Add paired `xcl-smoke v1` blocks (`main` and PR) so `PR description` passes (or ask another contributor with a retail title to post them).
luckyteagirl commented 2026-11-25 03:05:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-25T02:19:49Z.


Tested

  • Exact PR head 83d3d05107998927f48efe501584dacfd934c14c and main 5ce558f82a48c51d527f6035234dacbd29db3f05. Windows 11 build 26200, Ryzen 9 5980HX, AMD Radeon RX 6800M driver 30.0.13002.13003, Rust 1.99.0 MSVC, DXC/DXIL 1.9.2609.5.
  • With XCL_ADAPTER=6800M and XCL_REQUIRE_GPU=1, cargo test --locked -p xcl --lib -j 2 gpu::recomp::tests::gpu_buffer_d16_loads_of_16_bit_norms_round_once -- --exact --test-threads=1 --nocapture passed under both XCL_DIRECT_DXIL=0 (HLSL/DXC) and =1 (direct DXIL): 1 passed, 0 failed, 0 ignored, no explicit skip in each run.
  • cargo build --locked --release -p xcl -j 2 passed for both revisions. A locally owned title completed a paired 7-second scripts/smoke.ps1 run on the RX 6800M. Each run showed one frame, with no crash or device removal. Peak process commit was 6,963 MB on main and 7,058 MB on the PR.

The two blocks below can be copied into Regression run in the PR description. A comment by itself does not satisfy XCL's description check.

main:

xcl-smoke v1
commit: 5ce558f82a48c51d527f6035234dacbd29db3f05
gpu: AMD Radeon RX 6800M
title: 2ef5fd64
seconds: 7
exit: 0x0
frames shown: 1 (PresentX 1)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 6963 MB

PR head:

xcl-smoke v1
commit: 83d3d05107998927f48efe501584dacfd934c14c
gpu: AMD Radeon RX 6800M
title: 2ef5fd64
seconds: 7
exit: 0x0
frames shown: 1 (PresentX 1)
presents per 2 s (last 3): 0 0 1
device removals: 0
crashes: 0
peak commit: 7058 MB

Not tested

  • The short title runs logged zero draws and used default shader routing, so they do not demonstrate the D16 format-load path. The focused GPU test covers that path. I did not run the full workspace suite, longer title sessions, other adapters, or other normalized widths.

AI use

OpenAI Codex (GPT-6, exact variant not exposed in this session) ran the tests and smoke comparisons and drafted this report from their logs.

<!-- greyfinch-sync:ivall/xcl:comment:7150585458 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2027#issuecomment-7150585458). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-25T02:19:49Z. --- **Tested** - Exact PR head `83d3d05107998927f48efe501584dacfd934c14c` and main `5ce558f82a48c51d527f6035234dacbd29db3f05`. Windows 11 build 26200, Ryzen 9 5980HX, AMD Radeon RX 6800M driver `30.0.13002.13003`, Rust 1.99.0 MSVC, DXC/DXIL 1.9.2609.5. - With `XCL_ADAPTER=6800M` and `XCL_REQUIRE_GPU=1`, `cargo test --locked -p xcl --lib -j 2 gpu::recomp::tests::gpu_buffer_d16_loads_of_16_bit_norms_round_once -- --exact --test-threads=1 --nocapture` passed under both `XCL_DIRECT_DXIL=0` (HLSL/DXC) and `=1` (direct DXIL): 1 passed, 0 failed, 0 ignored, no explicit skip in each run. - `cargo build --locked --release -p xcl -j 2` passed for both revisions. A locally owned title completed a paired 7-second `scripts/smoke.ps1` run on the RX 6800M. Each run showed one frame, with no crash or device removal. Peak process commit was 6,963 MB on main and 7,058 MB on the PR. The two blocks below can be copied into **Regression run** in the PR description. A comment by itself does not satisfy XCL's description check. main: ``` xcl-smoke v1 commit: 5ce558f82a48c51d527f6035234dacbd29db3f05 gpu: AMD Radeon RX 6800M title: 2ef5fd64 seconds: 7 exit: 0x0 frames shown: 1 (PresentX 1) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 6963 MB ``` PR head: ``` xcl-smoke v1 commit: 83d3d05107998927f48efe501584dacfd934c14c gpu: AMD Radeon RX 6800M title: 2ef5fd64 seconds: 7 exit: 0x0 frames shown: 1 (PresentX 1) presents per 2 s (last 3): 0 0 1 device removals: 0 crashes: 0 peak commit: 7058 MB ``` **Not tested** - The short title runs logged zero draws and used default shader routing, so they do not demonstrate the D16 format-load path. The focused GPU test covers that path. I did not run the full workspace suite, longer title sessions, other adapters, or other normalized widths. **AI use** OpenAI Codex (GPT-6, exact variant not exposed in this session) ran the tests and smoke comparisons and drafted this report from their logs.
JoaoPauluu commented 2026-11-25 03:05:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-25T02:20:28Z.


A run with vkd3d-proton as the host D3D12 (DXIL → SPIR-V through dxil-spirv, then the NVIDIA Vulkan driver), so the DXIL goes through a different compiler than the native-Windows runs here: this PR's test passes.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. 83d3d05 as it is (merge base with main 5ce558f), no uncommitted changes. The lib test binary runs under Wine, one test per process.
    • gpu_buffer_d16_loads_of_16_bit_norms_round_once: ok, not skipped

Not tested

  • the whole suite on this head, a retail title, native Windows, AMD.

AI use

  • Claude Code (Claude Opus 5.5) built the commit, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
<!-- greyfinch-sync:ivall/xcl:comment:7150598024 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2027#issuecomment-7150598024). Originally posted by [JoaoPauluu](https://github.com/JoaoPauluu) on 2026-11-25T02:20:28Z. --- A run with vkd3d-proton as the host D3D12 (DXIL → SPIR-V through dxil-spirv, then the NVIDIA Vulkan driver), so the DXIL goes through a different compiler than the native-Windows runs here: this PR's test passes. **Tested** - RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for `x86_64-pc-windows-gnu`. `83d3d05` as it is (merge base with `main` `5ce558f`), no uncommitted changes. The lib test binary runs under Wine, one test per process. - `gpu_buffer_d16_loads_of_16_bit_norms_round_once`: ok, not skipped **Not tested** - the whole suite on this head, a retail title, native Windows, AMD. **AI use** - Claude Code (Claude Opus 5.5) built the commit, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
DavidM1911 commented 2026-11-25 05:08:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T04:12:14Z.


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:7152625771 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2027#issuecomment-7152625771). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T04:12:14Z. --- 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!
Toons29 commented 2026-11-25 11:09:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T10:20:41Z.


Regression run of b0aae2ec on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 568e7db7, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1566 (PresentX 1566)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14592 MB
xcl-smoke v1
commit: b0aae2ecbb5c92bda70990ab3cb75475e869fbeb
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1627 (PresentX 1627)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14597 MB

Against the limits in CONTRIBUTING.md: 104 % of main's frames, 100 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; a script posted this right after the run, with both blocks exactly as printed.

<!-- greyfinch-sync:ivall/xcl:comment:7159566180 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2027#issuecomment-7159566180). Originally posted by [Toons29](https://github.com/Toons29) on 2026-11-25T10:20:41Z. --- Regression run of `b0aae2ec` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `568e7db7`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb gpu: AMD Radeon RX 9070 title: 34df7c50 seconds: 60 exit: 0x0 frames shown: 1566 (PresentX 1566) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14592 MB ``` ``` xcl-smoke v1 commit: b0aae2ecbb5c92bda70990ab3cb75475e869fbeb gpu: AMD Radeon RX 9070 title: 34df7c50 seconds: 60 exit: 0x0 frames shown: 1627 (PresentX 1627) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14597 MB ``` Against the limits in CONTRIBUTING.md: 104 % of `main`'s frames, 100 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; a script posted this right after the run, with both blocks exactly as printed.
thehollowedone commented 2026-11-25 13:05:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-25T12:21:24Z.


Here is the requested scripts/smoke.ps1 pair from clean release builds of main 1a0bbe3 and PR head 0cab3ef.

RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC. The 60 s offline runs used separate copies of the same starting profile and DXIL seed, no input, PSO preload off, a 16 GiB job commit cap, and a 12 GiB system commit floor.

xcl-smoke v1
commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6
gpu: NVIDIA GeForce RTX 3080 Ti
title: retail-private-fixture
seconds: 60
exit: 0x0
frames shown: 1641 (PresentX 1641)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14266 MB
xcl-smoke v1
commit: 0cab3ef3b46a9b522fd8838051f2c404baa5fa62
gpu: NVIDIA GeForce RTX 3080 Ti
title: retail-private-fixture
seconds: 60
exit: 0x0
frames shown: 1639 (PresentX 1639)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14365 MB

The two D16 buffer tests also passed in separate processes with XCL_DIRECT_DXIL=0 and =1. cargo test --offline --locked -p xcl --lib gpu_buffer_d16_loads_of -- --nocapture --test-threads=1 gave 2 passed, 0 failed, 0 ignored, and 0 skips in each mode.

The smoke pair covers startup. AMD hardware, Wine, and world load were outside this test.

AI-assisted. Codex (GPT-6, exact variant unavailable) ran the tests and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7162262812 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2027#issuecomment-7162262812). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-25T12:21:24Z. --- Here is the requested `scripts/smoke.ps1` pair from clean release builds of [main 1a0bbe3](https://github.com/xcl-dev/xcl/commit/1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6) and [PR head 0cab3ef](https://github.com/xcl-dev/xcl/commit/0cab3ef3b46a9b522fd8838051f2c404baa5fa62). RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC. The 60 s offline runs used separate copies of the same starting profile and DXIL seed, no input, PSO preload off, a 16 GiB job commit cap, and a 12 GiB system commit floor. ``` xcl-smoke v1 commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6 gpu: NVIDIA GeForce RTX 3080 Ti title: retail-private-fixture seconds: 60 exit: 0x0 frames shown: 1641 (PresentX 1641) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14266 MB ``` ``` xcl-smoke v1 commit: 0cab3ef3b46a9b522fd8838051f2c404baa5fa62 gpu: NVIDIA GeForce RTX 3080 Ti title: retail-private-fixture seconds: 60 exit: 0x0 frames shown: 1639 (PresentX 1639) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14365 MB ``` The two D16 buffer tests also passed in separate processes with `XCL_DIRECT_DXIL=0` and `=1`. `cargo test --offline --locked -p xcl --lib gpu_buffer_d16_loads_of -- --nocapture --test-threads=1` gave 2 passed, 0 failed, 0 ignored, and 0 skips in each mode. The smoke pair covers startup. AMD hardware, Wine, and world load were outside this test. AI-assisted. Codex (GPT-6, exact variant unavailable) ran the tests and drafted this report.
throny commented 2026-11-25 19:09:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-25T18:29:13Z.


Two contributors checked independently and found that #2360 solves the same problem (for #2026) in a different way: #1607, group D102. 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:7170973303 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2027#issuecomment-7170973303). Originally posted by [throny](https://github.com/throny) on 2026-11-25T18:29:13Z. --- <!-- xcl-1607-hint:D102 --> Two contributors checked independently and found that #2360 solves the same problem (for #2026) in a different way: #1607, group D102. 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.
raylitebull commented 2026-11-25 19:09:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T18:41:10Z.


Diff review (norm16_rep/d16_fmt in recomp/emit.rs + dxil/lower_mem.rs and f16_rtz float D16 truncation) and green CI look solid, with exact-head 0cab3ef NVIDIA and smoke runs verified.

Remaining before merge:

  1. An exact-head 0cab3ef AMD test run (previous RX 6800M and RX 9070 runs were on earlier commits 83d3d05 and b0aae2e).
  2. Confirm resolution/preference vs #2360 per the #1607 (D102) triage note.
<!-- greyfinch-sync:ivall/xcl:comment:7171252132 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2027#issuecomment-7171252132). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T18:41:10Z. --- Diff review (`norm16_rep`/`d16_fmt` in `recomp/emit.rs` + `dxil/lower_mem.rs` and `f16_rtz` float D16 truncation) and green CI look solid, with exact-head `0cab3ef` NVIDIA and smoke runs verified. Remaining before merge: 1. An exact-head `0cab3ef` AMD test run (previous RX 6800M and RX 9070 runs were on earlier commits `83d3d05` and `b0aae2e`). 2. Confirm resolution/preference vs `#2360` per the `#1607` (`D102`) triage note.
upipibi commented 2026-11-25 19:09:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-25T18:49:08Z.


@raylitebull On the two points:

  1. AMD run at 0cab3ef: I only have an RTX 3070, so this needs someone with a Radeon card. The earlier RX 6800M and RX 9070 runs were on 83d3d05 and b0aae2e.
  2. Against #2360 (D102): both round a UNORM / SNORM code to f16 once, to nearest, and NWProgramming00 found both exact for every code of widths 2 to 16 (#1607 comment). They differ in the other non-integer channels. This PR truncates them to f16 (f16_rtz, in both backends). #2360 keeps f32tof16, which rounds to nearest. NWProgramming00 measured buffer_load_format_d16_x on an RDNA2 gfx1036 with 32_FLOAT: the hardware truncates (6,011 of 6,011 values match truncation, 3,028 match round-to-nearest). Separately, SlopTart's run of #2360 at 647932f (comment) shows DXC refusing its prelude helper, because snorm is a reserved HLSL keyword used as a parameter name there.

So on those measurements this PR matches the hardware in both parts. If the maintainers prefer one PR, #2360's UNORM / SNORM routine and this one give the same results for those codes.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7171441960 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2027#issuecomment-7171441960). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T18:49:08Z. --- @raylitebull On the two points: 1. **AMD run at `0cab3ef`:** I only have an RTX 3070, so this needs someone with a Radeon card. The earlier RX 6800M and RX 9070 runs were on `83d3d05` and `b0aae2e`. 2. **Against #2360 (D102):** both round a UNORM / SNORM code to f16 once, to nearest, and NWProgramming00 found both exact for every code of widths 2 to 16 ([#1607 comment](https://github.com/xcl-dev/xcl/issues/1607#issuecomment-7170937871)). They differ in the other non-integer channels. This PR truncates them to f16 (`f16_rtz`, in both backends). #2360 keeps `f32tof16`, which rounds to nearest. NWProgramming00 measured `buffer_load_format_d16_x` on an RDNA2 gfx1036 with 32_FLOAT: the hardware truncates (6,011 of 6,011 values match truncation, 3,028 match round-to-nearest). Separately, SlopTart's run of #2360 at `647932f` ([comment](https://github.com/xcl-dev/xcl/pull/2360#issuecomment-7171245773)) shows DXC refusing its prelude helper, because `snorm` is a reserved HLSL keyword used as a parameter name there. So on those measurements this PR matches the hardware in both parts. If the maintainers prefer one PR, #2360's UNORM / SNORM routine and this one give the same results for those codes. AI-assisted (Claude Code, Claude Opus 5.5).
DavidM1911 commented 2026-11-26 08:04:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T07:05:08Z.


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:7185079561 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2027#issuecomment-7185079561). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T07:05:08Z. --- 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
luckyteagirl commented 2026-11-26 10:06:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T09:44:00Z.


RX 6800M follow-up on exact head 0cab3ef3b46a9b522fd8838051f2c404baa5fa62, as requested. The detached checkout was clean, and the remote PR head was unchanged before and after the runs. Upstream main was b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7.

Tested

  • Windows 11 Home build 26200, Ryzen 9 5980HX, AMD Radeon RX 6800M (RDNA2, driver 30.0.13002.13003), Rust 1.99.0 MSVC, DXC/DXIL 1.8.2502.11 from Windows SDK 10.0.26100.0.
  • I set XCL_ADAPTER=6800M and XCL_REQUIRE_GPU=1, used an isolated Cargo target with incremental compilation and test debug info disabled, and ran the following once with XCL_DIRECT_DXIL=0 and once with XCL_DIRECT_DXIL=1.
cargo test --locked -p xcl --lib -j 1 gpu::recomp::tests::gpu_buffer_d16_loads_of_16_bit_norms_round_once -- --exact --test-threads=1 --nocapture
  • HLSL/DXC and Direct DXIL each exited 0 with 1 passed, 0 failed, 0 ignored, 1201 filtered out, 0 skip markers. The fixture checks 64 UNORM and 64 SNORM results bit for bit. The fixture does not print the adapter name. Windows enumerated the RX 6800M and integrated Radeon separately, and the runner requires a DXGI adapter matching the explicit 6800M selector.

Not tested

The full workspace suite, retail smoke, other adapters, and a matching run on main were outside this run.

AI use

OpenAI Codex (GPT-6.2 Sol) ran the focused tests, inspected the selector and logs, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7188396107 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2027#issuecomment-7188396107). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T09:44:00Z. --- RX 6800M follow-up on exact head `0cab3ef3b46a9b522fd8838051f2c404baa5fa62`, as requested. The detached checkout was clean, and the remote PR head was unchanged before and after the runs. Upstream main was `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`. **Tested** - Windows 11 Home build 26200, Ryzen 9 5980HX, AMD Radeon RX 6800M (RDNA2, driver `30.0.13002.13003`), Rust 1.99.0 MSVC, DXC/DXIL 1.8.2502.11 from Windows SDK 10.0.26100.0. - I set `XCL_ADAPTER=6800M` and `XCL_REQUIRE_GPU=1`, used an isolated Cargo target with incremental compilation and test debug info disabled, and ran the following once with `XCL_DIRECT_DXIL=0` and once with `XCL_DIRECT_DXIL=1`. ```powershell cargo test --locked -p xcl --lib -j 1 gpu::recomp::tests::gpu_buffer_d16_loads_of_16_bit_norms_round_once -- --exact --test-threads=1 --nocapture ``` - HLSL/DXC and Direct DXIL each exited 0 with **1 passed, 0 failed, 0 ignored, 1201 filtered out, 0 skip markers**. The fixture checks 64 UNORM and 64 SNORM results bit for bit. The fixture does not print the adapter name. Windows enumerated the RX 6800M and integrated Radeon separately, and the runner requires a DXGI adapter matching the explicit `6800M` selector. **Not tested** The full workspace suite, retail smoke, other adapters, and a matching run on main were outside this run. **AI use** OpenAI Codex (GPT-6.2 Sol) ran the focused tests, inspected the selector and logs, and drafted this report.
Decodere commented 2026-11-27 04:45:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T04:45:28Z.


Independent desktop NVIDIA verification of PR #2027 at head 0cab3ef3b46a9b522fd8838051f2c404baa5fa62 (2 commits: 2a4d3c8baf8150c6e06bc87cfa6897130267e805 -> 0cab3ef3b46a9b522fd8838051f2c404baa5fa62; exact parent & merge-base: 426a5a745db4d5e4b037449ede0b70cb342f5192, 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 (0cab3ef3)

Command Result
cargo test --release -p xcl --lib gpu_buffer_d16_loads_of_32_bit_floats_truncate -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1201 filtered out × 3 (0.27s, 0.22s, 0.22s, 0 skipped; live RTX 4060 execution)
cargo test --release -p xcl --lib gpu_buffer_d16_loads_of_16_bit_norms_round_once -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1201 filtered out × 3 (0.31s, 0.23s, 0.23s, 0 skipped; live RTX 4060 execution)
cargo test --release -p xcl --lib buffer_format_d16_packs_and_unpacks_halves -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1201 filtered out × 3 (0.09s × 3, 0 skipped)
cargo test --release -p xcl --lib gpu::dxil:: -- --test-threads=4 (3 consecutive runs) 147 passed; 0 failed; 3 ignored; 1052 filtered out × 3 (3.11s, 3.23s, 3.16s, 0 skipped)
cargo build --release -p xcl Clean build (1m 03s, exit 0, 0 new warnings)

Paired quiet 60 s retail smoke (title: 29640639)

Exact parent & merge-base (426a5a745db4d5e4b037449ede0b70cb342f5192, same machine):

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

PR #2027 (0cab3ef3b46a9b522fd8838051f2c404baa5fa62):

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

Runtime log observations (xcl.log)

  • 9203 log lines, 0 [ERROR] / device-removal / panic lines (dxil_cache: 449 hits, 11 misses, 11 compilations, 0 compilation failures; 228 background pipelines, 0 failures).
  • Final draw/memory telemetry in log: 19663 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample 14472 MB committed by the process; video memory 6115 MB local, 4683 MB non-local.

Limits of coverage

  • Both D16 format-load fixes (single-round nearest for 16-bit UNORM/SNORM and RTZ truncation for 32-bit floats) were directly exercised on desktop RTX 4060 via gpu_buffer_d16_loads_of_32_bit_floats_truncate (3/3), gpu_buffer_d16_loads_of_16_bit_norms_round_once (3/3), buffer_format_d16_packs_and_unpacks_halves (3/3), and gpu::dxil:: (147/147 × 3).
  • The 60 s retail smoke confirms zero runtime or shader-compilation regression (11 recompiled shaders, 0 failures; single-run frame/commit delta vs. parent reflects normal startup variance, not this PR); AMD/Intel host D16 hardware behavior was not tested here.

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

<!-- greyfinch-sync:ivall/xcl:comment:7210070002 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2027#issuecomment-7210070002). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-27T04:45:28Z. --- Independent desktop NVIDIA verification of **PR #2027** at head `0cab3ef3b46a9b522fd8838051f2c404baa5fa62` (`2` commits: `2a4d3c8baf8150c6e06bc87cfa6897130267e805` -> `0cab3ef3b46a9b522fd8838051f2c404baa5fa62`; exact parent & merge-base: `426a5a745db4d5e4b037449ede0b70cb342f5192`, 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 (`0cab3ef3`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib gpu_buffer_d16_loads_of_32_bit_floats_truncate -- --nocapture` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1201 filtered out` × 3 (`0.27s`, `0.22s`, `0.22s`, `0` skipped; live RTX 4060 execution) | | `cargo test --release -p xcl --lib gpu_buffer_d16_loads_of_16_bit_norms_round_once -- --nocapture` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1201 filtered out` × 3 (`0.31s`, `0.23s`, `0.23s`, `0` skipped; live RTX 4060 execution) | | `cargo test --release -p xcl --lib buffer_format_d16_packs_and_unpacks_halves -- --nocapture` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1201 filtered out` × 3 (`0.09s` × 3, `0` skipped) | | `cargo test --release -p xcl --lib gpu::dxil:: -- --test-threads=4` (3 consecutive runs) | `147 passed; 0 failed; 3 ignored; 1052 filtered out` × 3 (`3.11s`, `3.23s`, `3.16s`, `0` skipped) | | `cargo build --release -p xcl` | Clean build (`1m 03s`, exit `0`, `0` new warnings) | ### Paired quiet 60 s retail smoke (`title: 29640639`) Exact parent & merge-base (`426a5a745db4d5e4b037449ede0b70cb342f5192`, same machine): ``` xcl-smoke v1 commit: 426a5a745db4d5e4b037449ede0b70cb342f5192 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1591 (PresentX 1591) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14477 MB ``` PR #2027 (`0cab3ef3b46a9b522fd8838051f2c404baa5fa62`): ``` xcl-smoke v1 commit: 0cab3ef3b46a9b522fd8838051f2c404baa5fa62 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1616 (PresentX 1616) presents per 2 s (last 3): 60 60 61 device removals: 0 crashes: 0 peak commit: 14473 MB ``` ### Runtime log observations (`xcl.log`) - `9203` log lines, `0` `[ERROR]` / device-removal / panic lines (`dxil_cache`: `449` hits, `11` misses, `11` compilations, `0` compilation failures; `228` background pipelines, `0` failures). - Final draw/memory telemetry in log: `19663 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped)`; last memory sample `14472 MB committed by the process; video memory 6115 MB local, 4683 MB non-local`. ### Limits of coverage - Both D16 format-load fixes (single-round nearest for 16-bit UNORM/SNORM and RTZ truncation for 32-bit floats) were directly exercised on desktop RTX 4060 via `gpu_buffer_d16_loads_of_32_bit_floats_truncate` (`3/3`), `gpu_buffer_d16_loads_of_16_bit_norms_round_once` (`3/3`), `buffer_format_d16_packs_and_unpacks_halves` (`3/3`), and `gpu::dxil::` (`147/147` × 3). - The 60 s retail smoke confirms zero runtime or shader-compilation regression (`11` recompiled shaders, `0` failures; single-run frame/commit delta vs. parent reflects normal startup variance, not this PR); AMD/Intel host D16 hardware behavior was not tested here. *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
SzczepanGrela commented 2026-11-27 05:55:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SzczepanGrela on 2026-11-27T05:55:27Z.


RX 9070 / RADV / Wine exhaustive D16 buffer-load check of exact head 0cab3ef3b46a9b522fd8838051f2c404baa5fa62, current main c2ee10e4e905eb736e56953c52b749e18bcc7ede and the PR automatically applied to that main.

Tested

  • RX 9070 16 GB, RADV GFX1201 / Mesa 26.3.1-arch3.5, Ryzen 7 7700, CachyOS 7.3.0-5-cachyos. Windows GNU release executables, Rust 1.97.1, GE-Proton11-12 / Wine 11.0 Staging, native DXGI/D3D12 through vkd3d-proton 8293130ebe370b1+ (local asserts-disabled build), DXC/DXIL 1.9.2602.17.
  • Separate source copies, conflict-free three-way integration from parent 426a5a745db4d5e4b037449ede0b70cb342f5192. Test-only additions to recomp/tests.rs; production code and original assertions unchanged. Main gets the identical two new original tests.
  • Build each: cargo test --offline --locked --release --target x86_64-pc-windows-gnu -p xcl --lib --no-run --message-format=json-render-diagnostics.
  • Original filter: <unit.exe> gpu_buffer_d16_loads_of_ --nocapture --test-threads=1, then --test-threads=4, separately with XCL_DIRECT_DXIL=0 and =1.
Source Threads 1, either backend Threads 4, either backend
Main + identical tests 1 passed, 1 failed 1 passed, 1 failed
Exact head 2 passed, 0 failed 2 passed, 0 failed
Current-main integration 2 passed, 0 failed 2 passed, 0 failed

On main the normalized test reports 57/128 differing halves. The original 32_FLOAT test passes on all three sources on this stack.

Additional owned filter <unit.exe> workflow_d16_all_16bit_codes --nocapture --test-threads=1, three fresh processes per source. Every process checks all 65,536 input bit patterns for each of 16_UNORM and 16_SNORM, separately in native wave32 and native wave64, through both HLSL/DXC and direct DXIL. Each dispatch handles a bounded 32-row loop, stores the complete 32-bit D16 results to a separate output region and reads back the whole flat-memory allocation.

Source UNORM mismatches / 65,536 SNORM mismatches / 65,536
Main 31,740 30,716
Exact head 0 0
Current-main integration 0 0

These counts are identical for both backends, both wave sizes and all three repeats. Each owned head/integration run is 1 passed, 0 failed. Each main run is 0 passed, 1 failed, after collecting all configurations. For example, main loads UNORM 0x0801 as 0x2800; head/integration return the exact-reference 0x2801.

The reference rounds the exact rational u/65535 or max(s/32767,-1) by integer distance to adjacent IEEE-half values, including nearest-even ties. A separate Python implementation independently recomputes all references and GPU readbacks. Eight 32_FLOAT RTZ controls repeated over active lanes also match on all sources: 3f803000, 3f803800, 4788b800, c788b800, 477fff00, 33c00000, bfc00000, 7f800000.

Across the nine owned runs: 1,782 captured GPU dispatches, including 18 physical-width probes and 603 native-wave64 dispatches; 4,718,592 normalized outputs and 1,728 active-lane float controls. Independently checked 14,201,856 complete memory words, final address/result registers, zero upper halves, inactive lanes and out-of-output guards. Programs were independently re-encoded from the public ISA tables and loop bounds checked. Readbacks repeat byte-for-byte; exact-head and integration data match. 0 ignored, 0 skipped, no device-removal markers.

The known Int64 requirement remains: all eight D16 shader configurations on head/integration have SFI0 bit 0x8000, including the 32_FLOAT controls. This tests the posted head, without the separate 32-bit repair.

Inherited XCL_* cleared; XCL_NETWORK=0, RX 9070 selected, XCL_REQUIRE_GPU=wave64, XCL_DXC_THREADS=1; private enabled caches per process.

Not tested

Full suite, tbuffer/image D16 forms, other channel widths or DST_SEL combinations, split wave64, native Windows, other GPUs, the separate Int64-removal branch, retail workload, scripts/smoke.ps1, timing or FPS.

AI use

OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the diff, wrote the owned test-only matrix, ran comparisons, independently verified exact-rational half results, full readbacks, ISA encoding, guards, wave widths and source/executable provenance, and drafted this report. Publication authorized by the account owner.

<!-- greyfinch-sync:ivall/xcl:comment:7211061773 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2027#issuecomment-7211061773). Originally posted by [SzczepanGrela](https://github.com/SzczepanGrela) on 2026-11-27T05:55:27Z. --- RX 9070 / RADV / Wine exhaustive D16 buffer-load check of exact head `0cab3ef3b46a9b522fd8838051f2c404baa5fa62`, current main `c2ee10e4e905eb736e56953c52b749e18bcc7ede` and the PR automatically applied to that main. **Tested** - RX 9070 16 GB, RADV GFX1201 / Mesa `26.3.1-arch3.5`, Ryzen 7 7700, CachyOS `7.3.0-5-cachyos`. Windows GNU release executables, Rust `1.97.1`, GE-Proton11-12 / Wine 11.0 Staging, native DXGI/D3D12 through vkd3d-proton `8293130ebe370b1+` (local asserts-disabled build), DXC/DXIL `1.9.2602.17`. - Separate source copies, conflict-free three-way integration from parent `426a5a745db4d5e4b037449ede0b70cb342f5192`. Test-only additions to `recomp/tests.rs`; production code and original assertions unchanged. Main gets the identical two new original tests. - Build each: `cargo test --offline --locked --release --target x86_64-pc-windows-gnu -p xcl --lib --no-run --message-format=json-render-diagnostics`. - Original filter: `<unit.exe> gpu_buffer_d16_loads_of_ --nocapture --test-threads=1`, then `--test-threads=4`, separately with `XCL_DIRECT_DXIL=0` and `=1`. | Source | Threads 1, either backend | Threads 4, either backend | |---|---|---| | Main + identical tests | 1 passed, 1 failed | 1 passed, 1 failed | | Exact head | 2 passed, 0 failed | 2 passed, 0 failed | | Current-main integration | 2 passed, 0 failed | 2 passed, 0 failed | On main the normalized test reports **57/128** differing halves. The original 32_FLOAT test passes on all three sources on this stack. Additional owned filter `<unit.exe> workflow_d16_all_16bit_codes --nocapture --test-threads=1`, three fresh processes per source. Every process checks **all 65,536 input bit patterns for each of 16_UNORM and 16_SNORM**, separately in native wave32 and native wave64, through both HLSL/DXC and direct DXIL. Each dispatch handles a bounded 32-row loop, stores the complete 32-bit D16 results to a separate output region and reads back the whole flat-memory allocation. | Source | UNORM mismatches / 65,536 | SNORM mismatches / 65,536 | |---|---|---| | Main | 31,740 | 30,716 | | Exact head | 0 | 0 | | Current-main integration | 0 | 0 | These counts are identical for both backends, both wave sizes and all three repeats. Each owned head/integration run is **1 passed, 0 failed**. Each main run is **0 passed, 1 failed**, after collecting all configurations. For example, main loads UNORM `0x0801` as `0x2800`; head/integration return the exact-reference `0x2801`. The reference rounds the exact rational `u/65535` or `max(s/32767,-1)` by integer distance to adjacent IEEE-half values, including nearest-even ties. A separate Python implementation independently recomputes all references and GPU readbacks. Eight 32_FLOAT RTZ controls repeated over active lanes also match on all sources: `3f803000`, `3f803800`, `4788b800`, `c788b800`, `477fff00`, `33c00000`, `bfc00000`, `7f800000`. Across the nine owned runs: **1,782 captured GPU dispatches**, including 18 physical-width probes and **603 native-wave64 dispatches**; **4,718,592 normalized outputs** and 1,728 active-lane float controls. Independently checked 14,201,856 complete memory words, final address/result registers, zero upper halves, inactive lanes and out-of-output guards. Programs were independently re-encoded from the public ISA tables and loop bounds checked. Readbacks repeat byte-for-byte; exact-head and integration data match. **0 ignored, 0 skipped**, no device-removal markers. The known Int64 requirement remains: all eight D16 shader configurations on head/integration have SFI0 bit `0x8000`, including the 32_FLOAT controls. This tests the posted head, without the separate 32-bit repair. Inherited `XCL_*` cleared; `XCL_NETWORK=0`, RX 9070 selected, `XCL_REQUIRE_GPU=wave64`, `XCL_DXC_THREADS=1`; private enabled caches per process. **Not tested** Full suite, tbuffer/image D16 forms, other channel widths or DST_SEL combinations, split wave64, native Windows, other GPUs, the separate Int64-removal branch, retail workload, `scripts/smoke.ps1`, timing or FPS. **AI use** OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the diff, wrote the owned test-only matrix, ran comparisons, independently verified exact-rational half results, full readbacks, ISA encoding, guards, wave widths and source/executable provenance, and drafted this report. Publication authorized by the account owner.
throny commented 2026-11-28 03:16:30 +00:00 (Migrated from github.com)

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


merge-check claim
head: 0cab3ef3b4

<!-- greyfinch-sync:ivall/xcl:comment:7232939906 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2027#issuecomment-7232939906). Originally posted by [throny](https://github.com/throny) on 2026-11-28T03:16:30Z. --- merge-check claim head: 0cab3ef3b46a9b522fd8838051f2c404baa5fa62
throny commented 2026-11-28 03:30:26 +00:00 (Migrated from github.com)

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


merge-check
base: 753e8b1a
head: 0cab3ef3b4
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1514 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1512 passed, 0 failed, 47 ignored
review: the conversion is right by hand: exponent, round bit, the subnormal case, and why no tie can occur; SNORM's most negative value clamps to -1 as the test expects. One thing worth a line, not blocking: in the direct-DXIL lowering everything is computed for every channel and the result picked with a select; for a missing component or a 1-bit SNORM the shift amount is unmasked (up to 63, or -1), which makes the divisor 0 on the arm that is then discarded: an integer division by zero in dead-by-select code is formally undefined, although no driver showed it in the thread's runs. Main masks such shifts elsewhere.
performance: default path, limited to D16 format loads: each now pays a 64-bit unsigned divide and about 40 ALU operations, on the direct path also for float and integer formats because the format is a runtime value. Not measured here. It changes translator sources: every tester re-translates all shaders once.
verdict: safe to merge (masking that shift would be better)
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:7233128108 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2027#issuecomment-7233128108). Originally posted by [throny](https://github.com/throny) on 2026-11-28T03:30:26Z. --- merge-check base: 753e8b1a head: 0cab3ef3b46a9b522fd8838051f2c404baa5fa62 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1514 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1512 passed, 0 failed, 47 ignored review: the conversion is right by hand: exponent, round bit, the subnormal case, and why no tie can occur; SNORM's most negative value clamps to -1 as the test expects. One thing worth a line, not blocking: in the direct-DXIL lowering everything is computed for every channel and the result picked with a select; for a missing component or a 1-bit SNORM the shift amount is unmasked (up to 63, or -1), which makes the divisor 0 on the arm that is then discarded: an integer division by zero in dead-by-select code is formally undefined, although no driver showed it in the thread's runs. Main masks such shifts elsewhere. performance: default path, limited to D16 format loads: each now pays a 64-bit unsigned divide and about 40 ALU operations, on the direct path also for float and integer formats because the format is a runtime value. Not measured here. It changes translator sources: every tester re-translates all shaders once. verdict: safe to merge (masking that shift would be better) 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).
upipibi commented 2026-11-28 08:51:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-28T08:51:31Z.


@throny On the shift: agreed. In d16_fmt (gpu/dxil/lower_mem.rs), w is masked to 0-63 and we = w - 1 for SNORM. So w = 0 gives we = -1, a we of 32 or more makes the shl i32 1, we undefined, and we = 0 (UNORM with w = 0, or 1-bit SNORM) makes dmax = 0, so the udiv divides by zero. All of that is on the arm that use_n (2 <= w <= 16) then drops. Nothing failed on any card here, but a division by zero in LLVM IR is undefined even when its result is unused, so it is better masked.

I haven't pushed it, because a new head would drop the two smoke pairs and the checks on 0cab3ef. If a maintainer wants it before merging, it's two lines (andc and umax already exist in lower.rs), and it leaves every value inside 2..16 bits unchanged:

let we = self.sel(snorm, wm1, w);
let we = self.andc(we, 31);         // new: the shift stays in 0..31
let dmax = self.bin(BinOp::Shl, one, we);
let dmax = self.sub(dmax, one);
let dmax = self.umax(dmax, one);    // new: never divide by 0

With these, the dropped arm never divides by 0, and nothing else changes. Otherwise I'll leave it for a follow-up.

<!-- greyfinch-sync:ivall/xcl:comment:7236857014 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2027#issuecomment-7236857014). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-28T08:51:31Z. --- @throny On the shift: agreed. In `d16_fmt` (`gpu/dxil/lower_mem.rs`), `w` is masked to 0-63 and `we = w - 1` for SNORM. So `w = 0` gives `we = -1`, a `we` of 32 or more makes the `shl i32 1, we` undefined, and `we = 0` (UNORM with `w = 0`, or 1-bit SNORM) makes `dmax = 0`, so the `udiv` divides by zero. All of that is on the arm that `use_n` (2 <= `w` <= 16) then drops. Nothing failed on any card here, but a division by zero in LLVM IR is undefined even when its result is unused, so it is better masked. I haven't pushed it, because a new head would drop the two smoke pairs and the checks on `0cab3ef`. If a maintainer wants it before merging, it's two lines (`andc` and `umax` already exist in `lower.rs`), and it leaves every value inside 2..16 bits unchanged: ```rust let we = self.sel(snorm, wm1, w); let we = self.andc(we, 31); // new: the shift stays in 0..31 let dmax = self.bin(BinOp::Shl, one, we); let dmax = self.sub(dmax, one); let dmax = self.umax(dmax, one); // new: never divide by 0 ``` With these, the dropped arm never divides by 0, and nothing else changes. Otherwise I'll leave it for a follow-up.
KOLESNiii commented 2026-11-28 13:23:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T13:23:01Z.


merge-check claim
head: 0cab3ef3b4

<!-- greyfinch-sync:ivall/xcl:comment:7239896548 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2027#issuecomment-7239896548). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-28T13:23:01Z. --- merge-check claim head: 0cab3ef3b46a9b522fd8838051f2c404baa5fa62
KOLESNiii commented 2026-11-28 15:15:54 +00:00 (Migrated from github.com)

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


merge-check
base: b937fbab29
head: 0cab3ef3b4
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2142 passed, 1 failed, 48 ignored, 25 SKIPPED: 21 no wave64, 3 per-lane f16/f32 forms refused (#1426 semantics), 1 no heap windows; failing: gpu::dxil::msaa_tests::direct_msaa_loads_precede_get_dimensions: it fails on the base too (the base b937fbab's suite, run alone on this PC with the same command and its own target dir: 2140 passed, 1 failed, 48 ignored, 25 SKIPPED, this same test failing), and it also failed when rerun alone on this merge (msaa_tests.rs:299: "dx.op.getDimensions preceded dx.op.textureLoad in the same basic block"); not caused by this PR. The suite ran on this PC at the same time as 1 other PR's suite, in one queued job.
review: none. Whole diff read (lower_mem.rs d16_fmt and emit.rs d16_fmt / norm16_rep in PRELUDE_MEM: a D16 format load's UNORM / SNORM channel of 2-16 bits becomes code / (2^w - 1) rounded once to nearest f16, SNORM with w - 1 bits and the sign; every other non-integer channel truncates (f16_rtz) instead of the host's f32-to-f16; the three D16 load paths of the direct DXIL lowering and the HLSL one use it; recomp/tests.rs GPU test). Checked norm16_rep: exponent 14 - lzcnt(p), 10 mantissa bits plus a round bit with the carry into the exponent, subnormals as p >> 8 rounded at bit 7, 0 and full scale exact; the DXIL and HLSL forms compute the same thing.
performance: reasoned, not measured: D16 format loads of UNORM / SNORM data get a 64-bit division and some ALU per channel; other loads unchanged; translator output changes, so shaders with D16 format loads are translated again once.
verdict: safe to merge
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, debug test profile; trial merge 7070e8f460fb10af200d3d0fdeca5bfd25527d78 (local, not pushed). Claude Code: Claude Opus 5.5 (coordination, full-diff review, draft).

<!-- greyfinch-sync:ivall/xcl:comment:7241332396 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2027#issuecomment-7241332396). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-28T15:15:54Z. --- merge-check base: b937fbab2964b2c142f5d13662b91b00f99b9848 head: 0cab3ef3b46a9b522fd8838051f2c404baa5fa62 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2142 passed, 1 failed, 48 ignored, 25 SKIPPED: 21 no wave64, 3 per-lane f16/f32 forms refused (#1426 semantics), 1 no heap windows; failing: gpu::dxil::msaa_tests::direct_msaa_loads_precede_get_dimensions: it fails on the base too (the base b937fbab's suite, run alone on this PC with the same command and its own target dir: 2140 passed, 1 failed, 48 ignored, 25 SKIPPED, this same test failing), and it also failed when rerun alone on this merge (msaa_tests.rs:299: "dx.op.getDimensions preceded dx.op.textureLoad in the same basic block"); not caused by this PR. The suite ran on this PC at the same time as 1 other PR's suite, in one queued job. review: none. Whole diff read (lower_mem.rs d16_fmt and emit.rs d16_fmt / norm16_rep in PRELUDE_MEM: a D16 format load's UNORM / SNORM channel of 2-16 bits becomes code / (2^w - 1) rounded once to nearest f16, SNORM with w - 1 bits and the sign; every other non-integer channel truncates (f16_rtz) instead of the host's f32-to-f16; the three D16 load paths of the direct DXIL lowering and the HLSL one use it; recomp/tests.rs GPU test). Checked norm16_rep: exponent 14 - lzcnt(p), 10 mantissa bits plus a round bit with the carry into the exponent, subnormals as p >> 8 rounded at bit 7, 0 and full scale exact; the DXIL and HLSL forms compute the same thing. performance: reasoned, not measured: D16 format loads of UNORM / SNORM data get a 64-bit division and some ALU per channel; other loads unchanged; translator output changes, so shaders with D16 format loads are translated again once. verdict: safe to merge 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, debug test profile; trial merge 7070e8f460fb10af200d3d0fdeca5bfd25527d78 (local, not pushed). Claude Code: Claude Opus 5.5 (coordination, full-diff review, draft).
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!2017
No description provided.