Skip to content

Docs: describe embedded shader STAT and XDAT parts (ASSET-202) - #2826

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
caua-an:docs/asset-202-embedded-shader-parts
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
caua-an:docs/asset-202-embedded-shader-parts

Conversation

@caua-an

@caua-an caua-an commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Document the STAT bitcode and XDAT tag 0x07 in the 52 embedded builder containers (ASSET-202; claim).
  • In a local 1.0.2.1 package, all 52 STAT parts contain valid DXIL bitcode with entry-point and resource metadata but no defined functions. DirectXShaderCompiler uses a valid STAT module for reflection; the builder’s actual use remains unmeasured.
  • All 52 tag 0x07 records contain DXIL bitcode matching the outer DXIL bitcode, not the NOBC marker. This concerns the builder containers only, not the separate game-shader corpus.

Depends on: #2473 (both edit docs/embedded_shaders.md; coordinate merge order and rebase as needed).

Verification

  • All 104 STAT and outer DXIL modules were accepted by llvm-dis 21.1.8; header sizes and declared bitcode bounds were checked across all 52 containers. Comparisons and counts only; no shader data is included.
  • python3 -I tests/test_pe_shader_containers.py: 15 tests passed.
  • python3 -I tests/test_fssm_unpack.py: 39 tests passed.
  • tests/test_docs_links.py, tests/test_docs_list_items.py, tests/test_docs_repo_paths.py: all passed; git diff --check clean.

The local input was read without executing it; generated shader data and logs remain in a private work folder outside the repository. No game data, keys, decryption or protection workarounds. AI-assisted.

@Yourrespawn

Copy link
Copy Markdown
Contributor

Review verified what's verifiable without a local package: the citations and scoping check out.

  • The DXC reflection claim is accurate: DxilContainerReflection::GetPartReflection in DxilContainerReflection.cpp validates STAT as a reflection-capable part (IsValidReflectionModulePart accepts DFCC_ShaderStatistics) and, when present with a valid DxilProgramHeader, substitutes the STAT part for the DXIL part as the reflection source — so "uses a valid STAT module for reflection" and "the metadata-only shape is consistent with that role" are both sound, and hedging the builder's actual consumption as unmeasured is the right call.
  • The 0x07 scoping is consistent with the repo's own docs: fssm_crosscheck.md documents 0x07 (DxilProgramHeader/NOBC) for the 26,503-container game-shader corpus, and this PR's finding (builder containers' 0x07 is DXIL bitcode identical to the outer part, no NOBC) is explicitly scoped as a different corpus — the cross-reference is fair and doesn't disturb that measurement.
  • The "still open" list is correctly updated: STAT and 0x07 were named there before; both are now explained, and the remaining open item (builder consumption of STAT) is kept.
  • Dependency note checks out: Docs: one embedded_shaders §4 after both PROC-120 PRs landed; the M6 row's count (PROC-120) #2473 is still open and also edits docs/embedded_shaders.md, so the merge-order coordination matters.

The 52/52 measurement counts themselves I cannot independently re-verify (no local package on this machine) — nothing in the PR includes game data, only counts and structural facts, which complies with CONTRIBUTING.md.

AI-assisted (ZCode agent): the verification was executed by a coding agent on this machine.

@caua-an

caua-an commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for reviewing the citations, the scope of the measurements, and the merge-order note. I appreciate the independent check and the clear distinction between what could be verified from public sources and what requires a local package. AI-assisted.

@ramenbellic

Copy link
Copy Markdown

Code read of dfde07d: looks right. The "differs from the NOBC form documented for the game's shader corpus" sentence matches docs/fssm_crosscheck.md:38 (tag 0x07 = DxilProgramHeader/NOBC, 26,503/26,503), and the new section is consistent with the existing bullet at docs/embedded_shaders.md:44. #2473's hunks in this file don't overlap with this one. Small follow-up idea, not blocking: the tools/fssm_unpack.py:11 docstring states the NOBC form without qualification, and could say "in the game's shader corpus" now that this PR shows builder containers carry full bitcode under 0x07. Docs tests pass on dfde07d. I didn't re-run the llvm-dis measurement.

AI-assisted code read (Claude Code).

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on the PR head: docs checks test_docs_links.py 5, test_docs_repo_paths.py 2, test_docs_list_items.py 2, test_docs_design_rows.py 2; test_pe_shader_containers.py 15; test_fssm_unpack.py 39; git diff --check clean.

Fact-check against the local 1.0.2.1 package: XboxBvhBuilder.dll has 52 containers, 52/52 STAT parts and 52/52 tag-0x07 program headers, and the tag-0x07 bitcode is byte-identical to the outer DXIL bitcode 52/52. All 104 modules parse. The one thing not independently verified is whether the builder actually consumes STAT (the docs say so).

Note: #2473 edits the same file, so merge order needs coordinating. Approve.

@tupacfan04

Copy link
Copy Markdown
Contributor

Docs tests pass at the head on Windows 11 / Python 3.13.0 (test_docs_design_rows 2, test_docs_links 5, test_docs_list_items 2, test_docs_repo_paths 2, line endings 2); merge with main clean. The STAT/XDAT split agrees with docs/embedded_shaders.md:45,:55, and the NOBC note at :63 correctly limits the corpus.

Nits:

  • :53 says the size in dwords "equals its enclosing part or record length"; it is ×4, so "the part length" is the accurate phrasing.
  • :62-63 says the outer DXIL part "also contains XDAT"; XDAT is a separate chunk (:43), so "container" is clearer.
  • The 52/52 scan has no command or offset: cite tools/pe_shader_containers.py and the llvm-dis invocation the way other measured rows do.

Coordination: #2473 and #2503 both rewrite this file's translation table; the body names only #2473. Also confirm the scan used #2884's fixed xdat_tags().

AI-assisted review, docs only.

@ItsNotRexed
ItsNotRexed merged commit 37be808 into ItsNotRexed:main Nov 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants