Repository navigation
Conversation
Melow-code
left a comment
There was a problem hiding this comment.
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.
|
A data point on how far the refusal reaches: RTX 3070 (Ampere), driver 616.56, Windows 11, debug. Your AI-assisted (Claude Code). Synthetic tests only. |
|
Test report with the regression pair this draft was waiting for, on an RTX 5080 with a retail title. Tested
Regression run
This PR's head: Not tested
AI use
|
|
@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). |
|
@ruipedro-pinheiro thanks. The fuzz tests emit DXIL directly and don't go through Written with Claude Code (Claude Opus 5.5). |
|
Rerun on
AI use for this rerun: Claude Code with Claude Opus 5.5 ran the commands and wrote this section. Earlier report, on RTX 5070 Ti, driver 617.42: Tested
Not tested
AI use
|
|
Additional full-workspace validation for #1905 on my RTX 5060 8 GB, NVIDIA driver 617.42. Tested PR head Builds
Full workspace tests
The sole direct DXIL failure was All four originally failing fuzz tests and the new 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. |
|
Independent Windows/NVIDIA test report on PR #1919, exact head Tested
Coverage limitation Regression run main: PR: Not tested
AI use
|
towiice
left a comment
There was a problem hiding this comment.
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.
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>
b54ac4e to
a081eb5
Compare
|
I pushed @upipibi's point about the cost was right. Measured here (RTX 5060 Ti, 621.24, synthetic HLSL, 200 000 iterations, median ms):
@ruipedro-pinheiro @guinpereira: @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 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). |
|
@PHeitor1 reran on Claude Code with Claude Opus 5.5 ran the tests and wrote this reply. |
|
Test report on Tested
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), 99.6 % of Not tested: a run that reaches a program with AI use: Claude Code (Claude Opus 5.5) ran the builds, tests and smoke runs and wrote this report. |
|
The single-atomic Remaining before merge:
|
|
Note after recent |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
AMD run on
(The merge base has one test fewer: Tested
Not tested
AI use: omp. Claude Fable 5.2 read the diff, ran the tests and wrote this report. |
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 withE_OUTOFMEMORY. Both translators emit a groupshared atomic add of0 - v. #1426's55e9c3bchose that form becauseatomicrmw subwas refused; newer drivers (617.14 to 621.24 in the reports) refuse it the same way (@Kalmarv inferred why; the runs that confirm it).a081eb5replacesb54ac4e. The earlier head used a compare-exchange loop. It worked, but it is up to 33 times slower under contention (table below), on every GPU. This one stays a single atomic. The reports below forb54ac4edon't cover it. The smoke pair fora081eb5is @KDenKC's, not mine: I have no title I can run it with.What is in it
recomp/emit.rs,dxil/lower_mem.rs: LDSsub_u32adds(0 - v) | WaveActiveBitOr(0). The wave op is always 0; with it the driver does not see the negation. Buffer, flat and imagesubare unchangeddxil/kernel.rs:TRANSLATOR_VERSION7 to 8, for the on-disk cachedxil/fuzz_tests.rs:Subis emitted the same way, so it stays coveredrecomp/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
a081eb5onmain62265d3XCL_DIRECT_DXIL=1,=all,=1withXCL_PER_LANE=1,XCL_HEAP_WINDOWS=1, both). Withemit.rsandlower_mem.rsfrommain: refused (0x8007000E) 3 of 3, on the HLSL path and withXCL_DIRECT_DXIL=1fuzz_validate_and_gpu_0to_3: pass,Subincludeddirect_dxil_lds_atomics_and_barrier_parity: 3 of 3 passcargo test --workspace --no-fail-fast -- --test-threads=4: 987 passed, 0 failed, 45 ignored; withXCL_DIRECT_DXIL=1: 986 passed, 1 failed, 45 ignored, the one beingoffline_compute_pipeline_is_reused_by_a_second_process(fails onmaintoo, Tests: offline compute pipeline test finds the driver blob with XCL_D… #1674). SKIPPED: theno wave64cases,per-lane form: refusedcases,no heap windows, and the Developer Mode onecs_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):InterlockedAdd(g, v)b54ac4e)a081eb5also run by @KDenKC (RTX 5090, 621.24, report): suite 987 passed, 0 failed, 45 ignored, 986 / 1 (Tests: offline compute pipeline test finds the driver blob with XCL_D… #1674) / 45 withXCL_DIRECT_DXIL=1, against 982 / 4 and 981 / 5 onmain; and by @regiumlepidi (RTX 5070 Ti, 617.42, report): the new test and the fuzz tests pass on both pathsb54ac4e, the same fix idea as a loop, so evidence for the refusal and the new test only: @Skyfrye (RTX 5080, 621.01, smoke pair), @guinpereira (RTX 5060 Ti, 617.14, smoke pair), @regiumlepidi (RTX 5070 Ti, 617.42), @humicu (RTX 5060, 617.42), @upipibi (RTX 3070, 616.56), @towiice (GTX 1650 SUPER, 610.88)Regression run
By @KDenKC (report): RTX 5090 32 GB, driver 621.24; Ryzen 7 9800X3D; Windows 11 25H2; release,
mainfirst. The runs stay in the title's first menus, so this is a regression check, not a test of the change.main:This PR's head:
Not tested
AI use
🤖 Generated with Claude Code