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

    Chunk prefetcher that proactively fetches adjacent zarr chunks.

    Triggered on L2 hits and L3 fetches to hide network latency by prefetching adjacent chunks (±1 in each dimension) before they are explicitly requested.

    Key features:

    • Symmetric ±1 adjacency in all dimensions
    • Concurrency limiting (default: 4 concurrent)
    • Full deduplication (queue + in-flight)
    • Fire-and-forget pattern (non-blocking)
    • Race-condition safe queue processing

    See: docs/guides/specs/CACHE_PREFETCHING_SPEC.md

    Index
    maxConcurrent: number
    enabled: boolean
    debug: boolean
    inFlight: Set<string> = ...
    queue: Set<string> = ...
    processing: boolean = false
    isDisposed: boolean = false
    MAX_SEEN_SIZE: 10000
    seen: Set<string> = ...
    parsedCache: Map<string, number[] | null> = ...

    Cache for parsed chunk indices (avoids repeated regex parsing per access)

    maxChunkIndices: Map<string, number[]> = ...

    Upper bounds per array path for suppressing out-of-range prefetch requests

    • Called by store after L2 hit or L3 fetch. Enqueues adjacent chunks for prefetching.

      Parameters

      • key: string

      Returns void

    • Add a key to the queue, unless it is already queued or in flight.

      Parameters

      • key: string

      Returns void

    • Process the prefetch queue with concurrency limiting. Race-condition safe via processing flag and queueMicrotask re-trigger.

      Returns void

    • Parse chunk indices from a zarr chunk key.

      Parameters

      • key: string

      Returns number[] | null

      parseChunkIndices('points/positions/0.1.2') → [0, 1, 2]
      parseChunkIndices('points/positions/c/0/1/2') → [0, 1, 2]
      parseChunkIndices('.zattrs') → null (not a chunk)
    • Register array shape and chunk sizes to enable adjacency prefetch. Neighbors outside the array's chunk grid are skipped.

      Parameters

      • arrayPath: string

        Base path of the array (e.g., 'gsplats_t0023/centers')

      • shape: number[]

        Array shape (e.g., [2096, 4])

      • chunks: number[]

        Chunk sizes (e.g., [1024, 4])

      Returns void

    • Generate adjacent chunk keys (±1 in each dimension). Returns [] unless bounds are registered for the key's array path.

      Parameters

      • key: string

      Returns string[]

      getAdjacentChunks('points/positions/1.2.3')
      → ['points/positions/0.2.3', 'points/positions/2.2.3',
      'points/positions/1.1.3', 'points/positions/1.3.3',
      'points/positions/1.2.2', 'points/positions/1.2.4']
    • Get prefetch statistics.

      Returns { queued: number; inFlight: number; enabled: boolean }