mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:25:53 +01:00
[PR #713] [MERGED] OLD-7087: restore old upstream PR 7087 - audit_shader4_regs: --limit must be at least 1; 0 audited nothing and printed a zero report #750
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#750
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/713
Author: @aslan2142
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142
Base:
main← Head:audit-shader4-limit-zero📝 Commits (1)
165402daudit_shader4_regs: --limit must be at least 1; 0 audited nothing and printed a zero report📊 Changes
2 files changed (+41 additions, -20 deletions)
View changed files
📝
scripts/audit_shader4_regs.py(+14 -5)📝
tests/test_audit_shader4_regs.py(+27 -15)📄 Description
Claimed in the coordination issue as: OLD-7087 https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7131734303
Restoration of my original pull request, old upstream PR 7087 in
ItsNotRexed/Leonida, which was closed unmerged when that repository went private on 2026-11-23 (old numbers link nowhere now). Rebased onto main at21625bca8c. The one commit cherry-picked cleanly and is unchanged. The tool is stillscripts/audit_shader4_regs.py, as it was in the original. Main has no shared helper for checking that a count is positive, so the PR keeps its ownshader_counttype function, written like thebyte_countintools/anim_index.py.What and why
--limit 0passes the non-negative check, andfiles[:0]keeps no listing.=== CS (0 shaders; ...) ===for every stage and exits 0. A typo gives an empty audit that looks real.--limitnow takes ashader_counttype: a value below 1 or a non-number is an argparse error that names the option, with exit 2 and no report or JSON written.audit()raisesValueErrorfor a limit below 1, so callers that bypass the command line get the same check.None) still audits everything.Tested
Linux, Python 3.14.10, CPU only, synthetic inputs (hand-written
.slistings in temporary folders, no game files).python -I tests/test_audit_shader4_regs.py: 20 tests, OK. On main the same 20 pass, but with this PR's test changes 5 subtests fail (--limit 0,-1andx;audit()with 0 and -1).--limit 0,-1andxexit 2 with nothing on stdout and no JSON.--limit 1on a folder with two listings audits one.--limit 2and--limit 3audit both.--limit 0to leave the listing out. It now adds a second listing that sorts first and uses--limit 1.python -m compileall -q tools tests scripts,git diff --checkandpython -I scripts/check_no_game_data.pyon the two changed files: all clean.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)AI-assisted (Claude Code, Claude Opus 5.5).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.