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

Open
github-bot wants to merge 2 commits from github-bot/gh-1745 into main AGit
Owner

@⁠kirigayakazima on GitHub · 2026-11-25 11:03 UTC · original
kirigayakazima:codex/glb-inspect-skin-references → main · +73 −10 · 2 files · 2 commits · open

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.
**@⁠kirigayakazima** on GitHub · 2026-11-25 11:03 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1745) `kirigayakazima:codex/glb-inspect-skin-references` → `main` · +73 −10 · 2 files · 2 commits · open Claimed in the coordination issue as: [GLB-INSPECT-SKIN-REFERENCES](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:03:30 +00:00
Author
Owner

@⁠lixonik on GitHub · 2026-11-25 11:19 UTC · original · reviewed

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.

**@⁠lixonik** on GitHub · 2026-11-25 11:19 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1745#pullrequestreview-6056670143) · **reviewed** 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.
@ -497,0 +517,4 @@
if accessor is None:
issues.append("inverseBindMatrices does not reference an accessor")
else:
if accessor.get("type") != "MAT4":
Author
Owner

@⁠lixonik on GitHub · 2026-11-25 11:19 UTC · original

The new check accepts an integer MAT4 as a valid inverse-bind accessor. I inspected a synthetic one-joint skin whose accessor declared type: MAT4, count: 1 and componentType: 5123. Its skin report had no issues. Could this also check componentType == 5126? Inverse bind matrices require floating-point components. glTF 2.0 skin specification

**@⁠lixonik** on GitHub · 2026-11-25 11:19 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1745#discussion_r4694120825) The new check accepts an integer MAT4 as a valid inverse-bind accessor. I inspected a synthetic one-joint skin whose accessor declared `type: MAT4`, `count: 1` and `componentType: 5123`. Its skin report had no issues. Could this also check `componentType == 5126`? Inverse bind matrices require floating-point components. [glTF 2.0 skin specification](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#skins)
@ -497,0 +517,4 @@
if accessor is None:
issues.append("inverseBindMatrices does not reference an accessor")
else:
if accessor.get("type") != "MAT4":
Author
Owner

@⁠kirigayakazima on GitHub · 2026-11-27 12:11 UTC · original

Fixed: _skin_report() now verifies accessor.get('componentType') == 5126 (FLOAT) for inverseBindMatrices. Added regression test with componentType: 5123 in tests/test_glb_inspect.py.

**@⁠kirigayakazima** on GitHub · 2026-11-27 12:11 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1745#discussion_r4719209999) Fixed: `_skin_report()` now verifies `accessor.get('componentType') == 5126` (`FLOAT`) for `inverseBindMatrices`. Added regression test with `componentType: 5123` in `tests/test_glb_inspect.py`.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1745/head:github-bot/gh-1745'
git switch 'github-bot/gh-1745'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1745'
git switch 'github-bot/gh-1745'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1745'
git switch 'github-bot/gh-1745'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1745'
git switch 'main'
git merge --squash 'github-bot/gh-1745'
git switch 'main'
git merge --ff-only 'github-bot/gh-1745'
git switch 'main'
git merge 'github-bot/gh-1745'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.