Direct DXIL per-lane: ignore reserved OP_SEL[3:2] on V_PERMLANE(X)16_B32 #2095
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!2095
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2095"
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?
@certified-retart on GitHub · 2026-11-25 03:52 UTC · original
certified-retart:dxil/permlane-ignore-reserved-opsel→main· +62 −1 · 2 files · 1 commits · openWhat is in it
Part of #1269 (per-lane direct DXIL compute coverage).
On RDNA2, 32-bit
V_PERMLANE16_B32andV_PERMLANEX16_B32only defineOP_SEL[0](FI) andOP_SEL[1](BOUND_CTRL);OP_SEL[3:2]are reserved and ignored by hardware. Both the HLSL backend (emit.rs) and the per-instruction direct DXIL backend (dxil/lower_valu.rs) already ignoreOP_SEL[3:2]and only read bits 0 and 1.crates/xcl/src/gpu/recomp/lower/wave.rsrejectedop_sel & !3 != 0withVOP3 modifiers, which caused the per-lane direct DXIL lowerer to refuse valid retail compute programs that set a reservedOP_SEL[3:2]bit (e.g.OP_SEL=0x9withABS=NEG=CLAMP=OMOD=0). This change removes theop_sel & !3 != 0check while keeping real VOP3 modifiers (ABS,NEG,CLAMP,OMOD) refused.crates/xcl/src/gpu/recomp/lower/wave.rs: stop rejecting reservedOP_SEL[3:2]bits onV_PERMLANE16_B32/V_PERMLANEX16_B32.crates/xcl/src/gpu/recomp/lower_dxil.rs: addpermlane_ignores_reserved_opsel_bits, verifying wave32/wave64 per-lane lowering and DXIL validation withOP_SEL=0x9andOP_SEL=0xE, verifyingABS/NEG/CLAMP/OMODremain refused, and checking real-GPU wave32 execution and parity with per-instruction direct DXIL.Tested
dxil.dll1.9.2602.17.cargo test -p xcl --lib permlane_ignores_reserved_opsel_bits -- --nocapture: 1 passed, 0 failed, 0 skipped; validated wave32 and wave64 DXIL and ran wave32 on the RTX 5070 with exact per-lane output and parity against per-instruction direct DXIL.cargo test --workspace -- --test-threads=4(debug): 1,155 passed, 0 failed, 46 ignored across 21 test suites.XCL_RECOMP_NO_HLSL=1 XCL_RECOMP_STAGES=CSsurvey over a retail shader pack (2,689 compute programs,origin/maincbc296avs1b4f9a7):V_PERMLANEX16_B32: VOP3 modifiersrefusals:42->0.origin/mainalone:579->583(+4), refused for instructions only:1,078->1,074(the remaining ~20 first-refusal programs also hit the single-operand atomic check fixed separately in #2077).Regression run
Matched 60 s
scripts/smoke.ps1runs on the same machine, title, and release build (XCL_D3D12_DIRset to Agility SDK v614):Baseline (
origin/main):This PR:
Not tested
AI use
Antigravity (
gemini-4-neon) diagnosed the per-lane refusal, implemented the fix and test, ran the tests and smoke run, and drafted this PR description.@JJAutoCompare on GitHub · 2026-11-25 04:04 UTC · original
Tested
1b4f9a737e. The PR was open at this SHA and the local checkout was clean and detached before and after the run.cargo test --locked -p xcl --lib --no-run(unoptimized test profile, debug info disabled), exit 0. Used two build jobs, incremental compilation disabled, and the assigned target directory below.-NoProfile -ExecutionPolicy RemoteSigned. SetXCL_ADAPTER=A770and pointedXCL_DXC_DIRto%LOCALAPPDATA%\XclTooling\dxc-1.9.2609\bin\x64. The mutex callback usedSystem.Diagnostics.Processto capture the child’s two output streams and exit status. The child and mutex wrapper both exited 0. Libtest reported 1 passed, 0 failed, 0 ignored, 1124 filtered out in 0.23 s. Separate stdout and stderr showed 0 explicit GPU skips.OP_SEL=0x9onV_PERMLANEX16_B32andOP_SEL=0xEonV_PERMLANE16_B32. The four wave32 negative cases onV_PERMLANEX16_B32still refusedABS,NEG,CLAMP, andOMODindividually.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-25 05:44 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!
@thehollowedone on GitHub · 2026-11-25 11:54 UTC · original
Independent Windows run on 1b4f9a7. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, DXC 1.8.2502.11, debug.
cargo build --offline --locked --workspacepassed.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapturereported 1,155 passed, 0 failed, 46 ignored, with 25 runtime skip notices included in Cargo's pass count.I extended the stock test to dispatch both permlane instructions on native wave32 for all 16
OP_SELpatterns. That exercises all four reserved patterns for every combination of the defined FI and BOUND_CTRL bits with full EXEC. All 1,024 output words matched the CPU reference and the per-instruction Direct DXIL path. Restoring the old rejection gate refused both instructions in the stock case.cargo test --offline --locked -p xcl --lib permlane_ignores_reserved_opsel_bits -- --nocapture --test-threads=1passed 1/0/0 with zero skips, usingXCL_ADAPTER=3080 TiandXCL_REQUIRE_GPU=wave32. Native wave64 and retail were outside this check. AI-assisted. Codex (GPT-6, exact variant unavailable) extended the fixture, ran the tests, and drafted this report.@Chrysana on GitHub · 2026-11-25 14:36 UTC · original
AMD RDNA4 run of
1b4f9a7, for the native wave64 case under Not tested. The change lowers and runs correctly in 64-lane hardware waves, the PR's test passes on this card, and the title shows no regression.Setup: AMD Radeon RX 9070 XT 16 GB (RDNA4, native wave64), driver 32.0.32015.2008, Ryzen 7 9800X3D, 31 GB RAM, Windows 11 26200.9974, rustc 1.100.0 MSVC, DXC 1.9.2602.17. This PR's head as pushed (its base is
maincbc296a).Tested
cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4(debug): 1153 passed, 2 failed, 46 ignored. The two failures arefuzz_validate_and_gpu_1(seed 722) andfuzz_validate_and_gpu_3(seed 1599), the AMD seeds of #2115;main06c9f55fails the same two on this card.f16_programs_on_the_gpu(4) andf32_programs_on_the_gpu(2) (the per-lane form refusesV_MUL_F16/V_PK_MUL_F16/V_CVT_F16_F32, #1426),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),pso_measurement_compiles_an_exact_synthetic_record(no Developer Mode).permlane_ignores_reserved_opsel_bitspasses. Its GPU part runs wave32, also on this card.compute_withwithwave64: true, once withsplit: false(WaveSize(64), native) and once withsplit: true,OP_SEL=0x9onV_PERMLANEX16_B32and0xEonV_PERMLANE16_B32. In both forms all 64 lanes give the RDNA2 result (100 + (lane ^ 16)and100 + lane, so X16 swaps rows 0↔1 and 2↔3), and match the per-instruction direct DXIL. I can post the test if you want it in the PR.Regression run
scripts/smoke.ps1 -Seconds 60, retail title,XCL_PRESS_A_AT=20,25,30, two rounds alternatingmaincbc296a(this PR's base) and this head. Frames:main935 and 1021, PR 994 and 984; peak commitmain16055 / 15279 MB, PR 17914 / 15285 MB. 0 device removals and 0 crashes in all four. Round 1:With
XCL_DIRECT_DXIL=1 XCL_PER_LANE=1(one run each, otherwise the same):main995 frames, PR 962, no device removal or crash. Both logged the same 15per-lane fallbacklines, none of them on a permlane.Not tested
OP_SELbits that this PR is for: the title doesn't reach them in the first 60 s here, with or without the per-lane switches.main.AI use
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.