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>
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>
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>
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>
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>
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>
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.
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>
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.
- #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>
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.