d3d12, dxbc: refuse incompatible WaveSize(N) compute shaders before driver compile #171
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/brcly--TuxBox!171
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/171/head"
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?
@Vladimir-Human on GitHub · 2026-11-25 13:01 UTC · original
Vladimir-Human:shader/wave32-wave64-diagnostics→main· +295 −34 · 8 files · 1 commits · merged 2026-11-25 14:21 UTCRefs #151
Summary
Implement Direction (1) for
#151: detect incompatible[WaveSize(N)]portable compute DXIL shaders before calling the host D3D12 driver, log an explicit wave-range refusal, and recordCS.refused=host-lacks-wave<N>inpipeline-failures/*.tsv(leavingtools/rank_pipeline_failures.py,tests/test_rank_pipeline_failures.py, anddocs/PROJECTSCARLETT.mduntouched to avoid conflicting with #167):tuxbox-dxbc(runtime/dxbc/src/fspx.rs,runtime/dxbc/src/lib.rs): addwave_lane_range(psv: &[u8]) -> Option<(u32, u32)>readingMinimumExpectedWaveLaneCountandMaximumExpectedWaveLaneCountfromPSV0PSVRuntimeInfo0(+16/+20), ignoring unconstrained(0, 0)/(0, u32::MAX)and invalidmin > max.tuxbox-d3d12:device/dxgi.rs: cache hostD3D12_FEATURE_D3D12_OPTIONS1[WaveLaneCountMin, WaveLaneCountMax]once per host device viaOnceLock.device/shader_cache.rs: addportable_wave_range(shader)inspectingPSV0onShaderCode::PortableDXIL containers (ignoringXDAT/NOBC).device/compute.rs&device/stream.rs: checkunsupported_wave_sizein slot 62 (create_pipeline_x_inner) and slot 86 (stream::createfields[5]) beforeprivate_root/CreateComputePipelineState/CreatePipelineState; on disjoint ranges, skip the driver compile, log viadiagnostics::compute_wave_failure(host lacks wave64 (supported wave range [32, 32])), recordCS.refused=host-lacks-wave<N>viafailures::refusal, and return the null compute stand-in whenTUXBOX_NULL_PIPELINES=1orE_INVALIDARGotherwise.diagnostics.rs&failures.rs: factordescribe_dxbc/log_compute_failureand addfailures::refusalfor local pre-driver stage refusals.Verified on Lanes
python tuxbox.py checkpassed on this branch (branch is based ona79aedbprior to MSVC/W4and#ordinalverify fixes in #169,tests/hits 5 pre-existing Linux-onlyfcntl/os.sched_getaffinitytest errors on Windows, andlanes-shader-cacheis Proton-only; equivalent Rust CI checks, targeted Python tests,lanes.exe, and a direct RTX 4070 SUPER[WaveSize(64)]vs[WaveSize(32)]d3d12_xs.dllprobe passed below)Lanesrunscs_6_0without[WaveSize(64)]so it exercises the non-refusal path; incompatible[WaveSize(64)]vs compatible[WaveSize(32)]cs_6_6pipelines are directly verified againstd3d12_xs.dllslots 62 and 86 on RTX 4070 SUPER)GPU, driver and backend: NVIDIA GeForce RTX 4070 SUPER (
pci=10de:2783), NVIDIA driver32.0.16.2114, Windows 11 native backend (MSVC19.44.35207, Windows SDK10.0.26100.0DXC, Rust1.95.0).Paste the summary printed at the end:
Checks
cargo test --locked -p tuxbox-dxbc: 20 passed, 0 failedcargo test --locked -p tuxbox-dxbc --features native-bindings: 54 passed, 0 failedcargo test --locked -p tuxbox-d3d12: 101 passed, 0 failedcargo test --locked -p tuxbox-xg-layout: 14 passed, 0 failedcargo test --locked --manifest-path tools/shader-compiler/Cargo.toml: 279 unit + 2 integration passed, 0 failedcargo check --locked --target x86_64-pc-windows-msvc -p tuxbox-d3d12 -p tuxbox-bvh: exit 0python -m unittest tests.test_rank_pipeline_failures tests.test_repository_hygiene tests.test_check tests.test_verify -v: 17 passed, 0 failedAI-assisted implementation and verification.