Repository navigation
Highlights
glTF 2.1 (draft) support
- GLB container version 3 with 64-bit chunk lengths (read by default; written only with
tg3_write_options.write_glb_64bit). - Draft glTF 2.1 items:
id,files,thumbnails, and the promoted-extension names. - Everything 2.1-specific is marked
TG3_GLTF21_UNSTABLE; reading a GLB v3 container emits a warning. glTF 2.1 is not a ratified Khronos specification and may change incompatibly.
Lean 4 formalization and machine-checked verification
- Lean 4 specification of the validation rules and GLB container framing.
- MiniC: a small operational semantics for the C subset used by the verified core of
tiny_gltf_v3.c, plus a translator from the real C source (via clang's typed AST). - Machine-checked refinement proofs — for every input, the translated C has no undefined behaviour, terminates, and returns the specified result. Current coverage:
- T1 (GLB):
tg3__glb_frame_parse,tg3__wr_u32le/tg3__wr_u64le,tg3__glb_write_magic,tg3__glb_write_header32/64,tg3__glb_write_headers, andtg3__glb_layout(glb_layout_correct). - T3 helpers:
tg3_component_size,tg3_num_components,tg3__b64_decoded_len,tg3__b64_decode_char. - T2 validation masks (started):
tg3__spec_buffer_mask,tg3__spec_skin_mask.
- T1 (GLB):
- No
sorry; every theorem depends only on Lean's standard axioms (propext,Classical.choice,Quot.sound). No Mathlib, nonative_decide, nobv_decide. - See
formal/README.mdfor the status table and build instructions.
Validation and hardening
- Post-parse index-bounds and byte-range validation is default-on (
tg3_parse_options.validate_indices/validate_rangesto opt out). TG3_PERMISSIVE(warnings) /TG3_STRICT(errors) strictness levels;tg3_validate()checks hand-built models with the same rules.- GLB v3 out-of-bounds and size-overflow fixes.
- New regression tests and a CI job for the Lean verification.
Changes since v3.0.1
- Add Lean 4 formalization, MiniC semantics, C-to-Lean translator, and T1 parse/writer proofs.
- Complete T1 GLB layout and header-writer proofs.
- Land T3 component/base64 helper proofs and start T2 validation-mask proofs.
- Add glTF 2.1 (draft) GLB v3 support and mark 2.1 items spec-unstable.
- Refactor validation: default-on index/range checks, strictness levels,
tg3_validate(). - Extend the translator for switch statements, string literals,
memcmp/strlen, and pointer loads. - Add regression tests, CI formal-verification job, and documentation updates.
Full changelog: v3.0.1...v3.1.0