mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:30:53 +01:00
[PR #1619] f16misc_diff: reject a zero or negative --max-ops and --programs #1633
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#1633
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/1619
Author: @xel1uz
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/f16misc-arg-guards📝 Commits (1)
1ded3b4f16misc_diff: reject a zero or negative --max-ops and --programs📊 Changes
2 files changed (+62 additions, -7 deletions)
View changed files
📝
tests/test_f16misc_diff.py(+49 -1)📝
tools/f16misc_diff.py(+13 -6)📄 Description
Item ID:
F16MISC-ARG-GUARDS(new item; the coordination issue #14 is at GitHub's 2,500-comment cap, so the claim lives here)Claimed as:
F16MISC-ARG-GUARDS---max-ops 0dies in numpy's randint and--programs 0exits 0 having run no random program. Reproduced on42537e7b.What and why
f16misc_diffvalidated neither of its two count options, so--max-ops 0ended inValueError: empty range in randint(1, 0)fromrandom.randintand--programs 0finished with exit 0 and nothing but sweep lines. Both are now rejected inmain()right afterparse_args, before the sweep,--list-opsand--self-test:--max-ops must be at least 1and--programs must be at least 1, viaap.error(exit 2, usage line, no traceback). The dead--programs > 0stage gate and the docstring's exit-code line are updated; the smallest valid run is byte-identical before and after.Tested
pytest tests/test_f16misc_diff.py -qwith the tool at42537e7b: 5 failed, 28 passed - only the new guard cases fail, the valid-run case passes on both sides.With this branch: 33 passed in 39.8s.
CLI on the branch:
--max-ops 0and--programs 0each print the message and exit 2;--self-testand--list-opsstill exit 0.git diff --checkclean;python3 -I scripts/check_no_game_data.pyclean on the changed files.GPUs tested: n/a - CPU only, no Vulkan device involved.
AI-assisted: Yes.
Checklist
main(42537e7b) and merges cleanly.docs/design.md- not applicable, no translator change.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.