Commit Graph

3 Commits

Author SHA1 Message Date
9e931a1f93 test: exclude FSPX entries from the corpus orphan check (TEST-625)
The 24 translated FidelityFX programs are in <shaders>/fspx/index.json, not in the RPF containers this test walks. Compare reached entries against the RPF total and report the FSPX count separately.
2026-11-22 20:24:28 +01:00
beaf0352b0 shader_library_corpus_test: report containers with no index entry apart from lookup misses
A container the translator left out (for example a module over SPIR-V's id bound, like the #881 pair in a work
folder translated before dcd8ecf) has no index entry under its name, so the lookup has nothing to find. The test
reported it as `not found under its <stage> stage`, the same line as a real lookup miss, so an older work folder
looked like a shader_library regression.

The test now reads index.json's entry names (with the same "string stage and fssm_sha256" rule ShaderLibrary::load
counts) and checks a container that isn't found: with no entry named after it (the stem or a `~N` duplicate) it is
reported as `NOT TRANSLATED (no index entry)` and counted in its own field of the summary, with a hint to rerun the
shaders stage; with an entry it stays a lookup failure. The exit code is unchanged: either makes the test fail.
shader_library.h is not touched.

Tested on Windows 11 Pro 25H2, MSVC 14.51 + Ninja, RTX 5070 Ti / 621.24, with my own 1.0.2.1 copy's work folder
(translated at 43d0015):
- the real corpus: `26503 containers, 26501 index entries, 26501 reached; 195 containers with more than one
  program; 2 not translated; 0 failures` (before: `2 failures`, as `not found under its cs stage`). The two are
  the #881 pair.
- controls on a scratch folder of copied containers: one under another shader's indexed name is still
  `FAIL not found under its cs stage`; one under a name with no entry is `NOT TRANSLATED`; the normal one resolves.
- without LEONIDA_SHADERS it still skips (exit 77); shader_library passes. No game data in the repository.
AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:06:06 -05:00
22888d4e65 Runtime: test the shader lookup against a translated corpus
shader_library_corpus_test runs src/shader_library.h over the work folder
make_game.py builds from the player's copy (LEONIDA_SHADERS=<work>/shaders/spirv,
containers from <work>/shaders/dxbc or LEONIDA_SHADER_DXBC), as the D3D12
layer does with a PSO's bytecode: inflate the FSSM program, hash it and look
it up under the stage the DXIL program header names. Every container must
find its own index.json entry and a readable .spv, every entry must be
reached, and in containers with more than one 0x0D payload no earlier
payload may be the indexed program.

Without LEONIDA_SHADERS it prints SKIP and exits 77 (SKIP_RETURN_CODE).
On the 1.0.2.1 corpus: 26,503 containers, all resolve, 195 with more than
one program. With fssm_program switched to the first payload it fails
(391 failures, 26,308 of 26,503 entries reached).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:54:56 +01:00