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

Open
opened 2026-11-26 21:19:01 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1795
Author: @abnalstlll-byte
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: feat/user-sgpr-census-ms-technique


📝 Commits (1)

  • 1e0554d user_sgpr_census: support MS stage techniques and pairing with PS (USER-SGPR-CENSUS-MS-TECHNIQUE)

📊 Changes

2 files changed (+67 additions, -22 deletions)

View changed files

📝 tests/test_user_sgpr_census.py (+29 -1)
📝 tools/user_sgpr_census.py (+38 -21)

📄 Description

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://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7162037146).

AI-assisted (Claude Code)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1795 **Author:** [@abnalstlll-byte](https://github.com/abnalstlll-byte) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/user-sgpr-census-ms-technique` --- ### 📝 Commits (1) - [`1e0554d`](https://github.com/ubiquitarianism/leonida/commit/1e0554da8f81d2adcd5e6c4ec5049dddf6b49a6c) user_sgpr_census: support MS stage techniques and pairing with PS (USER-SGPR-CENSUS-MS-TECHNIQUE) ### 📊 Changes **2 files changed** (+67 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_user_sgpr_census.py` (+29 -1) 📝 `tools/user_sgpr_census.py` (+38 -21) </details> ### 📄 Description ### 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://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7162037146). AI-assisted (Claude Code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1806
No description provided.