mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:20:53 +01:00
[PR #1617] mode_diff: reject empty/unjudged runs, invalid counts, and malformed --ops; accept argv (MODE-DIFF-CLI-AND-EMPTY-RUN-GUARDS) #1631
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#1631
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/1617
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/mode-diff-cli-and-empty-run-guards📝 Commits (1)
741b5femode_diff: reject empty/unjudged runs, invalid counts, and malformed --ops; accept argv📊 Changes
2 files changed (+94 additions, -4 deletions)
View changed files
📝
tests/test_mode_diff.py(+68 -0)📝
tools/mode_diff.py(+26 -4)📄 Description
Item ID:
MODE-DIFF-CLI-AND-EMPTY-RUN-GUARDS(unlisted; coordination issue #14 is at GitHub's 2,500-comment cap with no open successor at submission time, and no open PR touchestools/mode_diff.py).What changed
tools/mode_diff.py,main,run_suite,run_invariance):--no-sweep --programs 0 --invariance 0and runs where every program wasunjudgedprinted0/0 judged programs match, 0 mismatchand exited0(false pass). Now empty configurations are refused upfront andjudged == 0exits2.--programs < 0,--invariance < 0, and--max-ops < 1(previously--max-ops 0crashed insiderng.randint(1, max_ops)), and validateprograms/max_opsinrun_suite()andrun_invariance()against negative andboolvalues.--opsparsing and acceptargv=Noneinmain(argv=None): reject empty/blank/comma-only/trailing-comma--ops(previously--ops ""and--ops ","silently ran all ops or fell back to empty list) and deduplicate repeated op names so sweep/random counts aren't skewed.tests/test_mode_diff.py): 4 new tests inCliGuardscovering all of the above (no game files, no GPU).Verification
python3 -W error -I tests/test_mode_diff.py -v: 20 passedpython3 -W error -I tests/test_text_write_line_endings.py: passedpython3 -I scripts/check_no_game_data.py tools/mode_diff.py tests/test_mode_diff.py: cleanpython3 -m compileall -q tools/mode_diff.py tests/test_mode_diff.py: cleanCliGuardssuite oftests/test_mode_diff.pyagainst unpatchedmain:tools/mode_diff.py): 16 failures, 3 errors across the 4 CLI tests.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.