Repository navigation
Recompiler: VS / PS in the per-lane form as DXIL - #1839
teidenzero wants to merge 1 commit into
Conversation
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); - .\scripts\test.ps1 on main 266b845 with this commit: 958 passed, 0 failed, 42 ignored over the workspace (lib 909 passed); every test binary passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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 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..\scripts\test.ps1onmain266b845with this commit (61f6c2d): 958 passed, 0 failed, 42 ignored over the workspace (lib: 909 passed, 0 failed, 22 ignored). SKIPPED (23): 18 "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). The commit merges cleanly withmain4e3515e.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.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