user_sgpr_census: support MS stage techniques and pairing with PS (USER-SGPR-CENSUS-MS-TECHNIQUE) #1795

Open
github-bot wants to merge 1 commit from github-bot/gh-1795 into main AGit
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-25 12:14 UTC · original
abnalstlll-byte:feat/user-sgpr-census-ms-technique → main · +67 −22 · 2 files · 1 commits · open

Description

This PR implements mesh shader stage support in tools/user_sgpr_census.py and expands its test coverage.

Changes

  1. Technique Regex (tools/user_sgpr_census.py):
    • Expanded TECHNIQUE_RE from r"^.?(VS|PS)_(.+?)(?:_[0-9a-f]{8})?(?:_Wrapped)?$" to r"^.?(VS|PS|MS)_(.+?)(?:_[0-9a-f]{8})?(?:_Wrapped)?$" to correctly recognize mesh shaders (MS_).
    • Updated technique(name, stage) docstring and matching logic.
  2. Configurable Stage Pairs (pair_census):
    • Parameterized pair_census(index, stages=("vs", "ps")) to allow pairing any stage pair (e.g., MS with PS) while preserving 100% backwards-compatible dictionary return keys when called with default ("vs", "ps").
  3. CLI & Report (main):
    • In --pairs mode, if ms stage shaders are present in index.json, automatically computes and outputs MS/PS pairs summary and includes ms_ps_pairs in the JSON report.
  4. Test Suite (tests/test_user_sgpr_census.py):
    • Added ms shader stage fixture to INDEX with pointer reads at s16.
    • Added test assertions for ms in test_lowest_pointer_per_stage and --expect ms=16 in test_expect_passes_and_fails.
    • Added technique parsing assertions for MS_ tokens in test_technique_names.
    • Added test_mesh_shader_pair_census_and_cli verifying pair_census with ("ms", "ps") and CLI reporting.

Verification

  • python -m pytest tests/test_user_sgpr_census.py: 45 passed in 2.34s.
  • python -I tools/user_sgpr_census.py --help: Verified clean stdlib execution.
  • python -I tests/test_text_write_line_endings.py: 3/3 tests passed.
  • python -I scripts/check_no_game_data.py tools/user_sgpr_census.py tests/test_user_sgpr_census.py: Clean-room confirmed, 0 violations.

Claimed in #1608 (#1608).

AI-assisted (Claude Code)

**@⁠abnalstlll-byte** on GitHub · 2026-11-25 12:14 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1795) `abnalstlll-byte:feat/user-sgpr-census-ms-technique` → `main` · +67 −22 · 2 files · 1 commits · open ### Description This PR implements mesh shader stage support in `tools/user_sgpr_census.py` and expands its test coverage. ### Changes 1. **Technique Regex (`tools/user_sgpr_census.py`)**: - Expanded `TECHNIQUE_RE` from `r"^.?(VS|PS)_(.+?)(?:_[0-9a-f]{8})?(?:_Wrapped)?$"` to `r"^.?(VS|PS|MS)_(.+?)(?:_[0-9a-f]{8})?(?:_Wrapped)?$"` to correctly recognize mesh shaders (`MS_`). - Updated `technique(name, stage)` docstring and matching logic. 2. **Configurable Stage Pairs (`pair_census`)**: - Parameterized `pair_census(index, stages=("vs", "ps"))` to allow pairing any stage pair (e.g., `MS` with `PS`) while preserving 100% backwards-compatible dictionary return keys when called with default `("vs", "ps")`. 3. **CLI & Report (`main`)**: - In `--pairs` mode, if `ms` stage shaders are present in `index.json`, automatically computes and outputs `MS/PS pairs` summary and includes `ms_ps_pairs` in the JSON report. 4. **Test Suite (`tests/test_user_sgpr_census.py`)**: - Added `ms` shader stage fixture to `INDEX` with pointer reads at s16. - Added test assertions for `ms` in `test_lowest_pointer_per_stage` and `--expect ms=16` in `test_expect_passes_and_fails`. - Added technique parsing assertions for `MS_` tokens in `test_technique_names`. - Added `test_mesh_shader_pair_census_and_cli` verifying `pair_census` with `("ms", "ps")` and CLI reporting. ### Verification - `python -m pytest tests/test_user_sgpr_census.py`: 45 passed in 2.34s. - `python -I tools/user_sgpr_census.py --help`: Verified clean stdlib execution. - `python -I tests/test_text_write_line_endings.py`: 3/3 tests passed. - `python -I scripts/check_no_game_data.py tools/user_sgpr_census.py tests/test_user_sgpr_census.py`: Clean-room confirmed, 0 violations. Claimed in #1608 (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608). AI-assisted (Claude Code)
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)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:05:45 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1795/head:github-bot/gh-1795'
git switch 'github-bot/gh-1795'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1795'
git switch 'github-bot/gh-1795'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1795'
git switch 'github-bot/gh-1795'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1795'
git switch 'main'
git merge --squash 'github-bot/gh-1795'
git switch 'main'
git merge --ff-only 'github-bot/gh-1795'
git switch 'main'
git merge 'github-bot/gh-1795'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.