glb_inspect: diagnose broken skin joint and bind matrix references #1745

Merged
leonida/mandy
kirigayakazima merged 2 commits from codex/glb-inspect-skin-references into main 2026-11-28 14:56:23 +00:00

Pull request successfully merged and closed

kirigayakazima commented 2026-11-25 11:03:59 +00:00

Claimed in the coordination issue as: GLB-INSPECT-SKIN-REFERENCES

What and why

A skin with duplicate joints or a broken skeleton link looked identical to a healthy skin with the same joint count. The inspector now identifies invalid joint slots, missing skeleton or accessor references, non-MAT4 accessors and insufficient matrix counts. The optional inverse bind matrix accessor can still be omitted. glTF skin specification

Tested

The synthetic fixture covers duplicate joints, malformed and unresolved node indices, missing accessors, wrong matrix types, short counts and a valid accessor with extra matrices.

  • python -I tests/test_glb_inspect.py on Windows with Python 3.14.7 ran 37 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.
Claimed in the coordination issue as: [GLB-INSPECT-SKIN-REFERENCES](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7160388047) ### What and why A skin with duplicate joints or a broken skeleton link looked identical to a healthy skin with the same joint count. The inspector now identifies invalid joint slots, missing skeleton or accessor references, non-MAT4 accessors and insufficient matrix counts. The optional inverse bind matrix accessor can still be omitted. [glTF skin specification](https://github.com/KhronosGroup/glTF/blob/main/specification/2.0/Specification.adoc#skins) ### Tested The synthetic fixture covers duplicate joints, malformed and unresolved node indices, missing accessors, wrong matrix types, short counts and a valid accessor with extra matrices. - `python -I tests/test_glb_inspect.py` on Windows with Python 3.14.7 ran 37 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 reviewed 2026-11-25 11:19:47 +00:00
lixonik left a comment
No description provided.
Independent check at "0eed8e40". Windows: 36 tests reported, 1 platform skip. The extra CLI check uncovered one invalid inverse-bind accessor that the new diagnostics miss. Details inline. AI-assisted review and CPU-only testing with synthetic inputs.
kirigayakazima reviewed 2026-11-27 12:11:43 +00:00
lixonik reviewed 2026-11-27 15:50:22 +00:00
lixonik left a comment
No description provided.
Re-verified at `2d8bce897` (merged cleanly onto `main` `ec91d695c`). - Confirmed the prior finding is resolved: `_skin_report()` now requires `componentType == 5126` (`FLOAT`) on `inverseBindMatrices` accessors and rejects integer `MAT4` accessors (verified with `componentType: 5123` and `5126`, plus the new regression test). - Windows 11, Python 3.12: `python -I -B tests/test_glb_inspect.py -v` passed (37 tests, 1 expected Windows POSIX-permission skip); `scripts/check_no_game_data.py` and `git diff --check` clean. - No remaining findings. AI-assisted.
zmasi commented 2026-11-28 11:25:15 +00:00

#1745 | head 2d8bce8970019cb87afce5cd6c7dbe3a2434f8f4 (merged cleanly with main 4a54aedcb) | python -I tests/test_glb_inspect.py | red on main: FAILED (errors=2, skipped=6) (KeyError: 'issues' on broken skin joint, skeleton, and inverseBindMatrices references) | green on PR+main: 38 tests OK (skipped=6) | Windows 11, Python 3.12.10 | AI-assisted: yes

Audited _skin_report and format_report in tools/glb_inspect.py (validating non-empty joints, missing/duplicate joint node indices, skeleton node index, and inverseBindMatrices accessor MAT4 type, FLOAT (5126) componentType, and count >= joint_count). Also verified clean merge (0 conflicts) and combined execution with #1744 (39 tests OK (skipped=6)), plus tests/test_ci_registration.py (18 OK), tests/test_text_write_line_endings.py (3 OK), and scripts/check_no_game_data.py.

#1745 | head 2d8bce8970019cb87afce5cd6c7dbe3a2434f8f4 (merged cleanly with main 4a54aedcb) | `python -I tests/test_glb_inspect.py` | red on main: `FAILED (errors=2, skipped=6)` (`KeyError: 'issues'` on broken skin joint, skeleton, and inverseBindMatrices references) | green on PR+main: `38 tests OK (skipped=6)` | Windows 11, Python 3.12.10 | AI-assisted: yes Audited `_skin_report` and `format_report` in `tools/glb_inspect.py` (validating non-empty `joints`, missing/duplicate joint node indices, `skeleton` node index, and `inverseBindMatrices` accessor `MAT4` type, `FLOAT (5126)` componentType, and `count >= joint_count`). Also verified clean merge (`0` conflicts) and combined execution with #1744 (`39 tests OK (skipped=6)`), plus `tests/test_ci_registration.py` (`18 OK`), `tests/test_text_write_line_endings.py` (`3 OK`), and `scripts/check_no_game_data.py`.
MoonEyes commented 2026-11-28 14:56:20 +00:00

Red/green: pytest tests/test_glb_inspect.py fails on main (2 failed, 30 passed, 6 skipped, 7 subtests passed) and passes on head 2d8bce897001 merged with main (32 passed, 6 skipped, 7 subtests passed).
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main d48a957bb in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)

Red/green: `pytest tests/test_glb_inspect.py` fails on main (2 failed, 30 passed, 6 skipped, 7 subtests passed) and passes on head 2d8bce897001 merged with main (32 passed, 6 skipped, 7 subtests passed). Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main d48a957bb in GitHub Actions: no new failure. AI-assisted (Claude Code, Claude Opus 5.5)
Sign in to join this conversation.
No description provided.