valu_int_diff: report a bad --max-ops/--programs as a usage error #1621
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!1621
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/valu-arg-guards"
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 successfully merged and closed
Item ID:
VALU-ARG-GUARDS(new item; the coordination issue #14 is at GitHub's 2,500-comment cap, so the claim lives here)Claimed as:
VALU-ARG-GUARDS---max-ops 0is reported asharness errorand--programs 0exits 0 with0 programs. Reproduced on 42537e7b.What and why
valu_int_diffletrandint(1, 0)fail through its harness-error path, so a plain usage mistake read like a broken harness, and--programs 0exited 0 after running nothing (0 programs (seed 1): 0 pass, 0 mismatch). Both are now rejected inmain()right afterparse_argswith--programs must be at least 1/--max-ops must be at least 1throughap.error(exit 2, argument-style wording, no harness wording). The docstring's exit-code line names usage errors.Tested
pytest tests/test_valu_int_diff.py -qwith the tool at 42537e7b: 4 failed, 5 passed.With this branch: 5 passed, 4 subtests passed.
CLI:
--max-ops 0and--programs -2now exit 2 with the argument message;--programs 3 --max-ops 4still exits 0 with3 pass.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.Reviewed 4895f4755: ran tests/test_valu_int_diff.py on the PR (5 tests OK) and on main with the PR's test file copied in (the new tests fail on main as intended: silent empty runs and "harness error" become exit-2 usage errors); probed the CLI on both trees: bad counts exit 2 with "must be at least 1", valid runs byte-identical; compileall clean. No findings.
AI-assisted review.
Recommendation: Merge
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).
#1621 | head 4895f47555da59e2dea499ba93b11aa7873e5877 (merged cleanly with main 1bc055e6c2) |
python -I tests/test_valu_int_diff.py| red on main:FAILED (failures=4)(--max-ops 0and-1reportedharness error: empty range in randrange, while--programs 0and-1exited0silently) | green on PR+main:5 tests OK| Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yesAudited
tools/valu_int_diff.pyandtests/test_valu_int_diff.pyon Windows 11, verifyingargs.programs < 1andargs.max_ops < 1raiseap.error(...)(exit2) before--self-testorrun_fuzz, while preserving--programs 1 --max-ops 1and 100-program seeded runs. Also verifiedtests/test_ci_registration.py(18 OK),tests/test_text_write_line_endings.py(3 OK), andscripts/check_no_game_data.py.Tested
4895f4755merged (no commit) withmain829530dbd: Python 3.12.4, Windows 11 10.0.26300, CPU only.check_no_game_data.pyis clean.tests/test_valu_int_diff.py, 5 tests pass.tools/valu_int_diff.pyback tomain, 4 failures (0 != 2).No blocker from my side.
AI-assisted (Claude Code).
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).
Tested
4895f4755merged (no commit) withmain7c330c76d: Python 3.12.4, Windows 11 10.0.26300, CPU only.tests/test_valu_int_diff.pygives 5 tests OK.tools/valu_int_diff.pyback tomain,test_rejects_nonpositive_count_argumentsfails for--max-opsand--programsat 0 and -1 (4 subtests,0 != 2).main's own version gives 3 tests OK.check_no_game_data.pyis clean.AI-assisted (Claude Code).
Merging. Head
4895f4755has red/green verdicts from reviewers other than the author (above), merges cleanly withmain545f610fa, does not force a rebase of #2566, and carries a claim ID. Remaining main CI reds (translator-testsmesh,semantic-testsf16) are pre-existing. Merged by MoonEyes.AI-assisted (Claude Code).