Skip clipped fragments when retained mesh depth crosses the near or far plane. Check partial triangles, visibility in draw order, and clear probes with synthetic geometry (TEST-870).
The default pair's VS applies no matrix, so first light was an orthographic fit. --camera uses
VS_TransformVT_e6ebb353_Wrapped instead. That VS reads a descriptor table at s9, whose V#s point at a world
matrix (table + 0x20) and a view-projection (table + 0x60, rows at 0x160). The tool builds a camera, writes
the matrices, V#s and table into vk_harness's heap (VKH_HEAP, VKH_SGPRS), and predicts the image with the
same float32 matrices, interpolating UV perspective-correctly. The manifest keeps the constants, so --check and
tests/test_first_light.py draw the same way. The output goes to <work>/first_light/camera, so the folder
d3d12_first_light_test reads is untouched.
Apple M4 (MoltenVK 1.4.2), the section 1 model at 128x128:
- coverage 6,851/16,384, with the centre, four probes and the clear corner as predicted;
- a 32x32 grid agrees on coverage 1,024/1,024 and on UV 428/428 within 2e-3;
- no constants, or a camera 2 degrees off, is rejected.
AI-assisted.
Review of #3577: reset_run_folders() judged first_light only through the dxbc and spirv folders it found. When
first_light is a symlink or a junction to a folder that has neither, there was nothing to judge, and the new dxbc
was created in the folder the link points to, outside the work folder.
first_light itself is now checked before its children. tests/test_first_light.py gains the case with neither
folder behind the link (symlink and junction): it fails on the previous commit with "SystemExit not raised" and the
far folder gets a dxbc; with the check the run is refused and the far folder stays empty.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The tool staged the chosen VS and PS containers in <work>/first_light/dxbc and had them translated into
<work>/first_light/spirv, and emptied neither. fssm_unpack.py, shader_disasm.py and rdna2spirv.py take every file
in the folder they are given, so a second run with another shader translated the first run's container again:
"3 shaders: 2 translated" for a pair, the extra one with "stage ?", and its files stayed beside this run's.
reset_run_folders() removes both folders at the start of translate() and creates an empty dxbc. first_light/out,
another --out and <work>/shaders are not touched. A folder that is a symlink or a junction, or sits behind a
linked first_light, is refused before anything is removed; a link inside is unlinked without being entered; a
file that cannot be removed ends the run with one line naming it.
tests/test_first_light.py: RunFolderTests runs the tool twice in one synthetic work folder, with stand-ins for
the three tools that take every file like the real ones. docs/first_light.md says the two folders are per-run.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Addresses @Kam471's review on #2806:
- Fix uint32 wraparound in VKH_TSHARP_VA bounds check (tsharp_va > heap_bytes - 32) so 0xFFFFFFE0 is rejected with exit 2 instead of writing OOB; add regression test in tests/test_first_light.py.
- Clarify exact test counts in docs/first_light.md (14 tests: 11 pass, 3 skip without LEONIDA_FIRST_LIGHT_DIR; 14/14 pass with LEONIDA_FIRST_LIGHT_DIR).
- Require --obj when --dds is passed so textured probes are always populated, include all texture env vars in the non---run preview command, and pass VKH_SUBGROUP_SIZE from manifest['ps']['subgroup_size'].
Implements TEST-524:
- runtime/test/vk_harness.cpp: adds optional VKH_TEX_RGBA, VKH_TSHARP_VA, and VKH_SSHARP (inert when unset) to upload an RGBA8 texture to set 0 image index 1 (with 1x1 magenta fallback at index 0), write the 8-dword T# at VKH_TSHARP_VA in the 64 KiB heap, decode S# via gfx10_descriptors.h into sampler index 1, and bind DescriptorTable at binding 2.
- tools/first_light.py: adds --dds <path.dds> (decoding via tools/dds_png.py to texture.rgba), defaults --ps to PS_Copy_3ea4b38a_Wrapped (wave32, single image_sample_lz, compatible with DEFAULT_VS), reads ptr32_lo SGPR and literal_samplers from index.json, and adds a bilinear clamp-to-edge CPU texture oracle (centre_rgba + rgba_probes) in check_image.
- tests/test_first_light.py: shares fl.harness_env() so package-gated tests cover both untextured and textured runs, and adds 6 synthetic TexturedOracleTests (no GPU or game files).
- docs/first_light.md: documents the textured path and RTX 3060 verification (counts and hashes only; no game data).
- docs: one row per topic again in design.md (59 topics merged sentence by sentence, keeping every
number) and README.md (the current models/character rows); one Other languages line.
- docs/i18n: the two Spanish quickstarts had been concatenated; keep #1912's, drop #2277's row.
- make_game: the shader fingerprint covers spirv_asm.py and its tables; LF settings write.
- tools: pe_shader_containers, gamedata_maps and anim_rigs use report_paths.same_report_path (BUILD-589);
stdout guard on five tools; LF text writes in three; user_sgpr_census tolerates an unreachable --json.
- tests: fspx stage fakes write real carve/unpack indexes (c7408a1f); typed f16 stores round toward zero
(SHADER-358); test_ci_registration's helper is no longer collected as a test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>