Expand description
Backend-neutral mutable-cache ownership, storage, and admission algorithms. Backend-neutral ownership and admission algorithms for live model caches.
A cache backend owns concrete tensors, transfer objects, and persistent files. This module owns both each session’s block/lease/tail lifecycle and the process-wide accounting boundary shared by independently managed cache sessions. Reservations are RAII tokens: an admitted resource remains charged until its exact backend transition either publishes the bytes into a registered manager or drops the reservation.
Structs§
- Cache
Block Lifecycle - Canonical logical ownership state for one backend cache session.
- Cache
Block Storage - Canonical physical-resource state machine for one cache block.
- Cache
Host Promotion - Exact rollback ownership returned by a host-to-device promotion.
- Cache
IoExecution State - Canonical admission and cancellation state for a bounded cache I/O worker.
- Cache
IoOperation Key - Exact identity of one backing-store operation.
- Cache
IoSubmission - Prepared cache I/O that admits physical work only when explicitly enqueued.
- Cache
IoSubmission Outcome - Physical admission observations for one submission.
- Cache
IoTicket - Exact completion ownership for one coalesced cache I/O operation.
- Cache
IoWorker - Generic bounded background worker over opaque backend task and output types.
- Cache
Layer Residency Report - Bounded, individually identified per-layer residency observations.
- Cache
Layer Residency Stats - Current residency and cumulative activity attributable to one layer or a bounded overflow group of layers.
- Cache
Pool Limits - Process-wide finite limits shared by independently owned live caches.
- Cache
Pool Membership - Exact ownership of one manager’s aggregate pool contribution.
- Cache
Pool Report - Aggregate process-pool occupancy and high-water marks.
- Cache
Pool Reservation - Exact ownership of a temporary aggregate cache admission.
- Cache
Pool Usage - Occupancy on each independently admitted cache resource axis.
- Cache
Residency Pool - Shareable aggregate ownership boundary for scheduler and standalone caches.
- Cache
Residency Report - Aggregated logical device/disk and physical host residency observations.
- Cache
Residency Telemetry - Backend-neutral collector for bounded cache activity and snapshot assembly.
- Live
Cache Block Publication - Runtime-owned unique staging and atomic publication for one live-cache block.
- Mutable
Cache Tail - Device-resident mutable state that has not yet become an immutable block.
- Paged
Cache Options - Validated finite limits for block-addressable mutable state.
- Prompt
Cache Publication - A runtime-owned staging directory that publishes one immutable cache atomically.
Enums§
- Cache
IoAdmission - Result of requesting bounded queue admission for prepared cache I/O.
- Cache
IoCompletion Disposition - Publication action after a physically started operation completes.
- Cache
IoExecution State Error - Invalid cache I/O executor lifecycle use.
- Cache
IoOperation Kind - Kind of asynchronous backing-store operation.
- Cache
IoPreparation - Result of preparing an exact cache I/O key.
- Cache
IoStart Disposition - Action a physical executor takes after receiving one admitted operation.
- Cache
IoWorker Error - Failure in generic cache I/O worker coordination or task execution.
- Cache
Lifecycle Error - Invalid backend-neutral cache ownership transition.
- Cache
Pool Error - Backend-neutral aggregate cache ownership failure.
- Cache
Pool Resource - Resource axis named by an aggregate admission failure.
- Cache
Residency Configuration Error - Invalid backend-neutral mutable-cache residency configuration.
- Cache
Residency Policy - Selects fully resident mutable state or bounded block residency.
- Cache
Storage Error - Illegal cache storage phase transition or completion observation.
- Cache
Storage Phase - Stable phase of one cache block’s physical resources.
- Live
Cache Disk Policy - Controls optional disk backing for a live inference cache.
- Live
Cache Publication Error - Filesystem failure while publishing one ephemeral live-cache block.
- Prompt
Cache Persistence Error - Filesystem, catalog, and publication failures for a reusable prompt cache.
Constants§
- CACHE_
RESIDENCY_ LAYER_ REPORT_ LIMIT - Maximum number of individually identified layers in a residency report.
- MAX_
PROMPT_ CACHE_ SHARD_ HEADER_ BYTES - Maximum accepted safetensors metadata header size for a prompt-cache shard.
- PROMPT_
CACHE_ CURRENT_ FILE - Atomic pointer to the active immutable generation.
- PROMPT_
CACHE_ GENERATIONS_ DIRECTORY - Directory containing immutable replacement generations.
Traits§
- Cache
Host Demotion Operation - Opaque backend host-demotion completion with stable identity.
- Cache
IoOperation - Opaque backend I/O completion with an exact neutral key.
Functions§
- finalize_
prompt_ cache_ shard - Synchronizes a newly written shard and returns its exact payload SHA-256.
- hash_
prompt_ cache_ shard_ payload - Hashes the safetensors payload bytes, excluding its bounded metadata header.
- inspect_
prompt_ cache - Reads and validates a prompt-cache manifest without loading tensor arrays.
- resolve_
prompt_ cache_ root - Resolves the active immutable generation selected by the durable pointer.
- safe_
prompt_ cache_ shard_ path - Resolves a manifest shard path while rejecting traversal and symlink escapes.
- validate_
prompt_ cache_ manifest - Validates manifest structure and the bounded metadata of every referenced shard.