mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:00:52 +01:00
[PR #2294] tools/shader_diff.py: deduplicate --ops and guard generate_program/run_suite bounds #2297
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#2297
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/2294
Author: @kirigayakazima
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/shader-diff-safety📝 Commits (1)
fca1c1btools/shader_diff.py: deduplicate --ops and validate generator/suite bounds📊 Changes
2 files changed (+51 additions, -4 deletions)
View changed files
📝
tests/test_shader_diff_exit.py(+32 -0)📝
tools/shader_diff.py(+19 -4)📄 Description
Claimed in the coordination issue as: SHADER-DIFF-DEDUP-OPS-AND-EMPTY-INPUT-GUARDS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7192589921)
What and why
--opspreserving first-seen order inmain()andrun_suite()(tools/shader_diff.py) so duplicate op names do not alter generation weights or replay strings.n_ops >= 0and non-empty matchingtemplatesupfront ingenerate_program(), raisingValueError.programs >= 1,max_ops >= 1,start >= 0, andlimit >= 1(when set) upfront inrun_suite(), raisingValueError.tests/test_shader_diff_exit.py.Tested
python -I tests/test_shader_diff_exit.py -v: 20 passed, 0 failed (detachedupstream/mainbaseline with only the updated test file fails with 2 failures).python -I tools/shader_diff.py --self-test: passed (canaries: match ok, mismatch detected, skip counted).python -I tests/test_ci_registration.py: 16 passed.python -I tests/test_text_write_line_endings.py: 3 passed.python -I scripts/check_no_game_data.py,python -I -m compileall -q tools/shader_diff.py tests/test_shader_diff_exit.py, andgit diff --cached --check: passed.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.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.