diff --git a/.crumb b/.crumb index 84c01ea2..3eed6c08 100644 --- a/.crumb +++ b/.crumb @@ -100,8 +100,8 @@ "purpose": "" }, { - "digest": "55ca26451010e0ffcd7c54e1af55130f2b09a3094141937477c5131389ff8bdb", - "last_commit": "de68062a", + "digest": "b0d8f2a790a2430cb987703149e62d2ed702b9f98500539a667b78bde1925792", + "last_commit": "a51aac43", "name": "scripts", "purpose": "" }, @@ -118,15 +118,15 @@ "purpose": "Local CI sandbox exec contract (C8), aien-run user/caches install, Forgejo trigger hook, health " } ], - "children_root": "sha256:c28a6b94088f0d548612bbf3a996435a6c879cb94cf0f24539941f9db26ccd46", - "compiled_at": "2026-10-14T23:21:34Z", + "children_root": "sha256:f90c0930e15a0d29eaf368e95fafd1d715214fef4806681d3facc0cdfe4a0a20", + "compiled_at": "2026-10-15T00:25:34Z", "compiler": "crumb-compile/1", - "digest": "sha256:102d93427786344b3680651901fd2b4ed60444dada1b9b5035151fde9f20aaa2", - "evidence_files": 779, - "evidence_root": "sha256:71b21f0d08294a967db74dc610acba03f114f03501363f3243901bb25c578a5f", - "files": 4751, - "generated_at_commit": "fae990e3bc13ea0b795255cdb60694d0f62e328e", - "source_tree": "sha256:802b61be82487dcda17f6e84a8801773a1dfffada6e710fe6815e01bf8269444" + "digest": "sha256:808bd46b1638d2d6e5407d1130e7a8d9e67d1b0914e23b90e02b54987db44399", + "evidence_files": 942, + "evidence_root": "sha256:8986d927087f9b17a13c3d819371b4737e2adb901e1aefe09833d70f3ef2c18d", + "files": 4926, + "generated_at_commit": "aab59c7a81bb11b6a75d107caa0c0e2415089558", + "source_tree": "sha256:e6936f2ea1e7fa29e5bf3b8904215d38debcea7db3e58bf57c24bcea481e6d68" } }, "history": [], diff --git a/Cargo.lock b/Cargo.lock index 5f2476de..4ae6cc80 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -483,11 +483,15 @@ name = "aien-serve-http" version = "0.1.0" dependencies = [ "aien-inference-abi", + "aien-kv-store", "aien-omega-gpu", + "aien-platform", + "aien-runtime", "axum 0.7.9", "libc", "serde", "serde_json", + "sha2 0.10.9", "tokio", "tokio-stream", ] diff --git a/crates/aien-inference-abi/Cargo.toml b/crates/aien-inference-abi/Cargo.toml index 70694921..eb5b4aaa 100644 --- a/crates/aien-inference-abi/Cargo.toml +++ b/crates/aien-inference-abi/Cargo.toml @@ -35,3 +35,7 @@ sha2 = "0.10" # Off by default: a production build fails closed (no reference weights, no # silent CPU fallback behind the GPU backend). Only dev/test builds turn it on. dev-fallback = [] +# Host-only test engine (sc#505): the tiny in-memory Qwen3-MoE checkpoint and host matmuls behind +# a real `OmegaEngine` over a host bf16 pool, so other crates can test the persistent KV path +# without a chip. Dev-dependencies only; never in a server build. +host-test-engine = [] diff --git a/crates/aien-inference-abi/src/qwen3_moe_omega.rs b/crates/aien-inference-abi/src/qwen3_moe_omega.rs index b2da9048..a5fa98fe 100644 --- a/crates/aien-inference-abi/src/qwen3_moe_omega.rs +++ b/crates/aien-inference-abi/src/qwen3_moe_omega.rs @@ -34,6 +34,9 @@ mod whole_prompt; /// The one-list decode token (OWN-30B L2 cut 2), off unless `OWN30B_DECODE_GRAPH=1`. #[path = "qwen3_moe_omega_dgraph.rs"] pub mod dgraph; +/// Persistent KV export and import (sc#505): the `HostPagedPoolV1` payload of a token prefix. +#[path = "qwen3_moe_omega_kvio.rs"] +pub mod kvio; /// Column tile of the engine's tile-major B layout: every expert window must start on one. pub const WINDOW_TILE: usize = aien_omega_moe::TILE_N; @@ -1579,7 +1582,8 @@ pub fn loader_transient_bytes(config: &Qwen3MoeConfig) -> usize { bits + fp8 + scales + raw } -#[cfg(test)] +#[cfg(any(test, feature = "host-test-engine"))] +#[cfg_attr(not(test), allow(dead_code))] pub(crate) mod test_support { //! An in-memory checkpoint and a recording uploader with host matmuls, so the loader and the //! forward can be exercised end to end without a chip. @@ -2512,6 +2516,246 @@ pub trait KvAttention: Send { } /// The graph wrote position `pos` of every layer. fn dgraph_commit(&mut self, _pos: usize) {} + /// Persistent KV park (sc#505): the K/V of positions `start..start + len` as the + /// `HostPagedPoolV1` payload of [`kvio`] (`start` a multiple of [`KV_BLOCK_SIZE`]; every + /// layer must hold those positions). `None`: this cache cannot export, nothing is parked. + fn export_blocks(&mut self, _start: usize, _len: usize) -> Option, String>> { + None + } + /// Persistent KV restore (sc#505): writes a [`kvio`] payload for positions `start..start + + /// len`; every layer must hold exactly `0..start` before the call and holds `0..start + len` + /// after it. `None`: this cache cannot import, the caller prefills instead. On `Err` the + /// cache may hold part of the payload: the caller must reset it. + fn import_blocks( + &mut self, + _start: usize, + _len: usize, + _bytes: &[u8], + ) -> Option> { + None + } +} + +/// Positions `start..start + len` of a bf16 `aien_kv_cache` pool (blocks `0..n` in order, block +/// size [`KV_BLOCK_SIZE`]) as a [`kvio`] payload: the pool layout is the payload layout, so the +/// blocks are copied as they are and the rows past `len` in the last block are zeroed in the copy. +fn pool_export( + pool: &aien_kv_cache::UnifiedKvTensorPool, + filled: &[usize], + start: usize, + len: usize, +) -> Result, String> { + let c = pool.config(); + let g = kvio::PoolBlockGeometry { + layers: c.num_layers, + kv_heads: c.num_kv_heads, + head_dim: c.head_dim, + block_size: c.block_size, + }; + if c.dtype != aien_kv_cache::KvDType::Bf16 || g.block_stride() != pool.block_bytes() { + return Err(format!( + "kv export: pool {:?} with {} byte blocks is not the bf16 payload layout", + c.dtype, + pool.block_bytes() + )); + } + if len == 0 || !start.is_multiple_of(g.block_size) { + return Err(format!( + "kv export {start}+{len}: start must be a multiple of {}, len non-zero", + g.block_size + )); + } + if let Some((l, f)) = filled.iter().enumerate().find(|(_, &f)| f < start + len) { + return Err(format!( + "kv export {start}+{len}: layer {l} holds only {f} positions" + )); + } + let off = (start / g.block_size) * g.block_stride(); + let n = g.payload_len(len); + if off + n > pool.total_bytes() { + return Err(format!( + "kv export {start}+{len}: past the pool ({} bytes)", + pool.total_bytes() + )); + } + // SAFETY: the pool owns total_bytes() readable bytes at base_ptr(); the range is checked. + let mut out = unsafe { std::slice::from_raw_parts(pool.base_ptr().add(off), n) }.to_vec(); + kvio::zero_padding(&g, len, &mut out); + Ok(out) +} + +/// The inverse of [`pool_export`]: writes the payload's blocks into the pool and marks +/// `0..start + len` filled in every layer. +fn pool_import( + pool: &mut aien_kv_cache::UnifiedKvTensorPool, + filled: &mut [usize], + start: usize, + len: usize, + bytes: &[u8], +) -> Result<(), String> { + let c = pool.config(); + let g = kvio::PoolBlockGeometry { + layers: c.num_layers, + kv_heads: c.num_kv_heads, + head_dim: c.head_dim, + block_size: c.block_size, + }; + if c.dtype != aien_kv_cache::KvDType::Bf16 || g.block_stride() != pool.block_bytes() { + return Err(format!( + "kv import: pool {:?} with {} byte blocks is not the bf16 payload layout", + c.dtype, + pool.block_bytes() + )); + } + if len == 0 || !start.is_multiple_of(g.block_size) { + return Err(format!( + "kv import {start}+{len}: start must be a multiple of {}, len non-zero", + g.block_size + )); + } + if let Some((l, f)) = filled.iter().enumerate().find(|(_, &f)| f != start) { + return Err(format!( + "kv import at {start}: layer {l} holds {f} positions" + )); + } + kvio::check_payload(&g, len, bytes)?; + let off = (start / g.block_size) * g.block_stride(); + if off + bytes.len() > pool.total_bytes() { + return Err(format!( + "kv import {start}+{len}: past the pool ({} bytes)", + pool.total_bytes() + )); + } + // SAFETY: the pool owns total_bytes() writable bytes at base_mut_ptr(); the range is checked + // and `bytes` is a separate allocation. + unsafe { + std::ptr::copy_nonoverlapping(bytes.as_ptr(), pool.base_mut_ptr().add(off), bytes.len()) + }; + filled.iter_mut().for_each(|f| *f = start + len); + Ok(()) +} + +/// A host bf16 pool with the reference attention over the bf16 values: the same bytes as +/// [`OmegaPagedKv`] (append rounds to bf16 in the pool, export/import copy blocks), with no chip. +/// Host tests of the persistent KV path (sc#505) run the real engine over it. +pub struct HostPoolKv { + pool: aien_kv_cache::UnifiedKvTensorPool, + capacity: usize, + q_heads: usize, + kv_heads: usize, + head_dim: usize, + filled: Vec, +} + +impl HostPoolKv { + pub fn new(config: &Qwen3MoeConfig, max_context: usize) -> Result { + let num_blocks = max_context.div_ceil(KV_BLOCK_SIZE).max(1); + let cfg = aien_kv_cache::KvPoolConfig::for_model( + num_blocks, + KV_BLOCK_SIZE, + config.layers, + config.kv_heads, + config.head_dim, + aien_kv_cache::KvDType::Bf16, + ); + Ok(Self { + pool: aien_kv_cache::UnifiedKvTensorPool::allocate(cfg)?, + capacity: num_blocks * KV_BLOCK_SIZE, + q_heads: config.q_heads, + kv_heads: config.kv_heads, + head_dim: config.head_dim, + filled: vec![0; config.layers], + }) + } + + fn row(&self, layer: usize, pos: usize, value: bool) -> Vec { + let kv_dim = self.kv_heads * self.head_dim; + let off = self + .pool + .element_offset(pos / KV_BLOCK_SIZE, layer, value, pos % KV_BLOCK_SIZE); + // SAFETY: the offset is inside the pool (pos < filled <= capacity), kv_dim bf16 values. + let b = unsafe { std::slice::from_raw_parts(self.pool.base_ptr().add(off), kv_dim * 2) }; + b.chunks_exact(2) + .map(|w| bf16_to_f32(u16::from_le_bytes([w[0], w[1]]))) + .collect() + } +} + +impl KvAttention for HostPoolKv { + fn capacity(&self) -> usize { + self.capacity + } + fn reset(&mut self) { + self.filled.iter_mut().for_each(|f| *f = 0); + } + fn truncate(&mut self, len: usize) { + for f in self.filled.iter_mut() { + *f = (*f).min(len); + } + } + fn append(&mut self, layer: usize, pos: usize, k: &[f32], v: &[f32]) -> Result<(), String> { + if pos != self.filled[layer] || pos >= self.capacity { + return Err(format!( + "host pool kv: append at {pos}, have {} (capacity {})", + self.filled[layer], self.capacity + )); + } + self.pool + .write_token_kv(pos / KV_BLOCK_SIZE, layer, pos % KV_BLOCK_SIZE, k, v); + self.filled[layer] = pos + 1; + Ok(()) + } + fn attend( + &mut self, + layer: usize, + q: &[f32], + context_len: usize, + out: &mut [f32], + ) -> Result { + if context_len > self.filled[layer] { + return Err(format!( + "host pool kv: attend over {context_len}, only {} stored", + self.filled[layer] + )); + } + let keys: Vec> = (0..context_len) + .map(|p| self.row(layer, p, false)) + .collect(); + let values: Vec> = (0..context_len).map(|p| self.row(layer, p, true)).collect(); + scaled_dot_product_attention_single( + q, + &keys, + &values, + self.q_heads, + self.kv_heads, + self.head_dim, + out, + ); + Ok(0) + } + fn resident(&self) -> bool { + false + } + fn path_name(&self) -> &'static str { + "host-pool" + } + fn export_blocks(&mut self, start: usize, len: usize) -> Option, String>> { + Some(pool_export(&self.pool, &self.filled, start, len)) + } + fn import_blocks( + &mut self, + start: usize, + len: usize, + bytes: &[u8], + ) -> Option> { + Some(pool_import( + &mut self.pool, + &mut self.filled, + start, + len, + bytes, + )) + } } /// Host f32 cache with the reference attention (tests, and the oracle side of parity runs). @@ -2748,6 +2992,26 @@ impl KvAttention for OmegaPagedKv { fn resident(&self) -> bool { self.resident } + // The chip reads and writes this pool in place (GPU-uncached host-visible memory when + // resident) and no launch is in flight between steps, so the host copies see the bytes the + // attention reads. + fn export_blocks(&mut self, start: usize, len: usize) -> Option, String>> { + Some(pool_export(&self.pool, &self.filled, start, len)) + } + fn import_blocks( + &mut self, + start: usize, + len: usize, + bytes: &[u8], + ) -> Option> { + Some(pool_import( + &mut self.pool, + &mut self.filled, + start, + len, + bytes, + )) + } } /// Generation request (field for field what the HTTP door's `GenerateParams` carries). @@ -2889,6 +3153,37 @@ pub fn sample_next(logits: &[f32], params: &GenerateParams, step: usize) -> u32 sample_with_params(logits, &sp, decode_sampling_seed(params.seed, step)).0 } +/// Every run setting of a [`Qwen3MoeOmegaEngine`] that can change a K/V byte (persistent KV +/// engine identity, sc#505). When unsure whether a setting moves a byte it is listed (fail +/// closed: a needless entry only costs a cache miss). The caller adds the settings that live +/// outside the engine (weight format, the omega environment switches, the build). +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct OmegaKvSwitches { + /// "fused" (one-launch attention, bf16 RNE on the chip), "split" (host norm and RoPE, the + /// paged pool), or a test cache's name. + pub attention_path: &'static str, + /// Decode steps route with the device router. + pub device_routing: bool, + /// Prompt tokens per batched prefill step (the batch shape of the activation rounding). + pub prefill_chunk: usize, + /// Batched prefill on the FP8 grouped GEMM instead of the grouped GEMV. + pub prefill_gemm: bool, + /// GEMM prefill routes with the device router. + pub prefill_device_routing: bool, + /// Whole-prompt prefill (changes activation rounding, chip gate W-RC). + pub whole_prompt: bool, + /// Router logits and MoE combine of the whole-prompt prefill on the chip. + pub whole_prompt_device_host: bool, + /// The one-list decode graph (`OWN30B_DECODE_GRAPH=1`). + pub decode_graph: bool, + /// lm_head on the bf16 GEMV (logits only; listed anyway). + pub lm_head_gemv: bool, + /// Negative control: routing deliberately wrong. Persistence must refuse it. + pub routing_mutant: bool, + /// Parity tracing on (records activations; listed anyway). + pub trace_layers: bool, +} + /// The Stage A engine: one sequence, token-at-a-time prefill and decode. pub struct Qwen3MoeOmegaEngine { /// The one-list decode graph (built at the first graph decode step). Declared first so it is @@ -3528,6 +3823,90 @@ impl Qwen3MoeOmegaEngine { self.pos = len; } + /// Tokens `generate` would keep from the stored history for `prompt`: the longest common + /// prefix, capped at `prompt.len() - 1` (the last prompt token is always stepped). The same + /// rule as `generate_inner`; persistent KV (sc#505) restores only when the store beats it. + pub fn reusable_prefix(&self, prompt: &[u32]) -> usize { + let common = self + .history + .iter() + .zip(prompt) + .take_while(|(a, b)| a == b) + .count(); + common.min(prompt.len().saturating_sub(1)) + } + + /// Persistent KV park (sc#505): the K/V of stored positions `start..start + len` as the + /// [`kvio`] payload (`start` a multiple of [`KV_BLOCK_SIZE`], `start + len <= position()`). + pub fn export_kv(&mut self, start: usize, len: usize) -> Result, String> { + if start + len > self.pos { + return Err(format!( + "kv export {start}+{len}: only {} positions stored", + self.pos + )); + } + self.kv.export_blocks(start, len).unwrap_or_else(|| { + Err(format!( + "the {} attention cache cannot export its KV", + self.kv.path_name() + )) + }) + } + + /// Persistent KV restore (sc#505): replaces the stored sequence by `tokens` with the K/V of + /// `payload` (a [`kvio`] payload of `tokens.len()` positions from position 0). On success the + /// engine is exactly as if it had stepped `tokens` itself and kept them in its history, so the + /// next `generate` reuses them by the usual prefix rule. On any error the engine is reset + /// (empty history): the next `generate` prefills from position 0, never from a partial prefix. + pub fn restore_kv(&mut self, tokens: &[u32], payload: &[u8]) -> Result<(), String> { + self.reset(); + if tokens.is_empty() || tokens.len() >= self.kv.capacity() { + return Err(format!( + "kv restore of {} tokens, context is {}", + tokens.len(), + self.kv.capacity() + )); + } + let r = self + .kv + .import_blocks(0, tokens.len(), payload) + .unwrap_or_else(|| { + Err(format!( + "the {} attention cache cannot import KV", + self.kv.path_name() + )) + }); + match r { + Ok(()) => { + self.history = tokens.to_vec(); + self.pos = tokens.len(); + Ok(()) + } + Err(e) => { + self.reset(); + Err(e) + } + } + } + + /// Every setting of this engine that can change a K/V byte, for the persistent KV engine + /// identity (sc#505). See [`OmegaKvSwitches`]. + pub fn kv_switches(&self) -> OmegaKvSwitches { + OmegaKvSwitches { + attention_path: self.kv.path_name(), + device_routing: self.device_routing, + prefill_chunk: self.prefill_chunk, + prefill_gemm: self.prefill_gemm, + prefill_device_routing: self.prefill_device_routing, + whole_prompt: self.whole_prompt_on(), + whole_prompt_device_host: self.whole_prompt_device_host_on(), + decode_graph: self.decode_graph, + lm_head_gemv: matches!(self.weights.lm_head, LmHead::Gemv(_)), + routing_mutant: self.routing_mutant, + trace_layers: !self.trace_layers.is_empty(), + } + } + /// Runs `token` at the next position through every layer. Returns the final-normed hidden /// state (feed it to `logits`). Records `last_timing`. pub fn step(&mut self, token: u32) -> Result, String> { @@ -5020,3 +5399,249 @@ fn combine_rows( } }); } + +/// Host-only test engine (sc#505, feature `host-test-engine`): a real [`OmegaEngine`] over the +/// tiny in-memory Qwen3-MoE checkpoint, host matmuls and a [`HostPoolKv`] (bf16 pool, the +/// `HostPagedPoolV1` bytes), so the persistent KV path of the HTTP door can be tested end to end +/// without a chip. Never in a server build. +#[cfg(feature = "host-test-engine")] +pub mod host_test_engine { + use super::test_support::{tiny_config, MemorySource, RecordingUploader}; + use super::*; + + /// The tiny checkpoint's config (2 layers, 1 KV head of 128, 4 experts, top 2, vocab 64). + pub fn config() -> Qwen3MoeConfig { + tiny_config() + } + + /// A fresh engine (same weights every call, so two calls stand for one server restarted) with + /// room for `max_context` tokens. + pub fn engine(format: WeightFormat, max_context: usize) -> Result { + let c = tiny_config(); + let mut src = MemorySource::for_config(&c); + let up = RecordingUploader::default(); + let (w, report) = load_qwen3_moe_omega_from_with(&c, &mut src, &up, format, &mut |_| {})?; + let kv = HostPoolKv::new(&c, max_context)?; + Ok(OmegaEngine::from_engine( + Qwen3MoeOmegaEngine::new(w, Box::new(kv)), + report, + )) + } +} + +/// Persistent KV export and import on the engine (sc#505), host only. +#[cfg(test)] +mod kv_persist_tests { + use super::test_support::*; + use super::*; + + fn pool_engine(cap: usize) -> Qwen3MoeOmegaEngine { + let c = tiny_config(); + let mut src = MemorySource::for_config(&c); + let up = RecordingUploader::default(); + let (w, _) = + load_qwen3_moe_omega_from_with(&c, &mut src, &up, WeightFormat::Fp8All, &mut |_| {}) + .unwrap(); + Qwen3MoeOmegaEngine::new(w, Box::new(HostPoolKv::new(&c, cap).unwrap())) + } + + fn argmax(lg: &[f32]) -> u32 { + lg.iter() + .enumerate() + .max_by(|a, b| a.1.partial_cmp(b.1).unwrap()) + .unwrap() + .0 as u32 + } + + /// Greedy turn: (tokens, every logit vector, reused prompt tokens). + fn turn( + e: &mut Qwen3MoeOmegaEngine, + prompt: &[u32], + n: usize, + ) -> (Vec, Vec>, usize) { + let (mut toks, mut logits) = (Vec::new(), Vec::new()); + let o = e + .generate_with( + prompt, + &GenerateParams::greedy(n, vec![]), + &mut |lg, _| { + logits.push(lg.to_vec()); + argmax(lg) + }, + &mut |t| { + toks.push(t); + true + }, + ) + .unwrap(); + (toks, logits, o.reused_prompt_tokens) + } + + fn rows(seed: u64, n: usize) -> Vec { + (0..n).map(|i| prand(seed, i)).collect() + } + + #[test] + fn paged_and_host_pool_caches_export_the_same_bytes_and_round_trip() { + let c = tiny_config(); + let kvd = c.kv_heads * c.head_dim; + let mut paged = OmegaPagedKv::new(&c, 64).unwrap(); + assert!( + !paged.resident(), + "the stub build has no resident pool: a host pool, same bytes" + ); + let mut host = HostPoolKv::new(&c, 64).unwrap(); + for pos in 0..37 { + for l in 0..c.layers { + let (k, v) = ( + rows(pos as u64 * 10 + l as u64, kvd), + rows(pos as u64 * 10 + l as u64 + 5, kvd), + ); + paged.append(l, pos, &k, &v).unwrap(); + host.append(l, pos, &k, &v).unwrap(); + } + } + let g = kvio::PoolBlockGeometry::for_config(&c); + for (start, len) in [(0usize, 37usize), (0, 16), (16, 21), (32, 1)] { + let a = paged.export_blocks(start, len).unwrap().unwrap(); + let b = host.export_blocks(start, len).unwrap().unwrap(); + assert_eq!(a, b, "{start}+{len}"); + assert_eq!(a.len(), g.payload_len(len)); + kvio::check_payload(&g, len, &a).unwrap(); + } + // Past what is stored: refused. + assert!(paged.export_blocks(32, 6).unwrap().is_err()); + // Import into a fresh cache in two pieces, export again: identical bytes. + let whole = host.export_blocks(0, 37).unwrap().unwrap(); + let mut fresh = OmegaPagedKv::new(&c, 64).unwrap(); + assert!( + fresh + .import_blocks(16, 21, &host.export_blocks(16, 21).unwrap().unwrap()) + .unwrap() + .is_err(), + "must start where the cache ends" + ); + fresh + .import_blocks(0, 16, &host.export_blocks(0, 16).unwrap().unwrap()) + .unwrap() + .unwrap(); + fresh + .import_blocks(16, 21, &host.export_blocks(16, 21).unwrap().unwrap()) + .unwrap() + .unwrap(); + assert_eq!(fresh.export_blocks(0, 37).unwrap().unwrap(), whole); + // The f32 test cache cannot export: None, never a guess. + assert!(HostKv::new(&c, 8).export_blocks(0, 1).is_none()); + } + + #[test] + fn restored_prefix_continues_exactly_like_the_uninterrupted_engine() { + let turn1 = [ + 5u32, 17, 42, 3, 9, 60, 11, 23, 8, 2, 7, 19, 33, 40, 1, 6, 14, 29, + ]; + // Uninterrupted: turn 1, then turn 2 reusing the in-RAM prefix. + let mut live = pool_engine(128); + let (reply1, _, r1) = turn(&mut live, &turn1, 5); + assert_eq!(r1, 0); + let history = live.history().to_vec(); + let snapshot = live.export_kv(0, history.len()).unwrap(); + let mut turn2 = turn1.to_vec(); + turn2.extend_from_slice(&reply1); + turn2.extend_from_slice(&[12, 31, 4]); + let (want, want_logits, reused_live) = turn(&mut live, &turn2, 6); + assert_eq!( + reused_live, + history.len(), + "turn 2 reuses every stepped token of turn 1" + ); + + // Restarted: a fresh engine (same weights), the parked prefix restored, then turn 2. + let mut restarted = pool_engine(128); + restarted.restore_kv(&history, &snapshot).unwrap(); + assert_eq!(restarted.history(), &history[..]); + assert_eq!(restarted.position(), history.len()); + assert_eq!( + restarted.export_kv(0, history.len()).unwrap(), + snapshot, + "import then export is byte-identical" + ); + assert_eq!(restarted.reusable_prefix(&turn2), reused_live); + let (got, got_logits, reused_restored) = turn(&mut restarted, &turn2, 6); + assert_eq!( + reused_restored, reused_live, + "the restore point is the uninterrupted reuse point" + ); + assert_eq!( + got, want, + "restored continuation equals the uninterrupted one" + ); + assert_eq!(got_logits, want_logits, "bit for bit"); + } + + #[test] + fn a_damaged_or_impossible_restore_leaves_a_clean_engine_that_prefills_from_zero() { + let prompt = [5u32, 17, 42, 3, 9, 60, 11, 23, 8, 2]; + let mut a = pool_engine(64); + let _ = turn(&mut a, &prompt, 3); + let history = a.history().to_vec(); + let mut snap = a.export_kv(0, history.len()).unwrap(); + let mut cold = pool_engine(64); + let (want, _, _) = turn(&mut cold, &prompt, 3); + + let mut b = pool_engine(64); + let _ = turn(&mut b, &[1, 2, 3, 4], 2); + // Wrong length, a padding byte set, an empty or oversized token list: all refused. + assert!(b.restore_kv(&history, &snap[..snap.len() - 2]).is_err()); + assert_eq!( + (b.position(), b.history().len()), + (0, 0), + "reset, not a partial prefix" + ); + let last = snap.len() - 1; + snap[last] ^= 1; + assert!(b.restore_kv(&history, &snap).is_err()); + assert!(b.restore_kv(&[], &[]).is_err()); + assert!(b.restore_kv(&[1u32; 64], &snap).is_err()); + assert_eq!((b.position(), b.history().len()), (0, 0)); + let (got, _, reused) = turn(&mut b, &prompt, 3); + assert_eq!(reused, 0); + assert_eq!(got, want, "plain prefill after a refused restore"); + // An engine whose cache cannot export refuses the park. + let (mut f32_engine, _, _, _) = { + let c = tiny_config(); + let mut src = MemorySource::for_config(&c); + let up = RecordingUploader::default(); + let (w, r) = load_qwen3_moe_omega_from_with( + &c, + &mut src, + &up, + WeightFormat::Fp8All, + &mut |_| {}, + ) + .unwrap(); + ( + Qwen3MoeOmegaEngine::new(w, Box::new(HostKv::new(&c, 32))), + (), + (), + r, + ) + }; + let _ = turn(&mut f32_engine, &prompt, 2); + assert!(f32_engine.export_kv(0, 4).is_err()); + assert!(f32_engine.export_kv(0, 99).is_err()); + } + + #[test] + fn kv_switches_report_every_run_setting() { + let mut e = pool_engine(32); + let s = e.kv_switches(); + assert_eq!(s.attention_path, "host-pool"); + assert!(!s.whole_prompt && !s.decode_graph && !s.routing_mutant); + e.prefill_chunk = 3; + e.routing_mutant = true; + let t = e.kv_switches(); + assert_eq!(t.prefill_chunk, 3); + assert!(t.routing_mutant); + assert_ne!(s, t); + } +} diff --git a/crates/aien-inference-abi/src/qwen3_moe_omega_dattn.rs b/crates/aien-inference-abi/src/qwen3_moe_omega_dattn.rs index f9838532..e0134756 100644 --- a/crates/aien-inference-abi/src/qwen3_moe_omega_dattn.rs +++ b/crates/aien-inference-abi/src/qwen3_moe_omega_dattn.rs @@ -7,7 +7,7 @@ //! The cache owns the KV of every layer by position, so prefix reuse works as before: //! `truncate(len)` forgets positions at or past `len` and the next step rewrites them. //! `append` / `attend` (the split path) are refused: the engine must take [`KvAttention::fused_attend`]. -use crate::qwen3_moe_omega::{KvAttention, OmegaLayer, Qwen3MoeConfig}; +use crate::qwen3_moe_omega::{kvio, KvAttention, OmegaLayer, Qwen3MoeConfig, KV_BLOCK_SIZE}; /// Omega's one-launch decode attention with its GPU-resident KV, one sequence. pub struct OmegaFusedKv { @@ -85,6 +85,16 @@ impl OmegaFusedKv { pub fn mark_filled(&mut self, upto: usize) { self.filled.iter_mut().for_each(|f| *f = upto); } + + /// The payload geometry of this cache (sc#505): every layer, omega's 4 KV heads x 128. + pub fn geometry(&self) -> kvio::PoolBlockGeometry { + kvio::PoolBlockGeometry { + layers: self.filled.len(), + kv_heads: aien_omega_dattn::KV_HEADS, + head_dim: aien_omega_dattn::HEAD_DIM, + block_size: KV_BLOCK_SIZE, + } + } } impl KvAttention for OmegaFusedKv { @@ -168,4 +178,54 @@ impl KvAttention for OmegaFusedKv { fn dgraph_commit(&mut self, pos: usize) { self.filled.iter_mut().for_each(|f| *f = pos + 1); } + // Persistent KV (sc#505): omega's row helpers move whole bf16 rows between this cache and the + // `HostPagedPoolV1` payload (`kvio`), no value is converted. Called between generations only. + fn export_blocks(&mut self, start: usize, len: usize) -> Option, String>> { + if let Some((l, &f)) = self + .filled + .iter() + .enumerate() + .find(|(_, &f)| f < start + len) + { + return Some(Err(format!( + "fused kv export {start}+{len}: layer {l} holds only {f} positions" + ))); + } + let g = self.geometry(); + let cache = &mut self.cache; + Some(kvio::rows_to_blocks(&g, start, len, |l, h, p, k, v| { + cache + .read_row(l, h, p, k, v) + .map_err(|e| format!("fused kv export layer {l} head {h} pos {p}: {e}")) + })) + } + fn import_blocks( + &mut self, + start: usize, + len: usize, + bytes: &[u8], + ) -> Option> { + if let Some((l, &f)) = self.filled.iter().enumerate().find(|(_, &f)| f != start) { + return Some(Err(format!( + "fused kv import at {start}: layer {l} holds {f} positions" + ))); + } + if start + len > self.capacity { + return Some(Err(format!( + "fused kv import {start}+{len}: capacity {}", + self.capacity + ))); + } + let g = self.geometry(); + let cache = &mut self.cache; + let r = kvio::blocks_to_rows(&g, start, len, bytes, |l, h, k, v| { + cache + .write_rows(l, h, start, k, v) + .map_err(|e| format!("fused kv import layer {l} head {h}: {e}")) + }); + if r.is_ok() { + self.filled.iter_mut().for_each(|f| *f = start + len); + } + Some(r) + } } diff --git a/crates/aien-inference-abi/src/qwen3_moe_omega_kvio.rs b/crates/aien-inference-abi/src/qwen3_moe_omega_kvio.rs new file mode 100644 index 00000000..3a548b82 --- /dev/null +++ b/crates/aien-inference-abi/src/qwen3_moe_omega_kvio.rs @@ -0,0 +1,316 @@ +//! Persistent KV export and import for the Omega engine (sc#505). New file. +//! +//! The payload is the persistent KV store's `HostPagedPoolV1` format (ADR 0003 section 2.2): for +//! positions `start..start + len`, `ceil(len / KV_BLOCK_SIZE)` blocks, each exactly +//! [`PoolBlockGeometry::block_stride`] bytes, laid out `[layer][K plane | V plane][token][kv +//! head][dim]` with every element a little-endian bf16 bit pattern. Rows at or past `len` in the +//! last block are zero. This is byte for byte the layout of `aien_kv_cache::UnifiedKvTensorPool` +//! with dtype bf16 and block size [`KV_BLOCK_SIZE`] (the pool [`super::OmegaPagedKv`] attends +//! over), so the split path copies its blocks as they are. +//! +//! The fused path ([`crate::qwen3_moe_omega_dattn::OmegaFusedKv`], what the live server runs) keeps +//! its K/V differently on the chip: per layer one K plane and one V plane of bf16 rows, row +//! `(kv_head, pos)` at `(kv_head * max_pos + pos) * head_dim * 2` bytes. [`rows_to_blocks`] and +//! [`blocks_to_rows`] move whole bf16 rows between that layout and the payload without touching a +//! value (no rounding, no conversion), so the payload is the same `HostPagedPoolV1` bytes either +//! way. Which attention path computed them is part of the engine identity the namespace binds +//! (aien-serve-http `kv_persist.rs`), so a fused payload is never offered to the split path or +//! the other way round. +//! +//! Both rows of a position are the cached K (after the k norm and RoPE) and V, exactly what the +//! attention reads; positions are absolute, so a restored prefix lines up with the next step. + +use super::{Qwen3MoeConfig, KV_BLOCK_SIZE}; + +/// The byte geometry of one `HostPagedPoolV1` block for a model (bf16 elements). +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct PoolBlockGeometry { + pub layers: usize, + pub kv_heads: usize, + pub head_dim: usize, + pub block_size: usize, +} + +/// Bytes of one bf16 element. +pub const ELEMENT_BYTES: usize = 2; + +impl PoolBlockGeometry { + pub fn for_config(c: &Qwen3MoeConfig) -> Self { + Self { + layers: c.layers, + kv_heads: c.kv_heads, + head_dim: c.head_dim, + block_size: KV_BLOCK_SIZE, + } + } + pub fn head_stride(&self) -> usize { + self.head_dim * ELEMENT_BYTES + } + pub fn token_stride(&self) -> usize { + self.kv_heads * self.head_stride() + } + pub fn kv_plane_stride(&self) -> usize { + self.block_size * self.token_stride() + } + pub fn layer_stride(&self) -> usize { + 2 * self.kv_plane_stride() + } + pub fn block_stride(&self) -> usize { + self.layers * self.layer_stride() + } + /// Payload bytes for `len` positions. + pub fn payload_len(&self, len: usize) -> usize { + len.div_ceil(self.block_size) * self.block_stride() + } + /// Offset of the row of (`pos` relative to the payload start, `layer`, K or V, `head`). + pub fn row_offset(&self, rel_pos: usize, layer: usize, value: bool, head: usize) -> usize { + (rel_pos / self.block_size) * self.block_stride() + + layer * self.layer_stride() + + usize::from(value) * self.kv_plane_stride() + + (rel_pos % self.block_size) * self.token_stride() + + head * self.head_stride() + } + fn check(&self, start: usize, len: usize) -> Result<(), String> { + if self.layers == 0 || self.kv_heads == 0 || self.head_dim == 0 || self.block_size == 0 { + return Err(format!("kv export geometry {self:?} has a zero dimension")); + } + if len == 0 { + return Err("kv export of zero positions".into()); + } + if !start.is_multiple_of(self.block_size) { + return Err(format!( + "kv export start {start} is not a multiple of the block size {}", + self.block_size + )); + } + Ok(()) + } +} + +/// Builds the payload for positions `start..start + len` from a row reader: +/// `read_row(layer, kv_head, pos, k, v)` fills `head_dim` bf16 bit patterns of K and of V. +pub fn rows_to_blocks( + g: &PoolBlockGeometry, + start: usize, + len: usize, + mut read_row: impl FnMut(usize, usize, usize, &mut [u16], &mut [u16]) -> Result<(), String>, +) -> Result, String> { + g.check(start, len)?; + let mut out = vec![0u8; g.payload_len(len)]; + let (mut k, mut v) = (vec![0u16; g.head_dim], vec![0u16; g.head_dim]); + for layer in 0..g.layers { + for head in 0..g.kv_heads { + for rel in 0..len { + read_row(layer, head, start + rel, &mut k, &mut v)?; + put_row(&mut out, g.row_offset(rel, layer, false, head), &k); + put_row(&mut out, g.row_offset(rel, layer, true, head), &v); + } + } + } + Ok(out) +} + +/// Splits a payload of `len` positions into contiguous per-(layer, kv head) rows and hands them +/// to `write_rows(layer, kv_head, k_rows, v_rows)` (`len * head_dim` bf16 bit patterns each, +/// position order). Refuses a payload of the wrong size, or with a non-zero byte in the padding +/// rows of its last block, before writing anything. +pub fn blocks_to_rows( + g: &PoolBlockGeometry, + start: usize, + len: usize, + bytes: &[u8], + mut write_rows: impl FnMut(usize, usize, &[u16], &[u16]) -> Result<(), String>, +) -> Result<(), String> { + g.check(start, len)?; + check_payload(g, len, bytes)?; + let (mut k, mut v) = (vec![0u16; len * g.head_dim], vec![0u16; len * g.head_dim]); + for layer in 0..g.layers { + for head in 0..g.kv_heads { + for rel in 0..len { + let row = rel * g.head_dim..(rel + 1) * g.head_dim; + get_row( + bytes, + g.row_offset(rel, layer, false, head), + &mut k[row.clone()], + ); + get_row(bytes, g.row_offset(rel, layer, true, head), &mut v[row]); + } + write_rows(layer, head, &k, &v)?; + } + } + Ok(()) +} + +/// The payload must be exactly `payload_len(len)` bytes, and every row past `len` in the last +/// block must be zero (ADR 0003 section 2.2: the writer zeroes them, so anything else is damage). +pub fn check_payload(g: &PoolBlockGeometry, len: usize, bytes: &[u8]) -> Result<(), String> { + if bytes.len() != g.payload_len(len) { + return Err(format!( + "kv payload of {} bytes, {len} positions need {}", + bytes.len(), + g.payload_len(len) + )); + } + let tail = len % g.block_size; + if tail != 0 { + let last = len - tail; + for layer in 0..g.layers { + for value in [false, true] { + let from = g.row_offset(last + tail, layer, value, 0); + let to = g.row_offset(last, layer, value, 0) + g.kv_plane_stride(); + if bytes[from..to].iter().any(|&b| b != 0) { + return Err(format!("kv payload: padding rows past position {len} of layer {layer} are not zero")); + } + } + } + } + Ok(()) +} + +/// Zeroes the rows at or past `len` in the last block of a payload (in place). +pub fn zero_padding(g: &PoolBlockGeometry, len: usize, bytes: &mut [u8]) { + let tail = len % g.block_size; + if tail == 0 { + return; + } + let last = len - tail; + for layer in 0..g.layers { + for value in [false, true] { + let from = g.row_offset(last + tail, layer, value, 0); + let to = g.row_offset(last, layer, value, 0) + g.kv_plane_stride(); + bytes[from..to].fill(0); + } + } +} + +fn put_row(out: &mut [u8], at: usize, row: &[u16]) { + for (i, w) in row.iter().enumerate() { + out[at + 2 * i..at + 2 * i + 2].copy_from_slice(&w.to_le_bytes()); + } +} + +fn get_row(bytes: &[u8], at: usize, row: &mut [u16]) { + for (i, w) in row.iter_mut().enumerate() { + *w = u16::from_le_bytes([bytes[at + 2 * i], bytes[at + 2 * i + 1]]); + } +} + +#[cfg(test)] +mod tests { + use super::*; + + fn geom() -> PoolBlockGeometry { + PoolBlockGeometry { + layers: 3, + kv_heads: 2, + head_dim: 4, + block_size: 16, + } + } + + /// A fake fused cache: rows keyed by (layer, head, pos, value). + fn row_word(layer: usize, head: usize, pos: usize, value: bool, i: usize) -> u16 { + (((layer * 7 + head * 3 + pos * 11 + usize::from(value) * 5 + i) % 65_521) as u16) | 1 + } + + #[test] + fn geometry_equals_the_kv_cache_pool_layout() { + // The payload must be the aien_kv_cache pool layout (HostPagedPoolV1), not a look-alike. + let g = geom(); + let cfg = aien_kv_cache::KvPoolConfig::for_model( + 4, + g.block_size, + g.layers, + g.kv_heads, + g.head_dim, + aien_kv_cache::KvDType::Bf16, + ); + let d = aien_kv_cache::UnifiedKvTensorPool::allocate(cfg) + .unwrap() + .layout_desc(); + assert_eq!(d.block_stride_bytes as usize, g.block_stride()); + assert_eq!(d.layer_stride_bytes as usize, g.layer_stride()); + assert_eq!(d.kv_plane_stride_bytes as usize, g.kv_plane_stride()); + assert_eq!(d.token_stride_bytes as usize, g.token_stride()); + assert_eq!(d.head_stride_bytes as usize, g.head_stride()); + } + + #[test] + fn fused_rows_round_trip_through_the_payload_byte_for_byte() { + let g = geom(); + for (start, len) in [(0usize, 1usize), (0, 16), (0, 37), (32, 5), (48, 48)] { + let bytes = rows_to_blocks(&g, start, len, |l, h, p, k, v| { + for i in 0..g.head_dim { + k[i] = row_word(l, h, p, false, i); + v[i] = row_word(l, h, p, true, i); + } + Ok(()) + }) + .unwrap(); + assert_eq!(bytes.len(), g.payload_len(len)); + check_payload(&g, len, &bytes).unwrap(); + let mut seen = 0usize; + blocks_to_rows(&g, start, len, &bytes, |l, h, k, v| { + for rel in 0..len { + for i in 0..g.head_dim { + assert_eq!( + k[rel * g.head_dim + i], + row_word(l, h, start + rel, false, i) + ); + assert_eq!( + v[rel * g.head_dim + i], + row_word(l, h, start + rel, true, i) + ); + } + } + seen += 1; + Ok(()) + }) + .unwrap(); + assert_eq!(seen, g.layers * g.kv_heads); + // Export again from what was imported: identical bytes. + let again = rows_to_blocks(&g, start, len, |l, h, p, k, v| { + let rel = p - start; + get_row(&bytes, g.row_offset(rel, l, false, h), k); + get_row(&bytes, g.row_offset(rel, l, true, h), v); + Ok(()) + }) + .unwrap(); + assert_eq!(again, bytes); + } + } + + #[test] + fn damaged_payloads_are_refused_before_any_write() { + let g = geom(); + let mut bytes = rows_to_blocks(&g, 0, 20, |_, _, _, k, v| { + k.fill(0x3f80); + v.fill(0x4000); + Ok(()) + }) + .unwrap(); + let mut writes = 0; + // Wrong size. + assert!( + blocks_to_rows(&g, 0, 20, &bytes[..bytes.len() - 1], |_, _, _, _| { + writes += 1; + Ok(()) + }) + .is_err() + ); + // A non-zero padding byte (position 20 of layer 1, V plane). + let at = g.row_offset(20, 1, true, 1) + 3; + bytes[at] = 9; + assert!(blocks_to_rows(&g, 0, 20, &bytes, |_, _, _, _| { + writes += 1; + Ok(()) + }) + .is_err()); + assert_eq!(writes, 0); + zero_padding(&g, 20, &mut bytes); + assert!(check_payload(&g, 20, &bytes).is_ok()); + // Unaligned start and zero length are refused. + assert!(rows_to_blocks(&g, 3, 4, |_, _, _, _, _| Ok(())).is_err()); + assert!(rows_to_blocks(&g, 0, 0, |_, _, _, _, _| Ok(())).is_err()); + } +} diff --git a/crates/aien-kv-store/src/seal.rs b/crates/aien-kv-store/src/seal.rs index 69523ebe..f46d28e2 100644 --- a/crates/aien-kv-store/src/seal.rs +++ b/crates/aien-kv-store/src/seal.rs @@ -179,6 +179,17 @@ impl SealKey { /// version, fresh nonce, tag) and encrypts the payload. The file length is /// unchanged. pub fn seal_file(&self, file: &mut [u8]) -> Result<(), SealError> { + let t0 = std::time::Instant::now(); + let got = self.seal_inner(file); + note_timing( + &SEAL_TIMING, + file.len().saturating_sub(HEADER_REGION_LEN), + t0, + ); + got + } + + fn seal_inner(&self, file: &mut [u8]) -> Result<(), SealError> { if file.len() < HEADER_REGION_LEN { return Err(SealError::Short); } @@ -206,7 +217,9 @@ impl SealKey { /// sealed file) in place. On any error the payload buffer is zeroed and /// must be discarded; nothing in it may be used. pub fn open_payload(&self, region: &[u8], payload: &mut [u8]) -> Result<(), SealError> { + let t0 = std::time::Instant::now(); let got = self.open_inner(region, payload); + note_timing(&OPEN_TIMING, payload.len(), t0); if got.is_err() { payload.fill(0); if got == Err(SealError::Rejected) { @@ -291,3 +304,53 @@ pub fn key_refusals_total() -> u64 { pub fn open_rejected_total() -> u64 { OPEN_REJECTED.load(Ordering::Relaxed) } + +/// Calls, payload bytes and wall nanoseconds of one seal operation (#508 encryption cost). +struct Timing { + calls: AtomicU64, + bytes: AtomicU64, + ns: AtomicU64, +} + +static SEAL_TIMING: Timing = Timing { + calls: AtomicU64::new(0), + bytes: AtomicU64::new(0), + ns: AtomicU64::new(0), +}; +static OPEN_TIMING: Timing = Timing { + calls: AtomicU64::new(0), + bytes: AtomicU64::new(0), + ns: AtomicU64::new(0), +}; + +fn note_timing(t: &Timing, bytes: usize, t0: std::time::Instant) { + let ns = u64::try_from(t0.elapsed().as_nanos()).unwrap_or(u64::MAX); + t.calls.fetch_add(1, Ordering::Relaxed); + t.bytes.fetch_add(bytes as u64, Ordering::Relaxed); + t.ns.fetch_add(ns, Ordering::Relaxed); +} + +/// Totals of [`SealKey::seal_file`] and [`SealKey::open_payload`] in this process: every call +/// (refused ones included), the payload bytes it covered and the wall time it took. The +/// encryption cost of persistence is `seal_ns` per parked byte and `open_ns` per restored byte. +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)] +pub struct SealTiming { + pub seal_calls: u64, + pub seal_bytes: u64, + pub seal_ns: u64, + pub open_calls: u64, + pub open_bytes: u64, + pub open_ns: u64, +} + +pub fn seal_timing() -> SealTiming { + let r = |a: &AtomicU64| a.load(Ordering::Relaxed); + SealTiming { + seal_calls: r(&SEAL_TIMING.calls), + seal_bytes: r(&SEAL_TIMING.bytes), + seal_ns: r(&SEAL_TIMING.ns), + open_calls: r(&OPEN_TIMING.calls), + open_bytes: r(&OPEN_TIMING.bytes), + open_ns: r(&OPEN_TIMING.ns), + } +} diff --git a/crates/aien-kv-store/tests/seal_tests.rs b/crates/aien-kv-store/tests/seal_tests.rs index 481c6a07..b9ac64d1 100644 --- a/crates/aien-kv-store/tests/seal_tests.rs +++ b/crates/aien-kv-store/tests/seal_tests.rs @@ -153,6 +153,27 @@ fn seal_refuses_an_old_plaintext_format_file() { assert_eq!(open(&key, &other), Err(SealError::UnsupportedVersion)); } +#[test] +fn seal_and_open_time_is_counted_per_payload_byte() { + // Totals are process wide and other tests run in parallel: check growth by at least ours. + let key = SealKey::generate().unwrap(); + let before = seal::seal_timing(); + let (file, payload) = sealed_file(&key, 3); + open(&key, &file).unwrap(); + let after = seal::seal_timing(); + let n = payload.len() as u64; + assert!(after.seal_calls > before.seal_calls && after.open_calls > before.open_calls); + assert!( + after.seal_bytes - before.seal_bytes >= n, + "{before:?} {after:?}" + ); + assert!( + after.open_bytes - before.open_bytes >= n, + "{before:?} {after:?}" + ); + assert!(after.seal_ns > before.seal_ns && after.open_ns > before.open_ns); +} + #[test] fn seal_refusals_are_counted() { let key = SealKey::generate().unwrap(); diff --git a/crates/aien-omega-dattn/src/lib.rs b/crates/aien-omega-dattn/src/lib.rs index e2c829f8..ed7a5fbd 100644 --- a/crates/aien-omega-dattn/src/lib.rs +++ b/crates/aien-omega-dattn/src/lib.rs @@ -15,6 +15,7 @@ use aien_omega_gpu::OmegaGpuError; use std::fmt; pub mod raw; +pub mod rows; /// Query heads the kernel is built for (`OMEGA_GPU_DATTN_Q_HEADS`). pub const Q_HEADS: usize = 32; @@ -97,6 +98,25 @@ mod ffi { pub fn omega_gpu_decode_attn_set_depth(depth: u32); pub fn omega_gpu_decode_attn_set_per_split(per_split: u32); pub fn omega_gpu_decode_attn_test_set_mutant(mutant: i32); + // Row access to the cache (omega src/omega_gpu_decode_attn_api.c, test helpers used by the + // persistent KV park/restore of sc#505). + pub fn omega_gpu_decode_attn_cache_write( + c: *mut OmegaGpuDecodeAttnCache, + layer: u32, + kv_head: u32, + pos: u32, + count: u32, + k_bf16: *const u16, + v_bf16: *const u16, + ) -> i32; + pub fn omega_gpu_decode_attn_cache_read( + c: *mut OmegaGpuDecodeAttnCache, + layer: u32, + kv_head: u32, + pos: u32, + k_bf16: *mut u16, + v_bf16: *mut u16, + ) -> i32; } } diff --git a/crates/aien-omega-dattn/src/rows.rs b/crates/aien-omega-dattn/src/rows.rs new file mode 100644 index 00000000..2291c3e2 --- /dev/null +++ b/crates/aien-omega-dattn/src/rows.rs @@ -0,0 +1,116 @@ +//! Row access to the decode attention cache (persistent KV park/restore, sc#505). New file. +//! +//! omega keeps each layer's K and V planes as bf16 rows of [`HEAD_DIM`] values, row +//! `(kv_head, pos)` at `(kv_head * max_pos + pos) * 256` bytes into the plane +//! (`omega_gpu_decode_attn_api.h`, `OmegaGpuDecodeAttnCacheView`). The two calls here are the +//! header's test helpers: `cache_read` returns one K row and one V row, `cache_write` stores +//! `count` consecutive rows of one layer and KV head in one sync. Both take omega's session lock +//! and sync the layer between host and chip, so they must not run while a launch on this cache +//! is in flight (the engine calls them between generations, under the hive's GPU lock). +//! Without the native library both return `Unavailable`. +use super::{bad, check_len, DecodeAttnCache, HEAD_DIM, KV_HEADS}; +use aien_omega_gpu::OmegaGpuError; + +impl DecodeAttnCache { + fn check_row( + &self, + layer: usize, + kv_head: usize, + pos: usize, + count: usize, + ) -> Result<(), OmegaGpuError> { + if layer >= self.layers + || kv_head >= KV_HEADS + || count == 0 + || pos >= self.max_pos + || count > self.max_pos - pos + { + return Err(bad(format!( + "decode attn rows layer {layer} head {kv_head} pos {pos} count {count} outside {} layers x {KV_HEADS} heads x {} positions", + self.layers, self.max_pos + ))); + } + Ok(()) + } + + /// Copies the bf16 K and V rows of (`layer`, `kv_head`, `pos`) into `k` and `v` + /// ([`HEAD_DIM`] values each, bf16 bit patterns). + pub fn read_row( + &mut self, + layer: usize, + kv_head: usize, + pos: usize, + k: &mut [u16], + v: &mut [u16], + ) -> Result<(), OmegaGpuError> { + check_len("decode attn read k", HEAD_DIM, k.len())?; + check_len("decode attn read v", HEAD_DIM, v.len())?; + self.check_row(layer, kv_head, pos, 1)?; + #[cfg(has_omega_dattn)] + { + // SAFETY: ranges and lengths checked above; the cache is live for &mut self. + let rc = unsafe { + super::ffi::omega_gpu_decode_attn_cache_read( + self.ptr, + layer as u32, + kv_head as u32, + pos as u32, + k.as_mut_ptr(), + v.as_mut_ptr(), + ) + }; + if rc != 0 { + return Err(super::rc_err(rc)); + } + Ok(()) + } + #[cfg(not(has_omega_dattn))] + { + Err(OmegaGpuError::Unavailable) + } + } + + /// Stores `k.len() / HEAD_DIM` consecutive bf16 K rows and as many V rows of (`layer`, + /// `kv_head`) starting at position `pos`, in one sync. + pub fn write_rows( + &mut self, + layer: usize, + kv_head: usize, + pos: usize, + k: &[u16], + v: &[u16], + ) -> Result<(), OmegaGpuError> { + if k.is_empty() || !k.len().is_multiple_of(HEAD_DIM) { + return Err(bad(format!( + "decode attn write: {} K values is not a whole number of {HEAD_DIM}-wide rows", + k.len() + ))); + } + check_len("decode attn write v", k.len(), v.len())?; + let count = k.len() / HEAD_DIM; + self.check_row(layer, kv_head, pos, count)?; + #[cfg(has_omega_dattn)] + { + // SAFETY: ranges and lengths checked above; the cache is live for &mut self. + let rc = unsafe { + super::ffi::omega_gpu_decode_attn_cache_write( + self.ptr, + layer as u32, + kv_head as u32, + pos as u32, + count as u32, + k.as_ptr(), + v.as_ptr(), + ) + }; + if rc != 0 { + return Err(super::rc_err(rc)); + } + Ok(()) + } + #[cfg(not(has_omega_dattn))] + { + Err(OmegaGpuError::Unavailable) + } + } +} diff --git a/crates/aien-serve-http/Cargo.toml b/crates/aien-serve-http/Cargo.toml index babf8cf6..f8936ccc 100644 --- a/crates/aien-serve-http/Cargo.toml +++ b/crates/aien-serve-http/Cargo.toml @@ -22,3 +22,10 @@ serde_json = "1.0" aien-inference-abi = { path = "../aien-inference-abi" } aien-omega-gpu = { path = "../aien-omega-gpu" } libc = "0.2" +aien-kv-store = { path = "../aien-kv-store" } +aien-platform = { path = "../aien-platform" } +aien-runtime = { path = "../aien-runtime" } +sha2 = "0.10" + +[dev-dependencies] +aien-inference-abi = { path = "../aien-inference-abi", features = ["host-test-engine"] } diff --git a/crates/aien-serve-http/build.rs b/crates/aien-serve-http/build.rs new file mode 100644 index 00000000..7c52ff82 --- /dev/null +++ b/crates/aien-serve-http/build.rs @@ -0,0 +1,103 @@ +//! Build identity of the omega door for the persistent KV engine identity (sc#505, ADR 0003 +//! section 1.2.2). Embedded at build time, read by `kv_persist::OmegaBuild::linked()`: +//! +//! - `AIEN_SERVE_HTTP_GIT_COMMIT`: the commit this crate was built from (`AIEN_BUILD_COMMIT` +//! when set, else `git rev-parse HEAD`, else `unknown`). +//! - `AIEN_SERVE_HTTP_GIT_DIRTY`: `1` when `git status` showed modified tracked files at build +//! time, `0` when clean (or `AIEN_BUILD_COMMIT` given), `unknown` without git. Re-checked +//! when HEAD or the index moves, not on every unstaged edit. +//! - `AIEN_SERVE_HTTP_OMEGA_LOCK`: the omega commit `omega.lock` pins. +//! - `AIEN_SERVE_HTTP_GPU_RECORDED_SHA256`: the `libomega_gpu.a` sha256 `native-artifacts.lock` +//! records for that commit and this target, or `unrecorded`. +use std::path::{Path, PathBuf}; +use std::process::Command; + +fn git(root: &Path, args: &[&str]) -> Option { + let out = Command::new("git") + .arg("-C") + .arg(root) + .args(args) + .output() + .ok()?; + if !out.status.success() { + return None; + } + Some(String::from_utf8(out.stdout).ok()?.trim().to_string()) +} + +fn main() { + let manifest = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap()); + let root = manifest.join("../.."); + let target = std::env::var("TARGET").unwrap_or_default(); + + println!("cargo:rerun-if-env-changed=AIEN_BUILD_COMMIT"); + let forced = std::env::var("AIEN_BUILD_COMMIT") + .ok() + .filter(|s| !s.trim().is_empty()); + let (commit, dirty) = match forced { + Some(c) => (c.trim().to_string(), "0".to_string()), + None => { + for p in ["HEAD", "index"] { + if let Some(path) = git(&root, &["rev-parse", "--git-path", p]) { + let path = if Path::new(&path).is_absolute() { + PathBuf::from(path) + } else { + root.join(path) + }; + println!("cargo:rerun-if-changed={}", path.display()); + } + } + if let Some(name) = git(&root, &["symbolic-ref", "-q", "HEAD"]) { + if let Some(path) = git(&root, &["rev-parse", "--git-path", &name]) { + let path = if Path::new(&path).is_absolute() { + PathBuf::from(path) + } else { + root.join(path) + }; + if path.exists() { + println!("cargo:rerun-if-changed={}", path.display()); + } + } + } + let commit = git(&root, &["rev-parse", "HEAD"]) + .filter(|s| !s.is_empty()) + .unwrap_or_else(|| "unknown".into()); + let dirty = match git(&root, &["status", "--porcelain", "--untracked-files=no"]) { + Some(s) if s.is_empty() => "0", + Some(_) => "1", + None => "unknown", + }; + (commit, dirty.to_string()) + } + }; + println!("cargo:rustc-env=AIEN_SERVE_HTTP_GIT_COMMIT={commit}"); + println!("cargo:rustc-env=AIEN_SERVE_HTTP_GIT_DIRTY={dirty}"); + + let lock_path = root.join("omega.lock"); + println!("cargo:rerun-if-changed={}", lock_path.display()); + let omega = std::fs::read_to_string(&lock_path) + .map(|s| s.trim().to_string()) + .unwrap_or_default(); + let omega = if omega.is_empty() { + "unknown".to_string() + } else { + omega + }; + println!("cargo:rustc-env=AIEN_SERVE_HTTP_OMEGA_LOCK={omega}"); + + let artifacts = root.join("native-artifacts.lock"); + println!("cargo:rerun-if-changed={}", artifacts.display()); + let recorded = std::fs::read_to_string(&artifacts) + .ok() + .and_then(|text| { + text.lines() + .filter(|l| !l.trim_start().starts_with('#')) + .find_map(|l| { + let f: Vec<&str> = l.split_whitespace().collect(); + (f.len() >= 4 && f[0] == "libomega_gpu.a" && f[1] == omega && f[2] == target) + .then(|| f[3].to_string()) + }) + }) + .unwrap_or_else(|| "unrecorded".to_string()); + println!("cargo:rustc-env=AIEN_SERVE_HTTP_GPU_RECORDED_SHA256={recorded}"); +} diff --git a/crates/aien-serve-http/src/engine.rs b/crates/aien-serve-http/src/engine.rs index 01d6b381..b45f1e19 100644 --- a/crates/aien-serve-http/src/engine.rs +++ b/crates/aien-serve-http/src/engine.rs @@ -96,6 +96,11 @@ pub trait Engine: Send + Sync { params: &GenerateParams, on_token: &mut dyn FnMut(u32) -> bool, ) -> Result; + /// Persistent KV status and counters for `/health` (sc#505). `None` (the default, and the + /// omega door with `AIEN_KV_STORE_DIR` unset) leaves `/health` exactly as it was. + fn persistence_status(&self) -> Option { + None + } } /// Test engine: ignores the prompt and replays a fixed token list, optionally diff --git a/crates/aien-serve-http/src/kv_persist.rs b/crates/aien-serve-http/src/kv_persist.rs new file mode 100644 index 00000000..1ae7f94f --- /dev/null +++ b/crates/aien-serve-http/src/kv_persist.rs @@ -0,0 +1,1605 @@ +//! Persistent KV park and restore on the omega door (sc#505, ADR 0003), opt in with +//! `AIEN_KV_STORE_DIR`. +//! +//! With the directory unset nothing in this module runs: [`settings_from_lookup`] reads that one +//! variable and returns `None`, the door keeps [`PersistState::Off`], and generation, logs and +//! `/health` are what they were before persistence existed. +//! +//! With it set the door opens the sealed host store (`aien-kv-store`, the #511/#512 rules: a +//! private directory under a trusted parent, `AIEN_KV_STORE_KEY` required) and: +//! +//! - **park**: after a generation, under the GPU lock, the K/V of every chunk of the stored +//! history that the store does not hold yet is exported (`Qwen3MoeOmegaEngine::export_kv`, the +//! `HostPagedPoolV1` bytes of `kvio`); the lock is released and the chunks are submitted to the +//! storage worker, which seals and writes them on its own thread. +//! - **restore**: before a generation, without the GPU lock, the longest stored prefix of the +//! prompt (capped at `len - 1`, ADR 6.5: the last prompt token is always stepped) is looked up +//! and loaded; only when it is longer than what the engine still holds in RAM is it imported +//! (under the GPU lock, `restore_kv`), all or nothing. +//! +//! Every problem (store refused at start, missing or malformed key, unknown omega switch, a +//! miss, a failed or corrupt load, a timeout, an import error) ends in a plain prefill. Nothing +//! is ever partly restored: `restore_kv` resets the engine on error. +//! +//! The namespace binds the checkpoint digest, the model shape, the bf16 pool layout, the chunk +//! size, the sharing namespace and the engine identity of ADR 1.2.2 built by +//! [`OmegaKvIdentity::new`]: weight format as loaded, the build (omega commit, linked +//! `libomega_gpu.a` sha256, this crate's commit), a rounding class, and an engine config digest +//! over the MoE shape and every run switch that can move a K/V byte. +//! +//! Exactness limit (ADR 6.3 deviation): a stored tail chunk is found only when the prompt +//! continues the parked history; a prompt that diverges inside a chunk restores up to the last +//! whole chunk before the divergence, and may then restore less than the in-RAM rule would reuse +//! in an uninterrupted run (correct, only slower). + +use std::collections::{BTreeMap, HashMap}; +use std::io::Read; +use std::path::{Path, PathBuf}; +use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; +use std::sync::{Arc, Mutex}; +use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH}; + +use aien_inference_abi::qwen3_moe_omega::kvio::{self, PoolBlockGeometry}; +use aien_inference_abi::qwen3_moe_omega::{ + OmegaKvSwitches, Qwen3MoeConfig, Qwen3MoeOmegaEngine, WeightFormat, KV_BLOCK_SIZE, +}; +use aien_kv_store::host_fs::{Boundary, FaultAction, FaultHook, HostFsConfig, HostFsStore}; +use aien_kv_store::worker::StorageWorker; +use aien_kv_store::{ + chunk_chain, chunk_key, BackendFormat, ChunkHeader, ChunkKey, ComputeConfig, EngineConfig, + EngineIdentity, HiddenAct, HolderGuard, Incarnation, JobId, KvDtype, KvStore, LayoutStrides, + NamespaceFields, NamespaceId, PinnedDest, PinnedSource, RecoveryProgress, StoreState, Terminal, +}; +use aien_runtime::shared_kv::{KvPersistSettings, KV_STORE_DIR_ENV}; +use sha2::{Digest, Sha256}; + +/// `ComputeConfig::arith_id` of the omega engine. +pub const ARITH_ID: &str = "omega-qwen3-moe"; +/// Domain of the omega engine config digest. +const OMEGA_ENG_DOMAIN: &[u8] = b"AIEN-PKV-OMEGA-ENG-V1\0"; +/// How long a restore waits for its chunks before giving up (plain prefill). +pub const LOAD_TIMEOUT: Duration = Duration::from_secs(10); +/// How long a park waits for the storage worker's park budget to free (its earlier chunks +/// publishing) before it gives up on the rest of the chain. One 256-token chunk of the 30B model +/// is 25 MB and the default park budget is 64 MB, so a long turn always waits for credit (#514). +pub const PARK_CREDIT_WAIT: Duration = Duration::from_secs(10); + +/// Omega environment switches that are read at run time and can change what the chip computes +/// (omega C `getenv` and the engine's own). Their values are part of the engine config digest. +pub const NUMERIC_ENV: &[&str] = &[ + "AIEN_OMEGA_CTA_BUDGET", + "AIEN_OMEGA_DGRAPH_BARRIER", + "AIEN_OMEGA_DGRAPH_PREFETCH", + "AIEN_OMEGA_FP8_GEMV", + "AIEN_OMEGA_FP8_WEIGHT_CACHE", + "OWN30B_DECODE_GRAPH", + "OWN30B_DECODE_GRAPH_STAMPS", +]; +/// Omega variables that cannot move a K/V byte: timing (spin), build inputs (bound by the archive +/// digest in the build id) and test paths. +pub const NEUTRAL_ENV: &[&str] = &[ + "AIEN_OMEGA_SPIN_US", + "AIEN_OMEGA_DIR", + "AIEN_OMEGA_GPU", + "AIEN_OMEGA_GPU_LIB", + "AIEN_OMEGA_GPU_LIB_SHA256", + "AIEN_OMEGA_PINNED_SHA", + "AIEN_OMEGA_COMPOSE", + "AIEN_OMEGA_COMPOSE_DIR", + "AIEN_OMEGA_COMPOSE_LIB", + "AIEN_OMEGA_COMPOSE_LIB_SHA256", + "AIEN_OMEGA_COMPOSE_SHA", + "AIEN_OMEGA_COMPOSE_EXPECTED_SHA", + "OWN30B_MODEL_DIR", + "OWN30B_CHECKPOINT", +]; +/// Negative controls: persistence refuses while one is set. +pub const MUTANT_ENV: &[&str] = &["OWN30B_DECODE_GRAPH_MUTANT"]; + +/// The build of the engine that writes the K/V. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct OmegaBuild { + /// The omega commit `omega.lock` pins. + pub omega_commit: String, + /// How `libomega_gpu.a` was linked (`pinned-source`, `dev-override`, `prebuilt`, `stub`). + pub gpu_link: String, + /// sha256 of the linked `libomega_gpu.a`. + pub gpu_archive_sha256: String, + /// `locked` (the sha `native-artifacts.lock` records), `unrecorded` (no record for this + /// commit and target), `mismatch` or `none`. + pub gpu_digest: String, + pub gpu_target: String, + /// This crate's commit (`build.rs`). + pub sc_commit: String, + /// Built from a checkout with modified tracked files (or unknown). + pub sc_dirty: bool, +} + +impl OmegaBuild { + /// What this binary was built from and linked. + pub fn linked() -> Self { + let id = aien_omega_gpu::native_identity(); + let recorded = env!("AIEN_SERVE_HTTP_GPU_RECORDED_SHA256"); + let gpu_digest = if id.archive_sha256.is_empty() { + "none" + } else if recorded == "unrecorded" { + "unrecorded" + } else if recorded == id.archive_sha256 { + "locked" + } else { + "mismatch" + }; + let pin = env!("AIEN_SERVE_HTTP_OMEGA_LOCK"); + Self { + omega_commit: pin.to_string(), + // A pinned-source archive built from another commit than the pin is not the pin. + gpu_link: if id.link == "pinned-source" && id.source_sha != pin { + "pinned-source-other-commit".into() + } else { + id.link.to_string() + }, + gpu_archive_sha256: id.archive_sha256.to_string(), + gpu_digest: gpu_digest.to_string(), + gpu_target: id.target.to_string(), + sc_commit: env!("AIEN_SERVE_HTTP_GIT_COMMIT").to_string(), + sc_dirty: env!("AIEN_SERVE_HTTP_GIT_DIRTY") != "0", + } + } + + /// `omega:+libomega_gpu:+sc:`. Refused when any part is unknown or + /// cannot be trusted to name the bytes that run (fail closed). + pub fn build_id(&self) -> Result { + let hex = |s: &str, n: usize| s.len() == n && s.bytes().all(|b| b.is_ascii_hexdigit()); + if self.gpu_link != "pinned-source" { + return Err(format!( + "libomega_gpu.a is linked as {:?}, not built from the omega.lock pin", + self.gpu_link + )); + } + if !hex(&self.gpu_archive_sha256, 64) { + return Err("the linked libomega_gpu.a has no sha256".into()); + } + if !matches!(self.gpu_digest.as_str(), "locked" | "unrecorded") { + return Err(format!( + "libomega_gpu.a digest is {:?} against native-artifacts.lock", + self.gpu_digest + )); + } + if !hex(&self.omega_commit, 40) { + return Err(format!( + "omega.lock commit {:?} is not a 40-hex commit", + self.omega_commit + )); + } + if !(self.sc_commit.len() >= 7 + && self.sc_commit.len() <= 64 + && hex(&self.sc_commit, self.sc_commit.len())) + { + return Err(format!( + "the engine commit {:?} is unknown (build without git; set AIEN_BUILD_COMMIT)", + self.sc_commit + )); + } + if self.sc_dirty { + return Err("the binary was built from a checkout with uncommitted changes".into()); + } + if self.gpu_target.is_empty() { + return Err("the linked libomega_gpu.a has no target".into()); + } + Ok(format!( + "omega:{}+libomega_gpu:{}+sc:{}", + self.omega_commit, self.gpu_archive_sha256, self.sc_commit + )) + } +} + +/// Everything the omega engine identity is built from. +pub struct IdentityInputs<'a> { + /// The served model id (namespace field 4). + pub model_id: &'a str, + pub model_sha256: [u8; 32], + /// `file` or `index+shards` ([`checkpoint_digest`]). + pub model_digest_kind: &'a str, + pub config: &'a Qwen3MoeConfig, + /// `config.json` has a non-null `rope_scaling` (the omega engine has no scaled rope: refused). + pub rope_scaling: bool, + pub weights: WeightFormat, + pub switches: OmegaKvSwitches, + pub build: &'a OmegaBuild, + /// The process environment (name, value). + pub env: &'a [(String, String)], +} + +/// The owned namespace inputs of the omega door, except the chunk size and the sharing +/// namespace (from the settings). +#[derive(Debug, Clone, PartialEq)] +pub struct OmegaKvIdentity { + pub weight_format: aien_kv_store::WeightFormat, + pub engine_build_id: String, + pub rounding_class: String, + pub engine_config_digest: [u8; 32], + model_sha256: [u8; 32], + model_digest_kind: String, + model_id: String, + num_layers: u32, + num_kv_heads: u32, + head_dim: u32, + rope_theta: f32, + compute_config_digest: [u8; 32], + geometry: PoolBlockGeometry, +} + +fn store_weight_format(w: WeightFormat) -> aien_kv_store::WeightFormat { + match w { + WeightFormat::Bf16 => aien_kv_store::WeightFormat::Bf16, + WeightFormat::Fp8Experts => aien_kv_store::WeightFormat::Fp8Experts, + WeightFormat::Fp8All => aien_kv_store::WeightFormat::Fp8All, + } +} + +fn weights_label(w: WeightFormat) -> &'static str { + match w { + WeightFormat::Bf16 => "bf16", + WeightFormat::Fp8Experts => "fp8-experts", + WeightFormat::Fp8All => "fp8-all", + } +} + +fn u32_of(name: &str, v: usize) -> Result { + u32::try_from(v).map_err(|_| format!("{name} {v} does not fit 32 bits")) +} + +impl OmegaKvIdentity { + pub fn new(i: &IdentityInputs<'_>) -> Result { + if i.rope_scaling { + return Err("config.json has rope_scaling, the omega engine has no scaled rope".into()); + } + // The omega environment: mutants refuse, unknown switches refuse (unsure = refuse), the + // numeric ones are bound by value. + let mut numeric: BTreeMap<&str, &str> = BTreeMap::new(); + for (k, v) in i.env { + let omega = k.starts_with("AIEN_OMEGA_") || k.starts_with("OWN30B_"); + if !omega { + continue; + } + if MUTANT_ENV.contains(&k.as_str()) { + if !v.is_empty() { + return Err(format!( + "{k} is set (a negative control): K/V from a mutant must never be stored" + )); + } + } else if let Some(n) = NUMERIC_ENV.iter().find(|n| **n == k.as_str()) { + numeric.insert(n, v.as_str()); + } else if !NEUTRAL_ENV.contains(&k.as_str()) { + return Err(format!("{k} is set and its effect on the K/V is not known")); + } + } + // Exhaustive on purpose: no `..`, so a new run switch has to be placed here. + let OmegaKvSwitches { + attention_path, + device_routing, + prefill_chunk, + prefill_gemm, + prefill_device_routing, + whole_prompt, + whole_prompt_device_host, + decode_graph, + lm_head_gemv, + routing_mutant, + trace_layers, + } = i.switches; + if routing_mutant { + return Err("the engine runs the routing mutant (a negative control)".into()); + } + // Exhaustive on purpose: no `..`. + let Qwen3MoeConfig { + layers, + hidden, + q_heads, + kv_heads, + head_dim, + experts, + top_k, + moe_intermediate, + vocab, + rms_eps, + rope_theta, + norm_topk_prob, + tie_word_embeddings, + // Decides when a sequence stops, not what is computed. + eos_token_ids: _, + } = i.config; + let engine_build_id = i.build.build_id()?; + let base = EngineConfig { + num_experts: u32_of("experts", *experts)?, + experts_per_token: u32_of("top_k", *top_k)?, + expert_intermediate_dim: *moe_intermediate as u64, + whole_prompt_prefill: whole_prompt, + device_router: device_routing, + matmul_path: if prefill_gemm { + "fp8-grouped-gemm" + } else { + "grouped-gemv" + }, + } + .digest() + .map_err(|e| format!("engine config: {e:?}"))?; + let mut text = format!( + "weights={}\nnorm_topk_prob={norm_topk_prob}\nattention_path={attention_path}\nprefill_chunk={prefill_chunk}\nprefill_device_routing={prefill_device_routing}\nwhole_prompt_device_host={whole_prompt_device_host}\ndecode_graph={decode_graph}\nlm_head_gemv={lm_head_gemv}\ntrace_layers={trace_layers}\nq_heads={q_heads}\n", + weights_label(i.weights) + ); + for n in NUMERIC_ENV { + match numeric.get(n) { + Some(v) => text.push_str(&format!("env {n}={v:?}\n")), + None => text.push_str(&format!("env {n} unset\n")), + } + } + let mut h = Sha256::new(); + h.update(OMEGA_ENG_DOMAIN); + h.update(base); + h.update(text.as_bytes()); + let engine_config_digest: [u8; 32] = h.finalize().into(); + let rounding_class = format!( + "omega-gpu/{}/{}/kv-bf16/attn-{attention_path}@kv-arith-epoch-{}", + i.build.gpu_target, + weights_label(i.weights), + aien_inference_abi::KV_ARITH_EPOCH + ); + let weight_format = store_weight_format(i.weights); + let engine = EngineIdentity { + weight_format, + engine_build_id: &engine_build_id, + rounding_class: &rounding_class, + engine_config_digest, + }; + let compute_config_digest = ComputeConfig { + num_heads: u32_of("q_heads", *q_heads)?, + hidden_dim: *hidden as u64, + intermediate_dim: *moe_intermediate as u64, + vocab_size: *vocab as u64, + rms_norm_eps: *rms_eps, + tie_word_embeddings: *tie_word_embeddings, + hidden_act: HiddenAct::Silu, + arith_id: ARITH_ID, + arith_epoch: aien_inference_abi::KV_ARITH_EPOCH, + } + .digest_with_engine(&engine) + .map_err(|e| format!("compute config: {e:?}"))?; + Ok(Self { + weight_format, + engine_build_id, + rounding_class, + engine_config_digest, + model_sha256: i.model_sha256, + model_digest_kind: i.model_digest_kind.to_string(), + model_id: i.model_id.to_string(), + num_layers: u32_of("layers", *layers)?, + num_kv_heads: u32_of("kv_heads", *kv_heads)?, + head_dim: u32_of("head_dim", *head_dim)?, + rope_theta: *rope_theta, + compute_config_digest, + geometry: PoolBlockGeometry::for_config(i.config), + }) + } + + /// The namespace fields for `chunk_tokens` and `sharing_namespace`. + pub fn fields<'a>( + &'a self, + chunk_tokens: u32, + sharing_namespace: &'a str, + ) -> NamespaceFields<'a> { + let g = &self.geometry; + NamespaceFields { + model_sha256: self.model_sha256, + model_digest_kind: &self.model_digest_kind, + model_id: &self.model_id, + num_layers: self.num_layers, + num_kv_heads: self.num_kv_heads, + head_dim: self.head_dim, + block_size: KV_BLOCK_SIZE as u32, + rope_theta: self.rope_theta, + rope_scaling: None, + qk_norm: true, + dtype: KvDtype::Bf16, + layout: LayoutStrides { + head_stride: g.head_stride() as u64, + token_stride: g.token_stride() as u64, + kv_plane_stride: g.kv_plane_stride() as u64, + layer_stride: g.layer_stride() as u64, + block_stride: g.block_stride() as u64, + element_bytes: 2, + }, + backend_format: BackendFormat::HostPagedPoolV1, + chunk_tokens, + sharing_namespace, + compute_config_digest: self.compute_config_digest, + } + } +} + +/// Test-only fault hook of the chip acceptance checks (sc#507): `AIEN_KV_TEST_FAULT` = +/// `:[:]` makes the store sleep at one point of its protocol so a +/// fault lands deterministically: `p1` before the temp write, `p2` before the temp fsync, `p3` +/// before the rename that publishes, `p4` before the directory fsync, `p5` before the index +/// insert, `load` before a restore read. `count` stalls only the first N passes (default 0: +/// every pass). It only delays I/O: no K/V byte changes, so it is not part of the identity. +/// Unset in production; a malformed value refuses persistence (fail closed). +pub const TEST_FAULT_ENV: &str = "AIEN_KV_TEST_FAULT"; + +/// The parsed `AIEN_KV_TEST_FAULT` stall. +pub struct TestFault { + boundary: Boundary, + stall: Duration, + /// Passes still to stall; `u64::MAX` = every pass. + left: AtomicU64, + spec: String, +} + +impl TestFault { + /// `None` when the variable is unset or empty. + pub fn from_lookup(get: impl Fn(&str) -> Option) -> Result>, String> { + let Some(spec) = get(TEST_FAULT_ENV).filter(|s| !s.is_empty()) else { + return Ok(None); + }; + let bad = || { + format!( + "{TEST_FAULT_ENV}={spec:?}: expected :[:]" + ) + }; + let parts: Vec<&str> = spec.split(':').collect(); + if !(2..=3).contains(&parts.len()) { + return Err(bad()); + } + let boundary = match parts[0] { + "p1" => Boundary::P1Write, + "p2" => Boundary::P2FsyncFile, + "p3" => Boundary::P3Rename, + "p4" => Boundary::P4FsyncDir, + "p5" => Boundary::P5IndexInsert, + "load" => Boundary::LoadRead, + _ => return Err(bad()), + }; + let ms: u64 = parts[1].parse().map_err(|_| bad())?; + let count: u64 = match parts.get(2) { + Some(c) => c.parse().map_err(|_| bad())?, + None => 0, + }; + Ok(Some(Arc::new(Self { + boundary, + stall: Duration::from_millis(ms), + left: AtomicU64::new(if count == 0 { u64::MAX } else { count }), + spec, + }))) + } + + pub fn spec(&self) -> &str { + &self.spec + } +} + +impl FaultHook for TestFault { + fn at(&self, boundary: Boundary, _key: &ChunkKey) -> Option { + if boundary != self.boundary { + return None; + } + let took = self + .left + .fetch_update(Ordering::Relaxed, Ordering::Relaxed, |n| match n { + 0 => None, + u64::MAX => Some(u64::MAX), + n => Some(n - 1), + }) + .is_ok(); + took.then_some(FaultAction::Stall(self.stall)) + } +} + +/// Persistence settings when `AIEN_KV_STORE_DIR` is set and not empty; `None` otherwise, having +/// read nothing but that one variable (the switch-off path). +pub fn settings_from_lookup( + get: impl Fn(&str) -> Option, +) -> Option> { + let dir = get(KV_STORE_DIR_ENV)?; + if dir.is_empty() { + return None; + } + Some(KvPersistSettings::from_lookup(|n| { + if n == KV_STORE_DIR_ENV { + Some(dir.clone()) + } else { + get(n) + } + })) +} + +/// sha256 of a file, streamed. +fn sha256_file(p: &Path) -> Result<[u8; 32], String> { + let mut f = std::fs::File::open(p).map_err(|e| format!("{}: {e}", p.display()))?; + let mut h = Sha256::new(); + let mut buf = vec![0u8; 8 << 20]; + loop { + let n = f + .read(&mut buf) + .map_err(|e| format!("{}: {e}", p.display()))?; + if n == 0 { + break; + } + h.update(&buf[..n]); + } + Ok(h.finalize().into()) +} + +fn hex(b: &[u8]) -> String { + b.iter().map(|x| format!("{x:02x}")).collect() +} + +/// The checkpoint digest of `aien-cli` (`checkpoint_digest`): one weight file is its sha256 +/// (`file`); a sharded checkpoint is the sha256 of the manifest `aien-checkpoint-digest v1`, +/// the index sha256 and one ` ` line per shard (`index+shards`). +pub fn checkpoint_digest(model_dir: &Path) -> Result<([u8; 32], &'static str), String> { + let index = model_dir.join("model.safetensors.index.json"); + let path = if index.exists() { + index + } else { + model_dir.join("model.safetensors") + }; + let files = aien_inference_abi::checkpoint_files(&path) + .map_err(|e| format!("{}: {e}", path.display()))?; + let Some(index) = files.index else { + let (_, file) = files + .weights + .first() + .ok_or("the checkpoint names no weight file")?; + return Ok((sha256_file(file)?, "file")); + }; + if files.weights.is_empty() { + return Err("the shard index names no shard".into()); + } + let mut manifest = format!( + "aien-checkpoint-digest v1\nindex {}\n", + hex(&sha256_file(&index)?) + ); + for (name, file) in &files.weights { + manifest.push_str(&format!("{} {name}\n", hex(&sha256_file(file)?))); + } + Ok((Sha256::digest(manifest.as_bytes()).into(), "index+shards")) +} + +/// Whether `config.json` in `model_dir` sets a non-null `rope_scaling`. +pub fn config_has_rope_scaling(model_dir: &Path) -> Result { + let p = model_dir.join("config.json"); + let text = std::fs::read_to_string(&p).map_err(|e| format!("{}: {e}", p.display()))?; + let v: serde_json::Value = + serde_json::from_str(&text).map_err(|e| format!("{}: {e}", p.display()))?; + Ok(v.get("rope_scaling").is_some_and(|r| !r.is_null())) +} + +/// What the door does about persistence. +pub enum PersistState { + /// `AIEN_KV_STORE_DIR` unset: nothing runs. + Off, + /// Asked for, refused at start: every prompt is prefilled. + Refused(String), + On(Box), +} + +/// Counters of the persistence path (`/health` `persistent_kv`). +#[derive(Debug, Clone, Default, PartialEq, Eq)] +pub struct PersistCounters { + /// Chunks the store published. + pub parked_chunks: u64, + pub park_bytes: u64, + /// Chunks of the history the store already held. + pub park_dedup: u64, + /// Chunks the store refused at submit (quota, queue, state). + pub park_refused: u64, + /// Chunks whose export or write failed. + pub park_failed: u64, + /// Generations not parked because the store was not open (recovering, degraded, failed). + pub park_skipped: u64, + /// Generations that started from a restored prefix. + pub restores: u64, + pub restored_tokens: u64, + pub restore_bytes: u64, + /// Restore attempts that fell back to plain prefill, by reason. + pub restore_misses: BTreeMap, + /// Start refusals (0 or 1). + pub refusals: u64, +} + +/// One stored chunk of a restore: `stored` tokens on disk, the first `used` of them restored. +struct StoredChunk { + key: ChunkKey, + parent: Option, + first: usize, + stored: usize, + used: usize, +} + +/// A loaded prefix, ready to import. +pub struct Fetched { + pub tokens: usize, + pub payload: Vec, +} + +/// One exported chunk waiting for the store. +pub struct ParkItem { + header: ChunkHeader, + tokens: usize, + bytes: Vec, +} + +/// The landing buffer of one load: shared by the load job (through its holder guard) and the +/// door; freed when both let go. +struct LandBuf { + ptr: *mut u8, + len: usize, + _buf: Box<[u8]>, +} + +// SAFETY: the bytes behind `ptr` are written only by the load job while its holder is held, and +// read by the door only after that job's terminal completion was polled (ADR 5.5). +unsafe impl Send for LandBuf {} +unsafe impl Sync for LandBuf {} + +impl LandBuf { + fn new(len: usize) -> Arc { + let mut buf = vec![0u8; len].into_boxed_slice(); + let ptr = buf.as_mut_ptr(); + Arc::new(Self { + ptr, + len, + _buf: buf, + }) + } + /// # Safety + /// Only after the load job writing this buffer has reached its terminal completion. + unsafe fn bytes(&self) -> &[u8] { + std::slice::from_raw_parts(self.ptr, self.len) + } +} + +#[derive(Default)] +struct Inner { + counters: PersistCounters, + /// In-flight park jobs. + stores: HashMap, + /// In-flight load jobs: `None` until the terminal arrives. + loads: HashMap>>, +} + +/// An open store with its worker, for one omega door. +pub struct KvPersistence { + worker: Arc, + /// The store itself, read only for its I/O and recovery counters in `/health` (#509). + store: Arc, + /// The last recovery step's progress (startup recovery, #509). + recovery: Arc>, + identity: OmegaKvIdentity, + sharing: String, + chunk_tokens: usize, + ns: NamespaceId, + store_dir: PathBuf, + park: AtomicBool, + restore: bool, + drain_ms: u64, + inner: Mutex, + seq: AtomicU64, + /// The armed [`TEST_FAULT_ENV`] spec, if any. + test_fault: Option, +} + +fn miss_reason(e: &aien_platform::PlatformError) -> &'static str { + use aien_platform::PlatformError as P; + match e { + P::ObjectNotFound(_) => "not-found", + P::InvalidLayout => "invalid", + P::AccessDenied => "access-denied", + P::HardwareFault(_) => "io", + P::QueueFull | P::OutOfMemory => "busy", + P::DeviceUnavailable => "store-unavailable", + _ => "error", + } +} + +fn now_ns() -> u64 { + SystemTime::now() + .duration_since(UNIX_EPOCH) + .map(|d| d.as_nanos() as u64) + .unwrap_or(0) +} + +impl KvPersistence { + fn fields(&self) -> NamespaceFields<'_> { + self.identity + .fields(self.chunk_tokens as u32, &self.sharing) + } + + fn inc(&self) -> Incarnation { + Incarnation::new(self.seq.fetch_add(1, Ordering::Relaxed) + 1, 1) + } + + fn block_bytes(&self) -> usize { + self.identity.geometry.block_stride() + } + + /// The store finished recovery (or failed) within `timeout`. + pub fn wait_ready(&self, timeout: Duration) -> bool { + let t0 = Instant::now(); + loop { + if self.worker.capacity().state != StoreState::Recovering { + return true; + } + if t0.elapsed() >= timeout { + return false; + } + std::thread::sleep(Duration::from_millis(2)); + } + } + + /// Every submitted park reached its terminal within `timeout`. + pub fn wait_idle(&self, timeout: Duration) -> bool { + let t0 = Instant::now(); + loop { + { + let mut g = self.inner.lock().unwrap_or_else(|p| p.into_inner()); + self.pump(&mut g); + if g.stores.is_empty() { + return true; + } + } + if t0.elapsed() >= timeout { + return false; + } + std::thread::sleep(Duration::from_millis(1)); + } + } + + pub fn counters(&self) -> PersistCounters { + let mut g = self.inner.lock().unwrap_or_else(|p| p.into_inner()); + self.pump(&mut g); + g.counters.clone() + } + + pub fn status_json(&self) -> serde_json::Value { + let c = self.counters(); + let t = aien_kv_store::seal::seal_timing(); + let r = *self.recovery.lock().unwrap_or_else(|p| p.into_inner()); + let s = self.store.stats(); + let state = match self.worker.capacity().state { + StoreState::Recovering => "recovering", + StoreState::Open => "open", + StoreState::Degraded => "degraded", + StoreState::Failed => "failed", + }; + serde_json::json!({ + "state": "on", + "store_state": state, + "store_dir": self.store_dir.display().to_string(), + "namespace": hex(&self.ns.0[..8]), + "chunk_tokens": self.chunk_tokens, + "park": self.park.load(Ordering::Relaxed), + "restore": self.restore, + "engine_build_id": self.identity.engine_build_id, + "rounding_class": self.identity.rounding_class, + "parked_chunks": c.parked_chunks, + "park_bytes": c.park_bytes, + "park_dedup": c.park_dedup, + "park_refused": c.park_refused, + "park_failed": c.park_failed, + "park_skipped": c.park_skipped, + "restores": c.restores, + "restored_tokens": c.restored_tokens, + "restore_bytes": c.restore_bytes, + "restore_misses": c.restore_misses, + "refusals": c.refusals, + "seal": { + "seal_calls": t.seal_calls, + "seal_bytes": t.seal_bytes, + "seal_ns": t.seal_ns, + "open_calls": t.open_calls, + "open_bytes": t.open_bytes, + "open_ns": t.open_ns, + }, + "recovery": { + "done": r.done, + "failed": r.failed, + "indexed": r.indexed, + "indexed_bytes": r.bytes, + "foreign_namespace": r.foreign_namespace, + "corrupt_deleted": r.corrupt_deleted, + "tmp_deleted": r.tmp_deleted, + "elapsed_us": r.elapsed_us, + "unlink_failures": s.recovery_unlink_failures, + "foreign_files": s.foreign_files, + }, + "io": { + "reads": s.reads, + "read_bytes": s.read_bytes, + "writes": s.writes, + "write_bytes": s.write_bytes, + "file_fsyncs": s.file_fsyncs, + "published": s.published_total, + "disk_full": s.disk_full_total, + "queue_full": s.queue_full_total, + "indeterminate": s.indeterminate_total, + "failed": s.terminal_failed, + "corrupt_deleted": s.corrupt_deleted_total, + }, + "test_fault": self.test_fault, + }) + } + + fn miss(&self, reason: &str) { + let mut g = self.inner.lock().unwrap_or_else(|p| p.into_inner()); + *g.counters + .restore_misses + .entry(reason.to_string()) + .or_insert(0) += 1; + } + + /// Drains the worker's completions into the counters and the load slots. + fn pump(&self, g: &mut Inner) { + loop { + let batch = self.worker.poll(64); + if batch.is_empty() { + return; + } + for c in batch { + let Some(t) = c.terminal else { continue }; + if let Some(bytes) = g.stores.remove(&c.job) { + match t { + Terminal::Done(_) => { + g.counters.parked_chunks += 1; + g.counters.park_bytes += bytes; + } + Terminal::Failed(_) | Terminal::Cancelled => g.counters.park_failed += 1, + } + } else if let Some(slot) = g.loads.get_mut(&c.job) { + *slot = Some(match t { + Terminal::Done(_) => Ok(()), + Terminal::Failed(e) => Err(miss_reason(&e).to_string()), + Terminal::Cancelled => Err("cancelled".to_string()), + }); + } + // `c.holder` (a load's landing holder) drops here, after the slot is set. + } + } + } + + /// Pauses or resumes parking (the chip check freezes the store after turn 1). + pub fn set_park(&self, on: bool) { + self.park.store(on, Ordering::Relaxed); + } + + pub fn restore_on(&self) -> bool { + self.restore + } + + /// The chunks of the longest stored prefix of `prompt` (capped at `len - 1`). + fn find(&self, prompt: &[u32]) -> Result, &'static str> { + let cap = prompt.len().saturating_sub(1); + let ct = self.chunk_tokens; + if cap == 0 { + return Err("short-prompt"); + } + let full = cap / ct; + let keys = if full > 0 { + chunk_chain(&self.ns, ct as u32, &prompt[..full * ct]).map_err(|_| "key")? + } else { + Vec::new() + }; + let found = self.worker.lookup(&keys); + let f = found.iter().take_while(|x| x.is_some()).count(); + let mut out: Vec = (0..f) + .map(|i| StoredChunk { + key: keys[i], + parent: i.checked_sub(1).map(|p| keys[p]), + first: i * ct, + stored: ct, + used: ct, + }) + .collect(); + // The tail: the parked history may end inside chunk `f` (a stored partial chunk). + let first = f * ct; + // Probe up to the prompt end, use up to the cap: a stored tail that runs to the last + // prompt token still serves every position before it (ADR 6.5). + let max_len = if first < cap { + ct.min(prompt.len() - first) + } else { + 0 + }; + let parent = f.checked_sub(1).map(|p| keys[p]); + let lens: Vec = (1..=max_len) + .rev() + .filter(|&l| !(l == ct && f < full)) + .collect(); + let mut tail_keys = Vec::with_capacity(lens.len()); + for &l in &lens { + tail_keys.push( + chunk_key( + &self.ns, + parent.as_ref(), + first as u32, + &prompt[first..first + l], + ) + .map_err(|_| "key")?, + ); + } + let tail_found = self.worker.lookup(&tail_keys); + if let Some(j) = tail_found.iter().position(|x| x.is_some()) { + out.push(StoredChunk { + key: tail_keys[j], + parent, + first, + stored: lens[j], + used: lens[j].min(cap - first), + }); + } + Ok(out) + } + + /// Looks up and loads the longest stored prefix of `prompt` when it beats `in_ram`. Runs + /// without the GPU lock. `None` = plain prefill (the reason is counted). + pub fn fetch(&self, prompt: &[u32], in_ram: usize) -> Option { + if self.worker.capacity().state == StoreState::Recovering { + self.miss("store-recovering"); + return None; + } + let chunks = match self.find(prompt) { + Ok(c) => c, + Err(r) => { + self.miss(r); + return None; + } + }; + let r: usize = chunks.iter().map(|c| c.used).sum(); + if r == 0 { + self.miss("not-found"); + return None; + } + if r <= in_ram { + self.miss("ram-prefix-as-long"); + return None; + } + let fields = self.fields(); + let mut jobs: Vec<(JobId, Arc)> = Vec::new(); + let mut fail: Option = None; + let t_fetch = Instant::now(); + for c in &chunks { + let (key, tokens) = (c.key, c.stored); + let header = match fields.chunk_header( + &self.ns, + key, + c.parent.as_ref(), + c.first as u32, + tokens as u32, + 0, + ) { + Ok(h) => h, + Err(_) => { + fail = Some("header".into()); + break; + } + }; + let len = header.payload_len as usize; + let nb = tokens.div_ceil(KV_BLOCK_SIZE); + if len != nb * self.block_bytes() { + fail = Some("invalid".into()); + break; + } + let buf = LandBuf::new(len); + // A prefix larger than the worker's restore budget is normal on the real model (a + // 2079-token prefix of the 30B is 204 MB, the default restore budget 192 MB): on + // `QueueFull` the chunk waits for the earlier loads to land and free their credit, + // within [`LOAD_TIMEOUT`] of the fetch start (#514). The inner lock is not held + // while waiting. + loop { + let keep = buf.clone(); + // SAFETY: `buf` stays allocated while the guard (held by the job) lives, and + // nobody reads it until the job's terminal completion has been polled. A refused + // submit drops its guard; `buf` itself stays alive for the retry. + let dst = unsafe { + PinnedDest::new( + buf.ptr, + self.block_bytes(), + (0..nb).collect(), + HolderGuard::new(move || drop(keep)), + ) + }; + let mut g = self.inner.lock().unwrap_or_else(|p| p.into_inner()); + self.pump(&mut g); + match self.worker.submit_load(key, &header, dst, self.inc()) { + Ok(job) => { + g.loads.insert(job, None); + jobs.push((job, buf)); + break; + } + Err(aien_platform::PlatformError::QueueFull) + if t_fetch.elapsed() < LOAD_TIMEOUT => + { + drop(g); + std::thread::sleep(Duration::from_micros(200)); + } + Err(e) => { + fail = Some(miss_reason(&e).to_string()); + break; + } + } + } + if fail.is_some() { + break; + } + } + if fail.is_none() { + let t0 = Instant::now(); + loop { + let mut g = self.inner.lock().unwrap_or_else(|p| p.into_inner()); + self.pump(&mut g); + let mut all = true; + for (job, _) in &jobs { + match g.loads.get(job) { + Some(Some(Ok(()))) => {} + Some(Some(Err(e))) => { + fail = Some(e.clone()); + break; + } + _ => all = false, + } + } + if fail.is_some() || all { + break; + } + drop(g); + if t0.elapsed() >= LOAD_TIMEOUT { + fail = Some("timeout".into()); + break; + } + std::thread::sleep(Duration::from_micros(200)); + } + } + let mut g = self.inner.lock().unwrap_or_else(|p| p.into_inner()); + if let Some(reason) = fail { + for (job, _) in &jobs { + if !matches!(g.loads.get(job), Some(Some(_))) { + let _ = self.worker.cancel(*job); + } + g.loads.remove(job); + } + *g.counters.restore_misses.entry(reason).or_insert(0) += 1; + // Buffers of jobs still running stay alive through their guards. + return None; + } + let mut payload = Vec::with_capacity(jobs.iter().map(|(_, b)| b.len).sum()); + for (job, buf) in &jobs { + g.loads.remove(job); + // SAFETY: the job's terminal `Done` was polled above. + payload.extend_from_slice(unsafe { buf.bytes() }); + } + // A tail chunk stored past the cap: keep its first rows, zero the rest of the block. + let g = &self.identity.geometry; + payload.truncate(g.payload_len(r)); + kvio::zero_padding(g, r, &mut payload); + Some(Fetched { tokens: r, payload }) + } + + /// Counts a restore that the engine imported. + pub fn note_restored(&self, f: &Fetched) { + let mut g = self.inner.lock().unwrap_or_else(|p| p.into_inner()); + g.counters.restores += 1; + g.counters.restored_tokens += f.tokens as u64; + g.counters.restore_bytes += f.payload.len() as u64; + } + + /// Counts a fetched prefix the engine refused to import (it was reset: plain prefill). + pub fn note_import_failed(&self) { + self.miss("import"); + } + + /// Under the GPU lock, after a generation: exports the chunks of the engine's history that + /// the store does not hold. Submitting them is [`Self::submit`], after the lock is released. + pub fn snapshot(&self, e: &mut Qwen3MoeOmegaEngine) -> Vec { + if !self.park.load(Ordering::Relaxed) { + return Vec::new(); + } + if self.worker.capacity().state != StoreState::Open { + self.inner + .lock() + .unwrap_or_else(|p| p.into_inner()) + .counters + .park_skipped += 1; + return Vec::new(); + } + let hist = e.history().to_vec(); + if hist.is_empty() { + return Vec::new(); + } + let ct = self.chunk_tokens; + let Ok(keys) = chunk_chain(&self.ns, ct as u32, &hist) else { + self.inner + .lock() + .unwrap_or_else(|p| p.into_inner()) + .counters + .park_failed += 1; + return Vec::new(); + }; + let found = self.worker.lookup(&keys); + let fields = self.fields(); + let written = now_ns(); + let mut items = Vec::new(); + let mut dedup = 0u64; + let mut failed = 0u64; + for (i, key) in keys.iter().enumerate() { + if found.get(i).copied().flatten().is_some() { + dedup += 1; + continue; + } + let first = i * ct; + let tokens = (hist.len() - first).min(ct); + let header = match fields.chunk_header( + &self.ns, + *key, + i.checked_sub(1).map(|p| &keys[p]), + first as u32, + tokens as u32, + written, + ) { + Ok(h) => h, + Err(_) => { + failed += 1; + break; + } + }; + match e.export_kv(first, tokens) { + Ok(bytes) if bytes.len() as u64 == header.payload_len => items.push(ParkItem { + header, + tokens, + bytes, + }), + _ => { + failed += 1; + break; + } + } + } + let mut g = self.inner.lock().unwrap_or_else(|p| p.into_inner()); + g.counters.park_dedup += dedup; + g.counters.park_failed += failed; + items + } + + /// Hands exported chunks to the storage worker (no GPU lock held). Stops at the first + /// refusal: a chain with a hole cannot be restored past it. + /// + /// A chain longer than the worker's park budget is normal on the real model (one 256-token + /// chunk of the 30B is 25 MB, the default budget 64 MB): on `QueueFull` the chunk waits, up to + /// [`PARK_CREDIT_WAIT`], for the earlier chunks to publish and free their credit, then retries. + /// Runs after the GPU lock is released; the inner lock is not held while waiting. + pub fn submit(&self, items: Vec) { + for it in items { + let nb = it.tokens.div_ceil(KV_BLOCK_SIZE); + let tail_valid = (it.tokens - (nb - 1) * KV_BLOCK_SIZE) as u32; + // Shared so a refused submit (which drops its guard) leaves the bytes for the retry. + let bytes: Arc<[u8]> = it.bytes.into(); + let len = bytes.len() as u64; + let t0 = Instant::now(); + loop { + let mut g = self.inner.lock().unwrap_or_else(|p| p.into_inner()); + self.pump(&mut g); + let keep = bytes.clone(); + // SAFETY: the guard owns a reference to the bytes, so they live and stay unwritten + // (nothing writes through an `Arc<[u8]>`) until the store releases the holder. + let src = unsafe { + PinnedSource::new( + bytes.as_ptr(), + self.block_bytes(), + (0..nb).collect(), + tail_valid, + HolderGuard::new(move || drop(keep)), + ) + }; + match self.worker.submit_store(it.header, src, self.inc()) { + Ok(job) => { + g.stores.insert(job, len); + break; + } + Err(aien_platform::PlatformError::QueueFull) + if t0.elapsed() < PARK_CREDIT_WAIT => + { + drop(g); + std::thread::sleep(Duration::from_micros(500)); + } + Err(_) => { + g.counters.park_refused += 1; + // A chain with a hole cannot be restored past it. + return; + } + } + } + } + } +} + +impl Drop for KvPersistence { + fn drop(&mut self) { + // Let the parks of the last turns publish, then stop the worker. + let _ = self.wait_idle(Duration::from_millis(self.drain_ms)); + let _ = self.worker.shutdown(self.drain_ms); + } +} + +/// Opens the store for `identity` under `settings`. Every problem refuses (plain prefill) and +/// says why on the returned startup line. +pub fn open( + settings: Result, + identity: Result, +) -> (PersistState, String) { + open_with_test_fault(settings, identity, Ok(None)) +} + +/// [`open`] with the store's test-only stall ([`TEST_FAULT_ENV`]); `Err` (a malformed value) refuses. +pub fn open_with_test_fault( + settings: Result, + identity: Result, + fault: Result>, String>, +) -> (PersistState, String) { + match open_inner(settings, identity, fault) { + Ok((p, line)) => (PersistState::On(Box::new(p)), line), + Err(why) => { + let line = format!("persistent KV: REFUSED ({why}); running without persistence: no park, no restore, every prompt is prefilled"); + (PersistState::Refused(why), line) + } + } +} + +fn open_inner( + settings: Result, + identity: Result, + fault: Result>, String>, +) -> Result<(KvPersistence, String), String> { + let settings = settings?; + let fault = fault?; + let root = settings.store_dir.clone().ok_or("no store directory")?; + let key = match &settings.store_key { + Some(Ok(k)) => k.clone(), + Some(Err(r)) => { + aien_kv_store::seal::note_key_refusal(); + return Err(format!("{r}")); + } + None => return Err("the store key was not read".into()), + }; + let identity = identity.map_err(|e| format!("engine identity: {e}"))?; + let chunk_tokens = (settings.chunk_blocks as usize) + .checked_mul(KV_BLOCK_SIZE) + .filter(|&t| u32::try_from(t).is_ok()) + .ok_or("AIEN_KV_CHUNK_BLOCKS: chunk size overflows")?; + let (ns, mut cfg) = { + let fields = identity.fields(chunk_tokens as u32, &settings.namespace); + let ns = fields + .namespace_id() + .map_err(|e| format!("namespace: {e:?}"))?; + ( + ns, + HostFsConfig::from_fields(root.clone(), &fields) + .map_err(|e| format!("store config: {e:?}"))?, + ) + }; + if let Some(v) = settings.quota_bytes { + cfg.quota_bytes = v; + } + if let Some(v) = settings.max_objects { + cfg.max_objects = v; + } + if let Some(v) = settings.recovery_slice_ms { + cfg.recovery_slice_ms = v; + } + cfg.seal_key = Some(key); + if let Some(f) = &fault { + cfg.faults = Some(f.clone() as Arc); + } + let slice_ms = cfg.recovery_slice_ms; + let recovery = Arc::new(Mutex::new(RecoveryProgress::default())); + let store = Arc::new(HostFsStore::open(cfg).map_err(|e| format!("store open at {}: {e:?} (the directory must be private, under a parent only you can write)", root.display()))?); + let drive = { + let store = store.clone(); + let progress = recovery.clone(); + let mut recovered = false; + move || { + if !recovered { + let p = store.recover_step(slice_ms); + *progress.lock().unwrap_or_else(|e| e.into_inner()) = p; + recovered = p.done || p.failed; + } + } + }; + let worker = Arc::new( + StorageWorker::spawn(store.clone(), settings.worker.clone(), drive) + .map_err(|e| format!("storage worker: {e:?}"))?, + ); + let line = format!( + "persistent KV: on, store {} namespace {:?} chunk {} tokens, weights {}, engine build {}, rounding {}, park {}, restore {}, drain {} ms (recovering in the background)", + root.display(), + settings.namespace, + chunk_tokens, + identity.weight_format.as_str(), + identity.engine_build_id, + identity.rounding_class, + if settings.park { "on" } else { "off" }, + if settings.restore { "on" } else { "off" }, + settings.worker.drain_ms, + ); + let line = match &fault { + Some(f) => format!( + "{line}; TEST FAULT {TEST_FAULT_ENV}={} armed (chip check only)", + f.spec() + ), + None => line, + }; + Ok(( + KvPersistence { + worker, + store, + recovery, + identity, + sharing: settings.namespace.clone(), + chunk_tokens, + ns, + store_dir: root, + park: AtomicBool::new(settings.park), + restore: settings.restore, + drain_ms: settings.worker.drain_ms, + inner: Mutex::new(Inner::default()), + seq: AtomicU64::new(0), + test_fault: fault.map(|f| f.spec().to_string()), + }, + line, + )) +} + +#[cfg(test)] +mod tests { + use super::*; + + fn build() -> OmegaBuild { + OmegaBuild { + omega_commit: "d0889a944b02066f84fec71af7b9bbb92f5c986f".into(), + gpu_link: "pinned-source".into(), + gpu_archive_sha256: "ab".repeat(32), + gpu_digest: "unrecorded".into(), + gpu_target: "aarch64-unknown-linux-gnu".into(), + sc_commit: "cd".repeat(20), + sc_dirty: false, + } + } + + fn config() -> Qwen3MoeConfig { + Qwen3MoeConfig { + layers: 48, + hidden: 2048, + q_heads: 32, + kv_heads: 4, + head_dim: 128, + experts: 128, + top_k: 8, + moe_intermediate: 768, + vocab: 151936, + rms_eps: 1e-6, + rope_theta: 1e7, + norm_topk_prob: true, + tie_word_embeddings: false, + eos_token_ids: vec![151645], + } + } + + fn switches() -> OmegaKvSwitches { + OmegaKvSwitches { + attention_path: "fused", + device_routing: true, + prefill_chunk: 64, + prefill_gemm: true, + prefill_device_routing: true, + whole_prompt: true, + whole_prompt_device_host: true, + decode_graph: false, + lm_head_gemv: true, + routing_mutant: false, + trace_layers: false, + } + } + + struct In { + model_id: String, + sha: [u8; 32], + kind: String, + config: Qwen3MoeConfig, + weights: WeightFormat, + switches: OmegaKvSwitches, + build: OmegaBuild, + env: Vec<(String, String)>, + } + + fn base() -> In { + In { + model_id: "qwen3-30b".into(), + sha: [1; 32], + kind: "index+shards".into(), + config: config(), + weights: WeightFormat::Fp8All, + switches: switches(), + build: build(), + env: vec![("PATH".into(), "/bin".into())], + } + } + + fn ns(i: &In) -> Result<[u8; 32], String> { + let id = OmegaKvIdentity::new(&IdentityInputs { + model_id: &i.model_id, + model_sha256: i.sha, + model_digest_kind: &i.kind, + config: &i.config, + rope_scaling: false, + weights: i.weights, + switches: i.switches, + build: &i.build, + env: &i.env, + })?; + Ok(id + .fields(256, "default") + .namespace_id() + .map_err(|e| format!("{e:?}"))? + .0) + } + + /// Every identity input changed alone gives another namespace (so another chunk key: a + /// parked prefix of the old one can never be found). + #[test] + fn every_identity_input_moves_the_namespace() { + type Change = (&'static str, fn(&mut In)); + let changes: &[Change] = &[ + ("model id", |i| i.model_id.push('x')), + ("model digest", |i| i.sha[0] ^= 1), + ("digest kind", |i| i.kind = "file".into()), + ("layers", |i| i.config.layers += 1), + ("hidden", |i| i.config.hidden += 128), + ("q heads", |i| i.config.q_heads += 1), + ("kv heads", |i| i.config.kv_heads += 1), + ("head dim", |i| i.config.head_dim += 1), + ("experts", |i| i.config.experts += 1), + ("top k", |i| i.config.top_k += 1), + ("moe intermediate", |i| i.config.moe_intermediate += 1), + ("vocab", |i| i.config.vocab += 1), + ("rms eps", |i| i.config.rms_eps *= 2.0), + ("rope theta", |i| i.config.rope_theta *= 2.0), + ("norm topk prob", |i| i.config.norm_topk_prob ^= true), + ("tie embeddings", |i| i.config.tie_word_embeddings ^= true), + ("weights bf16", |i| i.weights = WeightFormat::Bf16), + ("weights fp8 experts", |i| { + i.weights = WeightFormat::Fp8Experts + }), + ("attention path", |i| i.switches.attention_path = "split"), + ("device routing", |i| i.switches.device_routing ^= true), + ("prefill chunk", |i| i.switches.prefill_chunk += 1), + ("prefill gemm", |i| i.switches.prefill_gemm ^= true), + ("prefill device routing", |i| { + i.switches.prefill_device_routing ^= true + }), + ("whole prompt", |i| i.switches.whole_prompt ^= true), + ("whole prompt device host", |i| { + i.switches.whole_prompt_device_host ^= true + }), + ("decode graph", |i| i.switches.decode_graph ^= true), + ("lm head gemv", |i| i.switches.lm_head_gemv ^= true), + ("trace layers", |i| i.switches.trace_layers ^= true), + ("omega commit", |i| i.build.omega_commit = "e".repeat(40)), + ("archive digest", |i| { + i.build.gpu_archive_sha256 = "ef".repeat(32) + }), + ("gpu target", |i| { + i.build.gpu_target = "x86_64-unknown-linux-gnu".into() + }), + ("engine commit", |i| i.build.sc_commit = "ab".repeat(20)), + ("env cta budget", |i| { + i.env.push(("AIEN_OMEGA_CTA_BUDGET".into(), "4".into())) + }), + ("env dgraph barrier", |i| { + i.env.push(("AIEN_OMEGA_DGRAPH_BARRIER".into(), "1".into())) + }), + ("env dgraph prefetch", |i| { + i.env + .push(("AIEN_OMEGA_DGRAPH_PREFETCH".into(), "1".into())) + }), + ("env fp8 gemv", |i| { + i.env.push(("AIEN_OMEGA_FP8_GEMV".into(), "0".into())) + }), + ("env fp8 weight cache", |i| { + i.env + .push(("AIEN_OMEGA_FP8_WEIGHT_CACHE".into(), "1".into())) + }), + ("env decode graph", |i| { + i.env.push(("OWN30B_DECODE_GRAPH".into(), "1".into())) + }), + ("env decode graph stamps", |i| { + i.env + .push(("OWN30B_DECODE_GRAPH_STAMPS".into(), "1".into())) + }), + ]; + let b = ns(&base()).unwrap(); + let mut seen = vec![b]; + for (what, change) in changes { + let mut i = base(); + change(&mut i); + let n = ns(&i).unwrap_or_else(|e| panic!("{what}: {e}")); + assert!(!seen.contains(&n), "{what} did not move the namespace"); + seen.push(n); + } + // Timing and build-input variables do not move it. + let mut i = base(); + i.env.push(("AIEN_OMEGA_SPIN_US".into(), "50".into())); + i.env.push(("AIEN_OMEGA_DIR".into(), "/x".into())); + assert_eq!(ns(&i).unwrap(), b); + } + + #[test] + fn untrusted_builds_and_negative_controls_refuse() { + type Change = (&'static str, fn(&mut In)); + let refusals: &[Change] = &[ + ("stub link", |i| i.build.gpu_link = "stub".into()), + ("dev override", |i| i.build.gpu_link = "dev-override".into()), + ("other commit", |i| { + i.build.gpu_link = "pinned-source-other-commit".into() + }), + ("no archive sha", |i| i.build.gpu_archive_sha256.clear()), + ("digest mismatch", |i| { + i.build.gpu_digest = "mismatch".into() + }), + ("unknown omega commit", |i| { + i.build.omega_commit = "unknown".into() + }), + ("unknown engine commit", |i| { + i.build.sc_commit = "unknown".into() + }), + ("dirty build", |i| i.build.sc_dirty = true), + ("routing mutant", |i| i.switches.routing_mutant = true), + ("decode graph mutant", |i| { + i.env + .push(("OWN30B_DECODE_GRAPH_MUTANT".into(), "skip-norm".into())) + }), + ("unknown omega switch", |i| { + i.env.push(("AIEN_OMEGA_NEW_THING".into(), "1".into())) + }), + ("unknown own30b switch", |i| { + i.env.push(("OWN30B_SOMETHING".into(), "1".into())) + }), + ]; + for (what, change) in refusals { + let mut i = base(); + change(&mut i); + assert!(ns(&i).is_err(), "{what} must refuse persistence"); + } + } + + #[test] + fn the_namespace_layout_is_the_pool_layout() { + let i = base(); + let id = OmegaKvIdentity::new(&IdentityInputs { + model_id: &i.model_id, + model_sha256: i.sha, + model_digest_kind: &i.kind, + config: &i.config, + rope_scaling: false, + weights: i.weights, + switches: i.switches, + build: &i.build, + env: &i.env, + }) + .unwrap(); + let f = id.fields(256, "default"); + // [block][layer][K|V][token][head][dim] bf16: 48 x 2 x 16 x 4 x 128 x 2 bytes per block. + assert_eq!(f.layout.block_stride, 48 * 2 * 16 * 4 * 128 * 2); + assert_eq!( + f.expected_payload_len(17).unwrap(), + 2 * f.layout.block_stride + ); + assert!(HostFsConfig::from_fields(PathBuf::from("/nonexistent"), &f).is_ok()); + } +} diff --git a/crates/aien-serve-http/src/lib.rs b/crates/aien-serve-http/src/lib.rs index baf35acc..a562f4c4 100644 --- a/crates/aien-serve-http/src/lib.rs +++ b/crates/aien-serve-http/src/lib.rs @@ -7,6 +7,7 @@ pub mod codec; pub mod cpu_engine; pub mod engine; +pub mod kv_persist; pub mod omega_engine; pub mod openai; pub mod sampling; diff --git a/crates/aien-serve-http/src/main.rs b/crates/aien-serve-http/src/main.rs index 7529ac6a..a1148c5e 100644 --- a/crates/aien-serve-http/src/main.rs +++ b/crates/aien-serve-http/src/main.rs @@ -12,6 +12,12 @@ //! only around each generation. Its prefill runs the whole prompt in one pass with the router //! and MoE combine on the chip (ON by default; `--whole-prompt off`, `--prefill-device-host off` //! or `AIEN_SERVE_WHOLE_PROMPT=0` / `AIEN_SERVE_WP_DEVICE_HOST=0` turn them off). +//! Persistent KV (omega only, opt in): with `AIEN_KV_STORE_DIR` set (and `AIEN_KV_STORE_KEY`, +//! e.g. `atlas-vault run AIEN_KV_STORE_KEY -- aien-serve-http ...`) the door parks each turn's KV +//! in the sealed store and restores the longest stored prefix after a restart; any problem +//! refuses with a startup line and the door runs plain. Unset: nothing changes. +//! SIGTERM/SIGINT: stop accepting, finish the request in flight, drain the parks, exit 0. +//! `AIEN_KV_TEST_FAULT` (chip acceptance checks only) stalls one store step; see `kv_persist`. //! `stub` replays `--stub-reply` for every request, using the model directory's //! tokenizer when it exists (so Odysseus can be wired before the weights load). @@ -24,10 +30,11 @@ use aien_inference_abi::qwen3_moe_omega::WeightFormat; use aien_serve_http::codec::{ByteCodec, Codec, HfCodec}; use aien_serve_http::cpu_engine::CpuReferenceEngine; use aien_serve_http::engine::{Engine, StubEngine}; +use aien_serve_http::kv_persist; use aien_serve_http::omega_engine::{ parse_switch, OmegaDoor, PrefillMode, WHOLE_PROMPT_ENV, WP_DEVICE_HOST_ENV, }; -use aien_serve_http::server::{serve, ServerConfig}; +use aien_serve_http::server::{serve_until, ServerConfig}; const DEFAULT_MODEL_DIR: &str = "models/qwen3-30b-a3b-instruct-2507-fp8"; @@ -226,7 +233,17 @@ fn main() -> ExitCode { args.spin_us, args.prefill, ) { - Ok(e) => Arc::new(e), + Ok(mut door) => { + // Persistent KV (sc#505): only when AIEN_KV_STORE_DIR is set; otherwise nothing else is read. + if let Some(settings) = kv_persist::settings_from_lookup(|n| std::env::var(n).ok()) + { + // The key lives on only in the settings; no child inherits it. + std::env::remove_var(aien_kv_store::seal::KEY_ENV); + let line = enable_persistence(&mut door, settings, &args); + eprintln!("aien-serve-http: {line}"); + } + Arc::new(door) + } Err(e) => { eprintln!("aien-serve-http: omega load failed: {e}"); return ExitCode::from(1); @@ -265,13 +282,25 @@ fn main() -> ExitCode { }; rt.block_on(async move { let model_id = args.cfg.model_id.clone(); - match serve(args.cfg, engine, codec).await { + // SIGTERM or SIGINT: stop accepting, let the request in flight finish, then drop the + // engine, which drains the persistent KV parks before the process exits (sc#509). + let keep = Arc::clone(&engine); + // The handlers are installed here, before "serving" is printed, so an early SIGTERM drains too. + let signals = shutdown_signals(); + match serve_until(args.cfg, engine, codec, signals).await { Ok((addr, handle)) => { eprintln!( "aien-serve-http: serving {model_id} at http://{addr}/v1 (engine {})", args.engine ); let _ = handle.await; + let t0 = std::time::Instant::now(); + eprintln!("aien-serve-http: shutting down: no new requests; finishing the one in flight and draining persistent KV"); + while Arc::strong_count(&keep) > 1 && t0.elapsed() < std::time::Duration::from_secs(600) { + tokio::time::sleep(std::time::Duration::from_millis(20)).await; + } + drop(keep); + eprintln!("aien-serve-http: shutdown complete in {} ms", t0.elapsed().as_millis()); ExitCode::SUCCESS } Err(e) => { @@ -281,3 +310,58 @@ fn main() -> ExitCode { } }) } + +/// Opens the persistent KV store for the loaded omega engine (the checkpoint digest reads every +/// weight file once). Returns the startup line; any problem refuses and the door runs plain. +fn enable_persistence( + door: &mut OmegaDoor, + settings: Result, + args: &Args, +) -> String { + let t0 = std::time::Instant::now(); + let build = kv_persist::OmegaBuild::linked(); + let env: Vec<(String, String)> = std::env::vars().collect(); + let config = door.config(); + let identity = settings.as_ref().map_err(|e| e.clone()).and_then(|s| { + // No digest (minutes of reading) when the key already refuses: `open` reports the key. + if !matches!(s.store_key, Some(Ok(_))) { + return Err("the store key refused".to_string()); + } + let rope_scaling = kv_persist::config_has_rope_scaling(&args.model_dir)?; + let (sha, kind) = kv_persist::checkpoint_digest(&args.model_dir)?; + kv_persist::OmegaKvIdentity::new(&kv_persist::IdentityInputs { + model_id: &args.cfg.model_id, + model_sha256: sha, + model_digest_kind: kind, + config: &config, + rope_scaling, + weights: args.weights, + switches: door.kv_switches(), + build: &build, + env: &env, + }) + }); + let fault = kv_persist::TestFault::from_lookup(|n| std::env::var(n).ok()); + let (state, line) = kv_persist::open_with_test_fault(settings, identity, fault); + door.set_persistence(state); + format!("{line} [identity in {:.1} s]", t0.elapsed().as_secs_f64()) +} + +/// Installs the SIGTERM and SIGINT handlers now; the returned future resolves on the first one. +fn shutdown_signals() -> impl std::future::Future + Send + 'static { + use tokio::signal::unix::{signal, SignalKind}; + let handlers = ( + signal(SignalKind::terminate()), + signal(SignalKind::interrupt()), + ); + async move { + let (Ok(mut term), Ok(mut int)) = handlers else { + eprintln!("aien-serve-http: cannot install the shutdown signal handlers; SIGTERM kills without draining"); + return std::future::pending().await; + }; + tokio::select! { + _ = term.recv() => eprintln!("aien-serve-http: SIGTERM received"), + _ = int.recv() => eprintln!("aien-serve-http: SIGINT received"), + } + } +} diff --git a/crates/aien-serve-http/src/omega_engine.rs b/crates/aien-serve-http/src/omega_engine.rs index 3b47c296..830162cd 100644 --- a/crates/aien-serve-http/src/omega_engine.rs +++ b/crates/aien-serve-http/src/omega_engine.rs @@ -9,12 +9,14 @@ use std::fs::{File, OpenOptions}; use std::os::fd::AsRawFd; -use std::path::Path; +use std::path::{Path, PathBuf}; +use std::sync::atomic::{AtomicUsize, Ordering}; use std::time::{Duration, Instant}; use aien_inference_abi::qwen3_moe_omega::{self as omega, LoadReport, OmegaEngine, WeightFormat}; use crate::engine::{Engine, EngineError, FinishReason, GenerateOutcome, GenerateParams}; +use crate::kv_persist::PersistState; use crate::sampling::sample_next; pub const GPU_LOCK_PATH: &str = "/tmp/aien-gb10.lock"; @@ -89,13 +91,18 @@ pub struct GpuLock(#[allow(dead_code)] File); impl GpuLock { /// Takes the lock, polling until `wait` has passed. `Err` = still held by someone else. pub fn acquire(wait: Duration) -> Result { + Self::acquire_at(Path::new(GPU_LOCK_PATH), wait) + } + + /// [`Self::acquire`] on the lock file at `path` (tests pass a private file). + pub fn acquire_at(path: &Path, wait: Duration) -> Result { let file = OpenOptions::new() .read(true) .write(true) .create(true) .truncate(false) - .open(GPU_LOCK_PATH) - .map_err(|e| format!("{GPU_LOCK_PATH}: {e}"))?; + .open(path) + .map_err(|e| format!("{}: {e}", path.display()))?; let t0 = Instant::now(); loop { // SAFETY: flock on a valid open descriptor; non-blocking so the wait is bounded. @@ -105,7 +112,7 @@ impl GpuLock { } let err = std::io::Error::last_os_error(); if err.raw_os_error() != Some(libc::EWOULDBLOCK) { - return Err(format!("flock {GPU_LOCK_PATH}: {err}")); + return Err(format!("flock {}: {err}", path.display())); } if t0.elapsed() >= wait { return Err(format!( @@ -133,11 +140,82 @@ pub fn mem_available_gb() -> f64 { } pub struct OmegaDoor { + /// Declared first: a running store drains its parks before the engine goes. + persist: PersistState, engine: OmegaEngine, lock_wait: Duration, + lock_path: PathBuf, + /// Prompt tokens the last generation reused (RAM or restored prefix). + reused_last: AtomicUsize, } impl OmegaDoor { + /// A door over an already built engine, taking the GPU lock at `lock_path` around each + /// generation (tests: a private lock file and the host test engine). Persistence off. + pub fn from_parts(engine: OmegaEngine, lock_path: PathBuf, lock_wait: Duration) -> Self { + Self { + persist: PersistState::Off, + engine, + lock_wait, + lock_path, + reused_last: AtomicUsize::new(0), + } + } + + /// Installs the persistence state (`kv_persist::open`), before the door is shared. + pub fn set_persistence(&mut self, state: PersistState) { + self.persist = state; + } + + pub fn persistence(&self) -> &PersistState { + &self.persist + } + + /// The engine's run settings that can change a K/V byte (persistent KV identity). + pub fn kv_switches(&self) -> omega::OmegaKvSwitches { + self.engine + .with_engine(|e| e.kv_switches()) + .expect("engine lock") + } + + /// The loaded model config. + pub fn config(&self) -> omega::Qwen3MoeConfig { + self.engine + .with_engine(|e| e.config().clone()) + .expect("engine lock") + } + + /// Tokens whose KV the engine holds (the next turn's reuse candidates). + pub fn history(&self) -> Vec { + self.engine + .with_engine(|e| e.history().to_vec()) + .unwrap_or_default() + } + + /// Prompt tokens the last generation did not prefill (kept in RAM or restored). + pub fn reused_last(&self) -> usize { + self.reused_last.load(Ordering::Relaxed) + } + + /// The K/V of positions `0..len` as the persistent KV payload, under the GPU lock (the chip + /// check compares the uninterrupted and the restored run byte for byte). + pub fn export_kv_for_check(&self, len: usize) -> Result, String> { + let _lock = GpuLock::acquire_at(&self.lock_path, self.lock_wait)?; + self.engine.with_engine(|e| e.export_kv(0, len))? + } + + /// Imports `payload` as the K/V of `tokens` (positions `0..tokens.len()`), under the GPU lock, + /// exactly as a restore does (the chip check times it and round-trips it against + /// [`Self::export_kv_for_check`]). On error the engine is reset. + pub fn restore_kv_for_check(&self, tokens: &[u32], payload: &[u8]) -> Result<(), String> { + let _lock = GpuLock::acquire_at(&self.lock_path, self.lock_wait)?; + self.engine.with_engine(|e| e.restore_kv(tokens, payload))? + } + + /// Forgets the KV the engine holds (the next prompt is prefilled, or restored from the store). + pub fn reset_kv(&self) { + let _ = self.engine.with_engine(|e| e.reset()); + } /// Loads the checkpoint onto Omega (under the GPU lock, released before returning) with a /// KV for `max_context` tokens. Refuses with less than [`LOAD_MIN_FREE_GB`] available. pub fn load( @@ -220,10 +298,11 @@ impl OmegaDoor { omega::OmegaModelUploader::uses_dattn_api(), aien_omega_gpu::spin_us(), ); - Ok(Self { + Ok(Self::from_parts( engine, - lock_wait: LOCK_WAIT, - }) + PathBuf::from(GPU_LOCK_PATH), + LOCK_WAIT, + )) } pub fn load_report(&self) -> &LoadReport { @@ -269,15 +348,55 @@ impl Engine for OmegaDoor { seed: p.seed, stop_token_ids: p.stop_token_ids.clone(), }; + // Persistent KV (sc#505), off unless AIEN_KV_STORE_DIR asked for it: look up and load + // the longest stored prefix that beats the RAM prefix, without the chip lock. + let persist = match &self.persist { + PersistState::On(pk) => Some(pk.as_ref()), + _ => None, + }; + let fetched = persist.filter(|pk| pk.restore_on()).and_then(|pk| { + let in_ram = self + .engine + .with_engine(|e| e.reusable_prefix(prompt)) + .unwrap_or(0); + pk.fetch(prompt, in_ram) + }); let t_lock = Instant::now(); - let _lock = GpuLock::acquire(self.lock_wait).map_err(EngineError::Busy)?; + let lock = + GpuLock::acquire_at(&self.lock_path, self.lock_wait).map_err(EngineError::Busy)?; let lock_wait_ms = t_lock.elapsed().as_millis(); + if let (Some(pk), Some(f)) = (persist, fetched.as_ref()) { + // All or nothing: on error the engine is reset and the prompt is prefilled. + match self + .engine + .with_engine(|e| e.restore_kv(&prompt[..f.tokens], &f.payload)) + { + Ok(Ok(())) => pk.note_restored(f), + Ok(Err(m)) | Err(m) => { + pk.note_import_failed(); + eprintln!("aien-serve-http: persistent KV: restore of {} tokens refused ({m}); prefilling", f.tokens); + } + } + } + drop(fetched); // The server's own sampler, so CPU and Omega engines pick tokens the same way. let mut sampler = |logits: &[f32], step: usize| sample_next(logits, p, step); let o = self .engine .generate_with(prompt, &q, &mut sampler, on_token) .map_err(EngineError::Failed)?; + self.reused_last + .store(o.reused_prompt_tokens, Ordering::Relaxed); + // Park: export under the chip lock, write after it is released. + let parked = persist.map(|pk| { + self.engine + .with_engine(|e| pk.snapshot(e)) + .unwrap_or_default() + }); + drop(lock); + if let (Some(pk), Some(items)) = (persist, parked) { + pk.submit(items); + } eprintln!( "aien-serve-http: omega: lock wait {lock_wait_ms} ms, prompt {} tok, {} reused from the previous turn, prefill {} ms, decode {} tok in {} ms", o.prompt_tokens, o.reused_prompt_tokens, o.prefill_ms, o.emitted_tokens, o.decode_ms @@ -293,6 +412,16 @@ impl Engine for OmegaDoor { decode_ms: o.decode_ms, }) } + + fn persistence_status(&self) -> Option { + match &self.persist { + PersistState::Off => None, + PersistState::Refused(why) => { + Some(serde_json::json!({ "state": "refused", "reason": why, "refusals": 1 })) + } + PersistState::On(pk) => Some(pk.status_json()), + } + } } #[cfg(test)] diff --git a/crates/aien-serve-http/src/server.rs b/crates/aien-serve-http/src/server.rs index a6399fa8..6c2e2572 100644 --- a/crates/aien-serve-http/src/server.rs +++ b/crates/aien-serve-http/src/server.rs @@ -195,6 +195,18 @@ pub async fn serve( cfg: ServerConfig, engine: Arc, codec: Arc, +) -> std::io::Result<(SocketAddr, JoinHandle<()>)> { + serve_until(cfg, engine, codec, std::future::pending()).await +} + +/// [`serve`] until `shutdown` resolves: then no new connection is accepted, the requests in +/// flight finish (a streaming generation runs to its end) and the task ends, releasing the +/// server's hold on `engine`. +pub async fn serve_until( + cfg: ServerConfig, + engine: Arc, + codec: Arc, + shutdown: impl std::future::Future + Send + 'static, ) -> std::io::Result<(SocketAddr, JoinHandle<()>)> { if !cfg.bind.is_loopback() { return Err(std::io::Error::new( @@ -214,7 +226,10 @@ pub async fn serve( }); let app = router(state); let handle = tokio::spawn(async move { - if let Err(e) = axum::serve(listener, app).await { + if let Err(e) = axum::serve(listener, app) + .with_graceful_shutdown(shutdown) + .await + { eprintln!("aien-serve-http: server stopped: {e}"); } }); @@ -251,13 +266,18 @@ async fn get_model( } async fn health(State(state): State>) -> Json { - Json(serde_json::json!({ + let mut v = serde_json::json!({ "status": "ok", "model": state.cfg.model_id, "engine": state.engine.kind(), "busy": state.gate.try_lock().is_err(), "uptime_s": state.started.elapsed().as_secs(), - })) + }); + // Persistent KV (sc#505): present only when AIEN_KV_STORE_DIR asked for it. + if let (Some(pk), Some(obj)) = (state.engine.persistence_status(), v.as_object_mut()) { + obj.insert("persistent_kv".into(), pk); + } + Json(v) } async fn not_found() -> ApiError { diff --git a/crates/aien-serve-http/tests/kv_persist.rs b/crates/aien-serve-http/tests/kv_persist.rs new file mode 100644 index 00000000..45a10f9f --- /dev/null +++ b/crates/aien-serve-http/tests/kv_persist.rs @@ -0,0 +1,875 @@ +//! Persistent KV park and restore on the omega door (sc#505), host only. +//! +//! The engine is the real `OmegaEngine` over the tiny in-memory checkpoint with a host bf16 +//! pool (`host_test_engine`), the store is the real sealed host store in a private temp dir, +//! and the key is generated per test from /dev/urandom. The GPU lock is a private file, never +//! the hive's `/tmp/aien-gb10.lock`. + +use std::collections::HashMap; +use std::io::{Read, Write}; +use std::net::TcpStream; +use std::path::{Path, PathBuf}; +use std::sync::atomic::{AtomicUsize, Ordering}; +use std::sync::{Arc, Mutex}; +use std::time::Duration; + +use aien_inference_abi::qwen3_moe_omega::{host_test_engine, OmegaEngine, WeightFormat}; +use aien_serve_http::codec::ByteCodec; +use aien_serve_http::engine::{Engine, GenerateParams}; +use aien_serve_http::kv_persist::{self, OmegaBuild, PersistState}; +use aien_serve_http::omega_engine::OmegaDoor; +use aien_serve_http::sampling::sample_next; +use aien_serve_http::server::{serve, serve_until, ServerConfig}; + +const CONTEXT: usize = 256; +const WAIT: Duration = Duration::from_secs(20); + +static NEXT: AtomicUsize = AtomicUsize::new(0); + +/// A private scratch dir (0700) under the system temp dir, removed on drop. +struct Scratch(PathBuf); + +impl Scratch { + fn new(tag: &str) -> Self { + use std::os::unix::fs::PermissionsExt; + let n = NEXT.fetch_add(1, Ordering::SeqCst); + let p = std::env::temp_dir().join(format!("pkv505-{tag}-{}-{n}", std::process::id())); + let _ = std::fs::remove_dir_all(&p); + std::fs::create_dir_all(&p).unwrap(); + std::fs::set_permissions(&p, std::fs::Permissions::from_mode(0o700)).unwrap(); + Self(p) + } + fn store(&self) -> PathBuf { + self.0.join("store") + } + fn lock(&self) -> PathBuf { + self.0.join("gpu.lock") + } +} + +impl Drop for Scratch { + fn drop(&mut self) { + let _ = std::fs::remove_dir_all(&self.0); + } +} + +/// 64 hex digits from /dev/urandom (a fresh key per test, never printed). +fn gen_key() -> String { + let mut b = [0u8; 32]; + std::fs::File::open("/dev/urandom") + .unwrap() + .read_exact(&mut b) + .unwrap(); + b.iter().map(|x| format!("{x:02x}")).collect() +} + +fn test_build() -> OmegaBuild { + OmegaBuild { + omega_commit: "d0889a944b02066f84fec71af7b9bbb92f5c986f".into(), + gpu_link: "pinned-source".into(), + gpu_archive_sha256: "11".repeat(32), + gpu_digest: "unrecorded".into(), + gpu_target: "aarch64-unknown-linux-gnu".into(), + sc_commit: "22".repeat(20), + sc_dirty: false, + } +} + +/// Everything one door start depends on; a test changes one field. +#[derive(Clone)] +struct Setup { + weights: WeightFormat, + build: OmegaBuild, + env: Vec<(String, String)>, + store_vars: Vec<(String, String)>, +} + +impl Setup { + fn new(store: &Path, key: &str) -> Self { + Self { + weights: WeightFormat::Fp8All, + build: test_build(), + env: Vec::new(), + store_vars: vec![ + ("AIEN_KV_STORE_DIR".into(), store.display().to_string()), + ("AIEN_KV_STORE_KEY".into(), key.into()), + ("AIEN_KV_CHUNK_BLOCKS".into(), "1".into()), + ], + } + } + fn without(mut self, var: &str) -> Self { + self.store_vars.retain(|(k, _)| k != var); + self + } + fn with_var(mut self, var: &str, v: &str) -> Self { + self.store_vars.retain(|(k, _)| k != var); + self.store_vars.push((var.into(), v.into())); + self + } +} + +fn engine(weights: WeightFormat) -> OmegaEngine { + host_test_engine::engine(weights, CONTEXT).unwrap() +} + +/// A door with persistence started from `s` (the startup line is returned). +fn door(scratch: &Scratch, s: &Setup) -> (OmegaDoor, String) { + door_with_fault(scratch, s, None) +} + +/// [`door`] with the store's test-only stall (`AIEN_KV_TEST_FAULT`, sc#507). +fn door_with_fault(scratch: &Scratch, s: &Setup, fault: Option<&str>) -> (OmegaDoor, String) { + let mut d = OmegaDoor::from_parts(engine(s.weights), scratch.lock(), Duration::from_secs(5)); + let vars: HashMap = s.store_vars.iter().cloned().collect(); + let settings = + kv_persist::settings_from_lookup(|n| vars.get(n).cloned()).expect("store dir is set"); + let identity = kv_persist::OmegaKvIdentity::new(&kv_persist::IdentityInputs { + model_id: "tiny-qwen3-moe", + model_sha256: [7u8; 32], + model_digest_kind: "file", + config: &host_test_engine::config(), + rope_scaling: false, + weights: s.weights, + switches: d.kv_switches(), + build: &s.build, + env: &s.env, + }); + let fault = kv_persist::TestFault::from_lookup(|n| { + (n == kv_persist::TEST_FAULT_ENV) + .then(|| fault.map(str::to_string)) + .flatten() + }); + let (state, line) = kv_persist::open_with_test_fault(settings, identity, fault); + if let PersistState::On(p) = &state { + assert!(p.wait_ready(WAIT), "store recovery did not finish"); + } + d.set_persistence(state); + (d, line) +} + +fn plain_door(scratch: &Scratch) -> OmegaDoor { + OmegaDoor::from_parts( + engine(WeightFormat::Fp8All), + scratch.lock(), + Duration::from_secs(5), + ) +} + +fn greedy(n: usize) -> GenerateParams { + GenerateParams { + max_new_tokens: n, + temperature: 0.0, + top_p: 1.0, + top_k: 0, + seed: 1, + stop_token_ids: vec![], + } +} + +fn turn(d: &OmegaDoor, prompt: &[u32]) -> Vec { + let mut out = Vec::new(); + d.generate(prompt, &greedy(6), &mut |t| { + out.push(t); + true + }) + .unwrap(); + out +} + +fn prompt1() -> Vec { + (0..40u32).map(|i| (i * 7 + 3) % 64).collect() +} + +/// Second turn prompt: everything the door holds after turn 1 plus a few new tokens (a chat turn +/// that extends the conversation). +fn prompt2(history: &[u32]) -> Vec { + let mut p = history.to_vec(); + p.extend([5, 6, 7, 9]); + p +} + +fn counters(d: &OmegaDoor) -> kv_persist::PersistCounters { + match d.persistence() { + PersistState::On(p) => p.counters(), + _ => panic!("persistence is not on"), + } +} + +/// The uninterrupted reference: one plain door that keeps running, turn 2 reuses its RAM prefix. +fn uninterrupted(scratch: &Scratch) -> (Vec, Vec, Vec) { + let d = plain_door(scratch); + let p1 = prompt1(); + let o1 = turn(&d, &p1); + let h1 = d.history(); + let o2 = turn(&d, &prompt2(&h1)); + (o1, h1, o2) +} + +/// Turn 1 on a persistence door, wait for the parks, stop it (drains the store). +fn park_turn1(scratch: &Scratch, s: &Setup) -> (Vec, Vec) { + let (a, line) = door(scratch, s); + assert!(line.contains("persistent KV: on"), "{line}"); + let o1 = turn(&a, &prompt1()); + let h1 = a.history(); + match a.persistence() { + PersistState::On(p) => assert!(p.wait_idle(WAIT), "parks did not finish"), + _ => unreachable!(), + } + let c = counters(&a); + assert!( + c.parked_chunks >= 3 && c.park_bytes > 0 && c.park_failed == 0, + "{c:?}" + ); + drop(a); + (o1, h1) +} + +#[test] +fn park_then_restart_then_restore_equals_the_uninterrupted_run() { + let scratch = Scratch::new("restore"); + let s = Setup::new(&scratch.store(), &gen_key()); + let (o1, h1) = park_turn1(&scratch, &s); + let (u1, uh1, u2) = uninterrupted(&scratch); + assert_eq!( + (&o1, &h1), + (&u1, &uh1), + "turn 1 differs with persistence on" + ); + + // "Restart": a new engine and a new store handle on the same directory and key. + let (b, _) = door(&scratch, &s); + let r2 = turn(&b, &prompt2(&h1)); + let c = counters(&b); + assert_eq!(c.restores, 1, "{c:?}"); + assert_eq!( + c.restored_tokens, + h1.len() as u64, + "restored up to the uninterrupted reuse point: {c:?}" + ); + assert_eq!( + r2, u2, + "restored continuation differs from the uninterrupted run" + ); + assert_eq!( + b.reused_last(), + h1.len(), + "the engine reused the restored prefix" + ); +} + +#[test] +fn the_last_prompt_token_is_always_recomputed() { + let scratch = Scratch::new("last"); + let s = Setup::new(&scratch.store(), &gen_key()); + let (_, h1) = park_turn1(&scratch, &s); + // Prompt 2 is exactly the parked history: everything is stored, but the last token is stepped. + let (b, _) = door(&scratch, &s); + let _ = turn(&b, &h1); + let c = counters(&b); + assert_eq!(c.restores, 1, "{c:?}"); + assert_eq!(c.restored_tokens, (h1.len() - 1) as u64, "{c:?}"); + assert_eq!(b.reused_last(), h1.len() - 1); +} + +#[test] +fn a_longer_ram_prefix_is_not_replaced_by_the_store() { + let scratch = Scratch::new("ram"); + let s = Setup::new(&scratch.store(), &gen_key()); + let (a, _) = door(&scratch, &s); + let _ = turn(&a, &prompt1()); + let h1 = a.history(); + match a.persistence() { + PersistState::On(p) => assert!(p.wait_idle(WAIT)), + _ => unreachable!(), + } + let _ = turn(&a, &prompt2(&h1)); + let c = counters(&a); + assert_eq!( + c.restores, 0, + "the RAM prefix is as long as the store's: {c:?}" + ); + assert_eq!(a.reused_last(), h1.len()); +} + +/// Each identity input changed alone: the parked prefix is never served. +#[test] +fn each_identity_input_changed_alone_is_never_served() { + let scratch = Scratch::new("ident"); + let key = gen_key(); + let base = Setup::new(&scratch.store(), &key); + let (_, h1) = park_turn1(&scratch, &base); + let mut variants: Vec<(&str, Setup)> = Vec::new(); + let mut v = base.clone(); + v.weights = WeightFormat::Fp8Experts; + variants.push(("weights fp8-experts", v)); + let mut v = base.clone(); + v.weights = WeightFormat::Bf16; + variants.push(("weights bf16", v)); + let mut v = base.clone(); + v.build.omega_commit = "e".repeat(40); + variants.push(("omega commit", v)); + let mut v = base.clone(); + v.build.gpu_archive_sha256 = "33".repeat(32); + variants.push(("gpu archive digest", v)); + let mut v = base.clone(); + v.build.sc_commit = "44".repeat(20); + variants.push(("engine commit", v)); + let mut v = base.clone(); + v.env.push(("AIEN_OMEGA_FP8_GEMV".into(), "0".into())); + variants.push(("omega fp8 gemv switch", v)); + let mut v = base.clone(); + v.env + .push(("AIEN_OMEGA_DGRAPH_PREFETCH".into(), "1".into())); + variants.push(("decode graph prefetch switch", v)); + variants.push(( + "sharing namespace", + base.clone().with_var("AIEN_KV_STORE_NAMESPACE", "other"), + )); + for (what, v) in variants { + let (b, line) = door(&scratch, &v); + assert!(line.contains("persistent KV: on"), "{what}: {line}"); + let _ = turn(&b, &prompt2(&h1)); + let c = counters(&b); + assert_eq!( + c.restores, 0, + "{what} changed, yet the parked prefix was served: {c:?}" + ); + assert!( + c.restore_misses.get("not-found").copied().unwrap_or(0) >= 1, + "{what}: {c:?}" + ); + assert!(b.reused_last() < h1.len(), "{what}"); + } + // The base setup still restores (the store is intact). + let (b, _) = door(&scratch, &base); + let _ = turn(&b, &prompt2(&h1)); + assert_eq!(counters(&b).restores, 1); +} + +#[test] +fn unknown_omega_switches_and_the_mutants_refuse_persistence() { + let scratch = Scratch::new("mutant"); + let base = Setup::new(&scratch.store(), &gen_key()); + for (k, v) in [ + ("OWN30B_DECODE_GRAPH_MUTANT", "skip-norm"), + ("AIEN_OMEGA_SOMETHING_NEW", "1"), + ] { + let mut s = base.clone(); + s.env.push((k.into(), v.into())); + let (d, line) = door(&scratch, &s); + assert!(line.contains("REFUSED") && line.contains(k), "{k}: {line}"); + assert!(matches!(d.persistence(), PersistState::Refused(_))); + let _ = turn(&d, &prompt1()); + } +} + +#[test] +fn switch_off_reads_only_the_store_dir_and_changes_nothing() { + for dir in [None, Some("")] { + let seen = Mutex::new(Vec::::new()); + let got = kv_persist::settings_from_lookup(|n| { + seen.lock().unwrap().push(n.to_string()); + if n == "AIEN_KV_STORE_DIR" { + dir.map(String::from) + } else { + Some("garbage that must not be read".into()) + } + }); + assert!(got.is_none()); + assert_eq!(*seen.lock().unwrap(), vec!["AIEN_KV_STORE_DIR".to_string()]); + } + + // Tokens: the door with persistence off equals the engine called the way the door always + // called it (its own sampler, prefix reuse across turns). + let scratch = Scratch::new("off"); + let d = plain_door(&scratch); + assert!(matches!(d.persistence(), PersistState::Off)); + assert!(d.persistence_status().is_none()); + let raw = engine(WeightFormat::Fp8All); + let p = greedy(6); + let q = aien_inference_abi::qwen3_moe_omega::GenerateParams { + max_new_tokens: p.max_new_tokens, + temperature: p.temperature, + top_p: p.top_p, + top_k: p.top_k, + seed: p.seed, + stop_token_ids: p.stop_token_ids.clone(), + }; + let raw_turn = |prompt: &[u32]| { + let mut out = Vec::new(); + raw.generate_with( + prompt, + &q, + &mut |lg: &[f32], step| sample_next(lg, &p, step), + &mut |t| { + out.push(t); + true + }, + ) + .unwrap(); + out + }; + let p1 = prompt1(); + assert_eq!(turn(&d, &p1), raw_turn(&p1)); + let p2 = prompt2(&d.history()); + assert_eq!(turn(&d, &p2), raw_turn(&p2)); + + // Health: the same keys as before persistence existed. + let rt = tokio::runtime::Runtime::new().unwrap(); + let cfg = ServerConfig { + port: 0, + model_id: "m".into(), + ..ServerConfig::default() + }; + let (addr, _h) = rt + .block_on(serve(cfg, Arc::new(d), Arc::new(ByteCodec))) + .unwrap(); + let v = get_json(addr, "/health"); + let mut keys: Vec<&str> = v.as_object().unwrap().keys().map(|s| s.as_str()).collect(); + keys.sort(); + assert_eq!(keys, ["busy", "engine", "model", "status", "uptime_s"]); +} + +#[test] +fn health_reports_the_persistence_counters_when_on() { + let scratch = Scratch::new("health"); + let s = Setup::new(&scratch.store(), &gen_key()); + let (d, _) = door(&scratch, &s); + let _ = turn(&d, &prompt1()); + let rt = tokio::runtime::Runtime::new().unwrap(); + let cfg = ServerConfig { + port: 0, + model_id: "m".into(), + ..ServerConfig::default() + }; + let (addr, _h) = rt + .block_on(serve(cfg, Arc::new(d), Arc::new(ByteCodec))) + .unwrap(); + let v = get_json(addr, "/health"); + let pk = &v["persistent_kv"]; + assert_eq!(pk["state"], "on", "{v}"); + for k in [ + "parked_chunks", + "park_bytes", + "restores", + "restored_tokens", + "restore_bytes", + "restore_misses", + "refusals", + "seal", + "recovery", + "io", + ] { + assert!(!pk[k].is_null(), "missing {k}: {pk}"); + } + for k in [ + "done", + "failed", + "corrupt_deleted", + "tmp_deleted", + "unlink_failures", + "foreign_files", + ] { + assert!(!pk["recovery"][k].is_null(), "missing recovery.{k}: {pk}"); + } + for k in [ + "read_bytes", + "write_bytes", + "published", + "failed", + "disk_full", + ] { + assert!(!pk["io"][k].is_null(), "missing io.{k}: {pk}"); + } + assert!( + pk["io"]["write_bytes"].as_u64().unwrap() > 0, + "the park wrote: {pk}" + ); +} + +#[test] +fn a_corrupted_store_file_is_never_served() { + let scratch = Scratch::new("corrupt"); + let s = Setup::new(&scratch.store(), &gen_key()); + let (_, h1) = park_turn1(&scratch, &s); + let mut flipped = 0; + for f in files_under(&scratch.store().join("objects")) { + let mut b = std::fs::read(&f).unwrap(); + let mid = b.len() / 2; + b[mid] ^= 0x40; + std::fs::write(&f, &b).unwrap(); + flipped += 1; + } + assert!(flipped >= 3, "expected parked objects, found {flipped}"); + let (b, _) = door(&scratch, &s); + let r2 = turn(&b, &prompt2(&h1)); + let c = counters(&b); + assert_eq!(c.restores, 0, "{c:?}"); + assert_eq!( + r2, + plain_turn2(&scratch, &h1), + "a refused restore must be a plain recompute" + ); +} + +#[test] +fn a_wrong_key_is_never_served() { + let scratch = Scratch::new("wrongkey"); + let s = Setup::new(&scratch.store(), &gen_key()); + let (_, h1) = park_turn1(&scratch, &s); + let other = s.clone().with_var("AIEN_KV_STORE_KEY", &gen_key()); + let (b, _) = door(&scratch, &other); + let r2 = turn(&b, &prompt2(&h1)); + if let PersistState::On(_) = b.persistence() { + assert_eq!(counters(&b).restores, 0); + } + assert_eq!(r2, plain_turn2(&scratch, &h1)); +} + +#[test] +fn a_missing_or_malformed_key_refuses_and_runs_plain() { + let scratch = Scratch::new("nokey"); + let base = Setup::new(&scratch.store(), &gen_key()); + for s in [ + base.clone().without("AIEN_KV_STORE_KEY"), + base.clone().with_var("AIEN_KV_STORE_KEY", "abc"), + ] { + let (d, line) = door(&scratch, &s); + assert!(line.contains("REFUSED"), "{line}"); + assert!(matches!(d.persistence(), PersistState::Refused(_))); + let st = d.persistence_status().unwrap(); + assert_eq!(st["state"], "refused"); + let _ = turn(&d, &prompt1()); + } + assert!( + !scratch.store().exists(), + "a refused start must not create the store" + ); +} + +#[test] +fn an_unsafe_store_dir_refuses_and_runs_plain() { + use std::os::unix::fs::PermissionsExt; + let scratch = Scratch::new("unsafe"); + let open = scratch.0.join("open"); + std::fs::create_dir_all(&open).unwrap(); + std::fs::set_permissions(&open, std::fs::Permissions::from_mode(0o777)).unwrap(); + let s = Setup::new(&open.join("store"), &gen_key()); + let (d, line) = door(&scratch, &s); + assert!(line.contains("REFUSED"), "{line}"); + assert!(matches!(d.persistence(), PersistState::Refused(_))); + let _ = turn(&d, &prompt1()); +} + +fn plain_turn2(scratch: &Scratch, h1: &[u32]) -> Vec { + let d = plain_door(scratch); + turn(&d, &prompt2(h1)) +} + +fn files_under(dir: &Path) -> Vec { + let mut out = Vec::new(); + let Ok(rd) = std::fs::read_dir(dir) else { + return out; + }; + for e in rd.flatten() { + let p = e.path(); + if p.is_dir() { + out.extend(files_under(&p)); + } else { + out.push(p); + } + } + out +} + +fn get_json(addr: std::net::SocketAddr, path: &str) -> serde_json::Value { + let mut s = TcpStream::connect(addr).unwrap(); + s.set_read_timeout(Some(Duration::from_secs(10))).unwrap(); + write!( + s, + "GET {path} HTTP/1.1\r\nHost: x\r\nConnection: close\r\n\r\n" + ) + .unwrap(); + let mut raw = Vec::new(); + s.read_to_end(&mut raw).unwrap(); + let text = String::from_utf8(raw).unwrap(); + let body = text.split_once("\r\n\r\n").unwrap().1; + serde_json::from_str(body).unwrap_or_else(|e| panic!("{e}: {body}")) +} + +fn pk_of(d: &OmegaDoor) -> &kv_persist::KvPersistence { + match d.persistence() { + PersistState::On(p) => p, + _ => panic!("persistence is not on"), + } +} + +/// Copies `src` to `dst` with its modes (a crash image of the store taken while a write is in +/// flight: what a power cut or `kill -9` leaves on disk). +fn copy_tree(src: &Path, dst: &Path) { + use std::os::unix::fs::PermissionsExt; + std::fs::create_dir_all(dst).unwrap(); + let mode = std::fs::metadata(src).unwrap().permissions().mode(); + std::fs::set_permissions(dst, std::fs::Permissions::from_mode(mode)).unwrap(); + for e in std::fs::read_dir(src).unwrap().flatten() { + let (p, q) = (e.path(), dst.join(e.file_name())); + if p.is_dir() { + copy_tree(&p, &q); + } else { + std::fs::copy(&p, &q).unwrap(); + } + } +} + +fn wait_for(what: &str, mut ok: impl FnMut() -> bool) { + let t0 = std::time::Instant::now(); + while !ok() { + assert!(t0.elapsed() < WAIT, "timed out waiting for {what}"); + std::thread::sleep(Duration::from_millis(5)); + } +} + +#[test] +fn the_test_fault_spec_is_parsed_strictly() { + let parse = |v: &str| kv_persist::TestFault::from_lookup(|_| Some(v.to_string())); + assert!(parse("").unwrap().is_none(), "empty = unset"); + for ok in ["p1:5", "p2:0", "p3:100:1", "p4:1:2", "p5:7", "load:12000:1"] { + assert_eq!(parse(ok).unwrap().unwrap().spec(), ok); + } + for bad in [ + "p3", "p6:5", "p3:x", "p3:5:y", "p3:5:1:2", "load:-1", "P3:5", + ] { + assert!(parse(bad).is_err(), "{bad} must refuse"); + } + // A malformed spec refuses persistence (fail closed); the door runs plain. + let scratch = Scratch::new("badfault"); + let s = Setup::new(&scratch.store(), &gen_key()); + let (d, line) = door_with_fault(&scratch, &s, Some("p9:1")); + assert!( + line.contains("REFUSED") && line.contains("AIEN_KV_TEST_FAULT"), + "{line}" + ); + assert!(matches!(d.persistence(), PersistState::Refused(_))); +} + +#[test] +fn a_write_interrupted_before_publish_is_never_served() { + // The park stalls before its rename; the store is imaged at that moment (the kill -9 of + // the chip check), the temp file is torn in half, and a new door opens the image. + let scratch = Scratch::new("torn"); + let s = Setup::new(&scratch.store(), &gen_key()); + let (a, line) = door_with_fault(&scratch, &s, Some("p3:60000")); + assert!(line.contains("TEST FAULT"), "{line}"); + let h1 = { + let _ = turn(&a, &prompt1()); + a.history() + }; + let tmp = scratch.store().join("tmp"); + wait_for("a temp file", || !files_under(&tmp).is_empty()); + let image = scratch.0.join("image"); + copy_tree(&scratch.store(), &image); + // The stalled worker would keep the first door alive for a minute: leave it behind, as + // the killed process would. + std::mem::forget(a); + let torn = files_under(&image.join("tmp")); + assert!(!torn.is_empty()); + for t in &torn { + let len = std::fs::metadata(t).unwrap().len(); + std::fs::OpenOptions::new() + .write(true) + .open(t) + .unwrap() + .set_len(len / 2) + .unwrap(); + } + assert!( + files_under(&image.join("objects")).is_empty(), + "nothing was published" + ); + let si = Setup::new(&image, "").with_var("AIEN_KV_STORE_KEY", &s.store_vars[1].1); + let (b, _) = door(&scratch, &si); + let r2 = turn(&b, &prompt2(&h1)); + let c = counters(&b); + assert_eq!(c.restores, 0, "{c:?}"); + assert_eq!( + r2, + plain_turn2(&scratch, &h1), + "a torn write must be a plain recompute" + ); + assert!( + files_under(&image.join("tmp")).is_empty(), + "recovery removes the torn temp" + ); + if let PersistState::On(pk) = b.persistence() { + let v = pk.status_json(); + assert!( + v["recovery"]["tmp_deleted"].as_u64().unwrap() >= 1, + "health counts the removed temp: {v}" + ); + assert_eq!(v["recovery"]["done"], true, "{v}"); + } else { + panic!("persistence should be on"); + } +} + +#[test] +fn a_restore_that_completes_after_its_timeout_is_never_served() { + // The load of turn 2 stalls past LOAD_TIMEOUT: the door gives up, prefills, and the late + // completion that arrives afterwards is dropped. The store itself stays good. + let scratch = Scratch::new("lateload"); + let s = Setup::new(&scratch.store(), &gen_key()); + let (_, h1) = park_turn1(&scratch, &s); + let late = kv_persist::LOAD_TIMEOUT + Duration::from_secs(2); + let spec = format!("load:{}:1", late.as_millis()); + let (b, _) = door_with_fault(&scratch, &s, Some(&spec)); + let r2 = turn(&b, &prompt2(&h1)); + let c = counters(&b); + assert_eq!(c.restores, 0, "{c:?}"); + assert_eq!(c.restore_misses.get("timeout"), Some(&1), "{c:?}"); + let plain = plain_turn2(&scratch, &h1); + assert_eq!(r2, plain); + std::thread::sleep(Duration::from_secs(3)); + let c = counters(&b); + assert_eq!( + c.restores, 0, + "the late completion must not count as a restore: {c:?}" + ); + // A new conversation on the same door is not touched by the stale completion. + let fresh: Vec = (0..30u32).map(|i| (i * 5 + 1) % 64).collect(); + assert_eq!(turn(&b, &fresh), turn(&plain_door(&scratch), &fresh)); + drop(b); + let (c2, _) = door(&scratch, &s); + assert_eq!(turn(&c2, &prompt2(&h1)), plain); + assert_eq!( + counters(&c2).restores, + 1, + "the store still serves after the stale load" + ); +} + +#[test] +fn a_park_that_lands_after_the_conversation_moved_on_is_harmless() { + // The first park of turn 1 stalls; turn 2 and a diverging turn run while it is in flight + // (turn 2 resubmits the chunks the store does not hold yet). Every answer equals the + // uninterrupted run, and after a restart the late parks restore turn 2 exactly. + let scratch = Scratch::new("latepark"); + let s = Setup::new(&scratch.store(), &gen_key()); + let (u1, uh1, u2) = uninterrupted(&scratch); + let (a, _) = door_with_fault(&scratch, &s, Some("p3:1500:1")); + assert_eq!(turn(&a, &prompt1()), u1); + let h1 = a.history(); + assert_eq!(h1, uh1); + assert_eq!(turn(&a, &prompt2(&h1)), u2); + let mut other = h1.clone(); + other.extend([1, 2, 3, 4]); + let plain_other = turn(&plain_door(&scratch), &other); + assert_eq!(turn(&a, &other), plain_other); + assert!(pk_of(&a).wait_idle(WAIT), "parks did not finish"); + let c = counters(&a); + assert!(c.parked_chunks >= 3 && c.park_failed == 0, "{c:?}"); + drop(a); + let (b, _) = door(&scratch, &s); + assert_eq!(turn(&b, &prompt2(&h1)), u2); + assert_eq!(counters(&b).restores, 1); +} + +#[test] +fn a_graceful_shutdown_releases_the_engine_and_flushes_the_parks() { + // serve_until: on shutdown the server stops and lets go of the engine; dropping the door + // then drains the parks still in flight (each stalls 200 ms) and leaves no temp file. + let scratch = Scratch::new("shutdown"); + let s = Setup::new(&scratch.store(), &gen_key()); + let (d, _) = door_with_fault(&scratch, &s, Some("p3:200")); + let _ = turn(&d, &prompt1()); + let h1 = d.history(); + let keep = Arc::new(d); + let rt = tokio::runtime::Runtime::new().unwrap(); + let cfg = ServerConfig { + port: 0, + model_id: "m".into(), + ..ServerConfig::default() + }; + let (tx, rx) = tokio::sync::oneshot::channel::<()>(); + let engine: Arc = keep.clone(); + let (addr, h) = rt + .block_on(serve_until(cfg, engine, Arc::new(ByteCodec), async { + let _ = rx.await; + })) + .unwrap(); + assert_eq!(get_json(addr, "/health")["status"], "ok"); + assert!( + pk_of(&keep).counters().parked_chunks < 3, + "the parks are still in flight" + ); + tx.send(()).unwrap(); + rt.block_on(h).unwrap(); + assert!(TcpStream::connect(addr).is_err(), "the listener is closed"); + wait_for("the server to release the engine", || { + Arc::strong_count(&keep) == 1 + }); + drop(keep); + assert!( + files_under(&scratch.store().join("tmp")).is_empty(), + "no temp file left" + ); + assert!( + files_under(&scratch.store().join("objects")).len() >= 3, + "the parks were flushed" + ); + let (b, _) = door(&scratch, &s); + let _ = turn(&b, &prompt2(&h1)); + assert_eq!(counters(&b).restores, 1); +} + +/// #514 chip findings: on the 30B model one 256-token chunk is 25 MB. The storage worker's park +/// budget (a quarter of `AIEN_KV_STORE_MAX_INFLIGHT_BYTES`, 64 MB by default) holds two chunks, +/// so a 2079-token turn parked 2 of 9 chunks and refused the rest; its restore budget (the other +/// three quarters, 192 MB) is smaller than that turn's 204 MB, so the whole restore was refused. +/// Here the park budget holds exactly one chunk and the restore budget three, for a 7-chunk +/// history: every chunk must still be parked and the restart must restore the whole history. +#[test] +fn a_turn_larger_than_the_park_and_restore_budgets_is_parked_and_restored_in_full() { + let long: Vec = (0..100u32).map(|i| (i * 11 + 5) % 64).collect(); + let probe = Scratch::new("budget-probe"); + let (a, line) = door(&probe, &Setup::new(&probe.store(), &gen_key())); + assert!(line.contains("persistent KV: on"), "{line}"); + let _ = turn(&a, &long); + assert!(pk_of(&a).wait_idle(WAIT)); + let c = counters(&a); + assert!(c.parked_chunks >= 7 && c.park_refused == 0, "{c:?}"); + let (n, per_chunk) = (c.parked_chunks, c.park_bytes / c.parked_chunks); + drop(a); + + let scratch = Scratch::new("budget"); + let budget = 4 * (per_chunk + aien_kv_store::record::HEADER_REGION_LEN as u64); + let s = Setup::new(&scratch.store(), &gen_key()) + .with_var("AIEN_KV_STORE_MAX_INFLIGHT_BYTES", &budget.to_string()); + let (a, line) = door(&scratch, &s); + assert!(line.contains("persistent KV: on"), "{line}"); + let _ = turn(&a, &long); + let h1 = a.history(); + assert!(pk_of(&a).wait_idle(WAIT)); + let c = counters(&a); + assert_eq!( + (c.parked_chunks, c.park_refused, c.park_failed), + (n, 0, 0), + "every chunk parked through a one-chunk park budget: {c:?}" + ); + drop(a); + + let plain = plain_door(&scratch); + let _ = turn(&plain, &long); + let u2 = turn(&plain, &prompt2(&plain.history())); + let (b, _) = door(&scratch, &s); + let r2 = turn(&b, &prompt2(&h1)); + let c = counters(&b); + assert_eq!( + (c.restores, c.restored_tokens), + (1, h1.len() as u64), + "the whole history restored through a three-chunk restore budget: {c:?}" + ); + assert_eq!( + r2, u2, + "restored continuation differs from the uninterrupted run" + ); +} diff --git a/crates/aien-serve-http/tests/kv_persist_chip.rs b/crates/aien-serve-http/tests/kv_persist_chip.rs new file mode 100644 index 00000000..e2b25341 --- /dev/null +++ b/crates/aien-serve-http/tests/kv_persist_chip.rs @@ -0,0 +1,399 @@ +//! Chip-only acceptance check of persistent KV on the omega engine (sc#505, locked by #499). +//! NOT run by `cargo test`: it loads the 30B checkpoint onto the chip. Run it only through +//! `scripts/own30b-pkv-chip-check.sh` (which builds natively and checks the chip is free): +//! +//! OWN30B_MODEL_DIR=... cargo test --release -p aien-serve-http --test kv_persist_chip -- --ignored +//! +//! In one process: turn 1, wait for the parks, turn 2 with the RAM prefix (the uninterrupted +//! run), then forget the RAM KV and run turn 2 again so it must restore from the store. The two +//! turn 2 replies and the K/V the engine holds afterwards must be identical, byte for byte. +//! The store key is generated in memory for the run; the store lives in a private temp dir. +//! Takes the hive GPU lock (/tmp/aien-gb10.lock) around each generation, as the server does. + +use std::io::Read; +use std::path::PathBuf; +use std::time::Duration; + +use aien_inference_abi::qwen3_moe_omega::WeightFormat; +use aien_serve_http::engine::{Engine, GenerateParams}; +use aien_serve_http::kv_persist::{self, OmegaBuild, PersistState}; +use aien_serve_http::omega_engine::{OmegaDoor, PrefillMode}; + +fn gen_key() -> String { + let mut b = [0u8; 32]; + std::fs::File::open("/dev/urandom") + .unwrap() + .read_exact(&mut b) + .unwrap(); + b.iter().map(|x| format!("{x:02x}")).collect() +} + +fn turn(d: &OmegaDoor, prompt: &[u32], n: usize) -> Vec { + let p = GenerateParams { + max_new_tokens: n, + temperature: 0.0, + top_p: 1.0, + top_k: 0, + seed: 1, + stop_token_ids: vec![], + }; + let mut out = Vec::new(); + d.generate(prompt, &p, &mut |t| { + out.push(t); + true + }) + .unwrap(); + out +} + +#[test] +#[ignore = "chip-only: loads the 30B checkpoint on omega; run via scripts/own30b-pkv-chip-check.sh"] +fn restored_turn_two_equals_the_uninterrupted_turn_two_on_the_chip() { + let model = PathBuf::from(std::env::var("OWN30B_MODEL_DIR").expect("OWN30B_MODEL_DIR")); + let scratch = std::env::temp_dir().join(format!("pkv505-chip-{}", std::process::id())); + std::fs::create_dir_all(&scratch).unwrap(); + { + use std::os::unix::fs::PermissionsExt; + std::fs::set_permissions(&scratch, std::fs::Permissions::from_mode(0o700)).unwrap(); + } + let mut door = OmegaDoor::load( + &model, + 8192, + WeightFormat::Fp8All, + Some(2000), + PrefillMode::default(), + ) + .expect("omega load"); + let store = scratch.join("store"); + let key = gen_key(); + let settings = kv_persist::settings_from_lookup(|n| match n { + "AIEN_KV_STORE_DIR" => Some(store.display().to_string()), + "AIEN_KV_STORE_KEY" => Some(key.clone()), + _ => None, + }) + .unwrap(); + let env: Vec<(String, String)> = std::env::vars().collect(); + let (sha, kind) = kv_persist::checkpoint_digest(&model).unwrap(); + let identity = kv_persist::OmegaKvIdentity::new(&kv_persist::IdentityInputs { + model_id: "own30b-chip-check", + model_sha256: sha, + model_digest_kind: kind, + config: &door.config(), + rope_scaling: kv_persist::config_has_rope_scaling(&model).unwrap(), + weights: WeightFormat::Fp8All, + switches: door.kv_switches(), + build: &OmegaBuild::linked(), + env: &env, + }); + let (state, line) = kv_persist::open(settings, identity); + eprintln!("{line}"); + let PersistState::On(_) = &state else { + panic!("persistence refused: {line}") + }; + door.set_persistence(state); + let pk = match door.persistence() { + PersistState::On(p) => p, + _ => unreachable!(), + }; + assert!(pk.wait_ready(Duration::from_secs(60))); + + // A 600-token prompt (the same sentence ids repeated), then a continuation. + let p1: Vec = (0..600u32).map(|i| 1000 + (i * 37) % 5000).collect(); + let _ = turn(&door, &p1, 32); + assert!( + pk.wait_idle(Duration::from_secs(60)), + "parks did not finish" + ); + let h1 = door.history(); + let mut p2 = h1.clone(); + p2.extend([2000u32, 2001, 2002, 2003, 2004]); + + // Freeze the store as it was after turn 1 (the state a restarted server would find). + pk.set_park(false); + let t_u = turn(&door, &p2, 64); + let reused_u = door.reused_last(); + let h_u = door.history(); + let kv_u = door.export_kv_for_check(h_u.len()).unwrap(); + + door.reset_kv(); + let t_r = turn(&door, &p2, 64); + let c = pk.counters(); + eprintln!("counters after the restored turn: {c:?}"); + assert_eq!(c.restores, 1, "turn 2 did not restore: {c:?}"); + assert_eq!( + c.restored_tokens as usize, reused_u, + "restored up to the uninterrupted reuse point" + ); + assert_eq!(door.reused_last(), reused_u); + assert_eq!( + t_r, t_u, + "restored continuation differs from the uninterrupted run" + ); + assert_eq!(door.history(), h_u); + let kv_r = door.export_kv_for_check(h_u.len()).unwrap(); + assert!( + kv_r == kv_u, + "the K/V after the restored turn differs from the uninterrupted one" + ); + drop(door); + let _ = std::fs::remove_dir_all(&scratch); +} + +/// `/proc/self/io` `read_bytes`: bytes this process caused to be read from the block layer. +fn proc_read_bytes() -> u64 { + let s = std::fs::read_to_string("/proc/self/io").unwrap(); + s.lines() + .find_map(|l| l.strip_prefix("read_bytes: ")) + .unwrap() + .trim() + .parse() + .unwrap() +} + +/// Drops the page cache (DGX Spark known issues: `sync; echo 3 > /proc/sys/vm/drop_caches`). +fn drop_caches() { + let ok = std::process::Command::new("sudo") + .args(["-n", "sh", "-c", "sync; echo 3 > /proc/sys/vm/drop_caches"]) + .status() + .unwrap() + .success(); + assert!(ok, "drop_caches needs sudo -n"); +} + +fn store_objects(dir: &std::path::Path, out: &mut Vec) { + for e in std::fs::read_dir(dir).unwrap() { + let p = e.unwrap().path(); + if p.is_dir() { + store_objects(&p, out); + } else { + out.push(p); + } + } +} + +fn ms(d: Duration) -> f64 { + d.as_secs_f64() * 1e3 +} + +fn summary(v: &mut [f64]) -> String { + v.sort_by(|a, b| a.partial_cmp(b).unwrap()); + format!( + "min={:.3} median={:.3} max={:.3} n={}", + v[0], + v[v.len() / 2], + v[v.len() - 1], + v.len() + ) +} + +/// Chip qualification of #514 (plan: docs/inference/evidence/pkv514-chip-20261014/PLAN.md): +/// the fused-cache export/import round trip byte for byte, the checkpoint cost, the NVMe restore +/// latency cold and warm, and the negative controls (a flipped payload byte must show, a +/// truncated payload and corrupted stored objects must be refused). Prints `SNAP` lines. +#[test] +#[ignore = "chip-only: loads the 30B checkpoint on omega; run by hand per the #514 plan"] +fn fused_cache_round_trip_cost_and_restore_latency_on_the_chip() { + use std::time::Instant; + const REPS: usize = 5; + let model = PathBuf::from(std::env::var("OWN30B_MODEL_DIR").expect("OWN30B_MODEL_DIR")); + // The store must be on the NVMe (not tmpfs) for a cold read. + let scratch_root = std::env::var("PKV_CHIP_SCRATCH") + .map(PathBuf::from) + .unwrap_or_else(|_| std::env::temp_dir()); + let scratch = scratch_root.join(format!("pkv514-chip-{}", std::process::id())); + std::fs::create_dir_all(&scratch).unwrap(); + { + use std::os::unix::fs::PermissionsExt; + std::fs::set_permissions(&scratch, std::fs::Permissions::from_mode(0o700)).unwrap(); + } + let mut door = OmegaDoor::load( + &model, + 8192, + WeightFormat::Fp8All, + Some(2000), + PrefillMode::default(), + ) + .expect("omega load"); + let sw = door.kv_switches(); + eprintln!("SNAP site=switches attention_path={}", sw.attention_path); + assert_eq!( + sw.attention_path, "fused", + "the live server runs the fused cache" + ); + let store = scratch.join("store"); + let key = gen_key(); + let settings = kv_persist::settings_from_lookup(|n| match n { + "AIEN_KV_STORE_DIR" => Some(store.display().to_string()), + "AIEN_KV_STORE_KEY" => Some(key.clone()), + _ => None, + }) + .unwrap(); + let env: Vec<(String, String)> = std::env::vars().collect(); + let (sha, kind) = kv_persist::checkpoint_digest(&model).unwrap(); + let identity = kv_persist::OmegaKvIdentity::new(&kv_persist::IdentityInputs { + model_id: "own30b-chip-check", + model_sha256: sha, + model_digest_kind: kind, + config: &door.config(), + rope_scaling: kv_persist::config_has_rope_scaling(&model).unwrap(), + weights: WeightFormat::Fp8All, + switches: door.kv_switches(), + build: &OmegaBuild::linked(), + env: &env, + }); + let (state, line) = kv_persist::open(settings, identity); + eprintln!("{line}"); + let PersistState::On(_) = &state else { + panic!("persistence refused: {line}") + }; + door.set_persistence(state); + let pk = match door.persistence() { + PersistState::On(p) => p, + _ => unreachable!(), + }; + assert!(pk.wait_ready(Duration::from_secs(60))); + + // Turn 1: a 2048-token prompt and 32 generated tokens, parked by the door. + let p1: Vec = (0..2048u32).map(|i| 1000 + (i * 37) % 5000).collect(); + let _ = turn(&door, &p1, 32); + assert!( + pk.wait_idle(Duration::from_secs(120)), + "parks did not finish" + ); + pk.set_park(false); + let c = pk.counters(); + let h = door.history(); + let n = h.len(); + eprintln!( + "SNAP site=park positions={n} parked_chunks={} park_bytes={} park_failed={} park_refused={}", + c.parked_chunks, c.park_bytes, c.park_failed, c.park_refused + ); + assert!(c.parked_chunks > 0 && c.park_failed == 0 && c.park_refused == 0); + + // Item 3: checkpoint cost, the export of the whole history under the GPU lock. + let mut t_export = Vec::new(); + let mut a: Option> = None; + for _ in 0..REPS { + let t0 = Instant::now(); + let x = door.export_kv_for_check(n).unwrap(); + t_export.push(ms(t0.elapsed())); + match &a { + None => a = Some(x), + Some(a) => assert!(*a == x, "two exports of the same KV differ"), + } + } + let a = a.unwrap(); + assert!(a.iter().any(|&b| b != 0), "export is all zeros"); + eprintln!( + "SNAP site=export positions={n} bytes={} ms_{}", + a.len(), + summary(&mut t_export) + ); + + // Item 1: export -> reset -> import -> export, byte for byte; import timed. + let mut t_import = Vec::new(); + for _ in 0..REPS { + door.reset_kv(); + assert!(door.history().is_empty()); + let t0 = Instant::now(); + door.restore_kv_for_check(&h, &a).unwrap(); + t_import.push(ms(t0.elapsed())); + assert_eq!(door.history(), h); + let b = door.export_kv_for_check(n).unwrap(); + assert!(b == a, "round trip export(import(A)) != A"); + } + eprintln!( + "SNAP site=round_trip identical=true reps={REPS} import_ms_{}", + summary(&mut t_import) + ); + + // Negative control: one flipped byte in the middle of the payload must come back flipped. + let mut bad = a.clone(); + let off = bad.len() / 2; + bad[off] ^= 0x40; + door.restore_kv_for_check(&h, &bad).unwrap(); + let b = door.export_kv_for_check(n).unwrap(); + let diff: Vec = (0..a.len()).filter(|&i| a[i] != b[i]).collect(); + eprintln!( + "SNAP site=neg_flip differing_bytes={} at={:?}", + diff.len(), + diff.first() + ); + assert_eq!( + diff, + vec![off], + "a flipped byte must show at exactly its offset" + ); + // Negative control: a truncated payload is refused and leaves an empty engine. + let r = door.restore_kv_for_check(&h, &a[..a.len() - 1]); + eprintln!( + "SNAP site=neg_truncated refused={} err={:?}", + r.is_err(), + r.as_ref().err() + ); + assert!(r.is_err() && door.history().is_empty()); + door.restore_kv_for_check(&h, &a).unwrap(); + assert!(door.export_kv_for_check(n).unwrap() == a); + + // Item 4: NVMe restore latency (lookup, read, decrypt, verify), warm then cold. + let mut p2 = h.clone(); + p2.extend([2000u32, 2001, 2002, 2003, 2004]); + let mut objs = Vec::new(); + store_objects(&store.join("objects"), &mut objs); + let obj_bytes: u64 = objs.iter().map(|p| p.metadata().unwrap().len()).sum(); + eprintln!( + "SNAP site=store objects={} object_bytes={obj_bytes}", + objs.len() + ); + let mut warm = Vec::new(); + for _ in 0..REPS { + let t0 = Instant::now(); + let f = pk.fetch(&p2, 0).expect("warm fetch"); + warm.push(ms(t0.elapsed())); + assert_eq!(f.tokens, n); + assert!(f.payload == a, "warm fetched payload != A"); + } + let mut cold = Vec::new(); + let mut cold_read = Vec::new(); + for _ in 0..REPS { + drop_caches(); + let r0 = proc_read_bytes(); + let t0 = Instant::now(); + let f = pk.fetch(&p2, 0).expect("cold fetch"); + cold.push(ms(t0.elapsed())); + let rb = proc_read_bytes() - r0; + cold_read.push(rb); + assert_eq!(f.tokens, n); + assert!(f.payload == a, "cold fetched payload != A"); + } + eprintln!("SNAP site=fetch_warm ms_{}", summary(&mut warm)); + eprintln!( + "SNAP site=fetch_cold ms_{} block_read_bytes={cold_read:?} object_bytes={obj_bytes}", + summary(&mut cold) + ); + // Cold is proven only if the reads reached the block layer. + assert!( + cold_read.iter().all(|&r| r >= obj_bytes), + "a cold fetch read less than the stored bytes from the device: not cold" + ); + + // Negative control: corrupt every stored object; the fetch must refuse. + let before = pk.counters().restore_misses; + for p in &objs { + let mut v = std::fs::read(p).unwrap(); + let m = v.len() / 2; + v[m] ^= 0x40; + std::fs::write(p, v).unwrap(); + } + drop_caches(); + let f = pk.fetch(&p2, 0); + let after = pk.counters().restore_misses; + eprintln!( + "SNAP site=neg_corrupt refused={} misses_before={before:?} misses_after={after:?}", + f.is_none() + ); + assert!(f.is_none(), "a corrupted checkpoint was served"); + assert!(after != before, "the refusal was not counted"); + drop(door); + let _ = std::fs::remove_dir_all(&scratch); +} diff --git a/crates/aien-serve-http/tests/shutdown.rs b/crates/aien-serve-http/tests/shutdown.rs new file mode 100644 index 00000000..ea3adf9e --- /dev/null +++ b/crates/aien-serve-http/tests/shutdown.rs @@ -0,0 +1,59 @@ +//! SIGTERM stops the binary cleanly (sc#509): it stops accepting, releases the engine (which +//! drains the persistent KV parks on the omega door) and exits 0. Host only, stub engine. + +use std::io::{BufRead, BufReader}; +use std::process::{Command, Stdio}; +use std::time::{Duration, Instant}; + +#[test] +fn sigterm_shuts_down_cleanly_and_exits_zero() { + let mut child = Command::new(env!("CARGO_BIN_EXE_aien-serve-http")) + .args([ + "--engine", + "stub", + "--port", + "0", + "--model-dir", + "/nonexistent-pkv509", + ]) + .env_remove("AIEN_KV_STORE_DIR") + .stdin(Stdio::null()) + .stdout(Stdio::null()) + .stderr(Stdio::piped()) + .spawn() + .unwrap(); + let mut err = BufReader::new(child.stderr.take().unwrap()); + let mut log = String::new(); + loop { + let mut line = String::new(); + assert!( + err.read_line(&mut line).unwrap() > 0, + "exited before serving: {log}" + ); + log.push_str(&line); + if line.contains("serving ") { + break; + } + } + // SAFETY: plain kill(2) on our own child. + assert_eq!(unsafe { libc::kill(child.id() as i32, libc::SIGTERM) }, 0); + let t0 = Instant::now(); + let status = loop { + if let Some(s) = child.try_wait().unwrap() { + break s; + } + assert!( + t0.elapsed() < Duration::from_secs(20), + "no exit after SIGTERM" + ); + std::thread::sleep(Duration::from_millis(10)); + }; + let mut rest = String::new(); + std::io::Read::read_to_string(&mut err, &mut rest).unwrap(); + log.push_str(&rest); + assert!(status.success(), "{status:?}: {log}"); + assert!( + log.contains("SIGTERM received") && log.contains("shutdown complete"), + "{log}" + ); +} diff --git a/docs/inference/evidence/pkv514-chip-20261014/PLAN.md b/docs/inference/evidence/pkv514-chip-20261014/PLAN.md new file mode 100644 index 00000000..56773dde --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/PLAN.md @@ -0,0 +1,53 @@ +# #514 chip qualification plan (written before any chip run, 2026-10-14) + +Candidate: branch `pkv/505-omega-park-restore` with origin/main merged (commit recorded in +RESULTS.md), stacked on `pkv/503-own30b-serve` (#510, not merged yet: qualified against the +branch as-is). Native release build, omega at the `omega.lock` pin (d0889a94), physics at +omega's `physics.lock`, built through `scripts/pins.sh --gpu` (clean tree, so the build id is +trusted). Model: `~/models/qwen3-30b-a3b-instruct-2507-fp8`, fp8-all weights, fused attention +cache (the live server's path). Every chip process takes `/tmp/aien-gb10.lock` around each +generation. Ports 18098/18099 (18097 is left for the Qwen3-8B worker, 18091 is the live +server and must be down, 18095 is spark-cockpit). Before each run: quiet flag clear, at least +45 GB `MemAvailable` per 30B process (unified 128 GB; `cudaMemGetInfo` under-reports, so +`/proc/meminfo` is the gauge). + +Docs read: DGX Spark user guide known issues (unified memory, `nvidia-smi` memory "Not +Supported", `cudaMemGetInfo` may under-report). Concurrent use of one store directory by two +processes: DOCS SILENT (ADR 0003 names one runtime per store directory; the store takes no +cross-process lock), so it is not tested as a supported mode. + +## Items (PASS rule in brackets) + +1. **Fused-cache export/import round trip.** In-process chip test + `fused_cache_round_trip_cost_and_restore_latency_on_the_chip`: 2048-token prompt plus 32 + generated tokens; export positions 0..n (A, 5 times: all identical); reset; `restore_kv`(A); + export again (B). [B == A byte for byte] +2. **Restored-turn token identity.** (a) in-process `restored_turn_two_equals_the_uninterrupted_turn_two_on_the_chip` + (greedy, seed 1, temperature 0; also the engine K/V after turn 2 byte for byte); + (b) the server script `own30b-pkv-chip-check.sh` (off/on/park/restore and its other phases). + [restored turn 2 tokens == uninterrupted turn 2, restores == 1] +3. **Checkpoint cost.** From item 1's test: export time under the GPU lock for the whole + history (ms, min and median of 5) and bytes; the store's `park_bytes` and `parked_chunks` + after turn 1. [measured; no threshold, numbers recorded] +4. **NVMe restore latency, cold and warm.** Same test: `fetch` (store lookup, read, decrypt, + verify) of the parked prefix, 5 times warm (page cache) and 5 times cold + (`sync; echo 3 > /proc/sys/vm/drop_caches` before each, cold proven by `/proc/self/io` + `read_bytes` growing by at least the stored bytes); plus `restore_kv` import time. + [fetched payload == A byte for byte every time; numbers recorded] +5. **Two-process test.** Process 1 (server, :18098) parks turn 1 and stays loaded; process 2 + (second server, :18099, a copy of process 1's store, same key) loads beside it and answers + turn 2 by restoring; process 1 then answers turn 2 from RAM. [both turn 2 replies == + the uninterrupted turn 2 of a persistence-off run; process 2 restores == 1] + +## Baseline and negative controls + +- Baseline: persistence off (same binary, `AIEN_KV_STORE_DIR` unset), same conversation; every + comparison is against it. The script's `off` phase and the in-process uninterrupted turn. +- Comparator can say no: in item 1, restore A with one byte flipped, export: must differ from A, + then restore A again and match. +- Engine refuses a truncated payload (`restore_kv` Err, history empty). +- Corrupted checkpoint refused: in item 4, flip one byte in every stored object, drop caches, + `fetch` must return nothing with a miss counted; server script `neg-corrupt` phase + (restores == 0, still answers) and `neg-switch` (another identity, restores == 0). + +Anything not measured here is UNVERIFIED in RESULTS.md. diff --git a/docs/inference/evidence/pkv514-chip-20261014/RESULTS.md b/docs/inference/evidence/pkv514-chip-20261014/RESULTS.md new file mode 100644 index 00000000..f48fe4ee --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/RESULTS.md @@ -0,0 +1,56 @@ +# #514 chip qualification results (GB10, 2026-10-14) + +Plan: `PLAN.md` (written before any run). Runner: `run-all.sh` (each step under its own +`quietlock hold --minutes 20`). Ground per run in `runN-*/ground.txt` (commit, clean tree, +binary and test sha256, omega d0889a94, driver 580.173.02, kernel 7.0.0-1019-nvidia). +Model: Qwen3-30B-A3B fp8-all, fused attention cache, chunk 256 tokens. + +## Final run: run3, commit 8a4c36e9 (all PASS) + +| item | result | numbers | +|---|---|---| +| 1 fused-cache export/import round trip | PASS | 2079 positions, 204,472,320 bytes; export(import(A)) == A byte for byte, 5/5; 5 exports identical | +| 2a restored turn 2 == uninterrupted (in process) | PASS | tokens and the engine K/V byte for byte; restores 1 | +| 2b restored turn 2 == uninterrupted (server script) | PASS | all 28 checks, incl. torn write, late load, late park, neg-switch, neg-corrupt; restored 800 tokens (turn-1 prompt 750) | +| 3 checkpoint cost | PASS (measured) | export under the GPU lock: median 65.3 ms (min 63.9, max 68.3) for 204 MB; 9 chunks parked, 0 refused, 0 failed; on disk 204,509,184 bytes | +| 4 NVMe restore latency | PASS (measured) | fetch (lookup, read, decrypt, verify) warm median 453.6 ms (452.4 to 470.7); cold median 693.5 ms (652.8 to 696.8), cold proven: block reads 204.5 to 204.9 MB per fetch >= 204.5 MB stored; import into the fused cache median 22.4 ms; fetched payload == A every time | +| 5 two processes | PASS | proc 1 parks and stays loaded, proc 2 loads beside it (both resident, MemAvailable 38.2 GB, RSS 37.3 + 33.8 GB) and restores 800 tokens; both turn 2 replies == the persistence-off turn 2 | + +Negative controls (run3): one flipped payload byte comes back at exactly its offset (the +comparator can say no); a truncated payload is refused ("kv payload of 204472319 bytes, 2079 +positions need 204472320") and leaves an empty engine; every stored object corrupted -> fetch +refused (miss `invalid`); server neg-corrupt and neg-switch restore nothing. Baseline: the +persistence-off server run and the in-process uninterrupted turn. + +## Earlier runs (kept, superseded) + +- run1 at 7d036ac4: item 1 FAIL. A 2079-token turn parked 2 of 9 chunks (`park_refused=1`): one + 256-token chunk is 25 MB and the storage worker's park budget is 64 MB (a quarter of + `AIEN_KV_STORE_MAX_INFLIGHT_BYTES`, 256 MB). The server script PASSED its token checks + while restoring only 512 of 750+ tokens; it did not check for refusals. Fixed in a639c4e9 + (`submit` waits for credit), red-first host test, and the scripts now check + `park_refused == 0` and restore coverage. +- run2 at a639c4e9: 9/9 chunks parked, round trip PASS; item 4 FAIL: the 204 MB restore was + refused as `busy` (restore budget 192 MB). Fixed in 8a4c36e9 (`fetch` waits for credit within + `LOAD_TIMEOUT`), same red-first test extended. Items 2a, 2b, 5 PASS in run2. + +## Limits (UNVERIFIED) + +- One conversation shape per item; 5 repetitions for timings, not a distribution under load. +- Warm fetch at about 450 MB/s is dominated by decrypt and verify on the CPU (INFERRED; not profiled). +- Two processes on one store folder at the same time: not tested and not supported (no + inter-process lock, issue #521); item 5 gives process 2 a copy. +- Contexts longer than 2079 tokens, and concurrent requests, were not run on the chip. + +## After the chip runs (not rerun on the chip) + +- #510 merged into main first; the merge moved `omega.lock` from d0889a94 to 62833658. 62833658 + contains d0889a94, and between them no engine source changes (only build plumbing in the + Makefile, a comment in `src/runtime/rx_argus.h`, and non-engine directories), so the chip + result carries over (INFERRED from the source diff; not rerun). +- Independent review: no MUST items. The check scripts' default port moved from 18097 (the + Qwen3-8B server) to 18098, and 18091/18092/18095/18097 are now refused (the runs above + already used 18098). The other review items are issue #523; the Rust code is unchanged + from 8a4c36e9. + +CALC-EXEMPT: every number is copied from the run logs (SNAP lines, health JSON, memory.txt); none is derived. diff --git a/docs/inference/evidence/pkv514-chip-20261014/SHA256SUMS b/docs/inference/evidence/pkv514-chip-20261014/SHA256SUMS new file mode 100644 index 00000000..5f718a7c --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/SHA256SUMS @@ -0,0 +1,216 @@ +0eed5ffc5a9028850887acce77a9145f75639563d16b985363644480146402a6 ./PLAN.md +e7d1cb06f01459cf8ab7811a627ceaff4e883132eff4b61e8764498bb528b28e ./RESULTS.md +b645ae8d1e71491b8d80991ff3f32832d9c0d511374f8b7d0aa5b4fbc3263024 ./run1-7d036ac4/chip-check/late-load-a1-health.json +68d0aeb9b50656235222b11b867684eb449df986ea0455bc9ee6e776bd9ee55b ./run1-7d036ac4/chip-check/late-load-a2-health.json +8691412618372ab02c3de3bc8fae9fbe5bbb93725b0697dd18bf3a8cfdf168a4 ./run1-7d036ac4/chip-check/late-load-a.log +5e0f8753ccdcfb428d43bd8f44e337bf6cf426d40e937805f31fd60b622f3a04 ./run1-7d036ac4/chip-check/late-load-b-health.json +c3cfc74c7cbf232d7e9d6c8ef53eb2fb98f9c7de286c84fe39b628609aebddd1 ./run1-7d036ac4/chip-check/late-load-b.log +d60eea25052fa81ded5788af112d89405fd539edb0f238a7a4ff141cf6962b8a ./run1-7d036ac4/chip-check/late-load-b-turn2.json +d62bef90840c6892fd746cc47aa661748a7ee58d49c5242421e9dffa0c764dfd ./run1-7d036ac4/chip-check/late-load-other.json +3a7a4dbaaad09216fd5abce2338680f57069969a1687a43df1867699c2e855f1 ./run1-7d036ac4/chip-check/late-load-park.log +a30eb75015b69d022a54cc870b0cf1c5011d53751c17c4b4b560bc3e04a0676b ./run1-7d036ac4/chip-check/late-load-turn1.json +96bca8351dc2c0e35dbaee685505f72418cc79fda7d53dcd111fd48c836be2e5 ./run1-7d036ac4/chip-check/late-load-turn2.json +1a53550c2201e1cfb06fe120527cd159428402d54b0b58390b23bff2917315a1 ./run1-7d036ac4/chip-check/late-park-a-health.json +fb4e493fccd435ed28914f701659f48077882c5de2843f2ba004a898ccb332e9 ./run1-7d036ac4/chip-check/late-park-a.log +75bec227b2dad3e17d1717ba669088e2bcd160f450fddc3580eef85caed3749c ./run1-7d036ac4/chip-check/late-park-b-health.json +c1350a1f05f7e14047322b460ec288583ea8b49236bc5833443e7d0bdac3c796 ./run1-7d036ac4/chip-check/late-park-b.log +687c6512beb9a0ec270baea8477dcb254c20c2324910221befaa3880183d3a48 ./run1-7d036ac4/chip-check/late-park-b-turn2.json +141e52b88a80199a9a2a2bacd4adc30f495974ff554fe397a7d2925838e4c8dc ./run1-7d036ac4/chip-check/late-park-inflight-health.json +c48a8e5cb5e183d01d33da4d953826b5221d82a4e9fa9039a8c71a0562ae1c14 ./run1-7d036ac4/chip-check/late-park-turn1.json +f2b78d587d3b48b934e5e8e4f8604c989853a8153d297f264335bc155d8a53ba ./run1-7d036ac4/chip-check/late-park-turn2b.json +b4ca5a6e961d9c32d3e90e0967bd8e2b2250592c9b3a52f9914d8362bf643f72 ./run1-7d036ac4/chip-check/late-park-turn2.json +3c02e4f2773fcc56612d34d37bd9cee7100e0947dbead2a526fb8de681ac36c3 ./run1-7d036ac4/chip-check/neg-corrupt-health.json +41568570fc9a61b585adfbd018aac3a64e2db5d317359ef574792556af92b3a6 ./run1-7d036ac4/chip-check/neg-corrupt.log +7f4521ed987688c352610fdc75650c06218814d29ee9e08abe583c4ce4101d71 ./run1-7d036ac4/chip-check/neg-corrupt-turn2.json +78aa0b07b78ae52b1cd3bec4dd10dbb5ab051f2df4093c5a3d87ba9c54c0bbe0 ./run1-7d036ac4/chip-check/neg-switch-health.json +8fc436681d54de198b4ea6e691336634eb188383223a167c31670dbf6e9d82b9 ./run1-7d036ac4/chip-check/neg-switch.log +2d12c2719fb013941f7094da4d88d28e2fa7e136cb3928954b3bd157ee9156b0 ./run1-7d036ac4/chip-check/neg-switch-turn2.json +f0408de5c7b13b0d939a60c57fb6f447f77df73175a62ac5cd9b690325f486f0 ./run1-7d036ac4/chip-check/off-health.json +9ca6523a54ef00aa8f71ec6f40105a0508ada1d6a5aabcf1db4eba3c87ab3a9f ./run1-7d036ac4/chip-check/off.log +db3441c8b4c42734380e53dfdc8e86af94cc11862b2807c394777f438ee5b3c5 ./run1-7d036ac4/chip-check/off-other.json +74ba5dfa66dfaf7f5abad231f9058dd72b3c1f189d703ad99a4b02d81fac1202 ./run1-7d036ac4/chip-check/off-turn1.json +7aa69c482d3a4a05b43ae674f18080fcf83d31ed4a4bebdbf73b44ff583240e7 ./run1-7d036ac4/chip-check/off-turn2b.json +6c8ed51e85779799e1c25a15c6844deff536fa74fa44bb1ffa93cbbb5183bb73 ./run1-7d036ac4/chip-check/off-turn2.json +282f617255b339b5235f687302057d721b41e6b9f2a48cded0e860ffbf16c92a ./run1-7d036ac4/chip-check/on-health.json +33d178f697d356d1b4765e4f111e2fc18fc68eb43ae65d06c165bf8214b8a423 ./run1-7d036ac4/chip-check/on.log +9191fc2efdf1130d55f3820adf4f03358981786722ddd4f28b30f75d9601c1de ./run1-7d036ac4/chip-check/on-turn1.json +ac0afac7fa20fa17efb49c3e5d150d4116875873920b8d9ea3f2da5a2e3e9401 ./run1-7d036ac4/chip-check/on-turn2.json +57d5c8ed6e03b591975b9d5a4072d93f750f019a9c2a4bb2a90947c39e3b6375 ./run1-7d036ac4/chip-check/park-health.json +af1ee026cb362adff5f502f723554bb0480752e6eb9faa41561a598a0e658218 ./run1-7d036ac4/chip-check/park.log +7496aad6b4f455a51cd796b8a5e3f88a62e47a589dda167a970e204f83f28dc6 ./run1-7d036ac4/chip-check/park-turn1.json +5b9afc743dd4c1109a528a11bee912dbed5ffe6f730167938832e7bdf8accd02 ./run1-7d036ac4/chip-check/restore-health.json +57084b524d91e31a698d4e5609f2f6cfa3954dbe75790d446fc0ad774bab2b76 ./run1-7d036ac4/chip-check/restore.log +0861d3a3f785529a99c669d99d3bef997301dd8542099f14a86191513543d6a4 ./run1-7d036ac4/chip-check/restore-turn2.json +a3b0f36224d395e5974aa942260569ca91e401fd44fc7ed7d580c33bb8a1e53e ./run1-7d036ac4/chip-check/run-info.txt +3ecbed25922f6b3480fc5c6f5a423e2bb2a5488d5d8a6ed805e18c2a47961048 ./run1-7d036ac4/chip-check/summary.txt +39b82eac21d6e7c8fef21c8798aba142f063bc54c4c534964b25046b67787972 ./run1-7d036ac4/chip-check/torn-a-health.json +8a9810219c5fd6d70a4614d0a2222398d6dce84e3561cb01c9673581b885a150 ./run1-7d036ac4/chip-check/torn-a.log +bf9e20e360c215c4bcfad45ca12d329c63f741809391a113fa8a32e3386027f5 ./run1-7d036ac4/chip-check/torn-b-health.json +15f0f35a48c8a85683295d010aedb870641ac949568eae940cd42da3fef885dd ./run1-7d036ac4/chip-check/torn-b.log +3187a0512bf571d434e356b422ec259ad138c2f3d8188b312cbf4bef3ec0709c ./run1-7d036ac4/chip-check/torn-files-at-kill.txt +3323c1266d3d1f2bf1db2135233d2070fd3af0d4534edceab0d9691e773dd28e ./run1-7d036ac4/chip-check/torn-turn1.json +736db5ecc34182dc62545b79ef0ba23d77fd76212860d0f3066d2def1f9a7db0 ./run1-7d036ac4/chip-check/torn-turn2.json +c290741642ac1622b1e881c821973e5d79d9aa682af2b15910f7c23a263b0186 ./run1-7d036ac4/ground.txt +3c5dbaf96c87c525c92c7f1125c49512eaa370f5f22dff3610b22d395b2dd31f ./run1-7d036ac4/item1-3-4-roundtrip.log +fbe255840f2b650628f4f16b49b927dc0bfe5ad7bb475b4560646d40050de21a ./run1-7d036ac4/item2a-inprocess-restore.log +d7094240a856cc8a46321fb790795b863d3a16d6396a5a0b04d7c5257cccf250 ./run1-7d036ac4/item2b-chip-check.log +874aeb5dd66944ae50c542f4313629299d556d660af867ae5eae72050a71ca59 ./run1-7d036ac4/item5-two-process.log +b593261dcb8609967109f4880ddc1d02eb78f320fcc46c7e4d98d2f99c515613 ./run1-7d036ac4/rc.txt +42abb1e12a86216079f7a62832fe0720739f40229f884c9a364b4ec8108bc5ca ./run1-7d036ac4/run-all.out +74f1a7fee6a299be3a8d95e6c542241f5974ec5cb15e9e7629c0dbcdbb6e636f ./run1-7d036ac4/two-process/memory.txt +7af1c2b3469abb4bb08a97d598d8d1b0cd888625f88f1dcb76dca0aacd91f44f ./run1-7d036ac4/two-process/off.log +6ed8bf6116eaf9f043d7feaba1902cbcd8b14bc9b1669bb16346745146ba24a2 ./run1-7d036ac4/two-process/off-turn1.json +341fa218432fff7f582ff596c8fffb2b96ddc5b27a5a4230e83b617adff42345 ./run1-7d036ac4/two-process/off-turn2.json +29d1bdb319183f480e57926481643cdf7c521548f5344fa52216dc70f170678e ./run1-7d036ac4/two-process/proc1-after-turn1-health.json +8d417350140aa5a4aa08c91b886c78460353ae82c74b08d876dcd3d94f200ca6 ./run1-7d036ac4/two-process/proc1-health.json +42d0c550d6838833ec3a3ba3c3b5f645202cc7043ec8c449e5a64c86d548c553 ./run1-7d036ac4/two-process/proc1.log +d6919800b10e9d0e0ae637eea9b57c536c5eb40c8681d01f89baa081dda9ecab ./run1-7d036ac4/two-process/proc1-turn1.json +67888b1c40161562e8bd8fb2e9d7abac9a105c99f4bef6175fcb49ea537f7bd3 ./run1-7d036ac4/two-process/proc1-turn2.json +72e854ef6c590a30c3a08c586a9de252da990be88a8150cf40e5f498d9796650 ./run1-7d036ac4/two-process/proc2-health.json +b41ae4f0d9d75c9e829d9ff0f6c1a1c100e2c50dc8c4fb047cbd1e516fe6aded ./run1-7d036ac4/two-process/proc2.log +ec373f7d32215dcee31abcc07ee93823ce617bfe43549005b442670fdf0e6581 ./run1-7d036ac4/two-process/proc2-turn2.json +e762a65143b9d19e90297bcb0faf04f96a47cd2989416e674f1425faefbc054b ./run1-7d036ac4/two-process/run-info.txt +3437cea5ad37beb61653efaf1b10f924e1347d040a54550cdce93eb4a5ff4592 ./run1-7d036ac4/two-process/summary.txt +b91f89e4260f1c487eedd5844dbffe3feecbc812bb6e4886a12b5d41d9dee1b6 ./run2-a639c4e9/chip-check/late-load-a1-health.json +d4cf98c23675dee77a269fb34647a9999e6f5e74f90162a896376fafda60e38b ./run2-a639c4e9/chip-check/late-load-a2-health.json +9f0c18d43740679b48da4c66a2893141f6a9476b5f8876dd0cc61843dadec964 ./run2-a639c4e9/chip-check/late-load-a.log +2a4878a3411a91cacf2da9463fffc9b4841701f2edb58613dba6a70f7ef1de23 ./run2-a639c4e9/chip-check/late-load-b-health.json +1b16214a1399b9f5767cd4612747e791f542f974518f7a0d2e94510d12d9485f ./run2-a639c4e9/chip-check/late-load-b.log +640b2ae4422f3b6ba9098ba11e56b85b3d46bf75f11a96553a37b2ff9fa88e73 ./run2-a639c4e9/chip-check/late-load-b-turn2.json +1aae6d7abe82980900f65c360ad5e5c2302e213705fdd4cafc537999b4dc436d ./run2-a639c4e9/chip-check/late-load-other.json +5afcd374dee36be2daaa7306ddf7a110596c656ec472e0ce31e754f39b5a0e2e ./run2-a639c4e9/chip-check/late-load-park.log +fe9eac5fb33d84a035961176cc0044be96d8b02551e8c96d895ee86bd72cef76 ./run2-a639c4e9/chip-check/late-load-turn1.json +8616c8dddb3fc0eb9edfb09be3a4597fcb5885609e056f2aa0c24f68fcff95b0 ./run2-a639c4e9/chip-check/late-load-turn2.json +ca4bb23922f31f6cdedba869aff6580cdb9160b068271e12978910b24e1d5f05 ./run2-a639c4e9/chip-check/late-park-a-health.json +db42213b4956d05a7baef2022b4b3aed0800b4f63483828fc8a6f1e65fc1c371 ./run2-a639c4e9/chip-check/late-park-a.log +80ac28bd1f945a9f4971c378942b163dd0d1557f6a5dd0680bea2dcfe6f07947 ./run2-a639c4e9/chip-check/late-park-b-health.json +271419b9332a636a3f6a6c2ed10c1c386953ff50bc44970b0cd8dff7e443a415 ./run2-a639c4e9/chip-check/late-park-b.log +1d5d2ff96d78a8217c9abc33eb88c5b6b2562aa12d595a2c85c29cc4391187d5 ./run2-a639c4e9/chip-check/late-park-b-turn2.json +e94978752d9199f39698c4141cdbca53ede156f21551a41fbd38bf6e11bdb1d9 ./run2-a639c4e9/chip-check/late-park-inflight-health.json +5a251c412f8518e4a4f4af8e007bcdefa74441c72e85bc4f2ad76f65e7052e5f ./run2-a639c4e9/chip-check/late-park-turn1.json +2018e3b396a54b81b45fd1922a333ed4f2cb00849bf4801030de6e145c451256 ./run2-a639c4e9/chip-check/late-park-turn2b.json +92fbb8035935a0a0248cf44fa9660591194f0ff0e5a37be876010f0d896d9143 ./run2-a639c4e9/chip-check/late-park-turn2.json +84c1a45a4d26442af27fca44731792582bdbe913295cbd766e1dd3d12c0c5c58 ./run2-a639c4e9/chip-check/neg-corrupt-health.json +cc7e13837882468cf401933d0b54dfeb058d8eb7ccbf40df7a677f30509ba40c ./run2-a639c4e9/chip-check/neg-corrupt.log +1b879843e9ef6409ca06957c5e9cf6b4342deeb43cc0a9df9176447ca7d642d0 ./run2-a639c4e9/chip-check/neg-corrupt-turn2.json +f08da13f30c5be5b38acf7082da6e35f1d9e10d65d092fc627fe953b0cf8ee46 ./run2-a639c4e9/chip-check/neg-switch-health.json +b0fe4ac24470d993acecae438ac1822be4525cec003837164506629761cfeaa2 ./run2-a639c4e9/chip-check/neg-switch.log +b294fd03431b98ff3a225070c580ab2f4a9bd73ba47fd63460d20b8626504237 ./run2-a639c4e9/chip-check/neg-switch-turn2.json +f0408de5c7b13b0d939a60c57fb6f447f77df73175a62ac5cd9b690325f486f0 ./run2-a639c4e9/chip-check/off-health.json +a6a9d0b1bf0d7739505c15deee65095a7a00c0cbe9eae2480e1cce11f0b0a8f2 ./run2-a639c4e9/chip-check/off.log +1d64d65c60028ebd4cebbf9f10da06bbd442ccea3bc314c4bd39ab137ee6897c ./run2-a639c4e9/chip-check/off-other.json +0ef9247c65839b6ba2279b2a92bb3fa30f78f6d9e4c7942098465970dd0455b4 ./run2-a639c4e9/chip-check/off-turn1.json +db2043c41590482712a597c48c8da5c9fb2041cec80d848eb817bc4c6d0d4894 ./run2-a639c4e9/chip-check/off-turn2b.json +aaf755d4c203c70d81da7ae13caf4044d56e52aab9e37d075b4d527fccd8eece ./run2-a639c4e9/chip-check/off-turn2.json +49c18035229d31b8c7e5b5a17838a358dd4c1ff3c553eaa528546acd058f7510 ./run2-a639c4e9/chip-check/on-health.json +d21230f36dad51caadd11126202186e4508146d0534e3270e6824a52888ff90f ./run2-a639c4e9/chip-check/on.log +57d672e0fb4462485fc9e0eba04bae636d8f68baffcb3049e26320af0b59507f ./run2-a639c4e9/chip-check/on-turn1.json +249eb5d18cbfb6dca62fe21fde04741f6b679c266506ad449c162c049a84ddd2 ./run2-a639c4e9/chip-check/on-turn2.json +6aa02c5a6bd93cdb78811765883d429cf2159fbdec77f6b4f43060ade0f64c21 ./run2-a639c4e9/chip-check/park-health.json +4595ebf94969d256d66c333fc2ce65992003fc085f028d108f935b21f070f547 ./run2-a639c4e9/chip-check/park.log +955f39da9e3b4c1e0b5fc8b36325eead5f37eea81de41bf369d9f9017fccc8a0 ./run2-a639c4e9/chip-check/park-turn1.json +0da8e192b5af66251750c49dd939444bdc5574903b56ff3bf71cac06a2bc2fbe ./run2-a639c4e9/chip-check/restore-health.json +d042313a79d96071f4ad29b2532d0538b4824638323ac44018eb92800ec0c63d ./run2-a639c4e9/chip-check/restore.log +f9479aeaa39b03e71dc915ae4edeb0cc16e7dafb2b511625e79a754531f03620 ./run2-a639c4e9/chip-check/restore-turn2.json +ddc7c4f3755899e36996586bab90b1d2ae2d06da7e090738673ceae5dd6ad49f ./run2-a639c4e9/chip-check/run-info.txt +99737015b7e4597dc72e8651cf0d988828a8e4d013ab6fb792623831a585efca ./run2-a639c4e9/chip-check/summary.txt +2481f70fb1aa87d35f3667402639fac20fb1bcceb26552bb4bdcde6a579c13b2 ./run2-a639c4e9/chip-check/torn-a-health.json +541ec8c65cdd3bd70f89a84e08122e379d8111af20a0f94a17059c72ea89d36c ./run2-a639c4e9/chip-check/torn-a.log +f7b1a82a07d6c2c9d45df6f46add6c1a6870f5899acb9f06d316ff4fe5cf8433 ./run2-a639c4e9/chip-check/torn-b-health.json +a9c5df2a36e5fd03754a721eac1a8feb35cfaff23c514873611de1a8276e6db3 ./run2-a639c4e9/chip-check/torn-b.log +af6d94330ce69527afc57d64d302eed35520278c359f3fa04951485053213cc8 ./run2-a639c4e9/chip-check/torn-files-at-kill.txt +e5adf79179531bb74a91f4791161e5c3b3ae7cb70b03f969ae64ac84fc16d6eb ./run2-a639c4e9/chip-check/torn-turn1.json +4128d4c825d205f068bff2162357863782e08e17b02b64ef0bf59dd722eb7854 ./run2-a639c4e9/chip-check/torn-turn2.json +e05f523d56e2090d5e9569f9cf02b3d876a703a91c894bec78aae538f5bbc858 ./run2-a639c4e9/ground.txt +e63e5b54157184bef004c5c472749d23a852c30452d345dec47cd12187fb55d9 ./run2-a639c4e9/item1-3-4-roundtrip.log +e3e16456dcedb3c790f1350d7de8f23fa105e3e1e22bea893a466aece3188f91 ./run2-a639c4e9/item2a-inprocess-restore.log +9eca40d0397671eebf4370b3c6963aecbdc8ac38fd065885b8b9d2c5434b2dfb ./run2-a639c4e9/item2b-chip-check.log +dee5e0025fe7a2463377f2a9af08914a01cd25ef070b3972fd06d85846127975 ./run2-a639c4e9/item5-two-process.log +b593261dcb8609967109f4880ddc1d02eb78f320fcc46c7e4d98d2f99c515613 ./run2-a639c4e9/rc.txt +119c15e98a3df54c5c144f9e526b3d1287e1a88a3163ccda1f311aeb233510fc ./run2-a639c4e9/run-all.out +40e4488eb5ddc5b606f455096392b70acfc79ada0e16f09143255fc30473d505 ./run2-a639c4e9/two-process/memory.txt +c9758282cd9c00a5e1a006878a6768eea35e6c4a74f1744e2c797594712895f1 ./run2-a639c4e9/two-process/off.log +43007caeed9e9c76eb4d4681d1c944b9ea80c2b5af160ae959aea7d5979d6bab ./run2-a639c4e9/two-process/off-turn1.json +f1af77685ba7a7fb46a5c74b253f8bddf100f326d6aef0b12203c42cb6676240 ./run2-a639c4e9/two-process/off-turn2.json +73c393861c97d10efc049c96d99ef2a93d8241b4475752c7bd04257a68914f78 ./run2-a639c4e9/two-process/proc1-after-turn1-health.json +7884e12f67d6eb4b9e066df879b8f35cbee5beedb80077a99a276cf7acd41ad6 ./run2-a639c4e9/two-process/proc1-health.json +a78974e39b4bed5868befa0333496cd7eee61122c1a5bd4d7a48b14d2030f675 ./run2-a639c4e9/two-process/proc1.log +8c04f6c438826f9d37a668376af38770386e4b890568e5a8d56e1809b0573b9c ./run2-a639c4e9/two-process/proc1-turn1.json +14006d0c90a5618569f50595eb4898a7c57f94475d0755947a78b04ce4009fbf ./run2-a639c4e9/two-process/proc1-turn2.json +b52630e594429a64b7f30cf6a428797f79291de80c06d08a7b3d6b7c023903bf ./run2-a639c4e9/two-process/proc2-health.json +66a8b34d4b4cee3ccb8c192bcf40d4c9b7413fdc36442734551b0b51c6931583 ./run2-a639c4e9/two-process/proc2.log +2ccbea981e8300dcde23e866117219db149a2c69b81c1b1583159cdfd04992ba ./run2-a639c4e9/two-process/proc2-turn2.json +38bf4c547e5e4a50ce0466d0d1833901dac7388d4e560406094e5b2f2fd289aa ./run2-a639c4e9/two-process/run-info.txt +69f249e4e117a3a819153ed461f1c4bb24790645420883dee20d3eb9957b68e4 ./run2-a639c4e9/two-process/summary.txt +f1863cf07f8d007c18bf49a68e9ed53ed4c8220c353e930112882f7e35e579ed ./run3-8a4c36e9/chip-check/late-load-a1-health.json +6e869b5b6284553fbff5ed4bb2fb2cdb59e31d7cda153bda72254f15006dc012 ./run3-8a4c36e9/chip-check/late-load-a2-health.json +973cb01598b608508eab19a3fb9f6d4d3f3f4ff23c0d42cc34bf06ebabcae854 ./run3-8a4c36e9/chip-check/late-load-a.log +430b49f7eee73eb76a0c1380e7e405707750f15ed957ad9f52974d49d209c5e5 ./run3-8a4c36e9/chip-check/late-load-b-health.json +59bfa026ef26442e59efb0ea0364d34861c956d8e920d9d97bc2f7a810e78f47 ./run3-8a4c36e9/chip-check/late-load-b.log +b51620edaafda2b5bf7ea5cf9a31430c106a7362625935d06d45b2bf7aeb4b7a ./run3-8a4c36e9/chip-check/late-load-b-turn2.json +beac008c7cae72d4ab4110e9ca769437e8f0bca232b0d90f1deae347b7b38145 ./run3-8a4c36e9/chip-check/late-load-other.json +800049d0c5772fd6253c3e830c5ddb6b0e94f1e8779faeeea165cec60d1a4585 ./run3-8a4c36e9/chip-check/late-load-park.log +4a76acdc3402f123bcf3a99de8be792a459d843a708f2dfbd182ca0e675d3bed ./run3-8a4c36e9/chip-check/late-load-turn1.json +9aee8812114e8edc73894b11dbd8b5c593b2a5df1e0642218a49ed95817b1151 ./run3-8a4c36e9/chip-check/late-load-turn2.json +fcceba51ef1a80f47e179e71003c5d1371adbafe5902f21ce89ce0c1c5fe231e ./run3-8a4c36e9/chip-check/late-park-a-health.json +c079f1b4a30e6ab3d75153cb45b0a662691974e4ee59644ec8f01539d80870ee ./run3-8a4c36e9/chip-check/late-park-a.log +e1edb86f0014a9d44021593b9aceea263ac16d9f97733f2c0797830f79b1dbcd ./run3-8a4c36e9/chip-check/late-park-b-health.json +23806c9b4ecba4558ce7e4b16d33cc4f353a382e8b5d7712dc3fc96b5c3b5354 ./run3-8a4c36e9/chip-check/late-park-b.log +7fc605d59950e28c8b7e981440be6fcb51454b6d6016ed5abfd30910127dbe06 ./run3-8a4c36e9/chip-check/late-park-b-turn2.json +d8afb3daf6e631cfe5cf6fbb018d4fb04ca2b813afeaba3af4945d2b6a21321f ./run3-8a4c36e9/chip-check/late-park-inflight-health.json +e86213b94eb8197a5fece6626d6ecf7b30ba8fe3e5e80de1c916ada81a63f962 ./run3-8a4c36e9/chip-check/late-park-turn1.json +0bbaaee903ebc40daa9d059d8b48340c9d8cd2a0fa4d2d8bdc2f21aa6ad0eae1 ./run3-8a4c36e9/chip-check/late-park-turn2b.json +7c177f358c9ab212d77147f597349ed9543b5b82af60b69e3253d138a35299b9 ./run3-8a4c36e9/chip-check/late-park-turn2.json +bddc3a1efd37274b8fc920d4e56fe9a762d48b762c18b42f43f5d3644f1ae7fd ./run3-8a4c36e9/chip-check/neg-corrupt-health.json +27aad178fcf377184ff13362cc491547225209c7fe351bb30ed0d4e5984e0661 ./run3-8a4c36e9/chip-check/neg-corrupt.log +2fa18a127c1f153bd2d397213b8ad5742c2d819cf143114fc81094fbae567e85 ./run3-8a4c36e9/chip-check/neg-corrupt-turn2.json +67c58877abc063e2d8a739568172c03771be456e1289bffe5888a8780355fcce ./run3-8a4c36e9/chip-check/neg-switch-health.json +06a35d33c8cecbe9eee8e9b2ae0901cabb7789677dbf090600f65447360f7378 ./run3-8a4c36e9/chip-check/neg-switch.log +25732a7ef287a5512ef6be05fc96911c8d0b12824df8351fad668d412a358b6b ./run3-8a4c36e9/chip-check/neg-switch-turn2.json +f0408de5c7b13b0d939a60c57fb6f447f77df73175a62ac5cd9b690325f486f0 ./run3-8a4c36e9/chip-check/off-health.json +00ff1d65e25f9af2a339e45c605fa77993d6065661314ae0e6d08a5bb52abb4c ./run3-8a4c36e9/chip-check/off.log +a3385f2c35f55339ae925060d9fe28664d55aec744221adcf4b41860f22493ac ./run3-8a4c36e9/chip-check/off-other.json +4a4b0d305ecb129ac30aa468780892e2f5d13f95f33a0a7c6e7725a77e881812 ./run3-8a4c36e9/chip-check/off-turn1.json +0d99d766001615d578b7f0f3a27603e0308cb64fbec2f9b517c2704828ddf80b ./run3-8a4c36e9/chip-check/off-turn2b.json +2688ce94e786b2dc7550c18b4b335777c48a538f712b8b79f8441c1a844e934d ./run3-8a4c36e9/chip-check/off-turn2.json +3874b9bc5a342ae9e7d6cf71e70f037a325b9fae5be93f000f14053dbea7d003 ./run3-8a4c36e9/chip-check/on-health.json +9c3a4111041f40568b85f2171fd7a3227c5bb8c436c42d21f954da16bc974c94 ./run3-8a4c36e9/chip-check/on.log +ae894b9970ccffaedd9f43fe0122840a5994571108488ba5899f5d6051451bb8 ./run3-8a4c36e9/chip-check/on-turn1.json +58fbf816349f6eb3e1e5dee2531317b01de6b0ce553ea359c0dabaa737bc176f ./run3-8a4c36e9/chip-check/on-turn2.json +01986ef8f031e8c50771d6413bba105d4fb53a8ca22daea4be92a03a52728b3c ./run3-8a4c36e9/chip-check/park-health.json +352817364347a0b2a18ee33f7a472401ef85bacb8c883f3d0ba4677d87bf8f99 ./run3-8a4c36e9/chip-check/park.log +b00e6efe783240b5a00b7ffdc557b936d6e5608d7fd96ea42659f36e1ffa6b5a ./run3-8a4c36e9/chip-check/park-turn1.json +f29045617894b3a9897fcdb9ba9cc1fdf909d264fd4bfabe2e5da48d1fa8a403 ./run3-8a4c36e9/chip-check/restore-health.json +436a17a44572b1a558cd8df14fce27db9f304275f0b6e534dabcd54a7a461c8e ./run3-8a4c36e9/chip-check/restore.log +d1becda72c81fbc8d4a93fac954239b51972ea43d54e5303afb8c43308a2d5a2 ./run3-8a4c36e9/chip-check/restore-turn2.json +df5c85b1e0d1b666838870f646a56bc30bfbc22011f3f18918caddff9cc6107a ./run3-8a4c36e9/chip-check/run-info.txt +99737015b7e4597dc72e8651cf0d988828a8e4d013ab6fb792623831a585efca ./run3-8a4c36e9/chip-check/summary.txt +ba135d245c442cd82987e1471491e2f5f31f14e310ba4fc8d481cb55dd4a0588 ./run3-8a4c36e9/chip-check/torn-a-health.json +372d689732ca051e76ede0c27a4469ce47885b9986b70d8142ca00667184709b ./run3-8a4c36e9/chip-check/torn-a.log +5e9e1cd408ba75767d32ec7be9d26b2722a62dead2f73b1d0579e9cbefe33ba6 ./run3-8a4c36e9/chip-check/torn-b-health.json +2cdb7999b0a223b6008bdb0d853fbb870216f1e66d0ea991876d5df73eb935f2 ./run3-8a4c36e9/chip-check/torn-b.log +5c1c579eb6ddaeea70133f7a0c80bc660965b29262923832ee3c39a9de541d52 ./run3-8a4c36e9/chip-check/torn-files-at-kill.txt +cb62e7159fcfb565ae65200573562aff2531ec5a153674b5b35ce2ae89207103 ./run3-8a4c36e9/chip-check/torn-turn1.json +cd3c5b5e32e260036366bfed7455b36a20fa83906aca144ea89b6da7e097d437 ./run3-8a4c36e9/chip-check/torn-turn2.json +cdf5cb8becb8d1c9a0b876277b4feb49e034afa6cb7b33d50a843d851c271312 ./run3-8a4c36e9/ground.txt +4fb3e057a54ae1237b7cb82b4b661ca16cf5ac2481d72d2ff8f563ccdb0509c7 ./run3-8a4c36e9/item1-3-4-roundtrip.log +b97145fd39be5c7032ec2d4701fe60c8d1c0bb391d1d893530b34057a5e8a5e3 ./run3-8a4c36e9/item2a-inprocess-restore.log +ab3371c1200558c5311c7aef89c695aecabffddd9032d1fd35ddab98f031c794 ./run3-8a4c36e9/item2b-chip-check.log +2d9ded39d24b9b7cb808ddc8dea792463a8c7197bb422273c2be9a3c68128016 ./run3-8a4c36e9/item5-two-process.log +290e5b59ef9f7c538763c58b6556087036cbe660117828401e87a01d96c0e717 ./run3-8a4c36e9/rc.txt +f4102cc3481fe9cbe6c58e2c187552f6c8b1455ff4c0a381c26b59796fcabb06 ./run3-8a4c36e9/run-all.out +f3cae29d20a661579e919eee97ce4757432e60e101b2f9b94207e31a88915543 ./run3-8a4c36e9/two-process/memory.txt +fa64671d69a879fe1c21a9160ec7d67c6844fffb13c59e79412f4f42afb04358 ./run3-8a4c36e9/two-process/off.log +36e05bdd7b80177cd291b4d0141c7a9fd56a16c2c5beeda649ed3f1702ed6178 ./run3-8a4c36e9/two-process/off-turn1.json +c3ae7ae6b7bbad4896eb711cdb4b18b1a9c14ab6b23823655e65457d69f67f8d ./run3-8a4c36e9/two-process/off-turn2.json +3f48e5676f139328fa6ead43cffe2309ffd58ca1c97028789be1ced4d32749b8 ./run3-8a4c36e9/two-process/proc1-after-turn1-health.json +cf71538b1ed8be2d13e8513d577cb88214d2db30bcd1567b6bb89697a4427fd2 ./run3-8a4c36e9/two-process/proc1-health.json +abe4b29215dd0d5ace157c381d8f5cc3278ff05be772673151cd3c5d64db9bfc ./run3-8a4c36e9/two-process/proc1.log +22e550af0035de6e230e2ea7a5355f42f17a4f071c550822192d57a6998a133f ./run3-8a4c36e9/two-process/proc1-turn1.json +29cc6a3a31d7361a4c2a0a3a4a243c35a0f7494c4741ecee5a0b18062e76afd0 ./run3-8a4c36e9/two-process/proc1-turn2.json +3288b2002d8260e6360258a5e5e47c7aaee99dde73d669b0d629a7f3c08e5b25 ./run3-8a4c36e9/two-process/proc2-health.json +bdf7f154c957469d476d9fcda572c3a4ddf844642d1e4a989011b57e8ac1c20c ./run3-8a4c36e9/two-process/proc2.log +4ef40a3d16b4f45e784e46486c036e0e110eddf87844b229562ffd2267acf070 ./run3-8a4c36e9/two-process/proc2-turn2.json +3446b565b22c657d73b8782c29fb94e6aa9380c2f4ec6f146d57193cfa397041 ./run3-8a4c36e9/two-process/run-info.txt +69f249e4e117a3a819153ed461f1c4bb24790645420883dee20d3eb9957b68e4 ./run3-8a4c36e9/two-process/summary.txt +7b3f87bdafad5dfc239552e4581f82902d619e495ee365688777c2fd13c4571b ./run-all.sh diff --git a/docs/inference/evidence/pkv514-chip-20261014/run-all.sh b/docs/inference/evidence/pkv514-chip-20261014/run-all.sh new file mode 100755 index 00000000..f8a77097 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run-all.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# #514 chip qualification, run under a quietlock hold. Never kills anything it did not start. +set -u +R=~/workspace/sc-pkv514 +E=$R/docs/inference/evidence/pkv514-chip-20261014 +T=$R/target/release/deps/kv_persist_chip-78f753803b9292f4 +BIN=$R/target/release/aien-serve-http +export OWN30B_MODEL_DIR=$HOME/models/qwen3-30b-a3b-instruct-2507-fp8 +mkdir -p "$E" +{ + echo "commit $(git -C $R rev-parse HEAD) dirty_files=$(git -C $R status --porcelain | grep -v '^?? docs/inference/evidence/' | wc -l)" + echo "binary sha256 $(sha256sum $BIN | cut -d' ' -f1)"; echo "test sha256 $(sha256sum $T | cut -d' ' -f1)" + echo "omega $(git -C ~/workspace/pkv514-pins/omega rev-parse HEAD) driver $(nvidia-smi --query-gpu=driver_version --format=csv,noheader) kernel $(uname -r)" + echo "start $(date -u +%FT%TZ)"; grep MemAvailable /proc/meminfo +} > "$E/ground.txt" +step() { local name=$1; shift; echo "== $name $(date -u +%T)"; quietlock hold --owner PKV514 --minutes 20 --reason "#514 PKV chip $name" -- "$@" > "$E/$name.log" 2>&1; local rc=$?; echo "$name rc=$rc" | tee -a "$E/rc.txt"; grep -E "^SNAP|^test |test result|panicked|PASS|FAIL|VERDICT" "$E/$name.log" | head -40; } +step item1-3-4-roundtrip env PKV_CHIP_SCRATCH=/tmp $T --ignored --exact fused_cache_round_trip_cost_and_restore_latency_on_the_chip --nocapture +step item2a-inprocess-restore $T --ignored --exact restored_turn_two_equals_the_uninterrupted_turn_two_on_the_chip --nocapture +step item2b-chip-check env PKV_CHECK_PORT=18098 PKV_CHECK_EPHEMERAL_KEY=1 $R/scripts/own30b-pkv-chip-check.sh $E/chip-check $BIN +step item5-two-process env PKV_CHECK_PORT=18098 PKV_CHECK_PORT2=18099 PKV_CHECK_EPHEMERAL_KEY=1 $R/scripts/own30b-pkv-two-process.sh $E/two-process $BIN +echo "end $(date -u +%FT%TZ)" >> "$E/ground.txt" diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/SHA256SUMS b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/SHA256SUMS new file mode 100644 index 00000000..3e82b782 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/SHA256SUMS @@ -0,0 +1,50 @@ +b645ae8d1e71491b8d80991ff3f32832d9c0d511374f8b7d0aa5b4fbc3263024 ./late-load-a1-health.json +68d0aeb9b50656235222b11b867684eb449df986ea0455bc9ee6e776bd9ee55b ./late-load-a2-health.json +8691412618372ab02c3de3bc8fae9fbe5bbb93725b0697dd18bf3a8cfdf168a4 ./late-load-a.log +5e0f8753ccdcfb428d43bd8f44e337bf6cf426d40e937805f31fd60b622f3a04 ./late-load-b-health.json +c3cfc74c7cbf232d7e9d6c8ef53eb2fb98f9c7de286c84fe39b628609aebddd1 ./late-load-b.log +d60eea25052fa81ded5788af112d89405fd539edb0f238a7a4ff141cf6962b8a ./late-load-b-turn2.json +d62bef90840c6892fd746cc47aa661748a7ee58d49c5242421e9dffa0c764dfd ./late-load-other.json +3a7a4dbaaad09216fd5abce2338680f57069969a1687a43df1867699c2e855f1 ./late-load-park.log +a30eb75015b69d022a54cc870b0cf1c5011d53751c17c4b4b560bc3e04a0676b ./late-load-turn1.json +96bca8351dc2c0e35dbaee685505f72418cc79fda7d53dcd111fd48c836be2e5 ./late-load-turn2.json +1a53550c2201e1cfb06fe120527cd159428402d54b0b58390b23bff2917315a1 ./late-park-a-health.json +fb4e493fccd435ed28914f701659f48077882c5de2843f2ba004a898ccb332e9 ./late-park-a.log +75bec227b2dad3e17d1717ba669088e2bcd160f450fddc3580eef85caed3749c ./late-park-b-health.json +c1350a1f05f7e14047322b460ec288583ea8b49236bc5833443e7d0bdac3c796 ./late-park-b.log +687c6512beb9a0ec270baea8477dcb254c20c2324910221befaa3880183d3a48 ./late-park-b-turn2.json +141e52b88a80199a9a2a2bacd4adc30f495974ff554fe397a7d2925838e4c8dc ./late-park-inflight-health.json +c48a8e5cb5e183d01d33da4d953826b5221d82a4e9fa9039a8c71a0562ae1c14 ./late-park-turn1.json +f2b78d587d3b48b934e5e8e4f8604c989853a8153d297f264335bc155d8a53ba ./late-park-turn2b.json +b4ca5a6e961d9c32d3e90e0967bd8e2b2250592c9b3a52f9914d8362bf643f72 ./late-park-turn2.json +3c02e4f2773fcc56612d34d37bd9cee7100e0947dbead2a526fb8de681ac36c3 ./neg-corrupt-health.json +41568570fc9a61b585adfbd018aac3a64e2db5d317359ef574792556af92b3a6 ./neg-corrupt.log +7f4521ed987688c352610fdc75650c06218814d29ee9e08abe583c4ce4101d71 ./neg-corrupt-turn2.json +78aa0b07b78ae52b1cd3bec4dd10dbb5ab051f2df4093c5a3d87ba9c54c0bbe0 ./neg-switch-health.json +8fc436681d54de198b4ea6e691336634eb188383223a167c31670dbf6e9d82b9 ./neg-switch.log +2d12c2719fb013941f7094da4d88d28e2fa7e136cb3928954b3bd157ee9156b0 ./neg-switch-turn2.json +f0408de5c7b13b0d939a60c57fb6f447f77df73175a62ac5cd9b690325f486f0 ./off-health.json +9ca6523a54ef00aa8f71ec6f40105a0508ada1d6a5aabcf1db4eba3c87ab3a9f ./off.log +db3441c8b4c42734380e53dfdc8e86af94cc11862b2807c394777f438ee5b3c5 ./off-other.json +74ba5dfa66dfaf7f5abad231f9058dd72b3c1f189d703ad99a4b02d81fac1202 ./off-turn1.json +7aa69c482d3a4a05b43ae674f18080fcf83d31ed4a4bebdbf73b44ff583240e7 ./off-turn2b.json +6c8ed51e85779799e1c25a15c6844deff536fa74fa44bb1ffa93cbbb5183bb73 ./off-turn2.json +282f617255b339b5235f687302057d721b41e6b9f2a48cded0e860ffbf16c92a ./on-health.json +33d178f697d356d1b4765e4f111e2fc18fc68eb43ae65d06c165bf8214b8a423 ./on.log +9191fc2efdf1130d55f3820adf4f03358981786722ddd4f28b30f75d9601c1de ./on-turn1.json +ac0afac7fa20fa17efb49c3e5d150d4116875873920b8d9ea3f2da5a2e3e9401 ./on-turn2.json +57d5c8ed6e03b591975b9d5a4072d93f750f019a9c2a4bb2a90947c39e3b6375 ./park-health.json +af1ee026cb362adff5f502f723554bb0480752e6eb9faa41561a598a0e658218 ./park.log +7496aad6b4f455a51cd796b8a5e3f88a62e47a589dda167a970e204f83f28dc6 ./park-turn1.json +5b9afc743dd4c1109a528a11bee912dbed5ffe6f730167938832e7bdf8accd02 ./restore-health.json +57084b524d91e31a698d4e5609f2f6cfa3954dbe75790d446fc0ad774bab2b76 ./restore.log +0861d3a3f785529a99c669d99d3bef997301dd8542099f14a86191513543d6a4 ./restore-turn2.json +a3b0f36224d395e5974aa942260569ca91e401fd44fc7ed7d580c33bb8a1e53e ./run-info.txt +3ecbed25922f6b3480fc5c6f5a423e2bb2a5488d5d8a6ed805e18c2a47961048 ./summary.txt +39b82eac21d6e7c8fef21c8798aba142f063bc54c4c534964b25046b67787972 ./torn-a-health.json +8a9810219c5fd6d70a4614d0a2222398d6dce84e3561cb01c9673581b885a150 ./torn-a.log +bf9e20e360c215c4bcfad45ca12d329c63f741809391a113fa8a32e3386027f5 ./torn-b-health.json +15f0f35a48c8a85683295d010aedb870641ac949568eae940cd42da3fef885dd ./torn-b.log +3187a0512bf571d434e356b422ec259ad138c2f3d8188b312cbf4bef3ec0709c ./torn-files-at-kill.txt +3323c1266d3d1f2bf1db2135233d2070fd3af0d4534edceab0d9691e773dd28e ./torn-turn1.json +736db5ecc34182dc62545b79ef0ba23d77fd76212860d0f3066d2def1f9a7db0 ./torn-turn2.json diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-load-a1-health.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-load-a1-health.json new file mode 100644 index 00000000..8f03915c --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-load-a1-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:7d036ac444bbd2a6892ac9af7a1352c554e5eca5","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":0,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":8208,"reads":3,"write_bytes":0,"writes":0},"namespace":"abb2032ed932f927","park":true,"park_bytes":0,"park_dedup":2,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1450,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":2,"indexed_bytes":50339840,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"timeout":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":0,"seal_calls":0,"seal_ns":0},"state":"on","store_dir":"/tmp/pkv-chip.dHSKGt/store-late-load","store_state":"open","test_fault":"load:15000:1"},"status":"ok","uptime_s":13} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-load-a2-health.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-load-a2-health.json new file mode 100644 index 00000000..3f54ff64 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-load-a2-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:7d036ac444bbd2a6892ac9af7a1352c554e5eca5","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":2,"indeterminate":0,"published":2,"queue_full":0,"read_bytes":25178128,"reads":5,"write_bytes":36184064,"writes":2},"namespace":"abb2032ed932f927","park":true,"park_bytes":36175872,"park_dedup":4,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":2,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1450,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":2,"indexed_bytes":50339840,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"ram-prefix-as-long":1,"timeout":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":25165824,"open_calls":1,"open_ns":9111111,"seal_bytes":36175872,"seal_calls":2,"seal_ns":4586227},"state":"on","store_dir":"/tmp/pkv-chip.dHSKGt/store-late-load","store_state":"open","test_fault":"load:15000:1"},"status":"ok","uptime_s":22} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-load-b-health.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-load-b-health.json new file mode 100644 index 00000000..7fab9e25 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-load-b-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:7d036ac444bbd2a6892ac9af7a1352c554e5eca5","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":0,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":75534352,"reads":13,"write_bytes":0,"writes":0},"namespace":"abb2032ed932f927","park":true,"park_bytes":0,"park_dedup":4,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1390,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":6,"indexed_bytes":114843648,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":75497472,"restore_misses":{},"restored_tokens":768,"restores":1,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":75497472,"open_calls":3,"open_ns":15355383,"seal_bytes":0,"seal_calls":0,"seal_ns":0},"state":"on","store_dir":"/tmp/pkv-chip.dHSKGt/store-late-load","store_state":"open","test_fault":null},"status":"ok","uptime_s":2} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-load-b-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-load-b-turn2.json new file mode 100644 index 00000000..c92c7abf --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-load-b-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792018327,"id":"chatcmpl-18de872c96c9ba9d0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-load-other.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-load-other.json new file mode 100644 index 00000000..8541c62b --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-load-other.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Bearing preload is the application of a controlled internal load to a bearing to eliminate play and improve stiffness. It is commonly used in precision applications to enhance performance and reduce vibration.","role":"assistant"}}],"created":1792018252,"id":"chatcmpl-18de871b3779452d0001","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":35,"prompt_tokens":753,"total_tokens":788}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-load-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-load-turn1.json new file mode 100644 index 00000000..8b697c74 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-load-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792018149,"id":"chatcmpl-18de87032d980a070000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-load-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-load-turn2.json new file mode 100644 index 00000000..6bf96557 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-load-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792018232,"id":"chatcmpl-18de8716800c36410000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-park-a-health.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-park-a-health.json new file mode 100644 index 00000000..e49c5443 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-park-a-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:7d036ac444bbd2a6892ac9af7a1352c554e5eca5","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":3,"indeterminate":0,"published":2,"queue_full":0,"read_bytes":0,"reads":0,"write_bytes":50339856,"writes":3},"namespace":"abb2032ed932f927","park":true,"park_bytes":50331648,"park_dedup":0,"park_failed":0,"park_refused":3,"park_skipped":0,"parked_chunks":2,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1658,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":3},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":50331648,"seal_calls":2,"seal_ns":6331730},"state":"on","store_dir":"/tmp/pkv-chip.dHSKGt/store-late-park","store_state":"open","test_fault":"p3:20000:1"},"status":"ok","uptime_s":29} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-park-b-health.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-park-b-health.json new file mode 100644 index 00000000..12e40e60 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-park-b-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:7d036ac444bbd2a6892ac9af7a1352c554e5eca5","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":0,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":50348048,"reads":7,"write_bytes":0,"writes":0},"namespace":"abb2032ed932f927","park":true,"park_bytes":0,"park_dedup":2,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1014,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":2,"indexed_bytes":50339840,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":50331648,"restore_misses":{},"restored_tokens":512,"restores":1,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":50331648,"open_calls":2,"open_ns":6164461,"seal_bytes":0,"seal_calls":0,"seal_ns":0},"state":"on","store_dir":"/tmp/pkv-chip.dHSKGt/store-late-park","store_state":"open","test_fault":null},"status":"ok","uptime_s":2} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-park-b-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-park-b-turn2.json new file mode 100644 index 00000000..1117d5dc --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-park-b-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792018506,"id":"chatcmpl-18de875637b7f6100000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-park-inflight-health.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-park-inflight-health.json new file mode 100644 index 00000000..8baa62d1 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-park-inflight-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:7d036ac444bbd2a6892ac9af7a1352c554e5eca5","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":1,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":0,"reads":0,"write_bytes":16,"writes":1},"namespace":"abb2032ed932f927","park":true,"park_bytes":0,"park_dedup":0,"park_failed":0,"park_refused":1,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1658,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":0,"seal_calls":0,"seal_ns":0},"state":"on","store_dir":"/tmp/pkv-chip.dHSKGt/store-late-park","store_state":"open","test_fault":"p3:20000:1"},"status":"ok","uptime_s":2} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-park-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-park-turn1.json new file mode 100644 index 00000000..a99f1348 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-park-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792018404,"id":"chatcmpl-18de873e748dcafa0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-park-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-park-turn2.json new file mode 100644 index 00000000..0bb1d4f7 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-park-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792018406,"id":"chatcmpl-18de873f065ca9620001","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-park-turn2b.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-park-turn2b.json new file mode 100644 index 00000000..fe5f43c5 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/late-park-turn2b.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Aerospace applications are least useful at home.","role":"assistant"}}],"created":1792018407,"id":"chatcmpl-18de873f5ddb69a50002","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":10,"prompt_tokens":819,"total_tokens":829}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/neg-corrupt-health.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/neg-corrupt-health.json new file mode 100644 index 00000000..97957dc3 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/neg-corrupt-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:7d036ac444bbd2a6892ac9af7a1352c554e5eca5","io":{"corrupt_deleted":1,"disk_full":0,"failed":1,"file_fsyncs":0,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":25194512,"reads":9,"write_bytes":0,"writes":0},"namespace":"abb2032ed932f927","park":true,"park_bytes":0,"park_dedup":3,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1446,"failed":false,"foreign_files":0,"foreign_namespace":2,"indexed":4,"indexed_bytes":136867840,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"invalid":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":25165824,"open_calls":1,"open_ns":3447474,"seal_bytes":0,"seal_calls":0,"seal_ns":0},"state":"on","store_dir":"/tmp/pkv-chip.dHSKGt/store","store_state":"open","test_fault":null},"status":"ok","uptime_s":3} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/neg-corrupt-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/neg-corrupt-turn2.json new file mode 100644 index 00000000..48a0e213 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/neg-corrupt-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792018582,"id":"chatcmpl-18de87681c9db2a00000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/neg-switch-health.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/neg-switch-health.json new file mode 100644 index 00000000..5809aa6d --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/neg-switch-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:7d036ac444bbd2a6892ac9af7a1352c554e5eca5","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":0,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":16400,"reads":5,"write_bytes":0,"writes":0},"namespace":"fdaa3172e1adc227","park":true,"park_bytes":0,"park_dedup":0,"park_failed":0,"park_refused":1,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1443,"failed":false,"foreign_files":0,"foreign_namespace":4,"indexed":0,"indexed_bytes":86523904,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":0,"seal_calls":0,"seal_ns":0},"state":"on","store_dir":"/tmp/pkv-chip.dHSKGt/store","store_state":"open","test_fault":null},"status":"ok","uptime_s":3} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/neg-switch-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/neg-switch-turn2.json new file mode 100644 index 00000000..96c80d24 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/neg-switch-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792017918,"id":"chatcmpl-18de86cd751f0a4c0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/off-health.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/off-health.json new file mode 100644 index 00000000..c1e14168 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/off-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","status":"ok","uptime_s":5} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/off-other.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/off-other.json new file mode 100644 index 00000000..c3ff959c --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/off-other.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Bearing preload is the application of a controlled internal load to a bearing to eliminate play and improve stiffness. It is commonly used in precision applications to enhance performance and reduce vibration.","role":"assistant"}}],"created":1792017605,"id":"chatcmpl-18de868495a65bec0003","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":35,"prompt_tokens":753,"total_tokens":788}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/off-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/off-turn1.json new file mode 100644 index 00000000..15653871 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/off-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792017601,"id":"chatcmpl-18de86839c4c223e0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/off-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/off-turn2.json new file mode 100644 index 00000000..befb9b71 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/off-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792017603,"id":"chatcmpl-18de8684289ac6bb0001","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/off-turn2b.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/off-turn2b.json new file mode 100644 index 00000000..8e27d885 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/off-turn2b.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Aerospace applications are least useful at home.","role":"assistant"}}],"created":1792017605,"id":"chatcmpl-18de86847df5633f0002","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":10,"prompt_tokens":819,"total_tokens":829}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/on-health.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/on-health.json new file mode 100644 index 00000000..076cbc65 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/on-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:7d036ac444bbd2a6892ac9af7a1352c554e5eca5","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":3,"indeterminate":0,"published":2,"queue_full":0,"read_bytes":0,"reads":0,"write_bytes":50339856,"writes":3},"namespace":"abb2032ed932f927","park":true,"park_bytes":50331648,"park_dedup":2,"park_failed":0,"park_refused":1,"park_skipped":0,"parked_chunks":2,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":940,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":2},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":50331648,"seal_calls":2,"seal_ns":7575468},"state":"on","store_dir":"/tmp/pkv-chip.dHSKGt/store-on","store_state":"open","test_fault":null},"status":"ok","uptime_s":4} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/on-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/on-turn1.json new file mode 100644 index 00000000..916d6607 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/on-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792017681,"id":"chatcmpl-18de869637ba14ce0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/on-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/on-turn2.json new file mode 100644 index 00000000..6141da4b --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/on-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792017683,"id":"chatcmpl-18de8696c828b3f70001","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/park-health.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/park-health.json new file mode 100644 index 00000000..5c2782b1 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/park-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:7d036ac444bbd2a6892ac9af7a1352c554e5eca5","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":3,"indeterminate":0,"published":2,"queue_full":0,"read_bytes":0,"reads":0,"write_bytes":50339856,"writes":3},"namespace":"abb2032ed932f927","park":true,"park_bytes":50331648,"park_dedup":0,"park_failed":0,"park_refused":1,"park_skipped":0,"parked_chunks":2,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1379,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":50331648,"seal_calls":2,"seal_ns":6417501},"state":"on","store_dir":"/tmp/pkv-chip.dHSKGt/store","store_state":"open","test_fault":null},"status":"ok","uptime_s":9} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/park-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/park-turn1.json new file mode 100644 index 00000000..09c9e3ed --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/park-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792017759,"id":"chatcmpl-18de86a87f9aa87e0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/restore-health.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/restore-health.json new file mode 100644 index 00000000..535573ba --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/restore-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:7d036ac444bbd2a6892ac9af7a1352c554e5eca5","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":0,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":50348048,"reads":7,"write_bytes":0,"writes":0},"namespace":"abb2032ed932f927","park":true,"park_bytes":0,"park_dedup":2,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1461,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":2,"indexed_bytes":50339840,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":50331648,"restore_misses":{},"restored_tokens":512,"restores":1,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":50331648,"open_calls":2,"open_ns":12293344,"seal_bytes":0,"seal_calls":0,"seal_ns":0},"state":"on","store_dir":"/tmp/pkv-chip.dHSKGt/store","store_state":"open","test_fault":null},"status":"ok","uptime_s":2} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/restore-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/restore-turn2.json new file mode 100644 index 00000000..b0db95ab --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/restore-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792017841,"id":"chatcmpl-18de86bb9378e6c00000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/run-info.txt b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/run-info.txt new file mode 100644 index 00000000..f34cf7ae --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/run-info.txt @@ -0,0 +1,3 @@ +binary /home/drakestapleton/workspace/sc-pkv514/target/release/aien-serve-http sha256 e979177291aac9b9cf19f3881a9eb88f02d873b69a4e64d0eba6b0a442b75104 +model /home/drakestapleton/models/qwen3-30b-a3b-instruct-2507-fp8 port 18098 key-mode ephemeral +started 2026-10-14T22:39:45Z host spark-b87b diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/summary.txt b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/summary.txt new file mode 100644 index 00000000..75d5a883 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/summary.txt @@ -0,0 +1,27 @@ +PASS turn 1 identical off/on/park/torn/late +PASS T_on == T_off (persistence changes no token) +PASS T_restored == T_off (restored = uninterrupted) +PASS restore served once +PASS neg-switch restores nothing +PASS torn: a temp file was in flight at the kill +PASS torn: nothing was published before the kill +PASS torn: recovery removed every temp file +PASS torn: health counts the removed temps +PASS torn: restores nothing +PASS torn: T == T_off +PASS late-load: timed out once +PASS late-load: restores nothing +PASS late-load: T == T_off +PASS late-load: the late completion is never served +PASS late-load: another chat == A_off +PASS late-load: the store still restores after +PASS late-load: restored T == T_off +PASS late-park: the park was in flight during turn 2 +PASS late-park: T == T_off +PASS late-park: other turn 2 == T2b_off +PASS late-park: no park failed +PASS late-park: restores once after restart +PASS late-park: restored T == T_off +PASS neg-corrupt restores nothing +PASS off health has no persistent_kv +PKV CHIP CHECK: PASS diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/torn-a-health.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/torn-a-health.json new file mode 100644 index 00000000..66b9a127 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/torn-a-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:7d036ac444bbd2a6892ac9af7a1352c554e5eca5","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":2,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":0,"reads":0,"write_bytes":25169936,"writes":2},"namespace":"abb2032ed932f927","park":true,"park_bytes":0,"park_dedup":0,"park_failed":0,"park_refused":1,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1027,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":25165824,"seal_calls":1,"seal_ns":3175211},"state":"on","store_dir":"/tmp/pkv-chip.dHSKGt/store-torn","store_state":"open","test_fault":"p3:600000"},"status":"ok","uptime_s":3} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/torn-b-health.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/torn-b-health.json new file mode 100644 index 00000000..c267abd9 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/torn-b-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:7d036ac444bbd2a6892ac9af7a1352c554e5eca5","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":0,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":16,"reads":1,"write_bytes":0,"writes":0},"namespace":"abb2032ed932f927","park":true,"park_bytes":0,"park_dedup":0,"park_failed":0,"park_refused":1,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":2062,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":1,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":0,"seal_calls":0,"seal_ns":0},"state":"on","store_dir":"/tmp/pkv-chip.dHSKGt/store-torn","store_state":"open","test_fault":null},"status":"ok","uptime_s":2} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/torn-files-at-kill.txt b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/torn-files-at-kill.txt new file mode 100644 index 00000000..d3eeb6c1 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/torn-files-at-kill.txt @@ -0,0 +1,2 @@ +STORE_ID 16 +tmp/affcded40f2e11ed8312ff173304eee9135431d3eefc3a3ecce230af585071e2.1.1.1.part 25169920 diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/torn-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/torn-turn1.json new file mode 100644 index 00000000..9815dbff --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/torn-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792017996,"id":"chatcmpl-18de86df7ad9bc3a0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/torn-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/torn-turn2.json new file mode 100644 index 00000000..00dfbccb --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/chip-check/torn-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792018073,"id":"chatcmpl-18de86f182df57ed0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/ground.txt b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/ground.txt new file mode 100644 index 00000000..54d71a8f --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/ground.txt @@ -0,0 +1,7 @@ +commit 7d036ac444bbd2a6892ac9af7a1352c554e5eca5 dirty_files=0 +binary sha256 e979177291aac9b9cf19f3881a9eb88f02d873b69a4e64d0eba6b0a442b75104 +test sha256 aa88db570fec42c4cc11a02816aacf92a96ae11cce5d51f4307d63a6c01f25c6 +omega d0889a944b02066f84fec71af7b9bbb92f5c986f driver 580.173.02 kernel 7.0.0-1019-nvidia +start 2026-10-14T22:36:37Z +MemAvailable: 112467648 kB +end 2026-10-14T22:59:37Z diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/rc.txt b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/rc.txt new file mode 100644 index 00000000..c1c6ddc1 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/rc.txt @@ -0,0 +1,4 @@ +item1-3-4-roundtrip rc=101 +item2a-inprocess-restore rc=0 +item2b-chip-check rc=0 +item5-two-process rc=0 diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/run-all.out b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/run-all.out new file mode 100644 index 00000000..4bc55145 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/run-all.out @@ -0,0 +1,51 @@ +== item1-3-4-roundtrip 22:36:37 +item1-3-4-roundtrip rc=101 +SNAP site=switches attention_path=fused +test fused_cache_round_trip_cost_and_restore_latency_on_the_chip has been running for over 60 seconds +SNAP site=park positions=2079 parked_chunks=2 park_bytes=50331648 park_failed=0 park_refused=1 +thread 'fused_cache_round_trip_cost_and_restore_latency_on_the_chip' (674651) panicked at crates/aien-serve-http/tests/kv_persist_chip.rs:271:5: +test fused_cache_round_trip_cost_and_restore_latency_on_the_chip ... FAILED +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 1 filtered out; finished in 108.31s +== item2a-inprocess-restore 22:38:26 +item2a-inprocess-restore rc=0 +test restored_turn_two_equals_the_uninterrupted_turn_two_on_the_chip has been running for over 60 seconds +test restored_turn_two_equals_the_uninterrupted_turn_two_on_the_chip ... ok +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 78.84s +== item2b-chip-check 22:39:45 +item2b-chip-check rc=0 +PASS turn 1 identical off/on/park/torn/late +PASS T_on == T_off (persistence changes no token) +PASS T_restored == T_off (restored = uninterrupted) +PASS restore served once +PASS neg-switch restores nothing +PASS torn: a temp file was in flight at the kill +PASS torn: nothing was published before the kill +PASS torn: recovery removed every temp file +PASS torn: health counts the removed temps +PASS torn: restores nothing +PASS torn: T == T_off +PASS late-load: timed out once +PASS late-load: restores nothing +PASS late-load: T == T_off +PASS late-load: the late completion is never served +PASS late-load: another chat == A_off +PASS late-load: the store still restores after +PASS late-load: restored T == T_off +PASS late-park: the park was in flight during turn 2 +PASS late-park: T == T_off +PASS late-park: other turn 2 == T2b_off +PASS late-park: no park failed +PASS late-park: restores once after restart +PASS late-park: restored T == T_off +PASS neg-corrupt restores nothing +PASS off health has no persistent_kv +PKV CHIP CHECK: PASS +== item5-two-process 22:56:26 +item5-two-process rc=0 +PASS proc1 turn 1 equals the uninterrupted turn 1 +PASS proc2 restored turn 2 equals the uninterrupted turn 2 +PASS proc2 restored (restores == 1) +PASS proc1 RAM turn 2 equals the uninterrupted turn 2 +PASS proc1 did not restore (restores == 0) +VERDICT PASS +run-all rc=0 diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/SHA256SUMS b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/SHA256SUMS new file mode 100644 index 00000000..33a6e364 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/SHA256SUMS @@ -0,0 +1,14 @@ +74f1a7fee6a299be3a8d95e6c542241f5974ec5cb15e9e7629c0dbcdbb6e636f ./memory.txt +7af1c2b3469abb4bb08a97d598d8d1b0cd888625f88f1dcb76dca0aacd91f44f ./off.log +6ed8bf6116eaf9f043d7feaba1902cbcd8b14bc9b1669bb16346745146ba24a2 ./off-turn1.json +341fa218432fff7f582ff596c8fffb2b96ddc5b27a5a4230e83b617adff42345 ./off-turn2.json +29d1bdb319183f480e57926481643cdf7c521548f5344fa52216dc70f170678e ./proc1-after-turn1-health.json +8d417350140aa5a4aa08c91b886c78460353ae82c74b08d876dcd3d94f200ca6 ./proc1-health.json +42d0c550d6838833ec3a3ba3c3b5f645202cc7043ec8c449e5a64c86d548c553 ./proc1.log +d6919800b10e9d0e0ae637eea9b57c536c5eb40c8681d01f89baa081dda9ecab ./proc1-turn1.json +67888b1c40161562e8bd8fb2e9d7abac9a105c99f4bef6175fcb49ea537f7bd3 ./proc1-turn2.json +72e854ef6c590a30c3a08c586a9de252da990be88a8150cf40e5f498d9796650 ./proc2-health.json +b41ae4f0d9d75c9e829d9ff0f6c1a1c100e2c50dc8c4fb047cbd1e516fe6aded ./proc2.log +ec373f7d32215dcee31abcc07ee93823ce617bfe43549005b442670fdf0e6581 ./proc2-turn2.json +e762a65143b9d19e90297bcb0faf04f96a47cd2989416e674f1425faefbc054b ./run-info.txt +3437cea5ad37beb61653efaf1b10f924e1347d040a54550cdce93eb4a5ff4592 ./summary.txt diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/memory.txt b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/memory.txt new file mode 100644 index 00000000..5f800114 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/memory.txt @@ -0,0 +1,7 @@ +MemAvailable before proc2 load: 70.8 GB +both resident: proc1 pid 922099 alive=yes, proc2 pid 935778 +MemAvailable with both loaded: 38.2 GB + PID RSS COMMAND + 922099 37260904 aien-serve-http + 935778 33803344 aien-serve-http +proc2 still alive during the ram phase diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/off-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/off-turn1.json new file mode 100644 index 00000000..b4146e49 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/off-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792018603,"id":"chatcmpl-18de876cee79acfe0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/off-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/off-turn2.json new file mode 100644 index 00000000..0b208754 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/off-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792018606,"id":"chatcmpl-18de876d7b0f1c1b0001","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/proc1-after-turn1-health.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/proc1-after-turn1-health.json new file mode 100644 index 00000000..d881c4c1 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/proc1-after-turn1-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:7d036ac444bbd2a6892ac9af7a1352c554e5eca5","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":3,"indeterminate":0,"published":2,"queue_full":0,"read_bytes":0,"reads":0,"write_bytes":50339856,"writes":3},"namespace":"abb2032ed932f927","park":true,"park_bytes":50331648,"park_dedup":0,"park_failed":0,"park_refused":1,"park_skipped":0,"parked_chunks":2,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1089,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":50331648,"seal_calls":2,"seal_ns":6377259},"state":"on","store_dir":"/tmp/pkv-chip.8Buu6u/store","store_state":"open","test_fault":null},"status":"ok","uptime_s":8} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/proc1-health.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/proc1-health.json new file mode 100644 index 00000000..82530555 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/proc1-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:7d036ac444bbd2a6892ac9af7a1352c554e5eca5","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":3,"indeterminate":0,"published":2,"queue_full":0,"read_bytes":0,"reads":0,"write_bytes":50339856,"writes":3},"namespace":"abb2032ed932f927","park":true,"park_bytes":50331648,"park_dedup":2,"park_failed":0,"park_refused":1,"park_skipped":0,"parked_chunks":2,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1089,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1,"ram-prefix-as-long":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":50331648,"seal_calls":2,"seal_ns":6377259},"state":"on","store_dir":"/tmp/pkv-chip.8Buu6u/store","store_state":"open","test_fault":null},"status":"ok","uptime_s":95} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/proc1-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/proc1-turn1.json new file mode 100644 index 00000000..00129b65 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/proc1-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792018680,"id":"chatcmpl-18de877eeced998d0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/proc1-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/proc1-turn2.json new file mode 100644 index 00000000..3d8a6bb4 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/proc1-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792018774,"id":"chatcmpl-18de879498d4b0b50001","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/proc2-health.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/proc2-health.json new file mode 100644 index 00000000..305532ff --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/proc2-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:7d036ac444bbd2a6892ac9af7a1352c554e5eca5","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":0,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":50348048,"reads":7,"write_bytes":0,"writes":0},"namespace":"abb2032ed932f927","park":true,"park_bytes":0,"park_dedup":2,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":2612,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":2,"indexed_bytes":50339840,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":50331648,"restore_misses":{},"restored_tokens":512,"restores":1,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":50331648,"open_calls":2,"open_ns":12320065,"seal_bytes":0,"seal_calls":0,"seal_ns":0},"state":"on","store_dir":"/tmp/pkv-chip.8Buu6u/store2","store_state":"open","test_fault":null},"status":"ok","uptime_s":2} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/proc2-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/proc2-turn2.json new file mode 100644 index 00000000..0cad8dad --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/proc2-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792018771,"id":"chatcmpl-18de87940e724ef00000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/run-info.txt b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/run-info.txt new file mode 100644 index 00000000..714b457d --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/run-info.txt @@ -0,0 +1,3 @@ +binary /home/drakestapleton/workspace/sc-pkv514/target/release/aien-serve-http sha256 e979177291aac9b9cf19f3881a9eb88f02d873b69a4e64d0eba6b0a442b75104 +model /home/drakestapleton/models/qwen3-30b-a3b-instruct-2507-fp8 port 18098 key-mode ephemeral +started 2026-10-14T22:56:26Z host spark-b87b diff --git a/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/summary.txt b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/summary.txt new file mode 100644 index 00000000..ce538319 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run1-7d036ac4/two-process/summary.txt @@ -0,0 +1,6 @@ +PASS proc1 turn 1 equals the uninterrupted turn 1 +PASS proc2 restored turn 2 equals the uninterrupted turn 2 +PASS proc2 restored (restores == 1) +PASS proc1 RAM turn 2 equals the uninterrupted turn 2 +PASS proc1 did not restore (restores == 0) +VERDICT PASS diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/SHA256SUMS b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/SHA256SUMS new file mode 100644 index 00000000..5a3cff1a --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/SHA256SUMS @@ -0,0 +1,50 @@ +b91f89e4260f1c487eedd5844dbffe3feecbc812bb6e4886a12b5d41d9dee1b6 ./late-load-a1-health.json +d4cf98c23675dee77a269fb34647a9999e6f5e74f90162a896376fafda60e38b ./late-load-a2-health.json +9f0c18d43740679b48da4c66a2893141f6a9476b5f8876dd0cc61843dadec964 ./late-load-a.log +2a4878a3411a91cacf2da9463fffc9b4841701f2edb58613dba6a70f7ef1de23 ./late-load-b-health.json +1b16214a1399b9f5767cd4612747e791f542f974518f7a0d2e94510d12d9485f ./late-load-b.log +640b2ae4422f3b6ba9098ba11e56b85b3d46bf75f11a96553a37b2ff9fa88e73 ./late-load-b-turn2.json +1aae6d7abe82980900f65c360ad5e5c2302e213705fdd4cafc537999b4dc436d ./late-load-other.json +5afcd374dee36be2daaa7306ddf7a110596c656ec472e0ce31e754f39b5a0e2e ./late-load-park.log +fe9eac5fb33d84a035961176cc0044be96d8b02551e8c96d895ee86bd72cef76 ./late-load-turn1.json +8616c8dddb3fc0eb9edfb09be3a4597fcb5885609e056f2aa0c24f68fcff95b0 ./late-load-turn2.json +ca4bb23922f31f6cdedba869aff6580cdb9160b068271e12978910b24e1d5f05 ./late-park-a-health.json +db42213b4956d05a7baef2022b4b3aed0800b4f63483828fc8a6f1e65fc1c371 ./late-park-a.log +80ac28bd1f945a9f4971c378942b163dd0d1557f6a5dd0680bea2dcfe6f07947 ./late-park-b-health.json +271419b9332a636a3f6a6c2ed10c1c386953ff50bc44970b0cd8dff7e443a415 ./late-park-b.log +1d5d2ff96d78a8217c9abc33eb88c5b6b2562aa12d595a2c85c29cc4391187d5 ./late-park-b-turn2.json +e94978752d9199f39698c4141cdbca53ede156f21551a41fbd38bf6e11bdb1d9 ./late-park-inflight-health.json +5a251c412f8518e4a4f4af8e007bcdefa74441c72e85bc4f2ad76f65e7052e5f ./late-park-turn1.json +2018e3b396a54b81b45fd1922a333ed4f2cb00849bf4801030de6e145c451256 ./late-park-turn2b.json +92fbb8035935a0a0248cf44fa9660591194f0ff0e5a37be876010f0d896d9143 ./late-park-turn2.json +84c1a45a4d26442af27fca44731792582bdbe913295cbd766e1dd3d12c0c5c58 ./neg-corrupt-health.json +cc7e13837882468cf401933d0b54dfeb058d8eb7ccbf40df7a677f30509ba40c ./neg-corrupt.log +1b879843e9ef6409ca06957c5e9cf6b4342deeb43cc0a9df9176447ca7d642d0 ./neg-corrupt-turn2.json +f08da13f30c5be5b38acf7082da6e35f1d9e10d65d092fc627fe953b0cf8ee46 ./neg-switch-health.json +b0fe4ac24470d993acecae438ac1822be4525cec003837164506629761cfeaa2 ./neg-switch.log +b294fd03431b98ff3a225070c580ab2f4a9bd73ba47fd63460d20b8626504237 ./neg-switch-turn2.json +f0408de5c7b13b0d939a60c57fb6f447f77df73175a62ac5cd9b690325f486f0 ./off-health.json +a6a9d0b1bf0d7739505c15deee65095a7a00c0cbe9eae2480e1cce11f0b0a8f2 ./off.log +1d64d65c60028ebd4cebbf9f10da06bbd442ccea3bc314c4bd39ab137ee6897c ./off-other.json +0ef9247c65839b6ba2279b2a92bb3fa30f78f6d9e4c7942098465970dd0455b4 ./off-turn1.json +db2043c41590482712a597c48c8da5c9fb2041cec80d848eb817bc4c6d0d4894 ./off-turn2b.json +aaf755d4c203c70d81da7ae13caf4044d56e52aab9e37d075b4d527fccd8eece ./off-turn2.json +49c18035229d31b8c7e5b5a17838a358dd4c1ff3c553eaa528546acd058f7510 ./on-health.json +d21230f36dad51caadd11126202186e4508146d0534e3270e6824a52888ff90f ./on.log +57d672e0fb4462485fc9e0eba04bae636d8f68baffcb3049e26320af0b59507f ./on-turn1.json +249eb5d18cbfb6dca62fe21fde04741f6b679c266506ad449c162c049a84ddd2 ./on-turn2.json +6aa02c5a6bd93cdb78811765883d429cf2159fbdec77f6b4f43060ade0f64c21 ./park-health.json +4595ebf94969d256d66c333fc2ce65992003fc085f028d108f935b21f070f547 ./park.log +955f39da9e3b4c1e0b5fc8b36325eead5f37eea81de41bf369d9f9017fccc8a0 ./park-turn1.json +0da8e192b5af66251750c49dd939444bdc5574903b56ff3bf71cac06a2bc2fbe ./restore-health.json +d042313a79d96071f4ad29b2532d0538b4824638323ac44018eb92800ec0c63d ./restore.log +f9479aeaa39b03e71dc915ae4edeb0cc16e7dafb2b511625e79a754531f03620 ./restore-turn2.json +ddc7c4f3755899e36996586bab90b1d2ae2d06da7e090738673ceae5dd6ad49f ./run-info.txt +99737015b7e4597dc72e8651cf0d988828a8e4d013ab6fb792623831a585efca ./summary.txt +2481f70fb1aa87d35f3667402639fac20fb1bcceb26552bb4bdcde6a579c13b2 ./torn-a-health.json +541ec8c65cdd3bd70f89a84e08122e379d8111af20a0f94a17059c72ea89d36c ./torn-a.log +f7b1a82a07d6c2c9d45df6f46add6c1a6870f5899acb9f06d316ff4fe5cf8433 ./torn-b-health.json +a9c5df2a36e5fd03754a721eac1a8feb35cfaff23c514873611de1a8276e6db3 ./torn-b.log +af6d94330ce69527afc57d64d302eed35520278c359f3fa04951485053213cc8 ./torn-files-at-kill.txt +e5adf79179531bb74a91f4791161e5c3b3ae7cb70b03f969ae64ac84fc16d6eb ./torn-turn1.json +4128d4c825d205f068bff2162357863782e08e17b02b64ef0bf59dd722eb7854 ./torn-turn2.json diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-load-a1-health.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-load-a1-health.json new file mode 100644 index 00000000..b16a909a --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-load-a1-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:a639c4e9417d915e185dfeb6db3aaf698940479b","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":0,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":16400,"reads":5,"write_bytes":0,"writes":0},"namespace":"88ea6a8ded2dc9d3","park":true,"park_bytes":0,"park_dedup":3,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1026,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":4,"indexed_bytes":78659584,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"timeout":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":0,"seal_calls":0,"seal_ns":0},"state":"on","store_dir":"/tmp/pkv-chip.Xm9b8g/store-late-load","store_state":"open","test_fault":"load:15000:1"},"status":"ok","uptime_s":12} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-load-a2-health.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-load-a2-health.json new file mode 100644 index 00000000..2992a122 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-load-a2-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:a639c4e9417d915e185dfeb6db3aaf698940479b","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":1,"indeterminate":0,"published":1,"queue_full":0,"read_bytes":25186320,"reads":7,"write_bytes":11014144,"writes":1},"namespace":"88ea6a8ded2dc9d3","park":true,"park_bytes":11010048,"park_dedup":5,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":1,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1026,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":4,"indexed_bytes":78659584,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"ram-prefix-as-long":1,"timeout":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":25165824,"open_calls":1,"open_ns":3124814,"seal_bytes":36175872,"seal_calls":2,"seal_ns":4559533},"state":"on","store_dir":"/tmp/pkv-chip.Xm9b8g/store-late-load","store_state":"open","test_fault":"load:15000:1"},"status":"ok","uptime_s":22} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-load-b-health.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-load-b-health.json new file mode 100644 index 00000000..d2214997 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-load-b-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:a639c4e9417d915e185dfeb6db3aaf698940479b","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":0,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":78688272,"reads":16,"write_bytes":0,"writes":0},"namespace":"88ea6a8ded2dc9d3","park":true,"park_bytes":0,"park_dedup":4,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1522,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":7,"indexed_bytes":117993472,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":78643200,"restore_misses":{},"restored_tokens":800,"restores":1,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":78643200,"open_calls":4,"open_ns":15836774,"seal_bytes":0,"seal_calls":0,"seal_ns":0},"state":"on","store_dir":"/tmp/pkv-chip.Xm9b8g/store-late-load","store_state":"open","test_fault":null},"status":"ok","uptime_s":2} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-load-b-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-load-b-turn2.json new file mode 100644 index 00000000..5008cbee --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-load-b-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792019852,"id":"chatcmpl-18de888fafabac4d0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-load-other.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-load-other.json new file mode 100644 index 00000000..cd3529e0 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-load-other.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Bearing preload is the application of a controlled internal load to a bearing to eliminate play and improve stiffness. It is commonly used in precision applications to enhance performance and reduce vibration.","role":"assistant"}}],"created":1792019776,"id":"chatcmpl-18de887e0c70caab0001","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":35,"prompt_tokens":753,"total_tokens":788}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-load-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-load-turn1.json new file mode 100644 index 00000000..68a98462 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-load-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792019672,"id":"chatcmpl-18de8865bc97851c0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-load-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-load-turn2.json new file mode 100644 index 00000000..2661e7dc --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-load-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792019756,"id":"chatcmpl-18de8879555269640000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-park-a-health.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-park-a-health.json new file mode 100644 index 00000000..888a0fd5 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-park-a-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:a639c4e9417d915e185dfeb6db3aaf698940479b","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":6,"indeterminate":0,"published":5,"queue_full":0,"read_bytes":0,"reads":0,"write_bytes":92819472,"writes":6},"namespace":"88ea6a8ded2dc9d3","park":true,"park_bytes":92798976,"park_dedup":3,"park_failed":0,"park_refused":1,"park_skipped":0,"parked_chunks":5,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1088,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":2,"ram-prefix-as-long":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":92798976,"seal_calls":5,"seal_ns":12292756},"state":"on","store_dir":"/tmp/pkv-chip.Xm9b8g/store-late-park","store_state":"open","test_fault":"p3:20000:1"},"status":"ok","uptime_s":29} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-park-b-health.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-park-b-health.json new file mode 100644 index 00000000..e674b80e --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-park-b-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:a639c4e9417d915e185dfeb6db3aaf698940479b","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":0,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":75530256,"reads":12,"write_bytes":0,"writes":0},"namespace":"88ea6a8ded2dc9d3","park":true,"park_bytes":0,"park_dedup":4,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1532,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":5,"indexed_bytes":92819456,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":75497472,"restore_misses":{},"restored_tokens":768,"restores":1,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":75497472,"open_calls":3,"open_ns":15334947,"seal_bytes":0,"seal_calls":0,"seal_ns":0},"state":"on","store_dir":"/tmp/pkv-chip.Xm9b8g/store-late-park","store_state":"open","test_fault":null},"status":"ok","uptime_s":2} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-park-b-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-park-b-turn2.json new file mode 100644 index 00000000..1a41f366 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-park-b-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792020033,"id":"chatcmpl-18de88b9e3441fa10000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-park-inflight-health.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-park-inflight-health.json new file mode 100644 index 00000000..e5d86817 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-park-inflight-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:a639c4e9417d915e185dfeb6db3aaf698940479b","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":2,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":0,"reads":0,"write_bytes":25169936,"writes":2},"namespace":"88ea6a8ded2dc9d3","park":true,"park_bytes":0,"park_dedup":0,"park_failed":0,"park_refused":1,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1088,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":25165824,"seal_calls":1,"seal_ns":3158693},"state":"on","store_dir":"/tmp/pkv-chip.Xm9b8g/store-late-park","store_state":"open","test_fault":"p3:20000:1"},"status":"ok","uptime_s":13} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-park-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-park-turn1.json new file mode 100644 index 00000000..4e876203 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-park-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792019930,"id":"chatcmpl-18de88a1c5d852c80000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-park-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-park-turn2.json new file mode 100644 index 00000000..d1cf0b3c --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-park-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792019942,"id":"chatcmpl-18de88a4aa70c00f0001","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-park-turn2b.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-park-turn2b.json new file mode 100644 index 00000000..700cce6d --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/late-park-turn2b.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Aerospace applications are least useful at home.","role":"assistant"}}],"created":1792019952,"id":"chatcmpl-18de88a7004e49aa0002","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":10,"prompt_tokens":819,"total_tokens":829}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/neg-corrupt-health.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/neg-corrupt-health.json new file mode 100644 index 00000000..b2233bc0 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/neg-corrupt-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:a639c4e9417d915e185dfeb6db3aaf698940479b","io":{"corrupt_deleted":1,"disk_full":0,"failed":1,"file_fsyncs":0,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":25206800,"reads":12,"write_bytes":0,"writes":0},"namespace":"88ea6a8ded2dc9d3","park":true,"park_bytes":0,"park_dedup":3,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1078,"failed":false,"foreign_files":0,"foreign_namespace":4,"indexed":5,"indexed_bytes":176197632,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"invalid":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":25165824,"open_calls":1,"open_ns":9496923,"seal_bytes":0,"seal_calls":0,"seal_ns":0},"state":"on","store_dir":"/tmp/pkv-chip.Xm9b8g/store","store_state":"open","test_fault":null},"status":"ok","uptime_s":2} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/neg-corrupt-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/neg-corrupt-turn2.json new file mode 100644 index 00000000..25960911 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/neg-corrupt-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792020111,"id":"chatcmpl-18de88cc0562e73f0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/neg-switch-health.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/neg-switch-health.json new file mode 100644 index 00000000..a314958e --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/neg-switch-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:a639c4e9417d915e185dfeb6db3aaf698940479b","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":1,"indeterminate":0,"published":1,"queue_full":0,"read_bytes":20496,"reads":6,"write_bytes":50339840,"writes":2},"namespace":"593f0dd45f6d70fb","park":true,"park_bytes":25165824,"park_dedup":0,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":1,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1323,"failed":false,"foreign_files":0,"foreign_namespace":5,"indexed":0,"indexed_bytes":89673728,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":50331648,"seal_calls":2,"seal_ns":6456390},"state":"on","store_dir":"/tmp/pkv-chip.Xm9b8g/store","store_state":"open","test_fault":null},"status":"ok","uptime_s":3} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/neg-switch-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/neg-switch-turn2.json new file mode 100644 index 00000000..d43cd139 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/neg-switch-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792019429,"id":"chatcmpl-18de882d4c66d3110000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/off-health.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/off-health.json new file mode 100644 index 00000000..c1e14168 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/off-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","status":"ok","uptime_s":5} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/off-other.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/off-other.json new file mode 100644 index 00000000..613dd64d --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/off-other.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Bearing preload is the application of a controlled internal load to a bearing to eliminate play and improve stiffness. It is commonly used in precision applications to enhance performance and reduce vibration.","role":"assistant"}}],"created":1792019114,"id":"chatcmpl-18de87e3f3e0481c0003","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":35,"prompt_tokens":753,"total_tokens":788}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/off-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/off-turn1.json new file mode 100644 index 00000000..c0871198 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/off-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792019110,"id":"chatcmpl-18de87e2fa21ac440000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/off-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/off-turn2.json new file mode 100644 index 00000000..2ad1282a --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/off-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792019113,"id":"chatcmpl-18de87e3863aaa5e0001","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/off-turn2b.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/off-turn2b.json new file mode 100644 index 00000000..521c3151 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/off-turn2b.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Aerospace applications are least useful at home.","role":"assistant"}}],"created":1792019114,"id":"chatcmpl-18de87e3db9021230002","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":10,"prompt_tokens":819,"total_tokens":829}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/on-health.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/on-health.json new file mode 100644 index 00000000..cef10f8c --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/on-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:a639c4e9417d915e185dfeb6db3aaf698940479b","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":5,"indeterminate":0,"published":4,"queue_full":0,"read_bytes":0,"reads":0,"write_bytes":78659600,"writes":5},"namespace":"88ea6a8ded2dc9d3","park":true,"park_bytes":78643200,"park_dedup":3,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":4,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1485,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1,"ram-prefix-as-long":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":78643200,"seal_calls":4,"seal_ns":10930077},"state":"on","store_dir":"/tmp/pkv-chip.Xm9b8g/store-on","store_state":"open","test_fault":null},"status":"ok","uptime_s":4} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/on-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/on-turn1.json new file mode 100644 index 00000000..53b79bc3 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/on-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792019191,"id":"chatcmpl-18de87f5cc7cd28c0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/on-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/on-turn2.json new file mode 100644 index 00000000..a5551f3f --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/on-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792019193,"id":"chatcmpl-18de87f65fe1442b0001","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/park-health.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/park-health.json new file mode 100644 index 00000000..cc73acb9 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/park-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:a639c4e9417d915e185dfeb6db3aaf698940479b","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":5,"indeterminate":0,"published":4,"queue_full":0,"read_bytes":0,"reads":0,"write_bytes":78659600,"writes":5},"namespace":"88ea6a8ded2dc9d3","park":true,"park_bytes":78643200,"park_dedup":0,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":4,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1013,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":78643200,"seal_calls":4,"seal_ns":10017219},"state":"on","store_dir":"/tmp/pkv-chip.Xm9b8g/store","store_state":"open","test_fault":null},"status":"ok","uptime_s":8} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/park-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/park-turn1.json new file mode 100644 index 00000000..1f9b4fc8 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/park-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792019270,"id":"chatcmpl-18de880818338be90000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/restore-health.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/restore-health.json new file mode 100644 index 00000000..8f67bed2 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/restore-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:a639c4e9417d915e185dfeb6db3aaf698940479b","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":0,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":78675984,"reads":13,"write_bytes":0,"writes":0},"namespace":"88ea6a8ded2dc9d3","park":true,"park_bytes":0,"park_dedup":3,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1088,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":4,"indexed_bytes":78659584,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":78643200,"restore_misses":{},"restored_tokens":800,"restores":1,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":78643200,"open_calls":4,"open_ns":15763521,"seal_bytes":0,"seal_calls":0,"seal_ns":0},"state":"on","store_dir":"/tmp/pkv-chip.Xm9b8g/store","store_state":"open","test_fault":null},"status":"ok","uptime_s":2} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/restore-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/restore-turn2.json new file mode 100644 index 00000000..8ca2a763 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/restore-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792019353,"id":"chatcmpl-18de881b705e19a80000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/run-info.txt b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/run-info.txt new file mode 100644 index 00000000..d7691cf0 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/run-info.txt @@ -0,0 +1,3 @@ +binary /home/drakestapleton/workspace/sc-pkv514/target/release/aien-serve-http sha256 5c97561339bdd71272f767d4f9fe8d2ba58fce6752cb072ee8b8d7fc03fcef1e +model /home/drakestapleton/models/qwen3-30b-a3b-instruct-2507-fp8 port 18098 key-mode ephemeral +started 2026-10-14T23:04:53Z host spark-b87b diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/summary.txt b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/summary.txt new file mode 100644 index 00000000..542e2bc1 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/summary.txt @@ -0,0 +1,29 @@ +PASS turn 1 identical off/on/park/torn/late +PASS T_on == T_off (persistence changes no token) +PASS T_restored == T_off (restored = uninterrupted) +PASS restore served once +PASS park refused no chunk (whole turn 1 parked) +PASS restore covered at least the turn-1 prompt (750 tokens) +PASS neg-switch restores nothing +PASS torn: a temp file was in flight at the kill +PASS torn: nothing was published before the kill +PASS torn: recovery removed every temp file +PASS torn: health counts the removed temps +PASS torn: restores nothing +PASS torn: T == T_off +PASS late-load: timed out once +PASS late-load: restores nothing +PASS late-load: T == T_off +PASS late-load: the late completion is never served +PASS late-load: another chat == A_off +PASS late-load: the store still restores after +PASS late-load: restored T == T_off +PASS late-park: the park was in flight during turn 2 +PASS late-park: T == T_off +PASS late-park: other turn 2 == T2b_off +PASS late-park: no park failed +PASS late-park: restores once after restart +PASS late-park: restored T == T_off +PASS neg-corrupt restores nothing +PASS off health has no persistent_kv +PKV CHIP CHECK: PASS diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/torn-a-health.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/torn-a-health.json new file mode 100644 index 00000000..06bd5076 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/torn-a-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:a639c4e9417d915e185dfeb6db3aaf698940479b","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":2,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":0,"reads":0,"write_bytes":25169936,"writes":2},"namespace":"88ea6a8ded2dc9d3","park":true,"park_bytes":0,"park_dedup":0,"park_failed":0,"park_refused":1,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1465,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":25165824,"seal_calls":1,"seal_ns":3235722},"state":"on","store_dir":"/tmp/pkv-chip.Xm9b8g/store-torn","store_state":"open","test_fault":"p3:600000"},"status":"ok","uptime_s":12} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/torn-b-health.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/torn-b-health.json new file mode 100644 index 00000000..36afe44b --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/torn-b-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:a639c4e9417d915e185dfeb6db3aaf698940479b","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":1,"indeterminate":0,"published":1,"queue_full":0,"read_bytes":16,"reads":1,"write_bytes":25169920,"writes":1},"namespace":"88ea6a8ded2dc9d3","park":true,"park_bytes":25165824,"park_dedup":0,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":1,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":2307,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":1,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":50331648,"seal_calls":2,"seal_ns":6478201},"state":"on","store_dir":"/tmp/pkv-chip.Xm9b8g/store-torn","store_state":"open","test_fault":null},"status":"ok","uptime_s":2} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/torn-files-at-kill.txt b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/torn-files-at-kill.txt new file mode 100644 index 00000000..c89c270f --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/torn-files-at-kill.txt @@ -0,0 +1,2 @@ +STORE_ID 16 +tmp/e4a46c4239a5b42b7248f2a21c4bfb0d0d6bc6d342253e36bbbe11a68b2bd862.1.1.1.part 25169920 diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/torn-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/torn-turn1.json new file mode 100644 index 00000000..0acf637d --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/torn-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792019507,"id":"chatcmpl-18de883f561057560000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/torn-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/torn-turn2.json new file mode 100644 index 00000000..4934c6aa --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/chip-check/torn-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792019594,"id":"chatcmpl-18de88539857c16f0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/ground.txt b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/ground.txt new file mode 100644 index 00000000..de14a350 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/ground.txt @@ -0,0 +1,7 @@ +commit a639c4e9417d915e185dfeb6db3aaf698940479b dirty_files=0 +binary sha256 5c97561339bdd71272f767d4f9fe8d2ba58fce6752cb072ee8b8d7fc03fcef1e +test sha256 0275d9efe99fc8df4bba4ec22337c884c04f2e30eee716a03301b014f5dd7ef0 +omega d0889a944b02066f84fec71af7b9bbb92f5c986f driver 580.173.02 kernel 7.0.0-1019-nvidia +start 2026-10-14T23:02:08Z +MemAvailable: 112102968 kB +end 2026-10-14T23:25:04Z diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/rc.txt b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/rc.txt new file mode 100644 index 00000000..c1c6ddc1 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/rc.txt @@ -0,0 +1,4 @@ +item1-3-4-roundtrip rc=101 +item2a-inprocess-restore rc=0 +item2b-chip-check rc=0 +item5-two-process rc=0 diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/run-all.out b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/run-all.out new file mode 100644 index 00000000..f3b886e7 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/run-all.out @@ -0,0 +1,60 @@ +== item1-3-4-roundtrip 23:02:08 +item1-3-4-roundtrip rc=101 +SNAP site=switches attention_path=fused +test fused_cache_round_trip_cost_and_restore_latency_on_the_chip has been running for over 60 seconds +SNAP site=park positions=2079 parked_chunks=9 park_bytes=204472320 park_failed=0 park_refused=0 +SNAP site=export positions=2079 bytes=204472320 ms_min=65.443 median=65.718 max=69.612 n=5 +SNAP site=round_trip identical=true reps=5 import_ms_min=22.342 median=22.496 max=22.624 n=5 +SNAP site=neg_flip differing_bytes=1 at=Some(102236160) +SNAP site=neg_truncated refused=true err=Some("kv payload of 204472319 bytes, 2079 positions need 204472320") +SNAP site=store objects=9 object_bytes=204509184 +thread 'fused_cache_round_trip_cost_and_restore_latency_on_the_chip' (1000540) panicked at crates/aien-serve-http/tests/kv_persist_chip.rs:351:34: +test fused_cache_round_trip_cost_and_restore_latency_on_the_chip ... FAILED +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 1 filtered out; finished in 85.36s +== item2a-inprocess-restore 23:03:34 +item2a-inprocess-restore rc=0 +test restored_turn_two_equals_the_uninterrupted_turn_two_on_the_chip has been running for over 60 seconds +test restored_turn_two_equals_the_uninterrupted_turn_two_on_the_chip ... ok +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 78.88s +== item2b-chip-check 23:04:53 +item2b-chip-check rc=0 +PASS turn 1 identical off/on/park/torn/late +PASS T_on == T_off (persistence changes no token) +PASS T_restored == T_off (restored = uninterrupted) +PASS restore served once +PASS park refused no chunk (whole turn 1 parked) +PASS restore covered at least the turn-1 prompt (750 tokens) +PASS neg-switch restores nothing +PASS torn: a temp file was in flight at the kill +PASS torn: nothing was published before the kill +PASS torn: recovery removed every temp file +PASS torn: health counts the removed temps +PASS torn: restores nothing +PASS torn: T == T_off +PASS late-load: timed out once +PASS late-load: restores nothing +PASS late-load: T == T_off +PASS late-load: the late completion is never served +PASS late-load: another chat == A_off +PASS late-load: the store still restores after +PASS late-load: restored T == T_off +PASS late-park: the park was in flight during turn 2 +PASS late-park: T == T_off +PASS late-park: other turn 2 == T2b_off +PASS late-park: no park failed +PASS late-park: restores once after restart +PASS late-park: restored T == T_off +PASS neg-corrupt restores nothing +PASS off health has no persistent_kv +PKV CHIP CHECK: PASS +== item5-two-process 23:21:55 +item5-two-process rc=0 +PASS proc1 turn 1 equals the uninterrupted turn 1 +PASS proc2 restored turn 2 equals the uninterrupted turn 2 +PASS proc2 restored (restores == 1) +PASS proc1 park refused no chunk +PASS proc2 restore covered at least the turn-1 prompt (750 tokens) +PASS proc1 RAM turn 2 equals the uninterrupted turn 2 +PASS proc1 did not restore (restores == 0) +VERDICT PASS +run-all rc=0 diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/SHA256SUMS b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/SHA256SUMS new file mode 100644 index 00000000..24ef19f8 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/SHA256SUMS @@ -0,0 +1,14 @@ +40e4488eb5ddc5b606f455096392b70acfc79ada0e16f09143255fc30473d505 ./memory.txt +c9758282cd9c00a5e1a006878a6768eea35e6c4a74f1744e2c797594712895f1 ./off.log +43007caeed9e9c76eb4d4681d1c944b9ea80c2b5af160ae959aea7d5979d6bab ./off-turn1.json +f1af77685ba7a7fb46a5c74b253f8bddf100f326d6aef0b12203c42cb6676240 ./off-turn2.json +73c393861c97d10efc049c96d99ef2a93d8241b4475752c7bd04257a68914f78 ./proc1-after-turn1-health.json +7884e12f67d6eb4b9e066df879b8f35cbee5beedb80077a99a276cf7acd41ad6 ./proc1-health.json +a78974e39b4bed5868befa0333496cd7eee61122c1a5bd4d7a48b14d2030f675 ./proc1.log +8c04f6c438826f9d37a668376af38770386e4b890568e5a8d56e1809b0573b9c ./proc1-turn1.json +14006d0c90a5618569f50595eb4898a7c57f94475d0755947a78b04ce4009fbf ./proc1-turn2.json +b52630e594429a64b7f30cf6a428797f79291de80c06d08a7b3d6b7c023903bf ./proc2-health.json +66a8b34d4b4cee3ccb8c192bcf40d4c9b7413fdc36442734551b0b51c6931583 ./proc2.log +2ccbea981e8300dcde23e866117219db149a2c69b81c1b1583159cdfd04992ba ./proc2-turn2.json +38bf4c547e5e4a50ce0466d0d1833901dac7388d4e560406094e5b2f2fd289aa ./run-info.txt +69f249e4e117a3a819153ed461f1c4bb24790645420883dee20d3eb9957b68e4 ./summary.txt diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/memory.txt b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/memory.txt new file mode 100644 index 00000000..cb0d1e5c --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/memory.txt @@ -0,0 +1,7 @@ +MemAvailable before proc2 load: 71.2 GB +both resident: proc1 pid 1246914 alive=yes, proc2 pid 1260768 +MemAvailable with both loaded: 38.3 GB + PID RSS COMMAND +1246914 37294092 aien-serve-http +1260768 33803284 aien-serve-http +proc2 still alive during the ram phase diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/off-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/off-turn1.json new file mode 100644 index 00000000..7a7eacd9 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/off-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792020132,"id":"chatcmpl-18de88d0e8119e1f0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/off-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/off-turn2.json new file mode 100644 index 00000000..42041982 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/off-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792020134,"id":"chatcmpl-18de88d1765221340001","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/proc1-after-turn1-health.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/proc1-after-turn1-health.json new file mode 100644 index 00000000..af1b08f8 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/proc1-after-turn1-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:a639c4e9417d915e185dfeb6db3aaf698940479b","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":5,"indeterminate":0,"published":4,"queue_full":0,"read_bytes":0,"reads":0,"write_bytes":78659600,"writes":5},"namespace":"88ea6a8ded2dc9d3","park":true,"park_bytes":78643200,"park_dedup":0,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":4,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1147,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":78643200,"seal_calls":4,"seal_ns":9919668},"state":"on","store_dir":"/tmp/pkv-chip.UrKZgF/store","store_state":"open","test_fault":null},"status":"ok","uptime_s":8} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/proc1-health.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/proc1-health.json new file mode 100644 index 00000000..2ba428e8 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/proc1-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:a639c4e9417d915e185dfeb6db3aaf698940479b","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":5,"indeterminate":0,"published":4,"queue_full":0,"read_bytes":0,"reads":0,"write_bytes":78659600,"writes":5},"namespace":"88ea6a8ded2dc9d3","park":true,"park_bytes":78643200,"park_dedup":3,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":4,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1147,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1,"ram-prefix-as-long":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":78643200,"seal_calls":4,"seal_ns":9919668},"state":"on","store_dir":"/tmp/pkv-chip.UrKZgF/store","store_state":"open","test_fault":null},"status":"ok","uptime_s":91} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/proc1-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/proc1-turn1.json new file mode 100644 index 00000000..b6179e39 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/proc1-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792020210,"id":"chatcmpl-18de88e3263fcecc0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/proc1-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/proc1-turn2.json new file mode 100644 index 00000000..851e168a --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/proc1-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792020300,"id":"chatcmpl-18de88f7f42f81300001","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/proc2-health.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/proc2-health.json new file mode 100644 index 00000000..77918668 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/proc2-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:a639c4e9417d915e185dfeb6db3aaf698940479b","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":0,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":78675984,"reads":13,"write_bytes":0,"writes":0},"namespace":"88ea6a8ded2dc9d3","park":true,"park_bytes":0,"park_dedup":3,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":3086,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":4,"indexed_bytes":78659584,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":78643200,"restore_misses":{},"restored_tokens":800,"restores":1,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":78643200,"open_calls":4,"open_ns":15965120,"seal_bytes":11010048,"seal_calls":1,"seal_ns":1424454},"state":"on","store_dir":"/tmp/pkv-chip.UrKZgF/store2","store_state":"open","test_fault":null},"status":"ok","uptime_s":5} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/proc2-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/proc2-turn2.json new file mode 100644 index 00000000..884e40fc --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/proc2-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792020295,"id":"chatcmpl-18de88f6eb81d9290000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/run-info.txt b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/run-info.txt new file mode 100644 index 00000000..8bda3731 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/run-info.txt @@ -0,0 +1,3 @@ +binary /home/drakestapleton/workspace/sc-pkv514/target/release/aien-serve-http sha256 5c97561339bdd71272f767d4f9fe8d2ba58fce6752cb072ee8b8d7fc03fcef1e +model /home/drakestapleton/models/qwen3-30b-a3b-instruct-2507-fp8 port 18098 key-mode ephemeral +started 2026-10-14T23:21:55Z host spark-b87b diff --git a/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/summary.txt b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/summary.txt new file mode 100644 index 00000000..0c8a15df --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run2-a639c4e9/two-process/summary.txt @@ -0,0 +1,8 @@ +PASS proc1 turn 1 equals the uninterrupted turn 1 +PASS proc2 restored turn 2 equals the uninterrupted turn 2 +PASS proc2 restored (restores == 1) +PASS proc1 park refused no chunk +PASS proc2 restore covered at least the turn-1 prompt (750 tokens) +PASS proc1 RAM turn 2 equals the uninterrupted turn 2 +PASS proc1 did not restore (restores == 0) +VERDICT PASS diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/SHA256SUMS b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/SHA256SUMS new file mode 100644 index 00000000..bbd52e7f --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/SHA256SUMS @@ -0,0 +1,50 @@ +f1863cf07f8d007c18bf49a68e9ed53ed4c8220c353e930112882f7e35e579ed ./late-load-a1-health.json +6e869b5b6284553fbff5ed4bb2fb2cdb59e31d7cda153bda72254f15006dc012 ./late-load-a2-health.json +973cb01598b608508eab19a3fb9f6d4d3f3f4ff23c0d42cc34bf06ebabcae854 ./late-load-a.log +430b49f7eee73eb76a0c1380e7e405707750f15ed957ad9f52974d49d209c5e5 ./late-load-b-health.json +59bfa026ef26442e59efb0ea0364d34861c956d8e920d9d97bc2f7a810e78f47 ./late-load-b.log +b51620edaafda2b5bf7ea5cf9a31430c106a7362625935d06d45b2bf7aeb4b7a ./late-load-b-turn2.json +beac008c7cae72d4ab4110e9ca769437e8f0bca232b0d90f1deae347b7b38145 ./late-load-other.json +800049d0c5772fd6253c3e830c5ddb6b0e94f1e8779faeeea165cec60d1a4585 ./late-load-park.log +4a76acdc3402f123bcf3a99de8be792a459d843a708f2dfbd182ca0e675d3bed ./late-load-turn1.json +9aee8812114e8edc73894b11dbd8b5c593b2a5df1e0642218a49ed95817b1151 ./late-load-turn2.json +fcceba51ef1a80f47e179e71003c5d1371adbafe5902f21ce89ce0c1c5fe231e ./late-park-a-health.json +c079f1b4a30e6ab3d75153cb45b0a662691974e4ee59644ec8f01539d80870ee ./late-park-a.log +e1edb86f0014a9d44021593b9aceea263ac16d9f97733f2c0797830f79b1dbcd ./late-park-b-health.json +23806c9b4ecba4558ce7e4b16d33cc4f353a382e8b5d7712dc3fc96b5c3b5354 ./late-park-b.log +7fc605d59950e28c8b7e981440be6fcb51454b6d6016ed5abfd30910127dbe06 ./late-park-b-turn2.json +d8afb3daf6e631cfe5cf6fbb018d4fb04ca2b813afeaba3af4945d2b6a21321f ./late-park-inflight-health.json +e86213b94eb8197a5fece6626d6ecf7b30ba8fe3e5e80de1c916ada81a63f962 ./late-park-turn1.json +0bbaaee903ebc40daa9d059d8b48340c9d8cd2a0fa4d2d8bdc2f21aa6ad0eae1 ./late-park-turn2b.json +7c177f358c9ab212d77147f597349ed9543b5b82af60b69e3253d138a35299b9 ./late-park-turn2.json +bddc3a1efd37274b8fc920d4e56fe9a762d48b762c18b42f43f5d3644f1ae7fd ./neg-corrupt-health.json +27aad178fcf377184ff13362cc491547225209c7fe351bb30ed0d4e5984e0661 ./neg-corrupt.log +2fa18a127c1f153bd2d397213b8ad5742c2d819cf143114fc81094fbae567e85 ./neg-corrupt-turn2.json +67c58877abc063e2d8a739568172c03771be456e1289bffe5888a8780355fcce ./neg-switch-health.json +06a35d33c8cecbe9eee8e9b2ae0901cabb7789677dbf090600f65447360f7378 ./neg-switch.log +25732a7ef287a5512ef6be05fc96911c8d0b12824df8351fad668d412a358b6b ./neg-switch-turn2.json +f0408de5c7b13b0d939a60c57fb6f447f77df73175a62ac5cd9b690325f486f0 ./off-health.json +00ff1d65e25f9af2a339e45c605fa77993d6065661314ae0e6d08a5bb52abb4c ./off.log +a3385f2c35f55339ae925060d9fe28664d55aec744221adcf4b41860f22493ac ./off-other.json +4a4b0d305ecb129ac30aa468780892e2f5d13f95f33a0a7c6e7725a77e881812 ./off-turn1.json +0d99d766001615d578b7f0f3a27603e0308cb64fbec2f9b517c2704828ddf80b ./off-turn2b.json +2688ce94e786b2dc7550c18b4b335777c48a538f712b8b79f8441c1a844e934d ./off-turn2.json +3874b9bc5a342ae9e7d6cf71e70f037a325b9fae5be93f000f14053dbea7d003 ./on-health.json +9c3a4111041f40568b85f2171fd7a3227c5bb8c436c42d21f954da16bc974c94 ./on.log +ae894b9970ccffaedd9f43fe0122840a5994571108488ba5899f5d6051451bb8 ./on-turn1.json +58fbf816349f6eb3e1e5dee2531317b01de6b0ce553ea359c0dabaa737bc176f ./on-turn2.json +01986ef8f031e8c50771d6413bba105d4fb53a8ca22daea4be92a03a52728b3c ./park-health.json +352817364347a0b2a18ee33f7a472401ef85bacb8c883f3d0ba4677d87bf8f99 ./park.log +b00e6efe783240b5a00b7ffdc557b936d6e5608d7fd96ea42659f36e1ffa6b5a ./park-turn1.json +f29045617894b3a9897fcdb9ba9cc1fdf909d264fd4bfabe2e5da48d1fa8a403 ./restore-health.json +436a17a44572b1a558cd8df14fce27db9f304275f0b6e534dabcd54a7a461c8e ./restore.log +d1becda72c81fbc8d4a93fac954239b51972ea43d54e5303afb8c43308a2d5a2 ./restore-turn2.json +df5c85b1e0d1b666838870f646a56bc30bfbc22011f3f18918caddff9cc6107a ./run-info.txt +99737015b7e4597dc72e8651cf0d988828a8e4d013ab6fb792623831a585efca ./summary.txt +ba135d245c442cd82987e1471491e2f5f31f14e310ba4fc8d481cb55dd4a0588 ./torn-a-health.json +372d689732ca051e76ede0c27a4469ce47885b9986b70d8142ca00667184709b ./torn-a.log +5e9e1cd408ba75767d32ec7be9d26b2722a62dead2f73b1d0579e9cbefe33ba6 ./torn-b-health.json +2cdb7999b0a223b6008bdb0d853fbb870216f1e66d0ea991876d5df73eb935f2 ./torn-b.log +5c1c579eb6ddaeea70133f7a0c80bc660965b29262923832ee3c39a9de541d52 ./torn-files-at-kill.txt +cb62e7159fcfb565ae65200573562aff2531ec5a153674b5b35ce2ae89207103 ./torn-turn1.json +cd3c5b5e32e260036366bfed7455b36a20fa83906aca144ea89b6da7e097d437 ./torn-turn2.json diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-load-a1-health.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-load-a1-health.json new file mode 100644 index 00000000..d51066ca --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-load-a1-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:8a4c36e9c11167bfab7119bb00229eadb594d0ab","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":0,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":16400,"reads":5,"write_bytes":0,"writes":0},"namespace":"685d9e3c15f30d14","park":true,"park_bytes":0,"park_dedup":3,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1402,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":4,"indexed_bytes":78659584,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"timeout":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":0,"seal_calls":0,"seal_ns":0},"state":"on","store_dir":"/tmp/pkv-chip.HA5vD5/store-late-load","store_state":"open","test_fault":"load:15000:1"},"status":"ok","uptime_s":12} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-load-a2-health.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-load-a2-health.json new file mode 100644 index 00000000..ffdccb48 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-load-a2-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:8a4c36e9c11167bfab7119bb00229eadb594d0ab","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":1,"indeterminate":0,"published":1,"queue_full":0,"read_bytes":25186320,"reads":7,"write_bytes":11014144,"writes":1},"namespace":"685d9e3c15f30d14","park":true,"park_bytes":11010048,"park_dedup":5,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":1,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1402,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":4,"indexed_bytes":78659584,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"ram-prefix-as-long":1,"timeout":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":25165824,"open_calls":1,"open_ns":9181304,"seal_bytes":36175872,"seal_calls":2,"seal_ns":4604588},"state":"on","store_dir":"/tmp/pkv-chip.HA5vD5/store-late-load","store_state":"open","test_fault":"load:15000:1"},"status":"ok","uptime_s":21} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-load-b-health.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-load-b-health.json new file mode 100644 index 00000000..304d63ba --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-load-b-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:8a4c36e9c11167bfab7119bb00229eadb594d0ab","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":0,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":78688272,"reads":16,"write_bytes":0,"writes":0},"namespace":"685d9e3c15f30d14","park":true,"park_bytes":0,"park_dedup":4,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1041,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":7,"indexed_bytes":117993472,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":78643200,"restore_misses":{},"restored_tokens":800,"restores":1,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":78643200,"open_calls":4,"open_ns":15818961,"seal_bytes":0,"seal_calls":0,"seal_ns":0},"state":"on","store_dir":"/tmp/pkv-chip.HA5vD5/store-late-load","store_state":"open","test_fault":null},"status":"ok","uptime_s":3} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-load-b-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-load-b-turn2.json new file mode 100644 index 00000000..0c491477 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-load-b-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792021371,"id":"chatcmpl-18de89f178c036890000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-load-other.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-load-other.json new file mode 100644 index 00000000..6f29448b --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-load-other.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Bearing preload is the application of a controlled internal load to a bearing to eliminate play and improve stiffness. It is commonly used in precision applications to enhance performance and reduce vibration.","role":"assistant"}}],"created":1792021296,"id":"chatcmpl-18de89dfd5f3e7760001","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":35,"prompt_tokens":753,"total_tokens":788}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-load-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-load-turn1.json new file mode 100644 index 00000000..ece9c096 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-load-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792021193,"id":"chatcmpl-18de89c800228e5b0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-load-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-load-turn2.json new file mode 100644 index 00000000..b48dce1c --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-load-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792021275,"id":"chatcmpl-18de89db1f4b9fce0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-park-a-health.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-park-a-health.json new file mode 100644 index 00000000..ea07acfd --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-park-a-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:8a4c36e9c11167bfab7119bb00229eadb594d0ab","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":6,"indeterminate":0,"published":5,"queue_full":0,"read_bytes":0,"reads":0,"write_bytes":92819472,"writes":6},"namespace":"685d9e3c15f30d14","park":true,"park_bytes":92798976,"park_dedup":3,"park_failed":0,"park_refused":1,"park_skipped":0,"parked_chunks":5,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1054,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":2,"ram-prefix-as-long":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":92798976,"seal_calls":5,"seal_ns":13090820},"state":"on","store_dir":"/tmp/pkv-chip.HA5vD5/store-late-park","store_state":"open","test_fault":"p3:20000:1"},"status":"ok","uptime_s":29} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-park-b-health.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-park-b-health.json new file mode 100644 index 00000000..248da902 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-park-b-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:8a4c36e9c11167bfab7119bb00229eadb594d0ab","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":0,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":75530256,"reads":12,"write_bytes":0,"writes":0},"namespace":"685d9e3c15f30d14","park":true,"park_bytes":0,"park_dedup":4,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1467,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":5,"indexed_bytes":92819456,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":75497472,"restore_misses":{},"restored_tokens":768,"restores":1,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":75497472,"open_calls":3,"open_ns":15312129,"seal_bytes":0,"seal_calls":0,"seal_ns":0},"state":"on","store_dir":"/tmp/pkv-chip.HA5vD5/store-late-park","store_state":"open","test_fault":null},"status":"ok","uptime_s":2} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-park-b-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-park-b-turn2.json new file mode 100644 index 00000000..07ec7e22 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-park-b-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792021551,"id":"chatcmpl-18de8a1b3ba904570000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-park-inflight-health.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-park-inflight-health.json new file mode 100644 index 00000000..96152ad3 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-park-inflight-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:8a4c36e9c11167bfab7119bb00229eadb594d0ab","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":2,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":0,"reads":0,"write_bytes":25169936,"writes":2},"namespace":"685d9e3c15f30d14","park":true,"park_bytes":0,"park_dedup":0,"park_failed":0,"park_refused":1,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1054,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":25165824,"seal_calls":1,"seal_ns":3219381},"state":"on","store_dir":"/tmp/pkv-chip.HA5vD5/store-late-park","store_state":"open","test_fault":"p3:20000:1"},"status":"ok","uptime_s":13} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-park-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-park-turn1.json new file mode 100644 index 00000000..c8acda59 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-park-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792021447,"id":"chatcmpl-18de8a03200f861b0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-park-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-park-turn2.json new file mode 100644 index 00000000..a7639c50 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-park-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792021460,"id":"chatcmpl-18de8a06085bfba60001","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-park-turn2b.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-park-turn2b.json new file mode 100644 index 00000000..73e6aa1c --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/late-park-turn2b.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Aerospace applications are least useful at home.","role":"assistant"}}],"created":1792021470,"id":"chatcmpl-18de8a085dda3efb0002","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":10,"prompt_tokens":819,"total_tokens":829}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/neg-corrupt-health.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/neg-corrupt-health.json new file mode 100644 index 00000000..d4c6ae1b --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/neg-corrupt-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:8a4c36e9c11167bfab7119bb00229eadb594d0ab","io":{"corrupt_deleted":1,"disk_full":0,"failed":1,"file_fsyncs":0,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":25206800,"reads":12,"write_bytes":0,"writes":0},"namespace":"685d9e3c15f30d14","park":true,"park_bytes":0,"park_dedup":3,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1021,"failed":false,"foreign_files":0,"foreign_namespace":4,"indexed":5,"indexed_bytes":176197632,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"invalid":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":25165824,"open_calls":1,"open_ns":3426261,"seal_bytes":0,"seal_calls":0,"seal_ns":0},"state":"on","store_dir":"/tmp/pkv-chip.HA5vD5/store","store_state":"open","test_fault":null},"status":"ok","uptime_s":3} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/neg-corrupt-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/neg-corrupt-turn2.json new file mode 100644 index 00000000..9f268481 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/neg-corrupt-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792021628,"id":"chatcmpl-18de8a2d1c6ff1100000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/neg-switch-health.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/neg-switch-health.json new file mode 100644 index 00000000..1496e161 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/neg-switch-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:8a4c36e9c11167bfab7119bb00229eadb594d0ab","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":1,"indeterminate":0,"published":1,"queue_full":0,"read_bytes":20496,"reads":6,"write_bytes":25169920,"writes":1},"namespace":"b5fdd55af435c6c7","park":true,"park_bytes":25165824,"park_dedup":0,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":1,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1420,"failed":false,"foreign_files":0,"foreign_namespace":5,"indexed":0,"indexed_bytes":89673728,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":50331648,"seal_calls":2,"seal_ns":6452069},"state":"on","store_dir":"/tmp/pkv-chip.HA5vD5/store","store_state":"open","test_fault":null},"status":"ok","uptime_s":3} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/neg-switch-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/neg-switch-turn2.json new file mode 100644 index 00000000..d862e10d --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/neg-switch-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792020954,"id":"chatcmpl-18de899042dbb16a0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/off-health.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/off-health.json new file mode 100644 index 00000000..c1e14168 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/off-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","status":"ok","uptime_s":5} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/off-other.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/off-other.json new file mode 100644 index 00000000..e50afc98 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/off-other.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Bearing preload is the application of a controlled internal load to a bearing to eliminate play and improve stiffness. It is commonly used in precision applications to enhance performance and reduce vibration.","role":"assistant"}}],"created":1792020643,"id":"chatcmpl-18de8947ce6e5ced0003","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":35,"prompt_tokens":753,"total_tokens":788}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/off-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/off-turn1.json new file mode 100644 index 00000000..855d7af8 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/off-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792020639,"id":"chatcmpl-18de8946d4cc63960000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/off-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/off-turn2.json new file mode 100644 index 00000000..16867814 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/off-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792020641,"id":"chatcmpl-18de89476125962c0001","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/off-turn2b.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/off-turn2b.json new file mode 100644 index 00000000..b58c9cf3 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/off-turn2b.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Aerospace applications are least useful at home.","role":"assistant"}}],"created":1792020642,"id":"chatcmpl-18de8947b68988920002","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":10,"prompt_tokens":819,"total_tokens":829}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/on-health.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/on-health.json new file mode 100644 index 00000000..2b469c78 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/on-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:8a4c36e9c11167bfab7119bb00229eadb594d0ab","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":5,"indeterminate":0,"published":4,"queue_full":0,"read_bytes":0,"reads":0,"write_bytes":78659600,"writes":5},"namespace":"685d9e3c15f30d14","park":true,"park_bytes":78643200,"park_dedup":3,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":4,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1175,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1,"ram-prefix-as-long":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":78643200,"seal_calls":4,"seal_ns":10756378},"state":"on","store_dir":"/tmp/pkv-chip.HA5vD5/store-on","store_state":"open","test_fault":null},"status":"ok","uptime_s":4} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/on-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/on-turn1.json new file mode 100644 index 00000000..0cd2b9f7 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/on-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792020717,"id":"chatcmpl-18de89592f88b08c0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/on-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/on-turn2.json new file mode 100644 index 00000000..e999c55b --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/on-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792020720,"id":"chatcmpl-18de8959c50fce2f0001","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/park-health.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/park-health.json new file mode 100644 index 00000000..25e7146e --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/park-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:8a4c36e9c11167bfab7119bb00229eadb594d0ab","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":5,"indeterminate":0,"published":4,"queue_full":0,"read_bytes":0,"reads":0,"write_bytes":78659600,"writes":5},"namespace":"685d9e3c15f30d14","park":true,"park_bytes":78643200,"park_dedup":0,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":4,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1371,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":78643200,"seal_calls":4,"seal_ns":10100553},"state":"on","store_dir":"/tmp/pkv-chip.HA5vD5/store","store_state":"open","test_fault":null},"status":"ok","uptime_s":8} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/park-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/park-turn1.json new file mode 100644 index 00000000..00785508 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/park-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792020796,"id":"chatcmpl-18de896b8709baed0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/restore-health.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/restore-health.json new file mode 100644 index 00000000..34ee9636 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/restore-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:8a4c36e9c11167bfab7119bb00229eadb594d0ab","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":0,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":78675984,"reads":13,"write_bytes":0,"writes":0},"namespace":"685d9e3c15f30d14","park":true,"park_bytes":0,"park_dedup":3,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1653,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":4,"indexed_bytes":78659584,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":78643200,"restore_misses":{},"restored_tokens":800,"restores":1,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":78643200,"open_calls":4,"open_ns":15905355,"seal_bytes":0,"seal_calls":0,"seal_ns":0},"state":"on","store_dir":"/tmp/pkv-chip.HA5vD5/store","store_state":"open","test_fault":null},"status":"ok","uptime_s":2} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/restore-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/restore-turn2.json new file mode 100644 index 00000000..41774572 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/restore-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792020878,"id":"chatcmpl-18de897ea850d5a90000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/run-info.txt b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/run-info.txt new file mode 100644 index 00000000..af19fec7 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/run-info.txt @@ -0,0 +1,3 @@ +binary /home/drakestapleton/workspace/sc-pkv514/target/release/aien-serve-http sha256 6bba9ad38e84f00ef9663aceac810fc8f034fe9ba9529867d851fbcc3ac6721e +model /home/drakestapleton/models/qwen3-30b-a3b-instruct-2507-fp8 port 18098 key-mode ephemeral +started 2026-10-14T23:30:21Z host spark-b87b diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/summary.txt b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/summary.txt new file mode 100644 index 00000000..542e2bc1 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/summary.txt @@ -0,0 +1,29 @@ +PASS turn 1 identical off/on/park/torn/late +PASS T_on == T_off (persistence changes no token) +PASS T_restored == T_off (restored = uninterrupted) +PASS restore served once +PASS park refused no chunk (whole turn 1 parked) +PASS restore covered at least the turn-1 prompt (750 tokens) +PASS neg-switch restores nothing +PASS torn: a temp file was in flight at the kill +PASS torn: nothing was published before the kill +PASS torn: recovery removed every temp file +PASS torn: health counts the removed temps +PASS torn: restores nothing +PASS torn: T == T_off +PASS late-load: timed out once +PASS late-load: restores nothing +PASS late-load: T == T_off +PASS late-load: the late completion is never served +PASS late-load: another chat == A_off +PASS late-load: the store still restores after +PASS late-load: restored T == T_off +PASS late-park: the park was in flight during turn 2 +PASS late-park: T == T_off +PASS late-park: other turn 2 == T2b_off +PASS late-park: no park failed +PASS late-park: restores once after restart +PASS late-park: restored T == T_off +PASS neg-corrupt restores nothing +PASS off health has no persistent_kv +PKV CHIP CHECK: PASS diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/torn-a-health.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/torn-a-health.json new file mode 100644 index 00000000..049299c6 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/torn-a-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:8a4c36e9c11167bfab7119bb00229eadb594d0ab","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":2,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":0,"reads":0,"write_bytes":25169936,"writes":2},"namespace":"685d9e3c15f30d14","park":true,"park_bytes":0,"park_dedup":0,"park_failed":0,"park_refused":1,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":930,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":25165824,"seal_calls":1,"seal_ns":3192659},"state":"on","store_dir":"/tmp/pkv-chip.HA5vD5/store-torn","store_state":"open","test_fault":"p3:600000"},"status":"ok","uptime_s":13} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/torn-b-health.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/torn-b-health.json new file mode 100644 index 00000000..25e70e64 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/torn-b-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:8a4c36e9c11167bfab7119bb00229eadb594d0ab","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":1,"indeterminate":0,"published":1,"queue_full":0,"read_bytes":16,"reads":1,"write_bytes":50339840,"writes":2},"namespace":"685d9e3c15f30d14","park":true,"park_bytes":25165824,"park_dedup":0,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":1,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1473,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":1,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":50331648,"seal_calls":2,"seal_ns":6373383},"state":"on","store_dir":"/tmp/pkv-chip.HA5vD5/store-torn","store_state":"open","test_fault":null},"status":"ok","uptime_s":3} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/torn-files-at-kill.txt b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/torn-files-at-kill.txt new file mode 100644 index 00000000..6fe54c91 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/torn-files-at-kill.txt @@ -0,0 +1,2 @@ +STORE_ID 16 +tmp/7e55014cc11fc2ee761997a45bba04eba21ad44c1c6da749c19eb40783d68b9e.1.1.1.part 25169920 diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/torn-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/torn-turn1.json new file mode 100644 index 00000000..7f08fd75 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/torn-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792021030,"id":"chatcmpl-18de89a20ea743b10000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/torn-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/torn-turn2.json new file mode 100644 index 00000000..38e7c143 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/chip-check/torn-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792021117,"id":"chatcmpl-18de89b64e4d2f640000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/ground.txt b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/ground.txt new file mode 100644 index 00000000..64f23b94 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/ground.txt @@ -0,0 +1,7 @@ +commit 8a4c36e9c11167bfab7119bb00229eadb594d0ab dirty_files=0 +binary sha256 6bba9ad38e84f00ef9663aceac810fc8f034fe9ba9529867d851fbcc3ac6721e +test sha256 a2fb47691d4d0d3d410850003334542a81e3fcb802b6b255c46239421db893d5 +omega d0889a944b02066f84fec71af7b9bbb92f5c986f driver 580.173.02 kernel 7.0.0-1019-nvidia +start 2026-10-14T23:27:02Z +MemAvailable: 112423480 kB +end 2026-10-14T23:50:19Z diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/rc.txt b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/rc.txt new file mode 100644 index 00000000..04a94c25 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/rc.txt @@ -0,0 +1,4 @@ +item1-3-4-roundtrip rc=0 +item2a-inprocess-restore rc=0 +item2b-chip-check rc=0 +item5-two-process rc=0 diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/run-all.out b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/run-all.out new file mode 100644 index 00000000..7b2d1ec0 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/run-all.out @@ -0,0 +1,62 @@ +== item1-3-4-roundtrip 23:27:02 +item1-3-4-roundtrip rc=0 +SNAP site=switches attention_path=fused +test fused_cache_round_trip_cost_and_restore_latency_on_the_chip has been running for over 60 seconds +SNAP site=park positions=2079 parked_chunks=9 park_bytes=204472320 park_failed=0 park_refused=0 +SNAP site=export positions=2079 bytes=204472320 ms_min=63.867 median=65.284 max=68.269 n=5 +SNAP site=round_trip identical=true reps=5 import_ms_min=22.343 median=22.424 max=22.464 n=5 +SNAP site=neg_flip differing_bytes=1 at=Some(102236160) +SNAP site=neg_truncated refused=true err=Some("kv payload of 204472319 bytes, 2079 positions need 204472320") +SNAP site=store objects=9 object_bytes=204509184 +SNAP site=fetch_warm ms_min=452.383 median=453.619 max=470.654 n=5 +SNAP site=fetch_cold ms_min=652.785 median=693.505 max=696.797 n=5 block_read_bytes=[204513280, 204902400, 204906496, 204906496, 204898304] object_bytes=204509184 +SNAP site=neg_corrupt refused=true misses_before={"not-found": 1} misses_after={"invalid": 1, "not-found": 1} +test fused_cache_round_trip_cost_and_restore_latency_on_the_chip ... ok +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 88.17s +== item2a-inprocess-restore 23:28:30 +item2a-inprocess-restore rc=0 +test restored_turn_two_equals_the_uninterrupted_turn_two_on_the_chip has been running for over 60 seconds +test restored_turn_two_equals_the_uninterrupted_turn_two_on_the_chip ... ok +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 111.05s +== item2b-chip-check 23:30:21 +item2b-chip-check rc=0 +PASS turn 1 identical off/on/park/torn/late +PASS T_on == T_off (persistence changes no token) +PASS T_restored == T_off (restored = uninterrupted) +PASS restore served once +PASS park refused no chunk (whole turn 1 parked) +PASS restore covered at least the turn-1 prompt (750 tokens) +PASS neg-switch restores nothing +PASS torn: a temp file was in flight at the kill +PASS torn: nothing was published before the kill +PASS torn: recovery removed every temp file +PASS torn: health counts the removed temps +PASS torn: restores nothing +PASS torn: T == T_off +PASS late-load: timed out once +PASS late-load: restores nothing +PASS late-load: T == T_off +PASS late-load: the late completion is never served +PASS late-load: another chat == A_off +PASS late-load: the store still restores after +PASS late-load: restored T == T_off +PASS late-park: the park was in flight during turn 2 +PASS late-park: T == T_off +PASS late-park: other turn 2 == T2b_off +PASS late-park: no park failed +PASS late-park: restores once after restart +PASS late-park: restored T == T_off +PASS neg-corrupt restores nothing +PASS off health has no persistent_kv +PKV CHIP CHECK: PASS +== item5-two-process 23:47:11 +item5-two-process rc=0 +PASS proc1 turn 1 equals the uninterrupted turn 1 +PASS proc2 restored turn 2 equals the uninterrupted turn 2 +PASS proc2 restored (restores == 1) +PASS proc1 park refused no chunk +PASS proc2 restore covered at least the turn-1 prompt (750 tokens) +PASS proc1 RAM turn 2 equals the uninterrupted turn 2 +PASS proc1 did not restore (restores == 0) +VERDICT PASS +run-all rc=0 diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/SHA256SUMS b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/SHA256SUMS new file mode 100644 index 00000000..846a3932 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/SHA256SUMS @@ -0,0 +1,14 @@ +f3cae29d20a661579e919eee97ce4757432e60e101b2f9b94207e31a88915543 ./memory.txt +fa64671d69a879fe1c21a9160ec7d67c6844fffb13c59e79412f4f42afb04358 ./off.log +36e05bdd7b80177cd291b4d0141c7a9fd56a16c2c5beeda649ed3f1702ed6178 ./off-turn1.json +c3ae7ae6b7bbad4896eb711cdb4b18b1a9c14ab6b23823655e65457d69f67f8d ./off-turn2.json +3f48e5676f139328fa6ead43cffe2309ffd58ca1c97028789be1ced4d32749b8 ./proc1-after-turn1-health.json +cf71538b1ed8be2d13e8513d577cb88214d2db30bcd1567b6bb89697a4427fd2 ./proc1-health.json +abe4b29215dd0d5ace157c381d8f5cc3278ff05be772673151cd3c5d64db9bfc ./proc1.log +22e550af0035de6e230e2ea7a5355f42f17a4f071c550822192d57a6998a133f ./proc1-turn1.json +29cc6a3a31d7361a4c2a0a3a4a243c35a0f7494c4741ecee5a0b18062e76afd0 ./proc1-turn2.json +3288b2002d8260e6360258a5e5e47c7aaee99dde73d669b0d629a7f3c08e5b25 ./proc2-health.json +bdf7f154c957469d476d9fcda572c3a4ddf844642d1e4a989011b57e8ac1c20c ./proc2.log +4ef40a3d16b4f45e784e46486c036e0e110eddf87844b229562ffd2267acf070 ./proc2-turn2.json +3446b565b22c657d73b8782c29fb94e6aa9380c2f4ec6f146d57193cfa397041 ./run-info.txt +69f249e4e117a3a819153ed461f1c4bb24790645420883dee20d3eb9957b68e4 ./summary.txt diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/memory.txt b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/memory.txt new file mode 100644 index 00000000..62167f12 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/memory.txt @@ -0,0 +1,7 @@ +MemAvailable before proc2 load: 71.1 GB +both resident: proc1 pid 1571762 alive=yes, proc2 pid 1585775 +MemAvailable with both loaded: 38.2 GB + PID RSS COMMAND +1571762 37294816 aien-serve-http +1585775 33803920 aien-serve-http +proc2 still alive during the ram phase diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/off-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/off-turn1.json new file mode 100644 index 00000000..17eae336 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/off-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792021647,"id":"chatcmpl-18de8a31ba77bb9a0000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/off-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/off-turn2.json new file mode 100644 index 00000000..e03d5f5e --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/off-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792021650,"id":"chatcmpl-18de8a3246fe5ac80001","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/proc1-after-turn1-health.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/proc1-after-turn1-health.json new file mode 100644 index 00000000..8530dd7e --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/proc1-after-turn1-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:8a4c36e9c11167bfab7119bb00229eadb594d0ab","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":5,"indeterminate":0,"published":4,"queue_full":0,"read_bytes":0,"reads":0,"write_bytes":78659600,"writes":5},"namespace":"685d9e3c15f30d14","park":true,"park_bytes":78643200,"park_dedup":0,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":4,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1104,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":78643200,"seal_calls":4,"seal_ns":9951177},"state":"on","store_dir":"/tmp/pkv-chip.9A7Ttb/store","store_state":"open","test_fault":null},"status":"ok","uptime_s":9} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/proc1-health.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/proc1-health.json new file mode 100644 index 00000000..c52d9faa --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/proc1-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:8a4c36e9c11167bfab7119bb00229eadb594d0ab","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":5,"indeterminate":0,"published":4,"queue_full":0,"read_bytes":0,"reads":0,"write_bytes":78659600,"writes":5},"namespace":"685d9e3c15f30d14","park":true,"park_bytes":78643200,"park_dedup":3,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":4,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":1104,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":0,"indexed_bytes":0,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":0,"restore_misses":{"not-found":1,"ram-prefix-as-long":1},"restored_tokens":0,"restores":0,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":0,"open_calls":0,"open_ns":0,"seal_bytes":78643200,"seal_calls":4,"seal_ns":9951177},"state":"on","store_dir":"/tmp/pkv-chip.9A7Ttb/store","store_state":"open","test_fault":null},"status":"ok","uptime_s":91} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/proc1-turn1.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/proc1-turn1.json new file mode 100644 index 00000000..923a8ef5 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/proc1-turn1.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"1. Tightening bolts to a specific torque value in automotive repairs. \n2. Ensuring proper tension in machinery assembly to prevent over-tightening or under-tightening. \n3. Maintaining safety and integrity in aerospace and industrial applications.","role":"assistant"}}],"created":1792021726,"id":"chatcmpl-18de8a43f50707a90000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":50,"prompt_tokens":750,"total_tokens":800}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/proc1-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/proc1-turn2.json new file mode 100644 index 00000000..47745319 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/proc1-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792021815,"id":"chatcmpl-18de8a58b21339710001","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/proc2-health.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/proc2-health.json new file mode 100644 index 00000000..c4b19668 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/proc2-health.json @@ -0,0 +1 @@ +{"busy":false,"engine":"omega","model":"qwen3-30b-a3b-instruct-2507","persistent_kv":{"chunk_tokens":256,"engine_build_id":"omega:d0889a944b02066f84fec71af7b9bbb92f5c986f+libomega_gpu:6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5+sc:8a4c36e9c11167bfab7119bb00229eadb594d0ab","io":{"corrupt_deleted":0,"disk_full":0,"failed":0,"file_fsyncs":0,"indeterminate":0,"published":0,"queue_full":0,"read_bytes":78675984,"reads":13,"write_bytes":0,"writes":0},"namespace":"685d9e3c15f30d14","park":true,"park_bytes":0,"park_dedup":3,"park_failed":0,"park_refused":0,"park_skipped":0,"parked_chunks":0,"recovery":{"corrupt_deleted":0,"done":true,"elapsed_us":3015,"failed":false,"foreign_files":0,"foreign_namespace":0,"indexed":4,"indexed_bytes":78659584,"tmp_deleted":0,"unlink_failures":0},"refusals":0,"restore":true,"restore_bytes":78643200,"restore_misses":{},"restored_tokens":800,"restores":1,"rounding_class":"omega-gpu/aarch64-unknown-linux-gnu/fp8-all/kv-bf16/attn-fused@kv-arith-epoch-1","seal":{"open_bytes":78643200,"open_calls":4,"open_ns":9817695,"seal_bytes":0,"seal_calls":0,"seal_ns":0},"state":"on","store_dir":"/tmp/pkv-chip.9A7Ttb/store2","store_state":"open","test_fault":null},"status":"ok","uptime_s":2} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/proc2-turn2.json b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/proc2-turn2.json new file mode 100644 index 00000000..00390484 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/proc2-turn2.json @@ -0,0 +1 @@ +{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Tightening bolts to a specific torque value matters most on a bicycle, because improper torque can lead to component failure, safety hazards, or damage—especially in critical areas like the stem, handlebars, or bottom bracket.","role":"assistant"}}],"created":1792021813,"id":"chatcmpl-18de8a582c4342060000","model":"qwen3-30b-a3b-instruct-2507","object":"chat.completion","usage":{"completion_tokens":45,"prompt_tokens":822,"total_tokens":867}} \ No newline at end of file diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/run-info.txt b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/run-info.txt new file mode 100644 index 00000000..a1ee7378 --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/run-info.txt @@ -0,0 +1,3 @@ +binary /home/drakestapleton/workspace/sc-pkv514/target/release/aien-serve-http sha256 6bba9ad38e84f00ef9663aceac810fc8f034fe9ba9529867d851fbcc3ac6721e +model /home/drakestapleton/models/qwen3-30b-a3b-instruct-2507-fp8 port 18098 key-mode ephemeral +started 2026-10-14T23:47:11Z host spark-b87b diff --git a/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/summary.txt b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/summary.txt new file mode 100644 index 00000000..0c8a15df --- /dev/null +++ b/docs/inference/evidence/pkv514-chip-20261014/run3-8a4c36e9/two-process/summary.txt @@ -0,0 +1,8 @@ +PASS proc1 turn 1 equals the uninterrupted turn 1 +PASS proc2 restored turn 2 equals the uninterrupted turn 2 +PASS proc2 restored (restores == 1) +PASS proc1 park refused no chunk +PASS proc2 restore covered at least the turn-1 prompt (750 tokens) +PASS proc1 RAM turn 2 equals the uninterrupted turn 2 +PASS proc1 did not restore (restores == 0) +VERDICT PASS diff --git a/scripts/.crumb b/scripts/.crumb index 0a6a9349..5368fb4e 100644 --- a/scripts/.crumb +++ b/scripts/.crumb @@ -4,14 +4,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-14T21:51:01Z", + "compiled_at": "2026-10-15T00:25:34Z", "compiler": "crumb-compile/1", - "digest": "sha256:55ca26451010e0ffcd7c54e1af55130f2b09a3094141937477c5131389ff8bdb", + "digest": "sha256:b0d8f2a790a2430cb987703149e62d2ed702b9f98500539a667b78bde1925792", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 42, - "generated_at_commit": "816de6c3954cf14a42f873f474c4519ccd33a3fb", - "source_tree": "sha256:d3caec24abeac2e99c3d36f1d102163852029af074132e5d0465a165f70feecc" + "files": 47, + "generated_at_commit": "aab59c7a81bb11b6a75d107caa0c0e2415089558", + "source_tree": "sha256:ece23782edc351691673c1e261fc81daa416fbe722b88fb1a6d5b687a4ecec7c" } }, "parent": { diff --git a/scripts/own30b-pkv-bench.sh b/scripts/own30b-pkv-bench.sh new file mode 100755 index 00000000..f0859f75 --- /dev/null +++ b/scripts/own30b-pkv-bench.sh @@ -0,0 +1,311 @@ +#!/usr/bin/env bash +# Persistent KV benchmark on the chip (sc#508, contract locked in #500). CHIP-ONLY: never run by +# CI or cargo test. Same safety rules as own30b-pkv-chip-check.sh (see own30b-pkv-lib.sh): own +# server on 127.0.0.1:18098 (PKV_CHECK_PORT), refuses while :18091 answers or the port is taken, +# stops only the PID it started, key via `atlas-vault run AIEN_KV_STORE_KEY --` (never printed). +# +# scripts/own30b-pkv-bench.sh [--dry-run] +# +# Workload: 8 two-turn conversations, each with its own ~2048-token prefix (a distinct session +# line plus PKV_BENCH_RULES rules) that turn 2 shares with turn 1; greedy, PKV_BENCH_MAX_TOKENS +# (64) new tokens, streamed so TTFT is measured on the client. +# seed persistence on, store S: turn 1 of all 8 conversations, wait for the parks +# disabled persistence off (AIEN_KV_STORE_DIR unset) +# warm persistence on S, every store file read into the page cache before each batch +# cold persistence on S, `sync; echo 3 > /proc/sys/vm/drop_caches` (sudo -n) before each +# batch; cold is VERIFIED per batch by the server's /proc//io read_bytes (reads +# that reached the block layer) against health restore_bytes; no fincore/vmtouch here +# Each mode: concurrency 1/2/4/8 x PKV_BENCH_REPS (3) batches. A batch first sends one short +# unrelated chat (so the engine's RAM prefix is useless), then turn 2 of conversations 1..N at +# once. The server runs one generation at a time and answers 503 when busy: clients retry every +# 0.2 s (counted), latency and TTFT run from the first attempt, so they include the queue. +# Raw evidence: every SSE stream with client timestamps, health and /proc//io before and +# after each batch, RSS every second, GPU memory (nvidia-smi compute-apps) every 5 s, iostat -dxk +# 5, server logs. summary.txt: p50/p95 latency and TTFT, completion tokens/s, restores, restore +# bytes, block reads, decrypt (open) and encrypt (seal) time, RSS/GPU peak, failures. +# Budget: PKV_BENCH_BUDGET_S (2700) wall seconds; past it the remaining batches are skipped and +# the verdict is INCOMPLETE. Rough duration: 4 server starts plus about 180 requests, 15 to 30 min. +set -euo pipefail +. "$(dirname "$0")/own30b-pkv-lib.sh" +pkv_usage_args "$(basename "$0")" "$@" + +REPS=${PKV_BENCH_REPS:-3} +MAXTOK=${PKV_BENCH_MAX_TOKENS:-64} +RULES=${PKV_BENCH_RULES:-118} +BUDGET=${PKV_BENCH_BUDGET_S:-2700} +LEVELS="1 2 4 8" +MODES="disabled warm cold" + +bench_prereqs() { + local bad=0 fs + for t in iostat nvidia-smi; do + if command -v "$t" >/dev/null; then echo " ok tool $t"; else echo " info tool $t missing (that column stays empty)"; fi + done + if sudo -n true 2>/dev/null; then + echo " ok sudo -n works (drop_caches for the cold mode)" + else + echo " MISS sudo -n (the cold mode needs: sync; echo 3 > /proc/sys/vm/drop_caches)" + bad=1 + fi + fs=$(findmnt -no FSTYPE -T /tmp) + if [ "$fs" = tmpfs ] || [ "$fs" = ramfs ]; then + echo " MISS /tmp is $fs: the store must be on the NVMe for a cold restore" + bad=1 + else + echo " ok store parent /tmp is $fs on $(findmnt -no SOURCE -T /tmp)" + fi + return $bad +} + +if [ "$DRY" = 1 ]; then + echo "PLAN own30b-pkv-bench (#508): seed, then modes [$MODES] x concurrency [$LEVELS] x $REPS reps" + echo " 8 conversations, ~2048-token prefix each ($RULES rules), $MAXTOK new tokens, streamed" + echo " 4 server starts on :$PORT, about $((3 * REPS * (4 + 15) + 8)) requests, estimate 15 to 30 minutes, budget ${BUDGET} s" + echo " cold = drop_caches before each batch, verified by server block reads vs restore_bytes" + echo " evidence -> $dir" + echo "PREREQUISITES" + ok=1 + pkv_prereqs 1 || ok=0 + bench_prereqs || ok=0 + if [ $ok = 1 ]; then echo "DRY RUN: ready"; exit 0; fi + echo "DRY RUN: NOT ready" + exit 1 +fi +if ! bench_prereqs >/dev/null 2>&1; then + bench_prereqs >&2 || true + echo "refusing: a benchmark prerequisite is missing" >&2 + exit 2 +fi +pkv_begin + +SAMPLER= +IOSTAT= +stop_samplers() { + if [ -n "$SAMPLER" ]; then kill "$SAMPLER" 2>/dev/null || true; fi + SAMPLER= +} +trap 'stop_samplers; [ -n "$IOSTAT" ] && kill "$IOSTAT" 2>/dev/null; stop_server; rm -rf "$work"' EXIT + +if command -v iostat >/dev/null; then + iostat -dxk -t 5 >"$dir/iostat.txt" 2>&1 & + IOSTAT=$! +fi + +start_samplers() { # : RSS every 1 s, GPU memory every 5 s + local mode=$1 p + p=$(server_pid) + ( + n=0 + while kill -0 "$p" 2>/dev/null; do + printf '%s %s\n' "$EPOCHREALTIME" "$(awk '/^VmRSS/ {print $2}' "/proc/$p/status" 2>/dev/null)" >>"$dir/rss-$mode.txt" + if [ $((n % 5)) = 0 ] && command -v nvidia-smi >/dev/null; then + printf '%s %s\n' "$EPOCHREALTIME" "$(nvidia-smi --query-compute-apps=pid,used_memory --format=csv,noheader,nounits 2>/dev/null | awk -F', *' -v p="$p" '$1 == p {print $2}')" >>"$dir/gpu-$mode.txt" + fi + n=$((n + 1)) + sleep 1 + done + ) & + SAMPLER=$! +} + +# The conversations: k = 1..8, each prefix its own (the session line makes every chunk distinct). +sys_k() { + local s="Session $1 of the OWN-30B benchmark. You are the OWN-30B assistant on the AIEN Spark. Answer briefly." i + for i in $(seq 1 "$RULES"); do s="$s Rule $i: keep answers short, never invent facts, say UNKNOWN when unsure."; done + printf '%s' "$s" +} +msgs1() { jq -n --arg s "$(sys_k "$1")" --arg q "$Q1" '[{role:"system",content:$s},{role:"user",content:$q}]'; } +msgs2() { # + jq -n --argjson m "$(msgs1 "$1")" --arg a "$2" --arg q "$3" '$m + [{role:"assistant",content:$a},{role:"user",content:$q}]' +} +FLUSH=$(jq -n '[{role:"user",content:"Say one word about the weather."}]') + +# send : one streamed request, retried while the server answers 503. +# Writes .sse (client time + SSE line) and one line of requests.tsv. +send() { + local name=$1 body="$work/$1.body" h="$work/$1.h" raw="$dir/sse/$1.sse" t0 code retries=0 + jq -n --arg model "$SERVED_MODEL" --argjson m "$2" --argjson n "$MAXTOK" '{model:$model, messages:$m, max_tokens:$n, temperature:0, seed:1, stream:true}' >"$body" + t0=$EPOCHREALTIME + while :; do + rm -f "$h" + curl -sN -m 900 -D "$h" "$base/v1/chat/completions" -H 'content-type: application/json' -d @"$body" | + while IFS= read -r line; do [ -n "$line" ] && printf '%s %s\n' "$EPOCHREALTIME" "$line"; done >"$raw" || true + code=$(awk 'NR == 1 {print $2}' "$h" 2>/dev/null) + if [ "$code" = 503 ] && [ "$retries" -lt 6000 ]; then + retries=$((retries + 1)) + sleep 0.2 + continue + fi + break + done + local row sha + row=$(awk -v t0="$t0" -v name="$name" -v code="${code:-none}" -v retries="$retries" ' + / data: \{/ && first == "" && $0 ~ /"content":"[^"]/ { first = $1 } + /"usage":/ { if (match($0, /"completion_tokens":[0-9]+/)) ct = substr($0, RSTART + 20, RLENGTH - 20) + if (match($0, /"prompt_tokens":[0-9]+/)) pt = substr($0, RSTART + 16, RLENGTH - 16) } + / data: \[DONE\]/ { done = 1 } + { last = $1 } + END { + ttft = (first == "") ? "NA" : sprintf("%.4f", first - t0) + lat = (last == "") ? "NA" : sprintf("%.4f", last - t0) + ok = (code == "200" && done && first != "" && ct != "") ? "ok" : "FAIL" + printf "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s", name, ok, code, retries, ttft, lat, ct + 0, pt + 0 + }' "$raw") + sha=$(sed -n 's/^[0-9.]* data: //p' "$raw" | grep -v '^\[DONE\]' | jq -rj '.choices[0].delta.content // empty' 2>/dev/null | sha256sum | cut -c1-16) + # One write per row: the N clients of a batch append at the same time. + printf '%s\t%s\n' "$row" "$sha" >>"$dir/requests.tsv" +} + +# snap : health and /proc//io of our server, and the NVMe line of /proc/diskstats. +snap() { + local p + p=$(server_pid) + curl -s -m 10 "$base/health" >"$dir/snap/$1-health.json" + cat "/proc/$p/io" >"$dir/snap/$1-io.txt" + grep -w "$(basename "$(findmnt -no SOURCE -T /tmp)" | sed 's/p[0-9]*$//')" /proc/diskstats >"$dir/snap/$1-diskstats.txt" || true + awk '/^(Cached|MemAvailable):/' /proc/meminfo >"$dir/snap/$1-meminfo.txt" +} +hv() { jq -r "(.persistent_kv$2) // 0" "$dir/snap/$1-health.json" 2>/dev/null || echo 0; } +iov() { awk -v k="$2:" '$1 == k {v = $2} END {print v + 0}' "$dir/snap/$1-io.txt" 2>/dev/null || echo 0; } + +# batch +batch() { + local mode=$1 n=$2 r=$3 tag="$1-c$2-r$3" k t0 t1 pids=() + send "$tag-flush" "$FLUSH" + case $mode in + warm) find "$S" -type f -exec cat {} + >/dev/null 2>&1 || true ;; + cold) + sync + sudo -n sh -c 'echo 3 > /proc/sys/vm/drop_caches' + ;; + esac + snap "$tag-pre" + t0=$EPOCHREALTIME + for k in $(seq 1 "$n"); do + send "$tag-k$k" "$(msgs2 "$k" "${A1[$k]}" "Benchmark question c$n r$r: which of those matters most on a bicycle, and why?")" & + pids+=("$!") + done + wait "${pids[@]}" + t1=$EPOCHREALTIME + snap "$tag-post" + printf '%s\t%s\t%s\t%.4f\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' "$mode" "$n" "$r" "$(awk -v a="$t0" -v b="$t1" 'BEGIN {print b - a}')" \ + $(($(hv "$tag-post" .restores) - $(hv "$tag-pre" .restores))) \ + $(($(hv "$tag-post" .restore_bytes) - $(hv "$tag-pre" .restore_bytes))) \ + $(($(iov "$tag-post" read_bytes) - $(iov "$tag-pre" read_bytes))) \ + $(($(iov "$tag-post" write_bytes) - $(iov "$tag-pre" write_bytes))) \ + $(($(hv "$tag-post" .seal.open_ns) - $(hv "$tag-pre" .seal.open_ns))) \ + $(($(hv "$tag-post" .seal.open_bytes) - $(hv "$tag-pre" .seal.open_bytes))) \ + $(($(hv "$tag-post" .seal.seal_ns) - $(hv "$tag-pre" .seal.seal_ns))) \ + $(($(hv "$tag-post" .seal.seal_bytes) - $(hv "$tag-pre" .seal.seal_bytes))) \ + "$(jq -c '.persistent_kv.restore_misses // {}' "$dir/snap/$tag-post-health.json")" >>"$dir/batches.tsv" +} + +mkdir -p "$dir/sse" "$dir/snap" +printf 'name\tok\thttp\tretries_503\tttft_s\tlatency_s\tcompletion_tokens\tprompt_tokens\tcontent_sha\n' >"$dir/requests.tsv" +printf 'mode\tconc\trep\twall_s\trestores\trestore_bytes\tproc_read_bytes\tproc_write_bytes\topen_ns\topen_bytes\tseal_ns\tseal_bytes\trestore_misses\n' >"$dir/batches.tsv" +{ + echo "reps $REPS max_tokens $MAXTOK rules $RULES budget_s $BUDGET levels $LEVELS" + echo "store parent $(findmnt -no SOURCE,FSTYPE -T /tmp)" +} >>"$dir/run-info.txt" +S="$work/store" +declare -a A1 + +echo "== seed: turn 1 of 8 conversations on store S" +start_server seed "$S" +start_samplers seed +for k in $(seq 1 8); do + send "seed-k$k" "$(msgs1 "$k")" + A1[k]=$(sed -n 's/^[0-9.]* data: //p' "$dir/sse/seed-k$k.sse" | grep -v '^\[DONE\]' | jq -rj '.choices[0].delta.content // empty') + printf '%s' "${A1[$k]}" >"$dir/seed-k$k.answer.txt" +done +wait_parks +health seed >/dev/null +stop_samplers +stop_server +prefix=$(awk -F'\t' '$1 == "seed-k1" {print $8}' "$dir/requests.tsv") +echo "turn-1 prompt tokens: $prefix (target ~2048)" +if [ "${prefix:-0}" -lt 1843 ] || [ "${prefix:-0}" -gt 2253 ]; then + echo "the prefix is $prefix tokens, not ~2048: set PKV_BENCH_RULES (now $RULES) and rerun" | tee "$dir/summary.txt" >&2 + pkv_seal + exit 1 +fi + +skipped=0 +for mode in $MODES; do + echo "== $mode" + if [ "$mode" = disabled ]; then start_server "$mode" -; else start_server "$mode" "$S"; fi + snap "$mode-start" + start_samplers "$mode" + for n in $LEVELS; do + for r in $(seq 1 "$REPS"); do + if [ "$SECONDS" -gt "$BUDGET" ]; then + echo "budget ${BUDGET} s spent: skipping $mode c$n r$r" + skipped=$((skipped + 1)) + continue + fi + batch "$mode" "$n" "$r" + done + done + health "$mode" >/dev/null + stop_samplers + stop_server +done + +pct() { #

on stdin numbers -> nearest rank + sort -g | awk -v p="$1" '{v[NR] = $1} END {if (NR == 0) {print "NA"; exit} i = int(p * NR + 0.9999); if (i < 1) i = 1; print v[i]}' +} +col() { # : values of requests in that cell + awk -F'\t' -v m="$1" -v c="$2" -v col="$3" '$1 ~ "^" m "-c" c "-r[0-9]+-k[0-9]+$" && $5 != "NA" {print $col}' "$dir/requests.tsv" +} +peak() { awk '$2 != "" && $2 + 0 > m {m = $2 + 0} END {print m + 0}' "$1" 2>/dev/null || echo 0; } + +{ + echo "PKV BENCH (#508) $(date -u +%FT%TZ) binary $(sha256sum "$BIN" | cut -c1-16) prefix $prefix tokens max_tokens $MAXTOK reps $REPS" + echo "latency and TTFT in seconds from the first attempt (queue included); tok/s = completion tokens / batch wall time" + printf '%-8s %4s %3s %4s %8s %8s %8s %8s %7s %6s %7s %10s %10s %9s %9s\n' mode conc n fail lat_p50 lat_p95 ttft_p50 ttft_p95 tok_s retry restores restore_MB block_rd_MB open_ms seal_ms + for mode in $MODES; do + for n in $LEVELS; do + cnt=$(col "$mode" "$n" 1 | wc -l) + fails=$(awk -F'\t' -v m="$mode" -v c="$n" '$1 ~ "^" m "-c" c "-r[0-9]+-k[0-9]+$" && $2 != "ok"' "$dir/requests.tsv" | wc -l) + read -r wall toks retr <<<"$(awk -F'\t' -v m="$mode" -v c="$n" ' + FILENAME ~ /batches/ && $1 == m && $2 == c {w += $4} + FILENAME ~ /requests/ && $1 ~ "^" m "-c" c "-r[0-9]+-k[0-9]+$" {t += $7; r += $4} + END {print w + 0, t + 0, r + 0}' "$dir/batches.tsv" "$dir/requests.tsv")" + read -r rs rb rd on sn <<<"$(awk -F'\t' -v m="$mode" -v c="$n" '$1 == m && $2 == c {a += $5; b += $6; d += $7; o += $9; s += $11} END {print a + 0, b + 0, d + 0, o + 0, s + 0}' "$dir/batches.tsv")" + printf '%-8s %4s %3s %4s %8s %8s %8s %8s %7s %6s %7s %10.1f %10.1f %9.1f %9.1f\n' "$mode" "$n" "$cnt" "$fails" \ + "$(col "$mode" "$n" 6 | pct 0.50)" "$(col "$mode" "$n" 6 | pct 0.95)" \ + "$(col "$mode" "$n" 5 | pct 0.50)" "$(col "$mode" "$n" 5 | pct 0.95)" \ + "$(awk -v t="$toks" -v w="$wall" 'BEGIN {printf "%.1f", (w > 0) ? t / w : 0}')" "$retr" "$rs" \ + "$(awk -v b="$rb" 'BEGIN {print b / 1048576}')" "$(awk -v b="$rd" 'BEGIN {print b / 1048576}')" \ + "$(awk -v b="$on" 'BEGIN {print b / 1e6}')" "$(awk -v b="$sn" 'BEGIN {print b / 1e6}')" + done + done + for mode in seed $MODES; do + echo "memory $mode: RSS peak $(($(peak "$dir/rss-$mode.txt") / 1024)) MiB, GPU (nvidia-smi compute-apps) peak $(peak "$dir/gpu-$mode.txt") MiB" + done + for mode in $MODES; do + echo "server prefill $mode (long prompts): p50 $(grep -ho 'prompt [0-9]* tok, [0-9]* reused from the previous turn, prefill [0-9]* ms' "$dir/$mode.log" | awk '$2 > 1000 {print $(NF - 1)}' | pct 0.50) ms" + done + echo "seed health: $(jq -c '.persistent_kv | {parked_chunks, park_bytes, park_failed, seal}' "$dir/seed-health.json")" + echo "CHECKS" + check "every request answered (http 200, content, usage)" "$(awk -F'\t' 'NR > 1 && $2 != "ok"' "$dir/requests.tsv" | wc -l)" 0 + check "no batch skipped by the budget" "$skipped" 0 + check "disabled: no persistent_kv in health" "$(jq -r 'has("persistent_kv")' "$dir/disabled-health.json")" false + for mode in warm cold; do + check "$mode: every request restored" "$(awk -F'\t' -v m="$mode" '$1 == m && $5 != $2' "$dir/batches.tsv" | wc -l)" 0 + check "$mode: no park failed" "$(jq -r '.persistent_kv.park_failed' "$dir/$mode-health.json")" 0 + done + check "warm: restores read from the page cache (block reads < 10% of restore bytes)" \ + "$(awk -F'\t' '$1 == "warm" && $7 * 10 >= $6 && $6 > 0' "$dir/batches.tsv" | wc -l)" 0 + check "cold: VERIFIED cold, block reads >= 90% of restore bytes in every batch" \ + "$(awk -F'\t' '$1 == "cold" && !($6 > 0 && $7 * 10 >= $6 * 9)' "$dir/batches.tsv" | wc -l)" 0 + check "answers identical across disabled/warm/cold" "$(awk -F'\t' '$1 ~ /-k[0-9]+$/ && $1 !~ /^seed/ { + split($1, p, "-"); key = p[2] "-" p[3] "-" p[4]; if (key in s && s[key] != $9) bad++; s[key] = $9 } END {print bad + 0}' "$dir/requests.tsv")" 0 + [ $fail = 0 ] && echo "PKV BENCH: COMPLETE" || echo "PKV BENCH: INCOMPLETE (see FAIL lines)" +} | tee "$dir/summary.txt" +grep -q "PKV BENCH: COMPLETE" "$dir/summary.txt" || fail=1 +stop_samplers +if [ -n "$IOSTAT" ]; then kill "$IOSTAT" 2>/dev/null || true; fi +IOSTAT= +pkv_seal +exit $fail diff --git a/scripts/own30b-pkv-chip-check.sh b/scripts/own30b-pkv-chip-check.sh new file mode 100755 index 00000000..5ed350d6 --- /dev/null +++ b/scripts/own30b-pkv-chip-check.sh @@ -0,0 +1,199 @@ +#!/usr/bin/env bash +# Persistent KV acceptance check on the chip (sc#505/#507, locked by #499). CHIP-ONLY: never run +# by CI or cargo test. It starts its OWN servers on 127.0.0.1:18098 (PKV_CHECK_PORT; never +# touches :18091, the live server, or its PID/log files) and loads the 30B checkpoint each time +# (~30.5 GB resident, about 18 s load plus the checkpoint digest when persistence is on). +# +# scripts/own30b-pkv-chip-check.sh [--dry-run] +# +# --dry-run prints the plan and checks the prerequisites; it starts no server. +# The binary must be a native release build of this branch from a clean checkout (dirty or +# unknown builds refuse persistence by design), e.g. +# AIEN_OMEGA_DIR= cargo build --release -p aien-serve-http +# +# Key: atlas-vault entry AIEN_KV_STORE_KEY by default; PKV_CHECK_EPHEMERAL_KEY=1 makes a +# throwaway key (never printed or saved). Stores are private temp dirs. Refuses while :18091 +# answers. Helpers and rules: scripts/own30b-pkv-lib.sh. +# +# Phases (same greedy two-turn conversation, temperature 0, seed 1): +# off persistence off, one server kept running -> T_off, T2b_off (other turn 2), A_off (other chat) +# on persistence on (fresh store), one server running -> turn2 = T_on +# park persistence on (fresh store S): turn 1, wait for the parks, stop +# restore restart on S: turn 2 must restore (restores == 1) -> T_restored +# neg-switch restart on S with --prefill-device-host off: restores == 0 (another identity) +# torn fresh store W, AIEN_KV_TEST_FAULT=p3:600000 (every park stalls before its publish +# rename): turn 1, wait for a temp file, kill -9, cut every temp file in half, restart +# plain on W: nothing published, recovery removes the temps, turn 2 == T_off, restores 0 +# late-load fresh store L parked normally; restart with AIEN_KV_TEST_FAULT=load:15000:1 (the +# first restore read stalls past the 10 s load timeout): turn 2 == T_off with +# restores 0 and one timeout miss; after the late completion lands restores is still +# 0 and another chat == A_off; restart plain on L: turn 2 restores 1 and == T_off +# late-park fresh store P, AIEN_KV_TEST_FAULT=p3:20000:1 (the first park stalls 20 s): turn 1, +# turn 2 and another turn 2 run while it is in flight (== T_off, == T2b_off); parks +# settle with none failed; restart plain on P: turn 2 restores 1 and == T_off +# neg-corrupt flip one byte in every stored object of S, restart: restores == 0, still answers +# PASS when every answer equals its uninterrupted twin and every negative control restores nothing. +# Not covered: a conversation "deleted" before its park lands; the server has no delete API, and +# chunks are content addressed, so a late park can only serve the exact same token prefix. +# Rough duration: 13 server starts, 14 to 20 minutes. +set -euo pipefail +. "$(dirname "$0")/own30b-pkv-lib.sh" +pkv_usage_args "$(basename "$0")" "$@" + +if [ $DRY = 1 ]; then + echo "PLAN own30b-pkv-chip-check (#507): off, on, park, restore, neg-switch, torn (kill -9 mid-write)," + echo " late-load (restore past its timeout), late-park (park lands after the chat moved on), neg-corrupt" + echo " 13 server starts on :$PORT, estimate 14 to 20 minutes; evidence -> $dir" + echo "PREREQUISITES" + if pkv_prereqs 1; then echo "DRY RUN: ready"; exit 0; fi + echo "DRY RUN: NOT ready" + exit 1 +fi +pkv_begin + +Q2B="Which of those is least useful at home?" +QA="Explain in two sentences what a bearing preload is." +mA=$(jq -n --arg s "$SYS" --arg q "$QA" '[{role:"system",content:$s},{role:"user",content:$q}]') + +echo "== off: persistence off, uninterrupted" +start_server off - +a1_off=$(chat off-turn1 "$m1") +t_off=$(chat off-turn2 "$(turn2_msgs "$a1_off")") +t2b_off=$(chat off-turn2b "$(turn2_msgs "$a1_off" "$Q2B")") +aA_off=$(chat off-other "$mA") +health off >/dev/null +stop_server + +echo "== on: persistence on, uninterrupted" +start_server on "$work/store-on" +a1_on=$(chat on-turn1 "$m1") +t_on=$(chat on-turn2 "$(turn2_msgs "$a1_on")") +health on >/dev/null +stop_server + +echo "== park: turn 1, wait for the parks, stop" +S="$work/store" +start_server park "$S" +a1=$(chat park-turn1 "$m1") +wait_parks +health park >/dev/null +stop_server + +echo "== restore: restart on the same store, turn 2" +start_server restore "$S" +t_restored=$(chat restore-turn2 "$(turn2_msgs "$a1")") +health restore >/dev/null +stop_server + +echo "== neg-switch: restart with another prefill switch (another identity)" +start_server neg-switch "$S" --prefill-device-host off +chat neg-switch-turn2 "$(turn2_msgs "$a1")" >/dev/null +health neg-switch >/dev/null +stop_server + +wait_store_open() { # : until store_state is open (recovery done) + for _ in $(seq 1 120); do + [ "$(curl -s -m 5 "$base/health" | jq -r '.persistent_kv.store_state')" = open ] && return 0 + sleep 1 + done + echo "store did not open after recovery ($1)" >&2 + exit 1 +} + +echo "== torn: kill -9 while every park is stalled before its publish rename" +W="$work/store-torn" +PKV_SERVER_ENV="AIEN_KV_TEST_FAULT=p3:600000" start_server torn-a "$W" +a1_torn=$(chat torn-turn1 "$m1") +for _ in $(seq 1 120); do + [ -n "$(find "$W/tmp" -type f 2>/dev/null | head -1)" ] && break + sleep 0.5 +done +health torn-a >/dev/null +kill9_server +find "$W" -type f -printf '%P %s\n' | sort >"$dir/torn-files-at-kill.txt" +torn_tmp=$(find "$W/tmp" -type f | wc -l) +torn_obj=$(find "$W/objects" -type f | wc -l) +find "$W/tmp" -type f | while read -r f; do truncate -s $(($(stat -c %s "$f") / 2)) "$f"; done +start_server torn-b "$W" +wait_store_open torn-b +torn_tmp_after=$(find "$W/tmp" -type f | wc -l) +t_torn=$(chat torn-turn2 "$(turn2_msgs "$a1_torn")") +health torn-b >/dev/null +stop_server + +echo "== late-load: the first restore read stalls past the load timeout" +L="$work/store-late-load" +start_server late-load-park "$L" +a1_ll=$(chat late-load-turn1 "$m1") +wait_parks +stop_server +PKV_SERVER_ENV="AIEN_KV_TEST_FAULT=load:15000:1" start_server late-load-a "$L" +wait_store_open late-load-a +t_ll=$(chat late-load-turn2 "$(turn2_msgs "$a1_ll")") +health late-load-a1 >/dev/null +sleep 8 # the stalled read completes about 5 s after the 10 s timeout +aA_ll=$(chat late-load-other "$mA") +health late-load-a2 >/dev/null +stop_server +start_server late-load-b "$L" +t_ll_b=$(chat late-load-b-turn2 "$(turn2_msgs "$a1_ll")") +health late-load-b >/dev/null +stop_server + +echo "== late-park: the first park stalls 20 s while the chat moves on" +P="$work/store-late-park" +PKV_SERVER_ENV="AIEN_KV_TEST_FAULT=p3:20000:1" start_server late-park-a "$P" +a1_lp=$(chat late-park-turn1 "$m1") +health late-park-inflight >/dev/null +t_lp=$(chat late-park-turn2 "$(turn2_msgs "$a1_lp")") +t2b_lp=$(chat late-park-turn2b "$(turn2_msgs "$a1_lp" "$Q2B")") +wait_parks +health late-park-a >/dev/null +stop_server +start_server late-park-b "$P" +t_lp_b=$(chat late-park-b-turn2 "$(turn2_msgs "$a1_lp")") +health late-park-b >/dev/null +stop_server + +echo "== neg-corrupt: flip one byte in every stored object, restart" +find "$S/objects" -type f | while read -r f; do flip_byte "$f"; done +start_server neg-corrupt "$S" +chat neg-corrupt-turn2 "$(turn2_msgs "$a1")" >/dev/null +health neg-corrupt >/dev/null +stop_server + +{ + check "turn 1 identical off/on/park/torn/late" "$a1_off|$a1_on|$a1_torn|$a1_ll|$a1_lp" "$a1|$a1|$a1|$a1|$a1" + check "T_on == T_off (persistence changes no token)" "$t_on" "$t_off" + check "T_restored == T_off (restored = uninterrupted)" "$t_restored" "$t_off" + check "restore served once" "$(pk restore restores)" 1 + check "park refused no chunk (whole turn 1 parked)" "$(pk park park_refused)" 0 + p1=$(jq -r .usage.prompt_tokens "$dir/park-turn1.json") + check "restore covered at least the turn-1 prompt ($p1 tokens)" "$([ "$(pk restore restored_tokens)" -ge "$p1" ] && echo yes)" yes + check "neg-switch restores nothing" "$(pk neg-switch restores)" 0 + check "torn: a temp file was in flight at the kill" "$([ "$torn_tmp" -gt 0 ] && echo yes || echo "no ($torn_tmp)")" yes + check "torn: nothing was published before the kill" "$torn_obj" 0 + check "torn: recovery removed every temp file" "$torn_tmp_after" 0 + check "torn: health counts the removed temps" "$(jq -r '.persistent_kv.recovery.tmp_deleted >= 1' "$dir/torn-b-health.json")" true + check "torn: restores nothing" "$(pk torn-b restores)" 0 + check "torn: T == T_off" "$t_torn" "$t_off" + check "late-load: timed out once" "$(jq -r '.persistent_kv.restore_misses.timeout // 0' "$dir/late-load-a1-health.json")" 1 + check "late-load: restores nothing" "$(pk late-load-a1 restores)" 0 + check "late-load: T == T_off" "$t_ll" "$t_off" + check "late-load: the late completion is never served" "$(pk late-load-a2 restores)" 0 + check "late-load: another chat == A_off" "$aA_ll" "$aA_off" + check "late-load: the store still restores after" "$(pk late-load-b restores)" 1 + check "late-load: restored T == T_off" "$t_ll_b" "$t_off" + check "late-park: the park was in flight during turn 2" "$([ "$(pk late-park-inflight parked_chunks)" -eq 0 ] && echo yes || echo no)" yes + check "late-park: T == T_off" "$t_lp" "$t_off" + check "late-park: other turn 2 == T2b_off" "$t2b_lp" "$t2b_off" + check "late-park: no park failed" "$(pk late-park-a park_failed)" 0 + check "late-park: restores once after restart" "$(pk late-park-b restores)" 1 + check "late-park: restored T == T_off" "$t_lp_b" "$t_off" + check "neg-corrupt restores nothing" "$(pk neg-corrupt restores)" 0 + check "off health has no persistent_kv" "$(jq -r 'has("persistent_kv")' "$dir/off-health.json")" false + [ $fail = 0 ] && echo "PKV CHIP CHECK: PASS" || echo "PKV CHIP CHECK: FAIL" +} | tee "$dir/summary.txt" +grep -q "PKV CHIP CHECK: PASS" "$dir/summary.txt" || fail=1 +pkv_seal +exit $fail diff --git a/scripts/own30b-pkv-lib.sh b/scripts/own30b-pkv-lib.sh new file mode 100644 index 00000000..b0413fbb --- /dev/null +++ b/scripts/own30b-pkv-lib.sh @@ -0,0 +1,250 @@ +# Shared helpers of the persistent KV chip scripts (sc#507 #508 #509). Sourced, never run. +# CHIP-ONLY callers: own30b-pkv-chip-check.sh, own30b-pkv-bench.sh, own30b-pkv-ops-check.sh. +# +# Rules every caller inherits: +# - refuses while the live server on :18091 answers (no override: two omega processes on +# the chip at once is UNKNOWN territory), and refuses an occupied port (PKV_CHECK_PORT, +# default 18098; never 18091, 18092, 18095 or 18097, which belong to other services); +# - starts its own aien-serve-http only on 127.0.0.1:$PORT, stops only the PID it started; +# - key: atlas-vault entry AIEN_KV_STORE_KEY by default (`atlas-vault run AIEN_KV_STORE_KEY +# --`, the key never passes through this shell), or PKV_CHECK_EPHEMERAL_KEY=1 for a +# throwaway key held only in this shell and the child's environment; never printed or saved; +# - evidence: raw files in the evidence dir, a summary, SHA256SUMS over every file. +# shellcheck shell=bash disable=SC2034 # DRY, fail, SERVER_JOB, ... are read by the callers + +PKV_LIVE_PORT=18091 +MODEL=${OWN30B_MODEL_DIR:-$HOME/models/qwen3-30b-a3b-instruct-2507-fp8} +PORT=${PKV_CHECK_PORT:-18098} +PKV_RESERVED_PORTS="18091 18092 18095 18097" # live 30B, spark-mail, spark-cockpit, Qwen3-8B MAX +pkv_port_reserved() { case " $PKV_RESERVED_PORTS " in *" $1 "*) return 0 ;; esac; return 1; } +base="http://127.0.0.1:$PORT" +DRY=0 +SERVER_JOB= + +pkv_usage_args() { #