Direct DXIL: lower i64 min/max as compare/select #1936
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1946"
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?
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-24T23:46:50Z.
Follow-up to #1679. On the Radeon RX 6800M with Windows driver
30.0.13002.13003, eachdx.op.binary.i64signed or unsigned min/max variant suspended the D3D12 device during pipeline creation (0x887A0005). This lowers those four forms to i64 comparisons andselect. The direct-DXIL source hash from #1947 keys the translated cache, so no manual translator-version bump is needed.What is in it
ops.rs: use signed or unsigned i64 comparison and select forIMax,IMin,UMax, andUMin; other binary operations keep their current path.ops_tests.rs: compare both output words against CPU signed and unsigned min/max across 32 lanes, including equal high words with different low words.Tested
71acf1f073985faa62ae89701ed35e27199bec1c, based on main6d12f58a229bc73889878a448c64dc3af25eeba0. Windows 11, AMD Radeon RX 6800M, driver30.0.13002.13003, DXC/DXIL 1.9.2609.5,XCL_ADAPTER=6800M,XCL_REQUIRE_GPU=1,XCL_DIRECT_DXIL=1.cargo test --locked -p xcl --lib -j 2 gpu::dxil::ops_tests::int64_bit_ops_match_cpu -- --exact --test-threads=1 --nocapture: 1 passed, 0 failed, 0 ignored, 0 SKIPPED.cargo test --locked -p xcl --lib -j 2 gpu::dxil::ops_tests:: -- --test-threads=2 --nocapture: 24 passed, 0 failed, 0 ignored, 0 SKIPPED.cargo build --locked --release -p xcl --bins -j 2: passed.f90626676934293a7c3c35cccd77c06299bce32d, the focused i64 GPU test passed on an RX 6750 XT. An independent RTX 3080 Ti run reported 1,154 passed, 0 failed, 46 ignored across the workspace; an RX 6600 run of main2898511plus this change and #2192 reported 1,364 passed, 0 failed, 46 ignored. These are not tests of the rebased commit.71acf1fand its base6d12f58on an RX 7600 XT and Ryzen 5 9600X iGPU. No run lost the device. The seed 783 mismatch count went from 32 to 0 on both GPUs. The RX 7600 XT full suite withXCL_DIRECT_DXIL=1had one extra failure ina_dispatch_with_a_pipeline_still_building_waits_at_the_submit. That test passed 80 of 80 isolated reruns across the two trees and GPUs. Independent report with full counts.SKIPPEDnotices. The focused i64 test passed 3/3 runs in each of HLSL and direct-DXIL modes; the fullgpu::dxil::ops_tests::group passed 24/24. This was a library run, not a title run. Independent NVIDIA report.Regression run
Release binaries, same owned title, RX 6800M, 7 seconds.
Main:
PR head:
Not tested
AI use
OpenAI Codex (GPT-6.2) implemented the change and tests in the existing commit; Codex refreshed the rebased-head focused tests, release build, smoke comparison, and this report. Codex also checked the independent results and drafted the description update.
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-25T00:11:10Z.
Checked on an RTX 3070 (Ampere, driver 616.56, Windows 11, debug build):
b527347,dxil::/bvh::units pass (121 passed). Thegpu_tests pass withXCL_DIRECT_DXIL=0and1(110 passed each, same asmain).FUZZ_SEED=540 cargo test -p xcl --lib -- debug_seed --ignoredonmain80f4819reportsGPU run: 0 mismatching resultshere (357 instructions,gpu_safe true). It doesn't reproduce on NVIDIA, so it looks like the RX 6800M driver rather than the translator's lowering.This PR also bumps
TRANSLATOR_VERSION7→8, as #1950 and #1952 do. Whichever merges later needs the next number.AI-assisted (Claude Code). Synthetic tests only.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T02:50:32Z.
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!
Imported from ivall/xcl. Originally posted by fallow64 on 2026-11-25T04:03:33Z.
Confirmed on AMD RX 6750 XT, driver
32.0.21045.5002, Windows 11 build 26200, exact headf9062667.int64_bit_ops_match_cpu: 1 passed, 0 failed, no skips.Stacked after #1974, this also clears the seed-783 i64
IMaxmismatch.Not tested: full suite or retail title.
AI use: OpenAI Codex (GPT-5) ran and analyzed the test; I reviewed the result.
Thank you!
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-25T11:32:42Z.
Independent Windows run on f906266. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, DXC/DXIL 1.8.2502.11, debug.
cargo build --offline --locked --workspacepassed.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapturereported 1,154 passed, 0 failed, 46 ignored, with 25 runtime skip notices included in Cargo's pass count. The stock i64 GPU test passed.A separate Direct DXIL fixture loaded both operands at runtime. Across 32 lanes it checked all four signed and unsigned min/max operations, including signed extrema, equal values, and low-word ordering when the high words were equal. DXC validated the shader. Disassembly showed four i64 compare/select pairs and zero i64 min/max intrinsic calls. All 128 full-width GPU results matched Rust. The original intrinsic path also validated and matched all 128 results on the RTX, with four intrinsic calls in its disassembly.
cargo test --offline --locked -p xcl --lib scratch_i64_min_max_variable_operands -- --nocapture --test-threads=1passed 1/0/0 with zero skips in each arm. This establishes NVIDIA regression coverage. The older AMD driver behavior and retail were outside this check. AI-assisted. Codex (GPT-6, exact variant unavailable) wrote the fixture, ran the tests, and drafted this report.Imported from ivall/xcl. Originally posted by thiagocalile on 2026-11-25T19:35:17Z.
Independent Windows AMD Radeon RX 6600 (RDNA2, 8 GB VRAM, native wave64) verification of
main2898511+#1946(f906266) +#2192(1d8341a): all 1,364 workspace tests pass with 0 failures (down from 1 failure,gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, on unmodifiedmain2898511).Tested
32.0.21045.29003,XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Rust1.100.0(stable-x86_64-pc-windows-msvc), DXC1.8.2502.11.main(2898511af1c038a2ef809719e9b6f89e5675c422):XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 1,362 passed, 1 failed, 46 ignored (11skipped; failed:gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1).#1946(f906266) +#2192(1d8341a) ontomain2898511:XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 1,364 passed, 0 failed, 46 ignored (11skipped).Regression run (
scripts/smoke.ps1 -Seconds 60, release builds,XCL_ADAPTER=radeon)main(2898511):main2898511+#1946(f906266) +#2192(1d8341a):Not tested:
#1946and#2192individually in isolation, NVIDIA/Intel GPUs, Linux/RADV, or world load past the 60 s smoke window.AI use: Antigravity (Gemini 4 Neon) ran the merge, workspace tests, and smoke runs and drafted this report; the account owner reviewed and approved posting.
Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T21:31:25Z.
Review: COMMENTED
No concrete source-level defect found. Signed/unsigned compare predicates and strict-select semantics are correct, Int64Ops is retained, and the path avoids AMD-problematic binary i64 min/max; focused lane/half tests are good. Current head lacks visible Windows build/test and description reports device-loss cascades in full-suite run without same-base comparison. Refresh full GPU/Windows evidence after investigation; equality cases would be a minor additional guard.
Imported from ivall/xcl. Originally posted by cindertheblue on 2026-11-25T23:04:42Z.
Same-base full-suite runs of the rebased head
71acf1fagainstmain6d12f58on two AMD GPUs, as asked in the review. No device loss in any run, and the PR adds no failure. On the iGPU it removes the one failuremainhas (seed 783).Tested
gfx1036), driver 32.0.21045.5002, on the same machine. Windows 11 Home 26200.9974, rustc 1.99.1, DXC 1.8.2502.11 (SDK 10.0.26100), debug. Each tree in its own folder and Cargo target,cargo build --workspacefirst, no local changes.cargo test --workspace --no-fail-fast -- --test-threads=4, once each:main6d12f58XCL_DIRECT_DXIL=1XCL_DIRECT_DXIL=1fuzz_validate_and_gpu_1stops atseed 722on the RX 7600 XT on both trees (#2192). On the iGPU it stops atseed 783: res[64] ..., CPU 0x7fffffffonmainand passes with this PR.XCL_DIRECT_DXIL=1,offline_compute_pipeline_is_reused_by_a_second_process(#1674) fails on both trees and both GPUs.XCL_DIRECT_DXIL=1run of this PR also faileda_dispatch_with_a_pipeline_still_building_waits_at_the_submitonce (left: 37, right: 421). Run alone 20 times withXCL_DIRECT_DXIL=1on each GPU and each tree, it passed 80 of 80, so I read it as a timing flake under the full-suite load, not this change.0x887A0005or device-removed lines in any of the eight logs. The same 8SKIPPEDlines in all eight.debug_seed,FUZZ_SEED=783, with and withoutXCL_DIRECT_DXIL=1: 32 mismatching onmainand 0 with this PR, on both GPUs.int64_bit_ops_match_cpuwithXCL_REQUIRE_GPU=1 XCL_DIRECT_DXIL=1: passes 3 of 3 on each GPU, and all 24ops_testspass on each. With onlyops.rsrestored from6d12f58it also passes on both, so these drivers don't have the RX 6800M pipeline-creation failure, and the test can't tell the two lowerings apart here.Not tested: a release build, a title or smoke run, the RX 6800M driver
30.0.13002.13003, NVIDIA.AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this comment from their output.
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T06:00:36Z.
NVIDIA test report for
71acf1f: RTX 3070 8 GB (Ampere, driver 616.56), Windows 11 26100, Rust 1.100.0, debug.cargo test -p xcl --lib -- --skip hle::xaudio2 --test-threads=4(thehle::xaudio2tests hang on this machine, onmaintoo): this PR: 1289 passed, 0 failed, 26 ignored; 25 SKIPPED lines (21 no-wave64, 3 f16 per-lane-form refusals under #1426, 1 driver cache).gpu::dxil::ops_tests::int64_bit_ops_match_cpu,--test-threads=1 --nocapture, 3 runs each:XCL_DIRECT_DXIL=03/3 passed,XCL_DIRECT_DXIL=13/3 passed, 0 SKIPPED.gpu::dxil::ops_tests::once: 24 passed, 0 failed.Lib tests only; no title run.
AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T06:51:29Z.
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
Imported from ivall/xcl. Originally posted by Granite900 on 2026-11-26T16:33:07Z.
Tested
1d8341abon an RX 9070 XT (RDNA4), Adrenalin 26.11.2, Windows 11, DXC 1.9.2609.5: seed 722 is fixed on RDNA4 too (first_active_lane_value_survives_a_divergent_switchpasses).On this PR alone,
fuzz_validate_and_gpu_1then fails on seed 783, which was hidden behind 722. That's a separate AMD i64 IMax fold that #1946 fixes. Combined with #2231 and #1946 onmain, all fuzz tests pass. Details and the table are in #2115.Not tested: full suite, retail titles. Report drafted with Claude (Claude Opus 5.5) from my runs.
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-27T06:56:00Z.
Thanks for the review. The current head is
71acf1f, based on6d12f58. The Windows build and test job passed on that exact head. Windows CI@cindertheblue ran the full workspace suite on those two commits with an RX 7600 XT and Ryzen 5 9600X iGPU, both with and without
XCL_DIRECT_DXIL=1. None of the eight runs lost the device. In the focused seed-783 check, mismatches fell from 32 to 0 on both GPUs. The head had one extra RX 7600 XT direct-mode failure ina_dispatch_with_a_pipeline_still_building_waits_at_the_submit. That test passed 80/80 isolated direct-mode reruns, 20 per commit and GPU. The full-suite timing failure remains unexplained. Same-base AMD runs and isolated rerunsOn my RX 6800M, the rebased head passed the focused i64 test and all 24 DXIL operation tests. The focused test covers equal high words with unequal low words. A full same-base suite on the RX 6800M remains unrun, and the short retail smoke pair covered startup without exercising this lowering. Exact-head test and smoke details
OpenAI Codex (GPT-6.2 Sol) checked the evidence and helped draft this reply.
Imported from ivall/xcl. Originally posted by throny on 2026-11-27T22:28:43Z.
merge-check claim
head:
71acf1f073Imported from ivall/xcl. Originally posted by throny on 2026-11-27T23:13:02Z.
merge-check
base:
2c717a04head:
71acf1f073merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1466 passed, 0 failed, 47 ignored (the fix targets an AMD driver; on this card the test passes with and without it) (26 SKIPPED lines); base alone: 1466 passed, 0 failed, 47 ignored
review: none. Signed and unsigned compare, then select; equal values give the same arm either way. The test's lanes with equal high words are really equal there.
performance: negligible; direct DXIL is opt-in and only its cache is re-keyed (reasoned).
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).
Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T01:51:43Z.
merge-check claim
head:
71acf1f073Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T02:44:26Z.
merge-check
base:
753e8b1a25head:
71acf1f073merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1512 passed, 0 failed, 47 ignored, 25 SKIPPED: 21 no wave64, 3 per-lane f16/f32 forms refused (#1426 semantics), 1 no heap windows; failing: none. The suite ran on this PC at the same time as 6 other PRs' suites, in one queued job.
review: none. Whole diff read (ops.rs binary(): i64 IMax/IMin/UMax/UMin lowered to icmp + select; ops_tests.rs int64_bit_ops_match_cpu extended to all four with signed/unsigned bounds and equal high words). Predicates match the ops (sgt/slt/ugt/ult, select a else b); other i64 binaries still use the intrinsic.
performance: reasoned, not measured: shaders with 64-bit integer min/max get a compare and select instead of the intrinsic; no change otherwise.
verdict: safe to merge
hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc, debug test profile; trial merge 96bb839d3e01fb94cc96c67ddef3ca7c5035a5a6 (local, not pushed). Claude Code: Claude Opus 5.5 (coordination, full-diff review, draft).