Skip to content

bvh_slot_check: unpack model_geometries() with *_, not a fixed five fields - #8421

Closed
Borooooo wants to merge 1 commit into
ItsNotRexed:mainfrom
Borooooo:fix/bvh-slot-check-geometries
Closed

Borooooo wants to merge 1 commit into
ItsNotRexed:mainfrom
Borooooo:fix/bvh-slot-check-geometries

Conversation

@Borooooo

Copy link
Copy Markdown

bvh_match.model_geometries() returns six fields since #6330 (render bucket added), but bvh_slot_check.match_exports() still unpacked five, so every census run stops with ValueError: too many values to unpack (expected 5). It is the only caller that unpacks by arity (bvh_match itself indexes).

-            for mesh, model, _, _, _ in M.model_geometries(item):
+            for mesh, model, *_ in M.model_geometries(item):

*_ takes the mesh and model and ignores the rest, so the next field added to model_geometries() cannot break this caller again.

Overlap: the same fix is already open as #6513 and #7954 (which also adjusts the test). Whichever lands first wins; close this one if either of those is merged.

Tested (Windows 11, Python 3.12.4, no GPU or game files needed):

  • python -I tests/test_bvh_slot_check.py: 9/9 OK (3 errors on main at dde82f2)
  • python -I tests/test_bvh_match.py: 41/41 OK
  • python -I scripts/check_no_game_data.py tools/bvh_slot_check.py: clean

AI-assisted.

🤖 Generated with Claude Code

…ields

#6330 added the render bucket as a sixth field of bvh_match.model_geometries(),
and match_exports() still unpacked five, so every census run stopped with
"too many values to unpack". Take the mesh and model and ignore the rest, so the
next field added there cannot break this caller again.

Fixes the 3 errors in tests/test_bvh_slot_check.py on main (dde82f2); the same
fix is open as #6513 and #7954. AI-assisted; tested with
python -I tests/test_bvh_slot_check.py and tests/test_bvh_match.py on Windows 11,
no GPU needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@faizanzatro

Copy link
Copy Markdown

Reviewed commit 9a3ee5d2:

Using for mesh, model, *_ in M.model_geometries(item): prevents ValueError: too many values to unpack whenever additional geometry metadata fields are yielded by model_geometries().

Clean and forward-compatible fix. LGTM!

@leoleahy leoleahy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-assisted.

Independently verified 9a3ee5d2 on Windows 11 (Python 3.14.8, CPU-only, no game data):

  • Clean merge check against upstream/main (dde82f27): git merge-tree --write-tree exit 0, git diff --check exit 0, python -I -m compileall -q tools/bvh_slot_check.py exit 0.
  • python -I tests/test_bvh_slot_check.py: 9/9 OK on HEAD 9a3ee5d2.
  • Negative control (reverted tools/bvh_slot_check.py to base dde82f27): 3 errors (ValueError: too many values to unpack (expected 5, got 6)).
  • Diff review: unpacking for mesh, model, *_ in M.model_geometries(item): fixes the 6-tuple breakage cleanly and avoids future tuple-arity fragility (maintainer note: overlaps #8013, which unpacks 6 explicit fields).

@Grimkeh

Grimkeh commented Nov 23, 2026

Copy link
Copy Markdown

Tested 9a3ee5d2b on Linux (CPython 3.13), CPU-only, synthetic inputs, no game files:

  • Red on main: model_geometries yields 6 fields; for mesh, model, _, _, _ in … raises ValueError: too many values to unpack.
  • Green on this head: *_ absorbs the extra fields; python -I tests/test_bvh_slot_check.py → 9/9 OK.

Pass.

AI-assisted (Cursor / Composer).

@rideinstead

Copy link
Copy Markdown

TEST validation — Approve

Validated on CPU (no GPU, no game files).

What changed: tools/bvh_slot_check.py — for mesh, model, *_ in M.model_geometries(item): replaces fixed five-field unpack with *_ to absorb trailing fields. model_geometries() returns six fields since PR #6330 (render bucket added), causing ValueError: too many values to unpack (expected 5) on every census run.

Tests: Fixes 3 pre-existing errors in tests/test_bvh_slot_check.py on main (dde82f2). tests/test_bvh_match.py (41/41 OK) remains green as regression check.

Verification:

  • Author (Windows 11, Python 3.12.4): test_bvh_slot_check.py 9/9 OK (was 3 errors on main), test_bvh_match.py 41/41 OK, check_no_game_data.py clean
  • leoleahy (Windows 11, Python 3.14.8, CPU-only): 9/9 OK, negative control (reverted) = 3 errors confirming the fix resolves them
  • Grimkeh (Linux, CPython 3.13, CPU-only): red on main, green on head, 9/9 OK

Note: Same fix is open as #6513 and #7954 (maintainer references #8013 which unpacks 6 explicit fields). Whichever lands first wins; this one should be closed if another merges first.

Recommendation: Approve / merge. CPU-validatable, negative control confirms the fix, cross-platform verified.

@Borooooo Borooooo closed this by deleting the head repository Nov 23, 2026
@Atomic258

Copy link
Copy Markdown
Contributor

Tested 9a3ee5d2 on Windows Server 2022, CPython 3.13.12: pass

  • python -I tests/test_bvh_slot_check.py -> OK
  • Negative control (tools/bvh_slot_check.py swapped to upstream/main): FAILED (errors=3)

git diff --check clean; python -m compileall -q exit 0. No game files, no GPU. AI-assisted (Devin).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants