mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:50:51 +01:00
[PR #1615] cvt_diff: reject empty/zero-program runs, invalid counts, and malformed --ops; accept argv (CVT-DIFF-CLI-AND-EMPTY-RUN-GUARDS) #1629
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#1629
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/1615
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/cvt-diff-cli-and-empty-run-guards📝 Commits (1)
266b1a9cvt_diff: reject empty/zero-program runs, invalid counts, and malformed --ops; accept argv📊 Changes
2 files changed (+89 additions, -7 deletions)
View changed files
📝
tests/test_cvt_diff.py(+63 -0)📝
tools/cvt_diff.py(+26 -7)📄 Description
Item ID:
CVT-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/cvt_diff.py).What changed
tools/cvt_diff.py,main,run_suite):--no-sweep --programs 0and--no-sweep --programs 0 --exhaustive-f16 --ops v_cvt_flr_i32_f32(an f32 op where the f16 exhaustive stage generates zero programs) printed0/0 programs matchand exited0(false pass). Now empty configurations are refused upfront and anytotal_run == 0run exits2.--programs < 0and--max-ops < 1(previously--max-ops 0crashed insiderng.randint(1, max_ops)), and validateprograms/max_opsinrun_suite()against negative andboolvalues.--opsparsing and acceptargv=Noneinmain(argv=None): reject empty/blank/trailing-comma--ops(previously--ops ""silently ran all 8 ops) and deduplicate repeated op names so sweep/grid/random counts aren't skewed.tests/test_cvt_diff.py): 4 new tests inCliGuardscovering all of the above (no game files, no GPU).Verification
python3 -W error -I tests/test_cvt_diff.py -v: 30 passedpython3 -W error -I tests/test_text_write_line_endings.py: passedpython3 -I scripts/check_no_game_data.py tools/cvt_diff.py tests/test_cvt_diff.py: cleanpython3 -m compileall -q tools/cvt_diff.py tests/test_cvt_diff.py: cleanCliGuardssuite oftests/test_cvt_diff.pyagainst unpatchedmain:tools/cvt_diff.py): 11 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.