glb_inspect: exclude invalid POSITION bounds from model extents #1748

Merged
kirigayakazima merged 1 commit from upstream-pr/1748 into main 2026-11-28 19:28:37 +00:00
kirigayakazima commented 2026-11-25 11:04:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-25T11:04:12Z.


Claimed in the coordination issue as: GLB-INSPECT-POSITION-BOUND-VALIDITY

What and why

An inverted or oversized POSITION bound could be reported as complete. An overflowing JSON exponent could prevent writing the entire JSON report. Both bounds now need exactly three finite numbers with ordered ranges. Good primitives still contribute to the aggregate and missing or invalid bounds mark it partial.

Tested

Two synthetic tests mix a good primitive with inverted, extra-component or boolean bounds, and pass an overflowing exponent through the GLB JSON parser and strict JSON report serialization.

  • python -I tests/test_glb_inspect.py on Windows with Python 3.14.7 ran 38 tests on this branch with one platform skip. The new tests also failed against the original inspector.
  • python -I scripts/check_no_game_data.py tools/glb_inspect.py tests/test_glb_inspect.py and git diff --check passed.
  • The shared base at bcaa13da passed 6,287 semantic tests across 488 files.

GPUs tested: N/A (CPU-only metadata inspection).
AI-assisted: Yes.

Checklist

  • Based on current upstream main.
  • One topic.
  • All test inputs are synthetic. No game data, keys or decryption.
  • Translator contract table: N/A.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5490086390 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1748). Originally posted by [kirigayakazima](https://github.com/kirigayakazima) on 2026-11-25T11:04:12Z. --- Claimed in the coordination issue as: [GLB-INSPECT-POSITION-BOUND-VALIDITY](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7160388047) ### What and why An inverted or oversized POSITION bound could be reported as complete. An overflowing JSON exponent could prevent writing the entire JSON report. Both bounds now need exactly three finite numbers with ordered ranges. Good primitives still contribute to the aggregate and missing or invalid bounds mark it partial. ### Tested Two synthetic tests mix a good primitive with inverted, extra-component or boolean bounds, and pass an overflowing exponent through the GLB JSON parser and strict JSON report serialization. - `python -I tests/test_glb_inspect.py` on Windows with Python 3.14.7 ran 38 tests on this branch with one platform skip. The new tests also failed against the original inspector. - `python -I scripts/check_no_game_data.py tools/glb_inspect.py tests/test_glb_inspect.py` and `git diff --check` passed. - The shared base at `bcaa13da` passed 6,287 semantic tests across 488 files. GPUs tested: N/A (CPU-only metadata inspection). AI-assisted: Yes. ### Checklist - [x] Based on current upstream main. - [x] One topic. - [x] All test inputs are synthetic. No game data, keys or decryption. - Translator contract table: N/A.
lixonik commented 2026-11-25 11:19:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-25T11:19:54Z.

Review: COMMENTED


Independent check at "855f2ef8". Windows: 37 tests reported, 1 platform skip. The mixed valid/invalid bounds and strict JSON serialization regressions passed. This also passed in the combined inspector tree with the other four PRs applied.

AI-assisted review and CPU-only testing with synthetic inputs.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6056671646 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1748#pullrequestreview-6056671646). Originally posted by [lixonik](https://github.com/lixonik) on 2026-11-25T11:19:54Z. **Review:** COMMENTED --- Independent check at "855f2ef8". Windows: 37 tests reported, 1 platform skip. The mixed valid/invalid bounds and strict JSON serialization regressions passed. This also passed in the combined inspector tree with the other four PRs applied. AI-assisted review and CPU-only testing with synthetic inputs.
whoalin1 commented 2026-11-25 11:25:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-25T11:25:26Z.


Independent verification (Windows, Python 3.11.9): _bbox now requires exactly 3 components, non-bool ints or finite floats (isfinite kills 1e999->inf), ordered min<=max; invalid bounds excluded + aggregate marked partial. test_glb_inspect.py 38 OK (6 env skips); both new tests pass; compileall + line-endings + check_no_game_data + diff-check clean. Non-blocking nit: returns accessor min/max lists by reference rather than copies — no downstream mutation observed. AI-assisted verification.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7161027497 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1748#issuecomment-7161027497). Originally posted by [whoalin1](https://github.com/whoalin1) on 2026-11-25T11:25:26Z. --- Independent verification (Windows, Python 3.11.9): `_bbox` now requires exactly 3 components, non-bool ints or finite floats (isfinite kills 1e999->inf), ordered min<=max; invalid bounds excluded + aggregate marked partial. `test_glb_inspect.py` 38 OK (6 env skips); both new tests pass; compileall + line-endings + check_no_game_data + diff-check clean. Non-blocking nit: returns accessor min/max lists by reference rather than copies — no downstream mutation observed. AI-assisted verification.
MoonEyes commented 2026-11-28 19:28:34 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T19:28:34Z.


Red/green: tests/test_glb_inspect.py fails 4 assertions on main (invalid POSITION bounds still counted in the extents) and passes with the PR merged, on GitHub Actions Linux and natively on Windows.
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7244571918 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1748#issuecomment-7244571918). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T19:28:34Z. --- Red/green: tests/test_glb_inspect.py fails 4 assertions on main (invalid POSITION bounds still counted in the extents) and passes with the PR merged, on GitHub Actions Linux and natively on Windows. Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure. AI-assisted (Claude Code, Claude Opus 5.5)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1748
No description provided.