Tests: GPU tests of f64 instructions skip on an adapter without doubles #787
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!787
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-787"
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?
@Lucasyudi on GitHub · 2026-11-24 05:23 UTC · original
Lucasyudi:tests/skip-f64-without-doubles→main· +57 −12 · 4 files · 1 commits · openAn adapter that reports no
DoublePrecisionFloatShaderOpsstill runs the recompiled f64 instructions, but with wrong results. On Apple's D3DMetal (macOS under CrossOver; the flag is 0 there, checked with a plain D3D12 program)v_cmp_eq_f64(-0, 0)is false,v_rsq_f64(-0)is 0 instead of -inf,v_ldexp_f64(-0, 5)is +0, and a literal's high word reads as 0.0. A program that holds any f64 instruction gets 0 for its other results too: an integerv_add_nc_u32of 5 and 7 next to av_add_f64reads 0, while the same add alone reads 12. So the f64 tests fail there, and so do the tests that mix f64 with other work in one program, instead of saying the adapter cannot run them, as the wave64 and mesh tests do. Part of #258.What is in it
gpu/recomp/runner.rs:f64_supported(), read fromD3D12_OPTIONSat init.XCL_REQUIRE_GPU=wave64/meshdoes not turn a "no f64" skip into a failure.gpu/recomp/tests.rs:no_doubles(). It is true only when there is a GPU that has no doubles; without a GPU,gpu_ready/gpu_wavesreport "no GPU" as before. The 9 f64 tests return through it, and so dogpu_clamp_and_omod_per_instructionandgpu_valu_16_and_64_bit, whose programs mix f64 with f16 / integer instructions (their f16 "failures" here came from that).gpu_float_compares_randombuilds one program per type and skips only the F64 one; F32 and F16 still run.CONTRIBUTING.md,README.md: "no f64" added to the list of skip reasons.Tested
gpu::recomp::tests::gpu_*test in its own process, onmain64b3f35: 53 ok, 23 failed, 8 hung (the graphics / wave64 ones listed in #258). 12 of the failures are the ones below.gpu_f64_class_compare,gpu_rndne_f64,gpu_frexp_f64_exp_and_mant,gpu_f64_rounding_and_conversions,gpu_f64_roots,gpu_ldexp_f64,gpu_f64_compares_with_nan,gpu_f64_math_random,gpu_f64_literal_high_word,gpu_clamp_and_omod_per_instruction,gpu_valu_16_and_64_bit,gpu_float_compares_randompass withSKIPPED …: no f64(the last one runs F32 and F16, 0 failures).v_cvt_f16_f32with clamp / plain / omod alone on this host gives 0x3C00 / 0x4200 / 0x4600, as expected; after av_add_f64and av_cvt_f32_f64in the same program every result is 0, the integer add included.46695ab, rebased ontomain930e8b4: the 12 tests above skip withSKIPPED …: no f64again, each in its own process;gpu_atomic_fcmpswap_x2fails as onmain(#983). It merges cleanly with #983 (the earlier head 8b73108 conflicted there, on the_x2guards) and with #553 #750 #794 #890 #957 #982 #996 #1024 stacked together.gpu_global_atomics_and_sub_dword_access,gpu_image_sample_offsetstill pass;gpu_wave32_program_in_wave64_hardwarestill skips with "no wave64".Regression run
Test-only change (plus docs); the pair is a regression check.
From @Toons29: AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, Windows 11 build 26300, release builds,
scripts/smoke.ps1, the same retail title for 60 s,main4178e88and this head: 101 % ofmain's frames, 100 % of its peak commit, no crash, no device removal.Not in this PR:
gpu_atomic_fcmpswap_x2,gpu_atomic_fmin_fmax_x2andgpu_more_atomics_sub_dword_scratch_valualso fail here, but their programs have no doubles (fcmpswap_x2isInterlockedCompareExchange64,fmin/fmax_x2go through 64-bit integer min / max inemit.rs); they fail on D3DMetal's 64-bit atomics, which #983 handles. An earlier head of this PR skipped the two_x2ones on "no f64"; that would have dropped passing coverage on an adapter with no doubles but working 64-bit atomics (the A770 in #42), so they are out (thanks @vakaobr, @us3r40456).Not tested
f64_supported()is true and nothing is skipped, but no run shows it.cargo test --workspaceas a whole (it does not finish under CrossOver, see #258).no_doubles()too.AI use
claude-opus-5-5): ran the sweep, wrote the change and this description.@futurepro62 on GitHub · 2026-11-24 07:04 UTC · original
Full-suite run, since this PR has no test report yet. Tested exact head
8b73108(on its base64b3f35).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 701 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.gpu_clamp_and_omod_per_instruction,gpu_valu_16_and_64_bitandgpu_float_compares_randomran and passed.cargo test -p xcl --lib gpu::recomp::tests -- --test-threads=4 --nocapturewithXCL_ADAPTER=radeon(AMD Radeon integrated graphics in the 9800X3D, RDNA2, driver 32.0.21036.18) andXCL_ADAPTER=nvidia: 115 passed, 0 failed, 17 ignored each. On the Radeon nothing skipped at all (it has wave64 and doubles); on the NVIDIA card only the two wave64 tests above skipped. Sof64_supported()reads true on both, and no f64 test is skipped by mistake on either.Not tested
AI use
@vakaobr on GitHub · 2026-11-24 09:30 UTC · original
A note from #258 that applies to this PR too (my own diff had the same two tests in its list): @us3r40456's SFI0 check (https://github.com/ivall/xcl/issues/258#issuecomment-7121781360) shows
gpu_atomic_fcmpswap_x2andgpu_atomic_fmin_fmax_x2compile without the Doubles flag (SFI00xc000, 64-bit integer atomics only). They fail on D3DMetal because of its 64-bit integer atomics, not for want of doubles. They are not among the A770's failures in #42, so skipping them on "no f64" would drop passing coverage on an adapter that has no doubles. Keeping them out of theno_doubles()list leaves them failing on D3DMetal, which is the true state there.I have not checked the SFI0 flags myself; the finding is @us3r40456's. On my M5 Pro (CrossOver 26.3, D3DMetal) both tests fail at
feb49beofmac-on-main-wip(tests.rs:4581andtests.rs:4712), as on the other Macs in #258.AI use: Claude Code, Claude Opus 5.5 compared the two diffs and drafted this note.
@us3r40456 on GitHub · 2026-11-24 11:47 UTC · original
Tested on an Apple Silicon Mac, where D3DMetal reports
DoublePrecisionFloatShaderOps = 0. I compared the head 8b73108 with its base64b3f35.Tested
XCL_DXC_DIR). Builds with no new warning.gpu_float_compares_random, one per process:okwithSKIPPED <test>: no f64:gpu_f64_roots,gpu_f64_compares_with_nan,gpu_f64_class_compare,gpu_f64_literal_high_word,gpu_f64_rounding_and_conversions,gpu_f64_math_random,gpu_frexp_f64_exp_and_mant,gpu_ldexp_f64,gpu_rndne_f64,gpu_clamp_and_omod_per_instruction,gpu_valu_16_and_64_bit,gpu_float_compares_random,gpu_atomic_fcmpswap_x2andgpu_atomic_fmin_fmax_x2.gpu_more_atomics_sub_dword_scratch_valufails on both: its program has 64-bit atomics (#983).gpu_atomic_fmin_fmax_negative_zero,gpu_dword_addtid_per_lane_addresses,gpu_fract_f32_edges,gpu_ldexp_f32andgpu_valu_float_and_intpass on both.*_x2atomic tests skip here withno f64, but their programs have no doubles. On this host they fail because of the 64-bit atomics (#983). On an adapter that has no doubles but working 64-bit atomics (the A770 in #42), they would be skipped although they pass.Not tested
AI use
@shortside on GitHub · 2026-11-24 11:56 UTC · original
Test report from a second Mac, head
8b73108against its merge base64b3f35.Tested
x86_64-pc-windows-msvcwith clang-cl / lld-link 23.1.6 and an xwin SDK 10.0.26100, Rust 1.100.0, debug. The lib test binary run under Wine, one test per process (--exact --nocapture, 60 s cap).f64, plusgpu_float_compares_random,gpu_clamp_and_omod_per_instructionandgpu_valu_16_and_64_bit(16 tests): base 4 passed, 12 failed; head 4 passed, 12 passed withSKIPPED … no f64, 0 failed.gpu_clamp_and_omod_per_instruction,gpu_f64_class_compare,gpu_f64_compares_with_nan,gpu_f64_literal_high_word,gpu_f64_math_random,gpu_f64_roots,gpu_f64_rounding_and_conversions,gpu_float_compares_random,gpu_frexp_f64_exp_and_mant,gpu_ldexp_f64,gpu_rndne_f64,gpu_valu_16_and_64_bit. The 4 that pass on both are the non-GPU ones.Not tested
AI use
@Lucasyudi on GitHub · 2026-11-24 12:37 UTC · original
@vakaobr @us3r40456 right, thanks:
fcmpswap_x2isInterlockedCompareExchange64andfmin/fmax_x2go through 64-bit integer min / max (emit.rs,rmw64/float_minmax_mem), so neither program holds a double. Head01a236ctakes both out ofno_doubles(); they fail again on D3DMetal, as onmain, and #983 is where they belong. The PR now skips 11 tests whole plus the F64 part ofgpu_float_compares_random(the 12 @shortside counted).@futurepro62 thanks for the Windows run on the 5070 Ti and the Radeon; this head only removes two skips, so nothing changes where
f64_supported()is true.AI-assisted (Claude Code, Claude Opus 5.5).
@mikebuckets171 on GitHub · 2026-11-24 16:25 UTC · original
#787 measured on a third Mac (M5 Pro, CrossOver 26 + D3DMetal): base
47efa2e→ head01a236c, each test in its own process.The host flag, from a plain D3D12 program (no XCL, reads no files):
DoublePrecisionFloatShaderOps 0,OutputMergerLogicOp 1,MinPrecisionSupport 0x2(16-bit),ROVs 1,TypedUAVLoadAdditionalFormats 1. So the premise holds here independently of the other two Mac reports.Base
47efa2e: all 12 tests the gate covers fail. The gated set is 12, not 11 —gpu_float_compares_randomis gated through its helperfloat_compares_random(), which a scan of the#[test]fns alone misses. Representative assertions:gpu_f64_class_compare—tests.rs:520:5,left: (0, 0),right: (4294967295, 4294967295)gpu_rndne_f64—697:9,left: 0,right: 9223372036854775808gpu_frexp_f64_exp_and_mant—756:9,left: 0,right: 4605212093963042816gpu_clamp_and_omod_per_instruction—1074:9,left: 0.0,right: 0.3gpu_f64_literal_high_word—7035:13,left: 0.0,right: 2.5gpu_valu_16_and_64_bit—2707:9,left: 0,right: 3203351424, onv_add_f16 keeps the high halfgpu_float_compares_random—6526:5,left: 25107,right: 0gpu_f64_roots(894:5),gpu_f64_rounding_and_conversions(854:5),gpu_ldexp_f64(952:5),gpu_f64_compares_with_nan(6232:5),gpu_f64_math_randomHead
01a236c: the same 12 all reportSKIPPED …: no f64and the process exits 0, printingno doubles in shaders on this GPU – skipping the f64 instructions. Reproduced on a second pass ofgpu_f64_math_random,gpu_float_compares_randomandgpu_f64_literal_high_word(0.05 s, 0.44 s, 0.04 s against 0.36-0.58 s when they run). Five controls unchanged on both sides,ok:gpu_valu_float_and_int,gpu_fract_f32_edges,gpu_ldexp_f32,gpu_atomic_fmin_fmax_negative_zero,gpu_dword_addtid_per_lane_addresses.What this host's f64 fault actually is, which is worth having on the record for the skip. It is wrong values from f64 operands, not missing writes.
gpu_float_compares_randomprints the breakdown for one program:wave32 F32: 1600 lanes x 33 compares, 0 distinct failures,wave32 F16: 1600 lanes x 33 compares, 0 distinct failures,wave32 F64: 1600 lanes x 33 compares, 25107 distinct failures— withF64 CMPX LT(-1.00375e2, 7.3125e1) = falseamong them. The f32 and f16 halves of the same program compute correctly. That is a different fault from the 64-bit atomics, where a program holding one produces no writes at all (my probe readback note higher up in this thread).One interaction, because it changed between heads of this PR. At
01a236cthe two 64-bit-atomic tests are not gated and still fail here:gpu_atomic_fcmpswap_x2tests.rs:4647:9,left: 4609434218613702656(0x3FF8_0000_0000_0000, the test's ownINIT, never replaced),right: 12682136550675316736;gpu_atomic_fmin_fmax_x24778:13,left: -inf,right: 42.5. In a tree that also carries #983'sno_int64_atomics()gate —47efa2eplus cherry-picks of #890 #957 #982 #983 #996 #1024 #787, measured today — both becomeSKIPPED … no 64-bit atomics/ok, and all 12 f64 tests skip as intended. So the two PRs cover different faults and neither skip hides the other's problem. That also matches @us3r40456's 14 tests on the earlier head: 12 here plus the two that8b73108also gated before @Lucasyudi moved them to the atomics gate.Not tested: Windows — this machine has no Windows host. Counts, line numbers, timings and result codes only; no game data.
Host: macOS 27.2.1 (Apple silicon, M5 Pro, 48 GB), CrossOver 26 with D3DMetal, Rust 1.100.0,
x86_64-pc-windows-gnullvm(LLVM-MinGW, clang 23.1.6),--release --locked. AI use: GPT-6 Luna built the trees, ran the tests and drafted this; the assertions, line numbers and timings are quoted from those runs.@Lucasyudi on GitHub · 2026-11-24 16:34 UTC · original
@mikebuckets171 thanks for the third Mac. One correction on the fault, since it bears on why two of these tests skip whole:
gpu_float_compares_randombuilds a separate program per type (for ty in ["F32", "F64", "F16"], each through its ownkernel_wave,tests.rsaround 6480–6493 at this head), so its F32 and F16 lines come from programs with no f64 in them and do not show that f64 leaves the rest of a program intact. What I measured with both in one program (the probe in the description) is the other way:v_add_nc_u325 + 7 reads 12 alone and 0 next to av_add_f64/v_cvt_f32_f64, andv_cvt_f16_f32with clamp / omod gives the right values alone and 0 next to them. A compare that comes out false, like yourCMPX LT(-100.375, 73.125), is what an all-zero result looks like too. That is whygpu_clamp_and_omod_per_instructionandgpu_valu_16_and_64_bitskip whole rather than only their f64 asserts.AI-assisted (Claude Code, Claude Opus 5.5).
@mikebuckets171 on GitHub · 2026-11-24 16:40 UTC · original
#787 measured on a third Mac (M5 Pro, CrossOver 26 + D3DMetal): base
47efa2e→ head01a236c, each test in its own process.The host flag, from a plain D3D12 program (no XCL, reads no files):
DoublePrecisionFloatShaderOps 0,OutputMergerLogicOp 1,MinPrecisionSupport 0x2(16-bit),ROVs 1,TypedUAVLoadAdditionalFormats 1. So the premise holds here independently of the other two Mac reports.Base
47efa2e: all 12 tests the gate covers fail. The gated set is 12, not 11 —gpu_float_compares_randomis gated through its helperfloat_compares_random(), which a scan of the#[test]fns alone misses. Representative assertions:gpu_f64_class_compare—tests.rs:520:5,left: (0, 0),right: (4294967295, 4294967295)gpu_rndne_f64—697:9,left: 0,right: 9223372036854775808gpu_frexp_f64_exp_and_mant—756:9,left: 0,right: 4605212093963042816gpu_clamp_and_omod_per_instruction—1074:9,left: 0.0,right: 0.3gpu_f64_literal_high_word—7035:13,left: 0.0,right: 2.5gpu_valu_16_and_64_bit—2707:9,left: 0,right: 3203351424, onv_add_f16 keeps the high halfgpu_float_compares_random—6526:5,left: 25107,right: 0gpu_f64_roots(894:5),gpu_f64_rounding_and_conversions(854:5),gpu_ldexp_f64(952:5),gpu_f64_compares_with_nan(6232:5),gpu_f64_math_randomHead
01a236c: the same 12 all reportSKIPPED …: no f64and the process exits 0, printingno doubles in shaders on this GPU – skipping the f64 instructions. Reproduced on a second pass ofgpu_f64_math_random,gpu_float_compares_randomandgpu_f64_literal_high_word(0.05 s, 0.44 s, 0.04 s against 0.36-0.58 s when they run). Five controls unchanged on both sides,ok:gpu_valu_float_and_int,gpu_fract_f32_edges,gpu_ldexp_f32,gpu_atomic_fmin_fmax_negative_zero,gpu_dword_addtid_per_lane_addresses.What this host's f64 fault actually is, which is worth having on the record for the skip. It is wrong values from f64 operands, not missing writes.
gpu_float_compares_randomprints the breakdown for one program:wave32 F32: 1600 lanes x 33 compares, 0 distinct failures,wave32 F16: 1600 lanes x 33 compares, 0 distinct failures,wave32 F64: 1600 lanes x 33 compares, 25107 distinct failures— withF64 CMPX LT(-1.00375e2, 7.3125e1) = falseamong them. The f32 and f16 halves of the same program compute correctly. That is a different fault from the 64-bit atomics, where a program holding one produces no writes at all (my probe readback note higher up in this thread).One interaction, because it changed between heads of this PR. At
01a236cthe two 64-bit-atomic tests are not gated and still fail here:gpu_atomic_fcmpswap_x2tests.rs:4647:9,left: 4609434218613702656(0x3FF8_0000_0000_0000, the test's ownINIT, never replaced),right: 12682136550675316736;gpu_atomic_fmin_fmax_x24778:13,left: -inf,right: 42.5. In a tree that also carries #983'sno_int64_atomics()gate —47efa2eplus cherry-picks of #890 #957 #982 #983 #996 #1024 #787, measured today — both becomeSKIPPED … no 64-bit atomics/ok, and all 12 f64 tests skip as intended. So the two PRs cover different faults and neither skip hides the other's problem. That also matches @us3r40456's 14 tests on the earlier head: 12 here plus the two that8b73108also gated before @Lucasyudi moved them to the atomics gate.Not tested: Windows — this machine has no Windows host. Counts, line numbers, timings and result codes only; no game data.
Host: macOS 27.2.1 (Apple silicon, M5 Pro, 48 GB), CrossOver 26 with D3DMetal, Rust 1.100.0,
x86_64-pc-windows-gnullvm(LLVM-MinGW, clang 23.1.6),--release --locked. AI use: GPT-6 Luna built the trees, ran the tests and drafted this; the assertions, line numbers and timings are quoted from those runs.@JJAutoCompare on GitHub · 2026-11-25 00:43 UTC · original
Intel Arc verification at
46695abf51ea2ceaae6b11eb4ed4f06440d5f383Tested on Intel Arc A770 (driver
32.0.101.9175), Ryzen 7 3800X, Windows 11 build26200.9974, Rust1.100.0MSVC debug, and DXC/DXIL1.9.2609.5. The adapter reportsDoublePrecisionFloatShaderOps=0.cargo test -p xcl --lib --no-runbuilt successfully. I ran the resulting lib test binary in separate processes withXCL_ADAPTER=A770andgpu::recomp::tests::<name> --exact --nocapture --test-threads=1.gpu_f64_class_compareandgpu_valu_16_and_64_biteach emittedSKIPPED ...: no f64and exited 0. These are two full skips.gpu_ldexp_f32passed without skips.gpu_float_compares_randomemitted a partialno f64skip and ran F32 and F16. The F32 comparisons had zero distinct failures. F16 failed with 164 distinct subnormal discrepancies, reproduced on a rerun. This run confirms the FP64 gating while exposing a separate F16 issue.Across the four first runs, libtest reported 3 passed, 1 failed, 0 ignored. The 3 include the two full skips above. #927 contains an overlapping capability probe and the same f64 gates, plus separate F16 tolerance and runtime fixes. The two heads conflict in
runner.rsandtests.rs. Clean workspace baselineNot tested the full suite or the PR base in this focused check. AI use Codex in T3 Code (
gpt-6.2-sol) for test execution and reporting.@Toons29 on GitHub · 2026-11-25 02:59 UTC · original
Regression run of
46695abfon the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon4178e888, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 101 % of
main's frames, 100 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; I checked the blocks before posting.@Lucasyudi on GitHub · 2026-11-25 03:49 UTC · original
@Toons29 thanks for the pairs here and on #1303, #1311 and #1313; pasted under Regression run in all four, with your hardware line. @JJAutoCompare thanks for the A770 run: the F16 subnormal failures there come from a program with no f64 in it (
float_compares_randombuilds one per type), so they are outside this PR; #927's F16 flush tolerance is the part that addresses them.@DavidM1911 on GitHub · 2026-11-25 11:08 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
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.