Class GeometryTilePool<AssetID>

The geometry narrowing of the general memory system (src/core/mem/): a GeometryTiles backend where a product's "tile" is a set of refcounted, chunk-resident assets in a SharedAssetPool.

Composed with DemandGeometryQueue this completes the M3 resident design: the queue owns demand ordering and the logical budget; this pool owns physical residency. Two accounting views, one invariant:

  • Logical (queue-side): extract charges an instance the full chunk-rounded cost of every asset it references, shared or not. Sharing is thus double-charged logically — deliberately conservative: summed logical charges always cover physical use, so with the queue's budget set to the pool's budget, an acquire can never fail mid-extract. (Heavy sharing under-utilises the logical budget; the production wiring can widen the queue budget once measured. The safe direction first.)
  • Physical (pool-side): bytesInUse counts real chunks. Shared assets are stored once, refcounted, and freed only on the last release — so evicting product A never discards the representation product B still renders (the mapped-item correctness rule, held structurally).

Type Parameters

  • AssetID

Implements

Constructors

Accessors

Methods

Constructors

Accessors

Methods

  • Materialise an instance's tile: take a reference on each of its assets, materialising the ones not yet resident.

    Parameters

    • instanceID: number

      The instance (product local ID).

    Returns number

    The instance's logical byte cost (chunk-rounded, every asset fully charged — see class docs for why sharing is double-charged).

  • Release an instance's tile: drop the reference on each of its assets, discarding those this instance was the last holder of.

    Parameters

    • instanceID: number

      The instance (product local ID).

    Returns void