Direct DXIL: fix TG_SIZE wave rounding, alloca align=0, and shader fl… #2255
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!2255
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2255"
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?
@fixgep on GitHub · 2026-11-25 11:33 UTC · original
fixgep:fix/dxil-encoder-and-flags→main· +238 −37 · 4 files · 1 commits · openFixes three remaining direct DXIL encoder/flag bugs from #1894 and adds synthetic DXIL-validator unit tests across all five items (note: item 1
TG_SIZEdiv_ceilwas already fixed onmainin5b31ca7, and item 5heap_raw_bufferkeepsFeature::RawAndStructuredBuffersomitted becausedxil.dll1.9.2602.17 rejects that flag on heap-only raw buffers withFlags must match usage: declared=1073741840, actual=1073741824, matchingdxc.exe).Fixes #1894
What is in it
crates/xcl/src/gpu/dxil/module.rs: scan liveself.blocks.iter().flatten()instead ofself.insts.iter()inuses_double_extensionsso dead or unreachablef64ops do not triggerFeature::DoubleExtensions.crates/xcl/src/gpu/dxil/module.rs: encodeOp::Allocaalignment0as0instead of33((1 << 5) | 1, which setinallocabit 5), and assertalign == 0 || align.is_power_of_two().crates/xcl/src/gpu/dxil/module.rs: shareused_globals_and_funcsbetweenwrite_bitcodeandglobal_bytes_layoutso stripped/unreferenced TGSM globals are excluded fromPSV0NumBytesGroupSharedMemory.crates/xcl/src/gpu/dxil/module.rs,crates/xcl/src/gpu/dxil/core_tests.rs,crates/xcl/src/gpu/dxil/graphics_tests.rs,crates/xcl/src/gpu/dxil/shader.rs: add synthetic unit anddxil.dllvalidation tests for all five #1894 items, and updategroupshared_bytes_follow_the_16bit_layoutso its test globals are referenced by live instructions.Tested
591.44), AMD Ryzen 5 7500F, Windows 11 Pro (build26200),rustc 1.100.0 (0ef1bc386 2026-11-09), debug (cargo build/cargo test) and release (cargo build --release -p xcl+scripts/smoke.ps1), Windows SDKdxcompiler 1.9.2602.17/dxil 1.9.2602.17.cargo build --workspace: 0 new warnings (3 pre-existing warnings outsidegpu/dxil).cargo test -p xcl --lib gpu::dxil -- --test-threads=4 --skip fuzz_validate_and_gpu: 186 passed, 0 failed, 3 ignored; 1SKIPPED(gpu::dxil::kernel::dispatch_chain_native_wave64_builds_whole: no wave64).XCL_ADAPTER=warp cargo test -p xcl --lib gpu::dxil -- --test-threads=4 --skip fuzz_validate_and_gpu: 186 passed, 0 failed, 3 ignored (GPU execution tests skipped on WARP).Regression run
main:
PR:
Not tested
cargo test --workspace -- --test-threads=4andfuzz_validate_and_gpuafter the rebase ontoupstream/main(b49be183).no wave64on RTX 3060).Alloca align=0, deadf64extension ops, or Mesh shader stripped TGSM).AI use
upstream/main(b49be183), ran the build, targeted DXIL tests, and smoke checks, and updated this PR description.@throny on GitHub · 2026-11-25 14:54 UTC · original
Two contributors checked independently and found that #1952 #2227 solves the same problem (for #1894) in a different way: #1607, group D73. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
@DavidM1911 on GitHub · 2026-11-25 16:58 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.Thanks!
@Aniseto on GitHub · 2026-11-25 18:01 UTC · original
Ran the direct-DXIL tests at
fb9e401:Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC/DXIL 1.9.2609.5, debug build.
All five new tests for #1894 pass here:
compute_tg_size_wave_count_rounds_up_partial_waves,alloca_align_zero_encodes_without_inalloca_and_validates,dead_f64_inst_does_not_set_double_extensions,dead_tgsm_global_does_not_inflate_psv0_size_and_validatesandheap_raw_buffer_omits_static_raw_flag_and_validates.What this adds: the author's run was an Ampere RTX 3060 with Windows SDK DXC/DXIL 1.9.2602.17; this is a Blackwell wave32 part with DXC/DXIL 1.9.2609.5, so the DXIL validator sees a different driver and toolchain.
Not tested: a paired 60 s smoke run, AMD and Intel GPUs, native wave64, release profile, retail title data. The four
gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_*tests were skipped in the run above: when I ran the filter without--skipthey failed here withCreateComputePipelineState ... 0x8007000E(out of memory). I did not check that failure on the base commit, so I am not attributing it to this PR.AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
fb9e401142tof43fa7fbc3github-bot referenced this pull request2026-11-26 06:18:30 +00:00
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.