bvh_groups: validate scan bounds and --json upfront, use same_report_path, catch write OSError (BVH-GROUPS-GUARDS-AND-IO) #1599
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!1599
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/bvh-groups-guards-and-io"
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:
BVH-GROUPS-GUARDS-AND-IO(unclaimed — coordination issue #14 is at GitHub's 2,500-comment cap with no successor open issue yet, and 0 open PRs touchtools/bvh_groups.py).Summary
start,limit, andmax_inflateinscan()before the empty-archive fast path so out-of-rangestarton empty files,limit <= 0,max_inflate <= 0, andboolvalues raiseValueError(previouslylimit=0scanned the whole archive andmax_inflate=0/Truecrashed withstruct.errorinbvh_index.classify).archiveand--jsonbefore scanning (reject empty/whitespace strings, directories, trailing separators, and missing parent directories) and use the sharedreport_paths.same_report_path()guard instead of rawos.path.samefile().OSErrorfromwrite_json_report()inmain()and publish--jsonbefore printing stdout (exiting with code 2 and one stderr line instead of a traceback), and enforceallow_nan=Falseinwrite_json_report().Verification
python3 -W error -I tests/test_bvh_groups.py -v: 16/16 passed.python3 -I tests/test_text_write_line_endings.py: 3/3 passed.python3 -I scripts/check_no_game_data.py tools/bvh_groups.py tests/test_bvh_groups.py: passed.python3 -m compileall -q tools/bvh_groups.py tests/test_bvh_groups.py: passed.tests/test_bvh_groups.pyagainst unpatchedmain:tools/bvh_groups.py):failures=11, errors=3across all new regression tests.AI-assisted: yes
GPUs tested: none (CPU-only Python BVH descriptor tool; synthetic streams only, no game data)
Hi @IlyassRS3, thanks for this (claimed in #1608 as BVH-GROUPS-GUARDS-AND-IO). It overlaps with #931: #931 (claimed as DRAFT-274, carrying
EspadaHD's commit) already makes two of this pull request's three changes: it uses the sharedreport_paths.same_report_pathand turns anOSErrorfromwrite_json_reportinto exit status 2 with one stderr line. If #931 lands first, please rebase this one so only thescan()argument checks, the up-front--jsonvalidation andallow_nan=Falseremain. If this one lands first, please keep #931's test that a./alias of the archive is refused, so #931 can then be closed.AI-assisted (Claude Code, Claude Opus 5.5)
Hi @IlyassRS3, thanks for this pull request. It currently conflicts with
main(conflicting file(s):tests/test_bvh_groups.py,tools/bvh_groups.py), so it carries theneeds rebaselabel. CONTRIBUTING.md asks authors to rebase their branch onmain; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.AI-assisted (Claude Code, Claude Opus 5.5).
#1599 | head 38f9a734b93e28e5d9562237716c6ff8920f8116 (merged cleanly with main a8465211fb) |
python -I tests/test_bvh_groups.py+python -I tests/test_bcpack_tool.py| red on main:FAILED (failures=12, errors=2)(bvh_groups.scanaccepted negative/zero/booleanstart,limit, andmax_inflateinputs — raisingstruct.erroronmax_inflate=0|True—mainranscan()before validating--json, printed summary lines before--jsonwrite failures, and allowedNaNinwrite_json_report) | green on PR+main:18 ran, OK(test_bvh_groups.py) +test_bcpack_tool.pyOK| Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yesAudited the rebased
38f9a734b9diff (tools/bvh_groups.pyandtests/test_bvh_groups.pyafter#931landed onmain) on Windows 11, verifying upfrontstart/limit/max_inflateinteger guards (type(...) is not intrejectingbool), pre-scan--jsondirectory/parent/empty-path validation,allow_nan=Falseinwrite_json_report, and stdout suppression whenwrite_json_reportfails. Also verifiedtests/test_ci_registration.py,tests/test_text_write_line_endings.py, andscripts/check_no_game_data.py.Tested
38f9a734bmerged (no commit) withmain829530dbd: Python 3.12.4, Windows 11 10.0.26300, CPU only.check_no_game_data.pyis clean.tests/test_bvh_groups.py, 18 tests pass.tools/bvh_groups.pyback tomain, 14 failures (ValueError not raised).No blocker from my side.
AI-assisted (Claude Code).
Merged after TheGeogeo's red/green check (check) (Windows, Python tests, no GPU needed) and a local re-check here. Merged after local re-verification: this PR merged onto
maine6546fe78 without conflict, and its test file(s) (tests/test_bcpack_tool.py,tests/test_bvh_groups.py) pass there. Earlier today the same tests failed onmainwithout the PR (red/green) and a bundle with other open PRs showed no new failures.check_no_game_data.pyis clean. Windows 11, Python 3.14; no GPU needed for these tests.AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.