Direct DXIL: size a compute program's LDS block from its LDS_SIZE #2158
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!2158
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2158"
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?
@grahamster2 on GitHub · 2026-11-25 06:32 UTC · original
grahamster2:lds-size-direct-dxil→main· +290 −48 · 9 files · 2 commits · openStacked on #2146; only the last commit (
55d06c1) belongs here, please review that one.The direct DXIL backend (
XCL_DIRECT_DXIL) declares itsxcl_ldswith 8192 words for every program, as the HLSL kernel did before #2146. This sizes it by the same rule: a compute program'sCOMPUTE_PGM_RSRC2.LDS_SIZEplus the same reserved top words, rounded up to a power of two. The exchange words,XCL_WTand the address mask inlds_indexmove to the new block's top. LDS_SIZE 0 and the other stages keep 8192 words.Part of #675.
What is in it
Lw::lds_words, set insetup_storagefrom the entry'slds_bytes(gpu/dxil/lanes.rs,kernel.rs,lower.rs), and used by the mask inlds_index(lower_mem.rs).gpu_compute_lds_ring_in_a_block_of_the_programs_sizealso runs the direct translation. It covers the kernelsdirect_orruns (wave32, and wave64 in the split form) and checks that@xcl_ldshas the HLSL block's size. With the old 8192-word block, the test fails.bench_compute_lds_block(ignored, next tobench_split_wave64): the 32 KB block against the LDS_SIZE block, in a loop with an LDS store and load and an exchange per iteration.Tested
cargo test --workspace -- --test-threads=4at55d06c1: 1156 passed, 0 failed, 47 ignored. The SKIPPED tests are the same as in #2146 (no wave64).XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- --test-threads=4: 1099 passed, 1 failed, 27 ignored. The failure,gpu_image_get_resinfo_1d_array, also fails withXCL_DIRECT_DXIL=1at52577f9, so it is not from this change.bench_compute_lds_block, 2^18 threads x 8192 iterations, 64-thread groups, 32 KB block -> LDS_SIZE block:256-thread groups: 1.0x to 1.27x.
Regression run
Both runs with
XCL_DIRECT_DXIL=1(the path this changes).main (
cbc296a):this PR (
55d06c1):Not tested
AI use
direct_orruns, and to matching@xcl_ldsexactly.@JJAutoCompare on GitHub · 2026-11-25 07:01 UTC · original
Tested
PR #2158, stacked on #2146, was open at
55d06c1e02831b09a931d383b7f6ea4bb6793b9ebefore and after testing. The assigned checkout was clean and detached at that SHA. The initial GitHub API response and final public PR page agreed with the live Git pull ref. The PR describes same-head RTX 3080 coverage. The discussion contained no equivalent Arc A770 coverage.STOR-WINLAB ran Windows 11 Enterprise Evaluation 26200.9974 on a Ryzen 7 3800X with an Intel Arc A770, driver
32.0.101.9175. Rust and Cargo were1.100.0onx86_64-pc-windows-msvc(rustc0ef1bc386). Both runs loaded DXC and DXIL1.9.2609.5from%LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64.Cargo used the unoptimized test profile with
CARGO_BUILD_JOBS=2,CARGO_INCREMENTAL=0,CARGO_PROFILE_DEV_DEBUG=0,CARGO_PROFILE_TEST_DEBUG=0and the exclusive targetL:/XclTooling/pr1947-1831ec4-t3-97236edf/target.TEMPandTMPboth usedL:/XclTooling/pr2158/temp. The build finished outside the Arc mutex in 59.47 s. The invocation used-NoProfile -ExecutionPolicy RemoteSignedfor that PowerShell process.XCL_DIRECT_DXIL10The fixture explicitly compiles HLSL through DXC and translates direct DXIL under both environment settings. The two invocations therefore repeat the same assertions. The existing STOR-WINLAB A770 capability log records a D3D12 wave-lane range of 8 to 32, so the fixture exercised wave32 and split wave64 for 64×1×1, 256×1×1 and 8×8×1 thread groups. For each of the six configurations, the fixture checked the direct DXIL
@xcl_ldsdeclaration against the HLSL block size and compared each backend’s per-thread ring and first-lane exchange result to the expected integer arithmetic. This exercises the fixture’s one-word exchange slot.The executable SHA-256 was
896E8C588C18A5363FF54AD4B25C76842C9B260409AA28D89C9772E0825B74D9before waiting for the Arc mutex, after acquiring it and after both runs. The Arc mutex and target were released after testing.Combined: 2 passed, 0 failed, 0 ignored, 0 skipped.
Not tested
Native wave64, other adapters, other exchange layouts, negative cases, runtime backend selection, broader test suites, benchmarks, retail titles and smoke/regression runs.
AI use
T3 Code / Codex (
gpt-6.2-sol) ran the checked-in fixture, verified its assertion coverage and prepared this report.@DavidM1911 on GitHub · 2026-11-25 07:20 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!
@DarkPanda69 on GitHub · 2026-11-25 07:33 UTC · original
Tested:
gpu_compute_lds_ring_in_a_block_of_the_programs_sizepasses on AMD with native 64-lane waves (the case the PR lists as untested), and on an RTX 3060.gpu::filter: 586 passed, 2 failed, 23 ignored. The 2 failures are the AMD fuzz seeds 722 and 1599 tracked in #2115, which fail the same way onmain.Head
55d06c1applied onmain568e7db, debug,cargo test -p xcl --lib -- gpu:: --test-threads=4withXCL_ADAPTERset to each card. The HLSL half (#2146) passed the same way on this card earlier.Not tested: occupancy or speed on AMD (correctness only), a title.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
@emirduran707 on GitHub · 2026-11-25 21:14 UTC · original
Independent AMD RDNA4 (native wave64) test report on exact head
55d06c1e02831b09a931d383b7f6ea4bb6793b9e(clean detached checkout, no local changes).Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1154 passed, 2 failed, 47 ignored; 8 SKIPPED (6 inlower_dxil::tests::{f16,f32}_programs_on_the_gpurefused by per-lane form;heap_window_out_of_memory_falls_back_to_the_switch_form;pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.gpu::recomp::tests::compute_lds_block_takes_the_programs_lds_size.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1seed 722 andfuzz_validate_and_gpu_3seed 1599) are pre-existing on unmodifiedmainon this GPU.Regression run (60 s retail-title smoke,
XCL_NETWORK=0, release)(Matched
main68a284abaseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)Not tested
AI use
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.