Recompiler: enforce -0.0 < +0.0 order in f16/f32 min and max (#1282) #1577
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1577
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1577"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@hajduzsolt on GitHub · 2026-11-24 17:52 UTC · original
hajduzsolt:recompiler/float-minmax-signed-zero→main· +94 −11 · 2 files · 1 commits · openAdds fmin_ieee and fmax_ieee HLSL helpers so RDNA2 v_min_, v_max_, v_min3_, v_max3_, v_pk_min_f16, v_pk_max_f16, and v_med3_* over f16/f32 strictly enforce -0.0 < +0.0 across D3D12 drivers while preserving NaN suppression. Fixes #1282.
What is in it
Tested
Regression run
main:
PR:
Not tested
AI use
github-bot referenced this pull request2026-11-26 04:59:09 +00:00
@DavidM1911 on GitHub · 2026-11-24 19:51 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@throny on GitHub · 2026-11-24 19:55 UTC · original
Two contributors checked independently and found that #1348 solves the same problem (for #1282) in a different way: #1607, group D3. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint, not a request from the maintainers; nobody from the project has adopted #1607 so far.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
@regiumlepidi on GitHub · 2026-11-25 00:09 UTC · original
RTX 5070 Ti:
d6d8f11merged intomain8e87fc7passes on both paths; on this GPU the GPU test also passes without the fixTested
XCL_SAMPLE_*cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --nocapture, one run per cell; PR headd6d8f116d7398e6c702665f65b21c9505f4ca35cmerged locally into8e87fc7b62a87ea589ccb9ea6182f514016cf7db, no conflicts (passed / failed / ignored):XCL_DIRECT_DXIL=1main8e87fc7fuzz_validate_and_gpu_0to_3(#1905, this driver) and, withXCL_DIRECT_DXIL=1,offline_compute_pipeline_is_reused_by_a_second_process, all as onmaintests.rschange applied tomain8e87fc7:float_minmax_uses_ieee_signed_zero_helpers(HLSL text) fails, butgpu_float_minmax_orders_negative_zero_below_positive_zeropasses on both paths. So this driver already orders -0 below +0 inmin/maxand returns the number for a qNaN operand; the GPU test does not show the bug here. A GPU whosemin/maxtreat ±0 as equal is needed to see it failSKIPPEDlines in each run (18 no wave64, 1 const mask + wave64, 3 per-lane form refused, Developer Mode,d3d12SDKLayers.dll, heap windows, debug layer); none names the new testsNot tested
gpu_waves()runs wave32 only here), any GPU where the test fails without the fix, release build, any retail titleAI use
@JJAutoCompare on GitHub · 2026-11-25 02:43 UTC · original
XCL PR #1577 — Intel Arc A770 signed-zero compatibility
#1577
Tested
Exact clean PR head d6d8f116d7398e6c702665f65b21c9505f4ca35c. GitHub confirmed the PR was open at that SHA before and after the run. I read the existing conversation, including the RTX 3060 Ti and RTX 5070 Ti reports.
Intel Arc A770 (32.0.101.9175), AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation 26200.9974, Rust 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc), unoptimized Cargo test profile. The runner reported dxcompiler and dxil 1.9.2609.5 (DXC 01b62ad4).
Process-only setup: 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, TEMP=TMP=L:/XclTooling/pr1577. GPU runs used XCL_ADAPTER=A770 and XCL_DXC_DIR=$env:LOCALAPPDATA/XclTooling/dxc-1.9.2609/bin/x64.
Prebuild outside the lock: cargo test -p xcl --lib --locked --no-run (54.18 s wall, exit 0). The commands below used the executable printed by Cargo:
$bin = 'L:/XclTooling/pr1778-2e2ee55-20261125-020159/target/debug/build/xcl/77aca8ccb20e299f/out/xcl-77aca8ccb20e299f.exe'
$lock = 'L:/XclTooling/Invoke-ArcTest.ps1'
$gpu = 'gpu::recomp::tests::gpu_float_minmax_orders_negative_zero_below_positive_zero'
$env:XCL_DIRECT_DXIL = '0'
& $bin gpu::recomp::tests::float_minmax_uses_ieee_signed_zero_helpers --exact --nocapture --test-threads=1
& $lock -Test { & $bin $gpu --exact --nocapture --test-threads=1 }
$env:XCL_DIRECT_DXIL = '1'
& $lock -Test { & $bin $gpu --exact --nocapture --test-threads=1 }
& $lock -Test { & 'L:/XclTooling/CapabilityProbe/capabilities.exe' }
HLSL translation test: 1 passed, 0 failed, 0 ignored, 0 SKIPPED, 832 filtered out (0.00 s harness). It checked complete translation and the signed-zero helpers in the emitted HLSL for f32/f16 scalar min/max, min3/max3 and packed f16 min/max. The translation-only test used the default logical wave64 options.
HLSL/DXC GPU test: 1 passed, 0 failed, 0 ignored, 0 SKIPPED, 832 filtered out (0.25 s harness, 0.41 s wall including lock). The fixture compiled HLSL with DXC as cs_6_6 and dispatched it on the Arc.
Direct DXIL GPU test: 1 passed, 0 failed, 0 ignored, 0 SKIPPED, 832 filtered out (0.20 s harness, 0.27 s wall including lock). The fixture's kernel_wave routes to direct_kernel when enabled, so this was a separate dispatch through the direct translator. The PR's HLSL helpers are only exercised by the HLSL path.
On both GPU paths, all 14 register assertions passed on each of 32 lanes (448 bit-exact comparisons per path). The assertions cover f32 and scalar f16 min/max for both mixed-sign zero operand orders, f32 min3/max3, packed f16 min/max across both halves, and f32 qNaN suppression with a finite first operand (3.0 for min and -2.0 for max). Scalar f16 checks include preservation of the upper 0xCAFE bits.
The D3D12 probe identified the Arc A770 (PCI 8086:56A0), WaveOps=1 and WaveLaneCountMin/Max=8/32. The fixture ran wave32 only. gpu_waves() omits wave64 on this adapter without emitting a SKIPPED line and does not select split wave64.
The GPU commands ran in a child PowerShell with process-scoped RemoteSigned after the default session blocked script loading. One retry acquired the lock but its output pipeline stopped on the DXC stderr diagnostic before capturing a result. Counts above come from the subsequent complete runs. Machine policy was untouched.
Logs: prebuild-20261125-033409.log, cpu-20261125-033531.log, gpu-hlsl-dxc-20261125-033726.log, gpu-direct-dxil-20261125-033726.log, wave-capability-20261125-033726.log.
Not tested
AI use
@DavidM1911 on GitHub · 2026-11-26 05:48 UTC · original
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
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.