Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit3bb1da2647

README.md

asset_warmup

asset.warmup — a read-only closure inspector.

Returns the transitive set of assets that the CPU-residency system would load when the given asset enters /runtime/ — i.e. the asset plus everything reachable through its declared content references. It does not itself change residency or touch bytes:

local closure = asset.warmup("@builtin::meshes.cube")
-- → the asset + every texture/material/mesh it transitively references

Residency is owned by the engine's reference-counted CPU-residency system, which acquires the closure on a /runtime/ enter (usage 0→1) and releases it on the last drop (→0), loading/unloading bytes at the per-node 0↔1 boundaries so a texture shared by two materials stays resident until BOTH are gone. This helper just lets scripts/agents inspect that closure (debugging, "what would loading X pull in?") without any side effect — it avoids asset.resolve (which fires the BlobStore prefetch) and uses the side-effect-free asset.guid / asset.deps / asset.identity.

The closure is the generic .refs graph, so this is fully type-agnostic — material/mesh/user-types all resolve the same way with zero per-type knowledge. By default it follows asset_ref / component (content) edges and skips asset_type (structural) / require (code); opts.vias overrides. Deduped by guid via an explicit work-stack so diamonds appear once and cycles terminate.

Installed onto the FFI asset namespace by the prelude.