Spoc_framework_registry.Framework_cachetype stats = {mutable hits : int;Successful cache lookups
*)mutable misses : int;Failed cache lookups
*)mutable puts : int;Cache writes
*)mutable errors : int;I/O errors
*)}Cache statistics
val stats : statsval get_stats : unit -> statsGet current cache statistics
On-disk key schema version. Bump this whenever the key inputs change so stale entries written under an older schema can never mis-hit - they simply become unreachable orphans (safe: just re-computed and rewritten under the new key). v2 adds the kernel/entry name to the digest (v1 keys omitted it, so two kernels sharing one source string collided).
val compute_key :
dev_name:string ->
driver_version:string ->
name:string ->
source:string ->
stringCompute cache key from device, driver, kernel/entry name, and source.
name (the kernel/entry-point name) must be included: a single source string may define more than one kernel, and without the name in the key a second kernel compiled from the same source would return the first kernel's cached SPIR-V. The device identity is deliberately the device NAME + driver version (not an enumeration-order ordinal) so the key stays stable across process restarts where device enumeration order is not guaranteed.
Delegates to Compile_cache.make_key for the name/source component so this on-disk cache uses the same collision-resistant, digest-per-field join as every backend's in-memory compile cache. dev_name and driver_version are digested independently before being combined into the single device component make_key expects, so a value containing ':' in either field can never shift bytes between them (the same class of bug key_schema_version concatenation used to have). The key_schema_version prefix is preserved as an outer wrapper around the digest so schema bumps still invalidate stale on-disk entries.