Skip to content

Tests: verify direct DXIL vs HLSL GPU parity for wide, paired, d16, and ADDTID LDS ops - #2093

Open
ramon-victor wants to merge 1 commit into
xcl-dev:mainfrom
ramon-victor:tests/gpu-dxil-lds-wide-d16-parity
Open

ramon-victor wants to merge 1 commit into
xcl-dev:mainfrom
ramon-victor:tests/gpu-dxil-lds-wide-d16-parity

Conversation

@ramon-victor

Copy link
Copy Markdown
Contributor

Add GPU differential parity tests between the direct RDNA2 → DXIL translator (xcl::gpu::dxil::kernel::translate, validated with dxil.dll) and the HLSL + DXC path (xcl::gpu::recomp) for lower_mem.rs LDS wide, paired/ST64, sub-dword/D16, and ADDTID load/store instructions across wave32 and wave64 (split wave64 on wave32-only GPUs). Test-only change; no runtime files modified.

What is in it

  • crates/xcl/tests/gpu_dxil_lds_wide_d16_parity.rs:
    • direct_dxil_lds_wide_64_96_128_parity: DS_WRITE_B64/B96/B128 + S_BARRIER + cross-lane DS_READ_B64/B96/B128 with OFFSET1 and V_CMPX_GT_U32 inactive-lane EXEC masking.
    • direct_dxil_lds_two_address_and_st64_parity: DS_WRITE2_B32/DS_READ2_B32 (including VDST == ADDR register overlap), DS_WRITE2_B64/DS_READ2_B64, DS_WRITE2ST64_B32/DS_READ2ST64_B32 (256-byte stride), and DS_WRITE2ST64_B64/DS_READ2ST64_B64 (512-byte stride).
    • direct_dxil_lds_subdword_and_d16_parity: DS_WRITE_B8, DS_WRITE_B8_D16_HI, DS_WRITE_B16, DS_WRITE_B16_D16_HI across neighbouring lanes sharing dwords, read back with DS_READ_{U8,I8,U16,I16} and all six DS_READ_{U8,I8,U16}_D16{,_HI} variants preserving the untouched 16-bit half of VDST.
    • direct_dxil_lds_addtid_and_exec_mask_parity: DS_READ_ADDTID_B32 and DS_WRITE_ADDTID_B32 addressing via M0[15:0] + offset + 4*lane (with non-zero high half in M0) and EXEC-masked even-lane updates.

Tested

  • Hardware: NVIDIA GeForce RTX 3070 (8 GiB, driver 621.24, wave32), AMD Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.99.0 (x86_64-pc-windows-msvc), DXC 1.8.2502.11 (Windows SDK 10.0.26100.0), debug build.
  • cargo test -p xcl --test gpu_dxil_lds_wide_d16_parity -- --nocapture: 4 passed, 0 failed, 0 ignored (0 SKIPPED; each test ran both wave32 and split wave64 through both Direct DXIL and HLSL+DXC).
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4) on head 5e4d004: 1158 passed, 0 failed, 46 ignored (24 SKIPPED GPU tests: 20 no wave64, 3 per-lane form #1426, 1 no heap windows).

Not tested

  • Native 64-lane hardware wave64 (AMD RDNA2/3/4) — RTX 3070 only supports 32-lane waves, so wave64 ran in split-wave64 mode.
  • Release build and retail game titles (test-only PR, no runtime changes).

AI use

  • Antigravity (Google DeepMind; Gemini frontier model — exact minor version not exposed to the agent): wrote the integration test file, ran the full test suite on the RTX 3070, and drafted this PR description.

@JJAutoCompare

Copy link
Copy Markdown

Arc A770 test report for XCL PR #2093

Tested

  • PR #2093 was open at 5e4d004939bee3aefe9079d5994c590a7920e17c before and after the run. The existing checkout was clean and detached at that commit. The live discussion contained zero comments or reviews before and after testing. The PR description records the author's RTX 3070 results.
  • STOR-WINLAB ran Windows 11 Enterprise Evaluation build 26200.9974, with an AMD Ryzen 7 3800X (6 cores and 12 logical processors exposed) and an Intel Arc A770 on driver 32.0.101.9175. Rust and Cargo were 1.100.0 on x86_64-pc-windows-msvc. The test logged dxcompiler and dxil 1.9.2609.5 loaded from %LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64.
  • Prebuilt outside the Arc mutex with cargo test --locked -p xcl --test gpu_dxil_lds_wide_d16_parity --no-run. Cargo exited 0 after 36.57 s in the unoptimized test profile. Used CARGO_BUILD_JOBS=2, CARGO_INCREMENTAL=0, CARGO_PROFILE_DEV_DEBUG=0, CARGO_PROFILE_TEST_DEBUG=0, CARGO_TARGET_DIR=L:/XclTooling/pr2014-1c971de6/target, and TEMP and TMP under L:/XclTooling/pr2093/temp.
  • Ran the prebuilt executable from the crates/xcl package directory with XCL_ADAPTER=A770 and XCL_DXC_DIR set to the DXC directory above. The mutex wrapper ran in a local PowerShell.exe -NoProfile -ExecutionPolicy RemoteSigned child. The callback launched the executable via System.Diagnostics.Process with these exact arguments and recorded its stdout, stderr, and exit code separately.
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
    & 'L:/XclTooling/pr2014-1c971de6/target/debug/build/xcl/d3d638d6f97ebe8d/out/gpu_dxil_lds_wide_d16_parity-d3d638d6f97ebe8d.exe' direct_dxil_lds_subdword_and_d16_parity --exact --nocapture --test-threads=1
}
  • 1 passed, 0 failed, 0 ignored, 0 GPU skips, 3 filtered out in 1.54 s. The test and mutex wrapper both exited 0. The wrapper recorded the mutex release at 04:09:38 UTC. The Cargo target slot was released after the run.

The fixture validated the direct DXIL and compiled the HLSL reference with DXC for main at cs_6_6. Both backends dispatched and matched bit for bit in VGPRs v10–v21 for every lane of logical wave32 and split logical wave64, accounting for 384 and 768 compared output words, respectively. The split mode follows from the checked-in fixture's mode selection and the A770 capability recorded on STOR-WINLAB (D3D12 wave lane range 8–32).

Expected-value checks also passed. Neighboring lanes packed four bytes or two halfwords per LDS dword using DS_WRITE_B8, DS_WRITE_B16, and their D16_HI forms. Readback checked that the high-input forms selected the source bits starting at bit 16, and that U8/I8 and U16/I16 reads zero-extended or sign-extended across the sign boundary at lane 8. All six U8, I8, and U16 D16/D16_HI reads preserved the other half of the seeded destination 0x5A5A1234. The I8 D16 forms sign-extended to 16 bits before inserting the result.

Not tested

The three other fixtures in this integration target, the workspace suite, retail-title smoke, native hardware wave64, other adapters and drivers, and release builds.

AI use

T3 Code / Codex (gpt-6.2-sol) ran the checked-in fixture, verified the live PR and logs, and wrote this report.

@DarkPanda69

Copy link
Copy Markdown

Native 64-lane wave64 run on AMD, which this PR lists as not tested (the RTX 3070 ran wave64 split; the other report here is Arc).

Tested: pass, head 5e4d004 applied on its base main cbc296a, debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X, DXC 1.9.2602.17. cargo test -p xcl --test gpu_dxil_lds_wide_d16_parity -- --test-threads=4 with XCL_ADAPTER set to each GPU:

  • AMD RX 9070 XT (RDNA4), driver 32.0.32029.2010, waves 32..64: 4 passed, 0 failed, 0 SKIPPED.
  • NVIDIA RTX 3060, driver 32.0.16.1088: 4 passed, 0 failed, 0 SKIPPED.

AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.

@JoaoPauluu

Copy link
Copy Markdown

A run with vkd3d-proton as the host D3D12, so both the direct DXIL and the HLSL → DXC output go through dxil-spirv and the NVIDIA Vulkan driver: all 4 parity tests pass, none skipped.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from Linux: docs/linux.md, scripts/linux and Wine start-up checks for vkd3d-proton and DXVK (#154, #241) #257, DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. 5e4d004 as it is (merge base with main cbc296a), no uncommitted changes. The gpu_dxil_lds_wide_d16_parity test binary runs under Wine, one test per process.
    • direct_dxil_lds_addtid_and_exec_mask_parity: ok
    • direct_dxil_lds_subdword_and_d16_parity: ok
    • direct_dxil_lds_two_address_and_st64_parity: ok
    • direct_dxil_lds_wide_64_96_128_parity: ok

Not tested

  • wave64 forms (this GPU has 32-lane waves only), the whole suite on this head, native Windows, AMD.

AI use

  • Claude Code (Claude Opus 5.5) built the commit, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

Thanks!

@throny throny added the off-goal Does not bear on the current goal (world loading); waits until it is reached label Nov 25, 2026
@Decodere

Copy link
Copy Markdown
Contributor

Independent desktop NVIDIA verification of PR #2093 at head 5e4d004939bee3aefe9079d5994c590a7920e17c (1 commit; exact parent & merge-base: cbc296ab65a2661a61e3e2da109134bcd5319f60, 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 GPU parity tests & build (5e4d0049)

Command Result
cargo test --release -p xcl --test gpu_dxil_lds_wide_d16_parity -- --nocapture (3 consecutive runs) 4 passed; 0 failed; 0 ignored; 0 filtered out × 3 (0.57s, 0.32s, 0.31s, 0 skipped; live RTX 4060 wave32 + split-wave64 execution of direct_dxil_lds_addtid_and_exec_mask_parity, direct_dxil_lds_subdword_and_d16_parity, direct_dxil_lds_two_address_and_st64_parity, and direct_dxil_lds_wide_64_96_128_parity)
cargo build --release -p xcl Clean build (0.06s incremental after --test build, exit 0, 0 new warnings)

Paired quiet 60 s retail smoke (title: 29640639)

Exact parent & merge-base (cbc296ab65a2661a61e3e2da109134bcd5319f60, cached baseline on the same machine):

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

PR #2093 (5e4d004939bee3aefe9079d5994c590a7920e17c):

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

Limits of coverage

  • This PR is test-only (crates/xcl/tests/gpu_dxil_lds_wide_d16_parity.rs, 0 production-code changes); all 4 direct-DXIL vs. HLSL LDS wide/paired/d16/ADDTID differential parity tests executed and passed 3/3 on desktop RTX 4060 across wave32 and split-wave64 (gpu_modes() omits native Wave64 on Wave32-only Ada).
  • The 60 s retail smoke confirms non-regression of the unchanged runtime binary at this commit (single-run frame/commit delta vs. cached parent reflects normal startup variance, not this PR).

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

@BBareth

BBareth commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

merge-check claim
head: 5e4d004

@github-actions github-actions Bot added area:tests Unit, integration, e2e tests, or testtitle needs-1st-check Passes gates; needs first independent merge-check (#3041) labels Nov 30, 2026
@BBareth

BBareth commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

merge-check
base: 9dfbe3e
head: 5e4d004
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2889 passed, 1 failed, 51 ignored; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, which fails on the base alone too (base: 2885 passed, 1 failed, 51 ignored, 28 SKIPPED lines). 28 SKIPPED lines, as on the base. The new test binary tests/gpu_dxil_lds_wide_d16_parity.rs ran 4 tests, all passed.
review: no blocking finding; one new integration test file, read; test-only, no file or process access. Direct DXIL against HLSL + DXC for LDS loads and stores (wide 64/96/128-bit, two-address, sub-dword and D16, ADDTID under EXEC), with the direct DXIL validated first and inactive lanes checked for being left alone. This card has no native wave64, so only the wave32 / split forms can have run here. Same family as #1823 and #2276; not a duplicate.
performance: none; tests only.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.

@github-actions github-actions Bot added needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) and removed needs-1st-check Passes gates; needs first independent merge-check (#3041) labels Nov 30, 2026
@saintwolf

Copy link
Copy Markdown
Contributor

merge-check claim
head: 5e4d004

@saintwolf

Copy link
Copy Markdown
Contributor

merge-check
base: 9dfbe3e
head: 5e4d004
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2889 passed, 1 failed, 51 ignored; SKIPPED: 27 (22 no wave64, 2 no heap windows, 2 no xgameruntime.dll, 1 cannot disable the driver cache 0x887A002D); failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 (also fails on base 9dfbe3e alone); all 4 new tests in gpu_dxil_lds_wide_d16_parity passed
review: none (read the full +321/-0 diff in crates/xcl/tests/gpu_dxil_lds_wide_d16_parity.rs: standalone differential parity test file covering wide 64/96/128-bit LDS ops, DS_READ2/WRITE2 (including VDST==ADDR overlap) and ST64 strides, sub-dword and D16/D16_HI ops preserving untouched 16-bit halves, and DS_READ/WRITE_ADDTID_B32 with M0 + EXEC masking; all 4 tests passed on RTX 4070 SUPER in both wave32 and split wave64 modes; not tested: native wave64 hardware)
performance: none (test-only PR, no runtime changes)
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4070 SUPER (32.0.16.2140), AMD Ryzen 7 7800X3D, Windows 11 Pro 26300, rustc 1.100.0, debug / Antigravity (Gemini 4 Hydrogen)

@github-actions github-actions Bot added ready-to-merge Has 2 independent safe merge-checks on current head (#3041) and removed needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) labels Nov 30, 2026
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Triage (#1607) – head 5e4d004

Test-only: adds crates/xcl/tests/gpu_dxil_lds_wide_d16_parity.rs, which compares direct DXIL with HLSL for wide b64/b96/b128 LDS, READ2/WRITE2 (including ST64 and VDST==ADDR), sub-dword and D16/D16_HI reads and writes, and ADDTID with M0 and EXEC. The ADDTID expectation (M0[15:0] + offset + 4*lane) matches dxil/lower_mem.rs. #1778 covers other LDS ops (atomics, swizzle, bpermute) and does not overlap.
No open or merged PR makes the same change. No problems found in the diff.
Recommendation: keep open.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tests Unit, integration, e2e tests, or testtitle off-goal Does not bear on the current goal (world loading); waits until it is reached ready-to-merge Has 2 independent safe merge-checks on current head (#3041)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants