Luxar Viewer API Documentation - v2026.10.19
    Preparing search index...

    Module cache/slice-cache-origin

    Slice-cache ORIGIN stamps — "this loaded-data object is exactly the content of that S-cache entry".

    A post-projection stage cache (#2944 B2) may only reuse a projection when its INPUT is provably the same slice data. Comparing typed arrays byte by byte would cost as much as the projection it saves, so the proof is structural instead: the loaders stamp the objects they hand downstream whose content is a pure function of a restored S-cache payload, and the stage cache keys on that payload's OBJECT IDENTITY (plus a signature of the other stage inputs). S-cache payloads are never mutated after store (see data/loaders/progressive/slice-cache-helper.ts::cloneLodSnapshot), so identity implies content.

    Stamp only objects whose content cannot change afterwards: a restored payload element, or a fresh concatenation built from restored elements and nothing else. NEVER a freshly LOADED result — its arrays alias the loader's reused accumulator, which the next load rewrites in place.

    Side table (a WeakMap), not a field on the data object, for the same reason prefix-lineage.ts is one: the data can itself be an S-cache-owned snapshot whose bytes were measured at store time and which must not be mutated. The stamp does not keep the entry alive: a lookup re-checks that the entry is still resident AND still holds the same payload (SliceCache.getStage), so an evicted or upgraded entry simply misses.

    SliceCacheOrigin
    setSliceCacheOrigin
    getSliceCacheOrigin
    lookupStageOutput
    canStoreStageOutput
    storeStageOutput