Repository navigation
docs/testing.md: which Known problems rows the game's shaders reach (op_reach --fssm, name patterns) - #6818
Conversation
tools/op_reach.py counts, over a disassembled corpus, the shaders and instructions using each instruction, merging the _e32/_e64/_sdwa/_dpp encodings and counting only the program up to a listing's last s_endpgm (decoded data words after it are reported separately). tests/test_op_reach.py checks it on hand-written listings. docs/isa_coverage.md lists, for the docs/design.md rows whose rule is partly not measured on hardware (or 'not run on the shader corpus'), which instructions no 1.0.2.1 shader uses (v_cvt_pknorm_*, v_cmp_class_f16/f64, v_div_fixup_f16/f64, f16/f64 frexp/ldexp, f64 rcp/rsq/sqrt, ds_add_f32, the fcmpswap family, s_cmov/s_pack, the x2 bitwise buffer atomics, the extra image atomics, v_dot2c/v_dot8c, sub-dword buffer/global forms) and how many use the others (16-bit interpolation 4,776 PS, v_fma_mix* 9,620, ...).
…op_reach --fssm, patterns)
tools/op_reach.py gains --fssm (count per compiled wave size, from the FSSM
header flag fssm_header.wave_size() reads, and per stage and wave size with
--index) and OP patterns over the printed names ('*_dpp'). Three new tests.
docs/testing.md: a subsection after the Known problems table with the
1.0.2.1 counts for the instruction-specific rows: no shader uses s_bfe_i64
(RDNA1/RADV cs_w32_salu64), no wave64 shader uses ds_bpermute_b32 (5 wave32
CS do; lds_fuzz --wave 64 on AMD's driver), DPP in 4,313 shaders (2,496
wave64), v_permlanex16_b32 in 2,293 (561 wave64), the five MoltenVK
signed-zero f16 ops in 47-130 shaders each, 16-bit interpolation in 4,776 PS,
195 GS and 9,282 MS for the Mac gs_tri/ms_tri row.
|
Independent CPU check of The new testing table distinguishes opcode-level counts from operand and driver conditions, including the high-half interpolation operand. I did not remeasure the documented corpus counts. The unrelated line-ending check already fails on the base at Synthetic inputs only. AI-assisted. |
shayderrr
left a comment
There was a problem hiding this comment.
Summary: Adds tools/op_reach.py, which counts per-instruction shader and instruction totals over a disassembled shader corpus, merging _e32/_e64/_sdwa/_dpp encodings through base_name() and excluding words after the last s_endpgm. With --index and --fssm it also splits counts by stage and compiled wave size. tests/test_op_reach.py exercises base-name normalization, encoding merging, post-endpgm exclusion, patterns, stage and wave splits, and CLI JSON and error paths. docs/isa_coverage.md and docs/testing.md record the measured 1.0.2.1 reach of unmeasured-contract rules and driver-fuzzer rows.
Why merge: Turns open hardware-coverage questions into measured, reproducible counts so effort can focus on instructions the game actually reaches.
Verdict: Approve
|
Summary: Adds tools/op_reach.py, which counts per-instruction shader and instruction totals over a disassembled shader corpus, merging _e32/_e64/_sdwa/_dpp encodings through base_name() and excluding words after the last s_endpgm. With --index and --fssm it also splits counts by stage and compiled wave size. tests/test_op_reach.py exercises base-name normalization, encoding merging, post-endpgm exclusion, patterns, stage and wave splits, and CLI JSON and error paths. docs/isa_coverage.md and docs/testing.md record the measured 1.0.2.1 reach of unmeasured-contract rules and driver-fuzzer rows. Why merge: Turns open hardware-coverage questions into measured, reproducible counts so effort can focus on instructions the game actually reaches. Verdict: Approve |
Claimed in the coordination issue as: #6414 (comment) (docs/testing.md Known problems: which rows the game's shaders reach)
Depends on: #6735. This branch is built on it and extends its
tools/op_reach.py. The diff below includes #6735's commit32f09b1a8; this PR's own change is commit6a1fa35a6. Once #6735 lands, only that commit remains.What and why
Several rows of the Known problems table in
docs/testing.mdare tied to particular instructions: a fixture or fuzzer fails on some driver. A reader can't tell from the row whether a game shader can hit the same failure. This PR narrows those rows with counts over the 1.0.2.1 corpus.tools/op_reach.py:--fssm <dxbc>/fssmadds a count per compiled wave size, read withfssm_header.wave_size()(u32[0xD4]bit 5). With--indexit also counts per stage and wave size.*/?is now anfnmatchpattern over the printed names ('*_dpp'). A plain name is still a base name with every encoding merged.tests/test_op_reach.py: 3 new tests (10 in total) on hand-written listings and synthetic FSSM headers that hold only the magic and the wave flag: pattern matching, the wave split (including a listing with no sidecar, which counts asw?), and the CLI with--fssmand its missing-folder exit 2.docs/testing.md: a subsection after the Known problems table, "Which known problems the game's shaders reach". It is placed there so it does not touch the table rows that several open PRs edit.Measured (1.0.2.1, 26,503 listings: 2,662 wave32 = 1,535 CS + 1,127 PS; 23,841 wave64)
cs_w32_salu64on RDNA1 / RADV 25.2.8 (high word ofs_bfe_i64)s_bfe_i64(ors_bfe_u64)lds_fuzz --wave 64ds_bpermute_b32on AMD's Windows driverds_bpermute_b32is only in 5 wave32 CScrosslane_fuzz --wave 64AMD iGPU (v_permlanex16_b32after a partial-row_maskDPP)v_permlanex16_b32in 561 wave64 shaders (upper bounds: the pairing androw_maskare not counted)cs_dpp_opson MoltenVK 1.4.2v_mul_f16124,v_fma_f16124,v_fmac_f16130,v_pk_mul_f1655,v_pk_fma_f1647 shadersps_interp_f16_highon MoltenVKgs_tri/ms_trion a MacThese are counts of instructions in the program; a count does not show that a shader reproduces the failure. The doc says so.
Tested
Commit
6a1fa35a6(on #6735's32f09b1a8, on origin/main1cc6e3c12). Docs and a census tool only, with no translator change, so there is no translate/spirv-val before-and-after.The run took about 3 minutes, CPU only, on Windows 11 (10.0.26200) with Python 3.12.10. No GPU or driver involved.
AI-assisted: yes (omp orchestrator).
Checklist
docs/design.md, with how it was confirmed. (No translator rule changes.)