On Windows a redirected stdout uses the console's ANSI code page, and python -I ignores PYTHONUTF8 and
PYTHONIOENCODING, so a caller path with a character outside that code page ended a run with
UnicodeEncodeError as soon as a tool printed it. #1406 fixed make_game.py; every CLI tool in tools/ now starts
its __main__ block the same way (stdout errors="replace").
tests/test_tool_stdout_encoding.py checks every tool's __main__ block and reruns two measured crashes
(analyze_4240_full.py, meshlet_page.py) with a private-use-named input. Found by @abilliontokens.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Per the split in #1218, #1256 owns the PS interpolation-mode decoder and
census; this keeps the translator side of what #1246 put on main.
- fssm_header: read_methods()/READ_MOV/READ_INTERP/read_name() replace
interpolation_modes()/MODE_*/mode_name(); the bits say how the code reads
each input (0x01 v_interp_mov, 0x02 v_interp_p1/p2), as #1256 names them.
- rdna2spirv: check_read_methods() (same rule, refuses 0 of 12,101 PS);
index.json records ps_flat_interpolants.
- Remove tools/ps_interp_census.py and its test (#1256's ps_interp_modes.py
covers it).
- docs/design.md: the row becomes the translator-side "PS v_interp read
methods" row; the "PS interpolation modes" row is #1256's.
Depends on: #1256
AI-assisted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The FSSM pixel-input record's flags bits 0-1 hold the interpolation mode
(1 flat, 2 linear = perspective-center). Over the 12,101 PS of the 1.0.2.1
corpus they are 1 or 2 only, agree with the v_interp form the code uses in
every shader, and match PSV0's per-input InterpolationMode (linear or
constant; no centroid, sample or noperspective input). The FSSM holds no
SPI_PS_INPUT_ENA/ADDR word.
- fssm_header: interpolation_modes(), mode names, tally of PS modes.
- rdna2spirv: check_interpolation_modes() refuses a read position whose
mode disagrees or is 0/3 (rejects 0 of 12,101 PS; shard 0/12 output is
byte-identical to main).
- ps_interp_census.py: PSV0 + FSSM + disassembly census (stdlib).
- docs/design.md: contract row with method and counts.
AI-assisted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
files_of() treated anything that is not a file as a folder, so a
missing path ended in a FileNotFoundError traceback. --limit was a
plain int used as paths[:limit], so --limit -1 silently dropped the
last blob and --limit -5 the last five, reported as a normal tally.
The path is now checked first (exit 2, one line), and --limit must be
0 or more (an argparse error otherwise).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AI-assisted (fixer lane, orchestrated). tools/fssm_header.py already decoded the pixel-input table; rdna2spirv.py ignored it.
- PS translate() reads the fssm/<name>.fssm sidecar (same convention as CS) and declares every table position 0..count-1 as a fragment input at that Location, including positions the code never reads.
- A 32-bit v_interp read (p1/p2/mov) of a 16-bit-flagged position (flag bit 4) is rounded f32->f16->f32; *_f16-opcode reads already narrow and are unchanged; reads past the table still declare; no sidecar (or empty table) is byte-identical to the old path.
- shader_meta() records ps_interpolants (count) and ps_fp16_interpolants (flagged positions).
- docs/design.md: contract-table row with corpus measurements and the fixture confirmation (synthetic + mini_interp, no GPU).
Verified: tests/test_rdna2spirv_pixelinput.py 9 passed (synthetic FSSM blobs + hand-written listings, empty DXBC; no llvm-mc/spirv-tools/GPU/game data); full suite 1066 passed + 366 subtests on the dev branch; compileall + make_game --help green. Claimed as SHADER-15 in #156 before starting.
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.