Recompiler: float16 interpolants packed two per dword reach the PS per half #2503

Open
MacieGx wants to merge 2 commits from upstream-pr/2513 into main
MacieGx commented 2026-11-25 21:14:19 +00:00 (Migrated from github.com)

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


A retail title (#505) packs its float16 interpolants: two components per dword and up to two signature registers per exp param / v_interp attrN. XCL refused the FSSM tables of such programs (PS input table, VS / mesh output table), fell back to "the N-th register", and so every attribute after a pair read its neighbour's register, plain ones included; a packed dword went raw into one register, and the PS converted it as one float. This PR reads the packing from the tables and unpacks it on both sides, in both translators (HLSL and direct DXIL).

Part of #505.

The console layout, as this PR reads it:

  • component c of a register sits in dword c / 2, the even component in the low half; the PS reads a half with v_interp_p2_f16 (SRC0 bit 8 = the high half);
  • the second register of a pair follows the dwords the first one takes: dword 1 after a .xy register, dwords 2-3 after .xyz / .xyzw;
  • PS input records [6, reg, mask, attr, 0, reg2, packed reg, flags]: flag 8 = float16, flag 16 = byte 5 names the second register; a record that repeats its own register pairs with the next float16 register no other record names;
  • VS / MS output records [6, reg, param, reg, 0, 1 | 3] (1 = float16, 3 = more than one dword): the table does not name the second register, so it is the next float16 register that starts no param of its own.

Evidence, from the programs dumped from a run of the title (no game data in this PR): the exp param enable masks of all 383 packed params in 442 mesh shaders are exactly the predicted dwords; every v_interp_p2_f16 (dword, half) of 376 of the 378 packed PS attribute reads in 362 pixel shaders is a declared component (the other 2 read one half past a .xy register). Programs without a table, and tables without float16 records, are translated as before, except that a mesh program with a table now takes its params' registers from it, as a VS already did.

What is in it

  • Recompiler: a PS reads float16 attributes packed two per dword per half: the PS input table parses the float16 / pair flags and each (dword, half) maps to its element and component (f16_registers, ps_attribute_f16, ps_f16_slot in crates/xcl/src/gpu/recomp/mod.rs); the PS reads that component as a float with the attribute's own interpolation mode (recomp/emit.rs, dxil/lower_gfx.rs). Tests: attribute_tests::f16_packed_attributes (recomp/mod.rs), dxil::core_tests::f16_packed_attributes_interpolate_per_half (dxil/core_tests.rs).
  • Recompiler: VS / mesh exports unpack float16 params packed two per dword: the VS / MS output table parses float16 params (OutParam, MsInterface::params, out_param_registers, out_param_elements in recomp/mod.rs); VS and mesh exports write each half as a float to its own component (recomp/emit.rs, dxil/lower_gfx.rs, dxil/lower_mem.rs, dxil/lower.rs, dxil/kernel.rs); the new MsInterface field in hle/d3d12x/real.rs and recomp/heap_window_tests.rs. Tests: attribute_tests::f16_packed_params, recomp::tests::gpu_mesh_f16_packed_params (recomp/tests.rs), and the VS side of f16_packed_attributes_interpolate_per_half.

494 lines added, 47 removed, about 300 of the added lines tests. The two commits are one feature (the PS side alone still reads raw packed dwords from the VS / MS), split by side so each builds and passes on its own.

Tested

  • NVIDIA GeForce RTX 5080 (driver 621.24, 32-lane waves), AMD Ryzen 7 5800X3D, Windows 11 Pro 10.0.26200, Rust 1.100.0, release builds.
  • cargo build --release --workspace at each commit: OK.
  • First commit: cargo test --release -p xcl --lib -- --test-threads=4 gpu::: 698 passed, 4 failed, 22 ignored (the 4 are fuzz_validate_and_gpu_0..3, below); its two new tests pass.
  • Head: the four new tests pass (cargo test --release -p xcl --lib f16_packed: 4 passed, 0 failed; gpu_mesh_f16_packed_params ran on the GPU, not skipped).
  • Head: cargo test --release --workspace --no-fail-fast -- --test-threads=4: 1423 passed, 4 failed, 46 ignored. The 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (CreateComputePipelineState E_OUTOFMEMORY); they fail the same way on main 6d12f58 on this machine, and alone.
  • SKIPPED (16 tests): no wave64 on this adapter: dispatch_chain_native_wave64_builds_whole, lower::tests::{a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu}, lower_dxil::tests::{a_per_lane_2d_or_3d_group_runs_on_the_gpu, const_and_null_mask_operands_agree_with_hlsl_on_the_gpu, f64_programs_on_the_gpu, integer_programs_on_the_gpu, mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu}, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware; f16_programs_on_the_gpu / f32_programs_on_the_gpu: their wave64 cases (no wave64) and three wave32 per-lane cases refused (#1426 semantics); heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows; pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (needs Developer Mode).

Relation to #1975 / #1976

  • #1975 (and #1976 on top of it) carried a float16 interpolant packing too; raylitebull removed it from both and deferred it to this branch after the review in https://github.com/xcl-dev/xcl/pull/1975#issuecomment-7161424965. The differences from that version: the second register follows the first one's dwords (#1975 always put it in dwords 2-3, wrong after a .xy register); a PS record that repeats its register pairs with the next unnamed float16 register (#1976 read the same register's .zw); mesh programs pair by their output table (#1975 guessed without it); programs without a table are left as today (#1975 paired 16-bit elements greedily in any title).
  • Merges: with #1975's head 7296038 without conflicts. #1976's head 2e7debd conflicts in dxil/kernel.rs / dxil/lower.rs (neighbouring lines of the mesh setup), and its test direct_dxil_mixed_fp16_interp_preserves_half_across_ssa_phi builds a PsAttr without the fields added here; #2112 conflicts in dxil/lower_gfx.rs. Whichever lands second needs a small rebase.

Regression run

xcl-smoke v1
commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb
gpu: NVIDIA GeForce RTX 5080
title: 16b5e5d4
seconds: 60
exit: 0x0
frames shown: 1383 (PresentX 1383)
presents per 2 s (last 3): 35 52 56
device removals: 0
crashes: 0
peak commit: 19703 MB

this PR:

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

Not tested

  • AMD and Intel GPUs (wave64 paths), debug builds.
  • The effect in the title: only measured on a local branch where the title reaches its world (normal targets become per-pixel instead of flat per surface), not on a build of this PR alone; the regression run checks for regressions only.
  • HANDOFF.md's description of the FSSM records (PS 0, 0, register, 1 flat / 2 interpolated; VS kind, register, param) does not cover the float16 flags read here; not edited.

AI use

  • Claude Code. Claude Opus 5.5 coordinated; a Claude Fable 5.2 subagent found the layout in the dumped programs and wrote the change and its tests; a Claude Opus 5.5 subagent ported it to main, split it into the two commits, ran the tests and wrote this description.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5499286598 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2513). Originally posted by [MacieGx](https://github.com/MacieGx) on 2026-11-25T21:14:19Z. --- A retail title (#505) packs its float16 interpolants: two components per dword and up to two signature registers per `exp param` / `v_interp attrN`. XCL refused the FSSM tables of such programs (PS input table, VS / mesh output table), fell back to "the N-th register", and so every attribute after a pair read its neighbour's register, plain ones included; a packed dword went raw into one register, and the PS converted it as one float. This PR reads the packing from the tables and unpacks it on both sides, in both translators (HLSL and direct DXIL). Part of #505. The console layout, as this PR reads it: - component c of a register sits in dword c / 2, the even component in the low half; the PS reads a half with `v_interp_p2_f16` (SRC0 bit 8 = the high half); - the second register of a pair follows the dwords the first one takes: dword 1 after a `.xy` register, dwords 2-3 after `.xyz` / `.xyzw`; - PS input records `[6, reg, mask, attr, 0, reg2, packed reg, flags]`: flag 8 = float16, flag 16 = byte 5 names the second register; a record that repeats its own register pairs with the next float16 register no other record names; - VS / MS output records `[6, reg, param, reg, 0, 1 | 3]` (1 = float16, 3 = more than one dword): the table does not name the second register, so it is the next float16 register that starts no param of its own. Evidence, from the programs dumped from a run of the title (no game data in this PR): the `exp param` enable masks of all 383 packed params in 442 mesh shaders are exactly the predicted dwords; every `v_interp_p2_f16` (dword, half) of 376 of the 378 packed PS attribute reads in 362 pixel shaders is a declared component (the other 2 read one half past a `.xy` register). Programs without a table, and tables without float16 records, are translated as before, except that a mesh program with a table now takes its params' registers from it, as a VS already did. **What is in it** - `Recompiler: a PS reads float16 attributes packed two per dword per half`: the PS input table parses the float16 / pair flags and each (dword, half) maps to its element and component (`f16_registers`, `ps_attribute_f16`, `ps_f16_slot` in `crates/xcl/src/gpu/recomp/mod.rs`); the PS reads that component as a float with the attribute's own interpolation mode (`recomp/emit.rs`, `dxil/lower_gfx.rs`). Tests: `attribute_tests::f16_packed_attributes` (`recomp/mod.rs`), `dxil::core_tests::f16_packed_attributes_interpolate_per_half` (`dxil/core_tests.rs`). - `Recompiler: VS / mesh exports unpack float16 params packed two per dword`: the VS / MS output table parses float16 params (`OutParam`, `MsInterface::params`, `out_param_registers`, `out_param_elements` in `recomp/mod.rs`); VS and mesh exports write each half as a float to its own component (`recomp/emit.rs`, `dxil/lower_gfx.rs`, `dxil/lower_mem.rs`, `dxil/lower.rs`, `dxil/kernel.rs`); the new `MsInterface` field in `hle/d3d12x/real.rs` and `recomp/heap_window_tests.rs`. Tests: `attribute_tests::f16_packed_params`, `recomp::tests::gpu_mesh_f16_packed_params` (`recomp/tests.rs`), and the VS side of `f16_packed_attributes_interpolate_per_half`. 494 lines added, 47 removed, about 300 of the added lines tests. The two commits are one feature (the PS side alone still reads raw packed dwords from the VS / MS), split by side so each builds and passes on its own. **Tested** - NVIDIA GeForce RTX 5080 (driver 621.24, 32-lane waves), AMD Ryzen 7 5800X3D, Windows 11 Pro 10.0.26200, Rust 1.100.0, release builds. - `cargo build --release --workspace` at each commit: OK. - First commit: `cargo test --release -p xcl --lib -- --test-threads=4 gpu::`: 698 passed, 4 failed, 22 ignored (the 4 are `fuzz_validate_and_gpu_0..3`, below); its two new tests pass. - Head: the four new tests pass (`cargo test --release -p xcl --lib f16_packed`: 4 passed, 0 failed; `gpu_mesh_f16_packed_params` ran on the GPU, not skipped). - Head: `cargo test --release --workspace --no-fail-fast -- --test-threads=4`: 1423 passed, 4 failed, 46 ignored. The 4 failures are `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3` (`CreateComputePipelineState` E_OUTOFMEMORY); they fail the same way on `main` `6d12f58` on this machine, and alone. - SKIPPED (16 tests): `no wave64` on this adapter: `dispatch_chain_native_wave64_builds_whole`, `lower::tests::{a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu}`, `lower_dxil::tests::{a_per_lane_2d_or_3d_group_runs_on_the_gpu, const_and_null_mask_operands_agree_with_hlsl_on_the_gpu, f64_programs_on_the_gpu, integer_programs_on_the_gpu, mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu}`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`; `f16_programs_on_the_gpu` / `f32_programs_on_the_gpu`: their wave64 cases (`no wave64`) and three wave32 per-lane cases refused (#1426 semantics); `heap_window_out_of_memory_falls_back_to_the_switch_form`: no heap windows; `pso_measurement_compiles_an_exact_synthetic_record`: cannot disable the driver cache (needs Developer Mode). **Relation to #1975 / #1976** - #1975 (and #1976 on top of it) carried a float16 interpolant packing too; raylitebull removed it from both and deferred it to this branch after the review in https://github.com/xcl-dev/xcl/pull/1975#issuecomment-7161424965. The differences from that version: the second register follows the first one's dwords (#1975 always put it in dwords 2-3, wrong after a `.xy` register); a PS record that repeats its register pairs with the next unnamed float16 register (#1976 read the same register's `.zw`); mesh programs pair by their output table (#1975 guessed without it); programs without a table are left as today (#1975 paired 16-bit elements greedily in any title). - Merges: with #1975's head `7296038` without conflicts. #1976's head `2e7debd` conflicts in `dxil/kernel.rs` / `dxil/lower.rs` (neighbouring lines of the mesh setup), and its test `direct_dxil_mixed_fp16_interp_preserves_half_across_ssa_phi` builds a `PsAttr` without the fields added here; #2112 conflicts in `dxil/lower_gfx.rs`. Whichever lands second needs a small rebase. **Regression run** ``` xcl-smoke v1 commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb gpu: NVIDIA GeForce RTX 5080 title: 16b5e5d4 seconds: 60 exit: 0x0 frames shown: 1383 (PresentX 1383) presents per 2 s (last 3): 35 52 56 device removals: 0 crashes: 0 peak commit: 19703 MB ``` this PR: ``` xcl-smoke v1 commit: 3bc875816e45550c3aaa6d44da3b3922b82d18e3 gpu: NVIDIA GeForce RTX 5080 title: 16b5e5d4 seconds: 60 exit: 0x0 frames shown: 1594 (PresentX 1594) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14983 MB ``` **Not tested** - AMD and Intel GPUs (wave64 paths), debug builds. - The effect in the title: only measured on a local branch where the title reaches its world (normal targets become per-pixel instead of flat per surface), not on a build of this PR alone; the regression run checks for regressions only. - `HANDOFF.md`'s description of the FSSM records (PS `0, 0, register, 1 flat / 2 interpolated`; VS `kind, register, param`) does not cover the float16 flags read here; not edited. **AI use** - Claude Code. Claude Opus 5.5 coordinated; a Claude Fable 5.2 subagent found the layout in the dumped programs and wrote the change and its tests; a Claude Opus 5.5 subagent ported it to `main`, split it into the two commits, ran the tests and wrote this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
DavidM1911 commented 2026-11-25 22:06:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T21:32:01Z.


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:7175203388 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2513#issuecomment-7175203388). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T21:32:01Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
DarkPanda69 commented 2026-11-25 22:06:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DarkPanda69 on 2026-11-25T21:36:17Z.


AMD wave64 and debug-build run (both listed as untested), plus an RTX 3060: all 4 new tests pass on both cards, with and without the direct translator, and nothing else changes.

Head 3bc8758 applied on main 6d12f58, debug build, Windows 11 Pro 26200, card chosen with XCL_ADAPTER, cargo test -p xcl --lib -- gpu:: --test-threads=4 on main and with the PR:

  • RX 9070 XT (RDNA4, driver 32.0.32029.2010): gpu_mesh_f16_packed_params ok; it translates with wave64: true and no split, so on this card it runs native wave64. 702 passed, 2 failed, 6 SKIPPED (the same as main). The 2 failures are the AMD fuzz seeds tracked in #2115, the same on main.
  • RTX 3060 (driver 32.0.16.1088): gpu_mesh_f16_packed_params ok; 704 passed, 0 failed, 24 SKIPPED (the same as main).
  • With XCL_DIRECT_DXIL=1, the only result changes against main, on both cards, are the new f16_packed_attributes_interpolate_per_half, f16_packed_attributes, f16_packed_params and gpu_mesh_f16_packed_params, all ok. No existing test changes.

Not tested: the title, Intel, release build.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7175298298 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2513#issuecomment-7175298298). Originally posted by [DarkPanda69](https://github.com/DarkPanda69) on 2026-11-25T21:36:17Z. --- AMD wave64 and debug-build run (both listed as untested), plus an RTX 3060: all 4 new tests pass on both cards, with and without the direct translator, and nothing else changes. Head `3bc8758` applied on `main` `6d12f58`, **debug** build, Windows 11 Pro 26200, card chosen with `XCL_ADAPTER`, `cargo test -p xcl --lib -- gpu:: --test-threads=4` on `main` and with the PR: - **RX 9070 XT** (RDNA4, driver 32.0.32029.2010): `gpu_mesh_f16_packed_params` ok; it translates with `wave64: true` and no split, so on this card it runs native wave64. 702 passed, 2 failed, 6 SKIPPED (the same as `main`). The 2 failures are the AMD fuzz seeds tracked in #2115, the same on `main`. - **RTX 3060** (driver 32.0.16.1088): `gpu_mesh_f16_packed_params` ok; 704 passed, 0 failed, 24 SKIPPED (the same as `main`). - With `XCL_DIRECT_DXIL=1`, the only result changes against `main`, on both cards, are the new `f16_packed_attributes_interpolate_per_half`, `f16_packed_attributes`, `f16_packed_params` and `gpu_mesh_f16_packed_params`, all ok. No existing test changes. Not tested: the title, Intel, release build. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
emirduran707 commented 2026-11-25 22:06:52 +00:00 (Migrated from github.com)

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


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

Tested

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

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

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

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

Not tested

  • D3D12 debug layer; Intel GPUs.

AI use

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

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T22:33:03Z.


Tested: current PR head merged onto current origin/main (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target x86_64-pc-windows-gnu run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).

gpu_ suite (cold cache): 165 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.
Targeted run of the packed-f16 interpolant tests (f16_packed family): 4 passed.

Not tested: retail titles (no title data on this lane, counts only).

AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7176502579 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2513#issuecomment-7176502579). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-25T22:33:03Z. --- **Tested**: current PR head merged onto current `origin/main` (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target `x86_64-pc-windows-gnu` run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29). `gpu_` suite (cold cache): 165 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR. Targeted run of the packed-f16 interpolant tests (`f16_packed` family): 4 passed. **Not tested**: retail titles (no title data on this lane, counts only). **AI use**: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
itsSio commented 2026-11-26 05:05:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by itsSio on 2026-11-26T04:22:26Z.


Independent dual-PC NVIDIA full-workspace test report on clean head 3bc875816e45550c3aaa6d44da3b3922b82d18e3.

Tested

  • Machine 1: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro build 26200, rustc 1.97.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug build (XCL_ADAPTER=NVIDIA)
    • cargo build --workspace: exit 0
    • cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1427 passed, 0 failed, 46 ignored (dxil::core_tests::f16_packed_attributes_interpolate_per_half, recomp::attribute_tests::f16_packed_attributes, recomp::attribute_tests::f16_packed_params, and GPU recomp::tests::gpu_mesh_f16_packed_params all pass)
    • SKIPPED: 26 (wave64-only GPU tests, #1426 wave32 f16/cvt refusals, heap_window_out_of_memory_falls_back_to_the_switch_form, pso_measurement_compiles_an_exact_synthetic_record)
  • Machine 2: NVIDIA GeForce RTX 2080 SUPER (driver 32.0.16.1088), AMD Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro build 26200, rustc 1.99.1 (stable-x86_64-pc-windows-msvc), Windows SDK 10.0.26100 DXC 1.8.2502.11, debug build (XCL_ADAPTER=NVIDIA)
    • cargo build --workspace: exit 0
    • cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1427 passed, 0 failed, 46 ignored (all 4 f16 attribute/GPU tests pass)
    • SKIPPED: 29 (same 26 as Machine 1 plus 3 requiring d3d12SDKLayers.dll)

Not tested

  • Retail title / scripts/smoke.ps1 runs
  • Release builds (--release)
  • AMD / Intel GPUs, native wave64, Linux / Wine / vkd3d-proton

AI use
Ran via Samaritan:

  • Google Antigravity CLI (Claude Opus 5.5 (High)): built the branch and ran the workspace test suite on both NVIDIA machines.
  • Google Antigravity CLI (Gemini 4 Neon (High)): coordinated the runs and wrote this test report.
<!-- greyfinch-sync:ivall/xcl:comment:7182537989 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2513#issuecomment-7182537989). Originally posted by [itsSio](https://github.com/itsSio) on 2026-11-26T04:22:26Z. --- Independent dual-PC NVIDIA full-workspace test report on clean head `3bc875816e45550c3aaa6d44da3b3922b82d18e3`. **Tested** - **Machine 1:** NVIDIA GeForce RTX 5080 (driver `32.0.16.1088`), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro build 26200, `rustc 1.97.0` (`stable-x86_64-pc-windows-msvc`), DXC `1.9.2609.5`, debug build (`XCL_ADAPTER=NVIDIA`) - `cargo build --workspace`: exit 0 - `cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture`: **1427 passed, 0 failed, 46 ignored** (`dxil::core_tests::f16_packed_attributes_interpolate_per_half`, `recomp::attribute_tests::f16_packed_attributes`, `recomp::attribute_tests::f16_packed_params`, and GPU `recomp::tests::gpu_mesh_f16_packed_params` all pass) - `SKIPPED`: 26 (wave64-only GPU tests, `#1426` wave32 f16/cvt refusals, `heap_window_out_of_memory_falls_back_to_the_switch_form`, `pso_measurement_compiles_an_exact_synthetic_record`) - **Machine 2:** NVIDIA GeForce RTX 2080 SUPER (driver `32.0.16.1088`), AMD Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro build 26200, `rustc 1.99.1` (`stable-x86_64-pc-windows-msvc`), Windows SDK 10.0.26100 DXC `1.8.2502.11`, debug build (`XCL_ADAPTER=NVIDIA`) - `cargo build --workspace`: exit 0 - `cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture`: **1427 passed, 0 failed, 46 ignored** (all 4 f16 attribute/GPU tests pass) - `SKIPPED`: 29 (same 26 as Machine 1 plus 3 requiring `d3d12SDKLayers.dll`) **Not tested** - Retail title / `scripts/smoke.ps1` runs - Release builds (`--release`) - AMD / Intel GPUs, native wave64, Linux / Wine / vkd3d-proton **AI use** Ran via Samaritan: - Google Antigravity CLI (Claude Opus 5.5 (High)): built the branch and ran the workspace test suite on both NVIDIA machines. - Google Antigravity CLI (Gemini 4 Neon (High)): coordinated the runs and wrote this test report.
luckyteagirl commented 2026-11-26 07:27:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T07:27:52Z.

Review: COMMENTED


gpu/recomp/mod.rs:500: ps_f16_slot falls back to any element at the register when its mask excludes the requested half. That makes an absent packed component read the PC producer's value instead of zero. The new f16_packed_attributes_interpolate_per_half fixture already requests TEXCOORD1.w and expects zero, but its PC VS writes zero there, so it cannot distinguish the paths.

On the exact head 3bc875816e45550c3aaa6d44da3b3922b82d18e3, I changed only that fixture's PC VS TEXCOORD1.w from 0.0 to 0.75 (and put the direct PS pair first for a second run), leaving the expected zero unchanged. With XCL_ADAPTER=6800M, XCL_REQUIRE_GPU=1, the focused test failed in both separate runs: PC VS + HLSL PS and PC VS + direct PS each returned 0.75 for the absent component at pixel (0,0), expected 0.0 (exit 101, 1 failed/1,327 filtered each). The HLSL path indexes component 3 and direct DXIL loads that column. Could the lookup return None for an undeclared half and retain the strengthened fixture so both translators take their zero path?

This is a focused modified-fixture GPU result, not a retail-title run or full-suite result. AI-assisted review with Codex.

<!-- greyfinch-sync:ivall/xcl:review:6070037284 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2513#pullrequestreview-6070037284). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T07:27:52Z. **Review:** COMMENTED --- `gpu/recomp/mod.rs:500`: `ps_f16_slot` falls back to any element at the register when its mask excludes the requested half. That makes an absent packed component read the PC producer's value instead of zero. The new `f16_packed_attributes_interpolate_per_half` fixture already requests `TEXCOORD1.w` and expects zero, but its PC VS writes zero there, so it cannot distinguish the paths. On the exact head `3bc875816e45550c3aaa6d44da3b3922b82d18e3`, I changed only that fixture's PC VS `TEXCOORD1.w` from `0.0` to `0.75` (and put the direct PS pair first for a second run), leaving the expected zero unchanged. With `XCL_ADAPTER=6800M`, `XCL_REQUIRE_GPU=1`, the focused test failed in both separate runs: `PC VS + HLSL PS` and `PC VS + direct PS` each returned `0.75` for the absent component at pixel (0,0), expected `0.0` (exit 101, 1 failed/1,327 filtered each). The HLSL path indexes component 3 and direct DXIL loads that column. Could the lookup return `None` for an undeclared half and retain the strengthened fixture so both translators take their zero path? This is a focused modified-fixture GPU result, not a retail-title run or full-suite result. AI-assisted review with Codex.
MacieGx commented 2026-11-26 13:05:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by MacieGx on 2026-11-26T12:18:35Z.


@raylitebull since you deferred the float16 part of #1975 to this PR: its CI run (and those of #1385, #2229, #2246, #2753 from the same fork) is waiting for workflow approval (action_required), so the required Build and test check never ran. Could you approve the runs when you have a moment? Details in #1833.

AI use: Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7191836044 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2513#issuecomment-7191836044). Originally posted by [MacieGx](https://github.com/MacieGx) on 2026-11-26T12:18:35Z. --- @raylitebull since you deferred the float16 part of #1975 to this PR: its `CI` run (and those of #1385, #2229, #2246, #2753 from the same fork) is waiting for workflow approval (`action_required`), so the required `Build and test` check never ran. Could you approve the runs when you have a moment? Details in #1833. AI use: Claude Code (Claude Opus 5.5).
Decodere commented 2026-11-27 03:31:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T03:31:30Z.


Independent desktop NVIDIA (Wave32-only Ada) verification of PR #2513 at head 3bc875816e45550c3aaa6d44da3b3922b82d18e3 (2 commits d7ba3cd7 -> 3bc87581; exact merge-base: 6d12f58a229bc73889878a448c64dc3af25eeba0, 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 (3bc87581)

Command Result
cargo test --release -p xcl --lib f16_packed_attributes_interpolate_per_half -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1327 filtered out × 3 (0.89s, 0.82s, 0.81s, 0 skipped — live RTX 4060 + DXC 1.9.2609.5)
cargo test --release -p xcl --lib f16_packed_attributes -- --nocapture (3 consecutive runs; executes both f16_packed_attributes and f16_packed_attributes_interpolate_per_half) 2 passed; 0 failed; 0 ignored; 1326 filtered out × 3 (0.81s, 0.82s, 0.84s, 0 skipped)
cargo test --release -p xcl --lib f16_packed_params -- --nocapture (3 consecutive runs; executes both f16_packed_params and gpu_mesh_f16_packed_params) 2 passed; 0 failed; 0 ignored; 1326 filtered out × 3 (0.32s, 0.25s, 0.25s, 0 skipped)
cargo test --release -p xcl --lib gpu_mesh_f16_packed_params -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1327 filtered out × 3 (0.25s, 0.24s, 0.25s, 0 skipped — live RTX 4060 mesh-shader execution)
cargo test --release -p xcl --lib gpu::dxil:: -- --test-threads=4 (3 consecutive runs) 184 passed; 0 failed; 3 ignored; 1141 filtered out × 3 (4.01s, 4.05s, 4.02s; 183 executed + 1 expected Wave32-only skip dispatch_chain_native_wave64_builds_whole: no wave64)
cargo test --release -p xcl --lib gpu::recomp:: -- --test-threads=4 (3 consecutive runs) 395 passed; 0 failed; 19 ignored; 914 filtered out × 3 (5.89s, 6.13s, 5.90s; 372 executed + 23 expected Wave32-only/env skips)
cargo build --release -p xcl Clean build (1m 08s, exit 0, 0 new warnings)

Paired quiet 60 s retail smoke (title: 29640639)

Exact merge-base (6d12f58a229bc73889878a448c64dc3af25eeba0, cached baseline on the same machine):

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

PR #2513 (3bc875816e45550c3aaa6d44da3b3922b82d18e3):

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

Runtime log observations (xcl.log)

  • 9223 log lines, 0 [ERROR] / device-removal / panic lines.
  • Final draw/memory telemetry in log: 19531 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample 13988 MB committed by the process; video memory 6116 MB local, 4651 MB non-local.

Limits of coverage

  • Packed two-per-dword float16 VS/mesh exports and per-half PS attribute interpolation were directly executed end-to-end on desktop RTX 4060 + DXC 1.9.2609.5 via all 4 new tests (f16_packed_attributes, f16_packed_attributes_interpolate_per_half, f16_packed_params, gpu_mesh_f16_packed_params, 3/3 each with 0 skips), gpu::dxil:: (183 executed + 1 expected no wave64 skip × 3), and gpu::recomp:: (372 executed + 23 expected Wave32-only/env skips × 3).
  • Native Wave64 GPU execution is not available on this Wave32-only RTX 4060, and the warm-cache 60 s retail smoke on title: 29640639 confirms zero runtime regression rather than recompiling a cold retail VS/MS/PS shader set (frame-count delta vs. cached merge-base reflects single-run startup variance, not this PR).

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

<!-- greyfinch-sync:ivall/xcl:comment:7209057201 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2513#issuecomment-7209057201). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-27T03:31:30Z. --- Independent desktop NVIDIA (Wave32-only Ada) verification of **PR #2513** at head `3bc875816e45550c3aaa6d44da3b3922b82d18e3` (`2` commits `d7ba3cd7 -> 3bc87581`; exact merge-base: `6d12f58a229bc73889878a448c64dc3af25eeba0`, 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 (`3bc87581`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib f16_packed_attributes_interpolate_per_half -- --nocapture` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1327 filtered out` × 3 (`0.89s`, `0.82s`, `0.81s`, `0` skipped — live RTX 4060 + DXC `1.9.2609.5`) | | `cargo test --release -p xcl --lib f16_packed_attributes -- --nocapture` (3 consecutive runs; executes both `f16_packed_attributes` and `f16_packed_attributes_interpolate_per_half`) | `2 passed; 0 failed; 0 ignored; 1326 filtered out` × 3 (`0.81s`, `0.82s`, `0.84s`, `0` skipped) | | `cargo test --release -p xcl --lib f16_packed_params -- --nocapture` (3 consecutive runs; executes both `f16_packed_params` and `gpu_mesh_f16_packed_params`) | `2 passed; 0 failed; 0 ignored; 1326 filtered out` × 3 (`0.32s`, `0.25s`, `0.25s`, `0` skipped) | | `cargo test --release -p xcl --lib gpu_mesh_f16_packed_params -- --nocapture` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1327 filtered out` × 3 (`0.25s`, `0.24s`, `0.25s`, `0` skipped — live RTX 4060 mesh-shader execution) | | `cargo test --release -p xcl --lib gpu::dxil:: -- --test-threads=4` (3 consecutive runs) | `184 passed; 0 failed; 3 ignored; 1141 filtered out` × 3 (`4.01s`, `4.05s`, `4.02s`; `183` executed + `1` expected Wave32-only skip `dispatch_chain_native_wave64_builds_whole: no wave64`) | | `cargo test --release -p xcl --lib gpu::recomp:: -- --test-threads=4` (3 consecutive runs) | `395 passed; 0 failed; 19 ignored; 914 filtered out` × 3 (`5.89s`, `6.13s`, `5.90s`; `372` executed + `23` expected Wave32-only/env skips) | | `cargo build --release -p xcl` | Clean build (`1m 08s`, exit `0`, `0` new warnings) | ### Paired quiet 60 s retail smoke (`title: 29640639`) Exact merge-base (`6d12f58a229bc73889878a448c64dc3af25eeba0`, cached baseline on the same machine): ``` xcl-smoke v1 commit: 6d12f58a229bc73889878a448c64dc3af25eeba0 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1606 (PresentX 1606) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14004 MB ``` PR #2513 (`3bc875816e45550c3aaa6d44da3b3922b82d18e3`): ``` xcl-smoke v1 commit: 3bc875816e45550c3aaa6d44da3b3922b82d18e3 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1604 (PresentX 1604) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13989 MB ``` ### Runtime log observations (`xcl.log`) - `9223` log lines, `0` `[ERROR]` / device-removal / panic lines. - Final draw/memory telemetry in log: `19531 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped)`; last memory sample `13988 MB committed by the process; video memory 6116 MB local, 4651 MB non-local`. ### Limits of coverage - Packed two-per-dword `float16` VS/mesh exports and per-half PS attribute interpolation were directly executed end-to-end on desktop RTX 4060 + DXC `1.9.2609.5` via all 4 new tests (`f16_packed_attributes`, `f16_packed_attributes_interpolate_per_half`, `f16_packed_params`, `gpu_mesh_f16_packed_params`, `3/3` each with `0` skips), `gpu::dxil::` (`183` executed + `1` expected `no wave64` skip × 3), and `gpu::recomp::` (`372` executed + `23` expected Wave32-only/env skips × 3). - Native Wave64 GPU execution is not available on this Wave32-only RTX 4060, and the warm-cache 60 s retail smoke on `title: 29640639` confirms zero runtime regression rather than recompiling a cold retail VS/MS/PS shader set (frame-count delta vs. cached merge-base reflects single-run startup variance, not this PR). *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
CharlyRien commented 2026-11-29 08:10:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by CharlyRien on 2026-11-29T08:10:11Z.


Test report on the retail title (#505). An output record flag of 1 is read as "packed two per dword", but on this title it means "16-bit, one half per dword". With this PR, vertex params exported as four plain dwords are unpacked from dwords 0-1 only, and dwords 2-3 are dropped.

Stack

  • RTX 3090 24 GB (Resizable BAR off), driver 616.56, Ryzen 9 5950X, 32 GB RAM, Windows 11 22631.
  • Base main fa204595, plus #3214, #3237, #3192, #3179, #3094 (with a local fix of ours to its alias copy), #3209, #3096 and #2571.
  • This PR's two commits ported onto that base. git range-diff against 3bc87581 / d7ba3cd7 shows only main's xcl_vok guard on the mesh stores and params: None in main's own literals.
  • Env: XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16 XCL_ALIAS_COPY=1 XCL_PLACE_RETIRE=0 XCL_VIEW_REACH_MB=36 XCL_TWO_PASS_MB=2048 XCL_HUGE_PSO_CONCURRENCY=8 XCL_PSO_WAIT_MS=5000 XCL_PREPARE=0.

Read (offline, from the title's own programs; no game data here)
One vertex program has these output records, on float16 .xyzw registers:

[6, r,   7, r, 0, 3]
[6, r+1, 8, 0, 0, 1]
[6, r+2, 9, 0, 0, 1]
[6, r+3, 10, 0, 0, 1]
  • Param 7 (flag 3) really is packed: two v_pack_b32_f16 into dwords 0-1, then filler.
  • Params 8-10 (flag 1) are each exported as exp param with en=0xf, compr=0. Each dword is v_and_b32 v, 0xffff, h: one half per dword, in the low half, nothing packed.
  • The matching PS reads attribute 7 with v_interp_p2_f16. It reads attributes 8-10 channel by channel with v_interp_mov_f32 then v_cvt_f32_f16 (input flag 9 = 8 | 1, flat, no 16).
  • Across all 9625 VS / mesh programs of the title: a flag-1 record on an .xyzw register is always exported over 4 dwords (54 of 54), never 2. On the PS side, flag 8 without 16 on an .xyzw register is always read with v_interp_mov_f32, up to channel 3 (127 cases).
  • On a .x register a flag-1 param fits in one dword either way. That may be why the 383 / 442 mask check in the description did not catch it.

Where (3bc87581)

  • crates/xcl/src/gpu/recomp/mod.rs, in the VS output-table parser: let f16 = r[5] & 1 == 1; sets f16 for flag 1 as well as flag 3.
  • emit.rs then takes dw = if f16 { first + c / 2 } else { c } for every f16 param. A flag-1 .xyzw param therefore reads halves of dwords 0-1, and dwords 2-3 are never read.
  • The mesh store and dxil/lower_gfx.rs follow the same rule.
  • On the PS side, d7ba3cd7's r[7] & 8 != 0 is just as wide, but it only matters for _f16 reads, so this PS comes out right.
  • Checked by running 3bc87581's parser and the emit loop, copied unchanged into a standalone binary, on these four records. It reproduces the translation we see in-game: param 10 becomes (f16(v12), f16(v18)), and the registers of dwords 2-3 are not read.

Measured (one run per setting, frames at ~700 s; the title's start does not always leave the camera at the same pose)

  • With the PR: the outdoor view through a window is covered in bright isolated speckles, about 3.3 per mille of the frame centre (median).
  • Same build and env with the PR's two commits reverted: the view through the same window is clean. 0 % skipped draws, 0 device removals. The camera pose differs between these two runs.
  • At the clean run's pose, a run with the PR but without XCL_TWO_PASS_MB=2048 draws that window's glass quad entirely black. Two settings differ there, so that pair alone does not single out the PR; the reading above does.

Suggested (not implemented, not run)

  • Treat a param as packed only on flag 3 in the VS / MS table (bit 1 set), and only on flag 16 in the PS table.
  • A flag-1 param keeps component c in dword c, as raw bits.
  • Guard: if the exp param enable mask does not match the dwords the table predicts, fall back to one component per dword.

I can run a candidate fix on this title, at the same pose.

AI use: the offline reading, the reproduction and this report were done with Claude Code (Claude Opus 5.5), driven and checked by me.

<!-- greyfinch-sync:ivall/xcl:comment:7252930039 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2513#issuecomment-7252930039). Originally posted by [CharlyRien](https://github.com/CharlyRien) on 2026-11-29T08:10:11Z. --- Test report on the retail title (#505). An output record flag of `1` is read as "packed two per dword", but on this title it means "16-bit, one half per dword". With this PR, vertex params exported as four plain dwords are unpacked from dwords 0-1 only, and dwords 2-3 are dropped. **Stack** - RTX 3090 24 GB (Resizable BAR off), driver 616.56, Ryzen 9 5950X, 32 GB RAM, Windows 11 22631. - Base `main` fa204595, plus #3214, #3237, #3192, #3179, #3094 (with a local fix of ours to its alias copy), #3209, #3096 and #2571. - This PR's two commits ported onto that base. `git range-diff` against 3bc87581 / d7ba3cd7 shows only main's `xcl_vok` guard on the mesh stores and `params: None` in main's own literals. - Env: `XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16 XCL_ALIAS_COPY=1 XCL_PLACE_RETIRE=0 XCL_VIEW_REACH_MB=36 XCL_TWO_PASS_MB=2048 XCL_HUGE_PSO_CONCURRENCY=8 XCL_PSO_WAIT_MS=5000 XCL_PREPARE=0`. **Read** (offline, from the title's own programs; no game data here) One vertex program has these output records, on float16 `.xyzw` registers: ``` [6, r, 7, r, 0, 3] [6, r+1, 8, 0, 0, 1] [6, r+2, 9, 0, 0, 1] [6, r+3, 10, 0, 0, 1] ``` - Param 7 (flag 3) really is packed: two `v_pack_b32_f16` into dwords 0-1, then filler. - Params 8-10 (flag 1) are each exported as `exp param` with `en=0xf`, `compr=0`. Each dword is `v_and_b32 v, 0xffff, h`: one half per dword, in the low half, nothing packed. - The matching PS reads attribute 7 with `v_interp_p2_f16`. It reads attributes 8-10 channel by channel with `v_interp_mov_f32` then `v_cvt_f32_f16` (input flag 9 = 8 | 1, flat, no 16). - Across all 9625 VS / mesh programs of the title: a flag-1 record on an `.xyzw` register is always exported over 4 dwords (54 of 54), never 2. On the PS side, flag 8 without 16 on an `.xyzw` register is always read with `v_interp_mov_f32`, up to channel 3 (127 cases). - On a `.x` register a flag-1 param fits in one dword either way. That may be why the 383 / 442 mask check in the description did not catch it. **Where** (3bc87581) - `crates/xcl/src/gpu/recomp/mod.rs`, in the VS output-table parser: `let f16 = r[5] & 1 == 1;` sets `f16` for flag 1 as well as flag 3. - `emit.rs` then takes `dw = if f16 { first + c / 2 } else { c }` for every `f16` param. A flag-1 `.xyzw` param therefore reads halves of dwords 0-1, and dwords 2-3 are never read. - The mesh store and `dxil/lower_gfx.rs` follow the same rule. - On the PS side, d7ba3cd7's `r[7] & 8 != 0` is just as wide, but it only matters for `_f16` reads, so this PS comes out right. - Checked by running 3bc87581's parser and the emit loop, copied unchanged into a standalone binary, on these four records. It reproduces the translation we see in-game: param 10 becomes `(f16(v12), f16(v18))`, and the registers of dwords 2-3 are not read. **Measured** (one run per setting, frames at ~700 s; the title's start does not always leave the camera at the same pose) - With the PR: the outdoor view through a window is covered in bright isolated speckles, about 3.3 per mille of the frame centre (median). - Same build and env with the PR's two commits reverted: the view through the same window is clean. 0 % skipped draws, 0 device removals. The camera pose differs between these two runs. - At the clean run's pose, a run with the PR but without `XCL_TWO_PASS_MB=2048` draws that window's glass quad entirely black. Two settings differ there, so that pair alone does not single out the PR; the reading above does. **Suggested** (not implemented, not run) - Treat a param as packed only on flag 3 in the VS / MS table (bit 1 set), and only on flag 16 in the PS table. - A flag-1 param keeps component c in dword c, as raw bits. - Guard: if the `exp param` enable mask does not match the dwords the table predicts, fall back to one component per dword. I can run a candidate fix on this title, at the same pose. AI use: the offline reading, the reproduction and this report were done with Claude Code (Claude Opus 5.5), driven and checked by me.
CharlyRien commented 2026-11-29 13:44:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by CharlyRien on 2026-11-29T13:44:02Z.


Follow-up to my report above. This one concerns main itself, without this PR. The same 16-bit params are also wrong there, in a different way: the VS writes them as a numeric conversion, and the PS reads them back as raw bits.

Read (upstream main 7a649b0e, crates/xcl/src/gpu/recomp/emit.rs):

  • hlsl_type() (l.5755-5759) declares every component type other than 1 and 2 as float, so float16 outputs (component type 6) become float4 pN.
  • The VS export (l.2371): let v = if e.component_type == 3 { format!("asfloat({v})") } else { format!("{v}") }; adds asfloat only for type 3. For a float16 param, the exported dword (v_and_b32 v, 0xffff, h, a raw half in the low bits) is assigned to the float output as an integer. DXC lowers that to uitofp, a numeric conversion of the bit pattern.
  • The PS reads those attributes as raw bits: asuint(xi.aN[c]), then f16tof32(x & 0xffff) for v_interp_mov_f32 followed by v_cvt_f32_f16.
  • The PS input declaration (l.5449) forces nointerpolation on every element whose component type is not 3. A float16 attribute that the console interpolates with v_interp_p2_f16 is therefore flat: each triangle takes its provoking vertex's value.

Reproduced offline (CPU arithmetic, confirmed on WARP with a minimal VS→PS pair translated the same way):

  • A half written this way reaches the PS as a different number. Every "round" value (1.0, 0.5, 0.25, 2.0) arrives as exactly 0, and 0.7 arrives as 2048.
  • Over [0, 1]: 1761 values arrive as 0, 3712 as ≥ 1, 6688 as negative and 224 as inf.
  • With the flat attribute on top, a quad whose per-vertex value differs gets a different, wrong value per triangle, so the error has a diagonal edge.

Deduced, not measured in-game: on the retail title this matches a window-glass particle drawn with dual-source blending (ONE / SRC1_COLOR) that zeroes one triangle of what is behind it. I have not run a fix in the game, so I am not claiming it is the cause.

Suggested:

  • In the VS export, asfloat for component type 6 as well as 3 (matches!(e.component_type, 3 | 6)). The same applies to the mesh store if it shares the rule.
  • In the PS declaration, keep interpolation for float16 attributes.
  • These two do not replace this PR's packing work: they cover the one-half-per-dword case that this PR currently reads as packed (see my report above).

Stack: RTX 3090 24 GB (Resizable BAR off), driver 616.56, Ryzen 9 5950X, 32 GB RAM, Windows 11 22631. Code read on main 7a649b0e; the WARP check used our local tree on that base. Nothing in it touches these lines.

AI use: found, reproduced and written with Claude Code (Claude Opus 5.5), checked and posted by me.

<!-- greyfinch-sync:ivall/xcl:comment:7256760259 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2513#issuecomment-7256760259). Originally posted by [CharlyRien](https://github.com/CharlyRien) on 2026-11-29T13:44:02Z. --- Follow-up to my report above. This one concerns `main` itself, without this PR. The same 16-bit params are also wrong there, in a different way: the VS writes them as a numeric conversion, and the PS reads them back as raw bits. **Read** (upstream `main` 7a649b0e, `crates/xcl/src/gpu/recomp/emit.rs`): - `hlsl_type()` (l.5755-5759) declares every component type other than 1 and 2 as `float`, so float16 outputs (component type 6) become `float4 pN`. - The VS export (l.2371): `let v = if e.component_type == 3 { format!("asfloat({v})") } else { format!("{v}") };` adds `asfloat` only for type 3. For a float16 param, the exported dword (`v_and_b32 v, 0xffff, h`, a raw half in the low bits) is assigned to the `float` output as an integer. DXC lowers that to `uitofp`, a numeric conversion of the bit pattern. - The PS reads those attributes as raw bits: `asuint(xi.aN[c])`, then `f16tof32(x & 0xffff)` for `v_interp_mov_f32` followed by `v_cvt_f32_f16`. - The PS input declaration (l.5449) forces `nointerpolation` on every element whose component type is not 3. A float16 attribute that the console interpolates with `v_interp_p2_f16` is therefore flat: each triangle takes its provoking vertex's value. **Reproduced offline** (CPU arithmetic, confirmed on WARP with a minimal VS→PS pair translated the same way): - A half written this way reaches the PS as a different number. Every "round" value (1.0, 0.5, 0.25, 2.0) arrives as exactly 0, and 0.7 arrives as 2048. - Over [0, 1]: 1761 values arrive as 0, 3712 as ≥ 1, 6688 as negative and 224 as inf. - With the flat attribute on top, a quad whose per-vertex value differs gets a different, wrong value per triangle, so the error has a diagonal edge. **Deduced, not measured in-game:** on the retail title this matches a window-glass particle drawn with dual-source blending (`ONE` / `SRC1_COLOR`) that zeroes one triangle of what is behind it. I have not run a fix in the game, so I am not claiming it is the cause. **Suggested:** - In the VS export, `asfloat` for component type 6 as well as 3 (`matches!(e.component_type, 3 | 6)`). The same applies to the mesh store if it shares the rule. - In the PS declaration, keep interpolation for float16 attributes. - These two do not replace this PR's packing work: they cover the one-half-per-dword case that this PR currently reads as packed (see my report above). Stack: RTX 3090 24 GB (Resizable BAR off), driver 616.56, Ryzen 9 5950X, 32 GB RAM, Windows 11 22631. Code read on `main` 7a649b0e; the WARP check used our local tree on that base. Nothing in it touches these lines. AI use: found, reproduced and written with Claude Code (Claude Opus 5.5), checked and posted by me.
CharlyRien commented 2026-11-29 17:52:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by CharlyRien on 2026-11-29T17:52:09Z.


Correction to my follow-up above (the main float16 params comment): its last part linked that HLSL-path bug to the window glass on the retail title. That link was wrong. In game, those glass programs go through the direct translator, which already passes the bits through, so the HLSL-path issue I described does not touch them. The issue itself still stands for the HLSL path (reproduced offline on WARP).
I also tested in game whether the packed params of those glass programs explain it: they do not (no change with them fixed). So I have no float16 link to the glass at all; please disregard that part.

For the record, the half-black window turned out to be the tiled lighting reading an empty compute-written depth buffer; #3089 fixes it (test report there).

AI use: found and written with Claude Code (Claude Opus 5.5), checked and posted by me.

<!-- greyfinch-sync:ivall/xcl:comment:7260026594 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2513#issuecomment-7260026594). Originally posted by [CharlyRien](https://github.com/CharlyRien) on 2026-11-29T17:52:09Z. --- Correction to my follow-up above (the `main` float16 params comment): its last part linked that HLSL-path bug to the window glass on the retail title. That link was wrong. In game, those glass programs go through the direct translator, which already passes the bits through, so the HLSL-path issue I described does not touch them. The issue itself still stands for the HLSL path (reproduced offline on WARP). I also tested in game whether the packed params of those glass programs explain it: they do not (no change with them fixed). So I have no float16 link to the glass at all; please disregard that part. For the record, the half-black window turned out to be the tiled lighting reading an empty compute-written depth buffer; #3089 fixes it (test report there). AI use: found and written with Claude Code (Claude Opus 5.5), checked and posted by me.
vasanex commented 2026-12-01 03:22:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by vasanex on 2026-12-01T03:22:36Z.


Report from a retail title (#505) on an RTX 3080: the mapping of this PR changes what reaches two shader groups here, and with it the window glass is drawn over its whole quad. It is not a merge-check: I tested a private port, not this head.

Tested tree: this PR's two commits (d7ba3cd7, 3bc87581, conflicts resolved) on private builds that are older than main and have other PRs and local changes. On top is one local rule for the case @CharlyRien described on 2026-11-29: an output record with flag 1 whose register uses more than two components is not treated as packed. The comparison builds are the same trees without these three commits. Vertex and pixel shaders go through HLSL here, compute and the mesh pass through direct DXIL.

Hardware: RTX 3080 10 GB (driver 621.40), Ryzen 9 7950X, Windows 11 build 26200, release build, Series S profile.

1. Wrong registers without the port. One pixel shader (it draws lamps in a yard) has an input record for a packed float16 pair, so ps_input_table refuses the whole table and the fallback counts the declared registers. For this shader that gives a wrong register for all six inputs; one of them is an input that ISG1 marks as not read. With the port, all 24 component reads in the generated HLSL match the ISG1 read masks, and the exports of its mesh shader match the output table.

2. Wrong types and interpolation without the port. For the three pixel shaders of the window glass, both sides count the registers alike, so the data arrive. But the packed pairs are not unpacked, and some inputs that the tables interpolate become nointerpolation. With the port, the number of reads per input matches the ISG1 read masks for all three, and all inputs that are read are interpolated.

What changes in the picture (runs of 900 to 2700 s on several private builds with the port)

  • Glass: 26 runs with the port; 24 reached the window scene. 22 of them show the glass layer, in all 22 over the whole pane and without the diagonal edge (in two of them I can see the layer only as haze, not its wire mesh; two others broke up later for another reason). 2 show no glass layer at all. Without the port, every run in which I saw a glass layer had it on one triangle of the quad only (more than 20 runs), and 2 runs had no layer.
  • Lamps in the yard (drawn by the shader in 1): bright in 119 of 120 checked frames of the last comparison run without the port, and in none of the 409 checked frames of the first four port runs. Without the port, red is about 58,000 in the HDR target at the two lamp pixels I followed (green and blue below 2); in one port run with the same two points, red is 0.75 and 0.94, and the lamps' program no longer changes these pixels. Its code can discard pixels; I have not shown that it does so here. I do not know how these lamps look on the console, so this shows a change, not that the new picture is right.
  • The red on a jacket was weaker in the first four port runs, but not clearly so in later ones, which have no bright lamps either. So I do not count it as an effect of this PR.

Not a statement about stability: the 26 port runs had 1 device removal and 4 title crashes; the builds differ in other ways, too.

About the withdrawn glass link: @CharlyRien's glass goes through the direct translator and ours through HLSL, so this does not contradict their result. A glass that is hazed on half of its quad was also described on #505 on 2026-11-30 (RTX 5070 Ti); I have not checked whether it has the same cause.

Not tested: this PR's head or current main, the direct translator for vertex and pixel shaders, AMD, the whole test suite on the private build (852 filtered recompiler, DXIL and pixel-history tests passed on the first port build), each commit on its own, and the same shader cache for both builds (the port used its own).

AI use: Claude Code ported the commits, ran the title and compared the generated shaders (Claude Opus 5.5), and counted the pictures again and wrote this text (Claude Fable 5.2). Posted by the tool on my instruction.

<!-- greyfinch-sync:ivall/xcl:comment:7299641127 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2513#issuecomment-7299641127). Originally posted by [vasanex](https://github.com/vasanex) on 2026-12-01T03:22:36Z. --- Report from a retail title (#505) on an RTX 3080: the mapping of this PR changes what reaches two shader groups here, and with it the window glass is drawn over its whole quad. It is **not a `merge-check`**: I tested a private port, not this head. **Tested tree:** this PR's two commits (`d7ba3cd7`, `3bc87581`, conflicts resolved) on private builds that are older than `main` and have other PRs and local changes. On top is one local rule for the case @CharlyRien described on 2026-11-29: an output record with flag 1 whose register uses more than two components is not treated as packed. The comparison builds are the same trees without these three commits. Vertex and pixel shaders go through HLSL here, compute and the mesh pass through direct DXIL. **Hardware:** RTX 3080 10 GB (driver 621.40), Ryzen 9 7950X, Windows 11 build 26200, release build, Series S profile. **1. Wrong registers without the port.** One pixel shader (it draws lamps in a yard) has an input record for a packed float16 pair, so `ps_input_table` refuses the whole table and the fallback counts the declared registers. For this shader that gives a wrong register for **all six inputs**; one of them is an input that ISG1 marks as not read. With the port, all 24 component reads in the generated HLSL match the ISG1 read masks, and the exports of its mesh shader match the output table. **2. Wrong types and interpolation without the port.** For the three pixel shaders of the window glass, both sides count the registers alike, so the data arrive. But the packed pairs are not unpacked, and some inputs that the tables interpolate become `nointerpolation`. With the port, the number of reads per input matches the ISG1 read masks for all three, and all inputs that are read are interpolated. **What changes in the picture** (runs of 900 to 2700 s on several private builds with the port) - **Glass:** 26 runs with the port; 24 reached the window scene. 22 of them show the glass layer, in all 22 over the whole pane and without the diagonal edge (in two of them I can see the layer only as haze, not its wire mesh; two others broke up later for another reason). 2 show no glass layer at all. Without the port, every run in which I saw a glass layer had it on one triangle of the quad only (more than 20 runs), and 2 runs had no layer. - **Lamps in the yard (drawn by the shader in 1):** bright in 119 of 120 checked frames of the last comparison run without the port, and in none of the 409 checked frames of the first four port runs. Without the port, red is about 58,000 in the HDR target at the two lamp pixels I followed (green and blue below 2); in one port run with the same two points, red is 0.75 and 0.94, and the lamps' program no longer changes these pixels. Its code can discard pixels; I have not shown that it does so here. **I do not know how these lamps look on the console, so this shows a change, not that the new picture is right.** - The red on a jacket was weaker in the first four port runs, but not clearly so in later ones, which have no bright lamps either. So I do not count it as an effect of this PR. **Not a statement about stability:** the 26 port runs had 1 device removal and 4 title crashes; the builds differ in other ways, too. **About the withdrawn glass link:** @CharlyRien's glass goes through the direct translator and ours through HLSL, so this does not contradict their result. A glass that is hazed on half of its quad was also described on #505 on 2026-11-30 (RTX 5070 Ti); I have not checked whether it has the same cause. **Not tested:** this PR's head or current `main`, the direct translator for vertex and pixel shaders, AMD, the whole test suite on the private build (852 filtered recompiler, DXIL and pixel-history tests passed on the first port build), each commit on its own, and the same shader cache for both builds (the port used its own). AI use: Claude Code ported the commits, ran the title and compared the generated shaders (Claude Opus 5.5), and counted the pictures again and wrote this text (Claude Fable 5.2). Posted by the tool on my instruction.
Foniass commented 2026-12-01 08:13:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:13:45Z.


Triage (#1607) – head 3bc8758

No open or merged PR makes the same change. #1975 / #1976 no longer carry float16 interpolant packing: the only f16 interp code in #1976 is a v_interp_p2_f16 half-preservation test. Nothing of f16_registers / ps_f16_slot / OutParam is on main.
No problems found in the diff. As the description says, the second-register inference for VS/MS tables is a heuristic checked on one title.
Recommendation: keep open.

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

<!-- greyfinch-sync:ivall/xcl:comment:7305041998 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2513#issuecomment-7305041998). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:13:45Z. --- **Triage (#1607)** – head 3bc8758 No open or merged PR makes the same change. #1975 / #1976 no longer carry float16 interpolant packing: the only f16 interp code in #1976 is a `v_interp_p2_f16` half-preservation test. Nothing of `f16_registers` / `ps_f16_slot` / `OutParam` is on main. No problems found in the diff. As the description says, the second-register inference for VS/MS tables is a heuristic checked on one title. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.

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

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

No due date set.

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