dxil: refuse wave64 VS/PS with upper-lane reads in 32-lane mode (#1895) #2252
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2252
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@zondy1i on GitHub · 2026-11-25 11:24 UTC · original
zondy1i:dxil/graphics-upper-lanes-guard→main· +70 −5 · 4 files · 1 commits · openWhat 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.@DarkPanda69 on GitHub · 2026-11-25 11:39 UTC · original
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.
@jennydeth on GitHub · 2026-11-25 14:14 UTC · original
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, base
f087b99.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.
@throny on GitHub · 2026-11-25 14:54 UTC · original
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.
@S1m0ne1997 on GitHub · 2026-11-25 15:11 UTC · original
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.
@zondy1i on GitHub · 2026-11-25 15:32 UTC · original · edited 2026-11-25 15:39 UTC
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.
@DavidM1911 on GitHub · 2026-11-25 16:58 UTC · original
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!
@zondy1i on GitHub · 2026-11-26 02:48 UTC · original
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.github-bot referenced this pull request2026-11-26 06:18:30 +00:00
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.