ReadonlyshapeCache for TVM ShapeTuple objects.
Key: comma-separated dimension string, e.g. "1,32,128" Value: TVM ShapeTuple object (Disposable)
Eviction releases only the cache's reference. Shape tuples returned to callers have independent references and normal scope-managed lifetimes.
CacheState manages domain-specific caches for the WebGPU runtime.
Currently contains:
makeShapeTuple()is called on every tensor operation, crossing the JS→WASM FFI boundary each time. During LLM decode, the same shapes repeat every token (e.g. [1,32,128]), so caching avoids thousands of redundant FFI round-trips.Future additions (follow-up PR):
createBuffer+writeBufferoverhead.