Expand description
STELLAR §A AH-track H1(a) cache — the hardware passport (decision D26).
Probing the host (H0 topology + H1(a) cross-circuit benchmark) costs real time; doing it every boot burns TTFT (A7). The passport caches the discovered topology + capability matrix to a small CBOR blob keyed by the host’s adapter identifiers (vendor:device handles — identifiers, not an “identity”). On later boots, if the current adapter set matches the cached key, the probe is skipped; a topology change invalidates the cache and forces a re-probe (D26/D28).
CBOR (via ciborium, serde-compatible) is used rather than JSON: it round-trips IEEE-754 floats
natively — including the f64::INFINITY that marks an in-pool (no-transfer) circuit — and a
compact binary blob fits the project’s .q42 binary-first ethos. Cache only (no signing): the
human-key signing of the passport (H1(b)) is gated on the identity remediation and lives
elsewhere; this module never claims trust, only fast-boot.
Native only.
Structs§
- Decode
Proxy Line - Full parse of the machine line from
llm decode-proxy. - Decode
Proxy Result - Result of a decode-proxy measurement: speed and whether the completion is usable.
- Hardware
Passport - Cached discovery: topology + measured capability matrix, keyed by adapter identifiers.
Constants§
- DECODE_
PROXY_ PROBE_ PROMPT - Fixed factual probe used for coherence + throughput (same prompt as browser llmdemo gate).
- PASSPORT_
GEMV_ N - Default representative GEMV side length for the cached benchmark.
- PASSPORT_
VERSION - Bump when the passport layout changes (older blobs are then ignored → re-probe).
v2: optional
decode_proxy_tok_sper circuit + ranking by real decode when measured.
Functions§
- attach_
decode_ proxy_ via_ subprocess - Attach decode-proxy tok/s to GPU circuits by spawning a child process per backend (shared_gpu is process-wide OnceLock — cannot switch backends in-process).
- backend_
env_ token - Map a passport
backendstring ("Dx12","Vulkan", …) to aQUALIA_WGPU_BACKENDenv value. - cached_
preferred_ wgpu_ backend - Best measured GPU backend name from a cached passport, if any (
"Dx12","Vulkan","Metal"…). Does not re-probe. Used bygpu_contextwhenQUALIA_WGPU_BACKENDis unset so the machine’s measured ranking (not a static Windows→DX12 rule alone) selects the path. - decode_
proxy_ coherence_ ok - Greedy factual gate: completion must contain “paris” (case-insensitive). Garbage token streams fail closed — speed alone is not excellence.
- default_
cache_ path - Default cache location (OS temp dir). Callers may pass any path (e.g. a per-user data dir).
- default_
decode_ proxy_ model - Default small-model candidates for decode-proxy ranking (first existing wins).
- load_
or_ probe - Fast-boot entry: return the cached passport iff its adapter-identifier key matches the current
host; otherwise probe (H0 + H1(a) benchmark), cache, and return.
(passport, was_cached). - load_
or_ probe_ default - Convenience: fast-boot against the default cache path + GEMV size.
- measure_
decode_ proxy - Run a short resident decode on
modelunder the current process backend. Returns tok/s + text + coherence, orNoneon hard failure. - measure_
decode_ proxy_ tok_ s - Back-compat: tok/s only (callers that ignore quality still work).
- parse_
decode_ proxy_ line - Parse
DECODE_PROXY tok_s=12.34 backend=dx12 coherence=1from child stdout. - parse_
decode_ proxy_ record - read_
passport - Read + decode a passport (CBOR). Returns
Noneon missing file, decode error, or version mismatch. - topology_
key - Stable key from the discovered adapter identifiers (sorted
vendor:device). Identifiers (handles), never an identity — this is referential integrity for “is this the same hardware set”, nothing more. - write_
passport - Serialize a passport to a CBOR blob on disk.