[AI Generated] extract-asset-metadata tool implementation #20

Merged
sessamekesh merged 6 commits from extract-metadata-binary-2 into main 2026-10-12 23:47:41 +00:00
Owner

NOTE: This PR is almost entirely AI generated using GLM 5.3.

Create a new extract-asset-metadata binary that is intended for use with asset pipeline tooling for building metadata about raw assets (e.g. PNG and glTF files) before feeding them into igasset-gen and igpack-bundle.

AI + igasset NOTE: This PR does involve a round of AI-written fixes in the igasset library itself. I'm comfortable including them because they're based on exact code changes I made downstream in a private repository (off of which the issue #18 was written), but be advised anyways.

_NOTE: This PR is almost entirely AI generated using GLM 5.3._ Create a new `extract-asset-metadata` binary that is intended for use with asset pipeline tooling for building metadata about raw assets (e.g. PNG and glTF files) before feeding them into `igasset-gen` and `igpack-bundle`. ## AI + `igasset` NOTE: This PR does involve a round of AI-written fixes in the `igasset` library itself. I'm comfortable including them because they're based on exact code changes I made downstream in a private repository (off of which the issue #18 was written), but be advised anyways.
rgba8_unorm_out read pixel channels 0-2 unconditionally, so 1- and
2-channel sources (grayscale / gray+alpha PNGs) read past the end of the
decoded buffer and copied the over-read bytes into the generated .igasset
(a heap info-leak oracle plus a correctness bug). basisu_ldr_out had the
identical unconditional read feeding the compressor. Both now expand only
valid channels: 1ch -> (g,g,g,255), 2ch -> (g,g,g,a), 3ch -> (r,g,b,255).
Byte counts use size_t (int32 overflow for huge images), the conversion
loop counters use int (uint16_t wrapped for dimensions over 65535,
spinning the loop and growing the output unbounded).

Regression tests pin the exact converted pixel values via the output
data hash (deterministic fixtures: gray.png, gray-alpha.png); verified
they fail against the old code and pass against the fix. Direct-mode
suites stay green with zero existing-fixture changes: igasset-gen 26/26
(23 + 3 new), igpack-bundle 23/23, on GCC + clang.
PlanInvocationConfig now carries a shared StagedFilesystem instead of raw
input/output roots; the three processors resolve every access through it
(logical names end to end: reads via read_input, writes via write_output,
logs with logical paths). Without --manifest the facade is constructed
with the direct policy, reproducing the historical operator/ semantics -
all direct-mode suites stay green with zero fixture changes. With
--manifest, inputs resolve deny-by-default through the manifest and
outputs are contained under the output root.

The Assimp path installs AssimpStagedIOSystem and imports by LOGICAL name
in staged mode (extension-based importer selection; base_dir-aware
two-step resolution for mtllib/buffer references); direct mode installs
the recording IOSystem (DefaultIOSystem semantics, opens journaled for
diagnostics). inc-build cache checks take resolved physical paths; the
mtime cache keys stay consistent across policies (staged outputs are
deterministically output_root/logical).

Also fixes a latent crash in enumerate-igasset: dump_wgsl_contents
dereferenced optional entry points without null checks (no existing
fixture omitted one; the new staged plan legitimately omits compute).

New staged-mode e2e (5 tests): UUID-copied fixtures through a manifest
with nested logical names - WGSL output (entry points + source hash) and
DracoGeometry output in logical subdirectories, unmapped-input failure,
and escaping-output denial. Battery on GCC + clang: selftest 85/85,
igasset-gen e2e 31/31 (26 + 5 staged), igpack-bundle 23/23,
extract-asset-metadata 31/31.
Update handoff doc: Phase 3 complete
All checks were successful
Build WASM Library / wasm-build (pull_request_target) Successful in 1m39s
igasset-gen Integration Tests / build-and-test (pull_request_target) Successful in 2m26s
a5013bc1df
Author
Owner

See issue #18

See issue #18
igasset-gen now hard-fails when IGASSET_REQUIRE_MANIFEST is set to any
value other than "0" and no --manifest was provided - a service-
misconfiguration tripwire for the orchestrator deployment.

Image2D::Unpack on an RGBA8Unorm-stored image previously rejected BC7/ASTC
requests outright (uncompressed data has no compressed representation to
transcode, and the failure was guaranteed); per issue #18 it now always
returns the raw RGBA8Unorm bytes, with the returned Image2D reporting its
actual format so callers can post-transform. IgpackDecoder /
SingleAssetParser extract_image2d are pass-throughs and inherit the fix.

Adds igasset-selftest (native-only, decoder gated, wired into CI): 7
checks over in-memory flatbuffers covering the uncompressed paths and an
in-test ETC1S-compressed transcode control. The fix was regression-proven
by running the same assertions against the old code (4 failures).

Battery on GCC + clang: staged-asset-io 85/85, igasset-selftest 7/7,
igasset-gen e2e 33/33 (31 + 2 tripwire), igpack-bundle 23/23,
extract-asset-metadata 31/31.
Document extract-asset-metadata; refresh stale README tool sections
All checks were successful
Build WASM Library / wasm-build (pull_request_target) Successful in 1m41s
igasset-gen Integration Tests / build-and-test (pull_request_target) Successful in 2m28s
0aff61313d
Add a README in tools/extract-asset-metadata/ (first tool-level README):
purpose, CLI, exit codes, direct vs staged modes with the manifest
authoring recipe, detection ladder, sanitization/truncation guarantees,
and the e2e invocation.

Top-level README: add the tool to the features list, the targets
mention, and a compact usage section linking to the tool README. While
there, fix stale content verified against the built binaries' --help:
igasset-gen and igpack-bundle no longer take -s/--schema (plan schemas
are embedded at build time), igasset-gen documents the new --manifest +
IGASSET_REQUIRE_MANIFEST tripwire, the igpack-bundle example pointed at
a nonexistent path/file (test-definitions live under e2e/), and the
geometry input list now reflects the narrowed Assimp importer set
(FBX/glTF/OBJ).
Author
Owner

Ready for review

Ready for review
Author
Owner

Fixes #18

Fixes #18
Remove markdown file with implementation plan for things done already
All checks were successful
Build WASM Library / wasm-build (pull_request_target) Successful in 1m35s
igasset-gen Integration Tests / build-and-test (pull_request_target) Successful in 2m41s
67d910f6ff
sessamekesh deleted branch extract-metadata-binary-2 2026-10-12 23:47:41 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
indigocode/igasset!20
No description provided.