Repository navigation
tools: sgd5_pass_pipelines.py turns every stored SGD5 pass into a shader_link_check batch manifest - #5207
tools: sgd5_pass_pipelines.py turns every stored SGD5 pass into a shader_link_check batch manifest#5207Pipodi wants to merge 4 commits into
Conversation
…der_link_check batch manifest Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… keep only the stage sets shader_link_check takes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Checked the SGD5 manifest at I ran CPU-only on CachyOS. This was static shader linkage; Vulkan pipeline creation with the real partners and render states remains a separate test. AI-assisted. |
|
Independent check — PASS: |
|
Thanks @Kev-Ball. Same 28,798 / 16,325 from your own carve, and the same 301 on a different translator head, is the reproduction this needed. Running the manifest across #4760's optimization toggle is a use I hadn't thought of. Pipeline creation with the real partners in AI-assisted (Claude Code). |
|
Independent AI-assisted Windows end-to-end CLI check at Using the full manifest, batch reported 4 compatible / 2 incompatible with this branch's translator, and 6 / 0 with #5199 One normal case breaks the documented handoff: a valid empty |
…ch batch refuses Reported by whattheflop in ItsNotRexed#5207: an empty --spirv-dir left no set, the tool wrote {"pipelines": []} and exited 0, and shader_link_check.py batch then exited 2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @whattheflop, good catch. Fixed in 2e1c588: when no set is left, the tool prints its counts and exits 1 without writing the manifest, since AI-assisted (Claude Code). |
kacper-serewis
left a comment
There was a problem hiding this comment.
At 0e8354b conflicting carve-index entries sharing an offset silently change the selected shader. Reversing the index in a six-pass synthetic case changed the pixel shader in two passes. Both orders reported five resolved rows and two pipelines. Please reject conflicting entries at the same offset and test both input orders. The cached index had 26,503 distinct offsets in 26,503 entries. All 12,221 distinct stored mesh/pixel offset pairs in the independent inventory mapped correctly. That inventory does not retain state selectors or pass multiplicity.
AI-assisted independent review.
…offset Reported by kacper-serewis in ItsNotRexed#5207: with such entries the selected shader depended on the index order. The same entry listed twice is still accepted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @kacper-serewis, agreed. Fixed in a4a87ba: AI-assisted (Claude Code). |
|
AI-assisted Windows rerun at Repeating an identical carve entry in either order left both reports unchanged. Two independently carved shaders at the same offset were rejected in either order, with exit 1 and no output files. The canonical six-pipeline manifest and stage results were unchanged, and all five focused tests passed. Synthetic inputs only. |
kacper-serewis
left a comment
There was a problem hiding this comment.
Whole-package follow-up on the earlier 0e8354b revision: 28,797/28,797 emitted pass rows agreed with an independent walk in stored order, including raster, depth and blend selectors. Of 28,798 stored passes, one selected no program. Removing 2,863 compute passes and 3,560 without a pixel shader left 22,374 graphics occurrences and 16,325 distinct pipelines before the optional SPIR-V availability filter. The check reused effect-boundary parsing and program-offset resolution but decoded technique lengths, pass selectors and state bytes separately. This comparison predates a4a87ba.
AI-assisted independent CPU review.
kacper-serewis
left a comment
There was a problem hiding this comment.
The conflicting-offset finding is resolved at a4a87ba. Both index orders returned status 1 and preserved both existing outputs. An identical duplicate yielded byte-identical output. All five focused tests passed. This was a synthetic CPU recheck; the whole-package row comparison reported earlier ran at 0e8354b.
AI-assisted independent review.
|
Tested
|
Claimed in the coordination issue as: new SHADER item, building the graphics pipelines the effect database defines (claim). This is its census step; #5199 is the translator fix the census found.
Depends on: none. The tool runs on
main. Onmainthe link check it enables reports the 301 VS+GS+PS failures that #5199 fixes.What and why
Today the pipeline check pairs each translated shader with a stub partner, and
shader_link_check.pychecks only pairs listed by hand. The game's own pairings are known: every stored SGD5 pass (tools/sgd5_effects.py,docs/sgd5_render_states.md) names its VS or MS (+GS) + PS and selects rasterizer, depth/stencil and blend rows.tools/sgd5_pass_pipelines.py <shaders.rpf> <carve index.json> --out manifest.json [--spirv-dir DIR] [--passes passes.json]:program_identity()'s carve offset and names it by the entry's file stem, which is unique; display names repeat. Two different index entries at one offset are an error, so the result never depends on the index order (found by @kacper-serewis); the real index has 26,503 distinct offsets.shader_link_check.py batchmanifest with one pipeline per distinct graphics programme set that has a PS, sorted, namedpNNNNN_<first stem>.batchdoes not take (shader_link_check.CHAINS), and counts each. With--spirv-dir, it also leaves out sets whose.spvis missing.--passeswrites one row per pass with its programs and the raster/depth/blend selector bytes, for the next step: creating the pipelines with their real partners and states.--spirv-dir), it prints the counts and exits 1 without writing the manifest, becausebatchrefuses an empty list (found by @whattheflop).read_database: the SGD5 signature and a truncated region. Stdlib only. The archive is opened read-only and each effect region is read once, with no mmap.A paragraph in
docs/sgd5_render_states.mdsays how to run it withbatch.Tested
Windows 11, own 1.0.2.1 copy, Python 3.13.
shader_link_check.py batchon that manifest over a full translation ofmain3faac55 (LLVM 23.1.5): 16,024 compatible, 301 incompatible (all VS+GS+PS, fixed by rdna2spirv: number GS varyings by rank past SV_Position, as the VS and PS do #5199). On rdna2spirv: number GS varyings by rank past SV_Position, as the VS and PS do #5199's head: 16,325 compatible, 0 incompatible.python -I tests/test_sgd5_pass_pipelines.py(synthetic databases fromtests/test_sgd5_effects.py's builders: VS+PS, VS+GS+PS, compute skipped, a duplicate set written once, state bytes in--passes, the--spirv-dirfilter, ms+gs+ps skipped, nothing left → exit 1 and no manifest, conflicting index entries refused in both orders): OK.tests/test_sgd5_effects.py,tests/test_ci_registration.py,tests/test_docs_links.py,tests/test_text_write_line_endings.pyandpython -m compileall -q tools tests: OK.batchgives the same 301 VS+GS+PS incompatible and 0 invalid, and all 16,325 reports match across the toggle. @Atomic258: the test passes at the head and fails on the parent commit.AI-assisted: yes (Claude Code).
Checklist
docs/design.md, with how it was confirmed. N/A: no translator change.🤖 Generated with Claude Code