Expand description
Native warm-load cache of complete results; off unless a caller opts in. Native warm-load cache of complete processing results (phase 1).
A [ResultCache] wraps process: on a full pass whose
source bytes, output-affecting request fields and engine identity match a
stored entry, it replays that entry’s exact ProcessingResult (every
mesh, instance, frame, transform, metadata field, diagnostic and refusal
count, in order, float bits intact) instead of processing. Otherwise it
runs the unchanged pipeline and, in [CacheMode::ReadWrite], stores the
result. process itself stays pure: callers that never build a cache never
reach this module, and [CacheMode::Off] calls straight through without
hashing anything.
What it does not do (phase 1): replay sink events (the cached entry point
takes no sink, so streaming and callback consumers keep calling process),
cache a cancellable pass, trust an injected entity index, or cache the
prepared-source tier (index/discovery). A request it cannot replay reports
[CacheOutcome::Bypass] and runs live; it never returns a hit with missing
outputs.
Trust model: entries live in a per-user private directory (0700/0600,
owner-checked, O_NOFOLLOW, digest-only names, see store.rs). Every
entry is treated as untrusted input: bounded reads, checked arithmetic,
per-section SHA-256 verified before anything is decoded, and any failure is
a warning plus a miss and a recompute, never a panic or a partial result.
The checksums detect damage, not authorship: a process running as the same
user can write a self-consistent entry with wrong geometry, and this cache
cannot tell. Environments that need that guarantee need authenticated
entries or a separate trusted writer, which phase 1 does not provide.
Keys, layout and store policy: key.rs, envelope.rs, store.rs.
Structs§
- Cache
Report - Cache
Work - The current call’s work. Durations are wall time on this machine; byte counts are exact.
- Cached
Processing - A result and what the cache did to produce it.
- Result
Cache - A reusable cache context. Cheap to build; holds no open files.
- Result
Cache Config - Where and how much. Defaults: off, the platform cache directory, 10 GiB per directory, 1 GiB per entry. The limits are policy choices, not measured optima.
Enums§
- Bypass
Reason - Cache
Mode - What a
ResultCachemay do. Off unless a caller opts in. - Cache
Outcome - How the result was obtained.
- Miss
Reason - Publish
Outcome - What happened to the live result afterwards.
Functions§
- default_
directory - The per-user default root:
IFC_LITE_CACHE_DIRif set, else$XDG_CACHE_HOME/ifc-lite/nativeor~/.cache/ifc-lite/native(Linux and other Unix),~/Library/Caches/ifc-lite/native(macOS),%LOCALAPPDATA%\ifc-lite\native(Windows).