dot_diff: fail on skipped programs, reject invalid counts/empty --ops, and accept argv (DOT-DIFF-SKIPS-AND-CLI) #1613
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!1613
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/dot-diff-skips-and-cli"
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:
DOT-DIFF-SKIPS-AND-CLI(unlisted; coordination issue #14 is at GitHub's 2,500-comment cap with no open successor at submission time, and no open PR touchestools/dot_diff.py).What changed
main()(tools/dot_diff.py): unlikecvt_diff.py,div_fixup_diff.py, andmode_diff.py,dot_diff.pydid not tracktotal_skip, so a run where every generated program skipped translation exited0(false pass). Nowtotal_skipis tallied across stages and exits1withSKIPPED <N> program(s)when non-zero; a zero-program run exits2.--programs,--max-ops, and empty runs upfront:--programs < 0,--max-ops < 1(which previously crashed insiderng.randint(1, max_ops)), and--no-sweep --programs 0(which previously ran 0 programs and exited0) with exit2.randomstage when--programs 0is combined with sweep/grid.run_suite()against negative/boolprogramsand< 1/boolmax_ops.--opsparsing and acceptargv=Noneinmain(argv=None): reject empty/blank/trailing-comma--ops(previously--ops ""silently ran all 12 ops), trim whitespace around"gfx103x", and deduplicate repeated op names so sweep/grid/random weights aren't skewed.tests/test_dot_diff.py): 4 new tests inCliGuardscovering all of the above (no game files, no GPU).Verification
python3 -W error -I tests/test_dot_diff.py -v: 21 passedpython3 -W error -I tests/test_text_write_line_endings.py: passedpython3 -I scripts/check_no_game_data.py tools/dot_diff.py tests/test_dot_diff.py: cleanpython3 -m compileall -q tools/dot_diff.py tests/test_dot_diff.py: cleantests/test_dot_diff.pyagainst unpatchedmain:tools/dot_diff.py): 11 failures, 3 errors across the 21 tests (all 4 new tests fail on unpatchedmain).Tested
803575d2aon Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), againstmain42537e7b6(Python GPU differential tool; no campaign run):tests/test_dot_diff.py: 21 passed, 28 subtests passed at this head.main: 14 failed, 18 passed, 17 subtests — the skipped-program failure, count/--opsvalidation and argv handling are not there.dot_diffcampaign on the GPU; only the unit tests.AI-assisted; synthetic fixtures only, no game data.
Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18).
Targeted batch of 18 PRs (their tests, the tests importing the changed modules, the docs tests) on main 3ca0707: no new failure, Linux / Python 3.13.
AI-assisted (Claude Code, Claude Opus 5.5)