Commit Graph

151 Commits

Author SHA1 Message Date
dac28e6b19 Fix what the round-42 merges broke (tests and docs)
- shader_disasm: prune stale listings against every input, not the --skip-existing remainder (a resumed run
  deleted every listing it had just reused).
- progress_dashboard: a drive-letter path is never inside the repository off Windows (it printed user names);
  its own read_text helper is read_utf8, so the encoding check does not take it for pathlib's.
- Translator tests follow this round's rules: desc_lookup's BroadcastFirst in the typed-load condition walker;
  resinfo sizes are 0 past the last level and a 2D depth word is 0 (SHADER-388); SHADER-315 constant folding in
  the perm and i16 tests; #2089's structured wave64 emulation.
- test_semantic_translator_use: 57 oracle-only files merged before it are DEBT; test_spirv_tools_required is
  allowed (CI meta-test).
- Test fixes: image_fuzz fake writes the programs, preflight follows c506d00c's loader hint rule, feature_scan
  reads the first line of a pytest-decorated message, w64_graphics wording.
- docs: rows merged again in design.md, README.md, d3d12_vulkan.md; GameInput table rebuilt from #3172's rows;
  orphan rows in models.md and embedded_shaders.md; repeated bullets; anchors; a flag not on main.
- Repo rules: stdout guard on 14 programs; LF writes; csv lineterminator in bink_play.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:14:54 -05:00
f9763f5886 Merge pull request #3246 from andretuta 2026-11-22 15:16:09 -05:00
4a3f0497ec Merge pull request #3217 from NiiRoZz
# Conflicts:
#	docs/shader_inputs.md
2026-11-22 15:15:49 -05:00
96b1b82d3e Merge pull request #3157 from NiiRoZz
# Conflicts:
#	docs/README.md
2026-11-22 15:15:17 -05:00
4a209d7bd1 Merge pull request #3071 from Jeremy Goldberg 2026-11-22 15:14:33 -05:00
94ff85fdf7 Merge pull request #2784 from SuarezPM 2026-11-22 15:11:58 -05:00
7b7ada0e7b Merge pull request #2758 from Mohamed-Leo
# Conflicts:
#	docs/i18n/README.md
2026-11-22 15:11:40 -05:00
bcfedd79ee Merge pull request #2473 from Vonsek
# Conflicts:
#	docs/README.md
#	docs/d3d12_vulkan.md
#	docs/embedded_shaders.md
2026-11-22 15:10:53 -05:00
217e2f4631 PROC-148: document the ACES LUT bakes' and sky passes' inputs
Move @Silliana's notes from #1896 and #1897 into docs/shader_inputs.md,
checked against the ten postfx_aces bakes and the sky_scattering /
scattering_transmittance_system passes (offsets and counts only).

- ACES: the quasi-log addressing holds in all four QuasiLog bakes. The
  RRT spline is a constant table in the program, not an input. The
  tone-curve spline at +0x00 is in reference c9 order. Only the
  TonemapOnly bakes' second spline at +0x70 is points-first, and +0x118
  picks between the two. +0x13C selects per-channel vs luminance mode.
  It does not switch the curve off.
- Sky: Transmittance, then MultipleScattering (samples one table), then
  SkyAtmosphereLUT / SkyView (sample two). The +0xD0 dword in SkyView and
  MultipleScattering picks RGB9E5-packed or float output descriptors.
  It does not skip the stores.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:04:51 +01:00
330f0d3013 PROC-147: document the studio-shot lighting shader's inputs
docs/shader_inputs.md lists what PS_STUDIOSHOT_PBR_MATERIAL_STANDARD_LIGHTING
needs from its inputs, as a first check for a dark frame or a device-lost:
the 512-byte light records, the fixed eight-light loop, the plane count in
the top byte of +0x4C, the profile table's intensity skip and the shadow
strength byte at +0x73. Reported by @Silliana in #1892; offsets confirmed
against the shader, with two corrections to #1892 (the count is at +0x4C,
and the +0x40 low-24-bit test disables one factor, not the light).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:04:16 +01:00
456b0bcd33 PROC-147: document the studio-shot lighting shader's inputs
docs/shader_inputs.md lists what PS_STUDIOSHOT_PBR_MATERIAL_STANDARD_LIGHTING
needs from its inputs, as a first check for a dark frame or a device-lost:
the 512-byte light records, the fixed eight-light loop, the plane count in
the top byte of +0x4C, the profile table's intensity skip and the shadow
strength byte at +0x73. Reported by @Silliana in #1892; offsets confirmed
against the shader, with two corrections to #1892 (the count is at +0x4C,
and the +0x40 low-24-bit test disables one factor, not the light).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:04:11 +01:00
993eedb376 docs: document deferred G-buffer layout and declared output signatures (PROC-146) 2026-11-22 16:51:02 -03:00
15f5b2fbc0 Fix what the round-41 merges broke
- tests/semantic: BaseVertex/BaseInstance read 0 in the wave interpreter; the LDS MockGens follow
  SHADER-309 (lds_bound, lds_access, lds_atomic); abs emission tests load their operand, since
  SHADER-315 folds scalar ALU on constants.
- test_translate: the dynamic gather sampler is a loaded word, not s16 + 0 (SHADER-315 folds it).
- test_world_build: DDS downscale weights colours by alpha (62804d0d).
- test_fspx_shaders_stage: the fake disassembler writes the listing make_game now checks.
- xgameruntime_test: re-read the package id after clearing the LEONIDA_PACKAGE_ID override.
- docs: one row per topic again in design.md (72 topics) and README.md; one Other languages line;
  embedded_shaders.md keeps one copy of each bullet; animation.md links the heading anchor.
- tools/scripts: character_textures uses report_paths.same_report_path; stdout guard on six programs;
  LF write in vs_input_survey; the cl.exe fallback compiles winhttp_offline.cpp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:30:33 -05:00
b6f97b84be docs(shaders): document SGD5 pass render-state indices
Record the effect-local fixed-function table mapping and the full-corpus discriminator used for PROC-143.

Refs: #2519, #3036, #3047
2026-11-22 14:16:56 -05:00
0d938dedd8 Docs: 51 of the BVH builder's 52 FSSM programs translate on main; one rule (buffer_store_short) left (PROC-120)
Recounted with main 49475796 on the 1.0.2.1 package (counts only): 52/52 unpack,
42 clean and 10 with invalid words in the disassembly, 51 translate and pass
spirv-val. The four rules embedded_shaders.md listed are three since 427c1376
(#1968); Box16Rehydration stops at buffer_store_short (#1864). d3d12_vulkan.md
and the docs index quoted 41/42 and four rules in seven places.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:20:09 +01:00
50e3c60d7d Merge pull request #2681 from Leonardo Guimaraes 2026-11-22 13:17:02 -05:00
f495169092 boot: the first-boot runbook and the two-trace summary
tools/boot_trace.py reads the `--trace` JSONL and the `[d3d12-trace]`
stderr lines and prints the units a first boot needs: modules, unimplemented
imports with their callers, DllMain/TLS results, exceptions with their
stack, the exit, and the D3D12 calls by outcome and first call per method.
It counts debug strings instead of printing them, so a real trace stays on
the player's machine; the tests use synthetic fixtures only.

docs/boot.md is the runbook around it: the Windows and Wine commands, the
LEONIDA_UNIMPLEMENTED and validation switches, the first-failure triage
order, and the Q1-Q22 table mapping each open question to the event to look
for. docs/README.md and runtime/README.md point at both.
2026-11-22 15:16:15 -03:00
c1543e3449 Merge pull request #2552 from Leonida local test 2026-11-22 13:16:07 -05:00
3ff283da6a Merge pull request #2473 from Vonsek
# Conflicts:
#	docs/README.md
#	docs/d3d12_vulkan.md
2026-11-22 13:15:34 -05:00
1918a7d2e1 Merge pull request #2213 from MeNoSkills
# Conflicts:
#	docs/README.md
#	docs/i18n/README.md
#	docs/i18n/it/quickstart.md
2026-11-22 13:13:22 -05:00
4316318cb3 docs: add Arabic community quickstart 2026-11-22 20:13:00 +02:00
79b6daac22 Merge pull request #2063 from sovljanskii
# Conflicts:
#	docs/README.md
#	docs/design.md
2026-11-22 13:12:58 -05: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
a3b1719c61 gameinput: report and drive force-feedback and haptic motors through SDL3 haptics (RT-160)
IGameInputDevice answered the force-feedback and haptic half of the API with
nothing: no motors in GameInputDeviceInfo, E_INVALIDARG from
CreateForceFeedbackEffect, false from IsForceFeedbackMotorPoweredOn, a no-op
SetForceFeedbackMotorGain and E_INVALIDARG from SetHapticMotorState. A pad SDL
opens as a haptic device now reports one force-feedback motor with the effect
kinds SDL lists, and a pad with trigger motors reports two haptic motors.

Force feedback goes to SDL_CreateHapticEffect/RunHapticEffect on the poll
thread, so title calls still never touch SDL; the eleven GameInput effect kinds
are SDL's eleven force-feedback effects. The trigger haptic motors play their
one waveform as an intensity on the existing trigger output. A pad with neither
keeps the old answers, and LEONIDA_RUMBLE=0 silences both. gameinput_test drives
all of it through a fake haptic backend, because SDL's virtual joysticks report
no haptics.

AI-assisted.
2026-11-22 18:26:28 +01:00
1a22106ac6 Docs: 51 of the BVH builder's 52 FSSM programs translate on main; one rule (buffer_store_short) left (PROC-120)
Recounted with main 49475796 on the 1.0.2.1 package (counts only): 52/52 unpack,
42 clean and 10 with invalid words in the disassembly, 51 translate and pass
spirv-val. The four rules embedded_shaders.md listed are three since 427c1376
(#1968); Box16Rehydration stops at buffer_store_short (#1864). d3d12_vulkan.md
and the docs index quoted 41/42 and four rules in seven places.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:10:07 +01:00
984dcc3c3c docs: one row per topic again in design.md, README.md and testing.md (PROC-106)
tests/test_docs_design_rows.py failed on main again: merges after
64ece042 and abbb3dce kept both sides of rows two branches had edited.
design.md had 24 topics repeated (two to five rows each), README.md one
and testing.md two.

Each group is now one row at the first copy's place, keeping every fact
any copy stated. Where copies disagreed, the newer wording (by git blame
and the commit that wrote it) wins: for example, the --f16-interp-fallback
row no longer also gives the pre-SHADER-291 locations 29 - 2N / 30 - 2N,
the "Not GPU-verified" notes give way to the SHADER-137 hardware results
added to the same rows, and "tbuffer_store_format_* is not translated"
gives way to the paragraph describing how it is translated.

A sentence-by-sentence check of every copy against the merged row finds
only those deliberately replaced. The four docs tests pass.

AI-assisted.
2026-11-22 18:09:57 +01:00
9a82abceb3 tools/progress_dashboard: local page of what works, what changed and what blocks next
progress_dashboard.py (standard library, python -I) collects outcomes the project already
produces and writes a self-contained progress.html, JSON snapshots and a history into a
folder outside the repository (a folder inside it is refused):

- unit tests: --run-tests runs tests/test_*.py with ci.yml's selection, one process each;
  a test counts as current only if neither it nor tools/, scripts/, make_game.py changed
  since it passed (content digests, so uncommitted edits are handled too)
- runtime tests: runtime/build LastTest.log and --junit files (CTest or pytest)
- the translator contract table in docs/design.md, each row classified by how it says it
  was confirmed, with the matched words shown
- the measured tables in docs/runtime_imports.md
- --work: per-stage counts from the user's own carve and translation (numbers only)
- --github (read-only gh): latest completed CI run per workflow on main, the D3D- table
  of #313, the coordination issue's section sizes and, with --login, claims and PRs

No game data: counts, pass/fail and error classes only; no shader names or paths into the
game copy. The page has no packages and no network access. tests/test_progress_dashboard.py
covers the parsers, the classification, freshness, the no-names rule and the output folder.
2026-11-22 14:07:29 -03:00
eceff01dfa docs: add the Italian (it) community quickstart
Translated from the current README (build, prerequisites, troubleshooting, contributing); synced with 4eb6155d. Adds its row to docs/i18n/README.md and the code to the docs index. test_i18n_index, test_docs_links, test_docs_repo_paths and test_docs_list_items pass.
2026-11-22 17:55:54 +01:00
92e75f6fc8 Merge pull request #2247 from zGLados
# Conflicts:
#	docs/README.md
#	docs/i18n/README.md
2026-11-22 11:43:22 -05:00
2e0c95ff26 Merge pull request #2238 from Vonsek 2026-11-22 11:43:14 -05:00
5b53a926d0 Merge pull request #2213 from MeNoSkills
# Conflicts:
#	docs/README.md
#	docs/i18n/README.md
2026-11-22 11:42:56 -05:00
85f61c8694 Merge pull request #2212 from cxchhh
# Conflicts:
#	docs/README.md
#	docs/character_models.md
2026-11-22 11:42:54 -05:00
f478683f5c Merge pull request #2067 from Kam471
# Conflicts:
#	docs/README.md
#	docs/design.md
2026-11-22 11:41:28 -05:00
6c35af1256 Merge pull request #2063 from sovljanskii
# Conflicts:
#	docs/design.md
2026-11-22 11:41:25 -05:00
9b138453e8 Merge pull request #2001 from Rafael 2026-11-22 11:41:00 -05:00
49475796c2 Fix tests the round-39 merges broke
- test_translate: #1904 caps structured depth at 16, so the #1993 dispatch-loop test lowers MAX_STRUCTURED_DEPTH.
- test_ctest_registration: skip-code scan ignores conditional returns.
- test_d3d12_stubs_generation: INCLUDE uses os.pathsep.
- docs/README.md: one Other languages line.
- first_light.py, make_game.py: LF text writes; stdout guard on three tools.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:31:20 -05:00
0630bdfae2 docs: add the German (de) community quickstart
Translates the stable onboarding text (what the project is, own-copy and
no-game-data rules, prerequisites, build commands, stage order, common
problems, how to help) into German, following the structure of the other
quickstarts. Synced with 4eb6155d. Adds the de row to docs/i18n/README.md
and the language list in docs/README.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:26:18 +01:00
a217b88d8f tools: gamedata_reader, a streaming reader for the game-data XML that dispatches on root and type (ASSET-139)
Converts RAGE parser XML into plain values by its conventions (value,
x/y/z/w, content arrays, polymorphic type and NULL, ref, Item lists and
keyed maps, extra attributes), with register_root / register_type for
typed handlers. Each top-level field is converted and dropped as it ends.
On the 1.0.2.1 carve of common.rpf: 259 of 267 documents, 111 roots, 317
type classes, 0 conversion errors (counts only). Synthetic tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:26:13 +01:00
e30b405bbd docs: add the Italian (it) community quickstart
Translated from the current README (build, prerequisites, troubleshooting, contributing); synced with 4eb6155d. Adds its row to docs/i18n/README.md and the code to the docs index. test_i18n_index, test_docs_links, test_docs_repo_paths and test_docs_list_items pass.
2026-11-22 17:17:40 +01:00
b745f93946 anim_glb: export a skinned part with its skeleton and clips as an animated GLB
tools/anim_glb.py reads a fragment's skeleton (drawable +0x18: bone records,
inverse bind matrices, parents), binds part meshes to it through the model
bone list at grmModel+0x28 (ASSET-12 skin layouts), and writes decoded
anim.rpf clips as glTF animations: bonerotation/bonetranslation/bonescale
drive the joint with the track's bone hash, bone hash 0 drives a mover node,
and a clip entry maps animation time t to (t - start) / rate. --coverage
counts how many clip bone tracks name a skeleton joint.

docs/character_skeleton.md: the instance table was read 0x40 bytes late, so
each row paired a bone with the next bone's TRS. Read from the record start,
the default transforms compose to the stored inverse bind matrices (5.1e-6 m
female, 3.3e-6 m male, all 14,212 skeletons in packs.rpf within 1e-3). The
model bone list is at +0x28, not +0x20. New "Animated glTF export" section
with the measured counts; animation.md, models.md, character_models.md and
the docs index follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:17:37 +00:00
935edd4f97 docs: dedupe merged contract rows 2026-11-22 15:51:08 +00:00
ce4660c3b0 docs: one row per topic again in design.md, README.md and testing.md (PROC-106)
tests/test_docs_design_rows.py failed on main again: merges after
64ece042 and abbb3dce kept both sides of rows two branches had edited.
design.md had 24 topics repeated (two to five rows each), README.md one
and testing.md two.

Each group is now one row at the first copy's place, keeping every fact
any copy stated. Where copies disagreed, the newer wording (by git blame
and the commit that wrote it) wins: for example, the --f16-interp-fallback
row no longer also gives the pre-SHADER-291 locations 29 - 2N / 30 - 2N,
the "Not GPU-verified" notes give way to the SHADER-137 hardware results
added to the same rows, and "tbuffer_store_format_* is not translated"
gives way to the paragraph describing how it is translated.

A sentence-by-sentence check of every copy against the merged row finds
only those deliberately replaced. The four docs tests pass.

AI-assisted.
2026-11-22 16:50:02 +01:00
4c2800bd27 Merge pull request #1912 from Nolan Cotter
# Conflicts:
#	docs/README.md
#	docs/d3d12_vulkan.md
#	docs/i18n/README.md
2026-11-22 10:39:23 -05:00
6c73872cad first_light: draw the real model through the D3D12 layer
d3d12_first_light (package-gated by LEONIDA_FIRST_LIGHT_DIR, exit 77 when
unset) draws the mesh and translated VS/PS that tools/first_light.py wrote
through the Xbox-ABI device proxy: CreateGraphicsPipelineState gets the
game's own containers and finds both stages by FSSM hash, the input layout
feeds POSITION/TEXCOORD, DEFAULT vertex/index buffers, one
DrawIndexedInstanced, CopyTextureRegion readback. It checks vk_harness's
oracle (coverage window, clear corner, centre UV) with the rows flipped
for the y-up viewport, and compares every pixel with vk_harness's
image.raw.

first_light.py now also writes vs.dxbc, ps.dxbc and index.json (the
translator entries keyed vs/ps) to the output folder.

RTX 3060, driver 616.64: 12,804/16,384 covered, centre
(0.49756, 0.49634, 0, 1), as vk_harness; 16,383 pixels bit-exact and one
one f16 step apart (the PS exports with v_cvt_pkrtz_f16_f32; vk_harness
with the mesh mirrored in y matches the D3D12 image bit for bit).
Clean under LEONIDA_VK_VALIDATION=1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:36:51 -03:00
07cc6efb20 first_light: a real game model with its own translated VS/PS
tools/first_light.py carves the game's shaders, translates one real VS/PS pair,
converts an exported OBJ to a mesh, writes a manifest and runs vk_harness. The
harness gains VKH_DRAW_MESH/VKH_VERTEX_LAYOUT (indexed mesh, vertex input), inert
when unset. The package-gated test draws the model and checks coverage and the
centre pixel; docs/first_light.md records the measured result.
2026-11-22 12:28:20 -03:00
4eb6155d3a int_hw_probe: the five gfx1035 divergences are fixed; docs index and four tools follow the repo rules
- int_hw_probe: VOP3 clamp on the carry-out add/sub ops (#1831) and v_cvt_rpi/flr's exact floor(x+0.5) and NaN
  sign saturation (#1856) now translate as gfx1035 measured, so KNOWN_DIVERGENCES is empty. The known-divergence
  test reports a synthetic entry. shader_validation.md says so, and design.md loses the stale duplicate
  v_cvt_flr/rpi row a "both" merge left that still called them open.
- docs/README.md: one Other languages line (fr, pt-BR, zh-CN, pl-PL, tr, ru, ja); docs/i18n/README.md: one row
  each for pt-BR and zh-CN (the newer).
- anim_rigs, d16_format_probe, pe_shader_containers: text writes name newline="\n" (#1615);
  pe_shader_containers guards stdout (#1428).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:22:53 -05:00
de2db33510 i18n: add the Spanish community quickstart
Mirrors the stable onboarding text (what Leonida is, the own-copy and
no-game-data rules, prerequisites, build commands, stage order, common
troubleshooting, contribution pointers) at synced commit 003e7812, following
the fr/pt-BR structure. The index row lists @NolanCotter as maintainer.

AI-assisted. Tested: test_i18n_index, test_docs_links.
2026-11-22 07:57:55 -07:00
ca1557eac6 Merge pull request #1855 from bingll123
# Conflicts:
#	docs/README.md
#	docs/i18n/README.md
2026-11-22 09:48:48 -05:00
c3bc62bb45 Merge pull request #1835 from Vonsek
# Conflicts:
#	docs/README.md
#	docs/testing.md
2026-11-22 09:48:37 -05:00
b9a2ac53cf Merge pull request #1833 from Kam471
# Conflicts:
#	docs/design.md
2026-11-22 09:48:35 -05:00