Repository navigation
Conversation
|
Independent check (Windows 10 19045, CPython 3.12.10, CPU only, no game files): merged cleanly onto |
…e prologue of some pipeline-library programs (FSPX-SHORT-PROLOGUE) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…te programs llvm-mc refuses Conflicts with ProjectLeonida#583 (merged just before) in fspx_unpack.code_range and its test: both handle the two-hash-word, 24-byte prologue of some pipeline-library programs. ProjectLeonida#998's version counts the hash words (two or three) and covers ProjectLeonida#583's case, so it is kept; ProjectLeonida#583's two constants, used only there, are dropped and its measurement comment (50 of 2,684 programs) stays. Both PRs' tests are kept and pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s (FSPX-SHORT-PROLOGUE) main's code_range takes the 24-byte prologue with a stricter check than this PR first proposed (both carriers must be literal-bearing VOP3 words), so the code change is dropped. What is left: a unit test for the short form, its stricter check and the 36-byte precedence, and the docs/fspx.md paragraph with the library counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4b9a891 to
3af97a1
Compare
|
Rebased onto
|
kawaii-shakal
left a comment
There was a problem hiding this comment.
Heads-up: main now has this. tools/fspx_unpack.py::code_range on main (c7e82e2) has the 24-byte form. When words 0 and 3 are literal-bearing 0xD580 VOP3 NOPs and word 6 is not, the code starts at byte 24. It came in with the integration merge 273b3bd (#984).
Measured on the 1.0.2.1 pipeline library with main's shaders stage:
- 50 programs list
code 0x18..(fspx); - 49 of them translate and pass
spirv-val; - the 50th is the
s_sethalt 1program you mentioned, now handled by #1697.
So the code change here is superseded. If your tests cover cases main's version doesn't (for example the "all three prologue words still take the 36-byte form" check), they may be worth keeping as a small tests-only PR against main; otherwise this one can probably be closed.
AI-assisted review (Claude Code, Claude Opus 5.5).
…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 (3af97a1, 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>
# Conflicts: # tools/fspx_unpack.py # tools/shader_library.py
37 upstream commits after 86dc3d8: ProjectLeonida#2138 (integration/boot-combined), ProjectLeonida#2094 (geometry-view eviction on range release, reaped after the replays that may name them), ProjectLeonida#998/ProjectLeonida#1317/ProjectLeonida#1281/ProjectLeonida#583 heads (pipeline-library compute programs by code hash, shader_disasm prints the dot4 op_sel words llvm-mc rejects, FSPX short prologue with the literal-form check), null-resource texture barriers and null-view RTV clears on the console list, and the removal of the title's executable addresses from code (read from the environment). Conflicts, on merit: - d3d12_xs_device.cpp: both. Our title heap sync (LEONIDA_TITLE_HEAP_SYNC) and upstream's null-RTV marks sit side by side; heap_release unregisters the sync or the range as before and also drops the heap's null-RTV marks; CreateDescriptorHeap keeps our desc argument and takes upstream's RTV real range. Our value-op/upload-ring slots and upstream's slot 146 barrier conversion both stay. - startup_trace.h: our thread and watchdog-table logging stays, and follows upstream's rule: the watchdog table's store and table RVAs come from LEONIDA_WATCHDOG_TABLE (off when unset, documented in runtime/README.md); upstream's environment-driven pool diagnostic replaces the fixed address. - fspx_unpack.py: ours (the code end is found from one rdna2_decode pass, not an llvm-mc run per s_endpgm: the OOM and 15-minute fix). Its test takes upstream's short-prologue case, which checks the literal form our code also requires. - rdna2spirv.py: ours (s_bitreplicate_b64_b32 into VCC in wave32 stays translated: 6 pipeline-library programs), plus the point behind upstream's refusal: in wave32 VCC's high word is data, so it is now written to vcc_hi as source bits 16..31 replicated (replicate_bits16, shared with the scalar form). Tests: ours kept, one added for the vcc_hi word; test_salu_flbit_64 keeps ours (this tree translates i64 of a lane mask). - xs_proxy_mock_test.cpp: upstream's empty Barrier call, our chained-submission reference count. Every line the merge removes from our side is upstream's own or one of the resolutions above (checked against the merge base, D:\GTA6\analysis\lostlines.sh). The touched Python suites pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claimed in the coordination issue as: FSPX-SHORT-PROLOGUE (claimed in #14)
Item: FSPX-SHORT-PROLOGUE (claimed in #14).
tools/fspx_unpack.pycode_rangeonly knew the 36-byte prologue (VOP3 opcode 0x180, bits 31..16 =0xD580, at words 0, 3 and 6). Some programs of the pipeline library inshaders.rpfcarry only words 0 and 3: a 24-byte prologue, with the code starting at word 6 (s_inst_prefetchin all of them). Read from word 0 they never decode.Counted over the whole 1.0.2.1 library (2,684 programs): 50 have the 24-byte form; before this change 1 of the 50 translated. With it, all 50 disassemble with 0 invalid words, and 49 translate and pass
spirv-val(the last stops ats_sethalt). A program whose words 0, 3 and 6 are all prologue words still takes the 36-byte form.shader_library.pywrites"prologue": start > 0for both forms. The runtime needs no change: the game passes these programs as FSPX payloads, which it reads by directory.Found while booting the retail executable: four of the slot-67 compute pipelines the title creates were these programs.
Changes:
tools/fspx_unpack.py:SHORT_PROLOGUE_WORDS/SHORT_PROLOGUE_SIZE,code_rangefalls back to them.tools/shader_library.py: theprologueflag covers both sizes.tests/test_fspx_unpack.py:test_short_prologue(synthetic words, no game data).docs/fspx.md: the 24-byte variant and the counts.Tested (Windows 11, Python 3.12):
python -I tests/test_fspx_unpack.py,tests/test_shader_library.py,tests/test_fspx_unpack_out.py,tests/test_fspx_shaders_stage.py,tests/test_text_write_line_endings.py, all OK. The corpus counts come from a local work folder on an RTX 4070 SUPER box; no GPU test involved.AI-assisted (Claude Code).
GPUs tested: n/a (CPU-only Python tests)
AI-assisted: yes (Claude Code)
🤖 Generated with Claude Code