Commit Graph

15 Commits

Author SHA1 Message Date
95d1878dc3 fspx_unpack: keep main's literal-form check for the 24-byte prologue (#583 head)
The copy of #583 in this branch replaced main's check that both short
prologue words are literal-bearing VOP3 opcode-0x180 words
(words[k+1] & 0xFFFE0100 == 0x03FE0100, the shape fspx_prologue_probe.py
checks) with a looser SRC2 == 0xff test. Keep main's check, as #583's head
(3af97a1ec, by Tyrannys) does, with this branch's named constants, and take
that head's test_short_prologue (the stricter check refuses 0x03FF0000)
and its docs/fspx.md paragraph.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:51:22 -05:00
c9b3ec1c62 Merge #998 (pipeline-library compute programs llvm-mc refuses)
# Conflicts:
#	tests/semantic/test_salu_flbit_64.py
#	tests/test_fspx_unpack.py
#	tools/fspx_unpack.py
#	tools/rdna2_decode.py
#	tools/rdna2spirv.py
#	tools/shader_library.py
2026-11-25 00:49:31 -05:00
bec14f2259 tools: the last pipeline-library compute programs of 1.0.2.1
The retail boot reached 50 pipeline-library compute programs that had no
translation. Dumped from the running game, they all translate and pass
spirv-val after these changes:

- fspx_unpack.code_range: some programs carry a 24-byte hash prologue
  (two VOP3 words, then s_inst_prefetch) instead of 36 bytes; two or three
  hash words now count (shader_library uses the same range).
- fspx_unpack --last-endpgm: early exits branch past the first s_endpgm,
  and data after the code can hold s_endpgm words, so a program ends at
  the first s_endpgm whose listing keeps every branch inside the code.
- rdna2spirv: v_cmp_*_dpp into vcc (12 compares in reductions), taken when
  every lane writes (full row/bank masks with bound_ctrl:1, or DPP8).
- rdna2spirv: s_bitreplicate_b64_b32 of a constant into vcc (6 programs),
  as the exec form does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 09:17:13 -08:00
bf0c4d99ce tests: fspx_unpack takes the decoder listing when llvm-mc reports invalid words
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 09:02:59 -08:00
4b9a89124a fspx_unpack: code_range takes the 24-byte prologue of some pipeline-library programs
50 of the 2,684 library programs in shaders.rpf (1.0.2.1) start with two VOP3
opcode-0x180 words (words 0 and 3) instead of three, and their code starts at
word 6. code_range only knew the 36-byte form, so it disassembled them from
word 0 and they never decoded: 1 of the 50 translated. With the 24-byte form
all 50 disassemble with 0 invalid words and 49 translate and pass spirv-val.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 03:08:08 -06:00
7b2c5712a8 fspx_unpack: refuse an --out in the input folder (BUILD-1043) (#3638)
Squash-merged after review of PR #3638 - fspx_unpack: refuse an --out in the input folder
2026-11-23 08:12:13 -06:00
f9028b3159 Merge pull request #3138 from Rayhan Robin 2026-11-22 17:00:40 -05:00
3c0afe9e4f tools: disassemble an FSPX program before writing its files
A program whose disassembly fails now leaves no .dxbc or fspx/ files
behind, so a failed run's output matches a run that never reached it.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-22 21:21:35 +00:00
9ff3024c92 awc_names/fspx_unpack: one-line error instead of a PermissionError traceback for unreadable inputs 2026-11-22 20:58:05 +01:00
ea89942a20 tools: fail FSPX unpacking when disassembly is empty
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-22 19:28:39 +00:00
81d1a27073 Merge pull request #1829 from Tayar 2026-11-22 09:48:31 -05:00
3b409769ec fspx_unpack: preserve outputs for matching file stems 2026-11-22 11:26:49 -03:00
fa2d41ca69 fix(fspx_unpack): omit optional threads/wave32 in index.json for short kind-0 entries 2026-11-22 10:52:12 -03:00
f7fc3b13c4 rdna2spirv: read an FSPX program's code and dispatch state from fspx/
A game compute shader's COMPUTE_PGM_RSRC2 and group size come from its
FSSM header (0x138..0x144), and the re-anchoring of undecodable words
reads the FSSM blob. The FidelityFX DLL's programs have no FSSM:
fspx_unpack.py writes the program as fspx/<name>.code and the kind-0
fields as fspx/<name>.json. native_blob and cs_dispatch_state use those
when there is no fssm/<name>.fssm; with one, nothing changes. Tests cover
the FSPX case, the FSSM taking precedence, and neither being an error.
2026-11-22 13:42:04 +01:00
8cdb4fe826 tests: fspx_unpack on synthetic payloads and containers
The DLL's status codes (short, magic, directory, missing kind 0/6), skipped
out-of-range entries, the kind-0 decode for wave32 and wave64, the prologue
and s_endpgm range, containers inside other bytes, and the CLI on a DLL-like
file, a bare payload and inputs without FSPX. No game data.
2026-11-22 13:42:04 +01:00