Recompiler: VS / PS in the per-lane form as DXIL #1839
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!1839
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1839"
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?
@teidenzero on GitHub · 2026-11-24 21:38 UTC · original
teidenzero:vsps-dxil-main→main· +146 −5 · 2 files · 1 commits · draftThe DXIL adapter's half of the per-lane VS / PS stages: a follow-up to #1745, whose description lists VS / PS with only its lowering half. Part of #1269. The runtime does not call the VS / PS entry points yet (
pso.rssends only compute programs to the per-lane form), so nothing changes outside the tests.What is in it (one commit)
crates/xcl/src/gpu/recomp/lower_dxil.rs:DxilIrsets a VS / PS up inLw's entry block, askernel.rsdoes:setup_lanes_gfx, then #1426'ssetup_vertex/setup_pixel, whose input loads must come before every use.graphics_starthands the lowering the initial VGPRs and the lane's bit of the launch EXEC (ballot(true), without a PS's helper lanes);graphics_endis #1426'sfinish_gfx.Lw'sballot,rlaandread_lane_half, which know a wave32 program's half in 64-lane hardware and see a PS's helper lanes through quad reads.lower_dxil::vertex/pixelgive the signed containers.per_lane_vs_and_ps_with_a_branch_before_their_exports_draw_as_the_hlsl_path.crates/xcl/src/gpu/recomp/lower.rs, the bridge: an export's EXEC goes in only as the guard, which #1426'sexport_gfxtakes, as forv_cmpx. Passed as a number, EXEC refused every export ("s126: a mask read as a number").The exports write #1426's output temporaries. These reach
finish_gfxin the exit block throughLw's SSA, because the adapter's branches go throughLw(gefydev's point on #1269), so the lowering needs no variable of its own for them.Tested
stable-x86_64-pc-windows-msvc, debug; DXC 1.8.2502.11 from the Windows SDK, withoutdxil.dll.cargo test --workspace --no-fail-fast -- --test-threads=1onmain68a284awith this commit (7772597): 1289 passed, 2 failed, 46 ignored over the workspace (lib: 1219 passed, 2 failed, 26 ignored). Neither failure is in this change:a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier(#2074) fails the same way onmain68a284awithout this commit (3 barriers, not 1). gefydev's test-only fix is #2379. It passes onmainjust before #2203 and fails once #2203 is in.hle::d3d12x::vram::tests::d32s8_targets_take_their_own_size_of_video_memoryfailed once in the full run (list.Close():0x80004005). It passes on its own, with and without this commit.mainmakes on purpose (V_CVT_F16_F32,V_MUL_F16,V_PK_MUL_F16).main1a0bbe3(be458bf, the previous head) the same one-thread run passed: 1251 passed, 0 failed, 46 ignored. With four threads there, the D3D12 device was removed duringhle::d3d12x::list_x's queue tests, and 3 of them failed with0x887A0005. They pass on their own and in the one-thread run.core_tests::graphics_stages_with_a_branch_before_their_exports), in the per-lane form, draw what the HLSL path's stages draw for both branch directions, and each links with the HLSL path's other stage. It fails without the bridge change (the VS is refused) and with the adapter's branches bypassingLw(the VS then fails validation).61f6c2d(RTX 3080 Ti, Windows 11, comment): the new test passes in debug and in release; with discard cases added to it (every column kept, columns 8–15 kept, none kept), the HLSL path, #1426's per-instruction DXIL and the per-lane DXIL give identical readbacks.61f6c2d(RTX 5070 Ti, Linux, Proton, comment): the new test passes in a release build under Wine.61f6c2dmerged withmain(RTX 3060 Ti, Windows 11, comment):cargo test -p xcl --libpasses.be458bf(RX 9070 XT, RDNA4, and a Ryzen 7 9800X3D's RDNA2 iGPU; Windows 11; comment): the new test passes on both adapters. Both report 32 and 64 lanes, so the test builds the stages in the form that checks the wave size at run time. A probe with plain HLSL stages shows the driver picks 64-lane waves for the PS on both and for the VS on RDNA4, so the 64-lane path runs there. Their 4-thread workspace run: 1249 passed, 2 failed (the AMD fuzz seeds of #2115, whichmainfails the same way on that card), 46 ignored.Regression run
Not run: there is no Series X|S title on this machine. No title program reaches this code yet (nothing calls
lower_dxil::vertex/pixelat run time), so a smoke pair could not exercise it; whether the pair can wait for the VS / PS runtime wiring is asked in the comments. This PR stays a draft until that is settled.Not tested
AI use
🤖 Generated with Claude Code
@thehollowedone on GitHub · 2026-11-24 21:48 UTC · original
Tested
On
61f6c2d6, I extended the stock VS/PS draw fixture to check discard. With the same HLSL vertex shader, HLSL, per-instruction DXIL and per-lane DXIL produced identical 16×16 readbacks for all three settings.The fixture compares positive screen coordinates with an integer
V_CMPX_LT_U32before the final export. Windows 11 build 26300, RTX 3080 Ti / 621.35, Ryzen 7 9800X3D, Rust 1.99.1 MSVC, DXC 1.8.2502.11.cargo test --offline --locked -p xcl --lib per_lane_vs_and_ps_with_a_branch_before_their_exports_draw_as_the_hlsl_path -- --nocapture --test-threads=1passed 1/1 as shipped and 1/1 with the added discard cases in debug, with zero skips. The stock test also passed 1/1 in release.Not tested
This report covers synthetic wave32-adapter draws. It does not cover helper-lane reads, native wave64, or runtime routing.
AI-assisted. Codex (GPT-6 family, exact variant unavailable) extended and ran the fixture and drafted this report.
@vitor127wt on GitHub · 2026-11-24 22:24 UTC · original
Requested retail smoke pair and VS/PS test — RTX 5070 Ti / Proton
Tested
7.3.5-2-cachyos, Proton Experimental 11.0 (experimental-11.0-20261112-x86_64), vkd3d-protonec207194with the #257 patch and dxil-spirv7c048638. Rust 1.100.0, LLVM-MinGW 20261117 (x86_64-pc-windows-gnullvm), DXC 1.9.2609.5.cargo build --locked --release --target x86_64-pc-windows-gnullvm -p xcl --bin xcl. Ranscripts/linux/smoke.sh "$PROTON" "$PREFIX" "$GAME"from #257 for 60 s onmain266b845e4b2a193ea7ce1b86698ead08dc4a10c0and PR head61f6c2d6d0abd4d2114372b139ea6cfaf4af8e7f, same retail title with no injected input. The title runs used fresh Wine prefixes and caches, networking off, and a 16 GiB Linux scope limit with no swap.cargo test --locked --release --target x86_64-pc-windows-gnullvm -p xcl --lib --no-run. Rangpu::recomp::lower_dxil::tests::per_lane_vs_and_ps_with_a_branch_before_their_exports_draw_as_the_hlsl_path --exact --test-threads=1 --nocapturein Proton Wine on the PR. 1 passed, 0 failed, 0 ignored, 0 skipped.Regression run
The requested pair below comes from the Wine smoke script. I abbreviated the local folder name in the
titlefield.mainPR head
Linux scope peaks were 9.56 GiB (base) and 6.61 GiB (PR), with no OOM kills. Wine reported 0 MB in the Windows peak-commit field. The retail pair covers startup. The VS/PS path ran in the synthetic test.
AI use — OpenAI Codex (GPT-6, exact variant unavailable) ran the tests, checked the logs, and drafted this report.
@teidenzero on GitHub · 2026-11-24 22:35 UTC · original
Thank you @thehollowedone and @vitor127wt for the runs on
61f6c2d. Your test results (the discard cases, the release builds, the run under Proton) are now under Tested in the description.On the smoke pair, a question for @gefydev and the maintainers. The pair above comes from the Wine smoke script in #257, and CONTRIBUTING asks for
scripts/smoke.ps1. More to the point, no title program reaches this code yet:pso.rssends only compute programs to the per-lane form, and nothing callslower_dxil::vertex/pixelat run time, so a smoke pair cannot exercise it. Can this PR go without the pair, or should the pair come with the VS / PS runtime wiring, where a title run tests the path for real? Until then this PR stays a draft.AI use: Claude Code (Claude Opus 5.5) drafted this comment.
@DavidM1911 on GitHub · 2026-11-25 01:03 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@teidenzero on GitHub · 2026-11-25 13:18 UTC · original
Rebased onto
main1a0bbe3asbe458bf. The only conflict was inlower_dxil.rs's tests: the tests from #1864 and #1865 had been added in the same spot as the new one. All three tests are kept.cargo test --workspace -- --test-threads=1: 1251 passed, 0 failed, 46 ignored. Thanks @DavidM1911 for the run on the merged branch.@emirduran707, @AlpPesen: you ran
scripts/smoke.ps1pairs on an AMD card for your per-lane PRs (#1864, #2014). I have no Series X|S title of my own, so this PR can't carry the pair without help. If one of you has time, two things would let it leave draft:main1a0bbe3and one frombe458bf, same title and seconds. No title program reaches the new entry points yet, so the two runs should match.cargo test -p xcl --lib -- per_lane_vs_and_ps: on AMD the stages run in native wave64, which no one has tested yet.AI use: Claude Code (Claude Opus 5.5) drafted this comment.
@Chrysana on GitHub · 2026-11-25 14:51 UTC · original
AMD run of
be458bf, for "Native wave64 (no AMD GPU here)" under Not tested. On RDNA4 the per-lane VS and PS run in 64-lane hardware waves, and the new test passes there. It also passes on an RDNA2 iGPU, where the PS runs in 64-lane waves and the VS in 32-lane waves.Setup: AMD Radeon RX 9070 XT 16 GB (RDNA4), driver 32.0.32015.2008, and the Ryzen 7 9800X3D's integrated AMD Radeon(TM) Graphics (RDNA2), driver 32.0.21045.11001; 31 GB RAM, Windows 11 26200.9974, rustc 1.100.0 MSVC, DXC 1.9.2602.17, debug. This PR's head as pushed (on
main1a0bbe3).Tested
cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4on the RX 9070 XT: 1249 passed, 2 failed, 46 ignored. The two failures arefuzz_validate_and_gpu_1(seed 722) andfuzz_validate_and_gpu_3(seed 1599), the AMD seeds of #2115;main06c9f55fails the same two on this card.f16_programs_on_the_gpu(4) andf32_programs_on_the_gpu(2) (per-lane refusals, #1426),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),pso_measurement_compiles_an_exact_synthetic_record(no Developer Mode),test_title_draws_with_a_root_signature_under_the_debug_layeranduploads_start_from_each_subresources_state(no debug layer).per_lane_vs_and_ps_with_a_branch_before_their_exports_draw_as_the_hlsl_pathpasses on both adapters (XCL_ADAPTER=1for the iGPU).graphics_wave32()is true and the stages are built wave-size independent. For a VS / PS,kernel.rsfinishdoesn't usehw, so the container carries no wave size and the driver picks one. A local probe (not pushed) draws with a plain HLSL VS and PS that writeWaveGetLaneCount()from both stages andWaveActiveCountBits(true)from the PS, on 8×8 and 64×64 targets:So on these cards the new test's per-lane stages run in 64-lane hardware waves (the PS on both, the VS on RDNA4). That is the case
read_lane_halfhandles and a 32-lane-only GPU can't reach.Not tested
main.AI use
@teidenzero on GitHub · 2026-11-25 19:33 UTC · original
The head is now
7772597, rebased ontomain68a284a(only the tests clashed again, this time with #2074's). @emirduran707, @AlpPesen: if you run the smoke pair, please buildmain68a284aand7772597. This commit's code is unchanged, so the runs onbe458bfstill apply.AI use: Claude Code (Claude Opus 5.5) drafted this comment.
github-bot referenced this pull request2026-11-26 06:18:31 +00:00
@DavidM1911 on GitHub · 2026-11-26 06:28 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
@bmjask on GitHub · 2026-11-25 21:31 UTC · original · reviewed
No concrete source defect found in the graphics adapter; VS/PS setup, EXEC guards, ballot/read-lane, SSA/output flow and HLSL parity fixture look internally consistent, with external RTX/RDNA coverage. Not merge-ready: draft, runtime does not route VS/PS to these entries, helper-lane PS read/discard remains untested, no title/runtime path evidence, and current Windows/description checks fail. Require clean CI plus helper-lane coverage and defer merge until wiring/title evidence or an approved staging plan.
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.