Repository navigation
Conversation
Match the HLSL recompiler's stage guards in Lw::export and Lw::ds:
- Reject ENC_EXP in compute (res is None) and geometry (geom is Some)
entries with "export target" instead of panicking on
self.res.expect("res") (compute, en != 0), silently returning Ok
(en == 0), or writing kernel-export offsets into the geometry mesh
record buffer.
- Reject LDS ENC_DS operations in vertex and pixel entries (gfx is
Some) with "LDS outside compute" after allowing wave-level
ds_swizzle_b32 and ds_bpermute_b32 (and ds_nop), instead of emitting
invalid addrspace(3) TGSM ops in graphics DXIL.
Part of xcl-dev#1269
Assisted-by: Google Antigravity (Gemini 4 Neon)
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
Contributor
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is in it
Matches the HLSL recompiler's stage guards (
recomp/emit.rs) in the direct DXIL translator'sLw::export()andLw::ds()(crates/xcl/src/gpu/dxil/lower_mem.rs):Lw::export(): after dispatchingEntry::Mesh(self.mesh.is_some()) andEntry::Vertex/Entry::Pixel(self.gfx.is_some()), rejectsEntry::Compute(self.res.is_none()) andEntry::Geometry(self.geom.is_some()) witherr(d, "export target")before reaching the kernel-modeKERNEL_EXPORTSstore path. Previously,ENC_EXPinEntry::Computepanicked onself.res.expect("res")whenEN != 0and silently returnedOk(())whenEN == 0, whileENC_EXPinEntry::Geometrysilently wrote kernel-export offsets into the geometry mesh-record UAV (u1).Lw::ds(): after handling wave-levelds_swizzle_b32andds_bpermute_b32(withds_nopalready skipped inNOOPS), rejects LDSENC_DSoperations inEntry::VertexandEntry::Pixel(self.gfx.is_some()) witherr(d, "LDS outside compute")beforeGDS/ LDS lowering. Previously, direct DXIL emitted invalidaddrspace(3)TGSM ops in graphics stages and returnedOk.gpu::dxil::lower_mem::stage_guard_testscovering computeEXP(EN = 0xFandEN = 0, wave32 and wave64), geometryEXP(EN = 0xFandEN = 0, ES-only and GS-only, native and split), VS/PS LDS ops (DS_READ_B32,DS_WRITE_B32, andGDS = 1), and positivedxil.dllvalidation controls for kernelEXP, compute LDS, and VS/PSDS_SWIZZLE_B32/DS_BPERMUTE_B32/DS_NOP+ validEXP.Part of #1269
Tested
Environment: Windows 11 Home 26200, Intel Core i5-11400F, 32 GB RAM, NVIDIA GeForce RTX 4060 8 GB (driver 621.14, wave32), Rust 1.100.0, DXC
1.9.2609.5(01b62ad4).cargo test -j 4 -p xcl --lib gpu::dxil::lower_mem::stage_guard_tests -- --nocapture): 1 passed, 3 failed (compute_export_rejectedpanicked atlower_mem.rs:2511:28: res->"the direct DXIL translator panicked: res";geometry_export_rejectedandgraphics_lds_rejectedunexpectedly succeeded;valid_stage_ops_still_translate_and_validatepassed).cargo test --release -p xcl --lib gpu::dxil::lower_mem::stage_guard_tests -- --nocapture): 4 passed, 0 failed (includingdxil 1.9.2609.5validation of positive controls).cargo build --release --workspaceandcargo test --release --workspace -- --test-threads=4 --nocapture): 1,158 passed, 0 failed, 46 ignored across 21 test binaries (1102inxcllib,56across the remaining 20 binaries), with 27SKIPPEDlines on this RTX 4060:no wave64(RTX 4060 is wave32-only)per-lane form: refused(wave32 f16 arithmetic, f16 packed, f32 conversions)no d3d12SDKLayers.dll/no D3D12 debug layercannot disable the driver cache(Windows Developer Mode not enabled)no heap windowsRegression run
Paired 60 s runs via
scripts/smoke.ps1on cleanorigin/main(cbc296ab) and clean PR head (00b5eef7):Main (
cbc296ab65a2661a61e3e2da109134bcd5319f60):PR (
00b5eef722359d70fd2549a12a5f87edb9b154f5):Not tested
no wave64skips on RTX 4060), D3D12 debug layer tests (2 skips withoutd3d12SDKLayers.dll), driver cache disable toggle (1 skip without Windows Developer Mode), and heap-window OOM fallback (1 skip withoutXCL_HEAP_WINDOWS).title: 29640639(and runtime title execution specifically exercising malformed compute/geometryEXPor graphics LDS shaders underXCL_DIRECT_DXIL).AI use
Google Antigravity (Gemini 4 Neon) wrote the stage guards, unit tests, and this PR description. All pre-fix/post-fix unit tests, full release workspace tests, paired 60 s smoke runs, and
scripts/pr_check.py --localvalidation were run locally on this machine.