DXIL: add semantic inspection helper and fixture #2575
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!2575
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2575"
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?
@luckyteagirl on GitHub · 2026-11-25 23:26 UTC · original
luckyteagirl:codex/dxil-semantic-audit→main· +470 −0 · 5 files · 1 commits · openPart of #2541. This adds a read-only baseline for comparing DXC and XCL DXIL container semantics; it does not change the emitter.
What is in it
scripts/inspect_dxil_semantics.pyemits schema-versioned JSON with shader stage/model, DXIL module and validator versions, entry-point flags and thread-group dimensions, SFI0 feature flags and DXC feature names, calleddx.opnames/opcodes/overloads/counts, resource bindings and handle annotations, and target layout.disassembler_dxc_versionidentifies the inspection tool, not the container producer.tests/data/dxil_semantic/compute_store.hlslis a minimal compute reference with an 8×4×2 group,WaveActiveSum, and one byte-address UAV store.resource_bindings.hlslexercises a constant buffer, two-element texture array, unbounded texture array, sampler, UAV, and legacy TBuffer across register spaces 3, 12, and 15.scripts/test_dxil_semantics.pycompiles both fixtures with DXC and checks the expected semantic fields, including entry-point metadata and all six resource bindings and counts. It also checks that invalid explicit andXCL_DXC_DIRoverrides cannot fall back silently and that multi-entry containers are rejected. CI requires DXC and fails if it is absent.Tested
e1d84b7; current upstream main is08db802. The intervening changes are confined toREADME.mdandcrates/xcl/src/gpu/recomp/{dxc.rs,emit.rs,link_tests.rs,mod.rs}and do not overlap this PR's inspector, fixture, or CI workflow.1.9.2609.5fromXCL_DXC_DIR.python -B scripts/test_dxil_semantics.py --require-dxc --dxc C:\Users\Luma\Documents\ChatGPT\XCL-test\dxc-1.9.2609\bin\x64\dxc.exe: 7 passed, 0 failed, 0 skipped. DXC compiled both fixtures and-dumpbininspected them successfully.1.8.2502.11atC:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64\dxc.exeand Vulkan SDK DXC1.9.0.5399atC:\VulkanSDK\1.4.357.0\Bin\dxc.exe: 7 passed, 0 failed, 0 skipped on each toolchain. CI requires DXC and fails if it is absent.python -B scripts/inspect_dxil_semantics.py --dxc C:\Users\Luma\Documents\ChatGPT\XCL-test\dxc-1.9.2609\bin\x64\dxc.exe ..\dxc-output\compute_store.dxil: emitteddisassembler_dxc_version1.9.2609.5,cs_6_6, DXIL 1.6 / validator 1.9,8×4×2, SFI00x4000,waveActiveOp.i32opcode 119,rawBufferStore.i32opcode 140, and the UAVu0binding with byte format and read/write dimension.cb2,space3andt1,space3entries. Independent DXC probes then found that a TBuffer appears astexturein DXC's type column andtbufferin its dimension column, and that DXC can concatenateunboundeddirectly to the register/space token. The final parser reports all six bindings, includingt2,space12as TBUFFER, the texture array count of 2, andt11,space15with countunbounded, on all three DXC versions.vs_6_6vertex shader (7dx.opgroups, 5 bindings) and aps_6_6pixel shader (9dx.opgroups, 0 bindings). DXC-dumpbinaccepted both. No title data or containers were uploaded.git diff --check: passed.Regression run
Not required: this changes scripts, a test fixture, and CI only; it does not change runtime code.
Not tested
AI use
OpenAI Codex (GPT-6.2-sol) wrote the inspector, fixture, test, and CI step, and ran the DXC/Python verification described above.
@luckyteagirl on GitHub · 2026-11-25 23:45 UTC · original
Thanks for the independent DXC check. I reproduced the missing
cbandtexturerows locally before seeing your completed report, then amended this PR at5c469198623984b02bc2dd5bcbefef4221d71dcd. The new four-resource fixture checks that the inspector reports CBUFFER, SRV, SAMPLER, and UAV bindings with their register spaces. Its seven tests pass on local DXC 1.9.2609.5, 1.9.0.5399, and 1.8.2502.11. The amended Windows CI is running. Your array/count and multi-space checks add useful independent coverage.AI use: OpenAI Codex (GPT-6.2-sol) reproduced the parser gap, amended this PR, ran the tests, and drafted this reply.
@DavidM1911 on GitHub · 2026-11-25 23:45 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.Thanks!
— Devin
@RavenCurseBurg on GitHub · 2026-11-25 23:36 UTC · original · edited 2026-11-26 00:14 UTC
Confirmed the author’s independent binding-parser fix on
0723b118cbafabb3c2200b0c9680e2a874335310. I reran the earlier four-resource shader matrix with DXC 1.9.2609.5: two shader profiles, three register-space/array-size combinations, six compiled containers. All 24 JSON binding rows matched the compiler’s own disassembly on register class, register, format, dimension and count.python -B scripts/test_dxil_semantics.py --require-dxcpassed 7/7, including the upstream fixture with its tbuffer and unbounded array; full Python discovery passed 32/32. Windows 11, Core i7-13700. No GPU dispatch or XCL-generated container was used. OpenAI Codex (GPT-6) ran the checks.Earlier verification
I reproduced two missing resource bindings on
865c792a2e824b784f8842f7f1b65eb51667bb8fwith DXC 1.9.2609.5. A small compute shader uses four resources.dxc -dumpbinlists all four, but the original inspector's JSON contains only the sampler and UAV. The omitted rows are the constant buffer atcb2,space1and the two-element texture array att3,space2.Fix and compiled regression fixture. The inspector now reads DXC’s
cbbinding prefix and itstexturetype for shader-resource views. With the fix, the four JSON rows match the dump, including counts and spaces. I also compared six small containers atcs_6_0andcs_6_6, using spaces 0, 7 and 23 and array sizes 1, 2 and 4. All 24 binding rows matched DXC on class, register, format, dimension and count.With
XCL_DXC_DIRset to the local compiler directory,python -B scripts/test_dxil_semantics.py --require-dxcpassed 6/6 on the original head and 7/7 with the patch. The new fixture failed against the original inspector.python -B -m unittest discover -s scripts -p "test_*.py"passed 32/32 with the patch. Windows 11, Core i7-13700, Python 3.14.3. CPU-side compilation and disassembly only. XCL-generated containers and GPU execution remain untested here. OpenAI Codex (GPT-6) wrote the patch and ran these checks.@DavidM1911 on GitHub · 2026-11-26 01:36 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
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.