glb_inspect: skip binary payloads when inspecting a model file #1744

Open
github-bot wants to merge 1 commit from github-bot/gh-1744 into main AGit
Owner

@⁠kirigayakazima on GitHub · 2026-11-25 11:03 UTC · original
kirigayakazima:codex/glb-inspect-stream-chunks → main · +41 −10 · 2 files · 1 commits · open

Claimed in the coordination issue as: GLB-INSPECT-STREAM-CHUNKS

What and why

The inspector needs the JSON and the chunk table, but opening an exported model previously read the entire file into a Python bytes object. The file entry point now checks chunk headers against the actual file length and seeks over payloads. The byte-array parser and non-seekable input still work.

Tested

A guarded stream compares the report with the byte-array entry point and fails on any read of either the BIN or extension payload. A separate synthetic file with a 128 MiB BIN chunk took 134,613 peak Python-traced bytes during inspection on the local integration branch.

  • python -I tests/test_glb_inspect.py on Windows with Python 3.14.7 ran 37 tests on this branch, including one platform skip. The new regression coverage also fails 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. The change is confined to the model inspector and its tests.

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/1744) `kirigayakazima:codex/glb-inspect-stream-chunks` → `main` · +41 −10 · 2 files · 1 commits · open Claimed in the coordination issue as: [GLB-INSPECT-STREAM-CHUNKS](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### What and why The inspector needs the JSON and the chunk table, but opening an exported model previously read the entire file into a Python bytes object. The file entry point now checks chunk headers against the actual file length and seeks over payloads. The byte-array parser and non-seekable input still work. ### Tested A guarded stream compares the report with the byte-array entry point and fails on any read of either the BIN or extension payload. A separate synthetic file with a 128 MiB BIN chunk took 134,613 peak Python-traced bytes during inspection on the local integration branch. - `python -I tests/test_glb_inspect.py` on Windows with Python 3.14.7 ran 37 tests on this branch, including one platform skip. The new regression coverage also fails 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. The change is confined to the model inspector and its tests. 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:29 +00:00
Author
Owner

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

Independent check at "e335f0ba". Windows: 36 tests reported, 1 platform skip. I inspected a separate synthetic file with a 32 MiB BIN on the merge base and this head. The reports were equal. With tracemalloc started immediately before inspect_file(), peak traced allocations fell from 33,563,190 to 11,449 bytes.

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/1744#pullrequestreview-6056669739) · **reviewed** Independent check at "e335f0ba". Windows: 36 tests reported, 1 platform skip. I inspected a separate synthetic file with a 32 MiB BIN on the merge base and this head. The reports were equal. With tracemalloc started immediately before inspect_file(), peak traced allocations fell from 33,563,190 to 11,449 bytes. AI-assisted review and CPU-only testing with synthetic inputs.
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/1744/head:github-bot/gh-1744'
git switch 'github-bot/gh-1744'

Merge

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