PR 1 — :format: glTF/GLB reader for the reference layer #2

Open
litruv wants to merge 2 commits from issue-1-gltf-glb-reader into main
Owner

Work tracked in #1. The decision comment is #1 (comment).

Scope is the :format module only: GLB container rules, buffer views, accessors, scene graph, skins. No rendering, no UI, no export.

Design lives in https://git.ruv.wtf/litruv/umamo-reference-layer (docs/spec.md, docs/seams.md, docs/pr-stack.md).

Checks run: :format:jvmTest green (60 glTF tests, 59 without a corpus), :format:compileKotlinIosArm64 compiles the common code, and verify/verify.py in the design repo passes 30 checks that prove the same numbers the tests pin.

Work tracked in https://git.ruv.wtf/litruv/umamo/issues/1. The decision comment is https://git.ruv.wtf/litruv/umamo/issues/1#issuecomment-1002. Scope is the `:format` module only: GLB container rules, buffer views, accessors, scene graph, skins. No rendering, no UI, no export. Design lives in https://git.ruv.wtf/litruv/umamo-reference-layer (`docs/spec.md`, `docs/seams.md`, `docs/pr-stack.md`). Checks run: `:format:jvmTest` green (60 glTF tests, 59 without a corpus), `:format:compileKotlinIosArm64` compiles the common code, and `verify/verify.py` in the design repo passes 30 checks that prove the same numbers the tests pin.
litruv added 1 commit 2026-11-03 19:40:13 +11:00
glTF/GLB reader for the reference layer (#1)
Verification / build (pull_request) Failing after 13m5s
CI / verify (pull_request) Failing after 13m5s
bfec51c184
Container rules: JSON chunk first, BIN second, chunk length multiple of 4,
declared total length must equal actual, unknown chunk types skipped, duplicate
known types refused.

Accessor rules: byteOffset must be a multiple of the component size, reads must
stay inside byteLength, sparse refused, normalized not applied, component type
5124 (INT) added.

FileRole.Reference and FileKind.Gltf added; codec registered in FormatRegistry.

Tests: 60 glTF tests (59 run without a corpus), `:format:jvmTest` green.
litruv added 1 commit 2026-11-03 21:05:44 +11:00
glTF reader: the rules a real file corrected
Verification / build (pull_request) Failing after 9m17s
CI / verify (pull_request) Failing after 9m17s
da0d13e101
Two rules the fixtures asserted in the wrong direction, found by reading CesiumMan.glb:

- MAT4 is an accessor type, and count is the number of elements rather than the number of floats.
  A skin's inverse bind matrices are one MAT4 Float32 accessor whose count is the number of joints,
  and the format allows the count to exceed the joints. The reader required SCALAR and refused the file.
- The BIN chunk type is spelled BIN in the spec and NUL in the files another tool writes, so both
  spellings are accepted, and the chunk codes are built from their characters rather than from a hex
  literal that had the bytes transposed.

The corpus gate now reads the inverse bind matrices, because that is the accessor a skin names and the
one the fixtures could not exercise.

node.matrix is column-major while Mat4 is row-major, and a skin's joints have to be resolved by node
index: in CesiumMan.glb the scene root holds only the mesh node and the nineteen joints hang off a
skeleton node the scene does not reach. Both are recorded on the shapes the reader returns.
Some required checks failed
Verification / build (pull_request) Failing after 9m17s
CI / verify (pull_request) Failing after 9m17s
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-1-gltf-glb-reader:issue-1-gltf-glb-reader
git checkout issue-1-gltf-glb-reader
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: litruv/umamo#2