Commit Graph

61 Commits

Author SHA1 Message Date
17a89c7349 Merge pull request #2299 from Ch1mpleo/fix/first-light-atomic-manifest
tools/first_light: write manifest.json atomically (FIRST-LIGHT-ATOMIC-MANIFEST)
2026-11-28 11:48:39 +01:00
04a204bc0e tools/first_light: write manifest.json atomically (FIRST-LIGHT-ATOMIC-MANIFEST) 2026-11-26 20:03:05 +07:00
4171724fb3 Reject non-finite channels in First Light readbacks 2026-11-25 12:47:11 -06:00
dfd239266f make_game, first_light: a vk_pipeline_check or vk_harness older than its sources is rebuilt or reported, not reused silently 2026-11-24 07:35:50 +05:30
7128104187 Merge remote-tracking branch 'origin/pr/8960' 2026-11-23 17:41:03 -05:00
124e51f2f6 first_light: refuse an image size below one pixel
camera_matrices divides by the width, so --width 0 became a ZeroDivisionError once a model was loaded.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-23 22:59:38 +01:00
84dc48b0d7 first_light: choose() reports a malformed carve index instead of a traceback
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 20:50:48 +01:00
7deb162b04 Validate first-light coverage thresholds (#6611)
Squash-merged after diff review of PR #6611
2026-11-23 11:16:12 -06:00
1ce6eb5f58 Reject non-finite first-light camera yaw (#6662)
Squash-merged after diff review of PR #6662
2026-11-23 11:03:03 -06:00
4155c23673 first_light: reject non-finite OBJ vertex positions (#6768)
Squash-merged after diff review of PR #6768 - first_light: reject non-finite OBJ vertex positions
2026-11-23 10:04:18 -06:00
46e73388fe Merge pull request #4600 from Vonsek
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:16:18 -05:00
d7efebf7d4 Merge pull request #4555 from Vonsek
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:15:53 -05:00
9c2508e6af Merge pull request #4270 from Vonsek
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:12:59 -05:00
320a5ac24e Merge pull request #4136 from Vonsek
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:11:36 -05:00
bc0d227006 Merge pull request #3967 from inerthel-agi
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	docs/first_light.md
2026-11-22 23:10:00 -05:00
8996e20228 Merge pull request #3350 from Jeremy Goldberg
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	docs/README.md
2026-11-22 23:07:21 -05:00
11ff3f3fc5 Merge pull request #2855 from sovljanskii
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:06:13 -05:00
bda6858c16 Merge upstream main into First Light probe bounds 2026-11-23 03:41:02 +00:00
2e7ce85cef fix(tools): accept null First Light UV probes 2026-11-23 03:05:56 +00:00
58b482f755 fix(tools): require four channels in First Light RGBA probes
A short expected color can leave alpha unchecked, and a long one can compare a channel from the next pixel. Reject both shapes before the comparison.
2026-11-23 04:02:08 +01:00
cdf24492ad fix(tools): preserve First Light probe fallback and validation 2026-11-23 02:40:18 +00:00
04533353a9 fix(tools): validate First Light probe coordinates 2026-11-23 02:25:09 +00:00
d8a3201fa5 fix(first-light): reject OBJ UVs that overflow binary32 2026-11-23 00:31:25 +00:00
53826fa5b5 fix(first-light): reject non-finite OBJ texture coordinates 2026-11-23 00:25:50 +00:00
5672a22293 fix(tools): clear stale First Light draw results
A failed recheck left an old preview and coverage result alongside the latest readback, making the artifacts disagree about the draw.
2026-11-23 00:36:44 +01:00
3b598a9be4 docs(first-light): distinguish UV and textured draw defaults
Refs: #3350
2026-11-22 17:50:46 -05:00
98a9f7eda5 fix(first-light): clip expected UV probes to the visible depth range
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).
2026-11-22 23:42:42 +01:00
3302d4ec81 docs(first-light): clarify shader selection in the index and CLI
Refs: #3350
2026-11-22 17:23:28 -05:00
bc79b55d1e first_light --camera: draw the model in perspective with a game VS that reads world and view-projection (TEST-523)
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.
2026-11-22 23:02:49 +01:00
9be3d33974 Merge pull request #3577 from Emma 2026-11-22 17:02:48 -05:00
43d667eb8d Merge pull request #3432 from kapitche 2026-11-22 17:02:00 -05:00
83a61272e9 Merge pull request #3412 from Vonsek 2026-11-22 17:01:53 -05:00
223a969d54 Merge pull request #2806 from Alex Arenas 2026-11-22 16:59:49 -05:00
06f9151d3b first_light: harden textured oracle for off-centre default UVs, NaN, and UNORM alpha 2026-11-22 22:24:34 +01:00
90a6b5d052 first_light.py: refuse a linked first_light even when nothing stale lies behind it
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>
2026-11-22 23:21:26 +02:00
35fe778eb6 first_light.py: start each run with empty first_light/dxbc and first_light/spirv
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>
2026-11-22 22:45:00 +02:00
95ebfb8e92 first_light: a run without an OBJ removes the previous run's mesh.bin 2026-11-22 15:30:19 -05:00
bd4215e416 fix(tools): refuse a First Light draw without geometry
A shader-only preparation could leave an older mesh in the output directory and report a successful draw with zero vertices and indices.
2026-11-22 21:25:56 +01:00
ea508e6839 Merge pull request #3307 from Vonsek 2026-11-22 15:16:51 -05:00
938616af6b Merge pull request #2979 from Vonsek 2026-11-22 15:13:46 -05:00
7e1aecf0cb first_light: fix VKH_TSHARP_VA overflow guard, subgroup size, preview env, and test docs
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'].
2026-11-22 21:06:15 +01:00
3763517741 First light: add textured draw path with T#/S# bindless set and CPU oracle (TEST-524)
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).
2026-11-22 21:06:14 +01:00
de123384a4 Merge upstream main into codex/first-light-ppm-nonfinite 2026-11-22 21:04:11 +01:00
95e2aff60c fix(tools): find first-light harness in CMake configurations
Visual Studio places the harness under a configuration folder, so first-light runs could fail discovery even after the target had built.
2026-11-22 21:02:38 +01:00
084b87be74 fix(tools): preserve previews with nonfinite readback channels
Converting a nonfinite channel to an integer raises before the display clamp, leaving a partial PPM.
2026-11-22 20:00:37 +01:00
cf9dc86395 Merge pull request #2602 from jvinpe 2026-11-22 13:16:28 -05:00
2b13467423 Merge pull request #2588 from Vonsek 2026-11-22 13:16:22 -05:00
d685e4b26f Merge pull request #2489 from Narek Shaghoyan 2026-11-22 13:15:40 -05:00
46a196cde9 Merge upstream main into first-light shader identity 2026-11-22 19:07:53 +01:00
ec8ec4c9a4 Fix what the round-40 merges broke
- 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>
2026-11-22 12:55:07 -05:00