Commit Graph

16 Commits

Author SHA1 Message Date
1e0554da8f user_sgpr_census: support MS stage techniques and pairing with PS (USER-SGPR-CENSUS-MS-TECHNIQUE)
Extend tools/user_sgpr_census.py technique regex to recognize mesh
shaders ("MS_"), support configurable stage pairs in pair_census()
(defaulting to "vs" and "ps"), and report MS/PS pairings when MS
shaders are present in index.json.

Add test coverage for mesh shader lowest-pointer census, --expect ms=16,
technique name parsing, and MS/PS pair census.

AI-assisted (Claude Code)
2026-11-25 15:14:11 +03:00
779c8da45a user_sgpr_census: use shared report_paths.same_report_path (BUILD-589) (#6299)
Squash-merged after diff review of PR #6299 - user_sgpr_census: use shared report_paths.same_report_path (BUILD-589)
2026-11-23 08:23:11 -06:00
05961f0eeb user_sgpr_census: read the index as utf-8-sig, so a Windows BOM is not a JSON error (EGEN-SGPRCENSUS-BOM) (#6276)
Squash-merged after diff review of PR #6276 - user_sgpr_census: read the index as utf-8-sig, so a Windows BOM is not a JSON error (EGEN-SGPRCENSUS-BOM)
2026-11-23 08:21:26 -06:00
35d498d8b4 Merge pull request #2364 from bbareth
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:05:34 -05:00
6e2e3a4606 Merge upstream main and preserve both changes
Conflict resolution AI-assisted with DeepSeek V4 Pro. Focused synthetic tests passed on macOS arm64.
2026-11-22 22:57:17 +01:00
d6fe52767c user_sgpr_census --pairs: VS/PS of one technique read shared root SGPRs alike (D3D-318)
docs/d3d12_vulkan.md left root-parameter visibility open: one block in
root order (the layer's model) or the console omitting a stage's invisible
parameters, which would put different parameters at the same SGPR in a VS
and a PS. The game's shaders carry no RTS0 and the executable that pairs
them into pipelines is not in the package, so --pairs pairs a VS with a PS
by technique name (names alike apart from the VS_/PS_ token) and compares
the user SGPRs both read, with all VS x PS combinations as a control.

On the 1.0.2.1 corpus: 166 techniques have both stages, 358 combinations.
All 379 shared reads have the same kind (pointer or constant), against
25.5% different over all 26,196,976 combinations; and all 111 shared
reads above an SGPR only one stage reads still agree, where omission
would have moved them. The doc records the counts and the limits: names
approximate the pipelines, and a visible parameter a stage doesn't read
looks like a hidden one.

The tests build both models from one root signature and check that they
give different counts. Names are used for pairing only, never printed.

AI-assisted.
2026-11-22 19:11:04 +01:00
ec8ec4c9a4 Fix what the round-40 merges broke
- docs: one row per topic again in design.md (59 topics merged sentence by sentence, keeping every
  number) and README.md (the current models/character rows); one Other languages line.
- docs/i18n: the two Spanish quickstarts had been concatenated; keep #1912's, drop #2277's row.
- make_game: the shader fingerprint covers spirv_asm.py and its tables; LF settings write.
- tools: pe_shader_containers, gamedata_maps and anim_rigs use report_paths.same_report_path (BUILD-589);
  stdout guard on five tools; LF text writes in three; user_sgpr_census tolerates an unreachable --json.
- tests: fspx stage fakes write real carve/unpack indexes (c7408a1f); typed f16 stores round toward zero
  (SHADER-358); test_ci_registration's helper is no longer collected as a test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:55:07 -05:00
b1896288d0 user_sgpr_census: stabilize the lowest-pointer mode when counts tie 2026-11-22 17:47:11 +01:00
e40f7de7d7 user_sgpr_census: a bad index or an unwritable --json is one ERROR line, not a traceback
The census opened index.json and called .values()/.get() on whatever it
held, so a missing file, a folder, an empty or non-JSON file, a top-level
array, or an entry or read of the wrong type each ended in a traceback
(FileNotFoundError, JSONDecodeError, UnicodeDecodeError, AttributeError,
TypeError). A --json path in a missing folder did the same after the scan.

load_index() now reads and checks the index before the census runs, with
the wording tools/root_sig_contract.py already uses for the same file
(object of entries, each entry an object, user_sgpr_reads an array, each
read with 'sgpr' and a string 'kind'), plus a string 'stage' and a
nonnegative integer 'sgpr'. Entries with no stage or no reads are counted
as before. Each failure is one "ERROR: ..." line and exit 2, which keeps
exit 1 for an --expect mismatch. A --json report that cannot be written is
reported the same way.

tests/test_user_sgpr_census.py: 25 new cases (the CLI under -I and main()
in process); 24 of them fail on the tool as it was.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 10:47:40 -05:00
8d3b3afe6c Merge pull request #1861 from FreddyxS 2026-11-22 09:48:51 -05:00
f6d9f993f6 Merge pull request #1832 from Tayar 2026-11-22 09:48:34 -05:00
f88f6de61f user_sgpr_census: refuse to overwrite the input index 2026-11-22 15:38:26 +01:00
3ea9b40792 user_sgpr_census: validate stage assignments before scanning 2026-11-22 11:27:40 -03:00
ec9b6cf22b tools: text reports are written with LF line ends on every platform (BUILD-468)
open(path, "w") without newline= turns each \n into \r\n on Windows, so the same JSON report, manifest or assembly
listing was CRLF there and LF elsewhere. 91 text-mode writes (open, os.fdopen, Path.write_text) under tools/, scripts/,
make_game.py and runtime/test/shaders/ now pass newline="\n". tests/test_text_write_line_endings.py reads the source
with ast and fails for a writer that forgets it; CONTRIBUTING.md names the convention.

AI-assisted (Claude), on behalf of dev-ewann.
2026-11-22 14:20:30 +00:00
89b047cd8f hw_oracle test follows #1620's per-kernel MODE skip; three tools guard stdout
- #1617 and #1620 both handle the float MODE fields gfx1170+ can't set. #1620's runner returns the reason for
  that kernel and runs the rest; #1617's test still expected Unavailable for the whole run. The test now checks
  the per-kernel reason.
- fspx_unpack.py, user_sgpr_census.py, world_lights_paths.py: new tools without #1428's stdout errors='replace'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 08:35:03 -05:00
0f183fcafd Tools: user-SGPR census per stage (evidence for d3d12_vulkan.md 3.5)
tools/user_sgpr_census.py (standard library only) reads spirv/index.json
(user_sgpr_reads from tools/shader_meta.py) and reports, per stage: the
lowest user SGPR read as a pointer, pointer width (ptr32_lo vs ptr64), the
distance between consecutive pointer SGPRs, how the SGPR after a 32-bit
pointer is read, and reads below a given stage base. --expect stage=sgpr
turns the result into a check.

docs/d3d12_vulkan.md 3.5: the measured counts next to the current packing
description. Physical SGPRs only; no packer change.

Tests: tests/test_user_sgpr_census.py builds both packing models by hand
and checks they are told apart, plus a failing --expect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:03:22 +01:00