Shaders: xcl shaders --precompile --pipelines blobs rejected on run 1 (compute retry) due to NodeMask, static_samplers, and device-flag mismatches #2453
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#2453
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@microwave805 on GitHub · 2026-11-25 19:30 UTC · original
Investigation on
main @ c7e1799of the issue reported on #1833 (xcl shaders --precompile --pipelinesblobs rejected withcompute retryon the first title run, then accepted on run 2). Part of #1833, Part of #1269.compute retryis emitted only incompute_container()(crates/xcl/src/hle/d3d12x/real.rs:4434-4440), meaningdriver_cache::load(disk)found the prebuilt<fnv64(dxil)>-<len>-0.psofile,CreateComputePipelineStaterejected itsCachedPSO, deleted it, retried uncached, and overwrote the exact same path with a compatible blob that run 2 then accepts.Three concrete mismatches between
xcl shaders --precompile --pipelines(shaders.rs) and runtimecompute_container()(real.rs) cause this:1.
NodeMaskmismatch (0 in precompile vs title'sd.NodeMaskat runtime) and omission from cache keyscrates/xcl/src/shaders.rs:1327-1331(Pipelines::make_with_cache_path)crates/xcl/src/hle/d3d12x/real.rs:4402-4411(compute_container),4477-4479(driver_cache::name),4651-4656(compute_blob_key),6574(stream_pipeline)shaders.rs:1327-1331constructsD3D12_COMPUTE_PIPELINE_STATE_DESCwith..Default::default(), hardcodingNodeMask = 0.compute_container()(real.rs:4402) copiesdverbatim and preserves the title'sNodeMask(e.g.NodeMask = 1, including stream subobject18atreal.rs:6574). Bothdriver_cache::name(dxil, flags)andcompute_blob_key(dxil, rs, flags)omitNodeMask(unlikegraphics_blob_key,compute_key, anddispatch_chain.rs).NodeMask = 1hits<hash>-<len>-0.psobuilt withNodeMask = 0→CreateComputePipelineStatereturnsE_INVALIDARG(compute retry) → deletes and overwrites the file withNodeMask = 1→ run 2 accepts it.copy.NodeMask = 0incompute_container()(matchingCreateRootSignature(0, ...),finish_two_pass, andshaders.rs), or includeNodeMaskindriver_cache::nameandcompute_blob_key.2.
driver_cache::nameomitsstatic_samplers(pRootSignaturecontent)crates/xcl/src/hle/d3d12x/real.rs:4411, 4477-4479,crates/xcl/src/shaders.rs:1333driver_cache::name(dxil, flags)keys only on(fnv64(dxil), dxil.len(), flags)without hashingcompiled.samplers, even thoughS#static sampler descriptors live exclusively inpRootSignature. Two shaders with identical DXIL but different static samplers collide on the same.psofile and failCachedPSOroot-signature validation (compute retry).samplers(asgraphics_blob_keyandtwo_pass_cs_keyalready do) intodriver_cache::name.3.
Pipelines::new()ignoresXCL_DRED,XCL_D3D12_DEBUG, andxcl.tomladapter settings — and triggers post-device debug-layer removalcrates/xcl/src/shaders.rs:1289-1301, 1410-1437vscrates/xcl/src/hle/d3d12x/real.rs:486-540,crates/xcl/src/gpu/recomp/runner.rs:88-90Pipelines::new()hardcodesSelector::from_env_or("auto")and never appliesXCL_DRED,XCL_D3D12_DEBUG, orxcl.toml'sd3d12_adapter/d3d12_debug, causing prebuilt driver blobs to mismatch runtime devices when any of those are set.precompile()(shaders.rs:1411),Pipelines::new()createspipeline.devbefore lines1436-1437callrunner::graphics_wave32()/wave64_supported(). WithXCL_D3D12_DEBUGset,runner::init()enables the D3D12 debug layer afterpipeline.devalready exists, removingpipeline.dev(DXGI_ERROR_DEVICE_REMOVED).XCL_D3D12_DEBUG/XCL_DREDand runrunnercapability queries before creatingpipeline.dev(or query wave capabilities directly onpipeline.dev).(Also note:
shaders.rs:1304-1389currently ignoresc.dispatch_chainand only writes.psoforc.dxil, leaving split compute shaders un-precompiled as.chain.pso.)AI use
main @ c7e1799and issue drafting.github-bot referenced this issue2026-11-26 05:32:37 +00:00
@oni-swr on GitHub · 2026-11-25 20:49 UTC · original
Claiming this issue: aligning xcl shaders --precompile --pipelines descriptor/cache-key construction (NodeMask, static_samplers, device flags) with runtime compute_container(), with regression tests.
AI use: Claude Code (Claude Opus 5.5).
@KOLESNiii on GitHub · 2026-11-26 01:08 UTC · original
Two offline parity checks on
mainatb49be18.xbox::parsebefore it checks the stage or reachesPipelines::make. That parser requires a DXIL part containing XDAT. The runtime’sconsole_translationaccepts an ACCC/FSPX container directly, and the CLI’s measure/export path already recognizes the format. I ran the upstream synthetic ACCC-only fixture with the extracted parsers and confirmed that runtime classification accepts it and XDAT lookup fails. The worker skips it even with--only cs, before incrementing any result counter. The number of affected title pipelines is unknown. Precompile worker · Runtime translator · FixtureGetCachedBlobresult of exactly the input size. A successful create with a different-sized blob takes the same branch as a failed create. Under the cap it callsCreateComputePipelineStateagain without the blob. Above the cap it discards the returned object, deletes the file and counts the input as capped. If a driver accepts the input and rebuilds or reserializes it, the first call may already have done the expensive work. Equal sizes also cannot establish reuse by themselves. A Windows trace with the first HRESULT, both blob lengths and elapsed time for each create would show whether this matters on a given driver. Offline create and retryStatic review and a standalone parser probe on Linux. Windows, title coverage and timing remain unmeasured. AI use was OpenAI Codex (GPT-6, exact serving variant unavailable) for review, probe and drafting.