shader: add deterministic corpus report #1032
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1039"
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 R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-23T22:29:20Z.
Change
Add
tools/shader_corpus_report.py, a deterministic offline report over the existing shaderarchive framing, plus a synthetic-frame test registered in the Linux Python job.
The report separates and labels:
All nine known stages are always present, including zero rows, and unknown stage kinds are listed
separately. JSON and Markdown include record/program/stream counts, native bytes, code dwords,
rejections by reason, optional decode results and the top unsupported forms. Without a decoder,
decode.statusisnot_runand no LLVM is required.The native-code path now calls
extract_native_rdna2_codedirectly.Nonestill means absentor refused native code, but an unexpected exception propagates to
main, which prints adiagnostic and exits 1 without writing a report.
Verification
out\pe-env\Scripts\python.exe -B tests\shader_corpus_report_check.pyRan 8 tests ... OK, exit 0.3/2/1, compute1/1/1,vertex
1/1/1; six stages at zero. The injected formv_foo_f32_e32blocks one stream andthree records.
container_framingwhile accepted countsstay unchanged; a repeated run is byte-identical. An empty archive exits 1 without a report.
extract_native_rdna2_coderaises, and the reportraises instead of counting a record without native code. A patched
build_documentinmainreturns 1 with the diagnostic and writes no output.report.json: 3,902 bytes, SHA-2566787ec4ebc502875dfb68f982a700e972f0ca856e23ecc21a605546b9e6de4a3report.md: 1,133 bytes, SHA-256b79e17581050f8dbe51682bb18dafd9b4fa86ce67c41d7b0c2bbc7e986f22547out\pe-env\Scripts\python.exe -B tests\docs_links_check.py:Self-test passed.,Checked 13 Markdown files and 229 links., exit 0.git diff --check origin/main...HEAD: clean.archive was used; every input is synthetic.
Evidence and follow-up
shader/corpus-report, head8285b10, based ona4e7651. Two commits:0e32626adds the report and fixture;8285b10addresses the review by removing the broadexception conversion and registering the check.
xbox2windows.report/1, withgenerated_by,inputs,sections.shader_corpusandattachments: []. This is the same envelope used by the XCL-01report; the tools share a JSON contract, not Python imports.
resource_inventory.scene_recordsandextract_shaders.extract_native_rdna2_code; the cache population reusesshader_census.cache_index. Acceptance rules are not forked.Xbox2Windows backlog and the XCL-01 envelope contract.
and validation failures, and attach the XCL-01 import-routing section as an optional opaque
fragment. Records that need the bounded FSSM span or the two-output rule from
pixel_aot.container_codecurrently appear inrecords_without_native; this is visible inthe report and is the next extraction follow-up.
native-code framing from bytes. It remains one behavior. README and docs are untouched.
Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T22:35:32Z.
The record / full-container / native-stream split and
decode.status=not_runare useful. Please register the synthetic test in the existing Linux Python job in this PR. Also remove the broad exception-to-no-native conversion aroundextract_native_rdna2_code: the existing parser already returns None for absent/refused native code. An unexpected exception should fail the report with a diagnostic rather than silently count as a record without native code. Keep the 5/4/3 and truncated-container controls.Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-23T22:53:41Z.
Addressed in c63eb83. The broad exception-to-no-native conversion is removed: extract_native_rdna2_code is called directly, None still means absent or refused native code, and an unexpected exception now propagates out of build_document. main prints "shader corpus: unexpected failure: : " and returns 1 without writing a report. Added the propagation and main-diagnostic tests (8 tests total); the 5/4/3 and truncated-container controls are unchanged. The check is registered in the Linux Python job and the AGENTS list.