Post-projection stage cache helpers (#2944 B2), shared by the GSplats and
Lines data processors.
Revisiting a slice during playback restores its decoded payload from the
S-cache, but the nD→3D projection used to re-run on every visit: a
structured clone of the whole slice into a worker, the kernel, a clone of
the projected buffers back, plus the main-thread garbage both clones leave.
The projection is a pure function of (slice data, projection parameters),
so its output is cached ON the slice's S-cache entry
(SliceCache.setStage) and reused while both halves are unchanged:
SLICE DATA is identified by the S-cache payload object the loader restored
the data from (cache/slice-cache-origin.ts) — never by content, which
would cost as much as the projection.
PARAMETERS are the dispatcher's own params object with every typed array
removed (projectionStageSig). Deriving the signature from the very
object handed to the kernel — rather than from a hand-picked list of view
fields — makes it complete by construction: a new kernel input cannot be
forgotten, because it has to be in params to reach the kernel at all.
The typed arrays are exactly the slice data covered by the payload
identity (their lengths still enter the signature, belt and braces).
The cached buffers are shared by every later commit of the slice, so they
are marked sharedBuffers and the commit must neither mutate nor transfer
them (the gsplats depth-sort hand-off copies instead — see
commit-gsplats-geometry.ts).
Post-projection stage cache helpers (#2944 B2), shared by the GSplats and Lines data processors.
Revisiting a slice during playback restores its decoded payload from the S-cache, but the nD→3D projection used to re-run on every visit: a structured clone of the whole slice into a worker, the kernel, a clone of the projected buffers back, plus the main-thread garbage both clones leave. The projection is a pure function of (slice data, projection parameters), so its output is cached ON the slice's S-cache entry (
SliceCache.setStage) and reused while both halves are unchanged:cache/slice-cache-origin.ts) — never by content, which would cost as much as the projection.paramsto reach the kernel at all. The typed arrays are exactly the slice data covered by the payload identity (their lengths still enter the signature, belt and braces).The cached buffers are shared by every later commit of the slice, so they are marked
sharedBuffersand the commit must neither mutate nor transfer them (the gsplats depth-sort hand-off copies instead — seecommit-gsplats-geometry.ts).