Repository navigation
Recompiler: VS / PS in the per-lane form as DXIL - #1839
teidenzero wants to merge 1 commit into
Conversation
|
Tested On
The fixture compares positive screen coordinates with an integer 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. |
|
Requested retail smoke pair and VS/PS test — RTX 5070 Ti / Proton Tested
Regression run The requested pair below comes from the Wine smoke script. I abbreviated the local folder name in the
PR 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. |
|
Thank you @thehollowedone and @vitor127wt for the runs on 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 AI use: Claude Code (Claude Opus 5.5) drafted this comment. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
The DXIL adapter's half of the VS / PS stages (xcl-dev#1269): - `DxilIr` sets a VS / PS up in `Lw`'s entry block, as `kernel.rs` does: `setup_lanes_gfx`, then xcl-dev#1426's `setup_vertex` / `setup_pixel`, whose input loads must come before every use. `graphics_start` hands the lowering the initial VGPRs and the lane's bit of the launch EXEC (`ballot(true)`, without a PS's helper lanes); `graphics_end` is xcl-dev#1426's `finish_gfx`. - A VS / PS's ballots and lane reads go through `Lw`'s `ballot`, `rla` and `read_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` / `pixel` give the signed containers. - The bridge passes an export's EXEC only as the guard, which xcl-dev#1426's `export_gfx` takes, as it does for `v_cmpx`: passed as a number, EXEC refused every export ("s126: a mask read as a number"). The exports write xcl-dev#1426's output temporaries. These reach `finish_gfx` in the exit block through `Lw`'s SSA, since the adapter's branches go through `Lw` (gefydev's point in xcl-dev#1269), so the lowering needs no variable of its own for them. Tested on an RTX 4090 (32-lane waves; Windows 10 22H2, DXC 1.8.2502): - per_lane_vs_and_ps_with_a_branch_before_their_exports_draw_as_the_hlsl_path (new): a VS and a PS whose exports follow a branch 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 bypassing `Lw` (the VS fails validation); - cargo test --workspace -- --test-threads=1 on main 1a0bbe3 with this commit: 1251 passed, 0 failed, 46 ignored (lib 1182 passed); every test binary passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
61f6c2d to
be458bf
Compare
|
Rebased onto @emirduran707, @AlpPesen: you ran
AI use: Claude Code (Claude Opus 5.5) drafted this comment. |
|
AMD run of 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 Tested
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 Not tested
AI use
|
The 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 gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #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 gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #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 gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #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 -- --test-threads=1onmain1a0bbe3with this commit (be458bf): 1251 passed, 0 failed, 46 ignored over the workspace (lib: 1182 passed, 0 failed, 26 ignored). SKIPPED (25): 20 "no wave64" (this GPU), 1 "no heap windows", 1 "no dxil.dll", and the 3 per-lane refusalsmainmakes on purpose (V_CVT_F16_F32,V_MUL_F16,V_PK_MUL_F16). With four threads (.\scripts\test.ps1), the D3D12 device was removed duringhle::d3d12x::list_x's queue tests, and 3 of them failed with0x887A0005. Those tests pass on their own and in the one-thread run, and this commit does not touch them.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, gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #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 DXIL fuzz tests: fuzz_validate_and_gpu_1 fails on AMD (seed 722 and others, RDNA2-4), so the default suite is red there #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