Repository navigation
recomp/dxil: straddling 16-bit LDS, XCL_SHADER_LOOP_LIMIT, and safe MS barriers - #1976
raylitebull wants to merge 2 commits into
Conversation
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
fed1358 to
561a6a9
Compare
|
Stacking note: #1976 is currently stacked on top of #1975 (which carries the f16 signature packing, CFG We will rebase #1976 cleanly onto #1975's latest head (and trim down to only the 4 mesh/LDS/safe-barrier additions once #1975 lands) so reviewers see zero duplicated diff. |
561a6a9 to
ec13a10
Compare
|
Rebased
|
|
Verification on RTX 3060 Ti (Windows 11): merge conflict with current |
|
Tested Independent STOR-WINLAB CPU verification of open PR #1976 at Windows 11 Enterprise Evaluation 25H2 x64 (26200.9974), Ryzen 7 3800X, Rust and Cargo 1.100.0 (x86_64-pc-windows-msvc), unoptimized test profile with debug info and incremental compilation disabled. Intel Arc A770 driver 32.0.101.9175 was installed. The shader fixture loaded DXC/DXIL 1.9.2609.5. Both selected fixtures ran on the CPU. cargo test --locked -p xcl --lib gpu::dxil::lower_valu::fidelity_tests::direct_dxil_mixed_fp16_interp_preserves_half_across_ssa_phi -- --exact --nocapture --test-threads=1
cargo test --locked -p xcl --lib gpu::recomp::attribute_tests::fssm_16bit_packed_tables_and_slot_mapping -- --exact --nocapture --test-threads=1Each exited 0 with 1 passed, 0 failed, 0 ignored, 0 skipped, and 1,082 filtered out (0.04 s and 0.01 s respectively).
Not tested GPU execution or pipeline creation, retail smoke, LDS, loop limits, relative moves, mesh barriers, and the workspace suite. AI use T3 Code / Codex (gpt-6.2-sol) inspected and ran the two checked-in fixtures and prepared this report from the logs. |
|
Regression run of Against the limits in CONTRIBUTING.md: 100 % of AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, AI use: Claude Code (Claude Opus 5.5) built both trees and ran |
ec13a10 to
e5ddc4b
Compare
|
Rebased Pushed |
e5ddc4b to
adfcc9c
Compare
|
Rebased Verified locally ( |
adfcc9c to
1447cf9
Compare
|
Rebased
|
1447cf9 to
2e7debd
Compare
|
Rescoped and rebased
|
A retail title's world pixel shaders (xcl-dev#505; 173 of its 362) pack their float16 interpolants: two components per dword (component c of a register in dword c / 2, the even one in the low half) and up to two signature registers per attribute, the second after the dwords the first one's components take (1 for .xy, 2 for .xyz / .xyzw). The PS reads each half with v_interp_p2_f16, SRC0 bit 8 choosing the high one. XCL refused the PS input table of such programs (records [6, reg, mask, attr, 0, reg2, packed reg, flags]: flag 8 = float16, flag 16 = byte 5 names the second register, byte 6 below byte 1 from the first pair on), so every attribute, plain ones included, fell back to "the N-th register" and the ones after a pair read their neighbour. The PS also converted the raw packed dword as a float, ignored the high bit and declared the float16 inputs nointerpolation. Now the table parses, each (dword, half) of a packed attribute maps to its element and component (f16_registers, ps_f16_slot; a record that repeats its own register pairs it with the next float16 register no other attribute names), and the PS reads that component as a float, interpolated with the attribute's own mode. Both translators (HLSL and direct DXIL). The layout was checked on the title's dumped programs: every v_interp_p2_f16 (dword, half) of 376 of 378 packed attributes in 362 PS is a declared component (2 read one past a .xy register). Not covered here: the VS / mesh side still exports the packed dwords raw (the next commit), so the GPU test feeds the PS from a PC VS that hands over each component as a float. xcl-dev#1975 / xcl-dev#1976 parsed the same records with a fixed layout - the second register always in dwords 2-3, a repeated register paired with itself - which does not match the title's programs after a .xy register; both have since dropped their float16 part in favour of this change. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bmjask
left a comment
There was a problem hiding this comment.
P1: direct-DXIL safe mesh-barrier state aliases normal LDS. kernel reserves dwords 8190-8191 by lowering lds_top for mesh shader, but lower_mem applies lds_top only when split; non-split Direct-DXIL DS accesses can still address reserved dwords. Full-32KiB LDS shader can overwrite liveness/generation state, corrupt LDS and release/hang barrier. Reserve/remap in non-split path too or use separate storage; add DS access-at-reserved-address plus barrier behavior regression. Current full-32KiB test only validates TGSM size.
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
|
Part 3 here ( AI-assisted (Claude Code, Claude Opus 5.5): read both diffs and wrote this. |
Stacked on #1975 (extends
#1975's72960386onc9ee916awith incremental commit2e7debd8,+401 / -40across 6 files).Adds three robustness and correctness improvements across the HLSL recompiler and Direct DXIL translator (both 32 KB
passthrough_splitdeferred to #304 and repeated-PS.zwf16interpolant packing deferred cleanly to@MacieGx'srecomp/f16-packed-interpolants— zero touch onrecomp/mod.rs):lower_mem.rs,emit.rs): splits 16-bit LDS loads/stores (ds_read_{u,i}16,ds_write_b16,ds_*_d16_*) at byte offset(addr & 3) == 3across(at >> 2)byte 3 and(at + 4) >> 2byte 0 in both Direct DXIL (lds_read_bits,lds_bits_store) and HLSL (InterlockedAnd/InterlockedOr), while preserving#134PRELUDE_PIXEL.kernel.rs,lower.rs): replaces Direct DXIL's non-uniform multi-wave mesh barrier fallback error with a bounded groupshared arrival barrier (xcl_barviasafe_barrier_init/safe_barrier_wait/safe_barrier_exit, reusing top 2 dwords ofxcl_ldswhen present so TGSM stays<= 32768bytes, gated byXCL_SAFE_BARRIER != 0, withVAR_BAR_ALIVE = VAR_BUDGET + 6disjoint from#2156'sVAR_IMG_WRITE = VAR_BUDGET + 8and both zero-initialized inInit::load).XCL_SHADER_LOOP_LIMIT(emit.rs,lower.rs,pso.rs): configurable shader loop limit (default65536, capped1 << 24, folded intopso.rstranslation identity), plusdirect_dxil_mixed_fp16_interp_preserves_half_across_ssa_phiupdated to usemain'sPsAttr.Part of #1269.
What is in it
2e7debd8on top of#1975(72960386):crates/xcl/src/gpu/dxil/kernel.rs,lower.rs,lower_mem.rs,lower_valu.rs,crates/xcl/src/gpu/recomp/emit.rs,pso.rs.lds_16bit_straddling_dword_boundary_hlsl,direct_dxil_lds_dword_straddling_16bit_validate,direct_dxil_infinite_loop_guarded_by_shader_loop_limit,direct_dxil_mixed_fp16_interp_preserves_half_across_ssa_phi, anddirect_dxil_mesh_non_uniform_barrier_guard(including full-32KB-LDS TGSM check).Tested
rustc 1.99.1 (58cf8f9c3 2026-10-13), DXCdxcompiler 1.8.2502.11/dxil 1.8.2502.11, stacked on#1975(72960386) overc9ee916a(2e7debd8).cargo check --workspace --tests: passed (0warnings in touched files).#1975+#1976: 14 passed, 0 failed (0.22s,dxil 1.8.2502.11validated).Regression run
scripts/smoke.ps1pair on2e7debd8vsc9ee916ahas not been run yet. AMD and NVIDIA reviewers are invited to test on2e7debd8vsc9ee916a(includingscripts/smoke.ps1,XCL_DIRECT_DXIL=1, and multi-wave mesh / straddling 16-bit LDS workloads) and post results in the comments.Not tested
scripts/smoke.ps1pair on2e7debd8, fullcargo test --workspacesuite on2e7debd8, runtime GPU execution across AMD / NVIDIA / Intel hardware, and Linux/Wine/vkd3d-proton.AI use
c9ee916a, trimming, and DXIL/recompiler validation tests; the author reviewed the diff and test output.