Recompiler: coalesce GS header and vertex attribute stores in direct DXIL #2273
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!2273
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2273/head"
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?
@ramon-victor on GitHub · 2026-11-25 12:00 UTC · original
ramon-victor:opt/dxil-geom-coalesce-stores→main· +24 −9 · 2 files · 1 commits · merged 2026-11-25 18:38 UTCCoalesces scalar
dx.op.rawBufferStorecalls in the direct DXIL geometry-shader epilogue (Lw::geom_epilogue):[nv]atrec * 4and[np]atrec * 4 + 4) with a single 2-dwordrawBufferStore(mask = 3) atrec << 2.dst + 4*slot + 0..3) with a single 4-dwordrawBufferStore(mask = 15) at(dst + 4*slot) << 2, reducing vertex UAV stores and store-offset arithmetic by 4x.Part of #1269.
What is in it
crates/xcl/src/gpu/dxil/lower_geom.rs: coalesce the 2-dword header store and each 4-dword per-register vertex attribute store inLw::geom_epilogue(+8/-10lines).crates/xcl/src/gpu/dxil/geometry_tests.rs: addgeometry_epilogue_coalesces_header_and_vertex_storesverifying DXIL validation and disassembly (1mask-3 header store,2mask-15 vertex register stores,1mask-1 triangle store =4total instead of11).On a seeded 600-program sample (
xcl shaders <archive> --direct --sample 600 --seed 3 --max-bytes 40000 --validate --threads 8, 573 programs including 8 GS programs), all 573/573 (8/8 GS) validate cleanly (0validator failures):41,323,736 B -> 41,320,436 B(-3,300 Bacross the 8 GS programs,~412 Bper GS)Tested
621.24, wave32), AMD Ryzen 7 5700X, Windows 11 Pro26300,rustc 1.99.0(x86_64-pc-windows-msvc), DXC/DXIL1.8.2502.11(Windows SDK10.0.26100.0).cargo test -p xcl --lib gpu::dxil::geometry_tests(debug):3 passed; 0 failed(geometry_forms_validate,geometry_epilogue_coalesces_header_and_vertex_stores, andgpu_geometry_direct_recordsrunning the GS + mesh pass-through draw on the RTX 3070)..\scripts\test.ps1(debug, full workspace):1251 passed; 0 failed; 46 ignored(25 GPU sub-checks skipped on this wave32 adapter: 21no wave64, 1no heap windows, 3 per-lane#1426refusals).cargo build --release -p xcl+ direct DXIL validation sweep on 573 sampled retail shader programs:573/573translated anddxil.dll-validated (0failures).Regression run
Not tested
XCL_SAMPLE_*env vars unset).AI use
lower_geom.rs, added the store-mask disassembly test ingeometry_tests.rs, and rangeometry_tests(including GPU mesh draw), the full workspace test suite, the 573-shader validation sweep, and the 60 s smoke regression run.@DarkPanda69 on GitHub · 2026-11-25 12:20 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.Head
a4decceapplied onmain1a0bbe3, 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
geometry_epilogue_coalesces_header_and_vertex_stores(ok). No existing test changes result or skip state. The 2 RX 9070 XT failures are the AMD fuzz seeds 722 and 1599 tracked in #2115, the same onmain.Not tested: geometry shader GPU output in a title,
XCL_SAMPLE_*.AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
@itsSio on GitHub · 2026-11-25 12:24 UTC · original
Tested
Complementing the paired GPU-library results above: clean, unmodified PR head
a4deccec4ee132b386d968af8446fda4f497b57b, Windows 11 Pro build 26200, x64 MSVC, unoptimized dev/test profiles with debug info off.cargo build --workspace --lockedandcargo test --workspace --locked --no-fail-fast -- --test-threads=4 --nocaptureexited 0 on both PCs, with default shader options.SKIPPED32.0.16.108832.0.16.1088cargo test -p xcl --lib --locked gpu::dxil::geometry_tests:: -- --test-threads=1 --nocapture: 3 / 0 / 0, zero runtime skips, on both RTX cards and a Radeon RDNA2 iGPU (32.0.21043.5001, same Ryzen 7 system and toolchain). The structural test verified one two-dword header store, two four-dword vertex stores and one scalar triangle-index store. The separate direct/HLSL draw and readback fixture passed as well.Not tested
Exact parent, full AMD workspace, retail geometry output, or GPU performance.
AI use
Ran via Samaritan:
openai/gpt-6.2-sol): scoped and ran the two-PC checks, audited logs and fixture coverage, and wrote this report. No subagents contributed.@DavidM1911 on GitHub · 2026-11-25 17:05 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!