Repository navigation
fssm_unpack: count containers and programs apart, per stage (BL-5) - #882
Conversation
The corpus is 26,503 carved containers holding 26,698 tag-0x0D payloads: 195 vertex-shader containers carry two. fssm_unpack.py now prints both counts and, given the carve index, a line per stage. shader_library.md records the two counts and why 195 equals the geometry-shader count. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
abnalstlll-byte
left a comment
There was a problem hiding this comment.
Clean-Room Audit & Architectural Review — PR #882 (BL-5 Corpus Count Resolution)
Outstanding implementation of the BL-5 corpus count resolution!
Technical Verification
- Container vs Program Accounting:
- Accurately formalizes the distinction between outer DXBC containers (26,503) and tag-
0x0Dpayloads (26,698). - Confirms that the 195 delta stems entirely from the 195 vertex shader containers carrying two hardware payloads (ES variant + VS variant for the legacy geometry pipeline), matching the 195 geometry shaders.
- Proves definitively that the carve skips zero shaders.
- Accurately formalizes the distinction between outer DXBC containers (26,503) and tag-
- Tooling & Test Coverage:
fssm_unpack.pyandshader_stage_manifest.pynow cleanly report container vs program breakdowns per stage.- Comprehensive synthetic unit test
test_program_counts_separate_containers_from_payloadsadded totests/test_fssm_unpack.py. - Verified clean execution under
python -I.
- Clean-Room Compliance:
- Pure metadata accounting and synthetic mock DXBC tests. 0 game data.
Verdict: APPROVED
SweatierKey
left a comment
There was a problem hiding this comment.
Independent verification on origin/main@a28927849 (commit 1f3f4ba3b):
python3 -I tests/test_fssm_unpack.py:48/48PASS (includingtest_program_counts_separate_containers_from_payloads)python3 -I tests/test_shader_stage_manifest.py:17/17PASSpython3 -I tests/test_docs_links.py:16/16PASSpython3 -I scripts/check_no_game_data.py: clean
Clean resolution of BL-5 separating outer DXBC containers from inner tag-0x0D payloads per stage.
AI-assisted: yes
qhukz13
left a comment
There was a problem hiding this comment.
Checked 1f3f4ba (Linux, CPU only, no game files). Merges cleanly with current main.
tests/test_fssm_unpack.py(48),tests/test_shader_stage_manifest.py,tests/test_shader_stage_resume.py: OK.- The counting is right as far as I can check without the corpus:
program_countskeys by the carve's stage, counts every row as one container and itsxbch_payloadsas programs, and an entry without a stage lands under None ("stage unknown") instead of being dropped.shader_stageskeepsshader_stems' validation through_stem_rows, so the CLI still refuses the same malformed indexes. - Mutations, with
semantic_mutants --sourcefrom #1016 (both files sit outsiderdna2spirv.py, andtest_fssm_unpack.pyimportstools/by path):program_counts4 of 4 caught. Inshader_stagesone survives against bothtest_fssm_unpack.pyandtest_shader_stage_manifest.py: line 57,isinstance(stage, str) and stage->or. The tests only cover an entry with nostagekey, where both give None; an entry with"stage": ""(or a non-string value) is where they differ: the code counts it as stage unknown, the mutant gives it a group of its own (""), splitting the per-stage lines. One such entry intest_program_counts_separate_containers_from_payloadswould pin it.
LGTM otherwise; the containers-vs-payloads table in docs/shader_library.md settles BL-5 nicely.
…BL-5) The carve-index case covered an entry with no stage field only, so a change of shader_stages' "a non-empty string" test to "a string or anything truthy" went unseen (review of ProjectLeonida#882). The case now has an entry with an empty stage and one with a number, checks shader_stages' answer for all five, and that the breakdown has one line for them. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
@qhukz13 thank you, that survivor was real. Root cause. Change. Test only, in Validation. Windows 11, Python 3.12.10:
Nothing else of the pull request changes, and it still merges cleanly with |
Merging. **Why merged:** D3D-CLEAR-DEPTH-RANGE: enables VK_EXT_depth_range_unrestricted where the device has it, so depth clears outside [0,1] (and NaN) behave like D3D12 instead of being clamped. Without the extension it keeps clamping, and NaN becomes 0. Four independent passes; on AMD (660M, 7900 XTX), d3d12_clear still fails only on the NaN rows, which is the driver issue tracked in #307, not this PR. **Why it's good:** On the 4070 SUPER with validation on, main's d3d12_clear_test exits 1 with 4x VUID-VkClearDepthStencilValue-depth-00022. With this PR it exits 0 with no VUIDs, and the 1.5 / -0.5 / NaN clears match WARP. The new d3d12_clear_restricted_depth passes, and so do d3d12_clear and d3d12_clear_formats. Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 3295055, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #516, #535, #751, #935 and #662 merged onto main 955d9be. There the repo-consistency set gives 571 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 307/309. The 2 failures are the same pre-existing ones as main (d3d12_execute_indirect_validation, d3d12_depth_resolve), with the same 11 skips. git merge-tree against current main 71f99e2: no conflicts, and none of these touch the files #891/#882 changed. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
Merging. **Why merged:** VK-SAMPLER-UNNORM-BIAS: an unnormalized-coordinates sampler gets mipLodBias 0, which VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01074 requires. kawaii-shakal ran it under ASan/UBSan and showed the new check fails on main. **Why it's good:** gfx10_descriptors and d3d12_descriptor pass both plain and under validation. Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 3295055, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #516, #535, #751, #935 and #662 merged onto main 955d9be. There the repo-consistency set gives 571 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 307/309. The 2 failures are the same pre-existing ones as main (d3d12_execute_indirect_validation, d3d12_depth_resolve), with the same 11 skips. git merge-tree against current main 71f99e2: no conflicts, and none of these touch the files #891/#882 changed. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
…opy-clear-stage Merging. **Why merged:** OLD-10048: SYNC_COPY maps to COPY|CLEAR, so WriteBufferImmediate (vkCmdUpdateBuffer) and the query zero-fill are ordered before later copies. moffington reproduced the read-after-write hazard on the base, and Timon360SB and SweatierKey checked it independently. Part K of vk_command_replay_test covers it. **Why it's good:** vk_command_replay, d3d12_state_map and replay_query_edges pass both plain and under validation. Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 3295055, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #516, #535, #751, #935 and #662 merged onto main 955d9be. There the repo-consistency set gives 571 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 307/309. The 2 failures are the same pre-existing ones as main (d3d12_execute_indirect_validation, d3d12_depth_resolve), with the same 11 skips. git merge-tree against current main 71f99e2: no conflicts, and none of these touch the files #891/#882 changed. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
…dup-wait Merging. **Why merged:** RT-RETIRE-TICKETS-DEDUP-WAIT: pending_through() merges entries per semaphore to the highest value, and completed_ can no longer move backwards. moffington (ASan/UBSan, with a differential test that fails on the base), Timon360SB, KernelSmoker and SweatierKey checked it independently. **Why it's good:** retire_tickets passes both plain and under validation. Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 3295055, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #516, #535, #751, #935 and #662 merged onto main 955d9be. There the repo-consistency set gives 571 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 307/309. The 2 failures are the same pre-existing ones as main (d3d12_execute_indirect_validation, d3d12_depth_resolve), with the same 11 skips. git merge-tree against current main 71f99e2: no conflicts, and none of these touch the files #891/#882 changed. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
Claimed in the coordination issue as: BL-5 (#14 (comment))
What and why
BL-5 in
docs/boot_leads.mdasks why a count of 26,698 shader programs has been reported against this repository's 26,503, and whether the difference of 195 (the geometry-shader count) is a counting difference or programs the carve misses.It is a counting difference. Measured on an own 1.0.2.1 copy:
vsmspsgscs26,503 is carved containers and 26,698 is the tag-0x0D payloads in them. The 195 two-payload containers are all vertex shaders: the ES and VS hardware variants
docs/design.mdalready describes ("VS as ES (two-payload VS containers)"). The carve skips nothing.Changes:
tools/fssm_unpack.pyprints both counts after unpacking and, when given the carve index, one line per stage (program_counts). An index entry without a stage is counted under "stage unknown", not dropped or guessed.tools/shader_stage_manifest.pygainsshader_stages, which reads the stage the carve index records. It shares the existing entry validation withshader_stemsthrough one helper, so the tool reads the carve's stage and does not parse the container's program header a second time.docs/shader_library.mdgets a "Containers and programs" section with the two counts and the table above.Not in this pull request: the 195 export-stage payloads stay untranslated (the tool still writes the last payload by default), and which payload a geometry-shader pipeline selects stays open, as
docs/design.mdsays.Tested
python -I tests/test_fssm_unpack.py: 48 tests pass, two of them new and synthetic (three containers with four payloads through the CLI with a carve index, including an entry with no stage; and one two-payload container without a carve index).test_shader_stage_manifest,test_shader_stage_resume,test_library_shaders_stage(1 skipped, as onmain),test_make_game_dry_run,test_vs_layout_census,test_fssm_crosscheck: pass.tests/test_docs_*.pychecks pass excepttest_docs_links, which fails the same way on plainmainat8f05e09e(docs/boot_leads.mdlinksCONTRIBUTING.mdrelative todocs/).program_countsrun over theindex.jsonandfssm_index.jsonof amake_game.pyshader stage on the own copy. The unpack CLI itself was not re-run on the real corpus with this change. The full translator suite was not run: the translator is not touched.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (No translator rule in this change.)🤖 Generated with Claude Code