dxil: refuse wave64 VS/PS with upper-lane reads in 32-lane mode (#1895) #2242
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2252"
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 zondy1i on 2026-11-25T11:24:23Z.
What is in it
Fixes the remaining item (item 1) of #1895 (item 2,
XCL_DXIL_NO_OPT, was already merged in #2013):crates/xcl/src/gpu/dxil/kernel.rs: intranslate_on_this_thread, when lowering aVertexorPixelentry witho.wave64 && o.split(32-lane hardware waves such as NVIDIA), runupper_lanes::analyze(&cfg.insts)and refuse the shader ("wave64 VS / PS in 32-lane waves: a read of lanes 32–63") if any read is non-Native(matchingrecomp::lower::lower_graphics).crates/xcl/src/gpu/recomp/pso.rs: passsplit_wave64fromcompile_console_shaderintodirect_graphicsand setsplit: wave64 && split_wave64inKernelOptionsinstead of hardcodingsplit: false, soXCL_DIRECT_DXIL=allfalls back to the HLSLupper_lanespath instead of caching broken wave64-only DXIL under thesplit=1disk cache key. Modifyingkernel.rsalso advancesXCL_DIRECT_DXIL_SOURCE_IDautomatically so staleXCL_DIRECT_DXIL=allcache entries are invalidated.crates/xcl/src/gpu/dxil/coverage.rs: stop overridingsplit: falseforMode::Vertex/Mode::Pixelintranslate_modeso--direct --split 1accurately reports 32-lane graphics refusals.crates/xcl/src/gpu/dxil/core_tests.rs: addwave64_graphics_with_upper_lane_reads_refused_in_32_lane_modecoveringtranslate_vertex,translate_pixel, andcoverage::translate_modefor bothsplit: trueandsplit: false, with and without upper-lane reads.Impact on a 2,000-program sample (
--direct --sample 2000 --max-bytes 0, seed 1):--split 1(32-lane waves): 50 of 874 pixel shaders (5.7%) that read lanes 32–63 are now cleanly refused (wave64 VS / PS in 32-lane waves: a read of lanes 32–63) instead of silently emitting broken wave64-only DXIL; the remaining 824 PS and 178/178 VS still translate directly (1950 / 2000 total, 0 panics).--split 0(native wave64): 2000 / 2000 (100.0%) still translate directly (no change on native wave64).Fixes #1895.
Tested
rustc 1.100.0, DXC /dxil.dll1.9.2602.17, debug & release builds.cargo test -p xcl --lib -- gpu::dxil::core_tests gpu::dxil::coverageonda82f10: 25 passed, 0 failed, 1 ignored (including newwave64_graphics_with_upper_lane_reads_refused_in_32_lane_mode).cargo test --workspace -- --test-threads=4onda82f10: 1436 passed, 0 failed, 47 ignored across 37 test binaries.2a6d713; the rebase onto currentmainonly resolved a conflict inpso.rs(split_wave64is threaded throughdirect_graphicsnext tofssm_wave64).xcl shaders <pack> --direct --split 1 --sample 2000 --max-bytes 0: 1950 / 2000 translated, 50 PS refused forlanes 32–63, 0 panics.xcl shaders <pack> --direct --split 0 --sample 2000 --max-bytes 0: 2000 / 2000 translated, 0 panics.Regression run
Baseline (
main568e7db):PR (
da82f10):Not tested
--split 0translation coverage verified locally on NVIDIA).--sample 2000) were not re-run on the rebased headda82f10; the numbers above are from2a6d713.AI use
upper_lanesguard inkernel.rs, threadingsplit_wave64throughpso.rsandcoverage.rs, writing the unit test, and running the sweeps and smoke test.Imported from ivall/xcl. Originally posted by DarkPanda69 on 2026-11-25T11:39:05Z.
The AMD native wave64 run listed as untested, plus an RTX 3060, paired against
mainwith the direct translator on for the whole GPU suite. On native wave64 hardware the new refusal must not kick in, and nothing that ran before is refused now.Head
2a6d713applied onmain426a5a7, debug, Windows 11 Pro 26200,XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- gpu:: --test-threads=4, onmainand on this PR for each card:mainPer-test comparison: on both cards the only difference is the new
wave64_graphics_with_upper_lane_reads_refused_in_32_lane_mode(ok). No existing test changes result, and the SKIPPED lines are identical, so no graphics program that ran before is refused now on either card. The RX 9070 XT failures are onmaintoo:gpu_image_get_resinfo_past_last_level(reported on #2054) and the fuzz seeds tracked in #2115.Not tested: a title with
XCL_DIRECT_DXIL=1, RDNA2/RDNA3.AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
Imported from ivall/xcl. Originally posted by jennydeth on 2026-11-25T14:14:13Z.
Full workspace run on this head (listed under Not tested). Two failures, both also on the PR's base, so not from this PR.
Setup: RTX 3060 12 GB (32-lane waves, driver 32.0.16.2101), Ryzen 5 5600X, 32 GB RAM, Windows 11 build 26300, Rust 1.100.0, DXC 1.9.2609.5, debug build. Head
2a6d713, basef087b99.Result: cargo test --workspace -- --test-threads=4: 1173 passed, 2 failed, 26 ignored.
gpu::recomp::pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator (left 68, right 1)
hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa (format 85 kept: left 28, right 85)
Both fail the same way on the base
f087b99alone, and pass on current main1a0bbe3, so a rebase onto main should clear them. SKIPPED: 18 GPU tests for no wave64 (expected on this card).AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.
Imported from ivall/xcl. Originally posted by throny on 2026-11-25T14:54:03Z.
Two contributors checked independently and found that #1913 solves the same problem (for #1895) in a different way: #1607, group D74. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Imported from ivall/xcl. Originally posted by S1m0ne1997 on 2026-11-25T15:11:33Z.
Test report for
2a6d71336ad89de71dad83f125344dcf60bb740e(this PR's head), for #1607.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09)x86_64-pc-windows-msvc, debug.cargo build --workspace, thencargo test --workspace -- --test-threads=4at the head: 1173 passed, 2 failed, 26 ignored.a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu(no wave64),coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu(no wave64),cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu(no wave64),the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu(no wave64),a_per_lane_2d_or_3d_group_runs_on_the_gpu(no wave64),const_and_null_mask_operands_agree_with_hlsl_on_the_gpu(const_mask, wave64: no wave64),f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's)); f16 arithmetic, wave64: no wave64),f32_programs_on_the_gpu(f32 arithmetic, wave64: no wave64; f32 compares, wave64: no wave64),f64_programs_on_the_gpu(f64, wave64: no wave64),integer_programs_on_the_gpu(integer arithmetic, wave64: no wave64; integer carries, wave64: no wave64),mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu(mask_ff0_flbit, wave64: no wave64),gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64),pso_measurement_compiles_an_exact_synthetic_record(cannot disable the driver cache (Windows Developer Mode is required): L'applicazione ha richiesto un'operazione che dipende da un componente SDK mancante o non corrispondente. (0x887A002D)).gpu::recomp::pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator,hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaaThe 2 failures are in this PR's base, not in its change. Both fail the same way on its merge base
f087b99without this PR (rerouted_disk_entries_follow_the_direct_translator: left 68, right 1;pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa: format 85 kept, 28 expected), and both pass on currentmain06c9f55. They are the two tests of #2242 / #2248, fixed onmainsince (#2243 for the first). A rebase onto currentmainshould clear them.Regression run (retail title,
scripts/smoke.ps1 -Seconds 60, release;mainbuilt from the commit in its block, this PR from its head with no changes tocrates/, both run with thescripts/smoke.ps1ofmain, which hashes the name of the game folder)main:
this PR:
Not tested
AI use: Claude Code with Claude Opus 5.5 ran the build, the suite and the regression run and wrote this report at my request.
Imported from ivall/xcl. Originally posted by zondy1i on 2026-11-25T15:32:27Z.
Comparison for #1607 (group D74: #2252 vs #1913):
Both PRs are
MERGEABLE, CI-green, and fix the remaining #1895 item (wave64 VS/PS reading lanes 32-63 on 32-lane GPUs):upper_lanes::analyze(&cfg.insts)guard directly insidedxil::kernel::translate_on_this_thread(matchingrecomp::lower::lower_graphics), avoiding a second full decode pass and protecting every directtranslate_vertex/translate_pixelcaller (not onlypso.rsandcoverage.rs). It is compact (+70/-5) and verified on AMD RDNA4 (RX 9070 XT), RTX 3060 / 3060 Ti, and RTX 4090.needs_upper_lanes(code)pre-check inrecomp/mod.rscalled frompso.rsandcoverage.rs(plus anXCL_DXIL_NO_OPTline inpso.rsthat already landed in #2013), leavingtranslate_vertex/translate_pixelitself unguarded.Only one of the two should be merged - if maintainers prefer #1913, I'm happy to close #2252 in its favour.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T16:58:40Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). 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 CalvyPZ on 2026-11-25T22:43:53Z.
This PR has been marked as a duplicate and closed after multiple agreeing checks in #1607. If you believe this is incorrect please re-open with why.
Imported from ivall/xcl. Originally posted by zondy1i on 2026-11-26T02:48:18Z.
Rebased onto current
main(b49be183); the only conflict was inpso.rs(keptfssm_wave64and threadedsplit_wave64throughdirect_graphics). Re-ran the unit tests, the full workspace suite (1436 passed, 0 failed) and a 60 s smoke on the new headda82f10; description updated with the new smoke block.Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T08:09:40Z.
Independent desktop NVIDIA verification of PR #2252 at head
da82f106813bc7700a4d4ed7cdc93a806ee97b1d(1commit; exact parent & merge-base:b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7, pre-#2555ancestor ofmain).Environment
7956 MiBreported by D3D12, Wave32-only Ada), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200(Developer Mode off)rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC, DXC1.9.2609.5,--releaseTargeted release tests & build (
da82f106)cargo test --release -p xcl --lib wave64_graphics_with_upper_lane_reads_refused_in_32_lane_mode -- --nocapture(3 consecutive runs)1 passed; 0 failed; 0 ignored; 1336 filtered out× 3 (0.01s× 3,0skipped)cargo test --release -p xcl --lib gpu::dxil:: -- --test-threads=4(3 consecutive runs)185 passed; 0 failed; 3 ignored; 1149 filtered out× 3 (5.69s,5.87s,5.49s;1self-skipped:gpu::dxil::kernel::dispatch_chain_native_wave64_builds_whole—no wave64on Wave32-only Ada;184executed)cargo test --release -p xcl --lib gpu::recomp::pso::(3 consecutive runs)27 passed; 0 failed; 1 ignored; 1309 filtered out× 3 (0.10s,0.11s,0.10s,0skipped)cargo build --release -p xcl1m 46s, exit0,0new warnings)Paired quiet 60 s retail smoke (
title: 29640639)Exact parent & merge-base (
b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7, cached baseline on the same machine):PR #2252 (
da82f106813bc7700a4d4ed7cdc93a806ee97b1d):Runtime log observations (
xcl.log)9218log lines,0[ERROR]/ device-removal / panic lines (dxil_cache:460hits,0misses,0compilation failures;228background pipelines,0failures).19255 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample13971 MB committed by the process; video memory 6116 MB local, 4650 MB non-local.Limits of coverage
wave64_graphics_with_upper_lane_reads_refused_in_32_lane_mode(3/3),gpu::dxil::(184executed,0failed,1Wave64-only test self-skipped on Wave32-only Ada), andgpu::recomp::pso::(27/27× 3).AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-27T17:54:15Z.
NVIDIA and AMD full-suite run, to go with the reports above by Decodere, since none of them covers AMD. Tested exact head
da82f106(on its baseb49be18).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace --no-fail-fast -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1424 passed, 0 failed, 45 ignored. SKIPPED (no wave64):a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,a_per_lane_2d_or_3d_group_runs_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,dispatch_chain_native_wave64_builds_whole,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.wave64_graphics_with_upper_lane_reads_refused_in_32_lane_mode.XCL_ADAPTER=radeon),cargo test --workspace --no-fail-fast -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1435 passed, 0 failed, 47 ignored. SKIPPED:f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipleaves out tests that fail on main6089122atoo, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651), the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests,const_and_null_mask_operands_agree_with_hlsl_on_the_gpuandmask_ff0_and_flbit_agree_with_hlsl_on_the_gpu(follow-up on #1651) fail becauserunner::skip_testturns their skips into failures underXCL_REQUIRE_GPU=mesh, andgpu::dxil::fuzz_testsseeds 70, 545, 1019 and 1507 failCreateComputePipelineStatewithE_OUTOFMEMORYon this card (drivers 616.64 and 621.40). On AMD:fuzz_validate_and_gpu_1fails on seed 540 (res[833]0x7 vs CPU 0x6). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:40:33Z.
Triage (#1607) – head
da82f10Main commit
50e85c5("Recompiler: reject unsafe direct wave64 graphics reads") says it adapts this PR. It adds the same refusal inkernel.rs::translate_on_this_thread, with the same "lanes 32–63" error. It also passessplitthrough for VS/PS incoverage.rs::translate_modeandpso.rs::direct_graphics, and addswave64_graphics_with_upper_lane_reads_refused_in_32_lane_modetocore_tests.rs. #1913, the other PR for #1895, is closed.Recommendation: close (superseded by main commit
50e85c5).AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:51:09Z.
Closing as superseded: this change is already on
main(50e85c5b). main kernel.rs refuses wave64 VS/PS with upper-lane reads in 32-lane mode (kernel.rs ~310-315), pso.rs passes split_wave64 into direct DXIL, test wave64_graphics_with_upper_lane_reads_refused_in_32_lane_mode in core_tests.rs (50e85c5badapted from #2252)Two independent checks found this: Foniass's close list on #1607 and ours against current
main. If something here is still missing onmain, say so and reopen it, or ask and I will.AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.
Pull request closed