Skip to content

Direct DXIL: decode inline float constants as f32 for v_cvt_f16_u16 and v_cvt_f16_i16 - #1870

Merged
throny merged 1 commit into
xcl-dev:mainfrom
emirduran707:dxil-cvt-f16-int-inline-const
Nov 29, 2026
Merged

throny merged 1 commit into
xcl-dev:mainfrom
emirduran707:dxil-cvt-f16-int-inline-const

Conversation

@emirduran707

@emirduran707 emirduran707 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Lw::valu16 passed name.contains("f16") as src_f16 to self.sources(), which decoded inline float constants (240..=248) as f16 bit patterns for v_cvt_f16_u16 and v_cvt_f16_i16. Both instructions take a 16-bit integer source (not f16), so inline constants decode as f32 bit patterns per the RDNA2 ISA and recomp/emit.rs (for example, v_cvt_f16_u16 v0, 1.0 wrote 0x7380 instead of 0x0000).

Lw::valu16 now excludes v_cvt_f16_u16 and v_cvt_f16_i16 from src_f16, matching recomp/emit.rs.

What is in it

  • crates/xcl/src/gpu/dxil/lower_wide.rs: set src_f16 = name.contains("f16") && !matches!(name, "v_cvt_f16_u16" | "v_cvt_f16_i16") in Lw::valu16.
  • crates/xcl/src/gpu/dxil/core_tests.rs: GPU parity test v_cvt_f16_int_decodes_inline_float_constants_as_f32 against HLSL (SRC0 = 242, 243, 248).

Tested

  • AMD Radeon RX 9060 XT (driver 32.0.31044.16), Ryzen 5 5600, Windows 11 Pro 26300, Rust 1.100.0; tests debug, smoke release
  • cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4 on 1506f4b (rebased onto main 2aa2d1a): 1136 passed, 2 failed, 46 ignored; 8 SKIPPED (6 in lower_dxil::tests::{f16,f32}_programs_on_the_gpu; heap_window_out_of_memory_falls_back_to_the_switch_form; pso_measurement_compiles_an_exact_synthetic_record)
    • The 2 failures (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_3) fail identically on unmodified main 2aa2d1a on this GPU (seeds 722 and 1599).
  • v_cvt_f16_int_decodes_inline_float_constants_as_f32 before the change failed (v0: 0x7380 vs 0x0); passes and matches HLSL after

Regression run

main:

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

this PR:

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

Not tested

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

AI use

  • Antigravity with Gemini 4 Neon: found the bug, wrote the fix, GPU parity test and this description, and ran the test suite and smoke runs above.
  • Claude Code with Claude Opus 5.5: rebased the change onto main 2aa2d1a (a conflict in crates/xcl/src/gpu/dxil/core_tests.rs; both tests kept, this PR's now beside ps_get_lod_with_a_static_sampler) and reran the suite and smoke runs above.

@frenziedcoder

frenziedcoder commented Nov 24, 2026 •

Copy link
Copy Markdown

NVIDIA test report for d0cd5aa: full suite green, its own test v_cvt_f16_int_decodes_inline_float_constants_as_f32 passes, and a clean smoke pair on the retail title (1653 vs 1654 frames).

Tested

  • NVIDIA GeForce RTX 5080 16 GB (driver 617.14, 32-lane waves), AMD Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 25H2 (26200.9974), rustc 1.100.0 stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact head d0cd5aac7a736db220f9bff4f584c27c10a19439, no local changes.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4 (debug): 960 passed, 0 failed, 43 ignored; the PR's own test v_cvt_f16_int_decodes_inline_float_constants_as_f32 passes. SKIPPED: gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu (no wave64), gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu (no wave64), gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu (no wave64), gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu (no wave64), gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu (no wave64), gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu (f16 arithmetic, wave64: no wave64), gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu (f16 packed, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 arithmetic, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 compares, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 conversions, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 rounding, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 three-source, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 transcendentals, wave64: no wave64), gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu (f64, wave64: no wave64), gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu (integer arithmetic, wave64: no wave64), gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu (integer carries, wave64: no wave64), gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), gpu_wave32_program_in_wave64_hardware (no wave64), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • test_title_draws_with_a_root_signature_under_the_debug_layer reports ok, but this machine has no D3D12 debug layer (debug layer requested but unavailable … (0x887A002D)), so it ran without the layer and is no evidence either way.

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

base (1d027e5, this PR's merge base with main):

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

this PR:

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

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

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

@upipibi

upipibi commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

NVIDIA run, since the description lists it as untested: RTX 3070 8 GB, driver 616.56, Windows 11, debug, d0cd5aa on main 689f2db.

  • v_cvt_f16_int_decodes_inline_float_constants_as_f32: passes, 2 of 2 runs.
  • dxil::core_tests: 13 passed, 0 failed, 1 ignored.

On the rule itself: AnyPS5's translator reads these the same way, as an independent implementation (not a hardware measurement). v_cvt_f16_u16 / v_cvt_f16_i16 read their source with readU16AsU32, the low 16 bits of the f32 inline pattern, so 1.0 gives 0. Only instructions with an f16 source go through its f16 inline table (readF16SourceBits: 1.0 → 0x3c00).

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

@raylitebull

Copy link
Copy Markdown
Member

Both AMD and NVIDIA verification look good on d0cd5aa. This is currently DIRTY with merge conflicts against main — please rebase onto main and let Build and test (Windows, no GPU) run cleanly so we can merge.

@emirduran707
emirduran707 force-pushed the dxil-cvt-f16-int-inline-const branch from d0cd5aa to c076305 Compare November 25, 2026 01:27
@raylitebull

Copy link
Copy Markdown
Member

Build and test (Windows, no GPU) and PR description both passed on c076305, and #1922 just landed on main touching the same spot at the end of crates/xcl/src/gpu/dxil/core_tests.rs. Please rebase onto main to clear the DIRTY conflict so we can merge.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

… and `v_cvt_f16_i16`

`Lw::valu16` passed `name.contains("f16")` as `src_f16` to `self.sources()`,
decoding inline float constants (`240..=248`) as f16 bit patterns for
`v_cvt_f16_u16` and `v_cvt_f16_i16`. Both instructions take a 16-bit integer
source (not f16), so inline constants decode as f32 bit patterns per the RDNA2
ISA and `emit.rs` (e.g. `v_cvt_f16_u16 v0, 1.0` produced `0x7380` instead of
`0x0000`).

Exclude `v_cvt_f16_u16` and `v_cvt_f16_i16` from `src_f16`, matching
`recomp/emit.rs`, and add a GPU parity test against HLSL.

Assisted-by: Antigravity (Gemini 4 Neon)
@emirduran707
emirduran707 force-pushed the dxil-cvt-f16-int-inline-const branch from c076305 to 1506f4b Compare November 25, 2026 02:27
@JJAutoCompare

Copy link
Copy Markdown

PR #1870 Arc A770 parity test

Tested

  • PR #1870 was open at 1506f4baa4e8cb24e02c1093a2062c854fbd63ed before and after the run, verified from the public PR page and git ls-remote origin refs/pull/1870/head. The assigned detached checkout was clean at that SHA before and after the GPU run. The five visible discussion comments contained no Arc result. The earlier RTX 5080 and RTX 3070 reports used d0cd5aa. RTX 5080 report · RTX 3070 report
  • Windows 11 Enterprise Evaluation x64 build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc), Cargo 1.100.0 (3acc79c0c), unoptimized test profile with debug info disabled. The run logged DXC and DXIL 1.9.2609.5 (DXC build 01b62ad4).
  • 1 passed, 0 failed, 0 ignored, 0 skipped (zero SKIPPED lines). The exact filter excluded 1,114 tests. The GPU command exited 0 after the test completed in 0.22 s. The wrapper logged acquisition and release of the Arc A770 mutex.
  • The fixture dispatched direct DXIL and HLSL compiled with DXC for cs_6_6 in wave32, then compared all 32 bits of lane 0's v0, v1, and v2 across the backends. v0 used unsigned V_CVT_F16_U16 with SRC0=242 (+1.0 f32, low 16 bits 0x0000). v1 used signed V_CVT_F16_I16 with SRC0=243 (-1.0 f32, low 16 bits 0x0000). v2 used unsigned V_CVT_F16_U16 with SRC0=248 (1/(2π) f32, low 16 bits 0xF983). The signed opcode therefore exercised a zero integer input. The checked-in assertions compare against HLSL readback. Fixture at tested commit

Process environment used XCL_ADAPTER=A770, XCL_DXC_DIR=$env:LOCALAPPDATA/XclTooling/dxc-1.9.2609/bin/x64, CARGO_BUILD_JOBS=2, CARGO_INCREMENTAL=0, CARGO_PROFILE_DEV_DEBUG=0, CARGO_PROFILE_TEST_DEBUG=0, CARGO_TARGET_DIR=L:/XclTooling/pr1778-2e2ee55-20261125-020159/target, and TEMP and TMP set to L:/XclTooling/pr1870/temp.

Prebuild outside the mutex:

& "$env:USERPROFILE/.cargo/bin/cargo.exe" test -p xcl --lib --no-run --locked --message-format=json

GPU run in a fresh PowerShell process launched with -NoProfile -ExecutionPolicy RemoteSigned. The prebuild's Cargo JSON identified the executable.

& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
    & 'L:/XclTooling/pr1778-2e2ee55-20261125-020159/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe' 'gpu::dxil::core_tests::v_cvt_f16_int_decodes_inline_float_constants_as_f32' --exact --nocapture --test-threads=1
}

Raw logs use the prefix L:/XclTooling/pr1870/pr1870-1506f4b-20261125T030129487Z with suffixes .build.jsonl, .build.stderr.log, .arc.stdout.log, .arc.stderr.log, and .arc.exitcode.log.

Not tested

  • Nonzero signed integer input, additional operand encodings, lanes beyond lane 0, native or split wave64, comparison against a hardware oracle, other adapters or driver versions, baseline, release, broad suites, and retail or smoke runs.

AI use

  • T3 Code / Codex (gpt-6.2-sol) ran the checked-in test and wrote this report from the logs and fixture.

@DavidM1911

Copy link
Copy Markdown
Contributor

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

@futurepro62

Copy link
Copy Markdown

NVIDIA and AMD full-suite run, to go with the reports above by JJAutoCompare, since none of them covers AMD. Tested exact head 1506f4ba (on its base 2aa2d1a).

Tested

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

Not tested

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

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.

@thehollowedone

thehollowedone commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

merge-check
base: e429936
head: 1506f4b
merge: clean; the trial merge changes only gpu/dxil/lower_wide.rs and core_tests.rs (+30/-1).
build: cargo build --offline --locked -j 4 --workspace -> ok on the unchanged trial merge.
tests: cargo test --offline --locked -j 4 -p xcl --lib v_cvt_f16_int_decodes_inline_float_constants_as_f32 -- --nocapture -> 1 passed, 0 failed, 0 ignored, 0 skips. cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4 -> 2,125 passed, 11 failed, 48 ignored, 25 explicit SKIPPED GPU/environment notices. The same 11 tests failed in my immediately preceding untouched-main control with this command at base e429936c: three dispatch_chain_* split tests, gpu_heap_flat_reads_match_guarded_and_root_output, console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, gpu_compute_mode_dispatch_abi, gpu_float_cas_uses_ieee_equality, three test_title_* e2e tests, and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs. The latter launches a child whose failure summary appears twice in Cargo's output; I counted the outer test once. This machine's suite is not green.
review: no implementation blocker in the full two-file diff. The exception applies during CPU shader translation to the two integer-source conversions; it matches the HLSL path's source decoding and adds no per-lane operation. The GPU regression catches the old direct/HLSL mismatch. As an optional stronger oracle, I added a nonzero signed case and independent expected low-half assertions in a local test-only experiment; it passed 1/1 on this GPU. The suggested diff below was not included in the full-suite run or the PR head. Native RDNA2 execution for these exact conversions was not measured here.
performance: one name check during translation of these instructions; no new allocation or per-lane GPU work. Shader compilation and frame-time impact were not measured.
verdict: safe to merge relative to main e429936c; no new full-suite failure was found. The optional test assertion can be applied without holding the runtime fix.
hardware / tool and model: Windows 11 build 26300, Ryzen 7 9800X3D, NVIDIA RTX 3080 Ti driver 621.35, DXC 1.8.2502.11; Codex (GPT-6.2 Sol) performed the merge, build, GPU tests, control comparison, and optional test experiment; Codex (GPT-6.2 Astra) independently reviewed the source semantics.

Optional test assertion, verified locally on this head (1 passed)
diff --git a/crates/xcl/src/gpu/dxil/core_tests.rs b/crates/xcl/src/gpu/dxil/core_tests.rs
@@
         ("V_CVT_F16_U16", "ENC_VOP1", &[("VDST", 2), ("SRC0", 248)], None), // f32 1/(2pi) = 0x3E22_F983 -> low16 = 0xF983
        ("V_CVT_F16_I16", "ENC_VOP1", &[("VDST", 3), ("SRC0", 248)], None), // low16 = -1661 as i16
@@
-    for r in 0..=2 {
+    for (r, want) in [0x0000, 0x0000, 0x7bcc, 0xe67d].into_iter().enumerate() {
         assert_eq!(direct.vgpr[0][r], hlsl.vgpr[0][r], "v{r}: {:#x} vs {:#x}", direct.vgpr[0][r], hlsl.vgpr[0][r]);
+        assert_eq!(direct.vgpr[0][r] & 0xffff, want, "v{r}: independent low-half result");

@throny

throny commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

merge-check claim
head: 1506f4b

@throny

throny commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

merge-check
base: e429936
head: 1506f4b
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2126 passed, 10 failed, 48 ignored: the base's 9 and gpu::recomp::dxc::cache_tests::concurrent_cache_misses_compile_once, a test in the shader-compile cache that this PR does not touch and that has failed once in unrelated trees here four times now (a flaky test of main) (26 SKIPPED lines). The 9 failures are main's own at e429936 on this GPU (#3093); base alone: 2126 passed, 9 failed, 48 ignored.
review: none. The new source decoding is the same expression the HLSL path uses for these two instructions. The earlier conflict with #1922 is resolved.
performance: direct DXIL only; its users re-translate once.
verdict: safe to merge
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).

@throny
throny merged commit 5fc135a into xcl-dev:main Nov 29, 2026
3 checks passed
raylitebull pushed a commit that referenced this pull request Nov 29, 2026
…nts as f32

Direct DXIL: decode inline float constants as f32 for `v_cvt_f16_u16` and `v_cvt_f16_i16` (1506f4b):
`Lw::valu16` passed `name.contains("f16")` as `src_f16` to `self.sources()`,
decoding inline float constants (`240..=248`) as f16 bit patterns for
`v_cvt_f16_u16` and `v_cvt_f16_i16`. Both instructions take a 16-bit integer
source (not f16), so inline constants decode as f32 bit patterns per the RDNA2
ISA and `emit.rs` (e.g. `v_cvt_f16_u16 v0, 1.0` produced `0x7380` instead of
`0x0000`).

Exclude `v_cvt_f16_u16` and `v_cvt_f16_i16` from `src_f16`, matching
`recomp/emit.rs`, and add a GPU parity test against HLSL.

From #1870 (merge 5fc135a). Taken as is.

(cherry picked from commit 5fc135a)

Assisted-by: Antigravity (Gemini 4 Neon)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
raylitebull pushed a commit that referenced this pull request Nov 29, 2026
`image_store` with D16 unpacked each 16-bit half with `& 0xFFFF` and passed
it unchanged to the `RWTexture<int4>` store for SINT formats, so a negative
half such as -1 (0xFFFF) became 65535 and the R16 SINT store clamped it to
32767. Sign-extend the half when the T# format class is SINT, as the D16
`buffer_store_format_*` path in `lower_mem.rs` already does.

From #1920 (merge a7dac48). It conflicted when applied alone to the stack; on top of the #1870 port it applies without changes.

(cherry picked from commit a7dac48)

Assisted-by: Antigravity (Gemini 4 Neon, Claude Opus 5.5)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
raylitebull pushed a commit that referenced this pull request Nov 29, 2026
…nts as f32

Direct DXIL: decode inline float constants as f32 for `v_cvt_f16_u16` and `v_cvt_f16_i16` (1506f4b):
`Lw::valu16` passed `name.contains("f16")` as `src_f16` to `self.sources()`,
decoding inline float constants (`240..=248`) as f16 bit patterns for
`v_cvt_f16_u16` and `v_cvt_f16_i16`. Both instructions take a 16-bit integer
source (not f16), so inline constants decode as f32 bit patterns per the RDNA2
ISA and `emit.rs` (e.g. `v_cvt_f16_u16 v0, 1.0` produced `0x7380` instead of
`0x0000`).

Exclude `v_cvt_f16_u16` and `v_cvt_f16_i16` from `src_f16`, matching
`recomp/emit.rs`, and add a GPU parity test against HLSL.

From #1870 (merge 5fc135a). Taken as is.

(cherry picked from commit 5fc135a)

Assisted-by: Antigravity (Gemini 4 Neon)
raylitebull pushed a commit that referenced this pull request Nov 29, 2026
`image_store` with D16 unpacked each 16-bit half with `& 0xFFFF` and passed
it unchanged to the `RWTexture<int4>` store for SINT formats, so a negative
half such as -1 (0xFFFF) became 65535 and the R16 SINT store clamped it to
32767. Sign-extend the half when the T# format class is SINT, as the D16
`buffer_store_format_*` path in `lower_mem.rs` already does.

From #1920 (merge a7dac48). It conflicted when applied alone to the stack; on top of the #1870 port it applies without changes.

(cherry picked from commit a7dac48)

Assisted-by: Antigravity (Gemini 4 Neon, Claude Opus 5.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants