f16misc_diff: reject a zero or negative --max-ops and --programs #1619
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1619"
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?
Imported from ubiquitarianism/leonida. Originally posted by xel1uz on 2026-11-25T06:11:24Z.
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.Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T17:24:04Z.
Reviewed
1ded3b4: rejects --max-ops/--programs below 1 in tools/f16misc_diff.py before any stage (argparse exit 2); the random stage is now always appended; six new CommandLine tests. Verified on both trees (no GPU needed): tests/test_f16misc_diff.py passes on the PR tree (33) and main (27); the PR's test file on main fails 5 of the 6 new tests as intended. On main --programs 0 exits 0 having done nothing and --max-ops 0 dies with a ValueError traceback; on the PR every such invocation exits 2 with a usage error and runs no work. A seeded run is byte-identical on both trees; no other repo file calls the tool. No findings.AI-assisted review.
Recommendation: Merge
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T03:02:34Z.
Hi @xel1uz, thanks for this pull request.
CONTRIBUTING.md asks contributors to claim their work in the coordination issue ("Coordinating who works on what", currently #1608) before opening a pull request: post
claiming: <ID>there, or a one-line description if the item is not listed yet, and put the ID in the pull request. I could not find a claim from you for this one.The claim matters because "it is claimed in the coordination issue by the pull request's author" is the first item on the maintainers' checklist for a mergeable pull request, and because it lets others see that the work is taken before they write it a second time.
Could you post the claim in #1608 and put its ID (or a link to it) on the pull request's "Claimed in the coordination issue as:" line? If you already claimed it in another form, a link to your comment is enough.
AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T20:43:30Z.
#1619 | head
1ded3b4d8e(merged cleanly with main1bc055e6c2) |python -I tests/test_f16misc_diff.py| red on main:FAILED (failures=3, errors=2)(--max-ops 0and-3crashed inrandrange, while--programs 0and-1exited0without running random programs) | green on PR+main:33 tests OK| Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yesAudited
tools/f16misc_diff.pyandtests/test_f16misc_diff.pyon Windows 11, verifying upfrontargs.max_ops < 1andargs.programs < 1ap.error(...)usage checks (exit2, before--list-opsor sweep/random stages) and optionalargvparameter support inmain(argv=None). Also verifiedtests/test_ci_registration.py(18 OK),tests/test_text_write_line_endings.py(3 OK), andscripts/check_no_game_data.py.Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T00:17:06Z.
Tested
1ded3b4d8merged (no commit) withmain829530dbd: Python 3.12.4, Windows 11 10.0.26300, CPU only.check_no_game_data.pyis clean.tests/test_f16misc_diff.py, 33 tests pass.tools/f16misc_diff.pyback tomain, the new usage checks fail (exit0 != 2, e.g.--list-ops --programs 0).No blocker from my side.
AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T11:51:56Z.
Tested green here earlier on this same head (see my comment above). The only thing missing for a merge is your claim in the coordination issue #2570.
AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T17:11:14Z.
Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, main
4364a4fa6, PR head1ded3b4d8: red 5 failures / green 33 OKgit merge-tree). Reviews: none. No game data in the diff. Skipped on the merge: none.test_max_ops_negative_is_rejected,test_max_ops_zero_is_rejected,test_programs_negative_is_rejected,test_programs_zero_is_rejected,test_validation_comes_before_list_ops.f16misc_diff.--programs 0is now refused, so the random stage can no longer be skipped that way (docstring updated accordingly).Verdict: READY
AI-assisted: Claude Code
Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-29T18:28:08Z.
Thank you! Merged into
mainwith a merge commit. It was verified ready on its current head (1ded3b4d8) by OreoFR's Mac agent (macOS, red/green on main + PR); see the verification comment above. (AI-assisted, posted for DadaCap.)