mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:05:53 +01:00
[PR #2269] lds_fuzz: guard --model-only/--keep/--only flags and enforce UTF-8 subprocess I/O #2272
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#2272
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/2269
Author: @kirigayakazima
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/lds-fuzz-cli-safety📝 Commits (1)
9a678eflds_fuzz: guard --model-only/--keep/--only flags and enforce UTF-8 subprocess I/O📊 Changes
2 files changed (+113 additions, -9 deletions)
View changed files
📝
tests/test_lds_fuzz.py(+97 -0)📝
tools/lds_fuzz.py(+16 -9)📄 Description
Claimed in the coordination issue as: LDS-FUZZ-CLI-KEEP-MODEL-ONLY-AND-ENCODING-SAFETY (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7191235314)
What and why
tools/lds_fuzz.pypreviously:main()with noargvparameter and skipped validating--keep/--perturb/--negative-control/--minimizewhenever--model-onlywas also passed.--keep ""or a regular file path for--keep, and ignored negative indices mixed into--only(such as0,-1).subprocess.run(..., text=True)intranslate()andrun_gpu()withoutencoding="utf-8", errors="replace"and readindex.jsonwithout"utf-8-sig".This adds
argv=Nonetomain(), enforces--oracle hw(without--model-only) and directory/non-empty validation for--keep, rejects negative--onlyindices, sets UTF-8 encoding/BOM handling intranslate()andrun_gpu(), and adds unit coverage intests/test_lds_fuzz.py.Tested
python -I tests/test_lds_fuzz.py -v(40 passed)upstream/mainbaseline negative control: failed with the new CLI tests before the fixpython -I tests/test_ci_registration.py,python -I tests/test_text_write_line_endings.py,python -I scripts/check_no_game_data.py,python -I -m compileall -q, andgit diff --cached --checkGPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.