Skip to content

Recompiler: LDS ds_sub_u32 hides its negation from the driver (RTX 50 refuses it) - #1919

Open
PHeitor1 wants to merge 1 commit into
xcl-dev:mainfrom
PHeitor1:lds-sub-cas
Open

PHeitor1 wants to merge 1 commit into
xcl-dev:mainfrom
PHeitor1:lds-sub-cas

Conversation

@PHeitor1

@PHeitor1 PHeitor1 commented Nov 24, 2026 •

Copy link
Copy Markdown

Fixes #1905. On RTX 50 (Blackwell) cards, a compute program with an LDS subtract of a register (ds_sub_u32, ds_sub_rtn_u32) does not build: the NVIDIA driver refuses the pipeline with E_OUTOFMEMORY. Both translators emit a groupshared atomic add of 0 - v. #1426's 55e9c3b chose that form because atomicrmw sub was refused; newer drivers (617.14 to 621.24 in the reports) refuse it the same way (@Kalmarv inferred why; the runs that confirm it).

5835139 is a081eb5 rebased onto main 568e7db without the TRANSLATOR_VERSION bump (#1947 hashes gpu/dxil now), as @raylitebull asked; the rest of the diff is the same. The first head, b54ac4e, used a compare-exchange loop. It worked, but it is up to 33 times slower under contention (table below), on every GPU. The smoke pair is @KDenKC's for a081eb5; 5835139 needs a new one, and I have no title I can run it with.

What is in it

  • recomp/emit.rs, dxil/lower_mem.rs: LDS sub_u32 adds (0 - v) | WaveActiveBitOr(0). The wave op is always 0; with it the driver does not see the negation. Buffer, flat and image sub are unchanged
  • dxil/fuzz_tests.rs: Sub is emitted the same way, so it stays covered
  • recomp/tests.rs: gpu_ds_sub_u32_of_a_register, values of both instructions (wrap, old value, one slot that all 64 lanes subtract from)

Tested

  • NVIDIA GeForce RTX 5060 Ti 8 GB (32-lane waves), driver 621.24; Ryzen 5 5600X; Windows 11 Pro 26300 (native); Rust 1.100.0 msvc; DXC 1.9.2602.17; debug; 5835139 on main 568e7db
  • The new test: 3 of 3 runs pass in each of 6 modes (default, XCL_DIRECT_DXIL=1, =all, =1 with XCL_PER_LANE=1, XCL_HEAP_WINDOWS=1, both). With emit.rs and lower_mem.rs from main: refused (0x8007000E) 3 of 3, on the HLSL path and with XCL_DIRECT_DXIL=1
  • fuzz_validate_and_gpu_0 to _3: pass, Sub included
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 1155 passed, 0 failed, 46 ignored; with XCL_DIRECT_DXIL=1: 1153 passed, 2 failed, 46 ignored, the two being offline_compute_pipeline_is_reused_by_a_second_process (Tests: offline compute pipeline test finds the driver blob with XCL_D… #1674) and gpu_image_get_resinfo_1d_array, which both fail on main here too. SKIPPED: the no wave64 cases, three per-lane form: refused cases, no heap windows, and the Developer Mode one
  • Tests: verify direct DXIL vs HLSL GPU parity for wave, LDS atomic, and MIMG ops #1778's direct_dxil_lds_atomics_and_barrier_parity, on a081eb5: 3 of 3 pass
  • Cost, synthetic HLSL (DXC, cs_6_6, 32 threads, 200 000 iterations of one atomic, median ms of 15 calls over 3 rounds; first call = compile and run of a shader with 200 sites, 3 rounds):
plain InterlockedAdd(g, v) this PR loop (b54ac4e)
32 lanes, one slot 7.5 9.7 318.9
4 lanes per slot 8.8 9.5 30.3
a slot per lane 8.8 9.5 11.6
first call, 200 sites 46 to 50 61 to 74 179 to 264

Regression run

On a081eb5, not yet on 5835139. By @KDenKC (report): RTX 5090 32 GB, driver 621.24; Ryzen 7 9800X3D; Windows 11 25H2; release, main first. The runs stay in the title's first menus, so this is a regression check, not a test of the change.

main:

xcl-smoke v1
commit: 62265d3bbde2255f849fb650cc29872df91a4cf0
gpu: NVIDIA GeForce RTX 5090
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1663 (PresentX 1663)
presents per 2 s (last 3): 61 59 61
device removals: 0
crashes: 0
peak commit: 14487 MB

This PR's head:

xcl-smoke v1
commit: a081eb52220dbc746b63b9e1eec04ba7481ef59f
gpu: NVIDIA GeForce RTX 5090
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1657 (PresentX 1658)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14637 MB

Not tested

  • a title past its menus, the test suite in release
  • other AMD cards (RDNA3, RDNA4), other NVIDIA cards and drivers than these
  • whether a later driver folds this form too; it hides the negation from the compiler, it does not remove the cause
  • the cost on other GPUs

AI use

  • Claude Code with Claude Opus 5.5: found the trigger with test runs, wrote the change, the test and this description, ran the tests and measurements.

🤖 Generated with Claude Code

@Melow-code Melow-code left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CAS loop for ds_sub_u32 is the right fix — InterlockedAdd of a negated value relies on the driver treating the negate-then-add as a single atomic, which Blackwell does not.

One concern: the fuzz generator now rewrites Sub to Add before it reaches emit, so group-shared Sub lost its fuzz coverage. The new GPU test covers the happy path, but fuzz would catch edge cases (overflow, concurrent writes). Consider keeping Sub in the generator and letting it hit the new CAS path.

The TRANSLATOR_VERSION bump to 8 is correct — cached output from version 7 would still use the old negate-add path.

@upipibi

upipibi commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

A data point on how far the refusal reaches: RTX 3070 (Ampere), driver 616.56, Windows 11, debug. Your gpu_ds_sub_u32_of_a_register passes on main 689f2db with only the test copied in, and on b54ac4e, each with and without XCL_DIRECT_DXIL=1. So this driver builds the current groupshared add of 0 - v and gets the values right. The E_OUTOFMEMORY looks specific to RTX 50 or to driver 621.24, and the compare-exchange loop costs a retry loop under contention on cards that would take the single atomic. Whether that is worth a capability check rather than the loop everywhere is your call; the PR is correct on Ampere either way.

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

@Skyfrye

Skyfrye commented Nov 24, 2026

Copy link
Copy Markdown

Test report with the regression pair this draft was waiting for, on an RTX 5080 with a retail title.

Tested

  • NVIDIA GeForce RTX 5080 16 GB (32-lane waves), driver 621.01; Ryzen 7 9800X3D; 32 GB RAM; Windows 11 Pro 26300; rustc 1.100.0 msvc; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0)
  • PR head b54ac4e842a365d75ba97dfd07892cb75a0bd20e, clean tree, directly on main 689f2db; tests in debug, smoke runs in release
  • cargo test -p xcl --lib -- gpu_ds_sub_u32_of_a_register gpu::dxil::fuzz_tests --test-threads=1: 6 passed, 0 failed, 2 ignored; the same with XCL_DIRECT_DXIL=1: 6 passed, 0 failed, 2 ignored
  • The new test fails without the fix: with emit.rs and lower_mem.rs taken from main and the rest of this PR, gpu_ds_sub_u32_of_a_register fails with CreateComputePipelineState ... (0x8007000E) on the HLSL path and with XCL_DIRECT_DXIL=1
  • On main 689f2db the four fuzz_validate_and_gpu_* tests fail here at seeds 70, 545, 1019 and 1507 with 0x8007000E, every run, also with 14.7 GB of video memory free
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on the PR head: 976 passed, 0 failed, 45 ignored
  • SKIPPED: 16 no wave64 cases (gpu::recomp::lower::tests ×4, gpu::recomp::lower_dxil::tests ×10, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware); 3 lower_dxil per-lane cases refused as unsupported (V_MUL_F16, V_PK_MUL_F16, V_CVT_F16_F32); pso_measurement_compiles_an_exact_synthetic_record (Developer Mode off); heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows)

Regression run

main:

xcl-smoke v1
commit: 689f2db477c3c062cf162649781640ef8a977c18
gpu: NVIDIA GeForce RTX 5080
title: 26877148
seconds: 60
exit: 0x0
frames shown: 1144 (PresentX 1144)
presents per 2 s (last 3): 60 58 60
device removals: 0
crashes: 0
peak commit: 15828 MB

This PR's head:

xcl-smoke v1
commit: b54ac4e842a365d75ba97dfd07892cb75a0bd20e
gpu: NVIDIA GeForce RTX 5080
title: 26877148
seconds: 60
exit: 0x0
frames shown: 1639 (PresentX 1639)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14898 MB

Not tested

  • Whether the 60 s run reaches a compute program with ds_sub_u32: it stays in the menus, so this pair is a regression check, not evidence that the change fixes something in the title
  • The higher frame count on the PR run is probably not from this change: main ran first, so the second run likely had the first run's caches. I did not rerun main afterwards
  • World load, longer runs, AMD / Intel, other NVIDIA drivers, compile time of the loop form

AI use

  • Run and written with Claude Code (Claude Fable 5.2); the account owner approved posting it.

@PHeitor1

Copy link
Copy Markdown
Author

@upipibi thanks, that's useful. It doesn't look like 621.24 alone: RTX 50 cards with 617.14, 617.42 (#1905) and 621.01 (@Skyfrye above) refuse the same fuzz seeds, and a 5070 Ti on 610.74 runs them. I kept one path for all GPUs because it's the simplest. If a maintainer prefers a check for RTX 50, I can look into it.

Written with Claude Code (Claude Opus 5.5).

@PHeitor1

Copy link
Copy Markdown
Author

@ruipedro-pinheiro thanks. The fuzz tests emit DXIL directly and don't go through rmw32, so keeping Sub there wouldn't reach the translators' loop by itself. The new GPU test covers wraparound and 64 lanes subtracting different values from one slot. I can give the fuzz emitter its own compare-exchange loop so Sub stays covered, if you think that's worth it.

Written with Claude Code (Claude Opus 5.5).

@PHeitor1
PHeitor1 marked this pull request as ready for review November 24, 2026 23:24
@regiumlepidi

regiumlepidi commented Nov 24, 2026 •

Copy link
Copy Markdown

Rerun on a081eb5 (2026-11-25), as asked: RTX 5070 Ti, driver 617.42, all pass on both paths

  • PR head a081eb52220dbc746b63b9e1eec04ba7481ef59f as it is (on main 62265d3), clean tree, debug, same machine as below
  • cargo test -p xcl --locked --lib -- gpu_ds_sub_u32_of_a_register gpu::dxil::fuzz_tests --nocapture: 6 passed, 0 failed, 2 ignored (amd_reduced_seeds, debug_seed); the same with XCL_DIRECT_DXIL=1: 6 passed, 0 failed, 2 ignored. No SKIPPED line
  • On this head the fuzz generator emits the same | WaveActiveBitOr(0) form, so its four batches passing shows that 617.42 builds that form; the subtract itself is checked by gpu_ds_sub_u32_of_a_register
  • Not run on a081eb5: the whole workspace suite, a fail-before control on 62265d3, any smoke pair, release

AI use for this rerun: Claude Code with Claude Opus 5.5 ran the commands and wrote this section.


Earlier report, on b54ac4e:

RTX 5070 Ti, driver 617.42: b54ac4e removes the four fuzz failures, also when merged into main 20cf130

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (32-lane waves), driver 617.42; Ryzen 7 9800X3D; Windows 11 Pro 26H2, build 26300.9974; Rust 1.100.0 MSVC; Windows SDK 10.0.26100.0, DXC 1.8.2502.11; debug; no XCL_SAMPLE_*
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --nocapture, one run per cell, clean trees, one target directory per tree (passed / failed / ignored):
tree default XCL_DIRECT_DXIL=1
main 20cf130 972 / 4 / 45 971 / 5 / 45
PR head b54ac4e (on 689f2db) 976 / 0 / 45 975 / 1 / 45
b54ac4e merged into 20cf130 (local merge, no conflicts) 977 / 0 / 45 976 / 1 / 45
  • The four failures on main are fuzz_validate_and_gpu_0 to _3: CreateComputePipelineState 0x8007000E at seeds 70, 545, 1019 and 1507, the same seeds as DXIL GPU fuzz tests reproducibly fail with E_OUTOFMEMORY on RTX 5060 #1905
  • The one failure left with XCL_DIRECT_DXIL=1 is offline_compute_pipeline_is_reused_by_a_second_process, which fails on main here too
  • Only the PR's new test applied to main 20cf130: gpu_ds_sub_u32_of_a_register is refused with 0x8007000E, both with and without XCL_DIRECT_DXIL=1 (1 run each). It passes on the PR head and on the merge
  • SKIPPED (25 lines, on the PR head and the merge): 18 no wave64, 3 per-lane form refused, 1 Developer Mode off, 1 no d3d12SDKLayers.dll, 1 no heap windows, 1 no D3D12 debug layer

Not tested

  • any retail title (no smoke run), release build, performance cost of the compare-exchange loop, other GPUs or drivers

AI use

  • Claude Code with Claude Sonnet 5.5: read the diff, ran the tests and wrote this report.

@humicu

humicu commented Nov 24, 2026

Copy link
Copy Markdown

Additional full-workspace validation for #1905 on my RTX 5060 8 GB, NVIDIA driver 617.42.

Tested PR head b54ac4e842a365d75ba97dfd07892cb75a0bd20e.

Builds

  • Release workspace build: successful
  • Debug workspace build: successful

Full workspace tests

cargo test --workspace --no-fail-fast -- --test-threads=1

Configuration Passed Failed Ignored
Default HLSL 976 0 45
XCL_DIRECT_DXIL=1 975 1 45

The sole direct DXIL failure was offline_compute_pipeline_is_reused_by_a_second_process, consistent with the previously reported #1674 issue.

All four originally failing fuzz tests and the new gpu_ds_sub_u32_of_a_register regression test passed in both configurations.

No additional failures observed. Retail-title smoke testing has not yet been performed on this machine.

Tests executed locally by me; report prepared with ChatGPT assistance.

@guinpereira

Copy link
Copy Markdown

Independent Windows/NVIDIA test report on PR #1919, exact head b54ac4e842a365d75ba97dfd07892cb75a0bd20e.

Tested

  • NVIDIA GeForce RTX 5060 Ti, 16052 MiB VRAM, driver 32.0.16.1714 (617.14); Ryzen 7 5700X; 32 GB RAM; Windows 11 Pro build 26200; Rust 1.99.1 MSVC; DXC / dxil 1.8.2502.11, SDK 10.0.26100.0. Debug tests, release smoke runs.
  • XCL_ADAPTER="rtx 5060 ti" .\scripts\test.ps1 (cargo build --workspace, then cargo test --workspace -- --test-threads=4): 976 passed, 0 failed, 45 ignored, exit 0, clean PR head.
  • 22 printed GPU skip cases, not coverage: 18 no-wave64 cases, three unsupported per-lane f16/cvt cases (V_MUL_F16, V_PK_MUL_F16, V_CVT_F16_F32), one opt-in heap-window case. XCL_SAMPLE_* inputs unset, so optional real-data test bodies did not run.
  • Focused command on the preserved PR library test executable: gpu_ds_sub_u32_of_a_register gpu::dxil::fuzz_tests --test-threads=1 --nocapture, default path: 6 passed, 0 failed, 2 ignored; same with XCL_DIRECT_DXIL=1: 6 passed, 0 failed, 2 ignored. Each validates 2000 generated programs and GPU-compares 1232.
  • Fail-before/pass-after: copied only this PR's new gpu_ds_sub_u32_of_a_register test into a separate checkout of exact parent 689f2db477c3c062cf162649781640ef8a977c18, with its own target directory and unchanged translators. cargo test -p xcl --lib gpu_ds_sub_u32_of_a_register -- --test-threads=1 --nocapture: 0 passed, 1 failed, 0 ignored, CreateComputePipelineState / 0x8007000E. Same result with XCL_DIRECT_DXIL=1. On the clean PR head that same test passes on both paths; its assertions check wraparound, returned old values, and 64 lanes subtracting from a shared slot.
  • cargo build --release -p xcl succeeded for PR head and main 20cf13022f764208384c610c2ae6a3f4eed201a2; the smoke executables were retained separately. The main smoke build used its own fresh target directory. Source checkouts used for smoke were clean.

Coverage limitation
The fuzz generator in this PR maps its selected Sub operation to Add. Its passing fuzz batches therefore do not demonstrate that the original subtract cases now run unchanged. The translator fix is demonstrated here by the identical specific LDS-subtract test failing on the parent translators and passing on the PR. No performance improvement is claimed.

Regression run
Same local title, data root and default settings, release, XCL_ADAPTER="rtx 5060 ti", XCL_PRESS_A_AT=10,14,18,22,26,30,34,38,42,46,50,54,58. Main first, then PR, 60 seconds each; no task-owned builds or other tests ran during either game run. Existing shader/driver caches were reused. Script blocks copied verbatim:

main:

xcl-smoke v1
commit: 20cf13022f764208384c610c2ae6a3f4eed201a2
gpu: NVIDIA GeForce RTX 5060 Ti
title: retail-1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1587 (PresentX 1587)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14996 MB

PR:

xcl-smoke v1
commit: b54ac4e842a365d75ba97dfd07892cb75a0bd20e
gpu: NVIDIA GeForce RTX 5060 Ti
title: retail-1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1608 (PresentX 1608)
presents per 2 s (last 3): 60 61 59
device removals: 0
crashes: 0
peak commit: 15007 MB

Not tested

  • AMD / Intel, native wave64, other drivers, full workspace with XCL_DIRECT_DXIL=1, release test suite, CAS-loop performance/compile cost, gameplay/world loading.
  • The short game runs are regression checks, not proof that a game shader reaches ds_sub_u32 or that world loading improves. Current main also includes an unrelated upstream MSAA change; the exact-parent specific test is the isolated fail-before comparison.

AI use

  • Codex (GPT-6; exact model variant unknown) ran the builds, tests and smoke checks, and drafted this report from captured outputs. No new runtime code, assertions weakened, commits or competing PR.

@towiice towiice left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on Windows 11 (NVIDIA GeForce GTX 1650 SUPER, 4 GB Turing TU116, wave32, driver 610.88, DXC 1.9.2609.5):

  • \cargo test -p xcl --lib gpu_ds_sub_u32_of_a_register: 1 passed; 0 failed (0.65s)

Lowering \ds_sub_u32\ / \ds_sub_rtn_u32\ as a compare-exchange loop passes cleanly on Turing.

@PHeitor1 PHeitor1 changed the title Recompiler: LDS ds_sub_u32 is a compare-exchange loop Recompiler: LDS ds_sub_u32 hides its negation from the driver (RTX 50 refuses it) Nov 24, 2026
@PHeitor1

Copy link
Copy Markdown
Author

I pushed a081eb5, which replaces the compare-exchange loop with one atomic: InterlockedAdd(g, (0u - v) | WaveActiveBitOr(0u)). The wave op is always 0, and with it the driver no longer sees a negation.

@upipibi's point about the cost was right. Measured here (RTX 5060 Ti, 621.24, synthetic HLSL, 200 000 iterations, median ms):

plain add a081eb5 loop (b54ac4e)
32 lanes, one slot 7.5 9.7 318.9
4 lanes per slot 8.8 9.5 30.3
a slot per lane 8.8 9.5 11.6

@ruipedro-pinheiro @guinpereira: Sub is back in the fuzz tests, emitted the same way as the translators do, and all four pass here.

@Skyfrye @regiumlepidi @humicu @guinpereira @towiice thank you for the quick runs, and sorry that they were on the head this replaces. If one of you has time, a rerun on a081eb5 would help: cargo test -p xcl --lib -- gpu_ds_sub_u32_of_a_register gpu::dxil::fuzz_tests with and without XCL_DIRECT_DXIL=1, on any driver, and one smoke pair (@Skyfrye or @guinpereira). It is also untested on AMD and on older NVIDIA drivers.

If a maintainer prefers the loop, because it doesn't rely on the driver not seeing the negation, I can go back to it.

Run and written with Claude Code (Claude Opus 5.5).

@regiumlepidi

Copy link
Copy Markdown

@PHeitor1 reran on a081eb5 (RTX 5070 Ti, driver 617.42, debug): cargo test -p xcl --locked --lib -- gpu_ds_sub_u32_of_a_register gpu::dxil::fuzz_tests gives 6 passed, 0 failed, 2 ignored, both with and without XCL_DIRECT_DXIL=1. Details are at the top of my earlier comment, which I edited. No smoke pair from me: I don't have a title to run it on.

Claude Code with Claude Opus 5.5 ran the tests and wrote this reply.

@KDenKC

KDenKC commented Nov 25, 2026 •

Copy link
Copy Markdown

Test report on a081eb5 with the smoke pair it was missing: RTX 5090, retail title. The four fuzz tests and the new test pass on both paths; both fail on main here.

Tested

  • NVIDIA GeForce RTX 5090 32 GB (32-lane waves), driver 32.0.16.2124 (621.24); Ryzen 7 9800X3D; 62 GB RAM; Windows 11 25H2 build 26200.9974; rustc 1.99.1 msvc; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0); Gaming Services 39.118.30001.0
  • PR head a081eb52220dbc746b63b9e1eec04ba7481ef59f as it is (on main 62265d3), clean tree; tests in debug after cargo build --workspace, smoke runs in release
cargo test --workspace --no-fail-fast -- --test-threads=4 default XCL_DIRECT_DXIL=1
main 62265d3 982 passed, 4 failed, 45 ignored 981 passed, 5 failed, 45 ignored
this PR a081eb5 987 passed, 0 failed, 45 ignored 986 passed, 1 failed, 45 ignored
  • main's failures: fuzz_validate_and_gpu_0 to _3 (CreateComputePipelineState 0x8007000E; on 20cf130 earlier today seed 70 was the first). The one failure left with XCL_DIRECT_DXIL=1 on both is offline_compute_pipeline_is_reused_by_a_second_process (Tests: offline compute pipeline test finds the driver blob with XCL_D… #1674).
  • cargo test -p xcl --lib -- gpu_ds_sub_u32_of_a_register gpu::dxil::fuzz_tests --test-threads=1: 6 passed, 0 failed, 2 ignored, with and without XCL_DIRECT_DXIL=1.
  • Fail-before control: emit.rs and lower_mem.rs from main, the rest of the PR as it is: gpu_ds_sub_u32_of_a_register refused with CreateComputePipelineState … (0x8007000E) on the HLSL path and with XCL_DIRECT_DXIL=1. Files restored before the smoke run.
  • SKIPPED (23, the same on main and the PR): 18 no wave64, 3 per-lane form: refused (V_MUL_F16, V_PK_MUL_F16, V_CVT_F16_F32), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows), and pso_measurement_compiles_an_exact_synthetic_record (Developer Mode).

Regression run

Same title, 60 s each, no input (it stays in its first menus, so this is a regression check, not a test of the change), main first:

xcl-smoke v1
commit: 62265d3bbde2255f849fb650cc29872df91a4cf0
gpu: NVIDIA GeForce RTX 5090
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1663 (PresentX 1663)
presents per 2 s (last 3): 61 59 61
device removals: 0
crashes: 0
peak commit: 14487 MB
xcl-smoke v1
commit: a081eb52220dbc746b63b9e1eec04ba7481ef59f
gpu: NVIDIA GeForce RTX 5090
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1657 (PresentX 1658)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14637 MB

99.6 % of main's frames, 101 % of its peak commit.

Not tested: a run that reaches a program with ds_sub_u32 in the title (these runs stay in the menus); the cost of the wave op on this card; AMD; release test build.

AI use: Claude Code (Claude Opus 5.5) ran the builds, tests and smoke runs and wrote this report.

@raylitebull

Copy link
Copy Markdown
Member

The single-atomic (0u - v) | WaveActiveBitOr(0u) change on a081eb5 cleanly restores fuzz coverage and passes CI (Build and test + PR description) and RTX 5070 Ti / RTX 5090 verification.

Remaining before merge:

  1. Rebase onto main to drop the TRANSLATOR_VERSION = 8 bump in kernel.rs (#1950 took 8, and #1947 now auto-hashes gpu/dxil sources via XCL_DIRECT_DXIL_SOURCE_ID).
  2. One independent AMD GPU run confirming | WaveActiveBitOr(0u) builds and passes gpu_ds_sub_u32_of_a_register + gpu::dxil::fuzz_tests on RDNA.

@raylitebull

Copy link
Copy Markdown
Member

Note after recent main merges: a081eb5 now shows a merge conflict (CONFLICTING). Rebase onto current main and note that #1947 now auto-hashes gpu/dxil/* sources via XCL_DIRECT_DXIL_SOURCE_ID (kernel.rs:39), so edits outside gpu/dxil/* or using XCL_TRANSLATOR_SOURCE_ID don't need a manual TRANSLATOR_VERSION bump. Once rebased + CI green + an AMD verification pass lands, this will also unblock Blackwell split-w64 LDS sub in #1778.

@DavidM1911

Copy link
Copy Markdown
Contributor

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

Thanks!

@AmateurWizrd

Copy link
Copy Markdown

AMD run on a081eb5 (the head as it is, RDNA2 integrated GPU): gpu_ds_sub_u32_of_a_register passes, and so do fuzz_validate_and_gpu_0, _2 and _3, with and without XCL_DIRECT_DXIL=1. fuzz_validate_and_gpu_1 fails on seed 540 (res[833] = 0x7, CPU 0x6), but it fails identically on this PR's merge base 62265d3, so this PR does not cause it; it is the RDNA2 failure already reported on main in #42 (comment). This answers point 2 of #1919 (comment), before the rebase. On an RTX 5070 Ti with driver 621.01, where the four fuzz tests fail on main, all six pass.

cargo test -p xcl --lib -- gpu_ds_sub_u32_of_a_register gpu::dxil::fuzz_tests --test-threads=1 --nocapture, debug:

GPU Commit Path Passed Failed Ignored Failing test
AMD Radeon integrated (RDNA2) a081eb5 (PR) default 5 1 2 fuzz_validate_and_gpu_1, seed 540
AMD Radeon integrated (RDNA2) a081eb5 (PR) XCL_DIRECT_DXIL=1 5 1 2 fuzz_validate_and_gpu_1, seed 540
AMD Radeon integrated (RDNA2) 62265d3 (merge base) default, run 1 4 1 2 fuzz_validate_and_gpu_1, seed 540
AMD Radeon integrated (RDNA2) 62265d3 (merge base) default, run 2 4 1 2 fuzz_validate_and_gpu_1, seed 540
RTX 5070 Ti a081eb5 (PR) default 6 0 2 none
RTX 5070 Ti a081eb5 (PR) XCL_DIRECT_DXIL=1 6 0 2 none

(The merge base has one test fewer: gpu_ds_sub_u32_of_a_register is new in this PR.) Each fuzz batch validated 500 seeds; GPU-compared per batch: 299 (seeds 0..500), 313 (500..1000), 314 (1000..1500), 306 (1500..2000).

Tested

  • AMD Radeon integrated graphics of a Ryzen 7 7800X3D (RDNA2), driver 32.0.21045.16010, selected with XCL_ADAPTER=radeon; NVIDIA GeForce RTX 5070 Ti 16 GB, driver 621.01 (32-lane waves only); 32 GB RAM; Windows 11 build 26200; Rust 1.100.0
  • The test binary run directly under a local account without network access, XCL_NETWORK=0
  • On main 2bdf0477f the four fuzz tests fail on the 5070 Ti with "Not enough memory resources" for seeds 70, 545, 1019 and 1507, the failure of DXIL GPU fuzz tests reproducibly fail with E_OUTOFMEMORY on RTX 5060 #1905

Not tested

  • The PR rebased onto current main; RDNA3/RDNA4; the full suite on this head; a retail-title smoke pair

AI use: omp. Claude Fable 5.2 read the diff, ran the tests and wrote this report.

@JJAutoCompare

Copy link
Copy Markdown

PR #1919 | Intel Arc A770 | 2026-11-25 UTC

Tested

Open PR head a081eb5 matched the clean, detached reused checkout before and after the test. The PR discussion and issue #42 contained no equivalent Intel report for this head.

STOR-WINLAB, Intel Arc A770 (driver 32.0.101.9175), AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation 26200.9974. rustc 1.100.0 (0ef1bc386), x86_64-pc-windows-msvc, cargo 1.100.0. Both processes loaded dxcompiler and dxil 1.9.2609.5 from the selected DXC directory.

Build command, outside the Arc lock
cargo test --locked -p xcl --lib --no-run

Build succeeded in 42.00 s with two Rust deprecation warnings. CARGO_TARGET_DIR=L:/XclTooling/pr1512-tiling-edges-fddfa267/target, CARGO_BUILD_JOBS=2, CARGO_INCREMENTAL=0, CARGO_PROFILE_DEV_DEBUG=0, CARGO_PROFILE_TEST_DEBUG=0. TEMP and TMP were L:/XclTooling/pr1919/run-20261125T033208461Z.

Exact test invocations, each in its own powershell.exe -NoProfile -ExecutionPolicy RemoteSigned process
$env:XCL_ADAPTER='A770'
$env:XCL_DXC_DIR=Join-Path $env:LOCALAPPDATA 'XclTooling/dxc-1.9.2609/bin/x64'
$env:XCL_DIRECT_DXIL='0'
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { & 'L:/XclTooling/pr1512-tiling-edges-fddfa267/target/debug/build/xcl/77aca8ccb20e299f/out/xcl-77aca8ccb20e299f.exe' gpu::recomp::tests::gpu_ds_sub_u32_of_a_register --exact --nocapture --test-threads=1 }
# In the second process with the same adapter and DXC settings
$env:XCL_DIRECT_DXIL='1'
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { & 'L:/XclTooling/pr1512-tiling-edges-fddfa267/target/debug/build/xcl/77aca8ccb20e299f/out/xcl-77aca8ccb20e299f.exe' gpu::recomp::tests::gpu_ds_sub_u32_of_a_register --exact --nocapture --test-threads=1 }

  • 0, HLSL/DXC: 1 passed, 0 failed, 0 ignored, 0 explicit skips, 962 filtered out, 0.26 s. Exit 0.
  • 1, direct DXIL: 1 passed, 0 failed, 0 ignored, 0 explicit skips, 962 filtered out, 0.17 s. Exit 0.

Each run matched 256 GPU readback values against expected integers (four values per logical lane across 64 lanes, 512 total). For lane l, the subtrahend was 3*l + 100.

  • DS_SUB_U32: the lane-private slot matched (10l).wrapping_sub(3l + 100), including 15 lanes with unsigned wraparound.
  • DS_SUB_RTN_U32: the returned old value matched 5000 + l and the final slot value matched 5000 + l - (3*l + 100) in every lane.
  • Contended DS_SUB_U32: all 64 lanes subtracted from the same slot initialized to 1,000,000. Each lane read back 987,552 after the barrier, equal to 1,000,000 - 12,448.

Both processes logged mutex release. The assigned Cargo target and detached checkout slot are idle. Evidence is in build.log, direct-dxil-0.log and direct-dxil-1.log in this directory.

Not tested

Native wave64 hardware, other adapters or drivers, ancestor and negative controls, fuzz or random tests, other backend settings, the workspace suite, retail smoke tests, and crash investigations.

AI use

T3 Code / Codex gpt-6.2-sol ran the commands, checked the fixture and output, and wrote this report.

@chemist6913

Copy link
Copy Markdown

Test report on a081eb5: RTX 5090 on two drivers not yet in this thread, 616.92 and 621.40. The fix works on both, and main is refused on both.

Tested

  • NVIDIA GeForce RTX 5090 32 GB (32-lane waves); Ryzen 9 7900X; 64 GB RAM; Windows 11 Pro 26300.10075; rustc 1.100.0 msvc; DXC 1.9.2609.5 through XCL_DXC_DIR; debug; XCL_ADAPTER="rtx 5090"; no XCL_SAMPLE_* set
  • PR head a081eb52220dbc746b63b9e1eec04ba7481ef59f as it is (on main 62265d3), clean tree. Same machine and checkout for both columns; the driver was updated in between.
616.92 (32.0.16.1692) 621.40 (32.0.16.2140)
cargo test -p xcl --locked --lib -- gpu_ds_sub_u32_of_a_register gpu::dxil::fuzz_tests 6 passed, 0 failed, 2 ignored 6 passed, 0 failed, 2 ignored
the same with XCL_DIRECT_DXIL=1 6 passed, 0 failed, 2 ignored 6 passed, 0 failed, 2 ignored
control: this head with emit.rs and lower_mem.rs from 62265d3, gpu_ds_sub_u32_of_a_register only fails on both paths, CreateComputePipelineState 0x8007000E fails on both paths, 0x8007000E
cargo test --workspace --locked --no-fail-fast -- --test-threads=4 not run 987 passed, 0 failed, 45 ignored
the same with XCL_DIRECT_DXIL=1 not run 986 passed, 1 failed, 45 ignored
main cbc296a, the four fuzz_validate_and_gpu_* fail at seeds 70, 545, 1019, 1507 with 0x8007000E (default path; whole suite 1150 passed, 4 failed, 46 ignored) fail at the same seeds, default path and XCL_DIRECT_DXIL=1
  • The one failure with XCL_DIRECT_DXIL=1 is offline_compute_pipeline_is_reused_by_a_second_process (Tests: offline compute pipeline test finds the driver blob with XCL_D… #1674).
  • SKIPPED in each whole-suite run on this head, 23 lines, not coverage: 18 no wave64, 3 per-lane form: refused (V_MUL_F16, V_PK_MUL_F16, V_CVT_F16_F32), 1 no heap windows, 1 that needs Windows Developer Mode to turn the driver cache off.
  • For the driver range: 616.92 is older than the 617.14 reported here as refusing, and 621.40 is newer than 621.24. Both refuse the add of 0 - v, and both build the | WaveActiveBitOr(0) form.

Not tested

  • the whole suite on 616.92 (the driver was updated before that run), release builds
  • any title: no smoke pair from this machine
  • a081eb5 rebased or merged onto current main
  • the XCL_SAMPLE_* tests; AMD and Intel

AI use

  • Claude Code with Claude Fable 5.2 ran the tests and wrote this report.

@onlynullpoint

Copy link
Copy Markdown

Test report on a081eb5 applied onto current main cbc296a (the rebase asked for above): RTX 5090 Laptop GPU, driver 616.92. It adds two things the 616.92 / 621.40 report lists as not tested: the whole suite on 616.92, and the change on current main.

Tested

  • NVIDIA GeForce RTX 5090 Laptop GPU 24 GB (32-lane waves), driver 616.92 (32.0.16.1692); Intel Core Ultra 9 275HX; 96 GB RAM; Windows 11 Pro build 26300; rustc 1.99.1 msvc; DXC 1.8.2502.11 (Windows SDK 10.0.26100.0); debug
  • Tree: a081eb5 cherry-picked onto main cbc296a. The only conflict was TRANSLATOR_VERSION in gpu/dxil/kernel.rs, resolved by keeping main's 9 (gpu/dxil is hashed by XCL_DIRECT_DXIL_SOURCE_ID, recomp/emit.rs is in XCL_TRANSLATOR_SOURCE_ID). The rest applied unchanged
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 1155 passed, 0 failed, 46 ignored. On cbc296a without the change: 1150 passed, 4 failed, 46 ignored, the four being fuzz_validate_and_gpu_0 to _3 (0x8007000E at seeds 70, 545, 1019 and 1507)
  • cargo test -p xcl --lib -- gpu_ds_sub_u32_of_a_register gpu::dxil::fuzz_tests --test-threads=1: 6 passed, 0 failed, 2 ignored; the same with XCL_DIRECT_DXIL=1: 6 passed, 0 failed, 2 ignored
  • Fail-before: with recomp/emit.rs and dxil/lower_mem.rs from cbc296a and the rest of the change, gpu_ds_sub_u32_of_a_register is refused with 0x8007000E on the HLSL path and with XCL_DIRECT_DXIL=1 (1 run each)
  • SKIPPED (25 lines): 18 no wave64; 2 more wave64 cases whose reason was cut off in the log (const_mask, mask_ff0_flbit); 3 per-lane form: refused (V_MUL_F16, V_PK_MUL_F16, V_CVT_F16_F32); pso_measurement_compiles_an_exact_synthetic_record (Developer Mode off); 1 no heap windows

Not tested

  • the PR head as it is (only cherry-picked onto cbc296a), the full suite with XCL_DIRECT_DXIL=1 on this tree alone, release, any smoke pair or title

AI use

  • Claude Code with Claude Opus 5.5 applied the change, ran the commands and wrote this report.

@dhillonjagdeep650-boop

Copy link
Copy Markdown

Test report on a081eb5: RTX 3080 Ti (Ampere) on driver 617.42, the driver version of the RTX 5060 in #1905. All pass on both paths, and this card also builds main's form.

Tested

  • NVIDIA GeForce RTX 3080 Ti 12 GB (32-lane waves), driver 617.42 (32.0.16.1742); Ryzen 7 5800X; 48 GB RAM; Windows 11 Pro 26300.9974; rustc 1.98.1 msvc; DXC 1.8.2502.11 (Windows SDK 10.0.26100.0); debug; no XCL_* variable set except the one named
  • PR head a081eb52220dbc746b63b9e1eec04ba7481ef59f as it is (on main 62265d3), clean tree
  • cargo test -p xcl --locked --lib -- gpu_ds_sub_u32_of_a_register gpu::dxil::fuzz_tests --test-threads=1: 6 passed, 0 failed, 2 ignored (amd_reduced_seeds, debug_seed); the same with XCL_DIRECT_DXIL=1: 6 passed, 0 failed, 2 ignored. No SKIPPED line
  • Control, this head with recomp/emit.rs and dxil/lower_mem.rs from 62265d3: 6 passed, 0 failed, 2 ignored on both paths. So on the driver version that refuses the pipeline on the RTX 5060 (617.42), this Ampere card builds the groupshared add of 0 - v and gets the values right: the refusal follows the GPU generation, not the driver version alone
  • main 6020a33, cargo test --workspace --locked --no-fail-fast -- --test-threads=4: 1154 passed, 0 failed, 46 ignored, the four fuzz_validate_and_gpu_* among the passes

Not tested

  • The whole suite on a081eb5, the change rebased onto current main, a smoke pair, release, XCL_PER_LANE=1, XCL_HEAP_WINDOWS=1

AI use: Claude Code with Claude Fable 5.2 ran the tests and wrote this report.

IvyNotFound added a commit to IvyNotFound/xcl that referenced this pull request Nov 25, 2026
# Conflicts:
#	crates/xcl/src/gpu/dxil/kernel.rs
NVIDIA's RTX 50 (Blackwell) drivers refuse a compute pipeline with
E_OUTOFMEMORY when it has a groupshared atomic subtract, and newer ones
(seen from 617.14 to 621.24) also when it has a groupshared atomic add of
a negated, non-constant value, the form both translators emit for
ds_sub_u32. DXC's InterlockedAdd(g, 0u - v) is refused the same way.

ds_sub_u32 / ds_sub_rtn_u32 now add (0 - v) | WaveActiveBitOr(0), on the
HLSL and the direct DXIL path. The wave op is always 0; with it the driver
does not see the negation, and it stays one atomic. The fuzz tests emit
their Sub the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@PHeitor1

Copy link
Copy Markdown
Author

@raylitebull thank you for the review. Both points:

  1. Rebased onto main 568e7db as 5835139, without the TRANSLATOR_VERSION bump. kernel.rs is no longer in the diff; the rest is the same as a081eb5. Here (RTX 5060 Ti, 621.24): suite 1155 passed, 0 failed, 46 ignored; with XCL_DIRECT_DXIL=1 1153 passed, 2 failed, 46 ignored, the two being offline_compute_pipeline_is_reused_by_a_second_process (Tests: offline compute pipeline test finds the driver blob with XCL_D… #1674) and gpu_image_get_resinfo_1d_array, which both fail on main here too. The new test passes in all 6 modes I ran (3 runs each) and is refused without the translator change.
  2. AMD: @AmateurWizrd ran a081eb5 on an RDNA2 integrated GPU, both paths. The new test and three of the four fuzz tests pass; fuzz_validate_and_gpu_1 fails at seed 540 exactly as on its merge base. That is before the rebase.

Still missing: a smoke pair for 5835139, since the push invalidates the one for a081eb5. @KDenKC, @Skyfrye, @guinpereira: if one of you can rerun it once more, that is the last thing the check asks for. Sorry for the repeat.

Thanks also to @chemist6913, @onlynullpoint, @dhillonjagdeep650-boop, @JJAutoCompare, @DavidM1911 and @futurepro62 for the runs on a081eb5; the ones with details are in the description.

Run and written with Claude Code (Claude Opus 5.5).

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

Labels

goal:world-load Bears on the retail title getting past world loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DXIL GPU fuzz tests reproducibly fail with E_OUTOFMEMORY on RTX 5060