DXIL: add semantic inspection helper and fixture #2565
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-25T23:26:02Z.
Part 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.
Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-25T23:36:33Z.
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.Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-25T23:45:19Z.
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.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T23:45:32Z.
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
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T01:36:26Z.
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
Imported from ivall/xcl. Originally posted by rgroenewoudt on 2026-11-26T19:46:53Z.
Test report for
0723b118with another DXC versionTested
python -B scripts/test_dxil_semantics.py --require-dxc --dxc "<Windows Kits>\x64\dxc.exe": 7 passed, 0 failed, 0 skipped.scripts/inspect_dxil_semantics.pyon 40 DXIL containers from XCL's runtime cache (%LOCALAPPDATA%\xcl\dxil, compiled by DXC from XCL's HLSL for a retail title): 40 parsed, 0 errors (23 compute, 13 pixel, 3 vertex, 1 mesh). The output was not checked field by field, and no title data is shared here.Not tested
translated/).AI use
Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T04:28:05Z.
Independent desktop NVIDIA verification of PR #2575 at head
0723b118cbafabb3c2200b0c9680e2a874335310(1commit; exact parent & merge-base:e1d84b7d9153f86a97d2ec5d209d196046fc0bea, pre-#2555ancestor ofmain).Environment
7956 MiBreported by D3D12), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200(Developer Mode off)3.15.2, DXC1.9.2609.5(viaXCL_DXC_DIR),rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC,--releaseTargeted DXIL semantic fixture tests & build (
0723b118)python -B scripts/test_dxil_semantics.py --require-dxc(3 consecutive runs, exact CI check against live DXC1.9.2609.5)Ran 7 tests ... OK× 3 (0.068s,0.071s,0.067s,0skipped,0failed:test_entry_metadata_contains_thread_group_size,test_explicit_missing_dxc_does_not_fall_back,test_features_operations_and_resource_semantics,test_invalid_dxc_directory_does_not_fall_back,test_multiple_entry_points_are_rejected,test_resource_bindings_include_constant_buffers_textures_and_tbuffers,test_stage_model_versions_and_entry_metadata)cargo build --release -p xcl1m 12s, exit0,0new warnings)Paired quiet 60 s retail smoke (
title: 29640639)Exact parent & merge-base (
e1d84b7d9153f86a97d2ec5d209d196046fc0bea, cached baseline on the same machine):PR #2575 (
0723b118cbafabb3c2200b0c9680e2a874335310):Runtime log observations (
xcl.log)9223log lines,0[ERROR]/ device-removal / panic lines (dxil_cache:460hits,0misses,0compilation failures;228background pipelines,0failures).19663 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample13987 MB committed by the process; video memory 6115 MB local, 4651 MB non-local.Limits of coverage
.github/workflows/ci.yml,scripts/inspect_dxil_semantics.py,scripts/test_dxil_semantics.py,tests/data/dxil_semantic/*.hlsl;0Rust production-code changes); all7tests inscripts/test_dxil_semantics.py --require-dxcpassed3/3against installed DXC1.9.2609.5on Windows 11.AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:24:28Z.
Triage (#1607) – head
0723b11No open or merged PR adds a DXIL semantic inspector. #2553 (same issue #2541) adds manifests and a hash checker for
xcl shaders --direct --dumpoutput, which is a different tool. One small point: inscripts/test_dxil_semantics.pythe three tests that need no DXC (test_explicit_missing_dxc_does_not_fall_back, etc.) live in the class whosesetUpClassraisesSkipTestwhen DXC is missing, so they are skipped too without--require-dxc.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.