shader: add a GDK shader corpus harness #3290
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3290
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3288"
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?
@lambirou on GitHub · 2026-11-28 05:21 UTC · original
lambirou:gdk/shader-corpus→main· +496 −0 · 11 files · 2 commits · merged 2026-11-28 08:26 UTCThe GDK knowledge plan needs a reproducible corpus for the Xbox HLSL compiler and the existing DXIL retargeter. This adds six original HLSL cases and a harness that compiles them with the GXDK Scarlett dxc, retargets each container, records the source and container SHA-256 values, and verifies the result without the SDK.
Measured on 28 November 2026 with dxcompiler_xs 1.8, build 2610.2608.12522.14643:
All six compiled, retargeted from dxil-ms-xb2 to dxil-ms-dx and verified. The retarget removed xbox.compiler.options in every case. The cases cover wave ballot and lane access, a root signature with one constant buffer, a comparison sample at level zero, packed 16-bit fields in compute, implicit derivatives and fwidth, and a fixed three-vertex mesh shader.
Commands:
python -B tests/gdk_shader_corpus_check.py
python -B tools/gdk_shader_corpus.py build --gdk-root D:\gdk-ref\261000\gxdk\Microsoft GDK\261000 --corpus tests\gdk\shaders --out D:\gdk-oracle\knowledge\shaders\corpus
python -B tools/gdk_shader_corpus.py verify --manifest D:\gdk-oracle\knowledge\shaders\corpus\corpus.json
The check runs on Linux without dxc and covers case loading, hashing, manifest verification, triple checks and the missing-dxc skip. build returns 77 when dxc is absent.
A retargeted container is not a GPU execution result. The corpus does not prove that a desktop driver accepts the mesh or pixel pipeline, and it does not cover game shaders. The HLSL sources are versioned; the .cso files and the corpus manifest stay in D:\gdk-oracle.
@JohnConnorNPC on GitHub · 2026-11-28 06:45 UTC · original
Thanks for the corpus harness. I reviewed
f623e4c4and found two problems inverifythat I'd like to see fixed before this merges:verifydoesn't check the sources or the case list. It never comparessource_sha256with the current HLSL and never cross-checkscases.json, so a stale or empty manifest still verifies.python -B tools/gdk_shader_corpus.py verify --manifest empty.json, with{"cases": []}in the file, printsverified 0 casesand exits 0. The valid manifest incheck_verifyalso uses"source_sha256": "0" * 64without a source file, and it passes (the Linux CI log showsverified 1 cases). Couldverifytake--corpus, recompute each source hash, require the case names to matchcases.json, and fail when there are no cases?Most
verifychecks have no negative case. I rantests/gdk_shader_corpus_check.pyagainst five mutants ofverify_command. Each one removes a single check: the size comparison, theoriginal_triplecheck, thexbox.compiler.optionsremoval check, the recorded-error check, or the desktop record (by looping over("xbox",)only). All five still pass (rc=0). Because of the last one, the hash of the retargeted container is never tested, even though the check prints "verify: hashes, sizes, triples and missing files passed". One negative case for each would pin them.I only ran the pure-Python check on Linux (Python 3.13), with each mutant in its own scratch copy. I did not run a GDK build.
This comment was AI-assisted.