Commit Graph

1720 Commits

Author SHA1 Message Date
4eb6155d3a int_hw_probe: the five gfx1035 divergences are fixed; docs index and four tools follow the repo rules
- int_hw_probe: VOP3 clamp on the carry-out add/sub ops (#1831) and v_cvt_rpi/flr's exact floor(x+0.5) and NaN
  sign saturation (#1856) now translate as gfx1035 measured, so KNOWN_DIVERGENCES is empty. The known-divergence
  test reports a synthetic entry. shader_validation.md says so, and design.md loses the stale duplicate
  v_cvt_flr/rpi row a "both" merge left that still called them open.
- docs/README.md: one Other languages line (fr, pt-BR, zh-CN, pl-PL, tr, ru, ja); docs/i18n/README.md: one row
  each for pt-BR and zh-CN (the newer).
- anim_rigs, d16_format_probe, pe_shader_containers: text writes name newline="\n" (#1615);
  pe_shader_containers guards stdout (#1428).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:22:53 -05:00
35cd8160ca Merge pull request #1871 from Vonsek
# Conflicts:
#	docs/design.md
2026-11-22 09:48:59 -05:00
afedb44e14 Merge pull request #1869 from lumenpearson 2026-11-22 09:48:56 -05:00
8d3b3afe6c Merge pull request #1861 from FreddyxS 2026-11-22 09:48:51 -05:00
ac71f09f65 Merge pull request #1860 from Kam471 2026-11-22 09:48:51 -05:00
307f944f5f Merge pull request #1857 from Anira 2026-11-22 09:48:49 -05:00
db1e5605df Merge pull request #1856 from Youssef Rahmouni 2026-11-22 09:48:48 -05:00
19e7023217 Merge pull request #1849 from Vonsek 2026-11-22 09:48:44 -05:00
cb30c62965 Merge pull request #1840 from Diego Casares 2026-11-22 09:48:40 -05:00
f6d9f993f6 Merge pull request #1832 from Tayar 2026-11-22 09:48:34 -05:00
cc26b16dbd Merge pull request #1831 from Youssef Rahmouni
# Conflicts:
#	docs/design.md
2026-11-22 09:48:33 -05:00
81d1a27073 Merge pull request #1829 from Tayar 2026-11-22 09:48:31 -05:00
016ed9abce Merge pull request #1824 from Tayar 2026-11-22 09:48:29 -05:00
e07ba097c7 Merge pull request #1822 from Tayar 2026-11-22 09:48:27 -05:00
7354a9de81 Merge pull request #1821 from Tayar 2026-11-22 09:48:26 -05:00
00a0a68f59 Merge pull request #1816 from Tayar 2026-11-22 09:48:24 -05:00
452d6b52a1 Merge pull request #1815 from Tayar 2026-11-22 09:48:24 -05:00
21764e7dcd Merge pull request #1814 from Tayar 2026-11-22 09:48:24 -05:00
f3b4e69b90 Merge pull request #1813 from SuarezPM 2026-11-22 09:48:23 -05:00
23c6147946 Merge pull request #1811 from Vonsek 2026-11-22 09:48:23 -05:00
754c9f9d25 Merge pull request #1804 from liang-kai-shui 2026-11-22 09:48:20 -05:00
e42e3e6567 Merge pull request #1802 from FreddyxS 2026-11-22 09:48:19 -05:00
6ffa0e2aa8 Merge pull request #1800 from Leonardo Guimaraes 2026-11-22 09:48:18 -05:00
b489f06dba Merge pull request #1792 from Luiz Neves
# Conflicts:
#	docs/design.md
2026-11-22 09:48:17 -05:00
18d6f165cb Merge pull request #1759 from BetterJdue
# Conflicts:
#	docs/design.md
2026-11-22 09:48:12 -05:00
89920b0a4b Merge pull request #1731 from Dandasma 2026-11-22 09:48:09 -05:00
00452cfaa3 Merge pull request #1615 from Ewann 2026-11-22 09:48:04 -05:00
b9e91c2af8 Merge pull request #1398 from ezwinxdlmao 2026-11-22 09:48:00 -05:00
134b29a057 Merge pull request #789 from eIBart0 2026-11-22 09:47:59 -05:00
6a6704df15 anim_rigs, int_hw_probe: guard stdout like the other tools (#1428)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 09:46:20 -05:00
7759b2abe4 rdna2spirv: 8- and 16-bit UINT/SINT typed buffer formats, measured on gfx1036
Formats 5, 6, 11, 12, 18, 19, 28, 61 and 70 (8_UINT, 8_SINT, 16_UINT,
16_SINT, 8_8_UINT, 8_8_SINT, 16_16_SINT, 8_8_8_8_SINT, 16_16_16_16_SINT)
were missing from Gen.FORMATS: a MUBUF load through one read 0 and a
store wrote nothing. UINT channels zero-extend and stores saturate; SINT
channels sign-extend and stores clamp the signed value. Every expected
word in the new semantic test was read back from a gfx1036 run of the
same instruction (tools/hw_oracle, wave32 and wave64).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:43:38 +01:00
0186bc2175 rdna2spirv: reject an attribute at a decoded f16 half's location even when that half isn't read
--f16-interp-fallback reserves both halves of an attribute (the index's f16_halves lists the pair, and the producer
fills both), but the clash check only compared declared inputs. After #1750 moved the halves to 28/29, a shader that
reads attr0's low half and attr29 put both at 29 without an error, and the producer would overwrite attr29. The
reserved pair is now checked too. test_interp_p1lv_f16 (#1693) expects #1750's locations (28, 29).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 09:42:03 -05:00
4a5c257d8a fix(tools): reject an empty shader carve 2026-11-22 17:40:43 +03:00
ffcc9a4060 rdna2spirv: refuse an incomplete shard set at --merge
--merge globbed index.part*.json and merged whatever was there, so an
interrupted shard run published a partial index.json that make_game.py
takes as a finished translation. Each --shard run now writes a
shard<i>.json marker ({"index": i, "count": n}) beside its part, and
--merge checks that all markers agree and that the parts are exactly
0..n-1 before merging; parts from before the markers fall back to
make_game.py's shards.json plan. make_game drops the markers with the
parts when it re-plans.
2026-11-22 22:39:13 +08:00
f88f6de61f user_sgpr_census: refuse to overwrite the input index 2026-11-22 15:38:26 +01:00
2d44fc8082 Tools: put the script's own directory on sys.path in the two that need it
`python -I` implies `-P`, so the directory of the script is not `sys.path[0]` and a tool that imports the module
next to it dies before `main()`:

    python -I tools/calibrated_texture.py --help
    ModuleNotFoundError: No module named 'bcpack'

`calibrated_texture.py` imports `bcpack`, `bcpack_tables` and `ttpf_mips` and added nothing; `ttpf_assets.py`
imports `bcpack`, `file_mode`, `ttpf_mips` and `calibrated_texture` and added nothing either, so the build's
texture stage tools could only be run through `make_game.py`, never directly as CONTRIBUTING.md documents.

Insert `os.path.dirname(os.path.abspath(__file__))` before the sibling imports, the pattern already used by
`tools/anim_clips.py`. `tests/test_tool_startup.py` derives the affected set from the sources and runs
`python -I <tool> --help` for all of them, so a new tool with a sibling import is covered without editing the
test; without the two fixes it fails exactly on those two tools.

A sweep of `python -I tools/*.py --help` over all 110 tools found no other case.
2026-11-22 16:38:03 +02:00
8701a00ef8 rdna2spirv: exact floor(x+0.5) and signed-NaN saturation for v_cvt_flr/rpi_i32_f32 2026-11-22 15:37:59 +01:00
4e82e8afd7 tools: read mission-state record tables and pool elements
Adds tools/mission_tables.py, a stdlib reader for the 32-byte state records and 64-byte pool elements in inflated PSIN streams, and a synthetic-only unittest suite. The reader reports per file the record count, distinct state keys, distinct archetype and link hashes, and every resolved entity transform. It resolves both the file-absolute offset and the measured linked-pool encoding (offset in 16-byte units from the following element block), validates the duplicated position and rotation component, and reports unresolved records and skipped bytes instead of guessing.
2026-11-22 14:37:48 +00:00
9620edd22d sop2_b32_srcs: mask reads only when the result goes to EXEC / VCC
s_and_b32 s20, exec_lo, 1 put each lane's bit in s20, which lane_masks.py
classifies as data when the other operand is a constant, so s_bcnt1 of it
counted 32 / 0 instead of 1 (found by @Pierre-Kookis on #1792, reproduced
on AMD RDNA2 and an RTX 4070 Ti SUPER; main was right). The mask read is
now only for an EXEC / VCC destination; into a plain SGPR the op keeps the
data read. test_mask_src_sgpr_const.py has the case.
2026-11-22 11:36:18 -03:00
850d9e6ae7 style: ruff check and format on the new container tool 2026-11-22 11:34:05 -03:00
ce5380a65e Tools: inventory the DXBC shader containers embedded in PE images
Scans a binary for DXBC containers, validates the chunk table (sorted, aligned,
inside the declared total, last chunk ending at it), reads the ILDN module name
and reports whether each carries an XBCH console record, an FSPX program or an
LLVM bitcode blob. --extract writes the containers and an index.json the FSM
translator reads; nothing is extracted unless asked for. Synthetic tests build
the containers by hand.
2026-11-22 11:34:05 -03:00
cd6e21be84 Translator: tbuffer_store_format_* with the instruction's format
tbuffer_store_format_* and its d16 forms were Unsupported, though every
tbuffer_load_format_* form translates. They now go through buffer_store
with the instruction's format, as the loads go through
buffer_load_format:
- only that format is encoded, with no branch on the V#'s FORMAT;
- the bounds check uses its element size;
- a V# whose FORMAT is 0 (INVALID) still disables the store, as measured.
  (@Vonsek covers the MTBUF loads and @opit80 the raw MUBUF accesses
  through such a V#.)

The format parsing the loads did inline becomes mtbuf_format(), shared by
both: no modifier is GFX10's default BUF_FMT_8_UNORM, and a format
FORMATS has no encoder for stays Unsupported. read_before_write_vgprs
now counts a tbuffer store's data VGPRs as reads, as for buffer_store.

cs_tbuffer_store.asm stores into 13 sentinel-filled regions through V#s
whose format differs from the instruction's or is 0, and reads them
back. Every
expected word was measured by running the same body natively on a
Radeon 680M (gfx1035, RDNA2); wave32 and wave64 gave the same 52 words:
- the instruction's format decides the encoding, the element and the
  bounds;
- components the format has but the store doesn't give are 0, and extra
  ones are dropped;
- the default format is one byte, and its neighbours are kept;
- a FORMAT-0 V# leaves the region untouched.

check.py and run_gpu_tests.py compare the dump. The semantic fixture
runs through the interpreter in tests/semantic/test_tbuffer_store.py,
which fails on the old translator (Unsupported). It also fails on
versions that take the bounds from the V#'s element (5 words differ),
take the format from the V#, fill missing components with anything
but 0 (1 word), or drop the FORMAT-0 guard (2 words).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:33:18 +02:00
c51e308305 docs: the XGameSave shim is #279's, not main's; test backticked repo paths
docs/saves.md and the tools/saves.py docstring named
runtime/shims/xgameruntime_services.cpp as the runtime's save store; that file
is only in the open #279, and on main XGameSave* imports get the loader's
default answers. docs/shader_validation.md named spirv_mini_interp without
its .py. tests/test_docs_repo_paths.py checks that backticked tools/,
runtime/, tests/ and scripts/ paths in docs/ name tracked files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:32:24 +01:00
6275ccc647 rdna2spirv: a constant used as a lane mask through an SGPR (or in a b32 SOP2 on EXEC) gives each lane its bit
s_mov_b32 s20, 0x3ffffc00; s_and_saveexec_b32 s6, s20 left all lanes on:
mask_src read the SGPR's raw value, the same non-zero constant in every
invocation. The 32-bit bitwise SOP2 ops read constants raw too, so
s_and_b32 exec_lo, exec_lo, 0xff00 (inline or in an SGPR) kept every
lane, and s_mov_b32 exec_lo, sN did the same.

mask_src now takes bit L of an SGPR holds_lane_mask doesn't flag (the
high SGPR of a pair for lanes 32-63 in wave64). In wave32, a bitwise SOP2
on masks (EXEC/VCC destination or a mask source) reads both operands
through mask_src (sop2_b32_srcs), and s_mov_b32 exec_lo/hi from a non-mask
SGPR takes each lane's bit. A real mask is unchanged (0 / ~0 per lane).

tests/semantic/test_mask_src_sgpr_const.py covers saveexec, SOP2 on EXEC
(inline and SGPR), exec_lo from an SGPR, v_cndmask, a wave64 pair and
masks from compares. cf_diff (self-test, 800 runs) and salu_diff (500)
pass. docs/design.md row updated.
2026-11-22 11:30:03 -03:00
b0b0500d4e spirv_metal_set0: close header file and emit unique SSA IDs for aliased bindings 2026-11-22 15:29:22 +01:00
3ea9b40792 user_sgpr_census: validate stage assignments before scanning 2026-11-22 11:27:40 -03:00
d9fb51b72a rdna2spirv: honor VOP3 clamp on v_add/sub/subrev_co[_ci]_u32 2026-11-22 15:27:22 +01:00
3b409769ec fspx_unpack: preserve outputs for matching file stems 2026-11-22 11:26:49 -03:00
376f17dffc bink_names: reject negative alignment skip counts 2026-11-22 11:26:12 -03:00
dd12fb296a world_lights_paths: reject colliding light and summary reports 2026-11-22 11:26:04 -03:00