Commit Graph

23 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
156a056b85 Merge #583 (FSPX short prologue)
# Conflicts:
#	tools/fspx_unpack.py
#	tools/shader_library.py
2026-11-25 00:43:28 -05:00
273b3bdf9d [integration] Linux/Proton and native Windows: boot through the story load (RT-PROTON-STORY-LOAD)
One squashed commit of a fork that was developed on a Linux/Proton machine and
tested on two native Windows machines. On all of them the retail 1.0.2.1
package now launches, shows its launch movie, first-run pages and landing
prompt, runs the story load to its end with the loading slideshow drawing its
artwork, and enters the world phase. A first world frame is not verified yet.
docs/linux_proton.md has the setup, a healthy boot's timeline, the machines
and where it stops.

Runtime: frames in the title's own window; DirectStorage pinned reads,
page-list scatter/gather, BCPack and unshuffle with a locally generated
predictor file; pooled, device-local and deferred image backing for streamed
and placed textures; enhanced barriers into LAYOUT_UNDEFINED; a bindless table
that degrades instead of refusing a submission; a descriptor hash finalizer
(off until a library carries it); directly indexed heap offsets for compute
dispatches and VS/PS/GS draws; title buffer windows outside a fragmented
arena; opt-in device-local copies of streamed buffer views; write-fault
retries under the tracker lock, shared trackers and write-watched title memory
for native Windows; device-loss, compute-input and memory probes.

Translator: loop bounds at structured exits, the eight FidelityFX programs
that use a packed-dot form the disassembler skips, buffer bounds modes per
view kind, a compaction option, the hash finalizer option.

Tools and scripts: Linux boot scripts (Wine/Proton, no network), a Windows
boot script, the paired compute translation script.

No game data. AI-assisted (Claude Code and Codex agents), reviewed and booted
by people on the machines named in docs/linux_proton.md.

Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 11:42:12 -06: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
ebcb0acad5 tools: decode the pipeline-library compute programs llvm-mc refuses
llvm-mc 21 cannot decode SMEM loads whose SOFFSET is null (0x7D), so whole
pipeline-library compute programs of 1.0.2.1 came out with invalid words
and failed to translate. For compute programs, shader_disasm now falls back
to rdna2_decode when that decodes more of the program, and rdna2_decode
reads VOPC with DPP16/DPP8 as the 8-byte form it is.

rdna2spirv:
- SMEM with vcc as its base reads the vcc_lo/vcc_hi pair.
- s_flbit_i32_b64 of a lane mask reads the wave's 64-bit mask (18 library
  programs), as s_ff1_i32_b64 already does.
- s_bitreplicate_b64_b32 of a lane mask into plain scalar data replicates
  the wave's mask word (6 library programs); into exec/vcc it stays
  Unsupported.

test_salu_flbit_64: the lane-mask case now translates (the subgroup op is
outside the single-invocation interpreter), so the test checks that.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 08:42:10 -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
72a70e3e8f Merge pull request #3345 from jaybeebabageyus 2026-11-22 17:01:33 -05: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
ca5589f219 fspx_unpack: report an unusable --out without a traceback
os.makedirs of the fspx (and --disasm) output directories ran before any
input was read, so a regular file at --out, a regular file above the
target dir, or a regular file where fspx/disasm belongs exited with a raw
OSError traceback. One stderr line naming the refused directory and exit
2 instead; per-input failures keep rc 1.
2026-11-22 21:10:40 +01: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
d9f7ec4162 Merge upstream main
# Conflicts:
#	tools/fspx_unpack.py
2026-11-22 10:28:36 -05:00
6a16ac1436 FSPX lookup: a kind-0 state key next to the code key; ambiguous programs are refused (RT-99 review)
Review on #1911: two containers with the same kind-6 program and different kind-0 entries (32x1x1 and 64x1x1)
translate to different modules but got the same fspx_code_sha256, so both resolved to the same pipeline.

- tools/fspx_unpack.py writes the kind-0 entry as fspx/<name>.state; tools/shader_meta.py records its SHA-256 as
  fspx_state_sha256 next to fspx_code_sha256.
- make_game.py: entries with the same code and state keys must have identical modules, otherwise the FSPX step fails
  naming both programs and drops the index. The same code key with other state keys is allowed.
- runtime: a container or bare payload (kinds 0 and 6 present) matches the code key and then the state key; no match
  is E_INVALIDARG. A bare kind-6 program (slot 67, no kind 0) takes the code key's entries when their modules are
  identical, and is refused with E_INVALIDARG and an "ambiguous" log line when they differ.
- Tests: the review case in tests/test_fspx_shaders_stage.py, shader_library_test and d3d12_fspx_compute_test.
- docs/fspx.md: the two keys and the ambiguous case.

On 1.0.2.1 the 29 kind-6 programs are distinct, so nothing resolved wrongly before: 17 translated entries, 17
distinct code keys, 17 distinct (code, state) pairs, all 17 found from the container and from the bare program.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:28:07 -05:00
81d1a27073 Merge pull request #1829 from Tayar 2026-11-22 09:48:31 -05:00
00452cfaa3 Merge pull request #1615 from Ewann 2026-11-22 09:48:04 -05:00
3b409769ec fspx_unpack: preserve outputs for matching file stems 2026-11-22 11:26:49 -03:00
ec9b6cf22b tools: text reports are written with LF line ends on every platform (BUILD-468)
open(path, "w") without newline= turns each \n into \r\n on Windows, so the same JSON report, manifest or assembly
listing was CRLF there and LF elsewhere. 91 text-mode writes (open, os.fdopen, Path.write_text) under tools/, scripts/,
make_game.py and runtime/test/shaders/ now pass newline="\n". tests/test_text_write_line_endings.py reads the source
with ast and fails for a writer that forgets it; CONTRIBUTING.md names the convention.

AI-assisted (Claude), on behalf of dev-ewann.
2026-11-22 14:20:30 +00: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
89b047cd8f hw_oracle test follows #1620's per-kernel MODE skip; three tools guard stdout
- #1617 and #1620 both handle the float MODE fields gfx1170+ can't set. #1620's runner returns the reason for
  that kernel and runs the rest; #1617's test still expected Unavailable for the whole run. The test now checks
  the per-kernel reason.
- fspx_unpack.py, user_sgpr_census.py, world_lights_paths.py: new tools without #1428's stdout errors='replace'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 08:35:03 -05:00
638ac9279e tools: fspx_unpack.py, the FidelityFX DLL's FSPX compute programs
The FSR upscaler DLL's 29 shaders are DXBC containers whose ACCC part is an
FSPX payload: a directory of {kind, offset, size} entries around an RDNA2
program (kind 6) and its dispatch state (kind 0). parse_fspx follows the
DLL's own reader (RVA 0x1a20), status codes included. The tool finds the
containers in any file (the DLL itself, a .dxbc or a bare payload) and
writes them in the layout of the game's shader corpus: <name>.dxbc,
index.json, fspx/<name>.code and .json, and with --disasm a
shader_disasm.py .s of the code after its 36-byte prologue. --mcpu
defaults to gfx1030, because the programs use v_dot4 instructions that
gfx1013 does not decode. Format notes follow in docs/fspx.md.
2026-11-22 13:42:04 +01:00