Commit Graph

19 Commits

Author SHA1 Message Date
a30e6b101f Merge pull request #338 from NolanCotter/shader-satpk-u8
rdna2spirv: translate v_sat_pk_u8_i16 (SHADER-SATPK-U8)
2026-11-28 12:51:16 +01:00
62137d42f8 tools: fssm_root_layout reads each program's root-layout and used-resource tables, with a census (FSSM-ROOT-LAYOUT-TABLES)
docs/d3d12_vulkan.md section 3.5 infers where root arguments arrive from the user SGPRs the shaders read and calls
the graphics bases (s8 for VS/PS/GS, s16 for mesh) a hypothesis: the SGPR census cannot see root-parameter indices
or a spill. Each native program's FSSM record names two tables that state it directly: a root-layout table (root
type, user-data dwords, first user-data dword and root parameter index per parameter) and a used-resource table.
The record layout is the one VIctory reads (Marvisak/VIctory, GPL-3.0, crates/victory-shader/src/native.rs). The
parser is written for this repository from that layout and contains no VIctory code.

tools/fssm_root_layout.py is a new module on its own. root_tables(fssm) returns the programs of one blob with both
tables. It raises FssmLayoutError (a ValueError) for a header that is not version 0x101 with a matching payload
size, a record or code range outside the payload, records that overlap each other or the slot table, and a table
that runs past the payload or overlaps a record, its program's code or the program's other table. Unnamed types
and non-zero reserved fields are kept so they can be counted. Its command line prints the tables of a file or a
folder as JSON, or writes them with --out, one file in memory at a time.

tools/root_layout_census.py reads the user's own .fssm blobs or carved containers and prints counts per hardware
stage: the lowest SGPR a parameter arrives in, the dwords each root type takes, root types and used-resource kinds,
compute programs with a spilled parameter and the first spilled dword, and how many programs agree with the
section 3.5 hypothesis, with the reasons for the rest. It also counts what would show the reading to be wrong
(unread blobs by reason, record offsets, reserved fields, unnamed types). With no input it says so.

No retranslation: tools/fssm_unpack.py and every other file in make_game's TRANSLATION_SOURCES are untouched, and
neither new file is imported by the translator or make_game.py, so a translated shader library stays valid. A
test holds the two new names out of make_game.py, translator_deps.cmake, fssm_unpack.py, rdna2spirv.py and
shader_meta.py.

Nothing here was run on real shader data. Which fields are VIctory's reading and which this corpus's earlier
measurements already support (the two table offsets are the header's `code_end` and `meta_ptr`) is in section 3.5,
with the commands and the open questions. The runtime does not use the tables yet.

Tested: tests/test_fssm_root_layout.py (32 tests: hand-built records with constants, a root descriptor, tables, an
immediate sampler, a heap and a spilled compute layout; truncated, overlapping and overflowing tables; every
prefix and 4,000 seeded corruptions of a three-program blob; both command lines) and the fssm_unpack, pal_stages,
fssm_header, fssm_crosscheck, missing-input, line-ending and CI-registration tests pass. The repository-consistency
set gives 578 passed, 5 skipped. No game files.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
2026-11-24 19:18:20 -05:00
6446e3ce76 rdna2spirv: translate v_sat_pk_u8_i16 (SHADER-SATPK-U8)
The VOP1/VOP3 op saturates each signed i16 half of SRC0 to unsigned
8-bit and packs the pair into the low 16 bits of VDST, preserving the
high half (GFX9+ partial write; LLVM VOP1Inst_t16, Mesa ACO
instr_is_16bit). Neg/abs/clamp/omod are refused; _sdwa restricts to the
documented source/destination selects; _e32 rejects all modifiers.

Adds a hand-written fixture and a semantic test driving the SPIR-V
through spirv_mini_interp against a plain-Python reference (lane edge
values, SGPR/literal sources, sdwa selects, refused modifiers), the
docs/design.md contract row, and drops the op from the
fssm_crosscheck unhandled list. The two tests that used the mnemonic
as the still-unsupported canary now use v_mullit_f32.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-23 20:21:17 -07:00
4cd82fe3fa vs_layout_census: confirm legacy non-NGG VS per PAL hardware stage; measure the 195 ES variants (#6558)
Squash-merged after diff review of PR #6558
2026-11-23 12:45:04 -06:00
c29ad552fb docs/fssm_crosscheck: the repro runs six tests, not four with an expected failure (#6648)
Squash-merged after diff review of PR #6648
2026-11-23 11:06:46 -06:00
57c175391d Revert #2490: its console-ABI list proxy breaks run_tiny_frame (please rebase and split)
With it, d3d12_xs reads list slot 48 as the console's IASetVertexBuffers, so the PC-shaped fixture list's
ClearRenderTargetView never runs and Close fails. The branch also changes runtime/src/pe_loader.cpp and carried
committed conflict markers in docs/fssm_crosscheck.md. Its docs rows go with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 04:42:53 -05:00
2e52b2f1d7 Docs after round 44: one row per topic, escaped literal pipes, one copy of each repeated line and list item, one i18n row per language
Also: #2490's committed conflict markers in fssm_crosscheck.md resolved to main's text, the SHADER-605 section
moved below the troubleshooting table it split, a header rule for the export-format table, two backticked
paths that name no Leonida file, and the BOM dropped from anim_move.py and its test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:24:16 -05:00
ffb4be31ca Merge pull request #3782 from Kacper Serewis
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:08:26 -05:00
fa5f26db8e Merge origin/main: DXGI device fields coexist with the console-ABI device state 2026-11-22 20:39:59 -07:00
311736eca0 docs: fssm_crosscheck records the duplicate-XBCH fix that landed
xdat_entries_all, the last-wins xdat_entries view and unpack's
payload flag (--payload) are on main with their tests, but the doc
still called the duplicate tag-0x0D handling a repro expectedFailure
with the fix out of scope.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-22 17:02:10 -07:00
63547ca565 Use plain ASCII in the census method 2026-11-22 23:15:35 +01:00
3e82e38e16 Clarify the FSSM stage words and float-mode census method 2026-11-22 23:15:11 +01:00
17a82620ee Merge pull request #3782 from Kacper Serewis 2026-11-22 17:03:45 -05:00
411b761e99 Document the standalone FSSM float-mode candidate (SHADER-190) 2026-11-22 22:58:19 +01:00
35909176a1 Document FSSM initial float-mode search (SHADER-190) 2026-11-22 22:36:14 +01:00
a50a58bb13 docs/fssm_crosscheck.md: the duplicate XBCH payload bug is fixed, not open
#2479 added fssm_unpack.xdat_entries_all() and unpack(payload="first"|"last"), and the CLI's --payload, but this note still described the bug as open and cited a repro test that is no longer in the tree.

Correct the five spots that say so, and point at the tests that exist.
2026-11-22 15:31:27 -05:00
66bc9413eb docs/fssm_crosscheck.md: fssm_unpack now checks the FSSM magic (review)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 06:41:17 +01:00
2fecf12124 fssm_header: parse the post-code binding table
Decode the filler, header, 20-byte records and name record after
code_end, and add a --bindings summary. Measured over 26,503 blobs:
5,640,704 records, all parse.
2026-11-21 21:59:15 +00:00
03a9973f8d Docs: FSSM/RDNA2 cross-check against SCARAB
Adds a fact-level comparison of SCARAB's FSSM, rDNA2 classification and XBSC notes with Leonida's tools, plus a synthetic repro for the duplicate tag-0x0D XBCH loss.
2026-11-21 19:25:36 +00:00