Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-sovereign-core-mv/patches/8e5068350193962a # aien-sovereign-core-mv AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers ## GitHub aien-dev/aien-sovereign-core-mv#863 (code only) closed derived `8e5068350193962a` #863 Imported from GitHub aien-dev/aien-sovereign-core-mv#863 (code only) GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed). Base `4c86d43a7142c8b2f55324140537213b2b64742a` · Head `902666fc3cbaa6f3acc99d7e9c8abd4986f15eea` ### Fetch it A git bundle of the pull request's head, 140223 bytes. ``` curl -fsSL https://interplane.io/drakestapleton/aien-sovereign-core-mv/patches/8e5068350193962a.bundle -o 8e5068350193962a.bundle git fetch 8e5068350193962a.bundle refs/pull/863/head ``` Raw bundle · Diff ### Provenance This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record: ``` github-import 1 aien-dev/aien-sovereign-core-mv 863 902666fc3cbaa6f3acc99d7e9c8abd4986f15eea ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"aien-sovereign-core-mv","number":863,"url":"https://github.com/aien-dev/aien-sovereign-core-mv/pull/863","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:38:09Z","metadata":"unavailable","state_derived":true} ``` ### Changes ``` diff --git a/crates/aien-inference-abi/src/qwen38_omega.rs b/crates/aien-inference-abi/src/qwen38_omega.rs index 28ee17d8..e4b67b3a 100644 --- a/crates/aien-inference-abi/src/qwen38_omega.rs +++ b/crates/aien-inference-abi/src/qwen38_omega.rs @@ -47,7 +47,7 @@ mod moe; pub use moe::router_probe; mod prefill; mod rows; -pub use rows::{RowFeed, RowOut, RowTest}; +pub use rows::{timeline_now_ns, RowFeed, RowOut, RowTest, RowTimeline}; mod session; pub use prefill::PrefillStats; pub use session::{plan_reuse, FeedStats, Qwen38Session, Reuse, IM_START}; @@ -183,6 +183,9 @@ pub struct Qwen38Omega { row_src: Option, /// Multi-row steps so far (the row-swap negative control counts them). row_steps: u64, + /// Chip stamps and host clock marks on every row's one-row graph ([`Self::set_row_stamps`], + /// the decode timeline). Off by default. + row_stamps: bool, } impl std::fmt::Debug for Qwen38Omega { @@ -709,6 +712,7 @@ impl Qwen38Omega { rows: Vec::new(), row_src: None, row_steps: 0, + row_stamps: false, }) } diff --git a/crates/aien-inference-abi/src/qwen38_omega/moe.rs b/crates/aien-inference-abi/src/qwen38_omega/moe.rs index 932b197e..62426911 100644 --- a/crates/aien-inference-abi/src/qwen38_omega/moe.rs +++ b/crates/aien-inference-abi/src/qwen38_omega/moe.rs @@ -507,6 +507,7 @@ impl Qwen38Omega { rows: Vec::new(), row_src: Some(row_src), row_steps: 0, + row_stamps: false, }) } } diff --git a/crates/aien-inference-abi/src/qwen38_omega/rows.rs b/crates/aien-inference-abi/src/qwen38_omega/rows.rs index 3ce90561..a3169052 100644 --- a/crates/aien-inference-abi/src/qwen38_omega/rows.rs +++ b/crates/aien-inference-abi/src/qwen38_omega/rows.rs @@ -52,6 +52,30 @@ pub(super) struct Q36Row { attn: Option, pos: usize, max_pos: usize, + /// [`timeline_now_ns`] marks of the last one-row token while row stamps are on: entry, before + /// the graph call, after it, return. + host: [u64; 4], +} + +/// Row `r`'s last one-row token as the decode timeline reads it ([`Qwen38Omega::row_timeline`]). +#[derive(Debug, Clone, Default, PartialEq, Eq)] +pub struct RowTimeline { + /// Host marks ([`timeline_now_ns`]): `row_token` entry, before the graph call (after the + /// embedding row is widened), after the graph call, return (after any logits read). + pub host: [u64; 4], + /// `launches + 1` chip timestamps (ns, the GPU's PTIMER, its own clock): launch `i` ran from + /// `stamps[i]` to `stamps[i + 1]` (each stamp taken after the launch's WAIT_FOR_IDLE). + pub stamps: Vec, + /// One kind name per launch (`omega_gpu_q36_graph_kind_name`), in launch order. + pub kinds: Vec, +} + +/// The decode timeline's host clock: nanoseconds since the first call in this process (a +/// monotonic `Instant`; the scheduler and `row_token` read the same one). +pub fn timeline_now_ns() -> u64 { + static EPOCH: std::sync::LazyLock = + std::sync::LazyLock::new(std::time::Instant::now); + EPOCH.elapsed().as_nanos() as u64 } /// One row's share of a [`Qwen38Omega::step_rows`] call. @@ -174,12 +198,16 @@ impl Qwen38Omega { let mut graph = unsafe { Q36Graph::create(&cfg) }.map_err(gpu("row q36 graph create"))?; self.wire(&mut graph)?; + if self.row_stamps { + graph.set_stamps(true); + } self.rows.push(Q36Row { graph, gdn, attn, pos: 0, max_pos, + host: [0; 4], }); } // The strokes' graph (L312): MAX_HEADS head slots, pointed at each chunk's rows per step. @@ -570,6 +598,8 @@ impl Qwen38Omega { /// [`Self::row_token`]; `exact_head` false keeps the plain head for this token (the merge /// train's `exact_head: false` arm; the words must not change). fn row_token_with_head(&mut self, f: &RowFeed, exact_head: bool) -> Result { + let marks = self.row_stamps; + let h0 = if marks { timeline_now_ns() } else { 0 }; let (v, h) = (self.config.vocab, self.config.hidden); let t = f.token as usize; let x: Vec = self.embed[t * h..(t + 1) * h] @@ -584,7 +614,9 @@ impl Qwen38Omega { )); } row.graph.set_exact_head_on(exact_head && !f.logits); + let h1 = if marks { timeline_now_ns() } else { 0 }; let (token, stats) = row.graph.token(&x, row.pos).map_err(gpu("row q36 token"))?; + let h2 = if marks { timeline_now_ns() } else { 0 }; row.pos += 1; let logits = if f.logits { let mut l = vec![0f32; v]; @@ -595,6 +627,9 @@ impl Qwen38Omega { } else { None }; + if marks { + row.host = [h0, h1, h2, timeline_now_ns()]; + } Ok(RowOut { token, logits, @@ -603,6 +638,38 @@ impl Qwen38Omega { } } +impl Qwen38Omega { + /// The decode timeline (`AIEN_Q36_DECODE_TIMELINE`): chip stamps around every launch of each + /// row's one-row graph (rows made later too) and four host marks per one-row token, read by + /// [`Self::row_timeline`]. Off by default. The stamps add a timestamp report per launch, so a + /// speed receipt never runs with them on. + pub fn set_row_stamps(&mut self, on: bool) { + self.row_stamps = on; + for row in &mut self.rows { + row.graph.set_stamps(on); + } + } + + /// Row `r`'s last one-row token: its host marks, chip stamps and launch kinds. Refused when + /// row stamps are off. A stroke or a prefill does not refresh it, so read it right after a + /// step that fed this row alone (the door's timeline does; its checker goes red on stale marks). + pub fn row_timeline(&self, r: usize) -> Result { + if !self.row_stamps { + return Err("row_timeline: row stamps are off".into()); + } + let row = self + .rows + .get(r) + .ok_or_else(|| format!("row_timeline: row {r} of {}", self.rows.len()))?; + let (stamps, kinds) = row.graph.stamps().map_err(gpu("row_timeline stamps"))?; + Ok(RowTimeline { + host: row.host, + stamps, + kinds: kinds.into_iter().map(q::kind_name).collect(), + }) + } +} + impl Qwen38Omega { /// L369: `tokens` (a prompt chunk, at most [`q::PREFILL_MAX_ROWS`]) into row `r` at its next /// positions through the chip's prefill: the state ends bit for bit as `tokens.len()` steps of diff --git a/crates/aien-omega-q38/src/q36.rs b/crates/aien-omega-q38/src/q36.rs index b7b281b0..a0f2748d 100644 --- a/crates/aien-omega-q38/src/q36.rs +++ b/crates/aien-omega-q38/src/q36.rs @@ -805,8 +805,10 @@ impl Q36Graph { pub fn stamps(&self) -> Result<(Vec, Vec), OmegaGpuError> { #[cfg(has_omega_q36)] { - // 11 per layer + 4, with room to spare. - let cap = (self.layers * 16 + 16) as u32; + // The most launches one command list carries (OMEGA_GPU_CMDLIST_MAX_LAUNCHES): a token's + // count grows with the head and expert forms (the exact head alone adds 8), so no + // per-layer guess. + let cap = 4096u32; let mut stamps = vec![0u64; cap as usize + 1]; let mut kinds = vec![0u8; cap as usize + 1]; // SAFETY: ptr is live; both buffers hold cap + 1 entries. diff --git a/crates/aien-serve-http/src/cpu_engine.rs b/crates/aien-serve-http/src/cpu_engine.rs index d6f35806..09279208 100644 --- a/crates/aien-serve-http/src/cpu_engine.rs +++ b/crates/aien-serve-http/src/cpu_engine.rs @@ -25,7 +25,9 @@ use aien_inference_abi::qwen3_coder::{ compute_logits, forward_token, load_qwen3_coder, Qwen3CoderState, Qwen3CoderWeights, }; -use crate::engine::{Engine, EngineError, FinishReason, GenerateOutcome, GenerateParams}; +use crate::engine::{ + Engine, EngineError, FinishReason, GenerateOutcome, GenerateParams, ReplyClock, +}; use crate::sampling::SamplingObserver; pub struct CpuReferenceEngine { @@ -72,6 +74,7 @@ impl Engine for CpuReferenceEngine { } let mut state = Qwen3CoderState::new(); let t0 = Instant::now(); + let mut clock = ReplyClock::new(t0); let mut hidden = Vec::new(); for (pos, &tok) in prompt.iter().enumerate() { hidden = forward_token(&self.weights, tok, pos, &mut state); @@ -92,6 +95,7 @@ impl Engine for CpuReferenceEngine { break FinishReason::Stop; } emitted += 1; + clock.emitted(Instant::now()); if !on_token(next) { break FinishReason::Cancelled; } @@ -101,12 +105,13 @@ impl Engine for CpuReferenceEngine { hidden = forward_token(&self.weights, next, pos, &mut state); pos += 1; }; - Ok(GenerateOutcome { - emitted_tokens: emitted, + Ok(GenerateOutcome::timed( + emitted, finish, prefill_ms, - decode_ms: t1.elapsed().as_millis() as u64, - sampling: Some(sampler.record()), - }) + t1.elapsed().as_millis() as u64, + Some(sampler.record()), + clock.times(), + )) } } diff --git a/crates/aien-serve-http/src/decode_timeline.rs b/crates/aien-serve-http/src/decode_timeline.rs new file mode 100644 index 00000000..b18219ee --- /dev/null +++ b/crates/aien-serve-http/src/decode_timeline.rs @@ -0,0 +1,1266 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2026 Drake Stapleton (AIEN / aien-dev) + +//! The 35B one-row decode timeline: where one single-row decode beat of the batch door spends its +//! time, on the host and on the chip. +//! +//! `AIEN_Q36_DECODE_TIMELINE=` turns it on. When unset the door records nothing, +//! reads no extra clock and leaves the chip stamps off. When set, every row's one-row graph runs +//! with its per-launch chip stamps, and each beat that steps exactly one decoding row (no prompt +//! chunk, no other row) appends one JSON line, schema [`SCHEMA`]: +//! +//! - `host`: [`HOST_PHASES`] in order, contiguous, on [`timeline_now_ns`]. Each beat runs from its +//! join to the next beat's join, or to the idle point when nobody is left. +//! `graph_record` and `graph_submit_wait` come from the graph's own `record_ns` / `total_ns` +//! (the list build, then submit + chip + completion wait + readback). +//! - `dev`: one span per launch, contiguous, on the chip's PTIMER. That is a different clock, so +//! only durations are compared with host spans and never instants. +//! +//! [`check`] holds a file to that shape, and `aien-serve-http --check-decode-timeline` runs it and prints a +//! Wolfram-ready summary. Each stamp sits after a launch's wait-for-idle and adds a timestamp +//! report, so the stamps cost chip time: a timeline run is never a speed receipt. +//! +//! DRA-66, the per-token receipt: `AIEN_Q36_DECODE_TIMELINE_KIND=token` (default `launch`, the +//! above) writes one [`TokenRecord`] (schema [`TOKEN_SCHEMA`]) per beat that fed at least one +//! decoding row, at any number of conversations, with the chip stamps OFF (a speed receipt): +//! the beat's period on the host clock (`total_ns`, join to the next join or idle), the chip time +//! of every step in it (`chip_ns`, prefill chunks included) and the host's share +//! `host_overhead_ns = total_ns - chip_ns`. `prompt_rows > 0` marks a beat a joining prompt rode +//! in. [`check_tokens`] holds such a file to its shape; the same `--check-decode-timeline` CLI +//! dispatches on the schema. +//! +//! `chip_ns` is the graph's host-clock span from the first submit to the last completion marker +//! read back, so it also holds host work: the queue submit and the marker poll. The per-token +//! `host_overhead_ns` is therefore a LOWER bound of the host time. The DRA-66 gate +//! ([`GATE_WL`]) adds the submit + poll share `chip_ns - dev_span`, measured on a stamped +//! one-conversation launch timeline of the same window, to that lower bound. +use std::fs::File; +use std::io::{BufWriter, Write}; +use std::path::{Path, PathBuf}; + +use aien_inference_abi::qwen38_omega::RowTimeline; +use aien_omega_q38::GraphStats; +use serde::{Deserialize, Serialize}; + +pub use aien_inference_abi::qwen38_omega::timeline_now_ns; + +/// The switch: a path to append the timeline to. Unset: off. +pub const ENV: &str = "AIEN_Q36_DECODE_TIMELINE"; +/// What the switched-on door records: `launch` (default, [`Record`]) or `token` ([`TokenRecord`]). +pub const KIND_ENV: &str = "AIEN_Q36_DECODE_TIMELINE_KIND"; +/// The record schema. +pub const SCHEMA: &str = "aien.q36-decode-timeline/1"; +/// The per-token receipt's schema. +pub const TOKEN_SCHEMA: &str = "aien.q36-token-receipt/1"; + +/// Which records a switched-on door writes. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum Kind { + /// One stamped single-row decode beat per [`Record`] (chip stamps on: not a speed run). + Launch, + /// One [`TokenRecord`] per decoding beat, stamps off. + Token, +} + +impl Kind { + /// [`KIND_ENV`]: unset or `launch` is [`Kind::Launch`], `token` is [`Kind::Token`]. + pub fn from_env() -> Result { + match std::env::var(KIND_ENV).as_deref() { + Err(_) | Ok("") | Ok("launch") => Ok(Self::Launch), + Ok("token") => Ok(Self::Token), + Ok(v) => Err(format!("{KIND_ENV}={v}: launch | token")), + } + } +} + +/// One decoding beat's sums, handed to [`Recorder::beat`] at the end of the beat. +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)] +pub struct BeatSums { + pub beat: u64, + /// Decoding rows fed (tokens this beat produced for conversations past their prompt). + pub rows: u64, + /// Rows that fed prompt tokens this beat (chunks or single tokens). + pub prompt_rows: u64, + /// `step_rows` and `prefill_row` calls. + pub steps: u64, + /// The `step_rows` calls' graph stats, summed over every row's out. + pub launches: u64, + pub submits: u64, + pub graph_ns: u64, + pub record_ns: u64, + pub step_chip_ns: u64, + /// Host wall of every step call (prefill chunks included). + pub step_ns: u64, + /// Chip time of every step (prefill chunks included). + pub chip_ns: u64, +} + +/// One decoding beat of the per-token receipt (`total_ns`, `step_ns`, `graph_ns`, `t0`, `t1` on +/// the host clock; `chip_ns` the graphs' submit-to-marker spans, also measured on the host). +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] +pub struct TokenRecord { + pub schema: String, + pub seq: u64, + pub beat: u64, + pub rows: u64, + pub prompt_rows: u64, + pub steps: u64, + pub launches: u64, + pub submits: u64, + pub t0: u64, + pub t1: u64, + pub total_ns: u64, + pub step_ns: u64, + pub graph_ns: u64, + pub record_ns: u64, + pub step_chip_ns: u64, + pub chip_ns: u64, + pub host_overhead_ns: u64, +} + +/// The host phases of one beat, in order. +pub const HOST_PHASES: [&str; 11] = [ + "sched_join", + "sample", + "sched_feed", + "step_enter", + "embed", + "graph_record", + "graph_submit_wait", + "graph_exit", + "logits_read", + "step_return", + "sched_post", +]; +/// The device categories [`categories`] assigns, in summary order. They are the groups of +/// docs/speed/Q36_CEILING.md section 10, with the exact head split into its screen and its +/// recheck and the greedy pick taken out of the glue. +pub const DEV_CATEGORIES: [&str; 10] = [ + "experts", + "gdn", + "attention", + "router", + "head_screen", + "head_recheck", + "head_plain", + "token_pick", + "glue", + "unknown", +]; + +/// One span: `name` from `t0` to `t1` (ns). +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] +pub struct Span { + pub name: String, + pub t0: u64, + pub t1: u64, +} + +/// One single-row decode beat. +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] +pub struct Record { + pub schema: String, + /// Records written by this door before this one: a missing or repeated record breaks the run. + pub seq: u64, + /// The door's beat number. + pub beat: u64, + /// The row stepped. + pub row: usize, + /// That conversation's decode steps before this one. + pub step: u64, + /// The graph's stats for the token. + pub launches: u32, + /// Submissions of the token's list (1 normally; 0 in a file written before this field). + #[serde(default)] + pub submits: u32, + /// Host clock, the first submit to the last completion marker read back: the chip's work plus + /// the submit and the marker poll around it. + pub chip_ns: u64, + pub record_ns: u64, + pub total_ns: u64, + pub host: Vec, + pub dev: Vec, +} + +fn span(name: &str, t0: u64, t1: u64) -> Span { + Span { + name: name.into(), + t0, + t1, + } +} + +/// The open part of a beat's record: every host span up to `step_return`. `sched_post` closes it +/// at the next beat's join or at idle. +fn open_record( + marks: [u64; 3], + beat: u64, + row: usize, + step: u64, + call: (u64, u64), + stats: &GraphStats, + tl: &RowTimeline, +) -> Record { + let [join, sample, feed] = marks; + let [h0, h1, h2, h3] = tl.host; + let rec_end = h1 + stats.record_ns; + let wait_end = h1 + stats.total_ns; + let host = vec![ + span("sched_join", join, sample), + span("sample", sample, feed), + span("sched_feed", feed, call.0), + span("step_enter", call.0, h0), + span("embed", h0, h1), + span("graph_record", h1, rec_end), + span("graph_submit_wait", rec_end, wait_end), + span("graph_exit", wait_end, h2), + span("logits_read", h2, h3), + span("step_return", h3, call.1), + ]; + let dev = tl + .kinds + .iter() + .enumerate() + .map(|(i, k)| span(k, tl.stamps[i], tl.stamps[i + 1])) + .collect(); + Record { + schema: SCHEMA.into(), + seq: 0, + beat, + row, + step, + launches: stats.launches, + submits: stats.submits, + chip_ns: stats.chip_ns, + record_ns: stats.record_ns, + total_ns: stats.total_ns, + host, + dev, + } +} + +/// The batch door's timeline writer (one per door, held only while [`ENV`] is set). +pub struct Recorder { + path: PathBuf, + kind: Kind, + out: Option>, + /// join, sample, feed marks of the current beat. + marks: [u64; 3], + pending: Option, + pending_beat: Option, + written: u64, + failed: u64, + reported: (u64, u64), +} + +impl Recorder { + /// Appends `kind` records to `path` (created if missing). + pub fn open(path: &Path, kind: Kind) -> Result { + let f = std::fs::OpenOptions::new() + .create(true) + .append(true) + .open(path) + .map_err(|e| format!("decode timeline: {}: {e}", path.display()))?; + Ok(Self { + path: path.to_path_buf(), + kind, + out: Some(BufWriter::new(f)), + marks: [0; 3], + pending: None, + pending_beat: None, + written: 0, + failed: 0, + reported: (0, 0), + }) + } + + /// True when the door must turn the chip stamps on ([`Kind::Launch`]). + pub fn stamps(&self) -> bool { + self.kind == Kind::Launch + } + + /// A decoding beat ended ([`Kind::Token`] only; others ignore it). The record closes at + /// the next beat's join or at idle. + pub fn beat(&mut self, sums: BeatSums) { + if self.kind == Kind::Token && sums.rows > 0 { + self.pending_beat = Some(sums); + } + } + + /// The path from [`ENV`], when set and not empty. + pub fn path_from_env() -> Option { + std::env::var_os(ENV) + .filter(|v| !v.is_empty()) + .map(PathBuf::from) + } + + /// A beat's join starts: it closes the previous beat's record. + pub fn join(&mut self, now: u64) { + self.finish(now); + self.marks = [now; 3]; + } + + /// The beat's sampling starts. + pub fn sample(&mut self, now: u64) { + self.marks[1] = now; + } + + /// The beat's feed is being built. + pub fn feed(&mut self, now: u64) { + self.marks[2] = now; + } + + /// The beat stepped one decoding row: `call` is the step call's start and end, `tl` the + /// row's timeline for the token. + pub fn stepped( + &mut self, + beat: u64, + row: usize, + step: u64, + call: (u64, u64), + stats: &GraphStats, + tl: Result, + ) { + match tl { + Ok(tl) if tl.stamps.len() == tl.kinds.len() + 1 => { + self.pending = Some(open_record(self.marks, beat, row, step, call, stats, &tl)); + } + Ok(tl) => { + self.failed += 1; + eprintln!( + "aien-serve-http: decode timeline: beat {beat}: {} stamps for {} launches", + tl.stamps.len(), + tl.kinds.len() + ); + } + Err(e) => { + self.failed += 1; + eprintln!("aien-serve-http: decode timeline: beat {beat}: {e}"); + } + } + } + + /// The door went idle: closes the last record and reports the counts. + pub fn idle(&mut self, now: u64) { + self.finish(now); + if (self.written, self.failed) != self.reported { + self.reported = (self.written, self.failed); + eprintln!( + "aien-serve-http: decode timeline: {} beats written to {}, {} not recorded", + self.written, + self.path.display(), + self.failed + ); + } + } + + fn finish(&mut self, end: u64) { + if let Some(s) = self.pending_beat.take() { + let t0 = self.marks[0]; + let total_ns = end.saturating_sub(t0); + let r = TokenRecord { + schema: TOKEN_SCHEMA.into(), + seq: self.written, + beat: s.beat, + rows: s.rows, + prompt_rows: s.prompt_rows, + steps: s.steps, + launches: s.launches, + submits: s.submits, + t0, + t1: end, + total_ns, + step_ns: s.step_ns, + graph_ns: s.graph_ns, + record_ns: s.record_ns, + step_chip_ns: s.step_chip_ns, + chip_ns: s.chip_ns, + host_overhead_ns: total_ns.saturating_sub(s.chip_ns), + }; + self.write(serde_json::to_string(&r).expect("a record serializes")); + } + let Some(mut r) = self.pending.take() else { + return; + }; + let post0 = r.host.last().map_or(end, |s| s.t1); + r.host.push(span("sched_post", post0, end)); + r.seq = self.written; + self.write(serde_json::to_string(&r).expect("a record serializes")); + } + + fn write(&mut self, line: String) { + let Some(out) = self.out.as_mut() else { + return; + }; + let res = writeln!(out, "{line}").and_then(|()| out.flush()); + match res { + Ok(()) => self.written += 1, + Err(e) => { + eprintln!( + "aien-serve-http: decode timeline: write to {} failed: {e}; recording stops", + self.path.display() + ); + self.out = None; + } + } + } +} + +/// Device categories, one per launch. Before the last `down` launch: section 10's groups. After +/// it (the head): with the exact head an `lm_head` launch follows an `argmax`, so the `lm_head` +/// launches before the head's first `argmax` are the FP8 screen and those after it the BF16 +/// recheck; without one every `lm_head` is `head_plain`. The last two launches, when both are +/// `argmax`, are the greedy pick. +pub fn categories(kinds: &[String]) -> Vec<&'static str> { + let tail = kinds.iter().rposition(|k| k == "down").map_or(0, |i| i + 1); + let first_am = kinds[tail..] + .iter() + .position(|k| k == "argmax") + .map(|i| tail + i); + let exact = first_am.is_some_and(|a| kinds[a..].iter().any(|k| k == "lm_head")); + let n = kinds.len(); + let pick = n >= 2 && kinds[n - 2] == "argmax" && kinds[n - 1] == "argmax"; + kinds + .iter() + .enumerate() + .map(|(i, k)| match k.as_str() { + _ if pick && i + 2 >= n => "token_pick", + "lm_head" if !exact => "head_plain", + "lm_head" if first_am.is_some_and(|a| i < a) => "head_screen", + "lm_head" => "head_recheck", + "gate_up" | "down" => "experts", + "mix" | "gdn" | "ab" => "gdn", + "o_proj" | "attn" => "attention", + "router" => "router", + "res" | "swiglu" | "argmax" | "gather" | "gate" | "norm" | "perm" | "group" => "glue", + _ => "unknown", + }) + .collect() +} + +fn dur(s: &Span) -> u64 { + s.t1.saturating_sub(s.t0) +} + +/// Holds a timeline to its shape. Empty: green. For every record: the schema; the host phases +/// complete, in order, each `t1 >= t0`, each starting where the last ended; the device spans +/// one per launch, contiguous; the device span at most the graph's chip time, and that at most +/// its submit-and-wait span (durations only: two clocks); every record the same launch-kind +/// census as the first; no unknown kind. Across records: no overlap, and consecutive beats +/// touch. +pub fn check(records: &[Record]) -> Vec { + let mut bad = Vec::new(); + if records.is_empty() { + bad.push("no records".into()); + } + fn census(r: &Record) -> Vec<&str> { + let mut c: Vec<&str> = r.dev.iter().map(|s| s.name.as_str()).collect(); + c.sort_unstable(); + c + } + let first_census = records.first().map(census); + for (i, r) in records.iter().enumerate() { + let at = format!("record {i} (beat {})", r.beat); + if r.seq != i as u64 { + bad.push(format!( + "{at}: seq {} where {i} belongs (a record is missing or repeated)", + r.seq + )); + } + if r.schema != SCHEMA { + bad.push(format!("{at}: schema {:?}", r.schema)); + } + let names: Vec<&str> = r.host.iter().map(|s| s.name.as_str()).collect(); + if names != HOST_PHASES { + bad.push(format!("{at}: host phases {names:?}")); + } + for (what, spans) in [("host", &r.host), ("dev", &r.dev)] { + for (j, s) in spans.iter().enumerate() { + if s.t1 < s.t0 { + bad.push(format!("{at}: {what} {j} {} ends before it starts", s.name)); + } + } + for (j, w) in spans.windows(2).enumerate() { + if w[0].t1 != w[1].t0 { + bad.push(format!( + "{at}: {what} {j} {} ends at {}, {} starts at {}", + w[0].name, w[0].t1, w[1].name, w[1].t0 + )); + } + } + } + if r.dev.len() != r.launches as usize { + bad.push(format!( + "{at}: {} device spans for {} launches", + r.dev.len(), + r.launches + )); + } + if let (Some(a), Some(b)) = (r.dev.first(), r.dev.last()) { + let dev_span = b.t1.saturating_sub(a.t0); + if dev_span > r.chip_ns { + bad.push(format!( + "{at}: device span {dev_span} ns > chip_ns {}", + r.chip_ns + )); + } + } + if let Some(w) = r.host.iter().find(|s| s.name == "graph_submit_wait") { + if r.chip_ns > dur(w) { + bad.push(format!( + "{at}: chip_ns {} > graph_submit_wait {}", + r.chip_ns, + dur(w) + )); + } + } + if let Some(c) = &first_census { + if &census(r) != c { + bad.push(format!("{at}: launch-kind census differs from record 0")); + } + } + let kinds: Vec = r.dev.iter().map(|s| s.name.clone()).collect(); + if categories(&kinds).contains(&"unknown") { + bad.push(format!("{at}: unknown launch kind")); + } + if i > 0 { + let p = &records[i - 1]; + if let (Some(pe), Some(s)) = (p.host.last(), r.host.first()) { + if s.t0 < pe.t1 { + bad.push(format!( + "{at}: starts {} before record {} ends", + pe.t1 - s.t0, + i - 1 + )); + } + if r.beat == p.beat + 1 && s.t0 != pe.t1 { + bad.push(format!("{at}: beat follows beat {} with a gap", p.beat)); + } + } + } + } + bad +} + +/// The DRA-66 0.5 ms gate, a sum of two medians over two arms of the same window: `hostLB`, the +/// median `host_overhead_ns` of the clean one-conversation beats of the per-token receipt's +/// `receipt-1conv` slice ([`summary_tokens`]), plus `submitPoll`, the median submit + marker +/// poll share `chip_ns - dev_span` of the stamped one-conversation timeline ([`summary`]). Both +/// summaries must be evaluated first, in the same Wolfram session. It returns +/// `{host ms, submit + poll ms, sum ms, verdict}`. +pub const GATE_WL: &str = "(* DRA-66 gate, sum of medians (hostLB: token receipt, receipt-1conv slice, clean 1-row beats; submitPoll: stamped timeline, single-submit beats): {host lower bound ms, submit + poll ms, sum ms, sum <= 0.5 ms} *) {N[hostLB / 10^6], N[submitPoll / 10^6], N[(hostLB + submitPoll) / 10^6], hostLB + submitPoll <= 500000}\n"; + +/// A Wolfram-ready summary: one association of per-beat integer nanosecond lists (`period`, every +/// host phase, every device category, `dev_span`, `sync` = `graph_submit_wait - dev_span`, +/// `submits`, `chip_ns`, `submit_poll` = `chip_ns - dev_span`), plus the queries that reduce it, +/// ending with [`GATE_WL`]. The arithmetic is left to Wolfram. +/// +/// `submit_poll` is the host time [`Record::chip_ns`] (the same graph stat a [`TokenRecord`] +/// sums into its `chip_ns`) holds besides the chip's work: the queue submit, the chip's start, +/// the completion marker's poll (the served 2000 us spin, then 50 us sleeps) and its read back. +/// `chip_ns` and `dev_span` both carry the stamps' chip cost, so the +/// difference does not. With more than one submit the device span also covers the host's +/// emit between the chunks, which `chip_ns` does not, so only single-submit beats count. +pub fn summary(records: &[Record]) -> String { + let mut keys: Vec = vec!["period".into()]; + keys.extend(HOST_PHASES.iter().map(|p| format!("host:{p}"))); + keys.extend(DEV_CATEGORIES.iter().map(|c| format!("dev:{c}"))); + keys.extend(["dev_span", "sync", "submits", "chip_ns", "submit_poll"].map(String::from)); + let mut cols: Vec> = vec![Vec::new(); keys.len()]; + for r in records { + let mut row = Vec::with_capacity(keys.len()); + let period = match (r.host.first(), r.host.last()) { + (Some(a), Some(b)) => b.t1.saturating_sub(a.t0), + _ => 0, + }; + row.push(period); + for p in HOST_PHASES { + row.push(r.host.iter().filter(|s| s.name == p).map(dur).sum()); + } + let kinds: Vec = r.dev.iter().map(|s| s.name.clone()).collect(); + let cats = categories(&kinds); + for c in DEV_CATEGORIES { + row.push( + r.dev + .iter() + .zip(&cats) + .filter(|(_, k)| **k == c) + .map(|(s, _)| dur(s)) + .sum(), + ); + } + let dev_span = match (r.dev.first(), r.dev.last()) { + (Some(a), Some(b)) => b.t1.saturating_sub(a.t0), + _ => 0, + }; + let wait = r + .host + .iter() + .find(|s| s.name == "graph_submit_wait") + .map_or(0, dur); + row.push(dev_span); + row.push(wait.saturating_sub(dev_span)); + row.push(u64::from(r.submits)); + row.push(r.chip_ns); + row.push(r.chip_ns.saturating_sub(dev_span)); + for (c, v) in cols.iter_mut().zip(row) { + c.push(v); + } + } + let mut s = format!( + "(* {SCHEMA}: {} beats; integer ns per beat; host clock for host:*, period, sync, chip_ns, submit_poll; chip PTIMER for dev:*, dev_span *)\n", + records.len() + ); + s.push_str("timeline = <|\n"); + for (i, (k, c)) in keys.iter().zip(&cols).enumerate() { + let vals: Vec = c.iter().map(u64::to_string).collect(); + let comma = if i + 1 < keys.len() { "," } else { "" }; + s.push_str(&format!(" \"{k}\" -> {{{}}}{comma}\n", vals.join(", "))); + } + s.push_str("|>;\n"); + s.push_str("(* ms per beat, medians: *) N[Median /@ timeline / 10^6]\n"); + s.push_str( + "(* outside the chip + chip + sync vs the period: *) N[{Median[timeline[\"period\"] - timeline[\"host:graph_submit_wait\"]], Median[timeline[\"dev_span\"]], Median[timeline[\"sync\"]], Median[timeline[\"period\"]]} / 10^6]\n", + ); + s.push_str("(* residual against the recorded 20.7 ms step: *) N[207/10 - Median[timeline[\"period\"]] / 10^6]\n"); + s.push_str("(* DRA-66 submit + poll share per token, chip_ns - dev_span over single-submit beats: {beats, median ms} *) one = Flatten[Position[timeline[\"submits\"], 1]]; submitPoll = Median[timeline[\"submit_poll\"][[one]]]; {Length[one], N[submitPoll / 10^6]}\n"); + s.push_str(GATE_WL); + s +} + +/// Holds a per-token receipt to its shape. Empty: red. For every record: the schema; `seq` its +/// index (a dropped or repeated record breaks the run); at least one decoding row and one step; +/// `total_ns = t1 - t0`; `record_ns <= graph_ns`, `step_chip_ns <= graph_ns`, +/// `step_chip_ns <= chip_ns`, `graph_ns <= step_ns`, `chip_ns <= step_ns <= total_ns`; +/// `host_overhead_ns = total_ns - chip_ns`; a beat with no prompt and one step submitted at +/// least once and at most once per row. Across records: no overlap, and consecutive beats touch. +pub fn check_tokens(records: &[TokenRecord]) -> Vec { + let mut bad = Vec::new(); + if records.is_empty() { + bad.push("no records".into()); + } + for (i, r) in records.iter().enumerate() { + let at = format!("record {i} (beat {})", r.beat); + if r.schema != TOKEN_SCHEMA { + bad.push(format!("{at}: schema {}", r.schema)); + } + if r.seq != i as u64 { + bad.push(format!( + "{at}: seq {} (a record is missing or repeated)", + r.seq + )); + } + if r.rows == 0 || r.steps == 0 { + bad.push(format!("{at}: {} rows, {} steps", r.rows, r.steps)); + } + if r.t1 < r.t0 || r.total_ns != r.t1 - r.t0 { + bad.push(format!( + "{at}: total {} for t0 {} t1 {}", + r.total_ns, r.t0, r.t1 + )); + } + let order = [ + ("record_ns <= graph_ns", r.record_ns <= r.graph_ns), + ("step_chip_ns <= graph_ns", r.step_chip_ns <= r.graph_ns), + ("step_chip_ns <= chip_ns", r.step_chip_ns <= r.chip_ns), + ("graph_ns <= step_ns", r.graph_ns <= r.step_ns), + ("chip_ns <= step_ns", r.chip_ns <= r.step_ns), + ("step_ns <= total_ns", r.step_ns <= r.total_ns), + ]; + for (what, ok) in order { + if !ok { + bad.push(format!("{at}: not {what}")); + } + } + if r.host_overhead_ns != r.total_ns.saturating_sub(r.chip_ns) || r.chip_ns > r.total_ns { + bad.push(format!( + "{at}: host_overhead {} for total {} chip {}", + r.host_overhead_ns, r.total_ns, r.chip_ns + )); + } + if r.prompt_rows == 0 && r.steps == 1 && (r.submits == 0 || r.submits > r.rows) { + bad.push(format!("{at}: {} submits for {} rows", r.submits, r.rows)); + } + if i > 0 { + let p = &records[i - 1]; + if r.t0 < p.t1 { + bad.push(format!( + "{at}: starts {} before record {} ends", + p.t1 - r.t0, + i - 1 + )); + } + if r.beat == p.beat + 1 && r.t0 != p.t1 { + bad.push(format!("{at}: beat follows beat {} with a gap", p.beat)); + } + } + } + bad +} + +/// The per-token receipt's Wolfram-ready summary: per-beat integer lists, then the queries. A +/// beat yields one token to each of its `rows` conversations, so a beat's host overhead is each +/// of those tokens' host time. `hostLB` is the median host overhead of the clean +/// one-conversation beats (`rows` 1, `prompt_rows` 0): a LOWER bound of the host time per token, +/// because `chip_ns` also holds the submit and the completion marker's poll. The DRA-66 gate +/// adds the stamped timeline's `submitPoll` to it ([`GATE_WL`]); `hostLB` alone is never the +/// verdict. +pub fn summary_tokens(records: &[TokenRecord]) -> String { + type Col = fn(&TokenRecord) -> u64; + let cols: [(&str, Col); 11] = [ + ("rows", |r| r.rows), + ("prompt_rows", |r| r.prompt_rows), + ("steps", |r| r.steps), + ("submits", |r| r.submits), + ("total_ns", |r| r.total_ns), + ("step_ns", |r| r.step_ns), + ("graph_ns", |r| r.graph_ns), + ("record_ns", |r| r.record_ns), + ("step_chip_ns", |r| r.step_chip_ns), + ("chip_ns", |r| r.chip_ns), + ("host_overhead_ns", |r| r.host_overhead_ns), + ]; + let mut s = format!( + "(* {TOKEN_SCHEMA}: {} decoding beats; integer ns, host clock *)\nreceipt = <|\n", + records.len() + ); + for (i, (k, f)) in cols.iter().enumerate() { + let vals: Vec = records.iter().map(|r| f(r).to_string()).collect(); + let comma = if i + 1 < cols.len() { "," } else { "" }; + s.push_str(&format!(" \"{k}\" -> {{{}}}{comma}\n", vals.join(", "))); + } + s.push_str("|>;\n"); + s.push_str("clean[k_] := Pick[Range[Length[receipt[\"rows\"]]], MapThread[#1 == k && #2 == 0 &, {receipt[\"rows\"], receipt[\"prompt_rows\"]}]];\n"); + s.push_str("(* DRA-66 host lower bound per token at 1 conversation (wall - chip_ns; chip_ns holds the submit and the marker poll, see submitPoll): {beats, median ms} *) hostLB = Median[receipt[\"host_overhead_ns\"][[clean[1]]]]; {Length[clean[1]], N[hostLB / 10^6]}\n"); + s.push_str("(* per conversations k, clean beats: {beats, median total, chip, host overhead ms} *) Table[{k, Length[clean[k]], N[Median[receipt[\"total_ns\"][[clean[k]]]] / 10^6], N[Median[receipt[\"chip_ns\"][[clean[k]]]] / 10^6], N[Median[receipt[\"host_overhead_ns\"][[clean[k]]]] / 10^6]}, {k, Select[Union[receipt[\"rows\"]], Length[clean[#]] > 0 &]}]\n"); + s.push_str("(* host overhead at 1 conversation by where it sits (ms, medians): outside the step, step outside the graph, graph outside record and chip, record *) With[{c = clean[1], r = receipt}, N[{Median[(r[\"total_ns\"] - r[\"step_ns\"])[[c]]], Median[(r[\"step_ns\"] - r[\"graph_ns\"])[[c]]], Median[(r[\"graph_ns\"] - r[\"record_ns\"] - r[\"step_chip_ns\"])[[c]]], Median[r[\"record_ns\"][[c]]]} / 10^6]]\n"); + s +} + +/// The token checker's mutants and slice ([`run_check`]). +#[derive(Default)] +struct TokenOpts<'a> { + drop: Option<&'a str>, + bend: Option<&'a str>, + slice: Option<&'a str>, +} + +fn run_check_tokens(path: &str, o: &TokenOpts, text: &str) -> u8 { + let usage = "token receipt: --drop REC:record:0 (REC below the last record), --bend REC:chip | host:NS, --slice A:B (0 <= A < B <= records)"; + let mut records: Vec = match read_jsonl_as(text) { + Ok(r) => r, + Err(e) => { + eprintln!("{path}: {e}"); + return 2; + } + }; + if let Some(d) = o.drop { + let rec = match d.split(':').collect::>().as_slice() { + [r, "record", _] => r.parse::().ok().filter(|&r| r + 1 < records.len()), + _ => None, + }; + let Some(r) = rec else { + eprintln!("--drop {d}: {usage}"); + return 2; + }; + records.remove(r); + eprintln!("negative control: dropped {d}"); + } + if let Some(b) = o.bend { + match b.split(':').collect::>().as_slice() { + // The accounting mutant: seq stays dense, one beat's chip time moves by 1 ns while + // its host share stays put. It must come out red. + [r, "chip"] if r.parse::().is_ok_and(|r| r < records.len()) => { + records[r.parse::().expect("checked")].chip_ns += 1; + eprintln!("negative control: bent {b} (chip_ns + 1, host_overhead_ns kept)"); + } + // The synthetic receipt: every beat NS ns longer on the host, consistently (t0, t1, + // total and host share), so the shape stays green and the 0.5 ms gate must turn. + ["host", ns] if ns.parse::().is_ok() => { + let ns = ns.parse::().expect("checked"); + for (i, r) in records.iter_mut().enumerate() { + let i = i as u64; + r.t0 += i * ns; + r.t1 += (i + 1) * ns; + r.total_ns += ns; + r.host_overhead_ns += ns; + } + eprintln!("synthetic receipt: bent {b} (every beat {ns} ns more host time)"); + } + _ => { + eprintln!("--bend {b}: {usage}"); + return 2; + } + } + } + let range = match o.slice { + None => 0..records.len(), + Some(s) => { + let ab = s + .split_once(':') + .and_then(|(a, b)| a.parse::().ok().zip(b.parse::().ok())) + .filter(|&(a, b)| a < b && b <= records.len()); + let Some((a, b)) = ab else { + eprintln!("--slice {s}: {usage}"); + return 2; + }; + a..b + } + }; + let bad = check_tokens(&records); + if bad.is_empty() { + eprintln!( + "token receipt GREEN: {} records, {path}; summary over records {}..{}", + records.len(), + range.start, + range.end + ); + if o.slice.is_some() { + println!( + "(* records {}..{} (seq) of {path}; the whole file checked green *)", + range.start, range.end + ); + } + print!("{}", summary_tokens(&records[range])); + 0 + } else { + for b in bad.iter().take(20) { + eprintln!("RED: {b}"); + } + eprintln!( + "token receipt RED: {} findings over {} records, {path}", + bad.len(), + records.len() + ); + 1 + } +} + +/// `aien-serve-http --check-decode-timeline FILE [--drop SPEC] [--bend SPEC] [--slice A:B]`: +/// [`check`] and, when green, [`summary`] on stdout. `--drop` deletes one span (or, as +/// `REC:record:0`, the whole record) before checking: the negative control, which must come out +/// red. A file whose first record is a [`TOKEN_SCHEMA`] receipt goes to [`check_tokens`] / +/// [`summary_tokens`]: `--drop` then takes `REC:record:0` only; `--bend REC:chip` adds 1 ns to +/// one beat's `chip_ns` (a red control: seq stays dense); `--bend host:NS` adds NS ns of host +/// time to every beat consistently (green shape, the synthetic red arm of the 0.5 ms gate); +/// `--slice A:B` checks the whole file and summarizes records `A..B` only (one gate's beats). +/// Exit 0 green, 1 red, 2 usage or an unreadable file. +pub fn run_check(args: &[String]) -> u8 { + let usage = "usage: aien-serve-http --check-decode-timeline FILE [--drop REC:host|dev|record:IDX] [--bend REC:chip|host:NS] [--slice A:B] (--bend and --slice: token receipts)"; + let Some((path, rest)) = args.split_first() else { + eprintln!("{usage}"); + return 2; + }; + let mut o = TokenOpts::default(); + for pair in rest.chunks(2) { + let slot = match pair { + [f, _] if f == "--drop" => &mut o.drop, + [f, _] if f == "--bend" => &mut o.bend, + [f, _] if f == "--slice" => &mut o.slice, + _ => { + eprintln!("{usage}"); + return 2; + } + }; + if slot.replace(pair[1].as_str()).is_some() { + eprintln!("{} given twice; {usage}", pair[0]); + return 2; + } + } + let drop = o.drop; + let text = match std::fs::read_to_string(path) { + Ok(t) => t, + Err(e) => { + eprintln!("{path}: {e}"); + return 2; + } + }; + let first = text.lines().find(|l| !l.trim().is_empty()); + if first.is_some_and(|l| l.contains(TOKEN_SCHEMA)) { + return run_check_tokens(path, &o, &text); + } + if o.bend.is_some() || o.slice.is_some() { + eprintln!("{path}: a launch timeline takes --drop only; {usage}"); + return 2; + } + let mut records = match read_jsonl(&text) { + Ok(r) => r, + Err(e) => { + eprintln!("{path}: {e}"); + return 2; + } + }; + if let Some(d) = drop { + let parts: Vec<&str> = d.split(':').collect(); + let parsed = match parts.as_slice() { + [r, w, i] => r + .parse::() + .ok() + .zip(i.parse::().ok()) + .map(|(r, i)| (r, *w, i)), + _ => None, + }; + let ok = match parsed { + Some((r, "record", _)) if r < records.len() => { + records.remove(r); + true + } + Some((r, "host", i)) if r < records.len() && i < records[r].host.len() => { + records[r].host.remove(i); + true + } + Some((r, "dev", i)) if r < records.len() && i < records[r].dev.len() => { + records[r].dev.remove(i); + true + } + _ => false, + }; + if !ok { + eprintln!("--drop {d}: no such span; {usage}"); + return 2; + } + eprintln!("negative control: dropped {d}"); + } + let bad = check(&records); + if bad.is_empty() { + eprintln!("decode timeline GREEN: {} records, {path}", records.len()); + print!("{}", summary(&records)); + 0 + } else { + for b in bad.iter().take(20) { + eprintln!("RED: {b}"); + } + eprintln!( + "decode timeline RED: {} findings over {} records, {path}", + bad.len(), + records.len() + ); + 1 + } +} + +/// Reads a JSONL timeline. +pub fn read_jsonl(text: &str) -> Result, String> { + read_jsonl_as(text) +} + +/// Reads JSONL records of any one type. +pub fn read_jsonl_as(text: &str) -> Result, String> { + text.lines() + .enumerate() + .filter(|(_, l)| !l.trim().is_empty()) + .map(|(i, l)| serde_json::from_str(l).map_err(|e| format!("line {}: {e}", i + 1))) + .collect() +} + +#[cfg(test)] +mod tests { + use super::*; + + /// A 40-layer exact-head kind sequence shaped like the graph's (3 GDN : 1 attention). + pub(crate) fn kinds40() -> Vec { + let mut k = Vec::new(); + for l in 0..40 { + k.push("norm"); + if l % 4 == 3 { + k.extend(["mix", "attn", "gate", "o_proj"]); + } else { + k.extend(["mix", "ab", "gdn", "o_proj"]); + } + k.extend([ + "res", "norm", "router", "gate_up", "swiglu", "down", "gather", "res", + ]); + } + k.extend([ + "norm", "lm_head", "lm_head", "lm_head", "argmax", "argmax", "lm_head", "argmax", + "argmax", + ]); + k.into_iter().map(String::from).collect() + } + + fn timeline(kinds: Vec, base: u64) -> RowTimeline { + let stamps = (0..=kinds.len() as u64).map(|i| base + i * 1000).collect(); + RowTimeline { + host: [110, 120, 120 + 900_000, 120 + 900_010], + stamps, + kinds, + } + } + + fn records(n: usize) -> Vec { + let mut rec = Recorder { + path: PathBuf::from("/dev/null"), + kind: Kind::Launch, + out: None, + marks: [0; 3], + pending: None, + pending_beat: None, + written: 0, + failed: 0, + reported: (0, 0), + }; + let mut out = Vec::new(); + let mut t = 0u64; + for b in 0..n as u64 { + rec.join(t); + if let Some(r) = rec.pending.take() { + out.push(r); + } + rec.marks = [t; 3]; + rec.sample(t + 10); + rec.feed(t + 50); + let k = kinds40(); + let launches = k.len() as u32; + let mut tl = timeline(k, 5_000_000 * b); + tl.host = tl.host.map(|h| h + t); + let stats = GraphStats { + launches, + submits: 1, + chip_ns: launches as u64 * 1000 + 40_000, + record_ns: 300_000, + total_ns: 899_000, + ..Default::default() + }; + rec.stepped(b, 0, b, (t + 100, t + 900_200), &stats, Ok(tl)); + let mut r = rec.pending.take().expect("a record"); + r.host.push(span("sched_post", t + 900_200, t + 1_000_000)); + r.seq = b; + out.push(r); + t += 1_000_000; + } + out + } + + #[test] + fn complete_beats_are_green() { + let r = records(5); + assert_eq!(check(&r), Vec::::new()); + assert_eq!( + read_jsonl( + &r.iter() + .map(|x| serde_json::to_string(x).unwrap() + "\n") + .collect::() + ) + .unwrap(), + r + ); + } + + #[test] + fn dropping_one_host_span_is_red() { + let mut r = records(3); + r[1].host.remove(6); + let bad = check(&r); + assert!(bad.iter().any(|b| b.contains("host phases")), "{bad:?}"); + } + + #[test] + fn dropping_one_device_span_is_red() { + let mut r = records(3); + r[2].dev.remove(100); + let bad = check(&r); + assert!( + bad.iter().any(|b| b.contains("device spans for")), + "{bad:?}" + ); + assert!(bad.iter().any(|b| b.contains("dev 99")), "{bad:?}"); + } + + #[test] + fn dropping_one_record_is_red() { + let mut r = records(4); + r.remove(2); + let bad = check(&r); + assert!( + bad.iter().any(|b| b.contains("missing or repeated")), + "{bad:?}" + ); + } + + #[test] + fn overlap_and_gap_are_red() { + let mut r = records(2); + r[1].host[0].t0 -= 5; + assert!(check(&r).iter().any(|b| b.contains("before record 0 ends"))); + let mut r = records(2); + r[1].host[0].t0 += 5; + assert!(check(&r).iter().any(|b| b.contains("with a gap"))); + } + + #[test] + fn exact_head_is_split() { + let k = kinds40(); + let c = categories(&k); + let n = k.len(); + assert_eq!( + &c[n - 9..], + [ + "glue", + "head_screen", + "head_screen", + "head_screen", + "glue", + "glue", + "head_recheck", + "token_pick", + "token_pick" + ] + ); + assert_eq!(c.iter().filter(|x| **x == "experts").count(), 80); + assert_eq!(c.iter().filter(|x| **x == "router").count(), 40); + let plain: Vec = ["down", "norm", "lm_head", "argmax", "argmax"] + .map(String::from) + .into(); + assert_eq!( + categories(&plain), + ["experts", "glue", "head_plain", "token_pick", "token_pick"] + ); + } + + #[test] + fn summary_lists_every_beat() { + let r = records(4); + let s = summary(&r); + assert!( + s.contains("\"period\" -> {1000000, 1000000, 1000000, 1000000}"), + "{s}" + ); + assert!( + s.contains("\"dev:head_recheck\" -> {1000, 1000, 1000, 1000}"), + "{s}" + ); + assert!(s.contains("\"submits\" -> {1, 1, 1, 1}"), "{s}"); + assert!( + s.contains("\"submit_poll\" -> {40000, 40000, 40000, 40000}"), + "{s}" + ); + assert!(s.ends_with(GATE_WL), "{s}"); + } + + /// A launch record written before `submits` existed (#787's host timeline) still reads, as 0. + #[test] + fn record_without_submits_reads_as_zero() { + let r = records(1); + let line = serde_json::to_string(&r[0]).unwrap(); + let old = line.replace("\"submits\":1,", ""); + assert_ne!(old, line); + let back = read_jsonl(&old).unwrap(); + assert_eq!(back[0].submits, 0); + assert_eq!(back[0].chip_ns, r[0].chip_ns); + } + + /// `n` consistent single-row token records, 1 ms apart: 0.6 ms chip, 0.4 ms host each. + fn tokens(n: u64) -> Vec { + (0..n) + .map(|i| TokenRecord { + schema: TOKEN_SCHEMA.into(), + seq: i, + beat: i + 1, + rows: 1, + prompt_rows: 0, + steps: 1, + launches: 40, + submits: 1, + t0: 1_000_000 * i, + t1: 1_000_000 * (i + 1), + total_ns: 1_000_000, + step_ns: 900_000, + graph_ns: 800_000, + record_ns: 100_000, + step_chip_ns: 600_000, + chip_ns: 600_000, + host_overhead_ns: 400_000, + }) + .collect() + } + + fn token_file(name: &str, recs: &[TokenRecord]) -> String { + let p = std::env::temp_dir().join(format!("dra66-{}-{name}.jsonl", std::process::id())); + let text: String = recs + .iter() + .map(|r| serde_json::to_string(r).unwrap() + "\n") + .collect(); + std::fs::write(&p, text).unwrap(); + p.to_string_lossy().into_owned() + } + + fn cli(file: &str, extra: &[&str]) -> u8 { + let mut a = vec![file.to_string()]; + a.extend(extra.iter().map(|s| s.to_string())); + run_check(&a) + } + + #[test] + fn token_bends_and_slice() { + let recs = tokens(6); + assert_eq!(check_tokens(&recs), Vec::::new()); + let f = token_file("bend", &recs); + assert_eq!(cli(&f, &[]), 0); + // The accounting mutant: one beat's chip moves, its host share does not. Red. + assert_eq!(cli(&f, &["--bend", "3:chip"]), 1); + // The synthetic receipt: 0.6 ms more host time on every beat keeps the shape green. + assert_eq!(cli(&f, &["--bend", "host:600000"]), 0); + let mut bent = recs.clone(); + for (i, r) in bent.iter_mut().enumerate() { + let i = i as u64; + r.t0 += i * 600_000; + r.t1 += (i + 1) * 600_000; + r.total_ns += 600_000; + r.host_overhead_ns += 600_000; + } + assert_eq!(check_tokens(&bent), Vec::::new()); + assert!(summary_tokens(&bent).contains("\"host_overhead_ns\" -> {1000000, ")); + // Usage: unknown bend, bad slice, a flag twice, a dangling flag. + assert_eq!(cli(&f, &["--bend", "6:chip"]), 2); + assert_eq!(cli(&f, &["--bend", "host:x"]), 2); + assert_eq!(cli(&f, &["--slice", "4:4"]), 2); + assert_eq!(cli(&f, &["--slice", "2:7"]), 2); + assert_eq!(cli(&f, &["--bend", "1:chip", "--bend", "2:chip"]), 2); + assert_eq!(cli(&f, &["--slice"]), 2); + assert_eq!(cli(&f, &["--slice", "2:5"]), 0); + // A dropped record stays red whatever the slice. + assert_eq!(cli(&f, &["--drop", "1:record:0", "--slice", "2:4"]), 1); + let _ = std::fs::remove_file(&f); + } + + #[test] + fn token_summary_covers_the_slice_only() { + let mut recs = tokens(6); + // Beats 2..5 carry a distinct host share; the summary over them must show only those. + for r in &mut recs[2..5] { + r.chip_ns -= 1_000; + r.step_chip_ns -= 1_000; + r.host_overhead_ns += 1_000; + } + assert_eq!(check_tokens(&recs), Vec::::new()); + let s = summary_tokens(&recs[2..5]); + assert!( + s.contains("\"host_overhead_ns\" -> {401000, 401000, 401000}\n"), + "{s}" + ); + assert!(s.contains("hostLB = Median["), "{s}"); + assert!( + !s.contains("<= 500000"), + "the lower bound alone carries no verdict: {s}" + ); + } + + #[test] + fn launch_timeline_takes_drop_only() { + let r = records(3); + let p = std::env::temp_dir().join(format!("dra66-{}-launch.jsonl", std::process::id())); + std::fs::write( + &p, + r.iter() + .map(|x| serde_json::to_string(x).unwrap() + "\n") + .collect::(), + ) + .unwrap(); + let f = p.to_string_lossy().into_owned(); + assert_eq!(cli(&f, &[]), 0); + assert_eq!(cli(&f, &["--drop", "1:record:0"]), 1); + assert_eq!(cli(&f, &["--bend", "1:chip"]), 2); + assert_eq!(cli(&f, &["--slice", "0:2"]), 2); + let _ = std::fs::remove_file(&p); + } +} diff --git a/crates/aien-serve-http/src/engine.rs b/crates/aien-serve-http/src/engine.rs index 2a5abade..ce27dcf5 100644 --- a/crates/aien-serve-http/src/engine.rs +++ b/crates/aien-serve-http/src/engine.rs @@ -61,6 +61,14 @@ pub enum FinishReason { } /// What the engine reports when `generate` returns. +/// +/// The four `*_ns` fields (DRA-66) are durations on the host's monotonic clock, never mixed with +/// a chip clock: `ttft_ns` from the door's entry (the request queued) to the first token handed +/// out; `total_ns` from the first token handed out to the last; `chip_ns` the chip time of the +/// steps between them (the graph's submit-to-marker spans, measured on the host clock, so they +/// include the marker poll's wake-up); `host_overhead_ns = total_ns - chip_ns`, the host's share. +/// Per decode token: divide by `emitted_tokens - 1`. An engine that cannot see its chip time +/// reports `chip_ns` 0, so its overhead is its whole decode wall. #[derive(Debug, Clone, PartialEq)] pub struct GenerateOutcome { /// Tokens handed to `on_token`. @@ -71,6 +79,100 @@ pub struct GenerateOutcome { /// How the tokens were sampled, observed at each draw (OWN-8B stage S). `None` for an /// engine that does not sample (the stub replays a fixed list). pub sampling: Option, + pub ttft_ns: u64, + pub total_ns: u64, + pub chip_ns: u64, + pub host_overhead_ns: u64, +} + +/// Builds a reply's [`GenerateOutcome`] times on the host clock. A step's chip time is held +/// until the token it produced is handed out ([`Self::emitted`]): the chip time before the first +/// token (prefill, the prompt's last step) and that of a step whose token is never handed out (a +/// stop token, a cancel) stay out of `chip_ns`, so `chip_ns` covers exactly the steps inside +/// `total_ns`. +#[derive(Debug, Clone)] +pub struct ReplyClock { + start: Instant, + first: Option, + last: Option, + pending_chip_ns: u64, + chip_ns: u64, +} + +/// [`ReplyClock::times`]: the four host-clock durations of a reply. +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)] +pub struct ReplyTimes { + pub ttft_ns: u64, + pub total_ns: u64, + pub chip_ns: u64, + pub host_overhead_ns: u64, +} + +impl ReplyClock { + /// `start`: when the request reached the door. + pub fn new(start: Instant) -> Self { + Self { + start, + first: None, + last: None, + pending_chip_ns: 0, + chip_ns: 0, + } + } + + /// A step ran for this reply and took `ns` of chip time. + pub fn chip(&mut self, ns: u64) { + self.pending_chip_ns += ns; + } + + /// A token was handed out at `now`. + pub fn emitted(&mut self, now: Instant) { + if self.first.is_none() { + self.first = Some(now); + } else { + self.chip_ns += self.pending_chip_ns; + } + self.pending_chip_ns = 0; + self.last = Some(now); + } + + pub fn times(&self) -> ReplyTimes { + let ns = |a: Instant, b: Instant| b.saturating_duration_since(a).as_nanos() as u64; + let (ttft_ns, total_ns) = match (self.first, self.last) { + (Some(f), Some(l)) => (ns(self.start, f), ns(f, l)), + _ => (0, 0), + }; + ReplyTimes { + ttft_ns, + total_ns, + chip_ns: self.chip_ns, + host_overhead_ns: total_ns.saturating_sub(self.chip_ns), + } + } +} + +impl GenerateOutcome { + /// An outcome with `times` filled in (the one way every engine sets them). + pub fn timed( + emitted_tokens: usize, + finish: FinishReason, + prefill_ms: u64, + decode_ms: u64, + sampling: Option, + times: ReplyTimes, + ) -> Self { + Self { + emitted_tokens, + finish, + prefill_ms, + decode_ms, + sampling, + ttft_ns: times.ttft_ns, + total_ns: times.total_ns, + chip_ns: times.chip_ns, + host_overhead_ns: times.host_overhead_ns, + } + } } #[derive(Debug, Clone, PartialEq, Eq)] @@ -171,13 +273,14 @@ pub trait Engine: Send + Sync { .enumerate() .map(|(i, j)| { if stopped(j) { - return Ok(GenerateOutcome { - emitted_tokens: 0, - finish: FinishReason::Cancelled, - prefill_ms: 0, - decode_ms: 0, - sampling: None, - }); + return Ok(GenerateOutcome::timed( + 0, + FinishReason::Cancelled, + 0, + 0, + None, + ReplyTimes::default(), + )); } self.generate_with_test(&j.prompt, &j.params, &j.test, &mut |t| { on_token(i, t) && !stopped(j) @@ -361,6 +464,7 @@ impl Engine for StubEngine { }); } let t0 = Instant::now(); + let mut clock = ReplyClock::new(t0); let mut emitted = 0usize; let mut finish = FinishReason::Stop; for &tok in &self.reply { @@ -376,18 +480,20 @@ impl Engine for StubEngine { std::thread::sleep(self.per_token_delay); } emitted += 1; + clock.emitted(Instant::now()); if !on_token(tok) { finish = FinishReason::Cancelled; break; } } - Ok(GenerateOutcome { - emitted_tokens: emitted, + Ok(GenerateOutcome::timed( + emitted, finish, - prefill_ms: 0, - decode_ms: t0.elapsed().as_millis() as u64, - sampling: None, - }) + 0, + t0.elapsed().as_millis() as u64, + None, + clock.times(), + )) } } diff --git a/crates/aien-serve-http/src/lib.rs b/crates/aien-serve-http/src/lib.rs index d5787984..8a5a9c67 100644 --- a/crates/aien-serve-http/src/lib.rs +++ b/crates/aien-serve-http/src/lib.rs @@ -22,6 +22,7 @@ pub mod chip_reservation; pub mod codec; pub mod cpu_engine; +pub mod decode_timeline; pub mod engine; pub mod kv_persist; pub mod omega_engine; diff --git a/crates/aien-serve-http/src/main.rs b/crates/aien-serve-http/src/main.rs index 97022f2d..1f9e3370 100644 --- a/crates/aien-serve-http/src/main.rs +++ b/crates/aien-serve-http/src/main.rs @@ -269,6 +269,11 @@ fn main() -> ExitCode { print!("{}", build_info()); return ExitCode::SUCCESS; } + // The decode timeline's checker: `--check-decode-timeline FILE [--drop REC:host|dev:IDX]`. + let argv: Vec = std::env::args().skip(1).collect(); + if argv.first().map(String::as_str) == Some("--check-decode-timeline") { + return ExitCode::from(aien_serve_http::decode_timeline::run_check(&argv[1..])); + } let mut args = match parse_args() { Ok(a) => a, Err(e) => { diff --git a/crates/aien-serve-http/src/omega_engine.rs b/crates/aien-serve-http/src/omega_engine.rs index 3cfaa429..1df60846 100644 --- a/crates/aien-serve-http/src/omega_engine.rs +++ b/crates/aien-serve-http/src/omega_engine.rs @@ -30,7 +30,9 @@ 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::engine::{ + Engine, EngineError, FinishReason, GenerateOutcome, GenerateParams, ReplyClock, +}; use crate::kv_persist::PersistState; use crate::sampling::SamplingObserver; @@ -434,6 +436,9 @@ impl Engine for OmegaDoor { p: &GenerateParams, on_token: &mut dyn FnMut(u32) -> bool, ) -> Result { + // This engine does not report its chip time: chip_ns stays 0, so the host overhead the + // outcome reports is the whole decode wall. + let mut clock = ReplyClock::new(Instant::now()); let max = self.engine.max_context_tokens(); if prompt.is_empty() { return Err(EngineError::Failed("empty prompt".into())); @@ -486,9 +491,13 @@ impl Engine for OmegaDoor { // The server's own sampler, so CPU and Omega engines pick tokens the same way. let mut observer = SamplingObserver::new(p); let mut sampler = |logits: &[f32], step: usize| observer.sample(logits, step); + let mut timed_on_token = |t: u32| { + clock.emitted(Instant::now()); + on_token(t) + }; let o = self .engine - .generate_with(prompt, &q, &mut sampler, on_token) + .generate_with(prompt, &q, &mut sampler, &mut timed_on_token) .map_err(EngineError::Failed)?; let sampling = observer.record(); self.reused_last @@ -507,19 +516,21 @@ impl Engine for OmegaDoor { "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 ); - Ok(GenerateOutcome { - emitted_tokens: o.emitted_tokens, - finish: match o.finish { - omega::FinishReason::Stop => FinishReason::Stop, - omega::FinishReason::Length => FinishReason::Length, - omega::FinishReason::Cancelled => FinishReason::Cancelled, - // A constraint finished the output: complete, which HTTP clients read as "stop". - omega::FinishReason::Constraint => FinishReason::Stop, - }, - prefill_ms: o.prefill_ms, - decode_ms: o.decode_ms, - sampling: Some(sampling), - }) + let finish = match o.finish { + omega::FinishReason::Stop => FinishReason::Stop, + omega::FinishReason::Length => FinishReason::Length, + omega::FinishReason::Cancelled => FinishReason::Cancelled, + // A constraint finished the output: complete, which HTTP clients read as "stop". + omega::FinishReason::Constraint => FinishReason::Stop, + }; + Ok(GenerateOutcome::timed( + o.emitted_tokens, + finish, + o.prefill_ms, + o.decode_ms, + Some(sampling), + clock.times(), + )) } fn persistence_status(&self) -> Option { diff --git a/crates/aien-serve-http/src/qwen36_batch.rs b/crates/aien-serve-http/src/qwen36_batch.rs index 476f138a..57603000 100644 --- a/crates/aien-serve-http/src/qwen36_batch.rs +++ b/crates/aien-serve-http/src/qwen36_batch.rs @@ -28,11 +28,13 @@ use std::time::{Duration, Instant}; use aien_inference_abi::qwen38::Qwen38Config; use aien_inference_abi::qwen38_omega::{ - need_bytes, Qwen38Omega, Qwen38Snapshot, RowFeed, RowOut, RowTest, IM_START, + need_bytes, Qwen38Omega, Qwen38Snapshot, RowFeed, RowOut, RowTest, RowTimeline, IM_START, }; +use crate::decode_timeline::{timeline_now_ns, BeatSums, Kind, Recorder}; use crate::engine::{ - Engine, EngineError, FinishReason, GenerateOutcome, GenerateParams, GroupJob, TestSwitches, + Engine, EngineError, FinishReason, GenerateOutcome, GenerateParams, GroupJob, ReplyClock, + TestSwitches, }; use crate::omega_engine::{GpuLock, GPU_LOCK_PATH}; use crate::qwen38_engine::{ @@ -63,6 +65,16 @@ fn env_usize(name: &str, default: usize) -> usize { } } +/// The chip lock the live server takes at load and per busy spell. `AIEN_SERVE_GPU_LOCK` points +/// it at a private file so a live server never waits behind test jobs on `/tmp/aien-gb10.lock` +/// (coordinator 2026-10-21: serving has priority over chip tests). Added by 61cad330 on +/// ship/motor-l387 and lost when the batch door moved its load under the lock on main. +fn serve_lock_path() -> PathBuf { + std::env::var_os("AIEN_SERVE_GPU_LOCK") + .map(PathBuf::from) + .unwrap_or_else(|| PathBuf::from(GPU_LOCK_PATH)) +} + fn prompt_per_beat() -> Result { match std::env::var("AIEN_Q36_PROMPT_PER_BEAT") { Ok(v) => match v.parse::() { @@ -146,6 +158,16 @@ pub trait RowStep: Send + 'static { fn row_snapshot(&mut self, r: usize, snap: &mut Self::Snap) -> Result<(), String>; /// Puts a copy back into row `r` (any row). fn row_restore(&mut self, r: usize, snap: &Self::Snap) -> Result<(), String>; + /// The decode timeline ([`crate::decode_timeline`]): per-launch chip stamps and host marks on + /// every row's one-row step. The default refuses, so a switched-on door fails at load rather + /// than recording nothing. + fn set_row_stamps(&mut self, _on: bool) -> Result<(), String> { + Err("this row stepper has no decode timeline".into()) + } + /// Row `r`'s last one-row token as the timeline reads it. + fn row_timeline(&self, _r: usize) -> Result { + Err("this row stepper has no decode timeline".into()) + } } impl RowStep for Qwen38Omega { @@ -175,6 +197,13 @@ impl RowStep for Qwen38Omega { fn row_restore(&mut self, r: usize, snap: &Qwen38Snapshot) -> Result<(), String> { Qwen38Omega::row_restore(self, r, snap) } + fn set_row_stamps(&mut self, on: bool) -> Result<(), String> { + Qwen38Omega::set_row_stamps(self, on); + Ok(()) + } + fn row_timeline(&self, r: usize) -> Result { + Qwen38Omega::row_timeline(self, r) + } } /// A request handed to the scheduler. The channel carries a `Vec`: one request, or a group @@ -354,6 +383,11 @@ struct Active { /// The merge train's row swap still owed: at this decode step (from 1), at the first beat /// from it on with another conversation decoding, the two trade rows (negative control). swap_due: Option, + /// DRA-66: the reply's host-clock times (from `job.t_queued`); a decoding row is charged + /// the chip time of every step (prefill chunks included) in each beat it decoded in + /// (`decoded_beat`). + clock: ReplyClock, + decoded_beat: bool, } impl Active { @@ -399,7 +433,7 @@ impl Qwen36BatchDoor { let keep = keep_free()?; let mut t0 = Instant::now(); let (lock, mut model) = admit_then_open( - || GpuLock::acquire_queued_at(Path::new(GPU_LOCK_PATH), LOAD_LOCK_WAIT), + || GpuLock::acquire_queued_at(&serve_lock_path(), LOAD_LOCK_WAIT), mem_available, need, keep, @@ -439,13 +473,16 @@ impl Qwen36BatchDoor { after >> 20, rss_bytes() as f64 / 1e9, ); - let mut door = Self::with_stepper( + let mut door = Self::with_stepper_timeline( model, max_context, - PathBuf::from(GPU_LOCK_PATH), + serve_lock_path(), REQUEST_LOCK_WAIT, per_beat, std::env::var(CHIP_GREEDY_ENV).as_deref() != Ok("0"), + Recorder::path_from_env() + .map(|p| Kind::from_env().map(|k| (p, k))) + .transpose()?, )?; door.slot_bytes_measured = measured; door.slot_bytes_on_paper = on_paper; @@ -461,11 +498,53 @@ impl Qwen36BatchDoor { lock_wait: Duration, prompt_per_beat: usize, chip_greedy: bool, + ) -> Result { + Self::with_stepper_timeline( + model, + max_context, + lock_path, + lock_wait, + prompt_per_beat, + chip_greedy, + None, + ) + } + + /// [`Self::with_stepper`] with the decode timeline of `kind` written to `timeline` + /// ([`crate::decode_timeline`]; `None`: off). A [`Kind::Launch`] timeline turns the chip + /// stamps on, and a stepper that cannot stamp refuses the door; a [`Kind::Token`] receipt + /// leaves them off. + pub fn with_stepper_timeline( + mut model: S, + max_context: usize, + lock_path: PathBuf, + lock_wait: Duration, + prompt_per_beat: usize, + chip_greedy: bool, + timeline: Option<(PathBuf, Kind)>, ) -> Result { let slots = model.row_count(); if slots == 0 { return Err("qwen36-batch: no rows".into()); } + let timeline = match timeline { + Some((p, Kind::Launch)) => { + model.set_row_stamps(true)?; + eprintln!( + "aien-serve-http: qwen36-batch: decode timeline ON, writing {} (chip stamps on every one-row launch: not a speed run)", + p.display() + ); + Some(Recorder::open(&p, Kind::Launch)?) + } + Some((p, Kind::Token)) => { + eprintln!( + "aien-serve-http: qwen36-batch: per-token receipt ON, writing {} (chip stamps off)", + p.display() + ); + Some(Recorder::open(&p, Kind::Token)?) + } + None => None, + }; let (tx, rx) = mpsc::channel::>(); let sched = Scheduler { model, @@ -488,6 +567,7 @@ impl Qwen36BatchDoor { pf_min: env_usize("AIEN_Q36_PREFILL_MIN", Q36_PREFILL_MIN).max(1), chip_greedy, beat: 0, + timeline, }; std::thread::Builder::new() .name("qwen36-batch".into()) @@ -682,6 +762,8 @@ struct Scheduler { /// Greedy replies take the graph's token (`AIEN_SERVE_CHIP_GREEDY=0` turns it off). chip_greedy: bool, beat: u64, + /// The decode timeline ([`crate::decode_timeline`]); `None` (the default): off. + timeline: Option, } /// Totals over one busy spell (first arrival to last departure). @@ -691,8 +773,32 @@ struct Spell { steps: u64, row_tokens: u64, decode_tokens: u64, + /// Host wall and chip time of every step call (prefill chunks included). wall_ns: u64, chip_ns: u64, + /// DRA-66: replies that got a first token, and the sum of their times to it. + replies: u64, + ttft_ns: u64, + /// DRA-66: beats that fed at least one decoding row, the sum of their periods (join to the + /// next join or idle, host clock), of their chip time (every step in the beat), and of + /// `period - chip` per beat. + decode_beats: u64, + total_ns: u64, + decode_chip_ns: u64, + host_overhead_ns: u64, +} + +impl Spell { + /// A decoding beat that began at `t0` with `chip_ns` of chip time closes at `now`. + fn close_beat(&mut self, open: Option<(Instant, u64)>, now: Instant) { + if let Some((t0, chip_ns)) = open { + let period = now.saturating_duration_since(t0).as_nanos() as u64; + self.decode_beats += 1; + self.total_ns += period; + self.decode_chip_ns += chip_ns; + self.host_overhead_ns += period.saturating_sub(chip_ns); + } + } } impl Scheduler { @@ -700,20 +806,33 @@ impl Scheduler { let mut active: Vec = Vec::new(); let mut lock: Option = None; let (mut spell, mut spell_t0) = (Spell::default(), Instant::now()); + // The last decoding beat's join and chip time, closed at the next join or idle. + let mut open_beat: Option<(Instant, u64)> = None; loop { // Idle: wait for a request, then take the chip. if active.is_empty() { + spell.close_beat(open_beat.take(), Instant::now()); + if let Some(tl) = self.timeline.as_mut() { + tl.idle(timeline_now_ns()); + } if lock.take().is_some() { let s = &spell; + let per = |ns: u64, n: u64| ns as f64 / 1e6 / n.max(1) as f64; eprintln!( - "aien-serve-http: qwen36-batch: spell over: {} beats, {} steps, {} row tokens ({} decoded), {:.1} ms/step wall, chip {:.1} ms/step, spell {:.1} s", + "aien-serve-http: qwen36-batch: spell over: {} beats, {} steps, {} row tokens ({} decoded), {:.1} ms/step wall, chip {:.1} ms/step, spell {:.1} s; {} replies, ttft {:.1} ms mean; {} decoding beats, per beat total {:.2} chip {:.2} host_overhead {:.3} ms mean", s.beats, s.steps, s.row_tokens, s.decode_tokens, - s.wall_ns as f64 / 1e6 / s.steps.max(1) as f64, - s.chip_ns as f64 / 1e6 / s.steps.max(1) as f64, + per(s.wall_ns, s.steps), + per(s.chip_ns, s.steps), spell_t0.elapsed().as_secs_f64(), + s.replies, + per(s.ttft_ns, s.replies), + s.decode_beats, + per(s.total_ns, s.decode_beats), + per(s.decode_chip_ns, s.decode_beats), + per(s.host_overhead_ns, s.decode_beats), ); } let Some(group) = self.waiting.take().or_else(|| self.rx.recv().ok()) else { @@ -739,6 +858,11 @@ impl Scheduler { } // Join: every waiting request or group that fits, in arrival order. A group joins whole, // all its jobs in this beat; while it waits for rows nothing behind it joins. + let beat_t0 = Instant::now(); + spell.close_beat(open_beat.take(), beat_t0); + if let Some(tl) = self.timeline.as_mut() { + tl.join(timeline_now_ns()); + } loop { let group = match self.waiting.take() { Some(g) => g, @@ -757,8 +881,12 @@ impl Scheduler { } // Sample one token for every decoding row from its logits; leave on stop / length / // cancel (a row still feeding its prompt leaves on cancel only). + if let Some(tl) = self.timeline.as_mut() { + tl.sample(timeline_now_ns()); + } let mut i = 0; while i < active.len() { + let first = active[i].emitted == 0; let finish = if active[i].prefilling() { active[i] .job @@ -768,6 +896,10 @@ impl Scheduler { } else { Self::sample_one(&mut active[i], self.max_context) }; + if first && active[i].emitted == 1 { + spell.replies += 1; + spell.ttft_ns += active[i].clock.times().ttft_ns; + } match finish { Some(f) => { let a = active.swap_remove(i); @@ -779,8 +911,19 @@ impl Scheduler { if active.is_empty() { continue; } + if let Some(tl) = self.timeline.as_mut() { + tl.feed(timeline_now_ns()); + } self.beat += 1; spell.beats += 1; + // DRA-66: the beat's step totals start here, so its chip time includes the prefill + // chunks below as well as the decode steps. + let (wall0, chip0, steps0) = (spell.wall_ns, spell.chip_ns, spell.steps); + let mut sums = BeatSums { + beat: self.beat, + prompt_rows: active.iter().filter(|a| a.prefilling()).count() as u64, + ..BeatSums::default() + }; Self::row_swaps_due(&mut active, &mut self.rows); // L369: a row with a long stretch of prompt left reads one chunk of it through the chip's // prefill this beat (its state ends as token by token would leave it). A chunk stops at @@ -893,6 +1036,13 @@ impl Scheduler { if feed.is_empty() { break; } + // The launch timeline records a beat that steps one decoding row and nothing else. + let stamp = self.timeline.as_ref().is_some_and(Recorder::stamps) + && active.len() == 1 + && feed.len() == 1 + && !active[who[0]].prefilling() + && tests[0].is_plain(); + let call0 = if stamp { timeline_now_ns() } else { 0 }; let t = Instant::now(); // The served path calls `step_rows` exactly as before; only a beat with a // switched row goes through `step_rows_test`. @@ -901,14 +1051,41 @@ impl Scheduler { } else { self.model.step_rows_test(&feed, &tests) }; + let call1 = if stamp { timeline_now_ns() } else { 0 }; spell.wall_ns += t.elapsed().as_nanos() as u64; spell.steps += 1; spell.row_tokens += feed.len() as u64; let m = feed.len() as u64; match r { - Ok(outs) if outs.len() == feed.len() => { + // A row that asked for logits and got none could never pick its next token: fail + // the step instead of leaving that request waiting forever. + Ok(outs) + if outs.len() == feed.len() + && feed + .iter() + .zip(&outs) + .all(|(f, o)| !f.logits || o.logits.is_some()) => + { + if stamp { + let rt = self.model.row_timeline(feed[0].row); + if let Some(tl) = self.timeline.as_mut() { + tl.stepped( + self.beat, + feed[0].row, + active[who[0]].steps, + (call0, call1), + &outs[0].stats, + rt, + ); + } + } for ((f, &k), o) in feed.iter().zip(&who).zip(outs) { spell.chip_ns += o.stats.chip_ns; + sums.launches += u64::from(o.stats.launches); + sums.submits += u64::from(o.stats.submits); + sums.graph_ns += o.stats.total_ns; + sums.record_ns += o.stats.record_ns; + sums.step_chip_ns += o.stats.chip_ns; let a = &mut active[k]; self.rows[a.row].history.push(f.token); if a.prefilling() { @@ -922,6 +1099,7 @@ impl Scheduler { if a.chip_greedy { a.chip_next = Some(o.token); } + a.decoded_beat = true; a.steps += 1; a.rows_sum += m; spell.decode_tokens += 1; @@ -934,7 +1112,18 @@ impl Scheduler { r => { let e = match r { Err(e) => e, - Ok(o) => format!("step_rows gave {} rows for {}", o.len(), feed.len()), + Ok(o) if o.len() != feed.len() => { + format!("step_rows gave {} rows for {}", o.len(), feed.len()) + } + Ok(o) => { + let rows: Vec = feed + .iter() + .zip(&o) + .filter(|(f, o)| f.logits && o.logits.is_none()) + .map(|(f, _)| f.row) + .collect(); + format!("step_rows gave no logits for row(s) {rows:?} that asked for them") + } }; eprintln!("aien-serve-http: qwen36-batch: step over {m} rows failed: {e}"); for a in active.drain(..) { @@ -944,6 +1133,22 @@ impl Scheduler { } } } + // DRA-66: every row that decoded this beat waited for all of it, so each is charged + // the chip time of every step in the beat (prefill chunks included). + sums.chip_ns = spell.chip_ns - chip0; + sums.step_ns = spell.wall_ns - wall0; + sums.steps = spell.steps - steps0; + for a in active.iter_mut().filter(|a| a.decoded_beat) { + a.decoded_beat = false; + a.clock.chip(sums.chip_ns); + sums.rows += 1; + } + if sums.rows > 0 { + open_beat = Some((beat_t0, sums.chip_ns)); + if let Some(tl) = self.timeline.as_mut() { + tl.beat(sums); + } + } } } @@ -1004,6 +1209,7 @@ impl Scheduler { active.len() + 1, ); let observer = SamplingObserver::new(&job.params); + let clock = ReplyClock::new(job.t_queued); let job_swap = job.test.row_swap.filter(|&k| k >= 1); let chip_greedy = self.chip_greedy && observer.is_greedy(); active.push(Active { @@ -1024,6 +1230,8 @@ impl Scheduler { steps: 0, rows_sum: 0, swap_due: job_swap, + clock, + decoded_beat: false, }); } @@ -1088,6 +1296,7 @@ impl Scheduler { return Some(FinishReason::Cancelled); } a.emitted += 1; + a.clock.emitted(Instant::now()); // The last allowed token is not fed: nothing would read its logits. if a.emitted >= p.max_new_tokens || plen + a.emitted >= max_context { return Some(FinishReason::Length); @@ -1128,13 +1337,14 @@ impl Scheduler { } let ev = match err { Some(e) => Ev::Failed(e), - None => Ev::Done(GenerateOutcome { - emitted_tokens: a.emitted, + None => Ev::Done(GenerateOutcome::timed( + a.emitted, finish, - prefill_ms: a.prefill_ms, + a.prefill_ms, decode_ms, - sampling: Some(a.observer.record()), - }), + Some(a.observer.record()), + a.clock.times(), + )), }; let _ = a.job.send(ev); self.free.push(a.row); diff --git a/crates/aien-serve-http/src/qwen36_batch/tests.rs b/crates/aien-serve-http/src/qwen36_batch/tests.rs index ead5418f..2dbcd71c 100644 --- a/crates/aien-serve-http/src/qwen36_batch/tests.rs +++ b/crates/aien-serve-http/src/qwen36_batch/tests.rs @@ -294,6 +294,33 @@ fn the_graphs_greedy_token_equals_the_host_argmax_path() { assert_eq!(concurrent(8, None, 16), want); } +/// DRA-66: a reply's host-clock times add up (`host_overhead = total - chip`), and only the +/// chip of steps between the first and last token handed out is counted. +#[test] +fn a_reply_reports_total_chip_and_host_overhead() { + let (d, _) = door(1, None, 1); + let (words, o) = run(&d, &[3, 1, 4, 1, 5], &greedy(12)); + assert_eq!(words.len(), 12); + assert_eq!(o.emitted_tokens, 12); + assert!(o.ttft_ns > 0, "{o:?}"); + assert!(o.total_ns > 0, "{o:?}"); + assert_eq!(o.host_overhead_ns, o.total_ns - o.chip_ns, "{o:?}"); + // The fake reports no chip time: the whole decode wall is the host's share. + assert_eq!(o.chip_ns, 0); + let t0 = Instant::now(); + let mut c = crate::engine::ReplyClock::new(t0); + c.chip(7_000); // prefill: before the first token, not counted + c.emitted(t0 + Duration::from_micros(100)); + c.chip(30_000); + c.emitted(t0 + Duration::from_micros(150)); + c.chip(5_000); // a stop token's step: never handed out, not counted + let t = c.times(); + assert_eq!( + (t.ttft_ns, t.total_ns, t.chip_ns, t.host_overhead_ns), + (100_000, 50_000, 30_000, 20_000) + ); +} + // ---- the merge train's per-request switches (L384) ---- /// The fake honors the switches as the chip does: a mutant changes the row's own words and no @@ -871,13 +898,14 @@ fn a_reader_that_fell_behind_fails_even_when_its_done_fits() { }); // The reader has taken both queued tokens: the job's last event fits now. drained_rx.recv().unwrap(); - job.send(Ev::Done(GenerateOutcome { - emitted_tokens: 3, - finish: FinishReason::Cancelled, - prefill_ms: 0, - decode_ms: 0, - sampling: None, - })) + job.send(Ev::Done(GenerateOutcome::timed( + 3, + FinishReason::Cancelled, + 0, + 0, + None, + crate::engine::ReplyTimes::default(), + ))) .expect("Done fits after the drain"); drop(job); let (mut r, got) = consumer.join().unwrap(); @@ -887,3 +915,446 @@ fn a_reader_that_fell_behind_fails_even_when_its_done_fits() { other => panic!("a truncated reply reported as {other:?}"), } } + +/// The decode timeline over the fake: [`Fake`] plus the row timeline a chip graph gives, a fixed +/// launch sequence (one layer and the exact head) with 100 ns chip stamps. +struct StampFake { + inner: Fake, + on: bool, + asked: Arc, + last: Vec, +} + +const STAMP_KINDS: [&str; 21] = [ + "norm", "mix", "ab", "gdn", "o_proj", "res", "router", "gate_up", "swiglu", "down", "gather", + "res", "norm", "lm_head", "lm_head", "lm_head", "argmax", "argmax", "lm_head", "argmax", + "argmax", +]; + +impl RowStep for StampFake { + type Snap = (u64, usize); + fn row_snapshot(&mut self, r: usize, snap: &mut (u64, usize)) -> Result<(), String> { + self.inner.row_snapshot(r, snap) + } + fn row_restore(&mut self, r: usize, snap: &(u64, usize)) -> Result<(), String> { + self.inner.row_restore(r, snap) + } + fn row_count(&self) -> usize { + self.inner.row_count() + } + fn row_reset(&mut self, r: usize) -> Result<(), String> { + self.inner.row_reset(r) + } + fn step_rows(&mut self, feed: &[RowFeed]) -> Result, String> { + if !self.on || feed.len() != 1 { + return self.inner.step_rows(feed); + } + let h0 = timeline_now_ns(); + let h1 = timeline_now_ns(); + std::thread::sleep(Duration::from_micros(50)); // the list build + let rec = timeline_now_ns() - h1; + // Submit and wait: the chip's 200 us, of which the device span covers n * 100 ns and the + // submit and marker poll the 20 us `chip_ns` holds besides (DRA-66 `submit_poll`). + std::thread::sleep(Duration::from_micros(200)); + let mut outs = self.inner.step_rows(feed)?; + let total = timeline_now_ns() - h1; + let h2 = timeline_now_ns(); + let h3 = timeline_now_ns(); + let n = STAMP_KINDS.len(); + let base = 7_000_000_000 + h1; + self.last[feed[0].row] = RowTimeline { + host: [h0, h1, h2, h3], + stamps: (0..=n as u64).map(|i| base + i * 100).collect(), + kinds: STAMP_KINDS.iter().map(|k| k.to_string()).collect(), + }; + outs[0].stats = GraphStats { + launches: n as u32, + submits: 1, + chip_ns: n as u64 * 100 + 20_000, + record_ns: rec, + total_ns: total, + ..Default::default() + }; + Ok(outs) + } + fn set_row_stamps(&mut self, on: bool) -> Result<(), String> { + self.asked.fetch_add(1, Ordering::SeqCst); + self.on = on; + Ok(()) + } + fn row_timeline(&self, r: usize) -> Result { + self.asked.fetch_add(1, Ordering::SeqCst); + Ok(self.last[r].clone()) + } +} + +fn stamp_fake(rows: usize) -> (StampFake, Arc) { + let (inner, _) = Fake::new(rows, None); + let asked = Arc::new(AtomicUsize::new(0)); + ( + StampFake { + inner, + on: false, + asked: Arc::clone(&asked), + last: vec![RowTimeline::default(); rows], + }, + asked, + ) +} + +/// Waits for the scheduler's idle flush: `n` lines in `path`. +fn timeline_lines(path: &Path, n: usize) -> String { + for _ in 0..200 { + let t = std::fs::read_to_string(path).unwrap_or_default(); + if t.lines().count() >= n { + return t; + } + std::thread::sleep(Duration::from_millis(10)); + } + std::fs::read_to_string(path).unwrap_or_default() +} + +/// Every decode beat of one conversation is one complete, gap-free record; the words are the +/// request alone's; dropping one record, one host phase or one launch turns the checker red. +#[test] +fn decode_timeline_records_every_single_row_beat() { + let path = lock_file().with_extension("timeline.jsonl"); + let (f, asked) = stamp_fake(1); + let d = Qwen36BatchDoor::with_stepper_timeline( + f, + 4096, + lock_file(), + Duration::from_secs(5), + 1, + true, + Some((path.clone(), Kind::Launch)), + ) + .unwrap(); + let prompt: Vec = (0..5).map(|k| (k * 13 + 1) % VOCAB as u32).collect(); + let (words, _) = run(&d, &prompt, &greedy(20)); + assert_eq!(words, alone(&prompt, 20), "the timeline changed the words"); + // 20 tokens: the first from the prompt's last step, then 19 decode steps. + let text = timeline_lines(&path, 19); + let recs = crate::decode_timeline::read_jsonl(&text).unwrap(); + assert_eq!(recs.len(), 19, "{text}"); + assert_eq!(crate::decode_timeline::check(&recs), Vec::::new()); + for w in recs.windows(2) { + assert_eq!(w[1].beat, w[0].beat + 1); + assert_eq!(w[1].step, w[0].step + 1); + } + assert!(asked.load(Ordering::SeqCst) >= 20); + let mut no_rec = recs.clone(); + no_rec.remove(7); + assert!(!crate::decode_timeline::check(&no_rec).is_empty()); + let mut no_host = recs.clone(); + no_host[3].host.remove(4); + assert!(!crate::decode_timeline::check(&no_host).is_empty()); + let mut no_dev = recs.clone(); + no_dev[11].dev.remove(9); + assert!(!crate::decode_timeline::check(&no_dev).is_empty()); + let s = crate::decode_timeline::summary(&recs); + assert!(s.contains("\"dev:head_recheck\" -> {100, "), "{s}"); + assert!(s.contains("\"submit_poll\" -> {20000, "), "{s}"); + assert!(s.ends_with(crate::decode_timeline::GATE_WL), "{s}"); + // `AIEN_Q36_DECODE_TIMELINE_KEEP=`: keep this host run for the checker CLI. + if let Some(keep) = std::env::var_os("AIEN_Q36_DECODE_TIMELINE_KEEP") { + std::fs::copy(&path, keep).unwrap(); + } + let _ = std::fs::remove_file(&path); +} + +/// Switched off (the default), the door never asks the stepper for stamps or a timeline. +#[test] +fn decode_timeline_off_never_asks() { + let (f, asked) = stamp_fake(2); + let d = Qwen36BatchDoor::with_stepper(f, 4096, lock_file(), Duration::from_secs(5), 1, true) + .unwrap(); + let prompt = [3u32, 1, 4, 1, 5]; + let (words, _) = run(&d, &prompt, &greedy(10)); + assert_eq!(words, alone(&prompt, 10)); + assert_eq!(asked.load(Ordering::SeqCst), 0); +} + +/// A stepper without a timeline refuses a switched-on door instead of recording nothing. +#[test] +fn decode_timeline_refused_without_stamps() { + let (f, _) = Fake::new(1, None); + let path = lock_file().with_extension("refused.jsonl"); + let r = Qwen36BatchDoor::with_stepper_timeline( + f, + 4096, + lock_file(), + Duration::from_secs(5), + 1, + true, + Some((path.clone(), Kind::Launch)), + ); + assert!(r.is_err()); + assert!(!path.exists()); +} + +/// A [`Fake`] that times every step as a graph would report it (list build, then the step as +/// "chip"), and with `flat` scales the logits into [0, 2] so a sampled draw has real choices. +struct ChipFake { + inner: Fake, + flat: bool, +} + +impl RowStep for ChipFake { + type Snap = (u64, usize); + fn row_snapshot(&mut self, r: usize, snap: &mut (u64, usize)) -> Result<(), String> { + self.inner.row_snapshot(r, snap) + } + fn row_restore(&mut self, r: usize, snap: &(u64, usize)) -> Result<(), String> { + self.inner.row_restore(r, snap) + } + fn row_count(&self) -> usize { + self.inner.row_count() + } + fn row_reset(&mut self, r: usize) -> Result<(), String> { + self.inner.row_reset(r) + } + fn step_rows(&mut self, feed: &[RowFeed]) -> Result, String> { + let t0 = Instant::now(); + std::thread::sleep(Duration::from_micros(40)); // the list build + let record_ns = t0.elapsed().as_nanos() as u64; + let c0 = Instant::now(); + let mut outs = self.inner.step_rows(feed)?; + let chip_ns = c0.elapsed().as_nanos() as u64; + outs[0].stats = GraphStats { + launches: STAMP_KINDS.len() as u32, + submits: 1, + chip_ns, + record_ns, + total_ns: t0.elapsed().as_nanos() as u64, + ..Default::default() + }; + if self.flat { + for l in outs.iter_mut().filter_map(|o| o.logits.as_mut()) { + l.iter_mut().for_each(|x| *x /= 500_000.0); + } + } + Ok(outs) + } +} + +fn chip_door(rows: usize, flat: bool, receipt: Option<&Path>) -> Qwen36BatchDoor { + let (inner, _) = Fake::new(rows, None); + Qwen36BatchDoor::with_stepper_timeline( + ChipFake { inner, flat }, + 4096, + lock_file(), + Duration::from_secs(5), + 1, + true, + receipt.map(|p| (p.to_path_buf(), Kind::Token)), + ) + .unwrap() +} + +/// The receipt's lines once the door has gone idle (the count stops changing). +fn settled_lines(path: &Path) -> String { + let mut last = String::new(); + for _ in 0..100 { + std::thread::sleep(Duration::from_millis(30)); + let t = std::fs::read_to_string(path).unwrap_or_default(); + if !t.is_empty() && t == last { + return t; + } + last = t; + } + last +} + +/// DRA-66: the per-token receipt at 1 and then 8 conversations: the words are each request's +/// alone, every decoding beat is one green record, both 1-row and 8-row clean beats appear, the +/// replies' host overhead is total minus chip, and dropping a record turns the checker (library +/// and CLI) red. +#[test] +fn token_receipt_at_one_and_eight_conversations() { + let path = lock_file().with_extension("tokens.jsonl"); + let d = Arc::new(chip_door(8, false, Some(&path))); + let solo: Vec = (0..5).map(|k| (k * 13 + 1) % VOCAB as u32).collect(); + let (words, o) = run(&d, &solo, &greedy(20)); + assert_eq!(words, alone(&solo, 20)); + assert!(o.chip_ns > 0 && o.chip_ns <= o.total_ns, "{o:?}"); + assert_eq!(o.host_overhead_ns, o.total_ns - o.chip_ns); + let one = settled_lines(&path); + let hs: Vec<_> = (0..8u32) + .map(|i| { + let d = Arc::clone(&d); + let p: Vec = (0..5) + .map(|k| (k * 7 + i * 19 + 2) % VOCAB as u32) + .collect(); + std::thread::spawn(move || (run(&d, &p, &greedy(30)).0, p)) + }) + .collect(); + for h in hs { + let (w, p) = h.join().unwrap(); + assert_eq!(w, alone(&p, 30)); + } + let text = settled_lines(&path); + let recs: Vec = + crate::decode_timeline::read_jsonl_as(&text).unwrap(); + // 20 tokens alone: the first from the prompt's last step, then 19 decoding beats. + assert_eq!(one.lines().count(), 19, "{one}"); + assert_eq!( + crate::decode_timeline::check_tokens(&recs), + Vec::::new() + ); + let clean = |k: u64| { + recs.iter() + .filter(|r| r.rows == k && r.prompt_rows == 0) + .count() + }; + // The solo reply's 19 beats come first, each one clean row. + assert!( + recs[..19].iter().all(|r| r.rows == 1 && r.prompt_rows == 0), + "{text}" + ); + assert!(clean(8) >= 10, "{text}"); + assert!(recs + .iter() + .all(|r| r.chip_ns > 0 && r.host_overhead_ns < r.total_ns)); + let mut no_rec = recs.clone(); + no_rec.remove(5); + assert!(!crate::decode_timeline::check_tokens(&no_rec).is_empty()); + let mut bent = recs.clone(); + bent[2].chip_ns += 1; + assert!(!crate::decode_timeline::check_tokens(&bent).is_empty()); + let s = crate::decode_timeline::summary_tokens(&recs); + assert!(s.contains("\"host_overhead_ns\" -> {"), "{s}"); + let p = path.to_string_lossy().into_owned(); + let drop = |d: &str| crate::decode_timeline::run_check(&[p.clone(), "--drop".into(), d.into()]); + assert_eq!(drop("0:record:0"), 1, "the negative control must go red"); + assert_eq!(crate::decode_timeline::run_check(&[p.clone()]), 0); + // `AIEN_Q36_TOKEN_RECEIPT_KEEP=`: keep this host run for the checker CLI. + if let Some(keep) = std::env::var_os("AIEN_Q36_TOKEN_RECEIPT_KEEP") { + std::fs::copy(&path, keep).unwrap(); + } + let _ = std::fs::remove_file(&path); +} + +fn sampled(seed: u64, n: usize) -> GenerateParams { + GenerateParams { + temperature: 0.7, + seed, + ..greedy(n) + } +} + +/// The door's words for `seed` at T=0.7, alone and beside seven other seeded requests. +fn seeded_words(params: impl Fn(u64) -> GenerateParams) -> (Vec>, Vec) { + let prompt = [5u32, 9, 2, 6, 5]; + let alone: Vec> = [1u64, 2, 3, 1] + .iter() + .map(|&s| run(&chip_door(1, true, None), &prompt, ¶ms(s)).0) + .collect(); + let d = Arc::new(chip_door(8, true, None)); + let hs: Vec<_> = (1..=8u64) + .map(|s| { + let (d, p) = (Arc::clone(&d), params(s)); + std::thread::spawn(move || run(&d, &prompt, &p).0) + }) + .collect(); + let beside = hs + .into_iter() + .map(|h| h.join().unwrap()) + .collect::>(); + (alone, beside[0].clone()) +} + +/// What the honest door must show at T=0.7: three seeds give three different replies, a seed +/// repeats its reply, and seed 1 beside seven other requests says what it says alone. +fn seeds_hold(alone: &[Vec], beside: &[u32]) -> bool { + let spread = alone[0] != alone[1] && alone[1] != alone[2] && alone[0] != alone[2]; + spread && alone[0] == alone[3] && alone[0] == beside +} + +/// DRA-66 seed regression at T=0.7 through the batch door. The negative controls run first: +/// the two sampling mutants' effects (`ignore-seed`: every request on seed 0; `force-greedy`: +/// argmax at any temperature) applied to the requests must turn the check red, then the honest +/// run must be green. The process mutant is installed as the server does, so a debug-build run +/// with `AIEN_SAMPLING_MUTANT=ignore-seed` or `force-greedy` turns the honest leg itself red. +#[test] +fn seeds_spread_at_t07_through_the_batch_door() { + crate::sampling::install_mutant_from_env().unwrap(); + let ignore_seed = seeded_words(|_| sampled(0, 24)); + assert!( + !seeds_hold(&ignore_seed.0, &ignore_seed.1), + "ignore-seed must be red" + ); + let force_greedy = seeded_words(|s| GenerateParams { + temperature: 0.0, + ..sampled(s, 24) + }); + assert!( + !seeds_hold(&force_greedy.0, &force_greedy.1), + "force-greedy must be red" + ); + let honest = seeded_words(|s| sampled(s, 24)); + assert!(seeds_hold(&honest.0, &honest.1), "{honest:?}"); + assert!(honest.0.iter().all(|w| w.len() == 24)); +} + +/// A stepper that never returns logits, even when a feed asks for them. +struct NoLogits(Vec); + +impl RowStep for NoLogits { + type Snap = u64; + fn row_snapshot(&mut self, r: usize, snap: &mut u64) -> Result<(), String> { + *snap = self.0[r]; + Ok(()) + } + fn row_restore(&mut self, r: usize, snap: &u64) -> Result<(), String> { + self.0[r] = *snap; + Ok(()) + } + fn row_count(&self) -> usize { + self.0.len() + } + fn row_reset(&mut self, r: usize) -> Result<(), String> { + self.0[r] = 0; + Ok(()) + } + fn step_rows(&mut self, feed: &[RowFeed]) -> Result, String> { + Ok(feed + .iter() + .map(|f| { + self.0[f.row] = mix(self.0[f.row] ^ u64::from(f.token)); + RowOut { + token: (self.0[f.row] % 89) as u32 + 5, + logits: None, + stats: GraphStats::default(), + } + }) + .collect()) + } +} + +/// The prompt's last feed asks for logits; a stepper that returns none fails the request with a +/// clear error instead of leaving it waiting forever (the door used to hang here). +#[test] +fn missing_logits_fail_the_request() { + for chip_greedy in [true, false] { + let d = Qwen36BatchDoor::with_stepper( + NoLogits(vec![0; 2]), + 4096, + lock_file(), + Duration::from_secs(5), + 4, + chip_greedy, + ) + .unwrap(); + let (tx, rx) = std::sync::mpsc::channel(); + std::thread::spawn(move || { + let r = d.generate(&[3, 1, 4, 1, 5], &greedy(8), &mut |_| true); + let _ = tx.send(r.map(|_| ()).map_err(|e| format!("{e:?}"))); + }); + let r = rx + .recv_timeout(Duration::from_secs(20)) + .expect("the door hung on a step without the logits it asked for"); + let e = r.expect_err("a step without asked-for logits must fail the request"); + assert!(e.contains("no logits"), "error names the cause: {e}"); + } +} diff --git a/crates/aien-serve-http/src/qwen38_engine.rs b/crates/aien-serve-http/src/qwen38_engine.rs index d20bf6de..75a18885 100644 --- a/crates/aien-serve-http/src/qwen38_engine.rs +++ b/crates/aien-serve-http/src/qwen38_engine.rs @@ -29,7 +29,9 @@ use std::time::{Duration, Instant}; use aien_inference_abi::qwen38::Qwen38Config; use aien_inference_abi::qwen38_omega::{need_bytes, Qwen38Omega, Qwen38Session, Reuse}; -use crate::engine::{Engine, EngineError, FinishReason, GenerateOutcome, GenerateParams}; +use crate::engine::{ + Engine, EngineError, FinishReason, GenerateOutcome, GenerateParams, ReplyClock, +}; use crate::omega_engine::{GpuLock, GPU_LOCK_PATH}; use crate::sampling::SamplingObserver; @@ -223,6 +225,7 @@ impl Engine for Qwen38Door { }); } let t_lock = Instant::now(); + let mut clock = ReplyClock::new(t_lock); let lock = GpuLock::acquire_queued_at(&self.lock_path, self.lock_wait) .map_err(EngineError::Busy)?; let lock_wait_ms = t_lock.elapsed().as_millis(); @@ -244,7 +247,7 @@ impl Engine for Qwen38Door { let chip_greedy = observer.is_greedy() && std::env::var(CHIP_GREEDY_ENV).as_deref() != Ok("0"); let mut chip_next: Option = None; - let (mut emitted, mut chip_ns) = (0usize, 0u64); + let mut emitted = 0usize; let finish = loop { if emitted >= p.max_new_tokens || prompt.len() + emitted >= self.max_context { break FinishReason::Length; @@ -260,6 +263,7 @@ impl Engine for Qwen38Door { break FinishReason::Stop; } emitted += 1; + clock.emitted(Instant::now()); if !on_token(tok) { break FinishReason::Cancelled; } @@ -270,21 +274,22 @@ impl Engine for Qwen38Door { if chip_greedy { let (next, ns) = s.advance_greedy(tok).map_err(EngineError::Failed)?; chip_next = Some(next); - chip_ns += ns; + clock.chip(ns); } else { let (next, ns) = s.advance(tok).map_err(EngineError::Failed)?; logits = next; - chip_ns += ns; + clock.chip(ns); } }; let decode_ms = t1.elapsed().as_millis() as u64; + let times = clock.times(); let steps = emitted.saturating_sub(1).max(1) as f64; let reused = fs.reuse.map_or(0, Reuse::tokens); drop(s); drop(lock); let pf = &fs.prefill; eprintln!( - "aien-serve-http: qwen38: lock wait {lock_wait_ms} ms, prompt {} tok, reuse {:?} ({reused} tok), fed {} ({} stepped), prefill {prefill_ms} ms (gemm chip {} ms, gdn chip {} ms, attn chip {} ms, host {} ms, restore {} ms, snapshot {} ms), decode {emitted} tok in {decode_ms} ms, graph chip {:.1} ms/token, wall {:.1} ms/token, chip greedy {chip_greedy}", + "aien-serve-http: qwen38: lock wait {lock_wait_ms} ms, prompt {} tok, reuse {:?} ({reused} tok), fed {} ({} stepped), prefill {prefill_ms} ms (gemm chip {} ms, gdn chip {} ms, attn chip {} ms, host {} ms, restore {} ms, snapshot {} ms), decode {emitted} tok in {decode_ms} ms, ttft {:.3} ms, per token: total {:.3} ms, chip {:.3} ms, host overhead {:.3} ms, chip greedy {chip_greedy}", prompt.len(), fs.reuse.unwrap_or(Reuse::Cold), fs.fed, @@ -295,16 +300,19 @@ impl Engine for Qwen38Door { pf.host_ns / 1_000_000, fs.restore_ns / 1_000_000, fs.snapshot_ns / 1_000_000, - chip_ns as f64 / 1e6 / steps, - decode_ms as f64 / steps, + times.ttft_ns as f64 / 1e6, + times.total_ns as f64 / 1e6 / steps, + times.chip_ns as f64 / 1e6 / steps, + times.host_overhead_ns as f64 / 1e6 / steps, ); - Ok(GenerateOutcome { - emitted_tokens: emitted, + Ok(GenerateOutcome::timed( + emitted, finish, prefill_ms, decode_ms, - sampling: Some(observer.record()), - }) + Some(observer.record()), + times, + )) } } diff --git a/evidence/dra-66-host-time-20261031/PROTOCOL.md b/evidence/dra-66-host-time-20261031/PROTOCOL.md new file mode 100644 index 00000000..fffeccf6 --- /dev/null +++ b/evidence/dra-66-host-time-20261031/PROTOCOL.md @@ -0,0 +1,152 @@ +# DRA-66 host time per token: protocol + +Refs aien-dev/aien-sovereign-core-mv#857 (Linear DRA-66). Written before any chip run. Every chip +line below is NOT_RUN until the P-DRA-4 chip queue (`~/handoffs/pdra4-hive/chip/run-queue.sh`) has +run the two DRA-66 slices in `chip/`. + +## Binary + +- `/home/drakestapleton/work/dra-66/bin-head/aien-serve-http`, sha256 + `a33cc2abf545927b293316cca018ff81d492bacfdd8fb996dcc5dccdb02449e4`. +- Built from sovereign-core `9d70dca4eb41facf906092998c0033dcedbf84dd` (the binary reports + `sovereign-core commit: 9d70dca4… (dirty 0)`) with omega `a647b6a9` (`omega.lock`), physics + `048e5f5e`, aienos `b84c0a67`: + `scripts/pins.sh --gpu ~/work/dra-66/pins && . ~/work/dra-66/pins/env.sh && + nice -n 19 taskset -c 0-9 cargo build --release -p aien-serve-http --bin aien-serve-http + --target-dir ~/work/dra-66/target-gpu`. Native `libomega_gpu.a` linked (no CPU stub). +- The commits after 9d70dca4 on the branch touch only evidence files and the PR text. + +## Server + +The live 18091 flags on loopback port 18190: `--engine omega --model-dir +/home/drakestapleton/models/qwen3.6-35b-a3b-fp8-95a723d0 --port 18190 --bind 127.0.0.1 +--max-context 49152 --max-tokens-cap 16384 --thinking off --batch-slots 8`, env +`AIEN_GB10_LOCK_HELD=1 AIEN_Q36_STROKE=1 AIEN_STROKE_IN_WINDOW=1 AIEN_OMEGA_FP8_GROUPED_WAVE=0` +(the wave setting is the one 18091 actually serves; evidence in `chip/PLAN.md`). + +## Run: two P-DRA-4 chip-queue slices + +`chip/` holds the slices, byte-identical (`chip/SHA256SUMS`) to `~/handoffs/pdra4-hive/chip/DRA-66/`, +listed in `chip/QUEUE.txt` under `# Main (DRA-66)`: + +- `chip/s01-tokens.sh`: `mutant4-red`, `golden-identity`, `receipt-1conv`, `receipt-8conv`, + `seed-t07`, `check-tokens` (cap 889 s); +- `chip/s02-stamps.sh`: `stamps-1conv`, `check-stamps` (cap 377 s; refuses until s01 has a PASS + VERDICT); +- `chip/dra66-lib.sh`: the body both source; `chip/PLAN.md`: gates, caps, the Wolfram wall model, + the lock route and Main's steps after the window; `chip/dry-host.log`: the host dry path and its + negative controls. + +Main runs them with the rest of the queue (GO, preflight, 18091 and Flint down); the runner opens a +`--gb10 none --quiet exclusive --lease 20` window per slice (each slice's `# pdra4-gb10: none` +header) and caps each at 1140 s. Receipts: `~/handoffs/pdra4-hive/receipts/DRA-66//`, one-line +`VERDICT` each. + +Why the slice takes the chip lock: with `AIEN_GB10_LOCK_HELD=1` the server accepts an inherited +chip reservation only when the flock holder of `/tmp/aien-gb10.lock` is one of its ancestors +(`crates/aien-serve-http/src/chip_reservation.rs`, `detect`; refusal "none an ancestor of this +server", exit 1). spark-window's holder (`setsid spark-window _hold ID`) is never an ancestor, so in +a window that holds the chip the server cannot start. The slice takes the lock through `flock -w 90 +-E 75`, which is the ancestor of every server; it verifies that holder in `/proc/locks` (device and +inode) and in the server's own "chip reservation inherited" line. No new trust path; the window's +quiet lock keeps the timings quiet. This replaces the manual single-window `window.sh` (removed). + +## Gates and budget + +See `chip/PLAN.md` for the table. Each cap is enforced inside its gate: server load ≤ 180 s to +health, requests by `curl -m`, server stop ≤ 30 s then KILL. A gate starts only if its cap fits +before both the lease end and 1140 − 15 s after the slice started; otherwise it and the later gates +are NOT_RUN. Wolfram (MCP evaluator), quoted in full in `chip/PLAN.md`: caps 889 s and 377 s; expected +walls 222.1264576 s and 93.007232 s with 78 s loads and 5 s stops (476.1264576 s and 220.007232 s at +the 180 s load cap and 30 s stops), from the pinned DRA-64 model t(1) = 23.494 ms, t(8) = 83.7676 ms. + +`receipt.json` carries an overall `status`: FAIL if any gate failed, else NOT_RUN if any gate did +not run, else PASS (exit 4 / 3 / 0). That status covers the receipts' mechanics only; the 0.5 ms +verdict is Main's Wolfram evaluation of `s02-stamps/gate-red.wl` then `s02-stamps/gate.wl`. + +## The 0.5 ms gate + +`chip_ns` is the graph's own host-clock span from the first queue submit to the last +completion marker read back (omega `cmdlist.c` a647b6a9, `elapsed` from L390 to L399, summed +per chunk). It therefore holds host work besides the chip's: the submit, the marker poll (the +served 2000 µs spin, then 50 µs sleeps) and the marker read back. So the per-token receipt's +`host_overhead_ns = total_ns − chip_ns` is a LOWER bound of the host time per token, and is +labelled `hostLB`; it never carries a verdict alone. + +The stamped launch timeline measures the missing share. At one conversation a lone row takes +its own one-row graph (`rows.rs` `step_rows`, the lone-row path), the same graph as the token +arm, so per record `submit_poll = chip_ns − dev_span`, with `dev_span` the chip PTIMER span from +the first launch stamp to the last. The stamps' chip cost sits in both `chip_ns` and `dev_span`, +so it cancels to first order; the stamp buffer's own syncs fall outside `chip_ns` (cmdlist L372, +L404). Only `submits == 1` records count: with more chunks the host's emit between them lands in +`dev_span` but not in `chip_ns`. + +The gate is a sum of medians over two arms of the same window, `GATE_WL` in +`decode_timeline.rs`: +`{N[hostLB/10^6], N[submitPoll/10^6], N[(hostLB + submitPoll)/10^6], hostLB + submitPoll <= 500000}` +with `hostLB = Median[host_overhead_ns]` over the clean (rows 1, no prompt joining) beats of +records A..B and `submitPoll = Median[submit_poll]` over the single-submit stamped records. +`summary-stamps.wl` ends with it, so `gate.wl` evaluates to the verdict as its last result. + +Main's procedure, in one Wolfram session per file: +1. Evaluate `gate-red.wl`: the same slice with every beat 0.6 ms more host time + (`--bend host:600000`, consistent t0/t1/total/host share, shape green). The last result must + be `False`. If it is `True`, the gate is broken and `gate.wl` does not count. +2. Evaluate `gate.wl`. The last result's verdict is the gate: `True` PASS, `False` FAIL. + +Accounting notes (reviewer MINOR 7): +- The chip lock is taken once per spell before the first beat; its wait sits in TTFT and never + in a token record. +- The recorder writes and flushes one line per record at the next beat's start; that write + lands in the next beat's `total_ns`, so it counts as host time (conservative). + +The timing number is a quiet-window number only because the window holds the quiet lock +exclusively with 18091 and Flint down; `preconditions.txt` records the load average. The receipt's +`total_ns` is beat close to beat close on the host monotonic clock; `chip_ns` is the graphs' +reported submit-to-marker time for every step of the beat (prefill chunks included); +`host_overhead_ns = total_ns − chip_ns`. Beats where a prompt joined (`prompt_rows > 0`) are kept +in the receipt and excluded from the gate. + +## Host evidence (not chip qualification) + +- `host-token-receipt.jsonl`: the batch door over a timed fake stepper (`ChipFake`), 1 then 8 + conversations, 49 records; `--check-decode-timeline` exit 0, `--drop 3:record:0` exit 1 + (`host-token-check.err`, `host-token-drop.err`). `host-token-summary.wl` evaluated with the + Wolfram MCP gave `{19, 0.115041, True}` for the first version's gate query, which judged the + lower bound alone; the review (MAJOR 1) replaced it with `GATE_WL` below. Records 0..19 are the + one-conversation reply. The fake's sleep, not a chip number. +- `seed-red-green.log`: `seeds_spread_at_t07_through_the_batch_door` in a debug build is red + under `AIEN_SAMPLING_MUTANT=ignore-seed` and `force-greedy` (honest leg, tests.rs:1267), green + with it unset. +- `host-tests-2.log`: `nice -n 19 taskset -c 0-9 cargo test --release -p aien-serve-http`, all + green (before the review fixes). +- `host-tests-3.log`: the same command after the review fixes and the #787 fold: lib 92 passed, + 1 ignored; every other target green. +- `host-stamps.jsonl`: the stamped launch timeline of + `decode_timeline_records_every_single_row_beat` (`StampFake`: 200 µs host sleep before the + step, `submits` 1, `chip_ns` = dev span + 20000 ns), kept with + `AIEN_Q36_DECODE_TIMELINE_KEEP`; 19 records. +- `host-rev863.log`: every new CLI path, red first, with the commands and exits: `--bend 3:chip` + exit 1 then plain exit 0; `--slice 0:19` and `--bend host:600000 --slice 0:19` exit 0; stamped + `--drop 0:record:0` exit 1 then plain exit 0; usage errors exit 2 (a launch timeline with + `--bend`, an empty slice, a flag given twice); the lock-holder parse with the right device + (prints the flock pid) and a wrong one (prints nothing). +- Host gate files, each evaluated whole with the Wolfram MCP (last result = `GATE_WL`): + - `host-gate-red.wl` (slice 0..19 bent host:600000 + `host-summary-stamps.wl`) → + `{0.715041, 0.02, 0.735041, False}`; + - `host-gate-absorb.wl` (slice 0..19 + `host-stamps-absorb.jsonl`, where `chip_ns` takes the + whole `graph_submit_wait`, the shape of the review's "chip = step wall" mutant that stayed + green before; the checker still says GREEN) → `{0.115041, 0.628145, 0.743186, False}`; + - `host-gate.wl` (slice 0..19 + `host-summary-stamps.wl`) → `{0.115041, 0.02, 0.135041, True}`. + These exercise the queries on fakes; the numbers are the fakes' sleeps, not chip numbers. + The CLI runs used the host (CPU stub) build of 3cd0410d; 9d70dca4 differs from it only by + rustfmt and the regenerated `host-tests-3.log`. +- `chip/dry-host.log`: `DRY_RUN=1` runs of both slices on the host (no window, lock, GPU or + server): static checks, plans with caps, and the slices' own checker gates on + `host-token-receipt.jsonl` (slice 0..19, exits `0 1 1 1 0 0`) and `host-stamps.jsonl` (exits + `1 0`); the resulting `gate.wl` / `gate-red.wl` equal `host-gate.wl` / `host-gate-red.wl` from + line 2 on, and the Wolfram MCP gave `{0.715041, 0.02, 0.735041, False}` and + `{0.115041, 0.02, 0.135041, True}` for them. Negative controls: outside a window NOT_RUN exit 3 + with no VERDICT; a fake window NOT_RUN exit 3; the inner part with no ancestor holding the chip + lock NOT_RUN exit 3 before any chip query; a corrupted binary sha exit 3. + `queue-dry-run.log`: `run-queue.sh --dry-run` listing both slices `(gb10 none)`. diff --git a/evidence/dra-66-host-time-20261031/chip/PLAN.md b/evidence/dra-66-host-time-20261031/chip/PLAN.md new file mode 100644 index 00000000..c505a64f --- /dev/null +++ b/evidence/dra-66-host-time-20261031/chip/PLAN.md @@ -0,0 +1,128 @@ +# DRA-66 chip plan: host time per token (wall − chip) on the served 35B, as P-DRA-4 queue slices + +Issue: https://linear.app/drake-stapleton/issue/DRA-66 · aien-dev/aien-sovereign-core-mv#857 · draft PR #863 +(branch `dra-66/host-time-per-token`). Owner: DRA66Host (Main lane). Every chip line below is **NOT_RUN** +(host prep only; no GPU opened, no slice run, no GO). + +The repo copy (`evidence/dra-66-host-time-20261031/chip/`) and the queue copy +(`~/handoffs/pdra4-hive/chip/DRA-66/`) are byte-identical (`SHA256SUMS`). This replaces the earlier +single-window `window.sh` (removed in PR #863). + +## Binary and inputs (pinned by sha256 in `dra66-lib.sh`; a mismatch is NOT_RUN, exit 3) + +| file | sha256 | from | +|---|---|---| +| `~/work/dra-66/bin-head/aien-serve-http` | `a33cc2ab…49e4` | sovereign-core `9d70dca4` (binary reports it, dirty 0), omega `a647b6a9`, physics `048e5f5e`, aienos `b84c0a67`; native `libomega_gpu.a` (recipe in `../PROTOCOL.md`) | +| `evidence/q36-host-20261020/gen-chat-max-24.json` | `ec904017…a664` | gate2 golden, 24 `generated_ids` | +| model | — | `/home/drakestapleton/models/qwen3.6-35b-a3b-fp8-95a723d0` (`config.json` checked) | + +## Window and chip lock + +Both slices carry `# pdra4-gb10: none` (run-queue.sh sha256 `420b6cc7…`, `CHANGES-run-queue.md`). The +runner opens `spark-window open pdra4-DRA-66- --lease 20 --gb10 none --quiet exclusive --wait` and +runs `timeout 1140 spark-window run env Q36_EXTRA_WAIT=120 Q36_EXTRA_LEDGER=… ~/.local/bin/q36-extra `. + +- An aien-serve-http server accepts an inherited chip reservation (`AIEN_GB10_LOCK_HELD=1`) only when + the FLOCK holder of `/tmp/aien-gb10.lock` is one of its ancestors (`chip_reservation.rs` `detect`). + spark-window's holder (`setsid spark-window _hold ID`) never is, so a `--gb10 exclusive` window + cannot serve the door. The slice takes the lock itself: `flock -w 90 -E 75 /tmp/aien-gb10.lock bash + `; flock(1) is the ancestor of every server, `/proc/locks` (device + inode match) must name + it, and the server log must say `chip reservation inherited from ancestor pid `. + `AIEN_GB10_LOCK_HELD=1` is set only on the server command lines. No new trust path. +- flock exit 75 (lock not free in 90 s) becomes this slice's own `NOT_RUN` VERDICT and exit 3, so the + runner never mistakes it for a q36-extra refusal. The lock goes when the inner slice exits; + `timeout(1)` signals the whole process group at the cap (server, inner bash and flock(1) alike). +- The window's quiet lock (`--quiet exclusive`) is what keeps the timings quiet. + +Refusals before any chip contact (NOT_RUN, exit 3, VERDICT written inside a window, stdout only outside +one): no `SPARK_WINDOW`/`SPARK_WINDOW_DIR`; `spark-window id` ≠ `SPARK_WINDOW`; no `held` stamp; +`gb10` ≠ none or `quiet` ≠ exclusive; `AIEN_GB10_LOCK_HELD` already set; s02 only: s01-tokens has no +`PASS` VERDICT; lock not free in 90 s or its holder not an ancestor; 18091 answers `/health` or +anything listens on 18091/18300/18310; a compute process is on the chip; sha256 mismatch; the binary +has no native omega gpu engine; port 18190 busy. + +## Server + +The live 18091 flags on loopback port 18190: `--engine omega --model-dir --port 18190 --bind +127.0.0.1 --max-context 49152 --max-tokens-cap 16384 --thinking off --batch-slots 8`; env +`AIEN_GB10_LOCK_HELD=1 AIEN_Q36_STROKE=1 AIEN_STROKE_IN_WINDOW=1 AIEN_OMEGA_FP8_GROUPED_WAVE=0`. + +- `AIEN_OMEGA_FP8_GROUPED_WAVE=0` is explicit. The 18091 launcher + (`~/.local/state/aien-q36/start-35b-batch.sh`) leaves it unset and no script in + `~/.local/state/aien-q36/`, `~/.local/bin/` or the user systemd units sets it, so the served 35B + runs the omega `a647b6a9` default (off): `~/.local/state/aien-q36/serve.log` has its last + `(wave rule)` proof line at line 13207, none in the four starts at lines 70651-70706. + `bin/GATEKIT.md` names `=1` as the ship-env lever of `bin-cc45f45e` (its `BUILD.txt` line 5); this + issue measures the configuration actually served, so 0. A server whose log shows `(wave rule)` is + stopped and the gate is NOT_RUN. +- `AIEN_STROKE_IN_WINDOW` is read only by `qwen36_stroke_gate`; it has no effect on aien-serve-http + and is set for the queue convention. +- Load cap 180 s to `/health`: loads measured 39/57/78 s in the GoldenP04 window (2026-10-27, same + model and flags); the four latest 18091 starts reported `engine ready in` 112.4, 78.6, 32.9 and + 148.6 s (`serve.log` lines 70651-70706; the last a 4-row start). +- Server affinity and priority are inherited from the runner (recorded in `preconditions.txt`). + +## Slices (queue order; reds before greens) + +Receipts: `~/handoffs/pdra4-hive/receipts/DRA-66//`: `gate-.json` +(`aien.dra66-slice-gate/1`: window, binary sha and commit, lock holder pid, wave, start/end, +`deadline_left_s`, status, detail, sha256 of every file), `receipt.json` (`aien.dra66-slice/1`, status += FAIL > NOT_RUN > PASS over the gates) and the one-line `VERDICT` (`PASS|FAIL|NOT_RUN : ; first non-PASS: …`). Exit 0 PASS, 4 FAIL, 3 NOT_RUN. A gate starts only if its cap fits +before both the lease end and 1140 − 15 s after the slice process started; otherwise it and later +gates are NOT_RUN. Board lines come from the runner only. + +| slice | gate | content | expected | est. s | cap s | +|---|---|---|---|---|---| +| s01-tokens | (outer) | window checks, `flock -w 90` | lock free at once | ~0 | 90 | +| | `mutant4-red` | server with `AIEN_Q36_TEST_MUTANT=4`, gate2 request (24 greedy tokens), stop | `DIFFER` from the golden; else FAIL, exit 4 | 78 + 0.56 + 5 | 270 | +| | `golden-identity` | honest server, per-token receipt (`AIEN_Q36_DECODE_TIMELINE_KIND=token`), gate2 request, 2 s idle; records A | `IDENTICAL` | 78 + 0.56 + 2 | 240 | +| | `receipt-1conv` | 3 sequential greedy COUNT replies of 256 tokens, 2 s idle; records B > A + 1 | all answer | 18.04 + 2 | 92 | +| | `receipt-8conv` | 8 concurrent greedy replies of 256 tokens | all answer | 21.44 + 2 | 62 | +| | `seed-t07` | seed 1, seed 2, seed 1 at T = 0.7, 64 tokens | 1 repeats, 2 differs | 4.51 | 60 | +| | `check-tokens` | stop; checker on `tokens.jsonl`: check (0), `--drop 0:record:0` (1), `--drop n/2:record:0` (1), `--bend A+1:chip` (1), `--bend host:600000 --slice A:B` → `summary-red-host.wl` (0), `--slice A:B` → `summary-1conv.wl` (0) | exits `0 1 1 1 0 0` | 5 + 5 | 75 | +| s02-stamps | (outer) | as s01, plus s01-tokens `VERDICT` must start `PASS` | | ~0 | 90 | +| | `stamps-1conv` | honest server, stamped launch timeline (`AIEN_Q36_DECODE_TIMELINE`, default kind), 1 greedy COUNT reply of 128 tokens, 2 s idle, stop | answers, ≥ 1 record, ids = first 128 of s01 `solo-1.json` | 78 + 3.01 + 2 + 5 | 242 | +| | `check-stamps` | `--drop 0:record:0` (1), check → `summary-stamps.wl` (0); then `gate-red.wl` = s01 `summary-red-host.wl` + `summary-stamps.wl`, then `gate.wl` = s01 `summary-1conv.wl` + `summary-stamps.wl` | exits `1 0` | 5 | 45 | + +Wolfram (MCP evaluator), one query: +`t[n_, u_] := 9.13 + 3.29 n + 0.696 u + 4.81 Ceiling[n/4]; t1 = t[1, 9]; t8 = t[8, 55.6]; +cap01 = 90 + (180 + 60 + 30) + (180 + 60) + (3*30 + 2) + (60 + 2) + 3*20 + (30 + 45); +cap02 = 90 + (180 + 30 + 2 + 30) + 45; +s01[L_, st_] := 2 L + 2 st + (2*24 + 3*256 + 3*64) t1/1000 + 256 t8/1000 + 6 + 5; +s02[L_, st_] := L + 128 t1/1000 + 2 + st + 5; +{t1, t8, cap01, cap02, 1140 - 15 - cap01, 1140 - 15 - cap02, s01[78, 5], s01[180, 30], s02[78, 5], +s02[180, 30], cap01 + cap02, s01[78, 5] + s02[78, 5]}` +→ `{23.494, 83.7676, 889, 377, 236, 748, 222.1264576, 476.1264576, 93.007232, 220.007232, 1266, +315.1336896}` (s; t in ms). + +- Caps: s01 889 s, s02 377 s, each ≤ 1140 s. s01 runs every gate only if q36-extra's admission + (slot wait ≤ 120 s, memory wait) leaves 236 s or less used before the slice starts; s02 748 s. +- Expected: s01 222.1 s (load 78 s, stop 5 s), 476.1 s at the 180 s load cap and 30 s stops; s02 93.0 s + (220.0 s). Both slices 315.1 s expected, the same three loads as the old single window. +- The stamped reply is costed at the unstamped t(1); stamps slow the chip, its cap is 30 s. + +## Host dry path (no window, no lock, no GPU, no server; exercised 2026-10-31) + +`DRY_RUN=1 bash s01-tokens.sh` then `DRY_RUN=1 bash s02-stamps.sh`: static checks (binary, golden, model, +tools), the plan with caps, then the slice's own checker gate (`check_tokens` / `check_stamps`, the code +the chip run uses) on the committed host fixtures `../host-token-receipt.jsonl` (slice 0..19) and +`../host-stamps.jsonl`, into `/tmp/dra66-dry//` (never the receipts directory). Output in +`dry-host.log`. The dry `gate.wl` / `gate-red.wl` differ from `../host-gate.wl` / `../host-gate-red.wl` +only in the fixture path inside the first comment line, and Wolfram gives the same verdicts: +`gate-red.wl` → `{0.715041, 0.02, 0.735041, False}`, `gate.wl` → `{0.115041, 0.02, 0.135041, True}`. + +Negative controls in `dry-host.log`: outside a window → `NOT_RUN`, exit 3, no VERDICT written; a fake +window (temp copy, temp receipts) → `NOT_RUN … not the open window`, exit 3, VERDICT; the inner part +without an ancestor holding the chip lock (temp copy) → preconditions `NOT_RUN`, exit 3, no chip query; +the dry path with a corrupted `SHA_HEAD` (temp copy) → exit 3. + +## After the window (Main, host) + +1. Both VERDICTs; s01 `PASS` means the mutant went red before the honest golden was IDENTICAL, the + seed control held and every checker red fired. +2. Evaluate `receipts/DRA-66/s02-stamps/gate-red.wl` whole with the Wolfram MCP: the last result must be + `False`. If it is `True` the gate is broken and `gate.wl` does not count. +3. Evaluate `gate.wl`: last result `{hostLB ms, submit+poll ms, sum ms, sum <= 0.5 ms}`; `True` PASS, + `False` FAIL for "host time ≤ 0.5 ms per token at one conversation". Quote both replies. +4. Per-token host overhead at 1 and 8 conversations: `s01-tokens/summary-all.wl` (whole receipt). diff --git a/evidence/dra-66-host-time-20261031/chip/QUEUE.txt b/evidence/dra-66-host-time-20261031/chip/QUEUE.txt new file mode 100644 index 00000000..3c49a7dd --- /dev/null +++ b/evidence/dra-66-host-time-20261031/chip/QUEUE.txt @@ -0,0 +1,3 @@ +# DRA-66 lane order (Main; appended to chip/QUEUE.txt under "# Main (DRA-66)"); paths relative to chip/ +DRA-66/s01-tokens.sh +DRA-66/s02-stamps.sh diff --git a/evidence/dra-66-host-time-20261031/chip/SHA256SUMS b/evidence/dra-66-host-time-20261031/chip/SHA256SUMS new file mode 100644 index 00000000..e3fd8ebd --- /dev/null +++ b/evidence/dra-66-host-time-20261031/chip/SHA256SUMS @@ -0,0 +1,6 @@ +e384f6988d43f2dc0ba55b868f36381f33b63f44b014968cbeaf22e608a9061e dra66-lib.sh +bae07a0ed5f14ffbb2cdcfff66a452962aa313cc2a0a6d053e9a9b202cd9a1e5 s01-tokens.sh +f56956892f145a1b7dca6fa55dc3dbd8dfa15bebf058841d692a95c6c53d1143 s02-stamps.sh +fe056237e015c6bab27591e0f418e9de5333221bb38a0457fd45e6ed96c33b21 PLAN.md +c426a278a9945f754a13424a7567b77afc84106e37fadfc5fe52b63e53120dfd dry-host.log +5048e7df6d2a9b2451fb5c1b28a06918b5687f83a6ed756f1b27ee11fb33649c QUEUE.txt diff --git a/evidence/dra-66-host-time-20261031/chip/dra66-lib.sh b/evidence/dra-66-host-time-20261031/chip/dra66-lib.sh new file mode 100755 index 00000000..81321647 --- /dev/null +++ b/evidence/dra-66-host-time-20261031/chip/dra66-lib.sh @@ -0,0 +1,482 @@ +#!/usr/bin/env bash +# DRA-66 (sovereign #857, PR #863) chip slice library: sourced by sNN-*.sh, never run alone. +# The slice sets SLICE and GATES (gate names, run in order: reds before greens), then sources this. +# See PLAN.md beside it for the gates, the Wolfram wall model and the window script contract. +# +# Run only by ~/handoffs/pdra4-hive/chip/run-queue.sh. Every slice carries '# pdra4-gb10: none', so the +# runner opens `spark-window open pdra4-DRA-66- --lease 20 --gb10 none --quiet exclusive --wait` +# and runs `timeout 1140 spark-window run env Q36_EXTRA_WAIT=120 ... q36-extra ` (no args). +# Why gb10 none: the server verifies an inherited chip reservation by requiring the FLOCK holder of +# /tmp/aien-gb10.lock to be one of its ANCESTORS (crates/aien-serve-http/src/chip_reservation.rs +# `detect`); spark-window's holder (`setsid spark-window _hold ID`) never is. So the slice takes the +# lock itself through flock(1) (at most 90 s), which is the ancestor of every server it starts, and +# sets AIEN_GB10_LOCK_HELD=1 only for those servers. flock(1) exits, and the lock goes, when the inner +# slice exits; timeout(1) signals the whole process group at the cap. The window's quiet lock (--quiet +# exclusive) is what makes the timings quiet. +# +# Refuses with NOT_RUN (exit 3) before any chip contact unless: SPARK_WINDOW and SPARK_WINDOW_DIR name +# the open, held window; it is gb10=none and quiet=exclusive; AIEN_GB10_LOCK_HELD is not set; the chip +# lock comes free within 90 s and its holder is an ancestor; 18091/18300/18310 are down; no compute +# process is on the chip; binary and golden have their pinned sha256. +# Outside a window it prints NOT_RUN and exits 3 WITHOUT a VERDICT file (the runner would skip a slice +# with a VERDICT); inside one every outcome writes receipts/DRA-66//VERDICT. +# +# Budget: a gate starts only if its cap fits before BOTH the lease end and the runner's 1140 s cap less +# 15 s (measured from the start of this process: run-queue.sh -> timeout -> spark-window run -> env -> +# q36-extra -> slice is one exec chain, one pid); otherwise it and the later gates are NOT_RUN. +# +# Host dry path, no GPU and no 35B: `DRY_RUN=1 bash ` checks binary/golden/model/tools, prints the +# plan, and runs the slice's host-side checker gate on the committed host fixtures into /tmp/dra66-dry/. +set -u +umask 022 + +W=/home/drakestapleton/work/dra-66 +BIN=$W/bin-head/aien-serve-http +SHA_HEAD=a33cc2abf545927b293316cca018ff81d492bacfdd8fb996dcc5dccdb02449e4 # sc 9d70dca4 + omega a647b6a9 +GOLD=$W/core/evidence/q36-host-20261020/gen-chat-max-24.json +GOLD_SHA=ec9040177d67a3f33b4d8800bc6656990952a8479052468814386d9081e6a664 +HOSTEV=$W/core/evidence/dra-66-host-time-20261031 # host fixtures for the dry path +MODEL=/home/drakestapleton/models/qwen3.6-35b-a3b-fp8-95a723d0 +PORT=18190 +LOCK=/tmp/aien-gb10.lock +WAVE=0 # explicit: the 18091 launcher leaves it unset, the a647b6a9 default (off); proof checked in the log +RUNNER_CAP=1140 +LOAD=180 # server load to /health (measured 39-78 s in the GoldenP04 window; 148.6 s at 13:32Z beside Flint) +RQ=/home/drakestapleton/handoffs/pdra4-hive/receipts/DRA-66 +R=$RQ/$SLICE +S01=$RQ/s01-tokens # s02 reads the token slice's summaries from here +SELF=$(readlink -f "$0") +COUNT='Count from 1 to 400 in English words, one number per line, nothing else.' + +ts() { date -u +%FT%TZ; } + +# cap NAME: the gate's hard cap in seconds (PLAN.md, Wolfram). +cap() { + case $1 in + mutant4-red) echo $(( LOAD + 60 + 30 )) ;; # load, golden (60 s curl cap), stop + golden-identity) echo $(( LOAD + 60 )) ;; # load, golden + receipt-1conv) echo $(( 3 * 30 + 2 )) ;; + receipt-8conv) echo $(( 60 + 2 )) ;; + seed-t07) echo $(( 3 * 20 )) ;; + check-tokens) echo $(( 30 + 45 )) ;; # stop the token server, then the checker + stamps-1conv) echo $(( LOAD + 30 + 2 + 30 )) ;; # load, 128-token reply, idle, stop + check-stamps) echo 45 ;; + *) echo 0 ;; + esac +} + +dry_static() { + local fail=0 t + for t in curl jq ss sha256sum flock spark-window nvidia-smi; do command -v $t > /dev/null || { echo "missing tool $t"; fail=1; }; done + [ "$(sha256sum < "$BIN" | cut -c1-64)" = "$SHA_HEAD" ] || { echo "$BIN sha256 is not $SHA_HEAD"; fail=1; } + [ "$(sha256sum < "$GOLD" | cut -c1-64)" = "$GOLD_SHA" ] || { echo "$GOLD sha256 is not $GOLD_SHA"; fail=1; } + [ "$(jq '.generated_ids | length' "$GOLD" 2> /dev/null)" = 24 ] || { echo "golden has no 24 generated_ids"; fail=1; } + [ -f "$MODEL/config.json" ] || { echo "model dir $MODEL missing"; fail=1; } + return $fail +} + +# ---- host dry path: no window, no lock, no GPU, no server ---- +if [ "${DRY_RUN:-0}" = 1 ]; then + DRY=/tmp/dra66-dry/$SLICE + rm -rf "$DRY" + mkdir -p "$DRY" + dry_static || { echo "DRY $SLICE: static checks FAILED"; exit 3; } + total=90 + echo "DRY $SLICE: static checks passed (bin $SHA_HEAD, golden $GOLD_SHA); receipts -> $R; WAVE=$WAVE" + for g in "${GATES[@]}"; do echo " would run: $g (cap $(cap "$g") s)"; total=$(( total + $(cap "$g") )); done + echo " caps + 90 s lock wait = $total s of the $RUNNER_CAP s runner cap" + [ "$total" -le "$RUNNER_CAP" ] || { echo "DRY $SLICE: caps exceed the runner cap"; exit 3; } + DRY_RUN_CHECK=1 +fi + +# ---- outer: inside the window, take the chip lock through flock(1) ---- +if [ -z "${DRA66_INNER:-}" ] && [ -z "${DRY_RUN_CHECK:-}" ]; then + refuse() { # in a window: VERDICT; outside: stdout only + echo "NOT_RUN: $*" + if [ -n "${SPARK_WINDOW:-}" ]; then mkdir -p "$R" && echo "NOT_RUN $SLICE: $*" > "$R/VERDICT"; fi + exit 3 + } + [ -n "${SPARK_WINDOW:-}" ] && [ -n "${SPARK_WINDOW_DIR:-}" ] \ + || { echo "NOT_RUN: not inside a spark-window; run by ~/handoffs/pdra4-hive/chip/run-queue.sh only"; exit 3; } + [ -s "$R/VERDICT" ] && { echo "have VERDICT: $(cat "$R/VERDICT")"; exit 0; } + [ "$(spark-window id 2> /dev/null)" = "$SPARK_WINDOW" ] || refuse "window $SPARK_WINDOW is not the open window holding its locks" + [ -f "$SPARK_WINDOW_DIR/held" ] || refuse "window $SPARK_WINDOW has no held stamp" + gb=$(cat "$SPARK_WINDOW_DIR/gb10" 2> /dev/null) + q=$(cat "$SPARK_WINDOW_DIR/quiet" 2> /dev/null) + [ "$gb" = none ] \ + || refuse "window gb10=$gb: its holder is not an ancestor of the server, which would refuse the chip; the slice needs '# pdra4-gb10: none'" + [ "$q" = exclusive ] || refuse "window quiet=$q: the timing gates need --quiet exclusive" + [ -z "${AIEN_GB10_LOCK_HELD:-}" ] || refuse "AIEN_GB10_LOCK_HELD=$AIEN_GB10_LOCK_HELD already set; this slice takes the chip lock itself" + # A slice that names NEEDS (s02: s01-tokens) opens no chip until that slice's VERDICT is PASS: its + # gate files need the token summaries and its identity check needs s01's solo-1 ids. + if [ -n "${NEEDS:-}" ] && ! grep -q '^PASS' "$RQ/$NEEDS/VERDICT" 2> /dev/null; then + refuse "$NEEDS has no PASS VERDICT ($(cut -c1-120 "$RQ/$NEEDS/VERDICT" 2> /dev/null || echo none)); remove this VERDICT to run again once it has" + fi + lease=$(cat "$SPARK_WINDOW_DIR/lease") + now=$(date +%s) + lease_end=$(( $(stat -c %Y "$SPARK_WINDOW_DIR/held") + lease * 60 )) + run_end=$(( now - $(ps -o etimes= -p $$) + RUNNER_CAP - 15 )) + DRA66_DEADLINE=$(( lease_end < run_end ? lease_end : run_end )) + export DRA66_INNER=1 DRA66_DEADLINE + echo "$(ts) window $SPARK_WINDOW (gb10 $gb, quiet $q, lease $lease min); $(( DRA66_DEADLINE - now )) s to the deadline; taking $LOCK (at most 90 s)" + flock -w 90 -E 75 "$LOCK" bash "$SELF" + rc=$? + # 75 from the slice would read as a q36-extra refusal in run-queue.sh: map it to our own NOT_RUN. + [ "$rc" = 75 ] && refuse "$LOCK did not come free in 90 s" + exit "$rc" +fi + +# ---- inner: child of flock(1), which holds the chip lock (or the dry path) ---- +if [ -n "${DRY_RUN_CHECK:-}" ]; then + EV=$DRY + DRA66_DEADLINE=$(( $(date +%s) + RUNNER_CAP )) + SPARK_WINDOW=dry + SPARK_WINDOW_DIR=none +else + EV=$R +fi +SERVER_PID= +SERVED= # set once a server was started: only then does finish query the chip again +HOLDER= +BIN_SHA= +BIN_COMMIT= +G_T0=$(ts) +G_S0=$(date +%s) +T0=$G_S0 + +say() { echo "$(ts) $*" | tee -a "$EV/window.log"; } +left() { echo $(( DRA66_DEADLINE - $(date +%s) )); } +elapsed() { echo $(( $(date +%s) - T0 )); } + +# gate NAME STATUS DETAIL [FILE...]: the gate's receipt, stamped with window, binary and lock. +gate() { + local name=$1 status=$2 detail=$3 files + shift 3 + files=$(for f in "$@"; do [ -f "$f" ] && sha256sum "$f"; done \ + | jq -R 'capture("^(?[0-9a-f]{64}) (?.*)$")' | jq -s .) + jq -n --arg slice "$SLICE" --arg gate "$name" --arg status "$status" --arg detail "$detail" \ + --arg window_id "$SPARK_WINDOW" --arg window_dir "$SPARK_WINDOW_DIR" \ + --arg bin "$BIN" --arg bin_sha256 "$BIN_SHA" --arg sc_commit "$BIN_COMMIT" \ + --arg holder "$HOLDER" --arg start "$G_T0" --arg end "$(ts)" --arg wave "$WAVE" \ + --argjson elapsed_s "$(( $(date +%s) - G_S0 ))" --argjson deadline_left_s "$(left)" \ + --argjson files "$files" \ + '{schema: "aien.dra66-slice-gate/1", slice: $slice, gate: $gate, status: $status, detail: $detail, + window_id: $window_id, window_dir: $window_dir, bin: $bin, bin_sha256: $bin_sha256, + sc_commit: $sc_commit, gb10_lock_holder_pid: $holder, grouped_wave: $wave, start: $start, + end: $end, elapsed_s: $elapsed_s, deadline_left_s: $deadline_left_s, files: $files}' \ + > "$EV/gate-$name.json" + say "gate $name: $status ($detail)" +} + +# begin NAME: start a gate only if its cap fits before the deadline. +begin() { + G_T0=$(ts) + G_S0=$(date +%s) + local l c + l=$(left) + c=$(cap "$1") + if [ "$l" -lt "$c" ]; then + gate "$1" NOT_RUN "deadline in $l s, gate cap $c s; this and later gates not run" + exit 3 + fi + say "gate $1 begins (cap $c s, $l s to the deadline)" +} + +not_run() { + echo "NOT_RUN: $*" + gate preconditions NOT_RUN "$*" + exit 3 +} + +# ---- server control ---- +stop_server() { + [ -n "$SERVER_PID" ] || return 0 + kill -TERM "$SERVER_PID" 2> /dev/null + for _ in $(seq 30); do kill -0 "$SERVER_PID" 2> /dev/null || break; sleep 1; done + kill -KILL "$SERVER_PID" 2> /dev/null + wait "$SERVER_PID" 2> /dev/null + SERVER_PID= +} + +# finish: receipt.json over every gate, then the one-line VERDICT (status = worst gate: +# FAIL > NOT_RUN > PASS). The 0.5 ms verdict is Main's Wolfram evaluation, never part of it. +finish() { + stop_server + [ -z "$SERVED" ] || nvidia-smi --query-compute-apps=pid,process_name,used_memory --format=csv,noheader \ + > "$EV/compute-apps-after.txt" 2>&1 + jq -s --arg slice "$SLICE" --arg window_id "$SPARK_WINDOW" --arg bin_sha256 "$BIN_SHA" \ + --arg sc_commit "$BIN_COMMIT" --argjson elapsed_s "$(elapsed)" \ + '{schema: "aien.dra66-slice/1", slice: $slice, window_id: $window_id, bin_sha256: $bin_sha256, + sc_commit: $sc_commit, elapsed_s: $elapsed_s, + status: (if any(.[]; .status == "FAIL") then "FAIL" + elif any(.[]; .status == "NOT_RUN") then "NOT_RUN" else "PASS" end), + gates: .}' \ + $(ls -tr "$EV"/gate-*.json 2> /dev/null) > "$EV/receipt.json" + local st why + st=$(jq -r '.status // "NOT_RUN"' "$EV/receipt.json" 2> /dev/null) + why=$(jq -r '[.gates[] | select(.status != "PASS") | "\(.gate) \(.status): \(.detail)"][0] // empty' "$EV/receipt.json" 2> /dev/null) + [ -n "$st" ] || st=NOT_RUN + echo "$st $SLICE: $(jq -r '[.gates[] | "\(.gate)=\(.status)"] | join(" ")' "$EV/receipt.json" 2> /dev/null)${why:+; first non-PASS: $why}; elapsed $(elapsed) s; receipt.json" \ + | cut -c1-600 > "$EV/VERDICT" + cat "$EV/VERDICT" + [ "$st" = FAIL ] && exit 4 + [ "$st" = NOT_RUN ] && exit 3 + exit 0 +} + +# start_server LOG [ENV=VAL ...]: the live 18091 flags on a loopback test port, inheriting the chip +# lock this slice's flock(1) holds; at most LOAD s to health. +start_server() { + local log=$1 + shift + env AIEN_GB10_LOCK_HELD=1 AIEN_Q36_STROKE=1 AIEN_STROKE_IN_WINDOW=1 AIEN_OMEGA_FP8_GROUPED_WAVE=$WAVE "$@" \ + "$BIN" --engine omega --model-dir "$MODEL" --port $PORT --bind 127.0.0.1 \ + --max-context 49152 --max-tokens-cap 16384 --thinking off --batch-slots 8 \ + > "$log" 2>&1 & + SERVER_PID=$! + SERVED=1 + local deadline=$(( $(date +%s) + LOAD )) + while [ "$(date +%s)" -lt "$deadline" ]; do + kill -0 "$SERVER_PID" 2> /dev/null || { say "server exited during load: $(tail -n 2 "$log" | tr '\n' ' ')"; SERVER_PID=; return 1; } + curl -s -m 2 127.0.0.1:$PORT/health > /dev/null && break + sleep 1 + done + curl -s -m 2 127.0.0.1:$PORT/health > /dev/null || { say "server not healthy in $LOAD s"; stop_server; return 1; } + grep -q "chip reservation inherited from ancestor pid $HOLDER" "$log" \ + || { say "server did not report the inherited reservation of pid $HOLDER"; stop_server; return 1; } + ! grep -q '(wave rule)' "$log" \ + || { say "server log shows the grouped wave rule; WAVE=$WAVE wants it off"; stop_server; return 1; } + local l + l=$(ss -ltnH "sport = :$PORT" | awk '{print $4}') + if [ -z "$l" ] || [ -n "$(echo "$l" | grep -v '^127\.0\.0\.1:')" ]; then + say "listener check FAILED on $PORT: $l" + stop_server + return 1 + fi + say "server pid $SERVER_PID up, listeners: $(echo $l)" +} + +# chat OUT PROMPT MAX TEMP SEED CAP_S: one chat request with token ids; prints "tokens wall_s". +chat() { + local out=$1 prompt=$2 max=$3 temp=$4 seed=$5 cap=$6 body wall + body=$(jq -nc --arg p "$prompt" --argjson m "$max" --argjson t "$temp" --argjson s "$seed" \ + '{model:"qwen3.6-35b-a3b-fp8",messages:[{role:"user",content:$p}],temperature:$t,seed:$s,max_tokens:$m,stream:false,chat_template_kwargs:{enable_thinking:false},aien_return_token_ids:true}') + wall=$(curl -s -m "$cap" -o "$out" -w '%{time_total}' -H 'content-type: application/json' \ + -d "$body" 127.0.0.1:$PORT/v1/chat/completions) || { echo "fail 0"; return 1; } + echo "$(jq -r '.usage.completion_tokens // "fail"' "$out") $wall" +} + +# golden LABEL: the gate2 request (24 greedy tokens, 60 s cap); prints IDENTICAL, DIFFER or ERROR. +golden() { + local out=$EV/golden-$1.json got + chat "$out" 'Write a C function that returns the larger of two ints.' 24 0 0 60 > /dev/null + got=$(jq -c '.usage.aien_token_ids // empty' "$out" 2> /dev/null) + if [ -z "$got" ]; then echo ERROR; elif [ "$got" = "$WANT" ]; then echo IDENTICAL; else echo DIFFER; fi +} + +chk() { "$BIN" --check-decode-timeline "$@"; } + +# check_tokens TOK A B: the token receipt's checker gate (host only). Writes summary-1conv.wl (the +# 0.5 ms gate's token beats A..B) and summary-red-host.wl (the same beats bent +0.6 ms host: the red). +check_tokens() { + local tok=$1 a=$2 b=$3 n c0 c1 c2 c3 c4 c5 codes st + n=$(wc -l < "$tok" 2> /dev/null || echo 0) + chk "$tok" > "$EV/summary-all.wl" 2> "$EV/check.txt" + c0=$? + echo "check exit $c0 (must be 0)" >> "$EV/check.txt" + chk "$tok" --drop 0:record:0 > /dev/null 2> "$EV/red-drop-first.txt" + c1=$? + echo "red control (drop the first record) exit $c1 (must be 1)" >> "$EV/red-drop-first.txt" + chk "$tok" --drop $(( n / 2 )):record:0 > /dev/null 2> "$EV/red-drop-middle.txt" + c2=$? + echo "red control (drop record $(( n / 2 ))) exit $c2 (must be 1)" >> "$EV/red-drop-middle.txt" + chk "$tok" --bend $(( a + 1 )):chip > /dev/null 2> "$EV/red-bend-chip.txt" + c3=$? + echo "red control (record $(( a + 1 )) chip_ns + 1, host share kept) exit $c3 (must be 1)" >> "$EV/red-bend-chip.txt" + chk "$tok" --bend host:600000 --slice "$a:$b" > "$EV/summary-red-host.wl" 2> "$EV/red-bend-host.txt" + c4=$? + echo "synthetic receipt (every beat 0.6 ms more host) exit $c4 (must be 0; its Wolfram verdict must be False)" >> "$EV/red-bend-host.txt" + chk "$tok" --slice "$a:$b" > "$EV/summary-1conv.wl" 2> "$EV/check-1conv.txt" + c5=$? + echo "check --slice $a:$b exit $c5 (must be 0)" >> "$EV/check-1conv.txt" + echo "$a $b $n" > "$EV/slice.txt" + codes="$c0 $c1 $c2 $c3 $c4 $c5" + [ "$codes" = "0 1 1 1 0 0" ] && st=PASS || st=FAIL + gate check-tokens "$st" "$n token records, slice $a..$b; exits $codes (want 0 1 1 1 0 0: reds before the green slice)" \ + "$tok" "$EV/summary-all.wl" "$EV/summary-red-host.wl" "$EV/summary-1conv.wl" "$EV/check.txt" \ + "$EV/red-drop-first.txt" "$EV/red-drop-middle.txt" "$EV/red-bend-chip.txt" "$EV/red-bend-host.txt" \ + "$EV/check-1conv.txt" "$EV/slice.txt" +} + +# check_stamps STA TOKDIR: the stamped timeline's checker gate (host only), then Main's Wolfram inputs: +# gate-red.wl first (the bent token beats + the stamps: must evaluate False), then gate.wl. +check_stamps() { + local sta=$1 tokdir=$2 ns c0 c1 st detail + ns=$(wc -l < "$sta" 2> /dev/null || echo 0) + chk "$sta" --drop 0:record:0 > /dev/null 2> "$EV/red-stamps-drop.txt" + c1=$? + echo "red control (drop the first stamped record) exit $c1 (must be 1)" >> "$EV/red-stamps-drop.txt" + chk "$sta" > "$EV/summary-stamps.wl" 2> "$EV/check-stamps.txt" + c0=$? + echo "check exit $c0 (must be 0)" >> "$EV/check-stamps.txt" + [ "$c1 $c0" = "1 0" ] && st=PASS || st=FAIL + detail="$ns stamped records; exits $c1 $c0 (want 1 0)" + if [ -s "$tokdir/summary-red-host.wl" ] && [ -s "$tokdir/summary-1conv.wl" ] \ + && grep -q '^PASS' "$tokdir/VERDICT" 2> /dev/null; then + cat "$tokdir/summary-red-host.wl" "$EV/summary-stamps.wl" > "$EV/gate-red.wl" + cat "$tokdir/summary-1conv.wl" "$EV/summary-stamps.wl" > "$EV/gate.wl" + detail="$detail; gate-red.wl then gate.wl from $tokdir (slice $(cat "$tokdir/slice.txt" 2> /dev/null)); Wolfram: gate-red.wl last result False first, then gate.wl" + else + [ "$st" = PASS ] && st=NOT_RUN + detail="$detail; no PASS token slice in $tokdir, so no gate.wl" + fi + gate check-stamps "$st" "$detail" "$sta" "$EV/summary-stamps.wl" "$EV/check-stamps.txt" \ + "$EV/red-stamps-drop.txt" "$EV/gate-red.wl" "$EV/gate.wl" "$tokdir/summary-1conv.wl" "$tokdir/summary-red-host.wl" +} + +# ---- host dry path: the slice's checker gate on the committed host fixtures ---- +if [ -n "${DRY_RUN_CHECK:-}" ]; then + BIN_SHA=$SHA_HEAD + trap 'finish' EXIT + case $SLICE in + s01-tokens) G_T0=$(ts); G_S0=$(date +%s); check_tokens "$HOSTEV/host-token-receipt.jsonl" 0 19 ;; + s02-stamps) + G_T0=$(ts); G_S0=$(date +%s) + check_stamps "$HOSTEV/host-stamps.jsonl" /tmp/dra66-dry/s01-tokens ;; + esac + exit 0 +fi + +mkdir -p "$EV" || { echo "NOT_RUN: cannot create $EV"; exit 3; } +rm -f "$EV/VERDICT" +trap 'finish' EXIT +trap 'say "interrupted"; exit 4' INT TERM + +# ---- preconditions (no chip contact) ---- +[ -e "$LOCK" ] || not_run "$LOCK missing" +ino=$(stat -c %i "$LOCK") +dev=$(printf '%02x:%02x' $(stat -c '%Hd %Ld' "$LOCK")) +# /proc/locks field 6 is MAJ:MIN:INODE (hex device): match the device as well as the inode. +holders=$(awk -v ino="$ino" -v dev="$dev" '$2 == "FLOCK" && $4 == "WRITE" { n = split($6, a, ":"); if (a[n] == ino && a[1] ":" a[2] == dev) print $5 }' /proc/locks | sort -u) +anc=" " +p=$$ +while [ "$p" -gt 1 ]; do + anc="$anc$p " + p=$(awk '{print $4}' "/proc/$p/stat" 2> /dev/null) || break +done +for h in $holders; do case "$anc" in *" $h "*) HOLDER=$h ;; esac; done +[ -n "$HOLDER" ] || not_run "$LOCK held exclusively by pid(s) '$holders', none an ancestor of $$ ($anc)" +if curl -s -m 5 127.0.0.1:18091/health > "$EV/health-18091-before.json"; then + not_run "18091 answers /health; the live 35B must be stopped first" +fi +for port in 18091 18300 18310; do + [ -z "$(ss -ltnH "sport = :$port")" ] || not_run "a listener is still on $port" +done +apps=$(nvidia-smi --query-compute-apps=pid,process_name,used_memory --format=csv,noheader 2>&1) \ + || not_run "nvidia-smi failed: $apps" +echo "$apps" > "$EV/compute-apps-before.txt" +[ -z "$apps" ] || not_run "compute apps present: $apps" +dry_static > "$EV/static.txt" 2>&1 || not_run "static checks: $(tr '\n' ';' < "$EV/static.txt")" +BIN_SHA=$SHA_HEAD +"$BIN" --version > "$EV/version.txt" 2>&1 || not_run "$BIN --version failed" +BIN_COMMIT=$(awk '/^sovereign-core commit:/ { print $3 }' "$EV/version.txt") +grep -q '^omega gpu engine: native' "$EV/version.txt" || not_run "$BIN has no native omega gpu engine" +WANT=$(jq -c '.generated_ids' "$GOLD") +[ -z "$(ss -ltnH "sport = :$PORT")" ] || not_run "port $PORT busy" +{ + echo "slice $SLICE window $SPARK_WINDOW $SPARK_WINDOW_DIR deadline $DRA66_DEADLINE ($(left) s left)" + echo "lock $LOCK holder $HOLDER; ancestors$anc" + echo "bin $BIN $BIN_SHA commit $BIN_COMMIT; WAVE=$WAVE"; echo "golden $GOLD $GOLD_SHA" + echo "affinity: $(taskset -pc $$ 2>&1)" + uname -r; nvidia-smi --query-gpu=driver_version,name --format=csv,noheader; cat /proc/loadavg +} > "$EV/preconditions.txt" +gate preconditions PASS "window $SPARK_WINDOW, lock holder $HOLDER (ancestor), $(left) s to the deadline" \ + "$EV/preconditions.txt" "$EV/version.txt" "$EV/compute-apps-before.txt" "$GOLD" + +for g in "${GATES[@]}"; do + begin "$g" + case $g in + mutant4-red) # the negative control goes first + start_server "$EV/server-mutant4.log" AIEN_Q36_TEST_MUTANT=4 \ + || { gate mutant4-red NOT_RUN "mutant server did not come up" "$EV/server-mutant4.log"; exit 3; } + m4=$(golden mutant4) + stop_server + if [ "$m4" = DIFFER ]; then + gate mutant4-red PASS "mutant 4 DIFFERs from the golden (the control went red)" "$EV/golden-mutant4.json" "$EV/server-mutant4.log" + else + gate mutant4-red FAIL "mutant 4 gave $m4, not DIFFER; no green below would count" "$EV/golden-mutant4.json" "$EV/server-mutant4.log" + exit 4 + fi ;; + golden-identity) # honest server, per-token receipt on + TOK=$EV/tokens.jsonl + start_server "$EV/server-tokens.log" AIEN_Q36_DECODE_TIMELINE="$TOK" AIEN_Q36_DECODE_TIMELINE_KIND=token \ + || { gate golden-identity NOT_RUN "honest server did not come up" "$EV/server-tokens.log"; exit 3; } + grep -E 'per-token receipt' "$EV/server-tokens.log" | tee -a "$EV/window.log" + g=$(golden honest) + sleep 2 # the door closes the golden's last record at idle; every record is flushed as written + A=$(wc -l < "$TOK" 2> /dev/null || echo 0) + [ "$g" = IDENTICAL ] && st=PASS || st=FAIL + gate golden-identity "$st" "honest golden $g (must be IDENTICAL); receipt records so far A=$A" "$EV/golden-honest.json" "$GOLD" "$TOK" ;; + receipt-1conv) # records A..B are the 0.5 ms gate's beats + ok=PASS + for i in 1 2 3; do + r=$(chat "$EV/solo-$i.json" "$COUNT" 256 0 0 30) || ok=FAIL + say "solo $i: tokens wall_s = $r" + done + sleep 2 # the door closes the spell at idle + B=$(wc -l < "$TOK" 2> /dev/null || echo 0) + [ "$B" -gt $(( A + 1 )) ] || ok=FAIL + gate receipt-1conv "$ok" "3 sequential greedy replies of 256 tokens; receipt records A..B = $A..$B" "$EV"/solo-*.json "$TOK" ;; + receipt-8conv) + pids=() + for i in 1 2 3 4 5 6 7 8; do + chat "$EV/eight-$i.json" "Count from $((i * 50)) to $((i * 50 + 300)) in English words, one number per line, nothing else." 256 0 0 60 \ + > "$EV/eight-$i.txt" & + pids+=($!) + done + ok=PASS + for p in "${pids[@]}"; do wait "$p" || ok=FAIL; done + for i in 1 2 3 4 5 6 7 8; do say "eight $i: tokens wall_s = $(cat "$EV/eight-$i.txt")"; done + sleep 2 + gate receipt-8conv "$ok" "8 concurrent greedy replies of 256 tokens; receipt records so far $(wc -l < "$TOK" 2> /dev/null || echo 0)" \ + "$EV"/eight-*.json "$TOK" ;; + seed-t07) + for s in 1 2 1b; do chat "$EV/seed-$s.json" "$COUNT" 64 0.7 "${s%b}" 20 > /dev/null; done + ids() { jq -c '.usage.aien_token_ids' "$EV/seed-$1.json" 2> /dev/null; } + if [ "$(ids 1)" = "$(ids 1b)" ] && [ "$(ids 1)" != "$(ids 2)" ] && [ -n "$(ids 1)" ] && [ "$(ids 1)" != null ]; then + gate seed-t07 PASS "seed 1 repeats, seed 2 differs" "$EV"/seed-*.json + else + gate seed-t07 FAIL "seed1 $(ids 1 | cut -c1-60) / seed2 $(ids 2 | cut -c1-60) / seed1b $(ids 1b | cut -c1-60)" "$EV"/seed-*.json + fi ;; + check-tokens) # server stopped first: the checker reads a closed file + stop_server + grep -E 'spell over|per-token receipt' "$EV/server-tokens.log" > "$EV/spells.txt" + check_tokens "$TOK" "$A" "$B" ;; + stamps-1conv) + # chip_ns runs from the first submit to the last completion marker read back on the host clock, so + # host_overhead_ns = total_ns - chip_ns is a lower bound. The stamped launch timeline at one + # conversation (the token arm's lone-row graph) gives chip_ns - dev_span = submit + poll per token; + # the stamps' chip cost sits in both and cancels. Its first 128 greedy ids must equal s01's solo-1. + STA=$EV/stamps.jsonl + start_server "$EV/server-stamps.log" AIEN_Q36_DECODE_TIMELINE="$STA" \ + || { gate stamps-1conv NOT_RUN "stamped server did not come up" "$EV/server-stamps.log"; exit 3; } + grep -E 'decode timeline' "$EV/server-stamps.log" | tee -a "$EV/window.log" + ok=PASS + r=$(chat "$EV/stamped.json" "$COUNT" 128 0 0 30) || ok=FAIL + say "stamped: tokens wall_s = $r" + sleep 2 + stop_server + ns=$(wc -l < "$STA" 2> /dev/null || echo 0) + [ "$ns" -gt 0 ] || ok=FAIL + got=$(jq -c '.usage.aien_token_ids' "$EV/stamped.json" 2> /dev/null) + ref=$(jq -c '.usage.aien_token_ids[0:128]' "$S01/solo-1.json" 2> /dev/null) + if [ -z "$ref" ] || [ "$ref" = null ]; then idn="no s01 solo-1 ids to compare" + elif [ "$got" = "$ref" ]; then idn="first 128 ids IDENTICAL to s01 solo-1" + else idn="ids DIFFER from s01 solo-1"; ok=FAIL; fi + gate stamps-1conv "$ok" "1 greedy reply of 128 tokens, stamped launch timeline; $ns records; $idn" \ + "$EV/stamped.json" "$STA" "$EV/server-stamps.log" "$S01/solo-1.json" ;; + check-stamps) check_stamps "$STA" "$S01" ;; + *) gate "$g" FAIL "unknown gate name in GATES" ;; + esac +done +say "done in $(elapsed) s, $(left) s to the deadline" diff --git a/evidence/dra-66-host-time-20261031/chip/dry-host.log b/evidence/dra-66-host-time-20261031/chip/dry-host.log new file mode 100644 index 00000000..ebc3ae7f --- /dev/null +++ b/evidence/dra-66-host-time-20261031/chip/dry-host.log @@ -0,0 +1,44 @@ +# DRA-66 slices, host dry path and negative controls (2026-10-31T13:56:39Z, spark-b87b, nice -n 19 taskset -c 0-9; no window, no lock, no GPU, no server) +# lib sha256 e384f6988d43f2dc0ba55b868f36381f33b63f44b014968cbeaf22e608a9061e +== DRY_RUN=1 bash s01-tokens.sh +DRY s01-tokens: static checks passed (bin a33cc2abf545927b293316cca018ff81d492bacfdd8fb996dcc5dccdb02449e4, golden ec9040177d67a3f33b4d8800bc6656990952a8479052468814386d9081e6a664); receipts -> /home/drakestapleton/handoffs/pdra4-hive/receipts/DRA-66/s01-tokens; WAVE=0 + would run: mutant4-red (cap 270 s) + would run: golden-identity (cap 240 s) + would run: receipt-1conv (cap 92 s) + would run: receipt-8conv (cap 62 s) + would run: seed-t07 (cap 60 s) + would run: check-tokens (cap 75 s) + caps + 90 s lock wait = 889 s of the 1140 s runner cap +2026-10-31T13:56:39Z gate check-tokens: PASS (49 token records, slice 0..19; exits 0 1 1 1 0 0 (want 0 1 1 1 0 0: reds before the green slice)) +PASS s01-tokens: check-tokens=PASS; elapsed 0 s; receipt.json +exit 0 +== DRY_RUN=1 bash s02-stamps.sh +DRY s02-stamps: static checks passed (bin a33cc2abf545927b293316cca018ff81d492bacfdd8fb996dcc5dccdb02449e4, golden ec9040177d67a3f33b4d8800bc6656990952a8479052468814386d9081e6a664); receipts -> /home/drakestapleton/handoffs/pdra4-hive/receipts/DRA-66/s02-stamps; WAVE=0 + would run: stamps-1conv (cap 242 s) + would run: check-stamps (cap 45 s) + caps + 90 s lock wait = 377 s of the 1140 s runner cap +2026-10-31T13:56:39Z gate check-stamps: PASS (19 stamped records; exits 1 0 (want 1 0); gate-red.wl then gate.wl from /tmp/dra66-dry/s01-tokens (slice 0 19 49); Wolfram: gate-red.wl last result False first, then gate.wl) +PASS s02-stamps: check-stamps=PASS; elapsed 0 s; receipt.json +exit 0 +== dry gate files vs the committed host gate files (differ only in the fixture path of the first comment line) +gate.wl: lines 2.. identical to ../host-gate.wl +gate-red.wl: lines 2.. identical to ../host-gate-red.wl +summary-1conv.wl: lines 2.. identical to ../host-summary-1conv.wl +== N1 outside a window, real slice: NOT_RUN, exit 3, no VERDICT written +NOT_RUN: not inside a spark-window; run by ~/handoffs/pdra4-hive/chip/run-queue.sh only +exit 3 + ls: cannot access '/home/drakestapleton/handoffs/pdra4-hive/receipts/DRA-66/s01-tokens/VERDICT': No such file or directory +== N2 fake window (temp copy, receipts in /tmp/dra66-neg/rq): NOT_RUN exit 3 + VERDICT +NOT_RUN: window fake-dra66 is not the open window holding its locks +exit 3 + VERDICT: NOT_RUN s01-tokens: window fake-dra66 is not the open window holding its locks +== N3 inner part, chip lock not held by an ancestor (temp copy): preconditions NOT_RUN exit 3, no chip query +NOT_RUN: /tmp/aien-gb10.lock held exclusively by pid(s) '', none an ancestor of 104049 ( 104049 222923 221570 221493 221067 6355 ) +2026-10-31T13:56:39Z gate preconditions: NOT_RUN (/tmp/aien-gb10.lock held exclusively by pid(s) '', none an ancestor of 104049 ( 104049 222923 221570 221493 221067 6355 )) +NOT_RUN s01-tokens: preconditions=NOT_RUN; first non-PASS: preconditions NOT_RUN: /tmp/aien-gb10.lock held exclusively by pid(s) '', none an ancestor of 104049 ( 104049 222923 221570 221493 221067 6355 ); elapsed 0 s; receipt.json +exit 3 + files: VERDICT gate-preconditions.json receipt.json window.log +== N4 dry path, SHA_HEAD corrupted (temp copy): exit 3 +/home/drakestapleton/work/dra-66/bin-head/aien-serve-http sha256 is not 0000c2abf545927b293316cca018ff81d492bacfdd8fb996dcc5dccdb02449e4 +DRY s01-tokens: static checks FAILED +exit 3 diff --git a/evidence/dra-66-host-time-20261031/chip/s01-tokens.sh b/evidence/dra-66-host-time-20261031/chip/s01-tokens.sh new file mode 100755 index 00000000..83a056ba --- /dev/null +++ b/evidence/dra-66-host-time-20261031/chip/s01-tokens.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# DRA-66 (sovereign #857, PR #863) chip slice, no args: golden identity through the door (mutant 4 red +# first), the per-token receipt at 1 and 8 conversations, seed control, the token checker. Body in +# dra66-lib.sh; see PLAN.md. Run only by chip/run-queue.sh; `DRY_RUN=1 bash s01-tokens.sh` = host dry path. +# pdra4-gb10: none +SLICE=s01-tokens +GATES=(mutant4-red golden-identity receipt-1conv receipt-8conv seed-t07 check-tokens) +source "$(dirname "${BASH_SOURCE[0]}")/dra66-lib.sh" diff --git a/evidence/dra-66-host-time-20261031/chip/s02-stamps.sh b/evidence/dra-66-host-time-20261031/chip/s02-stamps.sh new file mode 100755 index 00000000..9e3145a1 --- /dev/null +++ b/evidence/dra-66-host-time-20261031/chip/s02-stamps.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# DRA-66 (sovereign #857, PR #863) chip slice, no args: the stamped launch timeline at one conversation +# (submit + poll per token), its checker, and Main's Wolfram inputs gate-red.wl then gate.wl (with +# s01-tokens' summaries). Body in dra66-lib.sh; see PLAN.md. Queue it after s01-tokens. +# pdra4-gb10: none +SLICE=s02-stamps +GATES=(stamps-1conv check-stamps) +NEEDS=s01-tokens +source "$(dirname "${BASH_SOURCE[0]}")/dra66-lib.sh" diff --git a/evidence/dra-66-host-time-20261031/host-gate-absorb.wl b/evidence/dra-66-host-time-20261031/host-gate-absorb.wl new file mode 100644 index 00000000..e4a7eea8 --- /dev/null +++ b/evidence/dra-66-host-time-20261031/host-gate-absorb.wl @@ -0,0 +1,54 @@ +(* records 0..19 (seq) of evidence/dra-66-host-time-20261031/host-token-receipt.jsonl; the whole file checked green *) +(* aien.q36-token-receipt/1: 19 decoding beats; integer ns, host clock *) +receipt = <| + "rows" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + "prompt_rows" -> {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + "steps" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + "submits" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + "total_ns" -> {455251, 655684, 610228, 491411, 471987, 472675, 475875, 469572, 471571, 466499, 469827, 485523, 473763, 471523, 583108, 505299, 467795, 451843, 453811}, + "step_ns" -> {447795, 587124, 558516, 454899, 451651, 455171, 451938, 451459, 450659, 451283, 452003, 465027, 454867, 454803, 568116, 448931, 444659, 444995, 446163}, + "graph_ns" -> {447731, 586980, 558308, 454739, 451587, 455075, 451826, 451363, 450563, 451203, 451891, 464947, 454787, 454723, 568036, 448547, 444595, 444947, 446099}, + "record_ns" -> {93233, 96881, 197378, 97473, 95809, 95025, 95120, 95024, 94624, 95648, 94768, 97280, 97649, 94401, 95297, 94673, 91777, 91857, 92337}, + "step_chip_ns" -> {354402, 490019, 360818, 357202, 355714, 359938, 356642, 356243, 355875, 355491, 356979, 367571, 357010, 360226, 472675, 353810, 352754, 353042, 353714}, + "chip_ns" -> {354402, 490019, 360818, 357202, 355714, 359938, 356642, 356243, 355875, 355491, 356979, 367571, 357010, 360226, 472675, 353810, 352754, 353042, 353714}, + "host_overhead_ns" -> {100849, 165665, 249410, 134209, 116273, 112737, 119233, 113329, 115696, 111008, 112848, 117952, 116753, 111297, 110433, 151489, 115041, 98801, 100097} +|>; +clean[k_] := Pick[Range[Length[receipt["rows"]]], MapThread[#1 == k && #2 == 0 &, {receipt["rows"], receipt["prompt_rows"]}]]; +(* DRA-66 host lower bound per token at 1 conversation (wall - chip_ns; chip_ns holds the submit and the marker poll, see submitPoll): {beats, median ms} *) hostLB = Median[receipt["host_overhead_ns"][[clean[1]]]]; {Length[clean[1]], N[hostLB / 10^6]} +(* per conversations k, clean beats: {beats, median total, chip, host overhead ms} *) Table[{k, Length[clean[k]], N[Median[receipt["total_ns"][[clean[k]]]] / 10^6], N[Median[receipt["chip_ns"][[clean[k]]]] / 10^6], N[Median[receipt["host_overhead_ns"][[clean[k]]]] / 10^6]}, {k, Select[Union[receipt["rows"]], Length[clean[#]] > 0 &]}] +(* host overhead at 1 conversation by where it sits (ms, medians): outside the step, step outside the graph, graph outside record and chip, record *) With[{c = clean[1], r = receipt}, N[{Median[(r["total_ns"] - r["step_ns"])[[c]]], Median[(r["step_ns"] - r["graph_ns"])[[c]]], Median[(r["graph_ns"] - r["record_ns"] - r["step_chip_ns"])[[c]]], Median[r["record_ns"][[c]]]} / 10^6]] +(* aien.q36-decode-timeline/1: 19 beats; integer ns per beat; host clock for host:*, period, sync, chip_ns, submit_poll; chip PTIMER for dev:*, dev_span *) +timeline = <| + "period" -> {736278, 909992, 774279, 887415, 1275243, 3087994, 1132921, 817751, 1160506, 4204771, 2246051, 788407, 832455, 1352459, 803223, 3115162, 802599, 786502, 780567}, + "host:sched_join" -> {80, 167762, 50704, 77488, 45024, 76448, 73280, 65041, 70593, 42192, 95617, 53921, 93953, 52912, 63633, 41680, 60225, 49776, 36513}, + "host:sample" -> {14048, 4736, 4145, 3040, 7728, 5472, 33905, 6160, 47968, 16448, 56624, 10496, 15024, 5184, 8864, 6160, 7088, 6800, 6224}, + "host:sched_feed" -> {560, 320, 496, 208, 480, 736, 880, 672, 608, 608, 1057, 832, 496, 464, 736, 416, 976, 576, 512}, + "host:step_enter" -> {80, 80, 144, 80, 80, 80, 128, 96, 80, 96, 176, 80, 96, 80, 96, 80, 288, 112, 192}, + "host:embed" -> {32, 32, 32, 48, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 48, 128, 48, 32}, + "host:graph_record" -> {103985, 113905, 105472, 104897, 107953, 108353, 114721, 110321, 107793, 104721, 111664, 107601, 106321, 115361, 111377, 105665, 107553, 106849, 106129}, + "host:graph_submit_wait" -> {608197, 615509, 608502, 693958, 1108122, 2877177, 899495, 630245, 927192, 4018402, 1954929, 610293, 610997, 1167546, 613525, 2934601, 615717, 617077, 622613}, + "host:graph_exit" -> {48, 48, 48, 64, 48, 64, 48, 64, 48, 64, 32, 48, 48, 48, 32, 336, 32, 48, 48}, + "host:logits_read" -> {48, 32, 32, 48, 32, 32, 32, 48, 32, 32, 64, 32, 32, 48, 48, 32, 32, 32, 32}, + "host:step_return" -> {1360, 2544, 1984, 3840, 2448, 9648, 5088, 2432, 3392, 13408, 10384, 2352, 1984, 4928, 2160, 10752, 5760, 2336, 3936}, + "host:sched_post" -> {7840, 5024, 2720, 3744, 3296, 9952, 5312, 2640, 2768, 8768, 15472, 2720, 3472, 5856, 2720, 15392, 4800, 2848, 4336}, + "dev:experts" -> {200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200}, + "dev:gdn" -> {300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300}, + "dev:attention" -> {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}, + "dev:router" -> {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}, + "dev:head_screen" -> {300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300}, + "dev:head_recheck" -> {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}, + "dev:head_plain" -> {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + "dev:token_pick" -> {200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200}, + "dev:glue" -> {800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800}, + "dev:unknown" -> {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + "dev_span" -> {2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100}, + "sync" -> {606097, 613409, 606402, 691858, 1106022, 2875077, 897395, 628145, 925092, 4016302, 1952829, 608193, 608897, 1165446, 611425, 2932501, 613617, 614977, 620513}, + "submits" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + "chip_ns" -> {608197, 615509, 608502, 693958, 1108122, 2877177, 899495, 630245, 927192, 4018402, 1954929, 610293, 610997, 1167546, 613525, 2934601, 615717, 617077, 622613}, + "submit_poll" -> {606097, 613409, 606402, 691858, 1106022, 2875077, 897395, 628145, 925092, 4016302, 1952829, 608193, 608897, 1165446, 611425, 2932501, 613617, 614977, 620513} +|>; +(* ms per beat, medians: *) N[Median /@ timeline / 10^6] +(* outside the chip + chip + sync vs the period: *) N[{Median[timeline["period"] - timeline["host:graph_submit_wait"]], Median[timeline["dev_span"]], Median[timeline["sync"]], Median[timeline["period"]]} / 10^6] +(* residual against the recorded 20.7 ms step: *) N[207/10 - Median[timeline["period"]] / 10^6] +(* DRA-66 submit + poll share per token, chip_ns - dev_span over single-submit beats: {beats, median ms} *) one = Flatten[Position[timeline["submits"], 1]]; submitPoll = Median[timeline["submit_poll"][[one]]]; {Length[one], N[submitPoll / 10^6]} +(* DRA-66 gate, sum of medians (hostLB: token receipt, receipt-1conv slice, clean 1-row beats; submitPoll: stamped timeline, single-submit beats): {host lower bound ms, submit + poll ms, sum ms, sum <= 0.5 ms} *) {N[hostLB / 10^6], N[submitPoll / 10^6], N[(hostLB + submitPoll) / 10^6], hostLB + submitPoll <= 500000} diff --git a/evidence/dra-66-host-time-20261031/host-gate-red.wl b/evidence/dra-66-host-time-20261031/host-gate-red.wl new file mode 100644 index 00000000..5af55c27 --- /dev/null +++ b/evidence/dra-66-host-time-20261031/host-gate-red.wl @@ -0,0 +1,54 @@ +(* records 0..19 (seq) of evidence/dra-66-host-time-20261031/host-token-receipt.jsonl; the whole file checked green *) +(* aien.q36-token-receipt/1: 19 decoding beats; integer ns, host clock *) +receipt = <| + "rows" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + "prompt_rows" -> {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + "steps" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + "submits" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + "total_ns" -> {1055251, 1255684, 1210228, 1091411, 1071987, 1072675, 1075875, 1069572, 1071571, 1066499, 1069827, 1085523, 1073763, 1071523, 1183108, 1105299, 1067795, 1051843, 1053811}, + "step_ns" -> {447795, 587124, 558516, 454899, 451651, 455171, 451938, 451459, 450659, 451283, 452003, 465027, 454867, 454803, 568116, 448931, 444659, 444995, 446163}, + "graph_ns" -> {447731, 586980, 558308, 454739, 451587, 455075, 451826, 451363, 450563, 451203, 451891, 464947, 454787, 454723, 568036, 448547, 444595, 444947, 446099}, + "record_ns" -> {93233, 96881, 197378, 97473, 95809, 95025, 95120, 95024, 94624, 95648, 94768, 97280, 97649, 94401, 95297, 94673, 91777, 91857, 92337}, + "step_chip_ns" -> {354402, 490019, 360818, 357202, 355714, 359938, 356642, 356243, 355875, 355491, 356979, 367571, 357010, 360226, 472675, 353810, 352754, 353042, 353714}, + "chip_ns" -> {354402, 490019, 360818, 357202, 355714, 359938, 356642, 356243, 355875, 355491, 356979, 367571, 357010, 360226, 472675, 353810, 352754, 353042, 353714}, + "host_overhead_ns" -> {700849, 765665, 849410, 734209, 716273, 712737, 719233, 713329, 715696, 711008, 712848, 717952, 716753, 711297, 710433, 751489, 715041, 698801, 700097} +|>; +clean[k_] := Pick[Range[Length[receipt["rows"]]], MapThread[#1 == k && #2 == 0 &, {receipt["rows"], receipt["prompt_rows"]}]]; +(* DRA-66 host lower bound per token at 1 conversation (wall - chip_ns; chip_ns holds the submit and the marker poll, see submitPoll): {beats, median ms} *) hostLB = Median[receipt["host_overhead_ns"][[clean[1]]]]; {Length[clean[1]], N[hostLB / 10^6]} +(* per conversations k, clean beats: {beats, median total, chip, host overhead ms} *) Table[{k, Length[clean[k]], N[Median[receipt["total_ns"][[clean[k]]]] / 10^6], N[Median[receipt["chip_ns"][[clean[k]]]] / 10^6], N[Median[receipt["host_overhead_ns"][[clean[k]]]] / 10^6]}, {k, Select[Union[receipt["rows"]], Length[clean[#]] > 0 &]}] +(* host overhead at 1 conversation by where it sits (ms, medians): outside the step, step outside the graph, graph outside record and chip, record *) With[{c = clean[1], r = receipt}, N[{Median[(r["total_ns"] - r["step_ns"])[[c]]], Median[(r["step_ns"] - r["graph_ns"])[[c]]], Median[(r["graph_ns"] - r["record_ns"] - r["step_chip_ns"])[[c]]], Median[r["record_ns"][[c]]]} / 10^6]] +(* aien.q36-decode-timeline/1: 19 beats; integer ns per beat; host clock for host:*, period, sync, chip_ns, submit_poll; chip PTIMER for dev:*, dev_span *) +timeline = <| + "period" -> {736278, 909992, 774279, 887415, 1275243, 3087994, 1132921, 817751, 1160506, 4204771, 2246051, 788407, 832455, 1352459, 803223, 3115162, 802599, 786502, 780567}, + "host:sched_join" -> {80, 167762, 50704, 77488, 45024, 76448, 73280, 65041, 70593, 42192, 95617, 53921, 93953, 52912, 63633, 41680, 60225, 49776, 36513}, + "host:sample" -> {14048, 4736, 4145, 3040, 7728, 5472, 33905, 6160, 47968, 16448, 56624, 10496, 15024, 5184, 8864, 6160, 7088, 6800, 6224}, + "host:sched_feed" -> {560, 320, 496, 208, 480, 736, 880, 672, 608, 608, 1057, 832, 496, 464, 736, 416, 976, 576, 512}, + "host:step_enter" -> {80, 80, 144, 80, 80, 80, 128, 96, 80, 96, 176, 80, 96, 80, 96, 80, 288, 112, 192}, + "host:embed" -> {32, 32, 32, 48, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 48, 128, 48, 32}, + "host:graph_record" -> {103985, 113905, 105472, 104897, 107953, 108353, 114721, 110321, 107793, 104721, 111664, 107601, 106321, 115361, 111377, 105665, 107553, 106849, 106129}, + "host:graph_submit_wait" -> {608197, 615509, 608502, 693958, 1108122, 2877177, 899495, 630245, 927192, 4018402, 1954929, 610293, 610997, 1167546, 613525, 2934601, 615717, 617077, 622613}, + "host:graph_exit" -> {48, 48, 48, 64, 48, 64, 48, 64, 48, 64, 32, 48, 48, 48, 32, 336, 32, 48, 48}, + "host:logits_read" -> {48, 32, 32, 48, 32, 32, 32, 48, 32, 32, 64, 32, 32, 48, 48, 32, 32, 32, 32}, + "host:step_return" -> {1360, 2544, 1984, 3840, 2448, 9648, 5088, 2432, 3392, 13408, 10384, 2352, 1984, 4928, 2160, 10752, 5760, 2336, 3936}, + "host:sched_post" -> {7840, 5024, 2720, 3744, 3296, 9952, 5312, 2640, 2768, 8768, 15472, 2720, 3472, 5856, 2720, 15392, 4800, 2848, 4336}, + "dev:experts" -> {200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200}, + "dev:gdn" -> {300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300}, + "dev:attention" -> {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}, + "dev:router" -> {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}, + "dev:head_screen" -> {300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300}, + "dev:head_recheck" -> {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}, + "dev:head_plain" -> {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + "dev:token_pick" -> {200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200}, + "dev:glue" -> {800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800}, + "dev:unknown" -> {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + "dev_span" -> {2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100}, + "sync" -> {606097, 613409, 606402, 691858, 1106022, 2875077, 897395, 628145, 925092, 4016302, 1952829, 608193, 608897, 1165446, 611425, 2932501, 613617, 614977, 620513}, + "submits" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + "chip_ns" -> {22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100}, + "submit_poll" -> {20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000} +|>; +(* ms per beat, medians: *) N[Median /@ timeline / 10^6] +(* outside the chip + chip + sync vs the period: *) N[{Median[timeline["period"] - timeline["host:graph_submit_wait"]], Median[timeline["dev_span"]], Median[timeline["sync"]], Median[timeline["period"]]} / 10^6] +(* residual against the recorded 20.7 ms step: *) N[207/10 - Median[timeline["period"]] / 10^6] +(* DRA-66 submit + poll share per token, chip_ns - dev_span over single-submit beats: {beats, median ms} *) one = Flatten[Position[timeline["submits"], 1]]; submitPoll = Median[timeline["submit_poll"][[one]]]; {Length[one], N[submitPoll / 10^6]} +(* DRA-66 gate, sum of medians (hostLB: token receipt, receipt-1conv slice, clean 1-row beats; submitPoll: stamped timeline, single-submit beats): {host lower bound ms, submit + poll ms, sum ms, sum <= 0.5 ms} *) {N[hostLB / 10^6], N[submitPoll / 10^6], N[(hostLB + submitPoll) / 10^6], hostLB + submitPoll <= 500000} diff --git a/evidence/dra-66-host-time-20261031/host-gate.wl b/evidence/dra-66-host-time-20261031/host-gate.wl new file mode 100644 index 00000000..a2725881 --- /dev/null +++ b/evidence/dra-66-host-time-20261031/host-gate.wl @@ -0,0 +1,54 @@ +(* records 0..19 (seq) of evidence/dra-66-host-time-20261031/host-token-receipt.jsonl; the whole file checked green *) +(* aien.q36-token-receipt/1: 19 decoding beats; integer ns, host clock *) +receipt = <| + "rows" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + "prompt_rows" -> {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + "steps" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + "submits" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + "total_ns" -> {455251, 655684, 610228, 491411, 471987, 472675, 475875, 469572, 471571, 466499, 469827, 485523, 473763, 471523, 583108, 505299, 467795, 451843, 453811}, + "step_ns" -> {447795, 587124, 558516, 454899, 451651, 455171, 451938, 451459, 450659, 451283, 452003, 465027, 454867, 454803, 568116, 448931, 444659, 444995, 446163}, + "graph_ns" -> {447731, 586980, 558308, 454739, 451587, 455075, 451826, 451363, 450563, 451203, 451891, 464947, 454787, 454723, 568036, 448547, 444595, 444947, 446099}, + "record_ns" -> {93233, 96881, 197378, 97473, 95809, 95025, 95120, 95024, 94624, 95648, 94768, 97280, 97649, 94401, 95297, 94673, 91777, 91857, 92337}, + "step_chip_ns" -> {354402, 490019, 360818, 357202, 355714, 359938, 356642, 356243, 355875, 355491, 356979, 367571, 357010, 360226, 472675, 353810, 352754, 353042, 353714}, + "chip_ns" -> {354402, 490019, 360818, 357202, 355714, 359938, 356642, 356243, 355875, 355491, 356979, 367571, 357010, 360226, 472675, 353810, 352754, 353042, 353714}, + "host_overhead_ns" -> {100849, 165665, 249410, 134209, 116273, 112737, 119233, 113329, 115696, 111008, 112848, 117952, 116753, 111297, 110433, 151489, 115041, 98801, 100097} +|>; +clean[k_] := Pick[Range[Length[receipt["rows"]]], MapThread[#1 == k && #2 == 0 &, {receipt["rows"], receipt["prompt_rows"]}]]; +(* DRA-66 host lower bound per token at 1 conversation (wall - chip_ns; chip_ns holds the submit and the marker poll, see submitPoll): {beats, median ms} *) hostLB = Median[receipt["host_overhead_ns"][[clean[1]]]]; {Length[clean[1]], N[hostLB / 10^6]} +(* per conversations k, clean beats: {beats, median total, chip, host overhead ms} *) Table[{k, Length[clean[k]], N[Median[receipt["total_ns"][[clean[k]]]] / 10^6], N[Median[receipt["chip_ns"][[clean[k]]]] / 10^6], N[Median[receipt["host_overhead_ns"][[clean[k]]]] / 10^6]}, {k, Select[Union[receipt["rows"]], Length[clean[#]] > 0 &]}] +(* host overhead at 1 conversation by where it sits (ms, medians): outside the step, step outside the graph, graph outside record and chip, record *) With[{c = clean[1], r = receipt}, N[{Median[(r["total_ns"] - r["step_ns"])[[c]]], Median[(r["step_ns"] - r["graph_ns"])[[c]]], Median[(r["graph_ns"] - r["record_ns"] - r["step_chip_ns"])[[c]]], Median[r["record_ns"][[c]]]} / 10^6]] +(* aien.q36-decode-timeline/1: 19 beats; integer ns per beat; host clock for host:*, period, sync, chip_ns, submit_poll; chip PTIMER for dev:*, dev_span *) +timeline = <| + "period" -> {736278, 909992, 774279, 887415, 1275243, 3087994, 1132921, 817751, 1160506, 4204771, 2246051, 788407, 832455, 1352459, 803223, 3115162, 802599, 786502, 780567}, + "host:sched_join" -> {80, 167762, 50704, 77488, 45024, 76448, 73280, 65041, 70593, 42192, 95617, 53921, 93953, 52912, 63633, 41680, 60225, 49776, 36513}, + "host:sample" -> {14048, 4736, 4145, 3040, 7728, 5472, 33905, 6160, 47968, 16448, 56624, 10496, 15024, 5184, 8864, 6160, 7088, 6800, 6224}, + "host:sched_feed" -> {560, 320, 496, 208, 480, 736, 880, 672, 608, 608, 1057, 832, 496, 464, 736, 416, 976, 576, 512}, + "host:step_enter" -> {80, 80, 144, 80, 80, 80, 128, 96, 80, 96, 176, 80, 96, 80, 96, 80, 288, 112, 192}, + "host:embed" -> {32, 32, 32, 48, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 48, 128, 48, 32}, + "host:graph_record" -> {103985, 113905, 105472, 104897, 107953, 108353, 114721, 110321, 107793, 104721, 111664, 107601, 106321, 115361, 111377, 105665, 107553, 106849, 106129}, + "host:graph_submit_wait" -> {608197, 615509, 608502, 693958, 1108122, 2877177, 899495, 630245, 927192, 4018402, 1954929, 610293, 610997, 1167546, 613525, 2934601, 615717, 617077, 622613}, + "host:graph_exit" -> {48, 48, 48, 64, 48, 64, 48, 64, 48, 64, 32, 48, 48, 48, 32, 336, 32, 48, 48}, + "host:logits_read" -> {48, 32, 32, 48, 32, 32, 32, 48, 32, 32, 64, 32, 32, 48, 48, 32, 32, 32, 32}, + "host:step_return" -> {1360, 2544, 1984, 3840, 2448, 9648, 5088, 2432, 3392, 13408, 10384, 2352, 1984, 4928, 2160, 10752, 5760, 2336, 3936}, + "host:sched_post" -> {7840, 5024, 2720, 3744, 3296, 9952, 5312, 2640, 2768, 8768, 15472, 2720, 3472, 5856, 2720, 15392, 4800, 2848, 4336}, + "dev:experts" -> {200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200}, + "dev:gdn" -> {300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300}, + "dev:attention" -> {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}, + "dev:router" -> {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}, + "dev:head_screen" -> {300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300}, + "dev:head_recheck" -> {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}, + "dev:head_plain" -> {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + "dev:token_pick" -> {200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200}, + "dev:glue" -> {800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800}, + "dev:unknown" -> {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + "dev_span" -> {2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100}, + "sync" -> {606097, 613409, 606402, 691858, 1106022, 2875077, 897395, 628145, 925092, 4016302, 1952829, 608193, 608897, 1165446, 611425, 2932501, 613617, 614977, 620513}, + "submits" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + "chip_ns" -> {22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100}, + "submit_poll" -> {20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000} +|>; +(* ms per beat, medians: *) N[Median /@ timeline / 10^6] +(* outside the chip + chip + sync vs the period: *) N[{Median[timeline["period"] - timeline["host:graph_submit_wait"]], Median[timeline["dev_span"]], Median[timeline["sync"]], Median[timeline["period"]]} / 10^6] +(* residual against the recorded 20.7 ms step: *) N[207/10 - Median[timeline["period"]] / 10^6] +(* DRA-66 submit + poll share per token, chip_ns - dev_span over single-submit beats: {beats, median ms} *) one = Flatten[Position[timeline["submits"], 1]]; submitPoll = Median[timeline["submit_poll"][[one]]]; {Length[one], N[submitPoll / 10^6]} +(* DRA-66 gate, sum of medians (hostLB: token receipt, receipt-1conv slice, clean 1-row beats; submitPoll: stamped timeline, single-submit beats): {host lower bound ms, submit + poll ms, sum ms, sum <= 0.5 ms} *) {N[hostLB / 10^6], N[submitPoll / 10^6], N[(hostLB + submitPoll) / 10^6], hostLB + submitPoll <= 500000} diff --git a/evidence/dra-66-host-time-20261031/host-rev863.log b/evidence/dra-66-host-time-20261031/host-rev863.log new file mode 100644 index 00000000..5b89d5e0 --- /dev/null +++ b/evidence/dra-66-host-time-20261031/host-rev863.log @@ -0,0 +1,62 @@ +$ aien-serve-http --check-decode-timeline evidence/dra-66-host-time-20261031/host-token-receipt.jsonl --bend 3:chip +negative control: bent 3:chip (chip_ns + 1, host_overhead_ns kept) +RED: record 3 (beat 9): host_overhead 134209 for total 491411 chip 357203 +token receipt RED: 1 findings over 49 records, evidence/dra-66-host-time-20261031/host-token-receipt.jsonl +exit 1 +$ aien-serve-http --check-decode-timeline evidence/dra-66-host-time-20261031/host-token-receipt.jsonl +token receipt GREEN: 49 records, evidence/dra-66-host-time-20261031/host-token-receipt.jsonl; summary over records 0..49 +exit 0 +$ aien-serve-http --check-decode-timeline evidence/dra-66-host-time-20261031/host-token-receipt.jsonl --slice 0:19 +token receipt GREEN: 49 records, evidence/dra-66-host-time-20261031/host-token-receipt.jsonl; summary over records 0..19 +exit 0 +$ aien-serve-http --check-decode-timeline evidence/dra-66-host-time-20261031/host-token-receipt.jsonl --bend host:600000 --slice 0:19 +synthetic receipt: bent host:600000 (every beat 600000 ns more host time) +token receipt GREEN: 49 records, evidence/dra-66-host-time-20261031/host-token-receipt.jsonl; summary over records 0..19 +exit 0 +$ aien-serve-http --check-decode-timeline evidence/dra-66-host-time-20261031/host-stamps.jsonl --drop 0:record:0 +negative control: dropped 0:record:0 +RED: record 0 (beat 7): seq 1 where 0 belongs (a record is missing or repeated) +RED: record 1 (beat 8): seq 2 where 1 belongs (a record is missing or repeated) +RED: record 2 (beat 9): seq 3 where 2 belongs (a record is missing or repeated) +RED: record 3 (beat 10): seq 4 where 3 belongs (a record is missing or repeated) +RED: record 4 (beat 11): seq 5 where 4 belongs (a record is missing or repeated) +RED: record 5 (beat 12): seq 6 where 5 belongs (a record is missing or repeated) +RED: record 6 (beat 13): seq 7 where 6 belongs (a record is missing or repeated) +RED: record 7 (beat 14): seq 8 where 7 belongs (a record is missing or repeated) +RED: record 8 (beat 15): seq 9 where 8 belongs (a record is missing or repeated) +RED: record 9 (beat 16): seq 10 where 9 belongs (a record is missing or repeated) +RED: record 10 (beat 17): seq 11 where 10 belongs (a record is missing or repeated) +RED: record 11 (beat 18): seq 12 where 11 belongs (a record is missing or repeated) +RED: record 12 (beat 19): seq 13 where 12 belongs (a record is missing or repeated) +RED: record 13 (beat 20): seq 14 where 13 belongs (a record is missing or repeated) +RED: record 14 (beat 21): seq 15 where 14 belongs (a record is missing or repeated) +RED: record 15 (beat 22): seq 16 where 15 belongs (a record is missing or repeated) +RED: record 16 (beat 23): seq 17 where 16 belongs (a record is missing or repeated) +RED: record 17 (beat 24): seq 18 where 17 belongs (a record is missing or repeated) +decode timeline RED: 18 findings over 18 records, evidence/dra-66-host-time-20261031/host-stamps.jsonl +exit 1 +$ aien-serve-http --check-decode-timeline evidence/dra-66-host-time-20261031/host-stamps.jsonl +decode timeline GREEN: 19 records, evidence/dra-66-host-time-20261031/host-stamps.jsonl +exit 0 +$ aien-serve-http --check-decode-timeline evidence/dra-66-host-time-20261031/host-stamps.jsonl --bend 1:chip +evidence/dra-66-host-time-20261031/host-stamps.jsonl: a launch timeline takes --drop only; usage: aien-serve-http --check-decode-timeline FILE [--drop REC:host|dev|record:IDX] [--bend REC:chip|host:NS] [--slice A:B] (--bend and --slice: token receipts) +exit 2 +$ aien-serve-http --check-decode-timeline evidence/dra-66-host-time-20261031/host-token-receipt.jsonl --slice 5:5 +--slice 5:5: token receipt: --drop REC:record:0 (REC below the last record), --bend REC:chip | host:NS, --slice A:B (0 <= A < B <= records) +exit 2 +$ aien-serve-http --check-decode-timeline evidence/dra-66-host-time-20261031/host-token-receipt.jsonl --bend 3:chip --bend 4:chip +--bend given twice; usage: aien-serve-http --check-decode-timeline FILE [--drop REC:host|dev|record:IDX] [--bend REC:chip|host:NS] [--slice A:B] (--bend and --slice: token receipts) +exit 2 +lock parse: flock pid 3489990, dev 103:02 ino 320239 + matching dev -> '3489990' + wrong dev 00:00 -> '' +# mutant 'chip_ns absorbs the whole graph_submit_wait' (Rev863 MAJOR 1 shape), made by: +# jq -c '.chip_ns = ([.host[] | select(.name == "graph_submit_wait") | .t1 - .t0][0])' host-stamps.jsonl > host-stamps-absorb.jsonl +$ aien-serve-http --check-decode-timeline evidence/dra-66-host-time-20261031/host-stamps-absorb.jsonl +decode timeline GREEN: 19 records, evidence/dra-66-host-time-20261031/host-stamps-absorb.jsonl +exit 0 +# Wolfram MCP evaluator, each file evaluated whole; last result = GATE_WL +# {N[hostLB/10^6], N[submitPoll/10^6], N[(hostLB+submitPoll)/10^6], hostLB + submitPoll <= 500000} +host-gate-red.wl (token slice 0..19 bent host:600000 + host stamps) -> {0.715041, 0.02, 0.735041, False} +host-gate-absorb.wl (token slice 0..19 + stamps with chip_ns = graph_submit_wait) -> {0.115041, 0.628145, 0.743186, False} +host-gate.wl (token slice 0..19 + host stamps) -> {0.115041, 0.02, 0.135041, True} diff --git a/evidence/dra-66-host-time-20261031/host-stamps-absorb.jsonl b/evidence/dra-66-host-time-20261031/host-stamps-absorb.jsonl new file mode 100644 index 00000000..efd3bd02 --- /dev/null +++ b/evidence/dra-66-host-time-20261031/host-stamps-absorb.jsonl @@ -0,0 +1,19 @@ +{"schema":"aien.q36-decode-timeline/1","seq":0,"beat":6,"row":0,"step":0,"launches":21,"submits":1,"chip_ns":608197,"record_ns":103985,"total_ns":712182,"host":[{"name":"sched_join","t0":7856898,"t1":7856978},{"name":"sample","t0":7856978,"t1":7871026},{"name":"sched_feed","t0":7871026,"t1":7871586},{"name":"step_enter","t0":7871586,"t1":7871666},{"name":"embed","t0":7871666,"t1":7871698},{"name":"graph_record","t0":7871698,"t1":7975683},{"name":"graph_submit_wait","t0":7975683,"t1":8583880},{"name":"graph_exit","t0":8583880,"t1":8583928},{"name":"logits_read","t0":8583928,"t1":8583976},{"name":"step_return","t0":8583976,"t1":8585336},{"name":"sched_post","t0":8585336,"t1":8593176}],"dev":[{"name":"norm","t0":7007871698,"t1":7007871798},{"name":"mix","t0":7007871798,"t1":7007871898},{"name":"ab","t0":7007871898,"t1":7007871998},{"name":"gdn","t0":7007871998,"t1":7007872098},{"name":"o_proj","t0":7007872098,"t1":7007872198},{"name":"res","t0":7007872198,"t1":7007872298},{"name":"router","t0":7007872298,"t1":7007872398},{"name":"gate_up","t0":7007872398,"t1":7007872498},{"name":"swiglu","t0":7007872498,"t1":7007872598},{"name":"down","t0":7007872598,"t1":7007872698},{"name":"gather","t0":7007872698,"t1":7007872798},{"name":"res","t0":7007872798,"t1":7007872898},{"name":"norm","t0":7007872898,"t1":7007872998},{"name":"lm_head","t0":7007872998,"t1":7007873098},{"name":"lm_head","t0":7007873098,"t1":7007873198},{"name":"lm_head","t0":7007873198,"t1":7007873298},{"name":"argmax","t0":7007873298,"t1":7007873398},{"name":"argmax","t0":7007873398,"t1":7007873498},{"name":"lm_head","t0":7007873498,"t1":7007873598},{"name":"argmax","t0":7007873598,"t1":7007873698},{"name":"argmax","t0":7007873698,"t1":7007873798}]} +{"schema":"aien.q36-decode-timeline/1","seq":1,"beat":7,"row":0,"step":1,"launches":21,"submits":1,"chip_ns":615509,"record_ns":113905,"total_ns":729414,"host":[{"name":"sched_join","t0":8593176,"t1":8760938},{"name":"sample","t0":8760938,"t1":8765674},{"name":"sched_feed","t0":8765674,"t1":8765994},{"name":"step_enter","t0":8765994,"t1":8766074},{"name":"embed","t0":8766074,"t1":8766106},{"name":"graph_record","t0":8766106,"t1":8880011},{"name":"graph_submit_wait","t0":8880011,"t1":9495520},{"name":"graph_exit","t0":9495520,"t1":9495568},{"name":"logits_read","t0":9495568,"t1":9495600},{"name":"step_return","t0":9495600,"t1":9498144},{"name":"sched_post","t0":9498144,"t1":9503168}],"dev":[{"name":"norm","t0":7008766106,"t1":7008766206},{"name":"mix","t0":7008766206,"t1":7008766306},{"name":"ab","t0":7008766306,"t1":7008766406},{"name":"gdn","t0":7008766406,"t1":7008766506},{"name":"o_proj","t0":7008766506,"t1":7008766606},{"name":"res","t0":7008766606,"t1":7008766706},{"name":"router","t0":7008766706,"t1":7008766806},{"name":"gate_up","t0":7008766806,"t1":7008766906},{"name":"swiglu","t0":7008766906,"t1":7008767006},{"name":"down","t0":7008767006,"t1":7008767106},{"name":"gather","t0":7008767106,"t1":7008767206},{"name":"res","t0":7008767206,"t1":7008767306},{"name":"norm","t0":7008767306,"t1":7008767406},{"name":"lm_head","t0":7008767406,"t1":7008767506},{"name":"lm_head","t0":7008767506,"t1":7008767606},{"name":"lm_head","t0":7008767606,"t1":7008767706},{"name":"argmax","t0":7008767706,"t1":7008767806},{"name":"argmax","t0":7008767806,"t1":7008767906},{"name":"lm_head","t0":7008767906,"t1":7008768006},{"name":"argmax","t0":7008768006,"t1":7008768106},{"name":"argmax","t0":7008768106,"t1":7008768206}]} +{"schema":"aien.q36-decode-timeline/1","seq":2,"beat":8,"row":0,"step":2,"launches":21,"submits":1,"chip_ns":608502,"record_ns":105472,"total_ns":713974,"host":[{"name":"sched_join","t0":9503168,"t1":9553872},{"name":"sample","t0":9553872,"t1":9558017},{"name":"sched_feed","t0":9558017,"t1":9558513},{"name":"step_enter","t0":9558513,"t1":9558657},{"name":"embed","t0":9558657,"t1":9558689},{"name":"graph_record","t0":9558689,"t1":9664161},{"name":"graph_submit_wait","t0":9664161,"t1":10272663},{"name":"graph_exit","t0":10272663,"t1":10272711},{"name":"logits_read","t0":10272711,"t1":10272743},{"name":"step_return","t0":10272743,"t1":10274727},{"name":"sched_post","t0":10274727,"t1":10277447}],"dev":[{"name":"norm","t0":7009558689,"t1":7009558789},{"name":"mix","t0":7009558789,"t1":7009558889},{"name":"ab","t0":7009558889,"t1":7009558989},{"name":"gdn","t0":7009558989,"t1":7009559089},{"name":"o_proj","t0":7009559089,"t1":7009559189},{"name":"res","t0":7009559189,"t1":7009559289},{"name":"router","t0":7009559289,"t1":7009559389},{"name":"gate_up","t0":7009559389,"t1":7009559489},{"name":"swiglu","t0":7009559489,"t1":7009559589},{"name":"down","t0":7009559589,"t1":7009559689},{"name":"gather","t0":7009559689,"t1":7009559789},{"name":"res","t0":7009559789,"t1":7009559889},{"name":"norm","t0":7009559889,"t1":7009559989},{"name":"lm_head","t0":7009559989,"t1":7009560089},{"name":"lm_head","t0":7009560089,"t1":7009560189},{"name":"lm_head","t0":7009560189,"t1":7009560289},{"name":"argmax","t0":7009560289,"t1":7009560389},{"name":"argmax","t0":7009560389,"t1":7009560489},{"name":"lm_head","t0":7009560489,"t1":7009560589},{"name":"argmax","t0":7009560589,"t1":7009560689},{"name":"argmax","t0":7009560689,"t1":7009560789}]} +{"schema":"aien.q36-decode-timeline/1","seq":3,"beat":9,"row":0,"step":3,"launches":21,"submits":1,"chip_ns":693958,"record_ns":104897,"total_ns":798855,"host":[{"name":"sched_join","t0":10277447,"t1":10354935},{"name":"sample","t0":10354935,"t1":10357975},{"name":"sched_feed","t0":10357975,"t1":10358183},{"name":"step_enter","t0":10358183,"t1":10358263},{"name":"embed","t0":10358263,"t1":10358311},{"name":"graph_record","t0":10358311,"t1":10463208},{"name":"graph_submit_wait","t0":10463208,"t1":11157166},{"name":"graph_exit","t0":11157166,"t1":11157230},{"name":"logits_read","t0":11157230,"t1":11157278},{"name":"step_return","t0":11157278,"t1":11161118},{"name":"sched_post","t0":11161118,"t1":11164862}],"dev":[{"name":"norm","t0":7010358311,"t1":7010358411},{"name":"mix","t0":7010358411,"t1":7010358511},{"name":"ab","t0":7010358511,"t1":7010358611},{"name":"gdn","t0":7010358611,"t1":7010358711},{"name":"o_proj","t0":7010358711,"t1":7010358811},{"name":"res","t0":7010358811,"t1":7010358911},{"name":"router","t0":7010358911,"t1":7010359011},{"name":"gate_up","t0":7010359011,"t1":7010359111},{"name":"swiglu","t0":7010359111,"t1":7010359211},{"name":"down","t0":7010359211,"t1":7010359311},{"name":"gather","t0":7010359311,"t1":7010359411},{"name":"res","t0":7010359411,"t1":7010359511},{"name":"norm","t0":7010359511,"t1":7010359611},{"name":"lm_head","t0":7010359611,"t1":7010359711},{"name":"lm_head","t0":7010359711,"t1":7010359811},{"name":"lm_head","t0":7010359811,"t1":7010359911},{"name":"argmax","t0":7010359911,"t1":7010360011},{"name":"argmax","t0":7010360011,"t1":7010360111},{"name":"lm_head","t0":7010360111,"t1":7010360211},{"name":"argmax","t0":7010360211,"t1":7010360311},{"name":"argmax","t0":7010360311,"t1":7010360411}]} +{"schema":"aien.q36-decode-timeline/1","seq":4,"beat":10,"row":0,"step":4,"launches":21,"submits":1,"chip_ns":1108122,"record_ns":107953,"total_ns":1216075,"host":[{"name":"sched_join","t0":11164862,"t1":11209886},{"name":"sample","t0":11209886,"t1":11217614},{"name":"sched_feed","t0":11217614,"t1":11218094},{"name":"step_enter","t0":11218094,"t1":11218174},{"name":"embed","t0":11218174,"t1":11218206},{"name":"graph_record","t0":11218206,"t1":11326159},{"name":"graph_submit_wait","t0":11326159,"t1":12434281},{"name":"graph_exit","t0":12434281,"t1":12434329},{"name":"logits_read","t0":12434329,"t1":12434361},{"name":"step_return","t0":12434361,"t1":12436809},{"name":"sched_post","t0":12436809,"t1":12440105}],"dev":[{"name":"norm","t0":7011218206,"t1":7011218306},{"name":"mix","t0":7011218306,"t1":7011218406},{"name":"ab","t0":7011218406,"t1":7011218506},{"name":"gdn","t0":7011218506,"t1":7011218606},{"name":"o_proj","t0":7011218606,"t1":7011218706},{"name":"res","t0":7011218706,"t1":7011218806},{"name":"router","t0":7011218806,"t1":7011218906},{"name":"gate_up","t0":7011218906,"t1":7011219006},{"name":"swiglu","t0":7011219006,"t1":7011219106},{"name":"down","t0":7011219106,"t1":7011219206},{"name":"gather","t0":7011219206,"t1":7011219306},{"name":"res","t0":7011219306,"t1":7011219406},{"name":"norm","t0":7011219406,"t1":7011219506},{"name":"lm_head","t0":7011219506,"t1":7011219606},{"name":"lm_head","t0":7011219606,"t1":7011219706},{"name":"lm_head","t0":7011219706,"t1":7011219806},{"name":"argmax","t0":7011219806,"t1":7011219906},{"name":"argmax","t0":7011219906,"t1":7011220006},{"name":"lm_head","t0":7011220006,"t1":7011220106},{"name":"argmax","t0":7011220106,"t1":7011220206},{"name":"argmax","t0":7011220206,"t1":7011220306}]} +{"schema":"aien.q36-decode-timeline/1","seq":5,"beat":11,"row":0,"step":5,"launches":21,"submits":1,"chip_ns":2877177,"record_ns":108353,"total_ns":2985530,"host":[{"name":"sched_join","t0":12440105,"t1":12516553},{"name":"sample","t0":12516553,"t1":12522025},{"name":"sched_feed","t0":12522025,"t1":12522761},{"name":"step_enter","t0":12522761,"t1":12522841},{"name":"embed","t0":12522841,"t1":12522873},{"name":"graph_record","t0":12522873,"t1":12631226},{"name":"graph_submit_wait","t0":12631226,"t1":15508403},{"name":"graph_exit","t0":15508403,"t1":15508467},{"name":"logits_read","t0":15508467,"t1":15508499},{"name":"step_return","t0":15508499,"t1":15518147},{"name":"sched_post","t0":15518147,"t1":15528099}],"dev":[{"name":"norm","t0":7012522873,"t1":7012522973},{"name":"mix","t0":7012522973,"t1":7012523073},{"name":"ab","t0":7012523073,"t1":7012523173},{"name":"gdn","t0":7012523173,"t1":7012523273},{"name":"o_proj","t0":7012523273,"t1":7012523373},{"name":"res","t0":7012523373,"t1":7012523473},{"name":"router","t0":7012523473,"t1":7012523573},{"name":"gate_up","t0":7012523573,"t1":7012523673},{"name":"swiglu","t0":7012523673,"t1":7012523773},{"name":"down","t0":7012523773,"t1":7012523873},{"name":"gather","t0":7012523873,"t1":7012523973},{"name":"res","t0":7012523973,"t1":7012524073},{"name":"norm","t0":7012524073,"t1":7012524173},{"name":"lm_head","t0":7012524173,"t1":7012524273},{"name":"lm_head","t0":7012524273,"t1":7012524373},{"name":"lm_head","t0":7012524373,"t1":7012524473},{"name":"argmax","t0":7012524473,"t1":7012524573},{"name":"argmax","t0":7012524573,"t1":7012524673},{"name":"lm_head","t0":7012524673,"t1":7012524773},{"name":"argmax","t0":7012524773,"t1":7012524873},{"name":"argmax","t0":7012524873,"t1":7012524973}]} +{"schema":"aien.q36-decode-timeline/1","seq":6,"beat":12,"row":0,"step":6,"launches":21,"submits":1,"chip_ns":899495,"record_ns":114721,"total_ns":1014216,"host":[{"name":"sched_join","t0":15528099,"t1":15601379},{"name":"sample","t0":15601379,"t1":15635284},{"name":"sched_feed","t0":15635284,"t1":15636164},{"name":"step_enter","t0":15636164,"t1":15636292},{"name":"embed","t0":15636292,"t1":15636324},{"name":"graph_record","t0":15636324,"t1":15751045},{"name":"graph_submit_wait","t0":15751045,"t1":16650540},{"name":"graph_exit","t0":16650540,"t1":16650588},{"name":"logits_read","t0":16650588,"t1":16650620},{"name":"step_return","t0":16650620,"t1":16655708},{"name":"sched_post","t0":16655708,"t1":16661020}],"dev":[{"name":"norm","t0":7015636324,"t1":7015636424},{"name":"mix","t0":7015636424,"t1":7015636524},{"name":"ab","t0":7015636524,"t1":7015636624},{"name":"gdn","t0":7015636624,"t1":7015636724},{"name":"o_proj","t0":7015636724,"t1":7015636824},{"name":"res","t0":7015636824,"t1":7015636924},{"name":"router","t0":7015636924,"t1":7015637024},{"name":"gate_up","t0":7015637024,"t1":7015637124},{"name":"swiglu","t0":7015637124,"t1":7015637224},{"name":"down","t0":7015637224,"t1":7015637324},{"name":"gather","t0":7015637324,"t1":7015637424},{"name":"res","t0":7015637424,"t1":7015637524},{"name":"norm","t0":7015637524,"t1":7015637624},{"name":"lm_head","t0":7015637624,"t1":7015637724},{"name":"lm_head","t0":7015637724,"t1":7015637824},{"name":"lm_head","t0":7015637824,"t1":7015637924},{"name":"argmax","t0":7015637924,"t1":7015638024},{"name":"argmax","t0":7015638024,"t1":7015638124},{"name":"lm_head","t0":7015638124,"t1":7015638224},{"name":"argmax","t0":7015638224,"t1":7015638324},{"name":"argmax","t0":7015638324,"t1":7015638424}]} +{"schema":"aien.q36-decode-timeline/1","seq":7,"beat":13,"row":0,"step":7,"launches":21,"submits":1,"chip_ns":630245,"record_ns":110321,"total_ns":740566,"host":[{"name":"sched_join","t0":16661020,"t1":16726061},{"name":"sample","t0":16726061,"t1":16732221},{"name":"sched_feed","t0":16732221,"t1":16732893},{"name":"step_enter","t0":16732893,"t1":16732989},{"name":"embed","t0":16732989,"t1":16733021},{"name":"graph_record","t0":16733021,"t1":16843342},{"name":"graph_submit_wait","t0":16843342,"t1":17473587},{"name":"graph_exit","t0":17473587,"t1":17473651},{"name":"logits_read","t0":17473651,"t1":17473699},{"name":"step_return","t0":17473699,"t1":17476131},{"name":"sched_post","t0":17476131,"t1":17478771}],"dev":[{"name":"norm","t0":7016733021,"t1":7016733121},{"name":"mix","t0":7016733121,"t1":7016733221},{"name":"ab","t0":7016733221,"t1":7016733321},{"name":"gdn","t0":7016733321,"t1":7016733421},{"name":"o_proj","t0":7016733421,"t1":7016733521},{"name":"res","t0":7016733521,"t1":7016733621},{"name":"router","t0":7016733621,"t1":7016733721},{"name":"gate_up","t0":7016733721,"t1":7016733821},{"name":"swiglu","t0":7016733821,"t1":7016733921},{"name":"down","t0":7016733921,"t1":7016734021},{"name":"gather","t0":7016734021,"t1":7016734121},{"name":"res","t0":7016734121,"t1":7016734221},{"name":"norm","t0":7016734221,"t1":7016734321},{"name":"lm_head","t0":7016734321,"t1":7016734421},{"name":"lm_head","t0":7016734421,"t1":7016734521},{"name":"lm_head","t0":7016734521,"t1":7016734621},{"name":"argmax","t0":7016734621,"t1":7016734721},{"name":"argmax","t0":7016734721,"t1":7016734821},{"name":"lm_head","t0":7016734821,"t1":7016734921},{"name":"argmax","t0":7016734921,"t1":7016735021},{"name":"argmax","t0":7016735021,"t1":7016735121}]} +{"schema":"aien.q36-decode-timeline/1","seq":8,"beat":14,"row":0,"step":8,"launches":21,"submits":1,"chip_ns":927192,"record_ns":107793,"total_ns":1034985,"host":[{"name":"sched_join","t0":17478771,"t1":17549364},{"name":"sample","t0":17549364,"t1":17597332},{"name":"sched_feed","t0":17597332,"t1":17597940},{"name":"step_enter","t0":17597940,"t1":17598020},{"name":"embed","t0":17598020,"t1":17598052},{"name":"graph_record","t0":17598052,"t1":17705845},{"name":"graph_submit_wait","t0":17705845,"t1":18633037},{"name":"graph_exit","t0":18633037,"t1":18633085},{"name":"logits_read","t0":18633085,"t1":18633117},{"name":"step_return","t0":18633117,"t1":18636509},{"name":"sched_post","t0":18636509,"t1":18639277}],"dev":[{"name":"norm","t0":7017598052,"t1":7017598152},{"name":"mix","t0":7017598152,"t1":7017598252},{"name":"ab","t0":7017598252,"t1":7017598352},{"name":"gdn","t0":7017598352,"t1":7017598452},{"name":"o_proj","t0":7017598452,"t1":7017598552},{"name":"res","t0":7017598552,"t1":7017598652},{"name":"router","t0":7017598652,"t1":7017598752},{"name":"gate_up","t0":7017598752,"t1":7017598852},{"name":"swiglu","t0":7017598852,"t1":7017598952},{"name":"down","t0":7017598952,"t1":7017599052},{"name":"gather","t0":7017599052,"t1":7017599152},{"name":"res","t0":7017599152,"t1":7017599252},{"name":"norm","t0":7017599252,"t1":7017599352},{"name":"lm_head","t0":7017599352,"t1":7017599452},{"name":"lm_head","t0":7017599452,"t1":7017599552},{"name":"lm_head","t0":7017599552,"t1":7017599652},{"name":"argmax","t0":7017599652,"t1":7017599752},{"name":"argmax","t0":7017599752,"t1":7017599852},{"name":"lm_head","t0":7017599852,"t1":7017599952},{"name":"argmax","t0":7017599952,"t1":7017600052},{"name":"argmax","t0":7017600052,"t1":7017600152}]} +{"schema":"aien.q36-decode-timeline/1","seq":9,"beat":15,"row":0,"step":9,"launches":21,"submits":1,"chip_ns":4018402,"record_ns":104721,"total_ns":4123123,"host":[{"name":"sched_join","t0":18639277,"t1":18681469},{"name":"sample","t0":18681469,"t1":18697917},{"name":"sched_feed","t0":18697917,"t1":18698525},{"name":"step_enter","t0":18698525,"t1":18698621},{"name":"embed","t0":18698621,"t1":18698653},{"name":"graph_record","t0":18698653,"t1":18803374},{"name":"graph_submit_wait","t0":18803374,"t1":22821776},{"name":"graph_exit","t0":22821776,"t1":22821840},{"name":"logits_read","t0":22821840,"t1":22821872},{"name":"step_return","t0":22821872,"t1":22835280},{"name":"sched_post","t0":22835280,"t1":22844048}],"dev":[{"name":"norm","t0":7018698653,"t1":7018698753},{"name":"mix","t0":7018698753,"t1":7018698853},{"name":"ab","t0":7018698853,"t1":7018698953},{"name":"gdn","t0":7018698953,"t1":7018699053},{"name":"o_proj","t0":7018699053,"t1":7018699153},{"name":"res","t0":7018699153,"t1":7018699253},{"name":"router","t0":7018699253,"t1":7018699353},{"name":"gate_up","t0":7018699353,"t1":7018699453},{"name":"swiglu","t0":7018699453,"t1":7018699553},{"name":"down","t0":7018699553,"t1":7018699653},{"name":"gather","t0":7018699653,"t1":7018699753},{"name":"res","t0":7018699753,"t1":7018699853},{"name":"norm","t0":7018699853,"t1":7018699953},{"name":"lm_head","t0":7018699953,"t1":7018700053},{"name":"lm_head","t0":7018700053,"t1":7018700153},{"name":"lm_head","t0":7018700153,"t1":7018700253},{"name":"argmax","t0":7018700253,"t1":7018700353},{"name":"argmax","t0":7018700353,"t1":7018700453},{"name":"lm_head","t0":7018700453,"t1":7018700553},{"name":"argmax","t0":7018700553,"t1":7018700653},{"name":"argmax","t0":7018700653,"t1":7018700753}]} +{"schema":"aien.q36-decode-timeline/1","seq":10,"beat":16,"row":0,"step":10,"launches":21,"submits":1,"chip_ns":1954929,"record_ns":111664,"total_ns":2066593,"host":[{"name":"sched_join","t0":22844048,"t1":22939665},{"name":"sample","t0":22939665,"t1":22996289},{"name":"sched_feed","t0":22996289,"t1":22997346},{"name":"step_enter","t0":22997346,"t1":22997522},{"name":"embed","t0":22997522,"t1":22997554},{"name":"graph_record","t0":22997554,"t1":23109218},{"name":"graph_submit_wait","t0":23109218,"t1":25064147},{"name":"graph_exit","t0":25064147,"t1":25064179},{"name":"logits_read","t0":25064179,"t1":25064243},{"name":"step_return","t0":25064243,"t1":25074627},{"name":"sched_post","t0":25074627,"t1":25090099}],"dev":[{"name":"norm","t0":7022997554,"t1":7022997654},{"name":"mix","t0":7022997654,"t1":7022997754},{"name":"ab","t0":7022997754,"t1":7022997854},{"name":"gdn","t0":7022997854,"t1":7022997954},{"name":"o_proj","t0":7022997954,"t1":7022998054},{"name":"res","t0":7022998054,"t1":7022998154},{"name":"router","t0":7022998154,"t1":7022998254},{"name":"gate_up","t0":7022998254,"t1":7022998354},{"name":"swiglu","t0":7022998354,"t1":7022998454},{"name":"down","t0":7022998454,"t1":7022998554},{"name":"gather","t0":7022998554,"t1":7022998654},{"name":"res","t0":7022998654,"t1":7022998754},{"name":"norm","t0":7022998754,"t1":7022998854},{"name":"lm_head","t0":7022998854,"t1":7022998954},{"name":"lm_head","t0":7022998954,"t1":7022999054},{"name":"lm_head","t0":7022999054,"t1":7022999154},{"name":"argmax","t0":7022999154,"t1":7022999254},{"name":"argmax","t0":7022999254,"t1":7022999354},{"name":"lm_head","t0":7022999354,"t1":7022999454},{"name":"argmax","t0":7022999454,"t1":7022999554},{"name":"argmax","t0":7022999554,"t1":7022999654}]} +{"schema":"aien.q36-decode-timeline/1","seq":11,"beat":17,"row":0,"step":11,"launches":21,"submits":1,"chip_ns":610293,"record_ns":107601,"total_ns":717894,"host":[{"name":"sched_join","t0":25090099,"t1":25144020},{"name":"sample","t0":25144020,"t1":25154516},{"name":"sched_feed","t0":25154516,"t1":25155348},{"name":"step_enter","t0":25155348,"t1":25155428},{"name":"embed","t0":25155428,"t1":25155460},{"name":"graph_record","t0":25155460,"t1":25263061},{"name":"graph_submit_wait","t0":25263061,"t1":25873354},{"name":"graph_exit","t0":25873354,"t1":25873402},{"name":"logits_read","t0":25873402,"t1":25873434},{"name":"step_return","t0":25873434,"t1":25875786},{"name":"sched_post","t0":25875786,"t1":25878506}],"dev":[{"name":"norm","t0":7025155460,"t1":7025155560},{"name":"mix","t0":7025155560,"t1":7025155660},{"name":"ab","t0":7025155660,"t1":7025155760},{"name":"gdn","t0":7025155760,"t1":7025155860},{"name":"o_proj","t0":7025155860,"t1":7025155960},{"name":"res","t0":7025155960,"t1":7025156060},{"name":"router","t0":7025156060,"t1":7025156160},{"name":"gate_up","t0":7025156160,"t1":7025156260},{"name":"swiglu","t0":7025156260,"t1":7025156360},{"name":"down","t0":7025156360,"t1":7025156460},{"name":"gather","t0":7025156460,"t1":7025156560},{"name":"res","t0":7025156560,"t1":7025156660},{"name":"norm","t0":7025156660,"t1":7025156760},{"name":"lm_head","t0":7025156760,"t1":7025156860},{"name":"lm_head","t0":7025156860,"t1":7025156960},{"name":"lm_head","t0":7025156960,"t1":7025157060},{"name":"argmax","t0":7025157060,"t1":7025157160},{"name":"argmax","t0":7025157160,"t1":7025157260},{"name":"lm_head","t0":7025157260,"t1":7025157360},{"name":"argmax","t0":7025157360,"t1":7025157460},{"name":"argmax","t0":7025157460,"t1":7025157560}]} +{"schema":"aien.q36-decode-timeline/1","seq":12,"beat":18,"row":0,"step":12,"launches":21,"submits":1,"chip_ns":610997,"record_ns":106321,"total_ns":717318,"host":[{"name":"sched_join","t0":25878506,"t1":25972459},{"name":"sample","t0":25972459,"t1":25987483},{"name":"sched_feed","t0":25987483,"t1":25987979},{"name":"step_enter","t0":25987979,"t1":25988075},{"name":"embed","t0":25988075,"t1":25988107},{"name":"graph_record","t0":25988107,"t1":26094428},{"name":"graph_submit_wait","t0":26094428,"t1":26705425},{"name":"graph_exit","t0":26705425,"t1":26705473},{"name":"logits_read","t0":26705473,"t1":26705505},{"name":"step_return","t0":26705505,"t1":26707489},{"name":"sched_post","t0":26707489,"t1":26710961}],"dev":[{"name":"norm","t0":7025988107,"t1":7025988207},{"name":"mix","t0":7025988207,"t1":7025988307},{"name":"ab","t0":7025988307,"t1":7025988407},{"name":"gdn","t0":7025988407,"t1":7025988507},{"name":"o_proj","t0":7025988507,"t1":7025988607},{"name":"res","t0":7025988607,"t1":7025988707},{"name":"router","t0":7025988707,"t1":7025988807},{"name":"gate_up","t0":7025988807,"t1":7025988907},{"name":"swiglu","t0":7025988907,"t1":7025989007},{"name":"down","t0":7025989007,"t1":7025989107},{"name":"gather","t0":7025989107,"t1":7025989207},{"name":"res","t0":7025989207,"t1":7025989307},{"name":"norm","t0":7025989307,"t1":7025989407},{"name":"lm_head","t0":7025989407,"t1":7025989507},{"name":"lm_head","t0":7025989507,"t1":7025989607},{"name":"lm_head","t0":7025989607,"t1":7025989707},{"name":"argmax","t0":7025989707,"t1":7025989807},{"name":"argmax","t0":7025989807,"t1":7025989907},{"name":"lm_head","t0":7025989907,"t1":7025990007},{"name":"argmax","t0":7025990007,"t1":7025990107},{"name":"argmax","t0":7025990107,"t1":7025990207}]} +{"schema":"aien.q36-decode-timeline/1","seq":13,"beat":19,"row":0,"step":13,"launches":21,"submits":1,"chip_ns":1167546,"record_ns":115361,"total_ns":1282907,"host":[{"name":"sched_join","t0":26710961,"t1":26763873},{"name":"sample","t0":26763873,"t1":26769057},{"name":"sched_feed","t0":26769057,"t1":26769521},{"name":"step_enter","t0":26769521,"t1":26769601},{"name":"embed","t0":26769601,"t1":26769633},{"name":"graph_record","t0":26769633,"t1":26884994},{"name":"graph_submit_wait","t0":26884994,"t1":28052540},{"name":"graph_exit","t0":28052540,"t1":28052588},{"name":"logits_read","t0":28052588,"t1":28052636},{"name":"step_return","t0":28052636,"t1":28057564},{"name":"sched_post","t0":28057564,"t1":28063420}],"dev":[{"name":"norm","t0":7026769633,"t1":7026769733},{"name":"mix","t0":7026769733,"t1":7026769833},{"name":"ab","t0":7026769833,"t1":7026769933},{"name":"gdn","t0":7026769933,"t1":7026770033},{"name":"o_proj","t0":7026770033,"t1":7026770133},{"name":"res","t0":7026770133,"t1":7026770233},{"name":"router","t0":7026770233,"t1":7026770333},{"name":"gate_up","t0":7026770333,"t1":7026770433},{"name":"swiglu","t0":7026770433,"t1":7026770533},{"name":"down","t0":7026770533,"t1":7026770633},{"name":"gather","t0":7026770633,"t1":7026770733},{"name":"res","t0":7026770733,"t1":7026770833},{"name":"norm","t0":7026770833,"t1":7026770933},{"name":"lm_head","t0":7026770933,"t1":7026771033},{"name":"lm_head","t0":7026771033,"t1":7026771133},{"name":"lm_head","t0":7026771133,"t1":7026771233},{"name":"argmax","t0":7026771233,"t1":7026771333},{"name":"argmax","t0":7026771333,"t1":7026771433},{"name":"lm_head","t0":7026771433,"t1":7026771533},{"name":"argmax","t0":7026771533,"t1":7026771633},{"name":"argmax","t0":7026771633,"t1":7026771733}]} +{"schema":"aien.q36-decode-timeline/1","seq":14,"beat":20,"row":0,"step":14,"launches":21,"submits":1,"chip_ns":613525,"record_ns":111377,"total_ns":724902,"host":[{"name":"sched_join","t0":28063420,"t1":28127053},{"name":"sample","t0":28127053,"t1":28135917},{"name":"sched_feed","t0":28135917,"t1":28136653},{"name":"step_enter","t0":28136653,"t1":28136749},{"name":"embed","t0":28136749,"t1":28136781},{"name":"graph_record","t0":28136781,"t1":28248158},{"name":"graph_submit_wait","t0":28248158,"t1":28861683},{"name":"graph_exit","t0":28861683,"t1":28861715},{"name":"logits_read","t0":28861715,"t1":28861763},{"name":"step_return","t0":28861763,"t1":28863923},{"name":"sched_post","t0":28863923,"t1":28866643}],"dev":[{"name":"norm","t0":7028136781,"t1":7028136881},{"name":"mix","t0":7028136881,"t1":7028136981},{"name":"ab","t0":7028136981,"t1":7028137081},{"name":"gdn","t0":7028137081,"t1":7028137181},{"name":"o_proj","t0":7028137181,"t1":7028137281},{"name":"res","t0":7028137281,"t1":7028137381},{"name":"router","t0":7028137381,"t1":7028137481},{"name":"gate_up","t0":7028137481,"t1":7028137581},{"name":"swiglu","t0":7028137581,"t1":7028137681},{"name":"down","t0":7028137681,"t1":7028137781},{"name":"gather","t0":7028137781,"t1":7028137881},{"name":"res","t0":7028137881,"t1":7028137981},{"name":"norm","t0":7028137981,"t1":7028138081},{"name":"lm_head","t0":7028138081,"t1":7028138181},{"name":"lm_head","t0":7028138181,"t1":7028138281},{"name":"lm_head","t0":7028138281,"t1":7028138381},{"name":"argmax","t0":7028138381,"t1":7028138481},{"name":"argmax","t0":7028138481,"t1":7028138581},{"name":"lm_head","t0":7028138581,"t1":7028138681},{"name":"argmax","t0":7028138681,"t1":7028138781},{"name":"argmax","t0":7028138781,"t1":7028138881}]} +{"schema":"aien.q36-decode-timeline/1","seq":15,"beat":21,"row":0,"step":15,"launches":21,"submits":1,"chip_ns":2934601,"record_ns":105665,"total_ns":3040266,"host":[{"name":"sched_join","t0":28866643,"t1":28908323},{"name":"sample","t0":28908323,"t1":28914483},{"name":"sched_feed","t0":28914483,"t1":28914899},{"name":"step_enter","t0":28914899,"t1":28914979},{"name":"embed","t0":28914979,"t1":28915027},{"name":"graph_record","t0":28915027,"t1":29020692},{"name":"graph_submit_wait","t0":29020692,"t1":31955293},{"name":"graph_exit","t0":31955293,"t1":31955629},{"name":"logits_read","t0":31955629,"t1":31955661},{"name":"step_return","t0":31955661,"t1":31966413},{"name":"sched_post","t0":31966413,"t1":31981805}],"dev":[{"name":"norm","t0":7028915027,"t1":7028915127},{"name":"mix","t0":7028915127,"t1":7028915227},{"name":"ab","t0":7028915227,"t1":7028915327},{"name":"gdn","t0":7028915327,"t1":7028915427},{"name":"o_proj","t0":7028915427,"t1":7028915527},{"name":"res","t0":7028915527,"t1":7028915627},{"name":"router","t0":7028915627,"t1":7028915727},{"name":"gate_up","t0":7028915727,"t1":7028915827},{"name":"swiglu","t0":7028915827,"t1":7028915927},{"name":"down","t0":7028915927,"t1":7028916027},{"name":"gather","t0":7028916027,"t1":7028916127},{"name":"res","t0":7028916127,"t1":7028916227},{"name":"norm","t0":7028916227,"t1":7028916327},{"name":"lm_head","t0":7028916327,"t1":7028916427},{"name":"lm_head","t0":7028916427,"t1":7028916527},{"name":"lm_head","t0":7028916527,"t1":7028916627},{"name":"argmax","t0":7028916627,"t1":7028916727},{"name":"argmax","t0":7028916727,"t1":7028916827},{"name":"lm_head","t0":7028916827,"t1":7028916927},{"name":"argmax","t0":7028916927,"t1":7028917027},{"name":"argmax","t0":7028917027,"t1":7028917127}]} +{"schema":"aien.q36-decode-timeline/1","seq":16,"beat":22,"row":0,"step":16,"launches":21,"submits":1,"chip_ns":615717,"record_ns":107553,"total_ns":723270,"host":[{"name":"sched_join","t0":31981805,"t1":32042030},{"name":"sample","t0":32042030,"t1":32049118},{"name":"sched_feed","t0":32049118,"t1":32050094},{"name":"step_enter","t0":32050094,"t1":32050382},{"name":"embed","t0":32050382,"t1":32050510},{"name":"graph_record","t0":32050510,"t1":32158063},{"name":"graph_submit_wait","t0":32158063,"t1":32773780},{"name":"graph_exit","t0":32773780,"t1":32773812},{"name":"logits_read","t0":32773812,"t1":32773844},{"name":"step_return","t0":32773844,"t1":32779604},{"name":"sched_post","t0":32779604,"t1":32784404}],"dev":[{"name":"norm","t0":7032050510,"t1":7032050610},{"name":"mix","t0":7032050610,"t1":7032050710},{"name":"ab","t0":7032050710,"t1":7032050810},{"name":"gdn","t0":7032050810,"t1":7032050910},{"name":"o_proj","t0":7032050910,"t1":7032051010},{"name":"res","t0":7032051010,"t1":7032051110},{"name":"router","t0":7032051110,"t1":7032051210},{"name":"gate_up","t0":7032051210,"t1":7032051310},{"name":"swiglu","t0":7032051310,"t1":7032051410},{"name":"down","t0":7032051410,"t1":7032051510},{"name":"gather","t0":7032051510,"t1":7032051610},{"name":"res","t0":7032051610,"t1":7032051710},{"name":"norm","t0":7032051710,"t1":7032051810},{"name":"lm_head","t0":7032051810,"t1":7032051910},{"name":"lm_head","t0":7032051910,"t1":7032052010},{"name":"lm_head","t0":7032052010,"t1":7032052110},{"name":"argmax","t0":7032052110,"t1":7032052210},{"name":"argmax","t0":7032052210,"t1":7032052310},{"name":"lm_head","t0":7032052310,"t1":7032052410},{"name":"argmax","t0":7032052410,"t1":7032052510},{"name":"argmax","t0":7032052510,"t1":7032052610}]} +{"schema":"aien.q36-decode-timeline/1","seq":17,"beat":23,"row":0,"step":17,"launches":21,"submits":1,"chip_ns":617077,"record_ns":106849,"total_ns":723926,"host":[{"name":"sched_join","t0":32784404,"t1":32834180},{"name":"sample","t0":32834180,"t1":32840980},{"name":"sched_feed","t0":32840980,"t1":32841556},{"name":"step_enter","t0":32841556,"t1":32841668},{"name":"embed","t0":32841668,"t1":32841716},{"name":"graph_record","t0":32841716,"t1":32948565},{"name":"graph_submit_wait","t0":32948565,"t1":33565642},{"name":"graph_exit","t0":33565642,"t1":33565690},{"name":"logits_read","t0":33565690,"t1":33565722},{"name":"step_return","t0":33565722,"t1":33568058},{"name":"sched_post","t0":33568058,"t1":33570906}],"dev":[{"name":"norm","t0":7032841716,"t1":7032841816},{"name":"mix","t0":7032841816,"t1":7032841916},{"name":"ab","t0":7032841916,"t1":7032842016},{"name":"gdn","t0":7032842016,"t1":7032842116},{"name":"o_proj","t0":7032842116,"t1":7032842216},{"name":"res","t0":7032842216,"t1":7032842316},{"name":"router","t0":7032842316,"t1":7032842416},{"name":"gate_up","t0":7032842416,"t1":7032842516},{"name":"swiglu","t0":7032842516,"t1":7032842616},{"name":"down","t0":7032842616,"t1":7032842716},{"name":"gather","t0":7032842716,"t1":7032842816},{"name":"res","t0":7032842816,"t1":7032842916},{"name":"norm","t0":7032842916,"t1":7032843016},{"name":"lm_head","t0":7032843016,"t1":7032843116},{"name":"lm_head","t0":7032843116,"t1":7032843216},{"name":"lm_head","t0":7032843216,"t1":7032843316},{"name":"argmax","t0":7032843316,"t1":7032843416},{"name":"argmax","t0":7032843416,"t1":7032843516},{"name":"lm_head","t0":7032843516,"t1":7032843616},{"name":"argmax","t0":7032843616,"t1":7032843716},{"name":"argmax","t0":7032843716,"t1":7032843816}]} +{"schema":"aien.q36-decode-timeline/1","seq":18,"beat":24,"row":0,"step":18,"launches":21,"submits":1,"chip_ns":622613,"record_ns":106129,"total_ns":728742,"host":[{"name":"sched_join","t0":33570906,"t1":33607419},{"name":"sample","t0":33607419,"t1":33613643},{"name":"sched_feed","t0":33613643,"t1":33614155},{"name":"step_enter","t0":33614155,"t1":33614347},{"name":"embed","t0":33614347,"t1":33614379},{"name":"graph_record","t0":33614379,"t1":33720508},{"name":"graph_submit_wait","t0":33720508,"t1":34343121},{"name":"graph_exit","t0":34343121,"t1":34343169},{"name":"logits_read","t0":34343169,"t1":34343201},{"name":"step_return","t0":34343201,"t1":34347137},{"name":"sched_post","t0":34347137,"t1":34351473}],"dev":[{"name":"norm","t0":7033614379,"t1":7033614479},{"name":"mix","t0":7033614479,"t1":7033614579},{"name":"ab","t0":7033614579,"t1":7033614679},{"name":"gdn","t0":7033614679,"t1":7033614779},{"name":"o_proj","t0":7033614779,"t1":7033614879},{"name":"res","t0":7033614879,"t1":7033614979},{"name":"router","t0":7033614979,"t1":7033615079},{"name":"gate_up","t0":7033615079,"t1":7033615179},{"name":"swiglu","t0":7033615179,"t1":7033615279},{"name":"down","t0":7033615279,"t1":7033615379},{"name":"gather","t0":7033615379,"t1":7033615479},{"name":"res","t0":7033615479,"t1":7033615579},{"name":"norm","t0":7033615579,"t1":7033615679},{"name":"lm_head","t0":7033615679,"t1":7033615779},{"name":"lm_head","t0":7033615779,"t1":7033615879},{"name":"lm_head","t0":7033615879,"t1":7033615979},{"name":"argmax","t0":7033615979,"t1":7033616079},{"name":"argmax","t0":7033616079,"t1":7033616179},{"name":"lm_head","t0":7033616179,"t1":7033616279},{"name":"argmax","t0":7033616279,"t1":7033616379},{"name":"argmax","t0":7033616379,"t1":7033616479}]} diff --git a/evidence/dra-66-host-time-20261031/host-stamps.jsonl b/evidence/dra-66-host-time-20261031/host-stamps.jsonl new file mode 100644 index 00000000..30fa8eb2 --- /dev/null +++ b/evidence/dra-66-host-time-20261031/host-stamps.jsonl @@ -0,0 +1,19 @@ +{"schema":"aien.q36-decode-timeline/1","seq":0,"beat":6,"row":0,"step":0,"launches":21,"submits":1,"chip_ns":22100,"record_ns":103985,"total_ns":712182,"host":[{"name":"sched_join","t0":7856898,"t1":7856978},{"name":"sample","t0":7856978,"t1":7871026},{"name":"sched_feed","t0":7871026,"t1":7871586},{"name":"step_enter","t0":7871586,"t1":7871666},{"name":"embed","t0":7871666,"t1":7871698},{"name":"graph_record","t0":7871698,"t1":7975683},{"name":"graph_submit_wait","t0":7975683,"t1":8583880},{"name":"graph_exit","t0":8583880,"t1":8583928},{"name":"logits_read","t0":8583928,"t1":8583976},{"name":"step_return","t0":8583976,"t1":8585336},{"name":"sched_post","t0":8585336,"t1":8593176}],"dev":[{"name":"norm","t0":7007871698,"t1":7007871798},{"name":"mix","t0":7007871798,"t1":7007871898},{"name":"ab","t0":7007871898,"t1":7007871998},{"name":"gdn","t0":7007871998,"t1":7007872098},{"name":"o_proj","t0":7007872098,"t1":7007872198},{"name":"res","t0":7007872198,"t1":7007872298},{"name":"router","t0":7007872298,"t1":7007872398},{"name":"gate_up","t0":7007872398,"t1":7007872498},{"name":"swiglu","t0":7007872498,"t1":7007872598},{"name":"down","t0":7007872598,"t1":7007872698},{"name":"gather","t0":7007872698,"t1":7007872798},{"name":"res","t0":7007872798,"t1":7007872898},{"name":"norm","t0":7007872898,"t1":7007872998},{"name":"lm_head","t0":7007872998,"t1":7007873098},{"name":"lm_head","t0":7007873098,"t1":7007873198},{"name":"lm_head","t0":7007873198,"t1":7007873298},{"name":"argmax","t0":7007873298,"t1":7007873398},{"name":"argmax","t0":7007873398,"t1":7007873498},{"name":"lm_head","t0":7007873498,"t1":7007873598},{"name":"argmax","t0":7007873598,"t1":7007873698},{"name":"argmax","t0":7007873698,"t1":7007873798}]} +{"schema":"aien.q36-decode-timeline/1","seq":1,"beat":7,"row":0,"step":1,"launches":21,"submits":1,"chip_ns":22100,"record_ns":113905,"total_ns":729414,"host":[{"name":"sched_join","t0":8593176,"t1":8760938},{"name":"sample","t0":8760938,"t1":8765674},{"name":"sched_feed","t0":8765674,"t1":8765994},{"name":"step_enter","t0":8765994,"t1":8766074},{"name":"embed","t0":8766074,"t1":8766106},{"name":"graph_record","t0":8766106,"t1":8880011},{"name":"graph_submit_wait","t0":8880011,"t1":9495520},{"name":"graph_exit","t0":9495520,"t1":9495568},{"name":"logits_read","t0":9495568,"t1":9495600},{"name":"step_return","t0":9495600,"t1":9498144},{"name":"sched_post","t0":9498144,"t1":9503168}],"dev":[{"name":"norm","t0":7008766106,"t1":7008766206},{"name":"mix","t0":7008766206,"t1":7008766306},{"name":"ab","t0":7008766306,"t1":7008766406},{"name":"gdn","t0":7008766406,"t1":7008766506},{"name":"o_proj","t0":7008766506,"t1":7008766606},{"name":"res","t0":7008766606,"t1":7008766706},{"name":"router","t0":7008766706,"t1":7008766806},{"name":"gate_up","t0":7008766806,"t1":7008766906},{"name":"swiglu","t0":7008766906,"t1":7008767006},{"name":"down","t0":7008767006,"t1":7008767106},{"name":"gather","t0":7008767106,"t1":7008767206},{"name":"res","t0":7008767206,"t1":7008767306},{"name":"norm","t0":7008767306,"t1":7008767406},{"name":"lm_head","t0":7008767406,"t1":7008767506},{"name":"lm_head","t0":7008767506,"t1":7008767606},{"name":"lm_head","t0":7008767606,"t1":7008767706},{"name":"argmax","t0":7008767706,"t1":7008767806},{"name":"argmax","t0":7008767806,"t1":7008767906},{"name":"lm_head","t0":7008767906,"t1":7008768006},{"name":"argmax","t0":7008768006,"t1":7008768106},{"name":"argmax","t0":7008768106,"t1":7008768206}]} +{"schema":"aien.q36-decode-timeline/1","seq":2,"beat":8,"row":0,"step":2,"launches":21,"submits":1,"chip_ns":22100,"record_ns":105472,"total_ns":713974,"host":[{"name":"sched_join","t0":9503168,"t1":9553872},{"name":"sample","t0":9553872,"t1":9558017},{"name":"sched_feed","t0":9558017,"t1":9558513},{"name":"step_enter","t0":9558513,"t1":9558657},{"name":"embed","t0":9558657,"t1":9558689},{"name":"graph_record","t0":9558689,"t1":9664161},{"name":"graph_submit_wait","t0":9664161,"t1":10272663},{"name":"graph_exit","t0":10272663,"t1":10272711},{"name":"logits_read","t0":10272711,"t1":10272743},{"name":"step_return","t0":10272743,"t1":10274727},{"name":"sched_post","t0":10274727,"t1":10277447}],"dev":[{"name":"norm","t0":7009558689,"t1":7009558789},{"name":"mix","t0":7009558789,"t1":7009558889},{"name":"ab","t0":7009558889,"t1":7009558989},{"name":"gdn","t0":7009558989,"t1":7009559089},{"name":"o_proj","t0":7009559089,"t1":7009559189},{"name":"res","t0":7009559189,"t1":7009559289},{"name":"router","t0":7009559289,"t1":7009559389},{"name":"gate_up","t0":7009559389,"t1":7009559489},{"name":"swiglu","t0":7009559489,"t1":7009559589},{"name":"down","t0":7009559589,"t1":7009559689},{"name":"gather","t0":7009559689,"t1":7009559789},{"name":"res","t0":7009559789,"t1":7009559889},{"name":"norm","t0":7009559889,"t1":7009559989},{"name":"lm_head","t0":7009559989,"t1":7009560089},{"name":"lm_head","t0":7009560089,"t1":7009560189},{"name":"lm_head","t0":7009560189,"t1":7009560289},{"name":"argmax","t0":7009560289,"t1":7009560389},{"name":"argmax","t0":7009560389,"t1":7009560489},{"name":"lm_head","t0":7009560489,"t1":7009560589},{"name":"argmax","t0":7009560589,"t1":7009560689},{"name":"argmax","t0":7009560689,"t1":7009560789}]} +{"schema":"aien.q36-decode-timeline/1","seq":3,"beat":9,"row":0,"step":3,"launches":21,"submits":1,"chip_ns":22100,"record_ns":104897,"total_ns":798855,"host":[{"name":"sched_join","t0":10277447,"t1":10354935},{"name":"sample","t0":10354935,"t1":10357975},{"name":"sched_feed","t0":10357975,"t1":10358183},{"name":"step_enter","t0":10358183,"t1":10358263},{"name":"embed","t0":10358263,"t1":10358311},{"name":"graph_record","t0":10358311,"t1":10463208},{"name":"graph_submit_wait","t0":10463208,"t1":11157166},{"name":"graph_exit","t0":11157166,"t1":11157230},{"name":"logits_read","t0":11157230,"t1":11157278},{"name":"step_return","t0":11157278,"t1":11161118},{"name":"sched_post","t0":11161118,"t1":11164862}],"dev":[{"name":"norm","t0":7010358311,"t1":7010358411},{"name":"mix","t0":7010358411,"t1":7010358511},{"name":"ab","t0":7010358511,"t1":7010358611},{"name":"gdn","t0":7010358611,"t1":7010358711},{"name":"o_proj","t0":7010358711,"t1":7010358811},{"name":"res","t0":7010358811,"t1":7010358911},{"name":"router","t0":7010358911,"t1":7010359011},{"name":"gate_up","t0":7010359011,"t1":7010359111},{"name":"swiglu","t0":7010359111,"t1":7010359211},{"name":"down","t0":7010359211,"t1":7010359311},{"name":"gather","t0":7010359311,"t1":7010359411},{"name":"res","t0":7010359411,"t1":7010359511},{"name":"norm","t0":7010359511,"t1":7010359611},{"name":"lm_head","t0":7010359611,"t1":7010359711},{"name":"lm_head","t0":7010359711,"t1":7010359811},{"name":"lm_head","t0":7010359811,"t1":7010359911},{"name":"argmax","t0":7010359911,"t1":7010360011},{"name":"argmax","t0":7010360011,"t1":7010360111},{"name":"lm_head","t0":7010360111,"t1":7010360211},{"name":"argmax","t0":7010360211,"t1":7010360311},{"name":"argmax","t0":7010360311,"t1":7010360411}]} +{"schema":"aien.q36-decode-timeline/1","seq":4,"beat":10,"row":0,"step":4,"launches":21,"submits":1,"chip_ns":22100,"record_ns":107953,"total_ns":1216075,"host":[{"name":"sched_join","t0":11164862,"t1":11209886},{"name":"sample","t0":11209886,"t1":11217614},{"name":"sched_feed","t0":11217614,"t1":11218094},{"name":"step_enter","t0":11218094,"t1":11218174},{"name":"embed","t0":11218174,"t1":11218206},{"name":"graph_record","t0":11218206,"t1":11326159},{"name":"graph_submit_wait","t0":11326159,"t1":12434281},{"name":"graph_exit","t0":12434281,"t1":12434329},{"name":"logits_read","t0":12434329,"t1":12434361},{"name":"step_return","t0":12434361,"t1":12436809},{"name":"sched_post","t0":12436809,"t1":12440105}],"dev":[{"name":"norm","t0":7011218206,"t1":7011218306},{"name":"mix","t0":7011218306,"t1":7011218406},{"name":"ab","t0":7011218406,"t1":7011218506},{"name":"gdn","t0":7011218506,"t1":7011218606},{"name":"o_proj","t0":7011218606,"t1":7011218706},{"name":"res","t0":7011218706,"t1":7011218806},{"name":"router","t0":7011218806,"t1":7011218906},{"name":"gate_up","t0":7011218906,"t1":7011219006},{"name":"swiglu","t0":7011219006,"t1":7011219106},{"name":"down","t0":7011219106,"t1":7011219206},{"name":"gather","t0":7011219206,"t1":7011219306},{"name":"res","t0":7011219306,"t1":7011219406},{"name":"norm","t0":7011219406,"t1":7011219506},{"name":"lm_head","t0":7011219506,"t1":7011219606},{"name":"lm_head","t0":7011219606,"t1":7011219706},{"name":"lm_head","t0":7011219706,"t1":7011219806},{"name":"argmax","t0":7011219806,"t1":7011219906},{"name":"argmax","t0":7011219906,"t1":7011220006},{"name":"lm_head","t0":7011220006,"t1":7011220106},{"name":"argmax","t0":7011220106,"t1":7011220206},{"name":"argmax","t0":7011220206,"t1":7011220306}]} +{"schema":"aien.q36-decode-timeline/1","seq":5,"beat":11,"row":0,"step":5,"launches":21,"submits":1,"chip_ns":22100,"record_ns":108353,"total_ns":2985530,"host":[{"name":"sched_join","t0":12440105,"t1":12516553},{"name":"sample","t0":12516553,"t1":12522025},{"name":"sched_feed","t0":12522025,"t1":12522761},{"name":"step_enter","t0":12522761,"t1":12522841},{"name":"embed","t0":12522841,"t1":12522873},{"name":"graph_record","t0":12522873,"t1":12631226},{"name":"graph_submit_wait","t0":12631226,"t1":15508403},{"name":"graph_exit","t0":15508403,"t1":15508467},{"name":"logits_read","t0":15508467,"t1":15508499},{"name":"step_return","t0":15508499,"t1":15518147},{"name":"sched_post","t0":15518147,"t1":15528099}],"dev":[{"name":"norm","t0":7012522873,"t1":7012522973},{"name":"mix","t0":7012522973,"t1":7012523073},{"name":"ab","t0":7012523073,"t1":7012523173},{"name":"gdn","t0":7012523173,"t1":7012523273},{"name":"o_proj","t0":7012523273,"t1":7012523373},{"name":"res","t0":7012523373,"t1":7012523473},{"name":"router","t0":7012523473,"t1":7012523573},{"name":"gate_up","t0":7012523573,"t1":7012523673},{"name":"swiglu","t0":7012523673,"t1":7012523773},{"name":"down","t0":7012523773,"t1":7012523873},{"name":"gather","t0":7012523873,"t1":7012523973},{"name":"res","t0":7012523973,"t1":7012524073},{"name":"norm","t0":7012524073,"t1":7012524173},{"name":"lm_head","t0":7012524173,"t1":7012524273},{"name":"lm_head","t0":7012524273,"t1":7012524373},{"name":"lm_head","t0":7012524373,"t1":7012524473},{"name":"argmax","t0":7012524473,"t1":7012524573},{"name":"argmax","t0":7012524573,"t1":7012524673},{"name":"lm_head","t0":7012524673,"t1":7012524773},{"name":"argmax","t0":7012524773,"t1":7012524873},{"name":"argmax","t0":7012524873,"t1":7012524973}]} +{"schema":"aien.q36-decode-timeline/1","seq":6,"beat":12,"row":0,"step":6,"launches":21,"submits":1,"chip_ns":22100,"record_ns":114721,"total_ns":1014216,"host":[{"name":"sched_join","t0":15528099,"t1":15601379},{"name":"sample","t0":15601379,"t1":15635284},{"name":"sched_feed","t0":15635284,"t1":15636164},{"name":"step_enter","t0":15636164,"t1":15636292},{"name":"embed","t0":15636292,"t1":15636324},{"name":"graph_record","t0":15636324,"t1":15751045},{"name":"graph_submit_wait","t0":15751045,"t1":16650540},{"name":"graph_exit","t0":16650540,"t1":16650588},{"name":"logits_read","t0":16650588,"t1":16650620},{"name":"step_return","t0":16650620,"t1":16655708},{"name":"sched_post","t0":16655708,"t1":16661020}],"dev":[{"name":"norm","t0":7015636324,"t1":7015636424},{"name":"mix","t0":7015636424,"t1":7015636524},{"name":"ab","t0":7015636524,"t1":7015636624},{"name":"gdn","t0":7015636624,"t1":7015636724},{"name":"o_proj","t0":7015636724,"t1":7015636824},{"name":"res","t0":7015636824,"t1":7015636924},{"name":"router","t0":7015636924,"t1":7015637024},{"name":"gate_up","t0":7015637024,"t1":7015637124},{"name":"swiglu","t0":7015637124,"t1":7015637224},{"name":"down","t0":7015637224,"t1":7015637324},{"name":"gather","t0":7015637324,"t1":7015637424},{"name":"res","t0":7015637424,"t1":7015637524},{"name":"norm","t0":7015637524,"t1":7015637624},{"name":"lm_head","t0":7015637624,"t1":7015637724},{"name":"lm_head","t0":7015637724,"t1":7015637824},{"name":"lm_head","t0":7015637824,"t1":7015637924},{"name":"argmax","t0":7015637924,"t1":7015638024},{"name":"argmax","t0":7015638024,"t1":7015638124},{"name":"lm_head","t0":7015638124,"t1":7015638224},{"name":"argmax","t0":7015638224,"t1":7015638324},{"name":"argmax","t0":7015638324,"t1":7015638424}]} +{"schema":"aien.q36-decode-timeline/1","seq":7,"beat":13,"row":0,"step":7,"launches":21,"submits":1,"chip_ns":22100,"record_ns":110321,"total_ns":740566,"host":[{"name":"sched_join","t0":16661020,"t1":16726061},{"name":"sample","t0":16726061,"t1":16732221},{"name":"sched_feed","t0":16732221,"t1":16732893},{"name":"step_enter","t0":16732893,"t1":16732989},{"name":"embed","t0":16732989,"t1":16733021},{"name":"graph_record","t0":16733021,"t1":16843342},{"name":"graph_submit_wait","t0":16843342,"t1":17473587},{"name":"graph_exit","t0":17473587,"t1":17473651},{"name":"logits_read","t0":17473651,"t1":17473699},{"name":"step_return","t0":17473699,"t1":17476131},{"name":"sched_post","t0":17476131,"t1":17478771}],"dev":[{"name":"norm","t0":7016733021,"t1":7016733121},{"name":"mix","t0":7016733121,"t1":7016733221},{"name":"ab","t0":7016733221,"t1":7016733321},{"name":"gdn","t0":7016733321,"t1":7016733421},{"name":"o_proj","t0":7016733421,"t1":7016733521},{"name":"res","t0":7016733521,"t1":7016733621},{"name":"router","t0":7016733621,"t1":7016733721},{"name":"gate_up","t0":7016733721,"t1":7016733821},{"name":"swiglu","t0":7016733821,"t1":7016733921},{"name":"down","t0":7016733921,"t1":7016734021},{"name":"gather","t0":7016734021,"t1":7016734121},{"name":"res","t0":7016734121,"t1":7016734221},{"name":"norm","t0":7016734221,"t1":7016734321},{"name":"lm_head","t0":7016734321,"t1":7016734421},{"name":"lm_head","t0":7016734421,"t1":7016734521},{"name":"lm_head","t0":7016734521,"t1":7016734621},{"name":"argmax","t0":7016734621,"t1":7016734721},{"name":"argmax","t0":7016734721,"t1":7016734821},{"name":"lm_head","t0":7016734821,"t1":7016734921},{"name":"argmax","t0":7016734921,"t1":7016735021},{"name":"argmax","t0":7016735021,"t1":7016735121}]} +{"schema":"aien.q36-decode-timeline/1","seq":8,"beat":14,"row":0,"step":8,"launches":21,"submits":1,"chip_ns":22100,"record_ns":107793,"total_ns":1034985,"host":[{"name":"sched_join","t0":17478771,"t1":17549364},{"name":"sample","t0":17549364,"t1":17597332},{"name":"sched_feed","t0":17597332,"t1":17597940},{"name":"step_enter","t0":17597940,"t1":17598020},{"name":"embed","t0":17598020,"t1":17598052},{"name":"graph_record","t0":17598052,"t1":17705845},{"name":"graph_submit_wait","t0":17705845,"t1":18633037},{"name":"graph_exit","t0":18633037,"t1":18633085},{"name":"logits_read","t0":18633085,"t1":18633117},{"name":"step_return","t0":18633117,"t1":18636509},{"name":"sched_post","t0":18636509,"t1":18639277}],"dev":[{"name":"norm","t0":7017598052,"t1":7017598152},{"name":"mix","t0":7017598152,"t1":7017598252},{"name":"ab","t0":7017598252,"t1":7017598352},{"name":"gdn","t0":7017598352,"t1":7017598452},{"name":"o_proj","t0":7017598452,"t1":7017598552},{"name":"res","t0":7017598552,"t1":7017598652},{"name":"router","t0":7017598652,"t1":7017598752},{"name":"gate_up","t0":7017598752,"t1":7017598852},{"name":"swiglu","t0":7017598852,"t1":7017598952},{"name":"down","t0":7017598952,"t1":7017599052},{"name":"gather","t0":7017599052,"t1":7017599152},{"name":"res","t0":7017599152,"t1":7017599252},{"name":"norm","t0":7017599252,"t1":7017599352},{"name":"lm_head","t0":7017599352,"t1":7017599452},{"name":"lm_head","t0":7017599452,"t1":7017599552},{"name":"lm_head","t0":7017599552,"t1":7017599652},{"name":"argmax","t0":7017599652,"t1":7017599752},{"name":"argmax","t0":7017599752,"t1":7017599852},{"name":"lm_head","t0":7017599852,"t1":7017599952},{"name":"argmax","t0":7017599952,"t1":7017600052},{"name":"argmax","t0":7017600052,"t1":7017600152}]} +{"schema":"aien.q36-decode-timeline/1","seq":9,"beat":15,"row":0,"step":9,"launches":21,"submits":1,"chip_ns":22100,"record_ns":104721,"total_ns":4123123,"host":[{"name":"sched_join","t0":18639277,"t1":18681469},{"name":"sample","t0":18681469,"t1":18697917},{"name":"sched_feed","t0":18697917,"t1":18698525},{"name":"step_enter","t0":18698525,"t1":18698621},{"name":"embed","t0":18698621,"t1":18698653},{"name":"graph_record","t0":18698653,"t1":18803374},{"name":"graph_submit_wait","t0":18803374,"t1":22821776},{"name":"graph_exit","t0":22821776,"t1":22821840},{"name":"logits_read","t0":22821840,"t1":22821872},{"name":"step_return","t0":22821872,"t1":22835280},{"name":"sched_post","t0":22835280,"t1":22844048}],"dev":[{"name":"norm","t0":7018698653,"t1":7018698753},{"name":"mix","t0":7018698753,"t1":7018698853},{"name":"ab","t0":7018698853,"t1":7018698953},{"name":"gdn","t0":7018698953,"t1":7018699053},{"name":"o_proj","t0":7018699053,"t1":7018699153},{"name":"res","t0":7018699153,"t1":7018699253},{"name":"router","t0":7018699253,"t1":7018699353},{"name":"gate_up","t0":7018699353,"t1":7018699453},{"name":"swiglu","t0":7018699453,"t1":7018699553},{"name":"down","t0":7018699553,"t1":7018699653},{"name":"gather","t0":7018699653,"t1":7018699753},{"name":"res","t0":7018699753,"t1":7018699853},{"name":"norm","t0":7018699853,"t1":7018699953},{"name":"lm_head","t0":7018699953,"t1":7018700053},{"name":"lm_head","t0":7018700053,"t1":7018700153},{"name":"lm_head","t0":7018700153,"t1":7018700253},{"name":"argmax","t0":7018700253,"t1":7018700353},{"name":"argmax","t0":7018700353,"t1":7018700453},{"name":"lm_head","t0":7018700453,"t1":7018700553},{"name":"argmax","t0":7018700553,"t1":7018700653},{"name":"argmax","t0":7018700653,"t1":7018700753}]} +{"schema":"aien.q36-decode-timeline/1","seq":10,"beat":16,"row":0,"step":10,"launches":21,"submits":1,"chip_ns":22100,"record_ns":111664,"total_ns":2066593,"host":[{"name":"sched_join","t0":22844048,"t1":22939665},{"name":"sample","t0":22939665,"t1":22996289},{"name":"sched_feed","t0":22996289,"t1":22997346},{"name":"step_enter","t0":22997346,"t1":22997522},{"name":"embed","t0":22997522,"t1":22997554},{"name":"graph_record","t0":22997554,"t1":23109218},{"name":"graph_submit_wait","t0":23109218,"t1":25064147},{"name":"graph_exit","t0":25064147,"t1":25064179},{"name":"logits_read","t0":25064179,"t1":25064243},{"name":"step_return","t0":25064243,"t1":25074627},{"name":"sched_post","t0":25074627,"t1":25090099}],"dev":[{"name":"norm","t0":7022997554,"t1":7022997654},{"name":"mix","t0":7022997654,"t1":7022997754},{"name":"ab","t0":7022997754,"t1":7022997854},{"name":"gdn","t0":7022997854,"t1":7022997954},{"name":"o_proj","t0":7022997954,"t1":7022998054},{"name":"res","t0":7022998054,"t1":7022998154},{"name":"router","t0":7022998154,"t1":7022998254},{"name":"gate_up","t0":7022998254,"t1":7022998354},{"name":"swiglu","t0":7022998354,"t1":7022998454},{"name":"down","t0":7022998454,"t1":7022998554},{"name":"gather","t0":7022998554,"t1":7022998654},{"name":"res","t0":7022998654,"t1":7022998754},{"name":"norm","t0":7022998754,"t1":7022998854},{"name":"lm_head","t0":7022998854,"t1":7022998954},{"name":"lm_head","t0":7022998954,"t1":7022999054},{"name":"lm_head","t0":7022999054,"t1":7022999154},{"name":"argmax","t0":7022999154,"t1":7022999254},{"name":"argmax","t0":7022999254,"t1":7022999354},{"name":"lm_head","t0":7022999354,"t1":7022999454},{"name":"argmax","t0":7022999454,"t1":7022999554},{"name":"argmax","t0":7022999554,"t1":7022999654}]} +{"schema":"aien.q36-decode-timeline/1","seq":11,"beat":17,"row":0,"step":11,"launches":21,"submits":1,"chip_ns":22100,"record_ns":107601,"total_ns":717894,"host":[{"name":"sched_join","t0":25090099,"t1":25144020},{"name":"sample","t0":25144020,"t1":25154516},{"name":"sched_feed","t0":25154516,"t1":25155348},{"name":"step_enter","t0":25155348,"t1":25155428},{"name":"embed","t0":25155428,"t1":25155460},{"name":"graph_record","t0":25155460,"t1":25263061},{"name":"graph_submit_wait","t0":25263061,"t1":25873354},{"name":"graph_exit","t0":25873354,"t1":25873402},{"name":"logits_read","t0":25873402,"t1":25873434},{"name":"step_return","t0":25873434,"t1":25875786},{"name":"sched_post","t0":25875786,"t1":25878506}],"dev":[{"name":"norm","t0":7025155460,"t1":7025155560},{"name":"mix","t0":7025155560,"t1":7025155660},{"name":"ab","t0":7025155660,"t1":7025155760},{"name":"gdn","t0":7025155760,"t1":7025155860},{"name":"o_proj","t0":7025155860,"t1":7025155960},{"name":"res","t0":7025155960,"t1":7025156060},{"name":"router","t0":7025156060,"t1":7025156160},{"name":"gate_up","t0":7025156160,"t1":7025156260},{"name":"swiglu","t0":7025156260,"t1":7025156360},{"name":"down","t0":7025156360,"t1":7025156460},{"name":"gather","t0":7025156460,"t1":7025156560},{"name":"res","t0":7025156560,"t1":7025156660},{"name":"norm","t0":7025156660,"t1":7025156760},{"name":"lm_head","t0":7025156760,"t1":7025156860},{"name":"lm_head","t0":7025156860,"t1":7025156960},{"name":"lm_head","t0":7025156960,"t1":7025157060},{"name":"argmax","t0":7025157060,"t1":7025157160},{"name":"argmax","t0":7025157160,"t1":7025157260},{"name":"lm_head","t0":7025157260,"t1":7025157360},{"name":"argmax","t0":7025157360,"t1":7025157460},{"name":"argmax","t0":7025157460,"t1":7025157560}]} +{"schema":"aien.q36-decode-timeline/1","seq":12,"beat":18,"row":0,"step":12,"launches":21,"submits":1,"chip_ns":22100,"record_ns":106321,"total_ns":717318,"host":[{"name":"sched_join","t0":25878506,"t1":25972459},{"name":"sample","t0":25972459,"t1":25987483},{"name":"sched_feed","t0":25987483,"t1":25987979},{"name":"step_enter","t0":25987979,"t1":25988075},{"name":"embed","t0":25988075,"t1":25988107},{"name":"graph_record","t0":25988107,"t1":26094428},{"name":"graph_submit_wait","t0":26094428,"t1":26705425},{"name":"graph_exit","t0":26705425,"t1":26705473},{"name":"logits_read","t0":26705473,"t1":26705505},{"name":"step_return","t0":26705505,"t1":26707489},{"name":"sched_post","t0":26707489,"t1":26710961}],"dev":[{"name":"norm","t0":7025988107,"t1":7025988207},{"name":"mix","t0":7025988207,"t1":7025988307},{"name":"ab","t0":7025988307,"t1":7025988407},{"name":"gdn","t0":7025988407,"t1":7025988507},{"name":"o_proj","t0":7025988507,"t1":7025988607},{"name":"res","t0":7025988607,"t1":7025988707},{"name":"router","t0":7025988707,"t1":7025988807},{"name":"gate_up","t0":7025988807,"t1":7025988907},{"name":"swiglu","t0":7025988907,"t1":7025989007},{"name":"down","t0":7025989007,"t1":7025989107},{"name":"gather","t0":7025989107,"t1":7025989207},{"name":"res","t0":7025989207,"t1":7025989307},{"name":"norm","t0":7025989307,"t1":7025989407},{"name":"lm_head","t0":7025989407,"t1":7025989507},{"name":"lm_head","t0":7025989507,"t1":7025989607},{"name":"lm_head","t0":7025989607,"t1":7025989707},{"name":"argmax","t0":7025989707,"t1":7025989807},{"name":"argmax","t0":7025989807,"t1":7025989907},{"name":"lm_head","t0":7025989907,"t1":7025990007},{"name":"argmax","t0":7025990007,"t1":7025990107},{"name":"argmax","t0":7025990107,"t1":7025990207}]} +{"schema":"aien.q36-decode-timeline/1","seq":13,"beat":19,"row":0,"step":13,"launches":21,"submits":1,"chip_ns":22100,"record_ns":115361,"total_ns":1282907,"host":[{"name":"sched_join","t0":26710961,"t1":26763873},{"name":"sample","t0":26763873,"t1":26769057},{"name":"sched_feed","t0":26769057,"t1":26769521},{"name":"step_enter","t0":26769521,"t1":26769601},{"name":"embed","t0":26769601,"t1":26769633},{"name":"graph_record","t0":26769633,"t1":26884994},{"name":"graph_submit_wait","t0":26884994,"t1":28052540},{"name":"graph_exit","t0":28052540,"t1":28052588},{"name":"logits_read","t0":28052588,"t1":28052636},{"name":"step_return","t0":28052636,"t1":28057564},{"name":"sched_post","t0":28057564,"t1":28063420}],"dev":[{"name":"norm","t0":7026769633,"t1":7026769733},{"name":"mix","t0":7026769733,"t1":7026769833},{"name":"ab","t0":7026769833,"t1":7026769933},{"name":"gdn","t0":7026769933,"t1":7026770033},{"name":"o_proj","t0":7026770033,"t1":7026770133},{"name":"res","t0":7026770133,"t1":7026770233},{"name":"router","t0":7026770233,"t1":7026770333},{"name":"gate_up","t0":7026770333,"t1":7026770433},{"name":"swiglu","t0":7026770433,"t1":7026770533},{"name":"down","t0":7026770533,"t1":7026770633},{"name":"gather","t0":7026770633,"t1":7026770733},{"name":"res","t0":7026770733,"t1":7026770833},{"name":"norm","t0":7026770833,"t1":7026770933},{"name":"lm_head","t0":7026770933,"t1":7026771033},{"name":"lm_head","t0":7026771033,"t1":7026771133},{"name":"lm_head","t0":7026771133,"t1":7026771233},{"name":"argmax","t0":7026771233,"t1":7026771333},{"name":"argmax","t0":7026771333,"t1":7026771433},{"name":"lm_head","t0":7026771433,"t1":7026771533},{"name":"argmax","t0":7026771533,"t1":7026771633},{"name":"argmax","t0":7026771633,"t1":7026771733}]} +{"schema":"aien.q36-decode-timeline/1","seq":14,"beat":20,"row":0,"step":14,"launches":21,"submits":1,"chip_ns":22100,"record_ns":111377,"total_ns":724902,"host":[{"name":"sched_join","t0":28063420,"t1":28127053},{"name":"sample","t0":28127053,"t1":28135917},{"name":"sched_feed","t0":28135917,"t1":28136653},{"name":"step_enter","t0":28136653,"t1":28136749},{"name":"embed","t0":28136749,"t1":28136781},{"name":"graph_record","t0":28136781,"t1":28248158},{"name":"graph_submit_wait","t0":28248158,"t1":28861683},{"name":"graph_exit","t0":28861683,"t1":28861715},{"name":"logits_read","t0":28861715,"t1":28861763},{"name":"step_return","t0":28861763,"t1":28863923},{"name":"sched_post","t0":28863923,"t1":28866643}],"dev":[{"name":"norm","t0":7028136781,"t1":7028136881},{"name":"mix","t0":7028136881,"t1":7028136981},{"name":"ab","t0":7028136981,"t1":7028137081},{"name":"gdn","t0":7028137081,"t1":7028137181},{"name":"o_proj","t0":7028137181,"t1":7028137281},{"name":"res","t0":7028137281,"t1":7028137381},{"name":"router","t0":7028137381,"t1":7028137481},{"name":"gate_up","t0":7028137481,"t1":7028137581},{"name":"swiglu","t0":7028137581,"t1":7028137681},{"name":"down","t0":7028137681,"t1":7028137781},{"name":"gather","t0":7028137781,"t1":7028137881},{"name":"res","t0":7028137881,"t1":7028137981},{"name":"norm","t0":7028137981,"t1":7028138081},{"name":"lm_head","t0":7028138081,"t1":7028138181},{"name":"lm_head","t0":7028138181,"t1":7028138281},{"name":"lm_head","t0":7028138281,"t1":7028138381},{"name":"argmax","t0":7028138381,"t1":7028138481},{"name":"argmax","t0":7028138481,"t1":7028138581},{"name":"lm_head","t0":7028138581,"t1":7028138681},{"name":"argmax","t0":7028138681,"t1":7028138781},{"name":"argmax","t0":7028138781,"t1":7028138881}]} +{"schema":"aien.q36-decode-timeline/1","seq":15,"beat":21,"row":0,"step":15,"launches":21,"submits":1,"chip_ns":22100,"record_ns":105665,"total_ns":3040266,"host":[{"name":"sched_join","t0":28866643,"t1":28908323},{"name":"sample","t0":28908323,"t1":28914483},{"name":"sched_feed","t0":28914483,"t1":28914899},{"name":"step_enter","t0":28914899,"t1":28914979},{"name":"embed","t0":28914979,"t1":28915027},{"name":"graph_record","t0":28915027,"t1":29020692},{"name":"graph_submit_wait","t0":29020692,"t1":31955293},{"name":"graph_exit","t0":31955293,"t1":31955629},{"name":"logits_read","t0":31955629,"t1":31955661},{"name":"step_return","t0":31955661,"t1":31966413},{"name":"sched_post","t0":31966413,"t1":31981805}],"dev":[{"name":"norm","t0":7028915027,"t1":7028915127},{"name":"mix","t0":7028915127,"t1":7028915227},{"name":"ab","t0":7028915227,"t1":7028915327},{"name":"gdn","t0":7028915327,"t1":7028915427},{"name":"o_proj","t0":7028915427,"t1":7028915527},{"name":"res","t0":7028915527,"t1":7028915627},{"name":"router","t0":7028915627,"t1":7028915727},{"name":"gate_up","t0":7028915727,"t1":7028915827},{"name":"swiglu","t0":7028915827,"t1":7028915927},{"name":"down","t0":7028915927,"t1":7028916027},{"name":"gather","t0":7028916027,"t1":7028916127},{"name":"res","t0":7028916127,"t1":7028916227},{"name":"norm","t0":7028916227,"t1":7028916327},{"name":"lm_head","t0":7028916327,"t1":7028916427},{"name":"lm_head","t0":7028916427,"t1":7028916527},{"name":"lm_head","t0":7028916527,"t1":7028916627},{"name":"argmax","t0":7028916627,"t1":7028916727},{"name":"argmax","t0":7028916727,"t1":7028916827},{"name":"lm_head","t0":7028916827,"t1":7028916927},{"name":"argmax","t0":7028916927,"t1":7028917027},{"name":"argmax","t0":7028917027,"t1":7028917127}]} +{"schema":"aien.q36-decode-timeline/1","seq":16,"beat":22,"row":0,"step":16,"launches":21,"submits":1,"chip_ns":22100,"record_ns":107553,"total_ns":723270,"host":[{"name":"sched_join","t0":31981805,"t1":32042030},{"name":"sample","t0":32042030,"t1":32049118},{"name":"sched_feed","t0":32049118,"t1":32050094},{"name":"step_enter","t0":32050094,"t1":32050382},{"name":"embed","t0":32050382,"t1":32050510},{"name":"graph_record","t0":32050510,"t1":32158063},{"name":"graph_submit_wait","t0":32158063,"t1":32773780},{"name":"graph_exit","t0":32773780,"t1":32773812},{"name":"logits_read","t0":32773812,"t1":32773844},{"name":"step_return","t0":32773844,"t1":32779604},{"name":"sched_post","t0":32779604,"t1":32784404}],"dev":[{"name":"norm","t0":7032050510,"t1":7032050610},{"name":"mix","t0":7032050610,"t1":7032050710},{"name":"ab","t0":7032050710,"t1":7032050810},{"name":"gdn","t0":7032050810,"t1":7032050910},{"name":"o_proj","t0":7032050910,"t1":7032051010},{"name":"res","t0":7032051010,"t1":7032051110},{"name":"router","t0":7032051110,"t1":7032051210},{"name":"gate_up","t0":7032051210,"t1":7032051310},{"name":"swiglu","t0":7032051310,"t1":7032051410},{"name":"down","t0":7032051410,"t1":7032051510},{"name":"gather","t0":7032051510,"t1":7032051610},{"name":"res","t0":7032051610,"t1":7032051710},{"name":"norm","t0":7032051710,"t1":7032051810},{"name":"lm_head","t0":7032051810,"t1":7032051910},{"name":"lm_head","t0":7032051910,"t1":7032052010},{"name":"lm_head","t0":7032052010,"t1":7032052110},{"name":"argmax","t0":7032052110,"t1":7032052210},{"name":"argmax","t0":7032052210,"t1":7032052310},{"name":"lm_head","t0":7032052310,"t1":7032052410},{"name":"argmax","t0":7032052410,"t1":7032052510},{"name":"argmax","t0":7032052510,"t1":7032052610}]} +{"schema":"aien.q36-decode-timeline/1","seq":17,"beat":23,"row":0,"step":17,"launches":21,"submits":1,"chip_ns":22100,"record_ns":106849,"total_ns":723926,"host":[{"name":"sched_join","t0":32784404,"t1":32834180},{"name":"sample","t0":32834180,"t1":32840980},{"name":"sched_feed","t0":32840980,"t1":32841556},{"name":"step_enter","t0":32841556,"t1":32841668},{"name":"embed","t0":32841668,"t1":32841716},{"name":"graph_record","t0":32841716,"t1":32948565},{"name":"graph_submit_wait","t0":32948565,"t1":33565642},{"name":"graph_exit","t0":33565642,"t1":33565690},{"name":"logits_read","t0":33565690,"t1":33565722},{"name":"step_return","t0":33565722,"t1":33568058},{"name":"sched_post","t0":33568058,"t1":33570906}],"dev":[{"name":"norm","t0":7032841716,"t1":7032841816},{"name":"mix","t0":7032841816,"t1":7032841916},{"name":"ab","t0":7032841916,"t1":7032842016},{"name":"gdn","t0":7032842016,"t1":7032842116},{"name":"o_proj","t0":7032842116,"t1":7032842216},{"name":"res","t0":7032842216,"t1":7032842316},{"name":"router","t0":7032842316,"t1":7032842416},{"name":"gate_up","t0":7032842416,"t1":7032842516},{"name":"swiglu","t0":7032842516,"t1":7032842616},{"name":"down","t0":7032842616,"t1":7032842716},{"name":"gather","t0":7032842716,"t1":7032842816},{"name":"res","t0":7032842816,"t1":7032842916},{"name":"norm","t0":7032842916,"t1":7032843016},{"name":"lm_head","t0":7032843016,"t1":7032843116},{"name":"lm_head","t0":7032843116,"t1":7032843216},{"name":"lm_head","t0":7032843216,"t1":7032843316},{"name":"argmax","t0":7032843316,"t1":7032843416},{"name":"argmax","t0":7032843416,"t1":7032843516},{"name":"lm_head","t0":7032843516,"t1":7032843616},{"name":"argmax","t0":7032843616,"t1":7032843716},{"name":"argmax","t0":7032843716,"t1":7032843816}]} +{"schema":"aien.q36-decode-timeline/1","seq":18,"beat":24,"row":0,"step":18,"launches":21,"submits":1,"chip_ns":22100,"record_ns":106129,"total_ns":728742,"host":[{"name":"sched_join","t0":33570906,"t1":33607419},{"name":"sample","t0":33607419,"t1":33613643},{"name":"sched_feed","t0":33613643,"t1":33614155},{"name":"step_enter","t0":33614155,"t1":33614347},{"name":"embed","t0":33614347,"t1":33614379},{"name":"graph_record","t0":33614379,"t1":33720508},{"name":"graph_submit_wait","t0":33720508,"t1":34343121},{"name":"graph_exit","t0":34343121,"t1":34343169},{"name":"logits_read","t0":34343169,"t1":34343201},{"name":"step_return","t0":34343201,"t1":34347137},{"name":"sched_post","t0":34347137,"t1":34351473}],"dev":[{"name":"norm","t0":7033614379,"t1":7033614479},{"name":"mix","t0":7033614479,"t1":7033614579},{"name":"ab","t0":7033614579,"t1":7033614679},{"name":"gdn","t0":7033614679,"t1":7033614779},{"name":"o_proj","t0":7033614779,"t1":7033614879},{"name":"res","t0":7033614879,"t1":7033614979},{"name":"router","t0":7033614979,"t1":7033615079},{"name":"gate_up","t0":7033615079,"t1":7033615179},{"name":"swiglu","t0":7033615179,"t1":7033615279},{"name":"down","t0":7033615279,"t1":7033615379},{"name":"gather","t0":7033615379,"t1":7033615479},{"name":"res","t0":7033615479,"t1":7033615579},{"name":"norm","t0":7033615579,"t1":7033615679},{"name":"lm_head","t0":7033615679,"t1":7033615779},{"name":"lm_head","t0":7033615779,"t1":7033615879},{"name":"lm_head","t0":7033615879,"t1":7033615979},{"name":"argmax","t0":7033615979,"t1":7033616079},{"name":"argmax","t0":7033616079,"t1":7033616179},{"name":"lm_head","t0":7033616179,"t1":7033616279},{"name":"argmax","t0":7033616279,"t1":7033616379},{"name":"argmax","t0":7033616379,"t1":7033616479}]} diff --git a/evidence/dra-66-host-time-20261031/host-summary-1conv.wl b/evidence/dra-66-host-time-20261031/host-summary-1conv.wl new file mode 100644 index 00000000..26632bcf --- /dev/null +++ b/evidence/dra-66-host-time-20261031/host-summary-1conv.wl @@ -0,0 +1,19 @@ +(* records 0..19 (seq) of evidence/dra-66-host-time-20261031/host-token-receipt.jsonl; the whole file checked green *) +(* aien.q36-token-receipt/1: 19 decoding beats; integer ns, host clock *) +receipt = <| + "rows" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + "prompt_rows" -> {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + "steps" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + "submits" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + "total_ns" -> {455251, 655684, 610228, 491411, 471987, 472675, 475875, 469572, 471571, 466499, 469827, 485523, 473763, 471523, 583108, 505299, 467795, 451843, 453811}, + "step_ns" -> {447795, 587124, 558516, 454899, 451651, 455171, 451938, 451459, 450659, 451283, 452003, 465027, 454867, 454803, 568116, 448931, 444659, 444995, 446163}, + "graph_ns" -> {447731, 586980, 558308, 454739, 451587, 455075, 451826, 451363, 450563, 451203, 451891, 464947, 454787, 454723, 568036, 448547, 444595, 444947, 446099}, + "record_ns" -> {93233, 96881, 197378, 97473, 95809, 95025, 95120, 95024, 94624, 95648, 94768, 97280, 97649, 94401, 95297, 94673, 91777, 91857, 92337}, + "step_chip_ns" -> {354402, 490019, 360818, 357202, 355714, 359938, 356642, 356243, 355875, 355491, 356979, 367571, 357010, 360226, 472675, 353810, 352754, 353042, 353714}, + "chip_ns" -> {354402, 490019, 360818, 357202, 355714, 359938, 356642, 356243, 355875, 355491, 356979, 367571, 357010, 360226, 472675, 353810, 352754, 353042, 353714}, + "host_overhead_ns" -> {100849, 165665, 249410, 134209, 116273, 112737, 119233, 113329, 115696, 111008, 112848, 117952, 116753, 111297, 110433, 151489, 115041, 98801, 100097} +|>; +clean[k_] := Pick[Range[Length[receipt["rows"]]], MapThread[#1 == k && #2 == 0 &, {receipt["rows"], receipt["prompt_rows"]}]]; +(* DRA-66 host lower bound per token at 1 conversation (wall - chip_ns; chip_ns holds the submit and the marker poll, see submitPoll): {beats, median ms} *) hostLB = Median[receipt["host_overhead_ns"][[clean[1]]]]; {Length[clean[1]], N[hostLB / 10^6]} +(* per conversations k, clean beats: {beats, median total, chip, host overhead ms} *) Table[{k, Length[clean[k]], N[Median[receipt["total_ns"][[clean[k]]]] / 10^6], N[Median[receipt["chip_ns"][[clean[k]]]] / 10^6], N[Median[receipt["host_overhead_ns"][[clean[k]]]] / 10^6]}, {k, Select[Union[receipt["rows"]], Length[clean[#]] > 0 &]}] +(* host overhead at 1 conversation by where it sits (ms, medians): outside the step, step outside the graph, graph outside record and chip, record *) With[{c = clean[1], r = receipt}, N[{Median[(r["total_ns"] - r["step_ns"])[[c]]], Median[(r["step_ns"] - r["graph_ns"])[[c]]], Median[(r["graph_ns"] - r["record_ns"] - r["step_chip_ns"])[[c]]], Median[r["record_ns"][[c]]]} / 10^6]] diff --git a/evidence/dra-66-host-time-20261031/host-summary-red-host.wl b/evidence/dra-66-host-time-20261031/host-summary-red-host.wl new file mode 100644 index 00000000..8d1cf8b6 --- /dev/null +++ b/evidence/dra-66-host-time-20261031/host-summary-red-host.wl @@ -0,0 +1,19 @@ +(* records 0..19 (seq) of evidence/dra-66-host-time-20261031/host-token-receipt.jsonl; the whole file checked green *) +(* aien.q36-token-receipt/1: 19 decoding beats; integer ns, host clock *) +receipt = <| + "rows" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + "prompt_rows" -> {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + "steps" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + "submits" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + "total_ns" -> {1055251, 1255684, 1210228, 1091411, 1071987, 1072675, 1075875, 1069572, 1071571, 1066499, 1069827, 1085523, 1073763, 1071523, 1183108, 1105299, 1067795, 1051843, 1053811}, + "step_ns" -> {447795, 587124, 558516, 454899, 451651, 455171, 451938, 451459, 450659, 451283, 452003, 465027, 454867, 454803, 568116, 448931, 444659, 444995, 446163}, + "graph_ns" -> {447731, 586980, 558308, 454739, 451587, 455075, 451826, 451363, 450563, 451203, 451891, 464947, 454787, 454723, 568036, 448547, 444595, 444947, 446099}, + "record_ns" -> {93233, 96881, 197378, 97473, 95809, 95025, 95120, 95024, 94624, 95648, 94768, 97280, 97649, 94401, 95297, 94673, 91777, 91857, 92337}, + "step_chip_ns" -> {354402, 490019, 360818, 357202, 355714, 359938, 356642, 356243, 355875, 355491, 356979, 367571, 357010, 360226, 472675, 353810, 352754, 353042, 353714}, + "chip_ns" -> {354402, 490019, 360818, 357202, 355714, 359938, 356642, 356243, 355875, 355491, 356979, 367571, 357010, 360226, 472675, 353810, 352754, 353042, 353714}, + "host_overhead_ns" -> {700849, 765665, 849410, 734209, 716273, 712737, 719233, 713329, 715696, 711008, 712848, 717952, 716753, 711297, 710433, 751489, 715041, 698801, 700097} +|>; +clean[k_] := Pick[Range[Length[receipt["rows"]]], MapThread[#1 == k && #2 == 0 &, {receipt["rows"], receipt["prompt_rows"]}]]; +(* DRA-66 host lower bound per token at 1 conversation (wall - chip_ns; chip_ns holds the submit and the marker poll, see submitPoll): {beats, median ms} *) hostLB = Median[receipt["host_overhead_ns"][[clean[1]]]]; {Length[clean[1]], N[hostLB / 10^6]} +(* per conversations k, clean beats: {beats, median total, chip, host overhead ms} *) Table[{k, Length[clean[k]], N[Median[receipt["total_ns"][[clean[k]]]] / 10^6], N[Median[receipt["chip_ns"][[clean[k]]]] / 10^6], N[Median[receipt["host_overhead_ns"][[clean[k]]]] / 10^6]}, {k, Select[Union[receipt["rows"]], Length[clean[#]] > 0 &]}] +(* host overhead at 1 conversation by where it sits (ms, medians): outside the step, step outside the graph, graph outside record and chip, record *) With[{c = clean[1], r = receipt}, N[{Median[(r["total_ns"] - r["step_ns"])[[c]]], Median[(r["step_ns"] - r["graph_ns"])[[c]]], Median[(r["graph_ns"] - r["record_ns"] - r["step_chip_ns"])[[c]]], Median[r["record_ns"][[c]]]} / 10^6]] diff --git a/evidence/dra-66-host-time-20261031/host-summary-stamps-absorb.wl b/evidence/dra-66-host-time-20261031/host-summary-stamps-absorb.wl new file mode 100644 index 00000000..2b99bede --- /dev/null +++ b/evidence/dra-66-host-time-20261031/host-summary-stamps-absorb.wl @@ -0,0 +1,35 @@ +(* aien.q36-decode-timeline/1: 19 beats; integer ns per beat; host clock for host:*, period, sync, chip_ns, submit_poll; chip PTIMER for dev:*, dev_span *) +timeline = <| + "period" -> {736278, 909992, 774279, 887415, 1275243, 3087994, 1132921, 817751, 1160506, 4204771, 2246051, 788407, 832455, 1352459, 803223, 3115162, 802599, 786502, 780567}, + "host:sched_join" -> {80, 167762, 50704, 77488, 45024, 76448, 73280, 65041, 70593, 42192, 95617, 53921, 93953, 52912, 63633, 41680, 60225, 49776, 36513}, + "host:sample" -> {14048, 4736, 4145, 3040, 7728, 5472, 33905, 6160, 47968, 16448, 56624, 10496, 15024, 5184, 8864, 6160, 7088, 6800, 6224}, + "host:sched_feed" -> {560, 320, 496, 208, 480, 736, 880, 672, 608, 608, 1057, 832, 496, 464, 736, 416, 976, 576, 512}, + "host:step_enter" -> {80, 80, 144, 80, 80, 80, 128, 96, 80, 96, 176, 80, 96, 80, 96, 80, 288, 112, 192}, + "host:embed" -> {32, 32, 32, 48, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 48, 128, 48, 32}, + "host:graph_record" -> {103985, 113905, 105472, 104897, 107953, 108353, 114721, 110321, 107793, 104721, 111664, 107601, 106321, 115361, 111377, 105665, 107553, 106849, 106129}, + "host:graph_submit_wait" -> {608197, 615509, 608502, 693958, 1108122, 2877177, 899495, 630245, 927192, 4018402, 1954929, 610293, 610997, 1167546, 613525, 2934601, 615717, 617077, 622613}, + "host:graph_exit" -> {48, 48, 48, 64, 48, 64, 48, 64, 48, 64, 32, 48, 48, 48, 32, 336, 32, 48, 48}, + "host:logits_read" -> {48, 32, 32, 48, 32, 32, 32, 48, 32, 32, 64, 32, 32, 48, 48, 32, 32, 32, 32}, + "host:step_return" -> {1360, 2544, 1984, 3840, 2448, 9648, 5088, 2432, 3392, 13408, 10384, 2352, 1984, 4928, 2160, 10752, 5760, 2336, 3936}, + "host:sched_post" -> {7840, 5024, 2720, 3744, 3296, 9952, 5312, 2640, 2768, 8768, 15472, 2720, 3472, 5856, 2720, 15392, 4800, 2848, 4336}, + "dev:experts" -> {200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200}, + "dev:gdn" -> {300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300}, + "dev:attention" -> {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}, + "dev:router" -> {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}, + "dev:head_screen" -> {300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300}, + "dev:head_recheck" -> {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}, + "dev:head_plain" -> {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + "dev:token_pick" -> {200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200}, + "dev:glue" -> {800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800}, + "dev:unknown" -> {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + "dev_span" -> {2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100}, + "sync" -> {606097, 613409, 606402, 691858, 1106022, 2875077, 897395, 628145, 925092, 4016302, 1952829, 608193, 608897, 1165446, 611425, 2932501, 613617, 614977, 620513}, + "submits" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + "chip_ns" -> {608197, 615509, 608502, 693958, 1108122, 2877177, 899495, 630245, 927192, 4018402, 1954929, 610293, 610997, 1167546, 613525, 2934601, 615717, 617077, 622613}, + "submit_poll" -> {606097, 613409, 606402, 691858, 1106022, 2875077, 897395, 628145, 925092, 4016302, 1952829, 608193, 608897, 1165446, 611425, 2932501, 613617, 614977, 620513} +|>; +(* ms per beat, medians: *) N[Median /@ timeline / 10^6] +(* outside the chip + chip + sync vs the period: *) N[{Median[timeline["period"] - timeline["host:graph_submit_wait"]], Median[timeline["dev_span"]], Median[timeline["sync"]], Median[timeline["period"]]} / 10^6] +(* residual against the recorded 20.7 ms step: *) N[207/10 - Median[timeline["period"]] / 10^6] +(* DRA-66 submit + poll share per token, chip_ns - dev_span over single-submit beats: {beats, median ms} *) one = Flatten[Position[timeline["submits"], 1]]; submitPoll = Median[timeline["submit_poll"][[one]]]; {Length[one], N[submitPoll / 10^6]} +(* DRA-66 gate, sum of medians (hostLB: token receipt, receipt-1conv slice, clean 1-row beats; submitPoll: stamped timeline, single-submit beats): {host lower bound ms, submit + poll ms, sum ms, sum <= 0.5 ms} *) {N[hostLB / 10^6], N[submitPoll / 10^6], N[(hostLB + submitPoll) / 10^6], hostLB + submitPoll <= 500000} diff --git a/evidence/dra-66-host-time-20261031/host-summary-stamps.wl b/evidence/dra-66-host-time-20261031/host-summary-stamps.wl new file mode 100644 index 00000000..e1e41bf5 --- /dev/null +++ b/evidence/dra-66-host-time-20261031/host-summary-stamps.wl @@ -0,0 +1,35 @@ +(* aien.q36-decode-timeline/1: 19 beats; integer ns per beat; host clock for host:*, period, sync, chip_ns, submit_poll; chip PTIMER for dev:*, dev_span *) +timeline = <| + "period" -> {736278, 909992, 774279, 887415, 1275243, 3087994, 1132921, 817751, 1160506, 4204771, 2246051, 788407, 832455, 1352459, 803223, 3115162, 802599, 786502, 780567}, + "host:sched_join" -> {80, 167762, 50704, 77488, 45024, 76448, 73280, 65041, 70593, 42192, 95617, 53921, 93953, 52912, 63633, 41680, 60225, 49776, 36513}, + "host:sample" -> {14048, 4736, 4145, 3040, 7728, 5472, 33905, 6160, 47968, 16448, 56624, 10496, 15024, 5184, 8864, 6160, 7088, 6800, 6224}, + "host:sched_feed" -> {560, 320, 496, 208, 480, 736, 880, 672, 608, 608, 1057, 832, 496, 464, 736, 416, 976, 576, 512}, + "host:step_enter" -> {80, 80, 144, 80, 80, 80, 128, 96, 80, 96, 176, 80, 96, 80, 96, 80, 288, 112, 192}, + "host:embed" -> {32, 32, 32, 48, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 48, 128, 48, 32}, + "host:graph_record" -> {103985, 113905, 105472, 104897, 107953, 108353, 114721, 110321, 107793, 104721, 111664, 107601, 106321, 115361, 111377, 105665, 107553, 106849, 106129}, + "host:graph_submit_wait" -> {608197, 615509, 608502, 693958, 1108122, 2877177, 899495, 630245, 927192, 4018402, 1954929, 610293, 610997, 1167546, 613525, 2934601, 615717, 617077, 622613}, + "host:graph_exit" -> {48, 48, 48, 64, 48, 64, 48, 64, 48, 64, 32, 48, 48, 48, 32, 336, 32, 48, 48}, + "host:logits_read" -> {48, 32, 32, 48, 32, 32, 32, 48, 32, 32, 64, 32, 32, 48, 48, 32, 32, 32, 32}, + "host:step_return" -> {1360, 2544, 1984, 3840, 2448, 9648, 5088, 2432, 3392, 13408, 10384, 2352, 1984, 4928, 2160, 10752, 5760, 2336, 3936}, + "host:sched_post" -> {7840, 5024, 2720, 3744, 3296, 9952, 5312, 2640, 2768, 8768, 15472, 2720, 3472, 5856, 2720, 15392, 4800, 2848, 4336}, + "dev:experts" -> {200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200}, + "dev:gdn" -> {300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300}, + "dev:attention" -> {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}, + "dev:router" -> {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}, + "dev:head_screen" -> {300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300}, + "dev:head_recheck" -> {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}, + "dev:head_plain" -> {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + "dev:token_pick" -> {200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200}, + "dev:glue" -> {800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800}, + "dev:unknown" -> {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + "dev_span" -> {2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100}, + "sync" -> {606097, 613409, 606402, 691858, 1106022, 2875077, 897395, 628145, 925092, 4016302, 1952829, 608193, 608897, 1165446, 611425, 2932501, 613617, 614977, 620513}, + "submits" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + "chip_ns" -> {22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100, 22100}, + "submit_poll" -> {20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000} +|>; +(* ms per beat, medians: *) N[Median /@ timeline / 10^6] +(* outside the chip + chip + sync vs the period: *) N[{Median[timeline["period"] - timeline["host:graph_submit_wait"]], Median[timeline["dev_span"]], Median[timeline["sync"]], Median[timeline["period"]]} / 10^6] +(* residual against the recorded 20.7 ms step: *) N[207/10 - Median[timeline["period"]] / 10^6] +(* DRA-66 submit + poll share per token, chip_ns - dev_span over single-submit beats: {beats, median ms} *) one = Flatten[Position[timeline["submits"], 1]]; submitPoll = Median[timeline["submit_poll"][[one]]]; {Length[one], N[submitPoll / 10^6]} +(* DRA-66 gate, sum of medians (hostLB: token receipt, receipt-1conv slice, clean 1-row beats; submitPoll: stamped timeline, single-submit beats): {host lower bound ms, submit + poll ms, sum ms, sum <= 0.5 ms} *) {N[hostLB / 10^6], N[submitPoll / 10^6], N[(hostLB + submitPoll) / 10^6], hostLB + submitPoll <= 500000} diff --git a/evidence/dra-66-host-time-20261031/host-tests-2.log b/evidence/dra-66-host-time-20261031/host-tests-2.log new file mode 100644 index 00000000..fad3d43a --- /dev/null +++ b/evidence/dra-66-host-time-20261031/host-tests-2.log @@ -0,0 +1,211 @@ +warning: aien-omega-gpu@0.1.0: aien-omega-gpu: no AIEN_OMEGA_DIR or AIEN_OMEGA_GPU_LIB, building the CPU stub +warning: aien-omega-compose@0.1.0: aien-omega-compose: no AIEN_OMEGA_COMPOSE_DIR, AIEN_OMEGA_DIR or AIEN_OMEGA_COMPOSE_LIB, building the stub + Compiling aien-serve-http v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-serve-http) + Finished `release` profile [optimized] target(s) in 32.62s + Running unittests src/lib.rs (target/release/deps/aien_serve_http-e511de99ff43f31c) + +running 89 tests +test chip_reservation::tests::without_the_marker_the_server_takes_its_own_lock ... ok +test codec::tests::byte_codec_renders_turns_and_refuses_tool ... ok +test chip_reservation::tests::ancestors_start_at_the_parent_and_exclude_self ... ok +test decode_timeline::tests::exact_head_is_split ... ok +test decode_timeline::tests::dropping_one_record_is_red ... ok +test chip_reservation::tests::holders_are_flock_owners_on_that_inode_only ... ok +test codec::tests::byte_codec_round_trips_and_marks_partial_utf8 ... ok +test engine::tests::stub_honours_max_new_tokens_and_cancel ... ok +test engine::tests::stub_refuses_empty_or_oversized_prompt ... ok +test engine::tests::stub_replays_until_stop_id ... ok +test decode_timeline::tests::overlap_and_gap_are_red ... ok +test decode_timeline::tests::dropping_one_host_span_is_red ... ok +test kv_persist::tests::every_identity_input_moves_the_namespace ... ok +test kv_persist::tests::the_namespace_layout_is_the_pool_layout ... ok +test kv_persist::tests::untrusted_builds_and_negative_controls_refuse ... ok +test decode_timeline::tests::dropping_one_device_span_is_red ... ok +test decode_timeline::tests::summary_lists_every_beat ... ok +test omega_engine::tests::prefill_mode_defaults_on_and_env_switches_off ... ok +test omega_engine::tests::mem_available_reads_proc ... ok +test kv_persist::tests::checkpoint_digest_accepts_regular_file_and_rejects_shard_symlink ... ok +test omega_engine::tests::gpu_lock_is_exclusive_and_released_on_drop ... ok +test decode_timeline::tests::complete_beats_are_green ... ok +test qwen36_batch::tests::a_group_larger_than_the_door_is_refused_whole ... ok +test qwen36_batch::tests::a_group_job_stops_on_the_callers_flag_while_prefilling ... ok +test qwen36_batch::tests::a_reader_that_fell_behind_fails_even_when_its_done_fits ... ok +test qwen36_batch::tests::a_reply_reports_total_chip_and_host_overhead ... ok +test chip_reservation::tests::marker_is_refused_unless_an_ancestor_holds_the_canonical_lock ... ok +test qwen36_batch::tests::a_reworded_next_turn_restores_the_turn_header_copy ... ok +test qwen36_batch::tests::cancel_frees_the_row_and_stop_ends ... ok +test qwen36_batch::tests::a_negative_control_leaves_no_state_for_a_later_request ... ok +test qwen36_batch::tests::decode_timeline_refused_without_stamps ... ok +test qwen36_batch::tests::a_group_waits_for_its_rows_then_joins_whole ... ok +test qwen36_batch::tests::load_reads_memory_after_the_lock_and_before_the_upload ... ok +test qwen36_batch::tests::load_refused_after_the_wait_releases_the_lock_and_uploads_nothing ... ok +test qwen36_batch::tests::load_without_the_lock_reads_no_memory_and_uploads_nothing ... ok +test qwen36_batch::tests::decode_timeline_off_never_asks ... ok +test qwen36_batch::tests::missing_logits_fail_the_request ... ok +test qwen36_batch::tests::a_next_turn_continues_its_row ... ok +test qwen36_batch::tests::no_switches_is_the_served_path_on_a_stepper_without_them ... ok +test qwen36_batch::tests::decode_timeline_records_every_single_row_beat ... ok +test qwen36_batch::tests::a_group_of_eight_joins_in_one_beat_and_keeps_its_order ... ok +test qwen36_batch::tests::seeds_spread_at_t07_through_the_batch_door ... ok +test qwen36_batch::tests::the_switch_names_round_trip_from_json ... ok +test qwen36_batch::tests::a_row_swap_switch_trades_two_conversations_and_both_go_red ... ok +test qwen38_engine::tests::low_memory_after_the_wait_refuses_and_releases_the_lock ... ok +test qwen38_engine::tests::memory_is_read_after_the_lock_is_taken ... ok +test qwen38_engine::tests::no_lock_means_memory_is_never_read ... ok +test qwen38_engine::tests::one_byte_short_is_refused ... ok +test readers::tests::cuts_prefer_paragraph_boundaries ... ok +test readers::tests::long_input_is_eight_equal_parts_covering_every_line_with_overlap ... ok +test readers::tests::long_user_message_connect_starts_with_the_request ... ok +test readers::tests::map_body_carries_system_question_and_its_part_only ... ok +test readers::tests::notes_are_cleaned_and_the_preface_is_collapsed ... ok +test readers::tests::one_huge_line_is_still_cut_into_eight ... ok +test readers::tests::short_input_takes_the_plain_path ... ok +test readers::tests::short_question_and_long_tool_result_keep_the_question_and_the_tools ... ok +test sampling::tests::bench_top_k ... ignored +test sampling::tests::chip_greedy_draw_records_as_a_host_greedy_draw ... ok +test sampling::tests::greedy_is_argmax ... ok +test sampling::tests::mutant_variable_is_refused_without_debug_assertions ... ok +test sampling::tests::record_counts_kept_sets_and_modes ... ok +test sampling::tests::same_seed_same_token ... ok +test qwen36_batch::tests::a_mutant_switch_changes_only_its_own_row ... ok +test sampling::tests::seeds_spread_and_mutants_break_the_spread ... ok +test sampling::tests::top_k_never_picks_outside_the_k_best ... ok +test sampling::tests::top_k_selection_matches_full_sort_random_and_tied ... ok +test sampling::tests::top_k_ties_at_cutoff_keep_lower_token_id ... ok +test server::tests::busy_after_the_readers_event_is_the_same_503 ... ok +test server::tests::busy_first_is_a_503_with_retry_after ... ok +test text::tests::multibyte_characters_are_never_split ... ok +test text::tests::no_stops_passes_everything ... ok +test text::tests::stop_string_truncates_and_holds_back_prefix ... ok +test tools::tests::parses_json_form ... ok +test tools::tests::parses_two_calls_and_multiline_value ... ok +test tools::tests::parses_xml_call_with_text_before ... ok +test tools::tests::partial_open_hold_back ... ok +test tools::tests::plain_reply_has_no_calls ... ok +test tools::tests::renders_round_trip_layout ... ok +test tools::tests::tojson_matches_python_separators ... ok +test tools::tests::tool_responses_fold ... ok +test sampling::tests::sampled_tokens_and_record_match_with_reference_mask ... ok +test qwen36_batch::tests::strokes_off_and_exact_head_off_equal_the_served_path ... ok +test qwen36_batch::tests::row_swap_mutant_is_caught ... ok +test qwen36_batch::tests::the_graphs_greedy_token_equals_the_host_argmax_path ... ok +test qwen36_batch::tests::token_receipt_at_one_and_eight_conversations ... ok +test omega_engine::tests::queued_lock_waits_its_turn_and_gives_up_cleanly ... ok +test qwen36_batch::tests::long_prompts_go_in_as_chunks_and_keep_the_turn_header_copy ... ok +test qwen36_batch::tests::a_reader_that_stops_reading_is_dropped_and_the_others_finish ... ok +test qwen36_batch::tests::every_row_equals_the_request_alone ... ok + +test result: ok. 88 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.73s + + Running unittests src/main.rs (target/release/deps/aien_serve_http-05320941c4c31834) + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/door_522.rs (target/release/deps/door_522-243fede4ed875b48) + +running 2 tests +test gpu_busy_is_an_openai_error_envelope ... ok +test tokenizing_does_not_block_the_runtime ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/kv_persist.rs (target/release/deps/kv_persist-cfdb59f498544809) + +running 17 tests +test an_unsafe_store_dir_refuses_and_runs_plain ... ok +test a_missing_or_malformed_key_refuses_and_runs_plain ... ok +test a_longer_ram_prefix_is_not_replaced_by_the_store ... ok +test health_reports_the_persistence_counters_when_on ... ok +test a_corrupted_store_file_is_never_served ... ok +test a_wrong_key_is_never_served ... ok +test a_write_interrupted_before_publish_is_never_served ... ok +test the_test_fault_spec_is_parsed_strictly ... ok +test unknown_omega_switches_and_the_mutants_refuse_persistence ... ok +test a_graceful_shutdown_releases_the_engine_and_flushes_the_parks ... ok +test switch_off_reads_only_the_store_dir_and_changes_nothing ... ok +test park_then_restart_then_restore_equals_the_uninterrupted_run ... ok +test the_last_prompt_token_is_always_recomputed ... ok +test a_turn_larger_than_the_park_and_restore_budgets_is_parked_and_restored_in_full ... ok +test a_park_that_lands_after_the_conversation_moved_on_is_harmless ... ok +test each_identity_input_changed_alone_is_never_served ... ok +test a_restore_that_completes_after_its_timeout_is_never_served ... ok + +test result: ok. 17 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 13.92s + + Running tests/kv_persist_chip.rs (target/release/deps/kv_persist_chip-8837f8d18ab79640) + +running 2 tests +test fused_cache_round_trip_cost_and_restore_latency_on_the_chip ... ignored, chip-only: loads the 30B checkpoint on omega; run by hand per the #514 plan +test restored_turn_two_equals_the_uninterrupted_turn_two_on_the_chip ... ignored, chip-only: loads the 30B checkpoint on omega; run via scripts/own30b-pkv-chip-check.sh + +test result: ok. 0 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/loopback.rs (target/release/deps/loopback-54ce8c0dc85b4eaf) + +running 16 tests +test non_loopback_bind_is_refused ... ok +test models_lists_the_one_served_id ... ok +test sampling_gate::repro_seeds_are_distinct_and_a_flat_choice_spreads ... ok +test prompt_that_fills_the_context_is_refused ... ok +test saturated_request_does_not_read_body_or_invoke_codec ... ok +test non_stream_completion_has_content_usage_and_finish ... ok +test inference_requires_authorization_and_local_json_origin ... ok +test bad_requests_get_openai_error_json ... ok +test stop_sequences_and_max_tokens_apply ... ok +test stream_chunks_parse_and_end_with_done ... ok +test sampling_gate::the_stream_carries_the_record_in_its_last_usage ... ok +test sampling_gate::a_server_chosen_seed_is_echoed_and_replays ... ok +test sampling_gate::an_engine_that_ignores_the_seed_fails_spread ... ok +test sampling_gate::an_engine_that_is_always_greedy_fails_spread_and_passes_greedy ... ok +test sampling_gate::honest_sampler_passes_a_b_c_and_records_every_draw ... ok +test second_request_while_busy_is_rejected_then_accepted ... ok + +test result: ok. 16 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.03s + + Running tests/readers.rs (target/release/deps/readers-c3ceadb839fc10fe) + +running 7 tests +test models_lists_the_readers_id_beside_the_plain_one ... ok +test a_short_input_on_the_readers_id_takes_the_plain_path ... ok +test streaming_sends_progress_then_the_notes_then_the_answer ... ok +test a_long_input_is_read_by_eight_readers_in_one_group_and_the_notes_come_back ... ok +test a_long_tool_result_is_read_and_the_answer_can_call_a_tool ... ok +test show_notes_puts_a_collapsed_preface_before_the_answer ... ok +test fewer_free_rows_mean_fewer_parts_and_one_engine_reads_in_turn ... ok + +test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s + + Running tests/reasoning.rs (target/release/deps/reasoning-18c5682711e97cf7) + +running 5 tests +test server_default_thinking_off_applies_unless_the_request_asks ... ok +test aien_test_switches_are_refused_by_an_engine_without_them ... ok +test streamed_thinking_reply_sends_reasoning_deltas_first ... ok +test thinking_reply_splits_into_reasoning_and_answer ... ok +test thinking_off_keeps_everything_as_content_and_ids_stay_opt_in ... ok + +test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/shutdown.rs (target/release/deps/shutdown-ea84dc16a3278498) + +running 1 test +test sigterm_shuts_down_cleanly_and_exits_zero ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s + + Running tests/version.rs (target/release/deps/version-e053638c4ac8e39c) + +running 2 tests +test version_prints_build_identity_and_exits_zero ... ok +test version_wins_over_other_flags_and_loads_nothing ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests aien_serve_http + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + diff --git a/evidence/dra-66-host-time-20261031/host-tests-3.log b/evidence/dra-66-host-time-20261031/host-tests-3.log new file mode 100644 index 00000000..ed8eaa53 --- /dev/null +++ b/evidence/dra-66-host-time-20261031/host-tests-3.log @@ -0,0 +1,226 @@ + Compiling aien-omega-gpu v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-omega-gpu) + Compiling aien-omega-dattn v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-omega-dattn) + Compiling aien-omega-pf v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-omega-pf) + Compiling aien-omega-q38 v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-omega-q38) + Compiling aien-omega-moe v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-omega-moe) + Compiling aien-omega-fp8 v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-omega-fp8) + Compiling aien-omega-dgraph v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-omega-dgraph) + Compiling aien-omega-router v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-omega-router) + Compiling aien-omega-bf16 v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-omega-bf16) + Compiling aien-omega-compose v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-omega-compose) + Compiling aien-serve-http v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-serve-http) + Compiling aien-runtime v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-runtime) + Compiling aien-inference-abi v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-inference-abi) + Compiling aien-scheduler v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-scheduler) + Finished `release` profile [optimized] target(s) in 2m 29s + Running unittests src/lib.rs (target/release/deps/aien_serve_http-e511de99ff43f31c) + +running 93 tests +test chip_reservation::tests::holders_are_flock_owners_on_that_inode_only ... ok +test chip_reservation::tests::ancestors_start_at_the_parent_and_exclude_self ... ok +test chip_reservation::tests::without_the_marker_the_server_takes_its_own_lock ... ok +test codec::tests::byte_codec_renders_turns_and_refuses_tool ... ok +test codec::tests::byte_codec_round_trips_and_marks_partial_utf8 ... ok +test decode_timeline::tests::dropping_one_device_span_is_red ... ok +test decode_timeline::tests::complete_beats_are_green ... ok +test decode_timeline::tests::dropping_one_host_span_is_red ... ok +test decode_timeline::tests::dropping_one_record_is_red ... ok +test decode_timeline::tests::record_without_submits_reads_as_zero ... ok +test decode_timeline::tests::exact_head_is_split ... ok +test decode_timeline::tests::launch_timeline_takes_drop_only ... ok +test decode_timeline::tests::summary_lists_every_beat ... ok +test decode_timeline::tests::overlap_and_gap_are_red ... ok +test kv_persist::tests::untrusted_builds_and_negative_controls_refuse ... ok +test omega_engine::tests::gpu_lock_is_exclusive_and_released_on_drop ... ok +test kv_persist::tests::the_namespace_layout_is_the_pool_layout ... ok +test decode_timeline::tests::token_bends_and_slice ... ok +test omega_engine::tests::mem_available_reads_proc ... ok +test chip_reservation::tests::marker_is_refused_unless_an_ancestor_holds_the_canonical_lock ... ok +test omega_engine::tests::prefill_mode_defaults_on_and_env_switches_off ... ok +test decode_timeline::tests::token_summary_covers_the_slice_only ... ok +test kv_persist::tests::checkpoint_digest_accepts_regular_file_and_rejects_shard_symlink ... ok +test qwen36_batch::tests::a_group_larger_than_the_door_is_refused_whole ... ok +test qwen36_batch::tests::a_group_job_stops_on_the_callers_flag_while_prefilling ... ok +test engine::tests::stub_honours_max_new_tokens_and_cancel ... ok +test engine::tests::stub_replays_until_stop_id ... ok +test engine::tests::stub_refuses_empty_or_oversized_prompt ... ok +test kv_persist::tests::every_identity_input_moves_the_namespace ... ok +test qwen36_batch::tests::a_reader_that_fell_behind_fails_even_when_its_done_fits ... ok +test qwen36_batch::tests::a_reply_reports_total_chip_and_host_overhead ... ok +test qwen36_batch::tests::cancel_frees_the_row_and_stop_ends ... ok +test qwen36_batch::tests::a_reworded_next_turn_restores_the_turn_header_copy ... ok +test qwen36_batch::tests::a_negative_control_leaves_no_state_for_a_later_request ... ok +test qwen36_batch::tests::decode_timeline_refused_without_stamps ... ok +test qwen36_batch::tests::a_group_waits_for_its_rows_then_joins_whole ... ok +test qwen36_batch::tests::load_reads_memory_after_the_lock_and_before_the_upload ... ok +test qwen36_batch::tests::load_refused_after_the_wait_releases_the_lock_and_uploads_nothing ... ok +test qwen36_batch::tests::load_without_the_lock_reads_no_memory_and_uploads_nothing ... ok +test qwen36_batch::tests::decode_timeline_off_never_asks ... ok +test qwen36_batch::tests::missing_logits_fail_the_request ... ok +test qwen36_batch::tests::a_next_turn_continues_its_row ... ok +test qwen36_batch::tests::no_switches_is_the_served_path_on_a_stepper_without_them ... ok +test qwen36_batch::tests::decode_timeline_records_every_single_row_beat ... ok +test qwen36_batch::tests::a_group_of_eight_joins_in_one_beat_and_keeps_its_order ... ok +test qwen36_batch::tests::seeds_spread_at_t07_through_the_batch_door ... ok +test qwen36_batch::tests::the_switch_names_round_trip_from_json ... ok +test qwen36_batch::tests::a_row_swap_switch_trades_two_conversations_and_both_go_red ... ok +test qwen38_engine::tests::low_memory_after_the_wait_refuses_and_releases_the_lock ... ok +test qwen38_engine::tests::memory_is_read_after_the_lock_is_taken ... ok +test qwen38_engine::tests::no_lock_means_memory_is_never_read ... ok +test qwen38_engine::tests::one_byte_short_is_refused ... ok +test readers::tests::cuts_prefer_paragraph_boundaries ... ok +test readers::tests::long_input_is_eight_equal_parts_covering_every_line_with_overlap ... ok +test readers::tests::long_user_message_connect_starts_with_the_request ... ok +test readers::tests::map_body_carries_system_question_and_its_part_only ... ok +test readers::tests::notes_are_cleaned_and_the_preface_is_collapsed ... ok +test readers::tests::one_huge_line_is_still_cut_into_eight ... ok +test readers::tests::short_input_takes_the_plain_path ... ok +test readers::tests::short_question_and_long_tool_result_keep_the_question_and_the_tools ... ok +test sampling::tests::bench_top_k ... ignored +test sampling::tests::chip_greedy_draw_records_as_a_host_greedy_draw ... ok +test sampling::tests::greedy_is_argmax ... ok +test sampling::tests::mutant_variable_is_refused_without_debug_assertions ... ok +test sampling::tests::record_counts_kept_sets_and_modes ... ok +test sampling::tests::same_seed_same_token ... ok +test qwen36_batch::tests::a_mutant_switch_changes_only_its_own_row ... ok +test sampling::tests::seeds_spread_and_mutants_break_the_spread ... ok +test sampling::tests::top_k_never_picks_outside_the_k_best ... ok +test sampling::tests::top_k_selection_matches_full_sort_random_and_tied ... ok +test sampling::tests::top_k_ties_at_cutoff_keep_lower_token_id ... ok +test server::tests::busy_after_the_readers_event_is_the_same_503 ... ok +test server::tests::busy_first_is_a_503_with_retry_after ... ok +test text::tests::multibyte_characters_are_never_split ... ok +test text::tests::no_stops_passes_everything ... ok +test text::tests::stop_string_truncates_and_holds_back_prefix ... ok +test tools::tests::parses_json_form ... ok +test tools::tests::parses_two_calls_and_multiline_value ... ok +test tools::tests::parses_xml_call_with_text_before ... ok +test tools::tests::partial_open_hold_back ... ok +test tools::tests::plain_reply_has_no_calls ... ok +test tools::tests::renders_round_trip_layout ... ok +test tools::tests::tojson_matches_python_separators ... ok +test tools::tests::tool_responses_fold ... ok +test sampling::tests::sampled_tokens_and_record_match_with_reference_mask ... ok +test qwen36_batch::tests::row_swap_mutant_is_caught ... ok +test qwen36_batch::tests::strokes_off_and_exact_head_off_equal_the_served_path ... ok +test qwen36_batch::tests::the_graphs_greedy_token_equals_the_host_argmax_path ... ok +test omega_engine::tests::queued_lock_waits_its_turn_and_gives_up_cleanly ... ok +test qwen36_batch::tests::token_receipt_at_one_and_eight_conversations ... ok +test qwen36_batch::tests::long_prompts_go_in_as_chunks_and_keep_the_turn_header_copy ... ok +test qwen36_batch::tests::a_reader_that_stops_reading_is_dropped_and_the_others_finish ... ok +test qwen36_batch::tests::every_row_equals_the_request_alone ... ok + +test result: ok. 92 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.76s + + Running unittests src/main.rs (target/release/deps/aien_serve_http-05320941c4c31834) + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/door_522.rs (target/release/deps/door_522-243fede4ed875b48) + +running 2 tests +test tokenizing_does_not_block_the_runtime ... ok +test gpu_busy_is_an_openai_error_envelope ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/kv_persist.rs (target/release/deps/kv_persist-cfdb59f498544809) + +running 17 tests +test an_unsafe_store_dir_refuses_and_runs_plain ... ok +test a_missing_or_malformed_key_refuses_and_runs_plain ... ok +test a_longer_ram_prefix_is_not_replaced_by_the_store ... ok +test health_reports_the_persistence_counters_when_on ... ok +test a_write_interrupted_before_publish_is_never_served ... ok +test a_corrupted_store_file_is_never_served ... ok +test the_test_fault_spec_is_parsed_strictly ... ok +test switch_off_reads_only_the_store_dir_and_changes_nothing ... ok +test a_wrong_key_is_never_served ... ok +test unknown_omega_switches_and_the_mutants_refuse_persistence ... ok +test park_then_restart_then_restore_equals_the_uninterrupted_run ... ok +test a_graceful_shutdown_releases_the_engine_and_flushes_the_parks ... ok +test the_last_prompt_token_is_always_recomputed ... ok +test a_turn_larger_than_the_park_and_restore_budgets_is_parked_and_restored_in_full ... ok +test a_park_that_lands_after_the_conversation_moved_on_is_harmless ... ok +test each_identity_input_changed_alone_is_never_served ... ok +test a_restore_that_completes_after_its_timeout_is_never_served ... ok + +test result: ok. 17 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 14.42s + + Running tests/kv_persist_chip.rs (target/release/deps/kv_persist_chip-8837f8d18ab79640) + +running 2 tests +test fused_cache_round_trip_cost_and_restore_latency_on_the_chip ... ignored, chip-only: loads the 30B checkpoint on omega; run by hand per the #514 plan +test restored_turn_two_equals_the_uninterrupted_turn_two_on_the_chip ... ignored, chip-only: loads the 30B checkpoint on omega; run via scripts/own30b-pkv-chip-check.sh + +test result: ok. 0 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/loopback.rs (target/release/deps/loopback-54ce8c0dc85b4eaf) + +running 16 tests +test non_stream_completion_has_content_usage_and_finish ... ok +test sampling_gate::repro_seeds_are_distinct_and_a_flat_choice_spreads ... ok +test prompt_that_fills_the_context_is_refused ... ok +test non_loopback_bind_is_refused ... ok +test models_lists_the_one_served_id ... ok +test bad_requests_get_openai_error_json ... ok +test inference_requires_authorization_and_local_json_origin ... ok +test saturated_request_does_not_read_body_or_invoke_codec ... ok +test stop_sequences_and_max_tokens_apply ... ok +test stream_chunks_parse_and_end_with_done ... ok +test sampling_gate::a_server_chosen_seed_is_echoed_and_replays ... ok +test sampling_gate::the_stream_carries_the_record_in_its_last_usage ... ok +test sampling_gate::an_engine_that_ignores_the_seed_fails_spread ... ok +test sampling_gate::an_engine_that_is_always_greedy_fails_spread_and_passes_greedy ... ok +test second_request_while_busy_is_rejected_then_accepted ... ok +test sampling_gate::honest_sampler_passes_a_b_c_and_records_every_draw ... ok + +test result: ok. 16 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.46s + + Running tests/readers.rs (target/release/deps/readers-c3ceadb839fc10fe) + +running 7 tests +test models_lists_the_readers_id_beside_the_plain_one ... ok +test a_short_input_on_the_readers_id_takes_the_plain_path ... ok +test streaming_sends_progress_then_the_notes_then_the_answer ... ok +test show_notes_puts_a_collapsed_preface_before_the_answer ... ok +test a_long_input_is_read_by_eight_readers_in_one_group_and_the_notes_come_back ... ok +test a_long_tool_result_is_read_and_the_answer_can_call_a_tool ... ok +test fewer_free_rows_mean_fewer_parts_and_one_engine_reads_in_turn ... ok + +test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s + + Running tests/reasoning.rs (target/release/deps/reasoning-18c5682711e97cf7) + +running 5 tests +test thinking_off_keeps_everything_as_content_and_ids_stay_opt_in ... ok +test server_default_thinking_off_applies_unless_the_request_asks ... ok +test aien_test_switches_are_refused_by_an_engine_without_them ... ok +test thinking_reply_splits_into_reasoning_and_answer ... ok +test streamed_thinking_reply_sends_reasoning_deltas_first ... ok + +test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s + + Running tests/shutdown.rs (target/release/deps/shutdown-ea84dc16a3278498) + +running 1 test +test sigterm_shuts_down_cleanly_and_exits_zero ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s + + Running tests/version.rs (target/release/deps/version-e053638c4ac8e39c) + +running 2 tests +test version_wins_over_other_flags_and_loads_nothing ... ok +test version_prints_build_identity_and_exits_zero ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests aien_serve_http + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + diff --git a/evidence/dra-66-host-time-20261031/host-tests.log b/evidence/dra-66-host-time-20261031/host-tests.log new file mode 100644 index 00000000..a8fcf8b5 --- /dev/null +++ b/evidence/dra-66-host-time-20261031/host-tests.log @@ -0,0 +1,444 @@ + Compiling proc-macro2 v1.0.107 + Compiling quote v1.0.47 + Compiling unicode-ident v1.0.26 + Compiling libc v0.2.189 + Compiling serde_core v1.0.229 + Compiling serde v1.0.229 + Compiling version_check v0.9.5 + Compiling cfg-if v1.0.5 + Compiling find-msvc-tools v0.1.13 + Compiling shlex v2.0.1 + Compiling zmij v1.0.23 + Compiling serde_json v1.0.151 + Compiling aien-abi-conformance v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-abi-conformance) + Compiling cc v1.4.7 + Compiling parking_lot_core v0.9.12 + Compiling generic-array v0.14.7 + Compiling getrandom v0.3.4 + Compiling zerocopy v0.8.57 + Compiling crossbeam-utils v0.8.23 + Compiling itoa v1.0.18 + Compiling crossbeam-epoch v0.9.21 + Compiling syn v3.0.6 + Compiling syn v2.0.119 + Compiling aien-omega-gpu v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-omega-gpu) + Compiling pkg-config v0.3.34 + Compiling memchr v2.8.3 +warning: aien-omega-gpu@0.1.0: aien-omega-gpu: no AIEN_OMEGA_DIR or AIEN_OMEGA_GPU_LIB, building the CPU stub + Compiling smallvec v1.16.1 + Compiling crossbeam-deque v0.8.8 + Compiling rustversion v1.0.23 + Compiling ahash v0.8.12 + Compiling rayon-core v1.13.0 + Compiling icu_normalizer_data v2.3.0 + Compiling icu_properties_data v2.3.0 + Compiling once_cell v1.21.4 + Compiling pin-project-lite v0.2.17 + Compiling fnv v1.0.7 + Compiling ident_case v1.0.1 + Compiling strsim v0.11.1 + Compiling thiserror v2.0.20 + Compiling getrandom v0.4.3 + Compiling stable_deref_trait v1.2.1 + Compiling autocfg v1.5.1 + Compiling bytes v1.12.1 + Compiling onig_sys v69.9.3 + Compiling httparse v1.10.1 + Compiling scopeguard v1.2.0 + Compiling lock_api v0.4.14 + Compiling typenum v1.20.1 + Compiling num-traits v0.2.19 + Compiling parking_lot v0.12.5 + Compiling esaxx-rs v0.1.10 + Compiling aien-omega-dattn v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-omega-dattn) + Compiling thiserror v1.0.69 + Compiling log v0.4.34 + Compiling errno v0.3.14 + Compiling macro_rules_attribute-proc_macro v0.2.3 + Compiling pastey v0.2.3 + Compiling vcpkg v0.2.15 + Compiling synstructure v0.14.0 + Compiling darling_core v0.20.11 + Compiling futures-core v0.3.34 + Compiling paste v1.0.15 + Compiling libsqlite3-sys v0.28.0 + Compiling crypto-common v0.1.7 + Compiling block-buffer v0.10.4 + Compiling signal-hook-registry v1.4.8 + Compiling tracing-attributes v0.1.31 + Compiling monostate-impl v0.1.18 + Compiling thiserror-impl v1.0.69 + Compiling serde_derive v1.0.229 + Compiling zerofrom-derive v0.1.8 + Compiling yoke-derive v0.8.3 + Compiling zerovec-derive v0.11.6 + Compiling displaydoc v0.2.7 + Compiling tokio-macros v2.7.2 + Compiling thiserror-impl v2.0.20 + Compiling async-trait v0.1.92 + Compiling darling_macro v0.20.11 + Compiling zerofrom v0.1.8 + Compiling yoke v0.8.3 + Compiling blake3 v1.8.7 + Compiling ring v0.17.14 + Compiling zerovec v0.11.8 + Compiling socket2 v0.6.5 + Compiling darling v0.20.11 + Compiling mio v1.2.3 + Compiling derive_builder_core v0.20.2 + Compiling aien-omega-dgraph v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-omega-dgraph) + Compiling num-conv v0.2.2 + Compiling aien-omega-router v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-omega-router) + Compiling aien-omega-q38 v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-omega-q38) + Compiling aien-omega-bf16 v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-omega-bf16) + Compiling aien-omega-moe v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-omega-moe) + Compiling time-core v0.1.9 + Compiling heck v0.5.0 + Compiling aien-omega-pf v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-omega-pf) + Compiling aien-omega-fp8 v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-omega-fp8) + Compiling time-macros v0.2.32 + Compiling clap_derive v4.6.7 + Compiling tokio v1.53.3 + Compiling tinystr v0.8.4 + Compiling derive_builder_macro v0.20.2 + Compiling zeroize_derive v1.5.0 + Compiling digest v0.10.7 + Compiling tracing-core v0.1.36 + Compiling cpufeatures v0.2.17 + Compiling ryu v1.0.23 + Compiling writeable v0.6.4 + Compiling litemap v0.8.3 + Compiling sha2 v0.10.9 + Compiling icu_locale_core v2.3.0 + Compiling potential_utf v0.1.6 + Compiling zerotrie v0.2.5 + Compiling http v1.5.0 + Compiling aho-corasick v1.1.5 + Compiling regex-syntax v0.8.11 + Compiling either v1.18.0 + Compiling utf8_iter v1.0.4 + Compiling icu_collections v2.3.0 + Compiling http-body v1.1.0 + Compiling icu_provider v2.3.1 + Compiling tracing v0.1.44 + Compiling axum-macros v0.4.2 + Compiling regex-automata v0.4.18 + Compiling aien-omega-compose v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-omega-compose) + Compiling bitflags v2.13.2 +warning: aien-omega-compose@0.1.0: aien-omega-compose: no AIEN_OMEGA_COMPOSE_DIR, AIEN_OMEGA_DIR or AIEN_OMEGA_COMPOSE_LIB, building the stub + Compiling rayon v1.12.0 + Compiling percent-encoding v2.3.2 + Compiling utf8parse v0.2.2 + Compiling tower-service v0.3.3 + Compiling anstyle-parse v1.0.0 + Compiling form_urlencoded v1.2.2 + Compiling icu_normalizer v2.3.0 + Compiling icu_properties v2.3.0 + Compiling ppv-lite86 v0.2.21 + Compiling rand_core v0.9.5 + Compiling anstyle v1.0.14 + Compiling is_terminal_polyfill v1.70.2 + Compiling anstyle-query v1.1.5 + Compiling slab v0.4.12 + Compiling tower-layer v0.3.3 + Compiling aien-platform v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-platform) + Compiling futures-task v0.3.34 + Compiling minimal-lexical v0.2.1 + Compiling colorchoice v1.0.5 + Compiling lazy_static v1.5.0 + Compiling anstream v1.0.0 + Compiling futures-util v0.3.34 + Compiling nom v7.1.3 + Compiling regex v1.13.1 + Compiling uuid v1.26.1 + Compiling rand_chacha v0.9.0 + Compiling idna_adapter v1.2.2 + Compiling http-body-util v0.1.5 + Compiling itertools v0.14.0 + Compiling futures-channel v0.3.34 + Compiling castaway v0.2.4 + Compiling httpdate v1.0.3 + Compiling clap_lex v1.1.1 + Compiling aien-runtime v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-runtime) + Compiling base64 v0.13.1 + Compiling sync_wrapper v1.0.2 + Compiling static_assertions v1.1.0 + Compiling atomic-waker v1.1.2 + Compiling unicode-segmentation v1.13.3 + Compiling iana-time-zone v0.1.65 + Compiling hyper v1.11.1 + Compiling chrono v0.4.45 + Compiling compact_str v0.9.1 + Compiling clap_builder v4.6.7 + Compiling rayon-cond v0.4.0 + Compiling spm_precompiled v0.1.4 + Compiling onig v6.5.3 + Compiling idna v1.1.0 + Compiling rand v0.9.5 + Compiling aien-platform-linux v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-platform-linux) + Compiling hashbrown v0.14.5 + Compiling dary_heap v0.3.9 + Compiling derive_builder v0.20.2 + Compiling monostate v0.1.18 + Compiling macro_rules_attribute v0.2.3 + Compiling getrandom v0.2.17 + Compiling unicode-normalization-alignments v0.1.12 + Compiling csv-core v0.1.13 + Compiling same-file v1.0.6 + Compiling powerfmt v0.2.0 + Compiling constant_time_eq v0.4.2 + Compiling deranged v0.5.8 + Compiling mime v0.3.17 + Compiling arrayvec v0.7.8 + Compiling untrusted v0.9.0 + Compiling unicode_categories v0.1.1 + Compiling tokenizers v0.21.4 + Compiling axum-core v0.4.5 + Compiling time v0.3.55 + Compiling walkdir v2.5.0 + Compiling csv v1.4.0 + Compiling hashlink v0.9.1 + Compiling clap v4.6.7 + Compiling aien-kv-cache v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-kv-cache) + Compiling url v2.5.8 + Compiling hyper-util v0.1.20 + Compiling tower v0.5.3 + Compiling colored v2.2.0 + Compiling sharded-slab v0.1.7 + Compiling matchers v0.2.0 + Compiling aien-localhttp v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-localhttp) + Compiling serde_urlencoded v0.7.1 + Compiling aien-allen v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-allen) + Compiling tracing-log v0.2.0 + Compiling zeroize v1.9.0 + Compiling aien-abi-core v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-abi-core) + Compiling bincode v1.3.3 + Compiling serde_path_to_error v0.1.20 + Compiling thread_local v1.1.10 + Compiling nu-ansi-term v0.50.3 + Compiling fallible-iterator v0.3.0 + Compiling fallible-streaming-iterator v0.1.9 + Compiling aien-serve-http v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-serve-http) + Compiling matchit v0.7.3 + Compiling axum v0.7.9 + Compiling aien-inference-abi v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-inference-abi) + Compiling tracing-subscriber v0.3.23 + Compiling crumb-spec v1.0.0 (https://github.com/aien-dev/crumb-spec-mv?rev=24194d1b7917ef19244aae6bcaff510686b75fef#24194d1b) + Compiling spark-crumbs v0.1.0 (https://github.com/aien-dev/spark-crumbs-mv?rev=9355a92bc9adfe95a6ec5f8ac926f38a0b6e7db2#9355a92b) + Compiling tower-http v0.5.2 + Compiling byteorder v1.5.0 + Compiling aien-allen-memory v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-allen-memory) + Compiling aien-allen-profile v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-allen-profile) + Compiling aien-security v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-security) + Compiling aien-kv-store v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-kv-store) + Compiling aien-scheduler v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-scheduler) + Compiling aien-trace v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/aien-trace) + Compiling tokio-stream v0.1.19 + Compiling rusqlite v0.31.0 + Compiling cortex-rs v0.1.0 (/home/drakestapleton/work/dra-66/core/crates/cortex-rs) + Finished `release` profile [optimized] target(s) in 2m 54s + Running unittests src/lib.rs (target/release/deps/aien_serve_http-e511de99ff43f31c) + +running 87 tests +test chip_reservation::tests::ancestors_start_at_the_parent_and_exclude_self ... ok +test chip_reservation::tests::holders_are_flock_owners_on_that_inode_only ... ok +test codec::tests::byte_codec_renders_turns_and_refuses_tool ... ok +test decode_timeline::tests::dropping_one_host_span_is_red ... ok +test codec::tests::byte_codec_round_trips_and_marks_partial_utf8 ... ok +test decode_timeline::tests::exact_head_is_split ... ok +test chip_reservation::tests::without_the_marker_the_server_takes_its_own_lock ... ok +test decode_timeline::tests::dropping_one_device_span_is_red ... ok +test decode_timeline::tests::overlap_and_gap_are_red ... ok +test engine::tests::stub_honours_max_new_tokens_and_cancel ... ok +test engine::tests::stub_refuses_empty_or_oversized_prompt ... ok +test engine::tests::stub_replays_until_stop_id ... ok +test decode_timeline::tests::summary_lists_every_beat ... ok +test decode_timeline::tests::dropping_one_record_is_red ... ok +test kv_persist::tests::every_identity_input_moves_the_namespace ... ok +test kv_persist::tests::the_namespace_layout_is_the_pool_layout ... ok +test kv_persist::tests::checkpoint_digest_accepts_regular_file_and_rejects_shard_symlink ... ok +test kv_persist::tests::untrusted_builds_and_negative_controls_refuse ... ok +test omega_engine::tests::mem_available_reads_proc ... ok +test omega_engine::tests::prefill_mode_defaults_on_and_env_switches_off ... ok +test omega_engine::tests::gpu_lock_is_exclusive_and_released_on_drop ... ok +test qwen36_batch::tests::a_group_larger_than_the_door_is_refused_whole ... ok +test decode_timeline::tests::complete_beats_are_green ... ok +test qwen36_batch::tests::a_reader_that_fell_behind_fails_even_when_its_done_fits ... ok +test qwen36_batch::tests::a_group_job_stops_on_the_callers_flag_while_prefilling ... ok +test qwen36_batch::tests::a_reply_reports_total_chip_and_host_overhead ... ok +test chip_reservation::tests::marker_is_refused_unless_an_ancestor_holds_the_canonical_lock ... ok +test qwen36_batch::tests::a_reworded_next_turn_restores_the_turn_header_copy ... ok +test qwen36_batch::tests::a_negative_control_leaves_no_state_for_a_later_request ... ok +test qwen36_batch::tests::cancel_frees_the_row_and_stop_ends ... ok +test qwen36_batch::tests::decode_timeline_refused_without_stamps ... ok +test qwen36_batch::tests::a_group_waits_for_its_rows_then_joins_whole ... ok +test qwen36_batch::tests::load_reads_memory_after_the_lock_and_before_the_upload ... ok +test qwen36_batch::tests::load_refused_after_the_wait_releases_the_lock_and_uploads_nothing ... ok +test qwen36_batch::tests::load_without_the_lock_reads_no_memory_and_uploads_nothing ... ok +test qwen36_batch::tests::decode_timeline_off_never_asks ... ok +test qwen36_batch::tests::missing_logits_fail_the_request ... ok +test qwen36_batch::tests::a_next_turn_continues_its_row ... ok +test qwen36_batch::tests::no_switches_is_the_served_path_on_a_stepper_without_them ... ok +test qwen36_batch::tests::decode_timeline_records_every_single_row_beat ... ok +test qwen36_batch::tests::a_group_of_eight_joins_in_one_beat_and_keeps_its_order ... ok +test qwen36_batch::tests::the_switch_names_round_trip_from_json ... ok +test qwen38_engine::tests::low_memory_after_the_wait_refuses_and_releases_the_lock ... ok +test qwen38_engine::tests::memory_is_read_after_the_lock_is_taken ... ok +test qwen38_engine::tests::no_lock_means_memory_is_never_read ... ok +test qwen38_engine::tests::one_byte_short_is_refused ... ok +test readers::tests::cuts_prefer_paragraph_boundaries ... ok +test readers::tests::long_input_is_eight_equal_parts_covering_every_line_with_overlap ... ok +test readers::tests::long_user_message_connect_starts_with_the_request ... ok +test readers::tests::map_body_carries_system_question_and_its_part_only ... ok +test readers::tests::notes_are_cleaned_and_the_preface_is_collapsed ... ok +test readers::tests::one_huge_line_is_still_cut_into_eight ... ok +test readers::tests::short_input_takes_the_plain_path ... ok +test readers::tests::short_question_and_long_tool_result_keep_the_question_and_the_tools ... ok +test sampling::tests::bench_top_k ... ignored +test sampling::tests::chip_greedy_draw_records_as_a_host_greedy_draw ... ok +test sampling::tests::greedy_is_argmax ... ok +test sampling::tests::mutant_variable_is_refused_without_debug_assertions ... ok +test sampling::tests::record_counts_kept_sets_and_modes ... ok +test sampling::tests::same_seed_same_token ... ok +test sampling::tests::sampled_tokens_and_record_match_with_reference_mask ... ok +test sampling::tests::seeds_spread_and_mutants_break_the_spread ... ok +test sampling::tests::top_k_never_picks_outside_the_k_best ... ok +test sampling::tests::top_k_selection_matches_full_sort_random_and_tied ... ok +test sampling::tests::top_k_ties_at_cutoff_keep_lower_token_id ... ok +test server::tests::busy_after_the_readers_event_is_the_same_503 ... ok +test server::tests::busy_first_is_a_503_with_retry_after ... ok +test text::tests::multibyte_characters_are_never_split ... ok +test text::tests::no_stops_passes_everything ... ok +test text::tests::stop_string_truncates_and_holds_back_prefix ... ok +test tools::tests::parses_json_form ... ok +test tools::tests::parses_two_calls_and_multiline_value ... ok +test tools::tests::parses_xml_call_with_text_before ... ok +test tools::tests::partial_open_hold_back ... ok +test tools::tests::plain_reply_has_no_calls ... ok +test tools::tests::renders_round_trip_layout ... ok +test tools::tests::tojson_matches_python_separators ... ok +test tools::tests::tool_responses_fold ... ok +test qwen36_batch::tests::a_row_swap_switch_trades_two_conversations_and_both_go_red ... ok +test qwen36_batch::tests::a_mutant_switch_changes_only_its_own_row ... ok +test qwen36_batch::tests::strokes_off_and_exact_head_off_equal_the_served_path ... ok +test qwen36_batch::tests::row_swap_mutant_is_caught ... ok +test qwen36_batch::tests::the_graphs_greedy_token_equals_the_host_argmax_path ... ok +test omega_engine::tests::queued_lock_waits_its_turn_and_gives_up_cleanly ... ok +test qwen36_batch::tests::long_prompts_go_in_as_chunks_and_keep_the_turn_header_copy ... ok +test qwen36_batch::tests::a_reader_that_stops_reading_is_dropped_and_the_others_finish ... ok +test qwen36_batch::tests::every_row_equals_the_request_alone ... ok + +test result: ok. 86 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.74s + + Running unittests src/main.rs (target/release/deps/aien_serve_http-05320941c4c31834) + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/door_522.rs (target/release/deps/door_522-243fede4ed875b48) + +running 2 tests +test tokenizing_does_not_block_the_runtime ... ok +test gpu_busy_is_an_openai_error_envelope ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/kv_persist.rs (target/release/deps/kv_persist-cfdb59f498544809) + +running 17 tests +test a_missing_or_malformed_key_refuses_and_runs_plain ... ok +test an_unsafe_store_dir_refuses_and_runs_plain ... ok +test a_longer_ram_prefix_is_not_replaced_by_the_store ... ok +test a_corrupted_store_file_is_never_served ... ok +test health_reports_the_persistence_counters_when_on ... ok +test a_wrong_key_is_never_served ... ok +test switch_off_reads_only_the_store_dir_and_changes_nothing ... ok +test the_test_fault_spec_is_parsed_strictly ... ok +test park_then_restart_then_restore_equals_the_uninterrupted_run ... ok +test a_write_interrupted_before_publish_is_never_served ... ok +test a_graceful_shutdown_releases_the_engine_and_flushes_the_parks ... ok +test unknown_omega_switches_and_the_mutants_refuse_persistence ... ok +test the_last_prompt_token_is_always_recomputed ... ok +test a_turn_larger_than_the_park_and_restore_budgets_is_parked_and_restored_in_full ... ok +test a_park_that_lands_after_the_conversation_moved_on_is_harmless ... ok +test each_identity_input_changed_alone_is_never_served ... ok +test a_restore_that_completes_after_its_timeout_is_never_served ... ok + +test result: ok. 17 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 14.19s + + Running tests/kv_persist_chip.rs (target/release/deps/kv_persist_chip-8837f8d18ab79640) + +running 2 tests +test fused_cache_round_trip_cost_and_restore_latency_on_the_chip ... ignored, chip-only: loads the 30B checkpoint on omega; run by hand per the #514 plan +test restored_turn_two_equals_the_uninterrupted_turn_two_on_the_chip ... ignored, chip-only: loads the 30B checkpoint on omega; run via scripts/own30b-pkv-chip-check.sh + +test result: ok. 0 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/loopback.rs (target/release/deps/loopback-54ce8c0dc85b4eaf) + +running 16 tests +test non_loopback_bind_is_refused ... ok +test models_lists_the_one_served_id ... ok +test sampling_gate::repro_seeds_are_distinct_and_a_flat_choice_spreads ... ok +test bad_requests_get_openai_error_json ... ok +test prompt_that_fills_the_context_is_refused ... ok +test non_stream_completion_has_content_usage_and_finish ... ok +test stop_sequences_and_max_tokens_apply ... ok +test inference_requires_authorization_and_local_json_origin ... ok +test saturated_request_does_not_read_body_or_invoke_codec ... ok +test stream_chunks_parse_and_end_with_done ... ok +test sampling_gate::a_server_chosen_seed_is_echoed_and_replays ... ok +test sampling_gate::the_stream_carries_the_record_in_its_last_usage ... ok +test sampling_gate::an_engine_that_ignores_the_seed_fails_spread ... ok +test sampling_gate::an_engine_that_is_always_greedy_fails_spread_and_passes_greedy ... ok +test sampling_gate::honest_sampler_passes_a_b_c_and_records_every_draw ... ok +test second_request_while_busy_is_rejected_then_accepted ... ok + +test result: ok. 16 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.08s + + Running tests/readers.rs (target/release/deps/readers-c3ceadb839fc10fe) + +running 7 tests +test a_long_input_is_read_by_eight_readers_in_one_group_and_the_notes_come_back ... ok +test models_lists_the_readers_id_beside_the_plain_one ... ok +test a_short_input_on_the_readers_id_takes_the_plain_path ... ok +test show_notes_puts_a_collapsed_preface_before_the_answer ... ok +test a_long_tool_result_is_read_and_the_answer_can_call_a_tool ... ok +test streaming_sends_progress_then_the_notes_then_the_answer ... ok +test fewer_free_rows_mean_fewer_parts_and_one_engine_reads_in_turn ... ok + +test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s + + Running tests/reasoning.rs (target/release/deps/reasoning-18c5682711e97cf7) + +running 5 tests +test aien_test_switches_are_refused_by_an_engine_without_them ... ok +test thinking_reply_splits_into_reasoning_and_answer ... ok +test server_default_thinking_off_applies_unless_the_request_asks ... ok +test streamed_thinking_reply_sends_reasoning_deltas_first ... ok +test thinking_off_keeps_everything_as_content_and_ids_stay_opt_in ... ok + +test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s + + Running tests/shutdown.rs (target/release/deps/shutdown-ea84dc16a3278498) + +running 1 test +test sigterm_shuts_down_cleanly_and_exits_zero ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s + + Running tests/version.rs (target/release/deps/version-e053638c4ac8e39c) + +running 2 tests +test version_wins_over_other_flags_and_loads_nothing ... ok +test version_prints_build_identity_and_exits_zero ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests aien_serve_http + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + diff --git a/evidence/dra-66-host-time-20261031/host-token-check.err b/evidence/dra-66-host-time-20261031/host-token-check.err new file mode 100644 index 00000000..a84dd01c --- /dev/null +++ b/evidence/dra-66-host-time-20261031/host-token-check.err @@ -0,0 +1 @@ +token receipt GREEN: 49 records, evidence/dra-66-host-time-20261031/host-token-receipt.jsonl diff --git a/evidence/dra-66-host-time-20261031/host-token-drop.err b/evidence/dra-66-host-time-20261031/host-token-drop.err new file mode 100644 index 00000000..0c1b044c --- /dev/null +++ b/evidence/dra-66-host-time-20261031/host-token-drop.err @@ -0,0 +1,22 @@ +negative control: dropped 3:record:0 +RED: record 3 (beat 10): seq 4 (a record is missing or repeated) +RED: record 4 (beat 11): seq 5 (a record is missing or repeated) +RED: record 5 (beat 12): seq 6 (a record is missing or repeated) +RED: record 6 (beat 13): seq 7 (a record is missing or repeated) +RED: record 7 (beat 14): seq 8 (a record is missing or repeated) +RED: record 8 (beat 15): seq 9 (a record is missing or repeated) +RED: record 9 (beat 16): seq 10 (a record is missing or repeated) +RED: record 10 (beat 17): seq 11 (a record is missing or repeated) +RED: record 11 (beat 18): seq 12 (a record is missing or repeated) +RED: record 12 (beat 19): seq 13 (a record is missing or repeated) +RED: record 13 (beat 20): seq 14 (a record is missing or repeated) +RED: record 14 (beat 21): seq 15 (a record is missing or repeated) +RED: record 15 (beat 22): seq 16 (a record is missing or repeated) +RED: record 16 (beat 23): seq 17 (a record is missing or repeated) +RED: record 17 (beat 24): seq 18 (a record is missing or repeated) +RED: record 18 (beat 30): seq 19 (a record is missing or repeated) +RED: record 19 (beat 31): seq 20 (a record is missing or repeated) +RED: record 20 (beat 32): seq 21 (a record is missing or repeated) +RED: record 21 (beat 33): seq 22 (a record is missing or repeated) +RED: record 22 (beat 34): seq 23 (a record is missing or repeated) +token receipt RED: 45 findings over 48 records, evidence/dra-66-host-time-20261031/host-token-receipt.jsonl diff --git a/evidence/dra-66-host-time-20261031/host-token-receipt.jsonl b/evidence/dra-66-host-time-20261031/host-token-receipt.jsonl new file mode 100644 index 00000000..5ed01623 --- /dev/null +++ b/evidence/dra-66-host-time-20261031/host-token-receipt.jsonl @@ -0,0 +1,49 @@ +{"schema":"aien.q36-token-receipt/1","seq":0,"beat":6,"rows":1,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":2467888,"t1":2923139,"total_ns":455251,"step_ns":447795,"graph_ns":447731,"record_ns":93233,"step_chip_ns":354402,"chip_ns":354402,"host_overhead_ns":100849} +{"schema":"aien.q36-token-receipt/1","seq":1,"beat":7,"rows":1,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":2923139,"t1":3578823,"total_ns":655684,"step_ns":587124,"graph_ns":586980,"record_ns":96881,"step_chip_ns":490019,"chip_ns":490019,"host_overhead_ns":165665} +{"schema":"aien.q36-token-receipt/1","seq":2,"beat":8,"rows":1,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":3578823,"t1":4189051,"total_ns":610228,"step_ns":558516,"graph_ns":558308,"record_ns":197378,"step_chip_ns":360818,"chip_ns":360818,"host_overhead_ns":249410} +{"schema":"aien.q36-token-receipt/1","seq":3,"beat":9,"rows":1,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":4189051,"t1":4680462,"total_ns":491411,"step_ns":454899,"graph_ns":454739,"record_ns":97473,"step_chip_ns":357202,"chip_ns":357202,"host_overhead_ns":134209} +{"schema":"aien.q36-token-receipt/1","seq":4,"beat":10,"rows":1,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":4680462,"t1":5152449,"total_ns":471987,"step_ns":451651,"graph_ns":451587,"record_ns":95809,"step_chip_ns":355714,"chip_ns":355714,"host_overhead_ns":116273} +{"schema":"aien.q36-token-receipt/1","seq":5,"beat":11,"rows":1,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":5152449,"t1":5625124,"total_ns":472675,"step_ns":455171,"graph_ns":455075,"record_ns":95025,"step_chip_ns":359938,"chip_ns":359938,"host_overhead_ns":112737} +{"schema":"aien.q36-token-receipt/1","seq":6,"beat":12,"rows":1,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":5625124,"t1":6100999,"total_ns":475875,"step_ns":451938,"graph_ns":451826,"record_ns":95120,"step_chip_ns":356642,"chip_ns":356642,"host_overhead_ns":119233} +{"schema":"aien.q36-token-receipt/1","seq":7,"beat":13,"rows":1,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":6100999,"t1":6570571,"total_ns":469572,"step_ns":451459,"graph_ns":451363,"record_ns":95024,"step_chip_ns":356243,"chip_ns":356243,"host_overhead_ns":113329} +{"schema":"aien.q36-token-receipt/1","seq":8,"beat":14,"rows":1,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":6570571,"t1":7042142,"total_ns":471571,"step_ns":450659,"graph_ns":450563,"record_ns":94624,"step_chip_ns":355875,"chip_ns":355875,"host_overhead_ns":115696} +{"schema":"aien.q36-token-receipt/1","seq":9,"beat":15,"rows":1,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":7042142,"t1":7508641,"total_ns":466499,"step_ns":451283,"graph_ns":451203,"record_ns":95648,"step_chip_ns":355491,"chip_ns":355491,"host_overhead_ns":111008} +{"schema":"aien.q36-token-receipt/1","seq":10,"beat":16,"rows":1,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":7508641,"t1":7978468,"total_ns":469827,"step_ns":452003,"graph_ns":451891,"record_ns":94768,"step_chip_ns":356979,"chip_ns":356979,"host_overhead_ns":112848} +{"schema":"aien.q36-token-receipt/1","seq":11,"beat":17,"rows":1,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":7978468,"t1":8463991,"total_ns":485523,"step_ns":465027,"graph_ns":464947,"record_ns":97280,"step_chip_ns":367571,"chip_ns":367571,"host_overhead_ns":117952} +{"schema":"aien.q36-token-receipt/1","seq":12,"beat":18,"rows":1,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":8463991,"t1":8937754,"total_ns":473763,"step_ns":454867,"graph_ns":454787,"record_ns":97649,"step_chip_ns":357010,"chip_ns":357010,"host_overhead_ns":116753} +{"schema":"aien.q36-token-receipt/1","seq":13,"beat":19,"rows":1,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":8937754,"t1":9409277,"total_ns":471523,"step_ns":454803,"graph_ns":454723,"record_ns":94401,"step_chip_ns":360226,"chip_ns":360226,"host_overhead_ns":111297} +{"schema":"aien.q36-token-receipt/1","seq":14,"beat":20,"rows":1,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":9409277,"t1":9992385,"total_ns":583108,"step_ns":568116,"graph_ns":568036,"record_ns":95297,"step_chip_ns":472675,"chip_ns":472675,"host_overhead_ns":110433} +{"schema":"aien.q36-token-receipt/1","seq":15,"beat":21,"rows":1,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":9992385,"t1":10497684,"total_ns":505299,"step_ns":448931,"graph_ns":448547,"record_ns":94673,"step_chip_ns":353810,"chip_ns":353810,"host_overhead_ns":151489} +{"schema":"aien.q36-token-receipt/1","seq":16,"beat":22,"rows":1,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":10497684,"t1":10965479,"total_ns":467795,"step_ns":444659,"graph_ns":444595,"record_ns":91777,"step_chip_ns":352754,"chip_ns":352754,"host_overhead_ns":115041} +{"schema":"aien.q36-token-receipt/1","seq":17,"beat":23,"rows":1,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":10965479,"t1":11417322,"total_ns":451843,"step_ns":444995,"graph_ns":444947,"record_ns":91857,"step_chip_ns":353042,"chip_ns":353042,"host_overhead_ns":98801} +{"schema":"aien.q36-token-receipt/1","seq":18,"beat":24,"rows":1,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":11417322,"t1":11871133,"total_ns":453811,"step_ns":446163,"graph_ns":446099,"record_ns":92337,"step_chip_ns":353714,"chip_ns":353714,"host_overhead_ns":100097} +{"schema":"aien.q36-token-receipt/1","seq":19,"beat":30,"rows":1,"prompt_rows":7,"steps":1,"launches":21,"submits":1,"t0":83972336,"t1":84445075,"total_ns":472739,"step_ns":467891,"graph_ns":467827,"record_ns":92273,"step_chip_ns":375506,"chip_ns":375506,"host_overhead_ns":97233} +{"schema":"aien.q36-token-receipt/1","seq":20,"beat":31,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":84445075,"t1":84958375,"total_ns":513300,"step_ns":450707,"graph_ns":450659,"record_ns":91824,"step_chip_ns":358771,"chip_ns":358771,"host_overhead_ns":154529} +{"schema":"aien.q36-token-receipt/1","seq":21,"beat":32,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":84958375,"t1":85427130,"total_ns":468755,"step_ns":451043,"graph_ns":450995,"record_ns":91904,"step_chip_ns":359043,"chip_ns":359043,"host_overhead_ns":109712} +{"schema":"aien.q36-token-receipt/1","seq":22,"beat":33,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":85427130,"t1":85895693,"total_ns":468563,"step_ns":452291,"graph_ns":452243,"record_ns":92304,"step_chip_ns":359891,"chip_ns":359891,"host_overhead_ns":108672} +{"schema":"aien.q36-token-receipt/1","seq":23,"beat":34,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":85895693,"t1":86364064,"total_ns":468371,"step_ns":450291,"graph_ns":450227,"record_ns":91984,"step_chip_ns":358195,"chip_ns":358195,"host_overhead_ns":110176} +{"schema":"aien.q36-token-receipt/1","seq":24,"beat":35,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":86364064,"t1":86833507,"total_ns":469443,"step_ns":449731,"graph_ns":449667,"record_ns":91633,"step_chip_ns":357986,"chip_ns":357986,"host_overhead_ns":111457} +{"schema":"aien.q36-token-receipt/1","seq":25,"beat":36,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":86833507,"t1":87301974,"total_ns":468467,"step_ns":449731,"graph_ns":449667,"record_ns":91537,"step_chip_ns":358098,"chip_ns":358098,"host_overhead_ns":110369} +{"schema":"aien.q36-token-receipt/1","seq":26,"beat":37,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":87301974,"t1":87767161,"total_ns":465187,"step_ns":445219,"graph_ns":445171,"record_ns":83921,"step_chip_ns":361186,"chip_ns":361186,"host_overhead_ns":104001} +{"schema":"aien.q36-token-receipt/1","seq":27,"beat":38,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":87767161,"t1":88241692,"total_ns":474531,"step_ns":451331,"graph_ns":451283,"record_ns":93169,"step_chip_ns":358050,"chip_ns":358050,"host_overhead_ns":116481} +{"schema":"aien.q36-token-receipt/1","seq":28,"beat":39,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":88241692,"t1":88714415,"total_ns":472723,"step_ns":450803,"graph_ns":450739,"record_ns":91681,"step_chip_ns":358994,"chip_ns":358994,"host_overhead_ns":113729} +{"schema":"aien.q36-token-receipt/1","seq":29,"beat":40,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":88714415,"t1":89186386,"total_ns":471971,"step_ns":450259,"graph_ns":450211,"record_ns":92145,"step_chip_ns":358002,"chip_ns":358002,"host_overhead_ns":113969} +{"schema":"aien.q36-token-receipt/1","seq":30,"beat":41,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":89186386,"t1":89663093,"total_ns":476707,"step_ns":454131,"graph_ns":454083,"record_ns":91937,"step_chip_ns":362098,"chip_ns":362098,"host_overhead_ns":114609} +{"schema":"aien.q36-token-receipt/1","seq":31,"beat":42,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":89663093,"t1":90130376,"total_ns":467283,"step_ns":450755,"graph_ns":450691,"record_ns":91777,"step_chip_ns":358866,"chip_ns":358866,"host_overhead_ns":108417} +{"schema":"aien.q36-token-receipt/1","seq":32,"beat":43,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":90130376,"t1":90602587,"total_ns":472211,"step_ns":450563,"graph_ns":450499,"record_ns":91905,"step_chip_ns":358546,"chip_ns":358546,"host_overhead_ns":113665} +{"schema":"aien.q36-token-receipt/1","seq":33,"beat":44,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":90602587,"t1":91073678,"total_ns":471091,"step_ns":450275,"graph_ns":450227,"record_ns":91985,"step_chip_ns":358194,"chip_ns":358194,"host_overhead_ns":112897} +{"schema":"aien.q36-token-receipt/1","seq":34,"beat":45,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":91073678,"t1":91537505,"total_ns":463827,"step_ns":450819,"graph_ns":450771,"record_ns":91953,"step_chip_ns":358770,"chip_ns":358770,"host_overhead_ns":105057} +{"schema":"aien.q36-token-receipt/1","seq":35,"beat":46,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":91537505,"t1":92002292,"total_ns":464787,"step_ns":450067,"graph_ns":450019,"record_ns":91569,"step_chip_ns":358386,"chip_ns":358386,"host_overhead_ns":106401} +{"schema":"aien.q36-token-receipt/1","seq":36,"beat":47,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":92002292,"t1":92470503,"total_ns":468211,"step_ns":449714,"graph_ns":449650,"record_ns":91648,"step_chip_ns":357938,"chip_ns":357938,"host_overhead_ns":110273} +{"schema":"aien.q36-token-receipt/1","seq":37,"beat":48,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":92470503,"t1":92941642,"total_ns":471139,"step_ns":452530,"graph_ns":452466,"record_ns":91632,"step_chip_ns":360770,"chip_ns":360770,"host_overhead_ns":110369} +{"schema":"aien.q36-token-receipt/1","seq":38,"beat":49,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":92941642,"t1":93412797,"total_ns":471155,"step_ns":450082,"graph_ns":450034,"record_ns":91888,"step_chip_ns":358082,"chip_ns":358082,"host_overhead_ns":113073} +{"schema":"aien.q36-token-receipt/1","seq":39,"beat":50,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":93412797,"t1":93884977,"total_ns":472180,"step_ns":451203,"graph_ns":451171,"record_ns":92816,"step_chip_ns":358291,"chip_ns":358291,"host_overhead_ns":113889} +{"schema":"aien.q36-token-receipt/1","seq":40,"beat":51,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":93884977,"t1":94352708,"total_ns":467731,"step_ns":450675,"graph_ns":450627,"record_ns":92560,"step_chip_ns":358019,"chip_ns":358019,"host_overhead_ns":109712} +{"schema":"aien.q36-token-receipt/1","seq":41,"beat":52,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":94352708,"t1":94821255,"total_ns":468547,"step_ns":451107,"graph_ns":451043,"record_ns":92208,"step_chip_ns":358771,"chip_ns":358771,"host_overhead_ns":109776} +{"schema":"aien.q36-token-receipt/1","seq":42,"beat":53,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":94821255,"t1":95285866,"total_ns":464611,"step_ns":450243,"graph_ns":450179,"record_ns":91952,"step_chip_ns":358163,"chip_ns":358163,"host_overhead_ns":106448} +{"schema":"aien.q36-token-receipt/1","seq":43,"beat":54,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":95285866,"t1":95753725,"total_ns":467859,"step_ns":451203,"graph_ns":451139,"record_ns":92240,"step_chip_ns":358835,"chip_ns":358835,"host_overhead_ns":109024} +{"schema":"aien.q36-token-receipt/1","seq":44,"beat":55,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":95753725,"t1":96231392,"total_ns":477667,"step_ns":451523,"graph_ns":451491,"record_ns":93072,"step_chip_ns":358355,"chip_ns":358355,"host_overhead_ns":119312} +{"schema":"aien.q36-token-receipt/1","seq":45,"beat":56,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":96231392,"t1":96698227,"total_ns":466835,"step_ns":452259,"graph_ns":452195,"record_ns":91649,"step_chip_ns":360482,"chip_ns":360482,"host_overhead_ns":106353} +{"schema":"aien.q36-token-receipt/1","seq":46,"beat":57,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":96698227,"t1":97164358,"total_ns":466131,"step_ns":450771,"graph_ns":450707,"record_ns":91921,"step_chip_ns":358722,"chip_ns":358722,"host_overhead_ns":107409} +{"schema":"aien.q36-token-receipt/1","seq":47,"beat":58,"rows":8,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":97164358,"t1":97647465,"total_ns":483107,"step_ns":450371,"graph_ns":450307,"record_ns":91633,"step_chip_ns":358610,"chip_ns":358610,"host_overhead_ns":124497} +{"schema":"aien.q36-token-receipt/1","seq":48,"beat":59,"rows":7,"prompt_rows":0,"steps":1,"launches":21,"submits":1,"t0":97647465,"t1":98146124,"total_ns":498659,"step_ns":453475,"graph_ns":453395,"record_ns":93393,"step_chip_ns":359906,"chip_ns":359906,"host_overhead_ns":138753} diff --git a/evidence/dra-66-host-time-20261031/host-token-summary.wl b/evidence/dra-66-host-time-20261031/host-token-summary.wl new file mode 100644 index 00000000..caa76618 --- /dev/null +++ b/evidence/dra-66-host-time-20261031/host-token-summary.wl @@ -0,0 +1,18 @@ +(* aien.q36-token-receipt/1: 49 decoding beats; integer ns, host clock *) +receipt = <| + "rows" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7}, + "prompt_rows" -> {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + "steps" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + "submits" -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + "total_ns" -> {455251, 655684, 610228, 491411, 471987, 472675, 475875, 469572, 471571, 466499, 469827, 485523, 473763, 471523, 583108, 505299, 467795, 451843, 453811, 472739, 513300, 468755, 468563, 468371, 469443, 468467, 465187, 474531, 472723, 471971, 476707, 467283, 472211, 471091, 463827, 464787, 468211, 471139, 471155, 472180, 467731, 468547, 464611, 467859, 477667, 466835, 466131, 483107, 498659}, + "step_ns" -> {447795, 587124, 558516, 454899, 451651, 455171, 451938, 451459, 450659, 451283, 452003, 465027, 454867, 454803, 568116, 448931, 444659, 444995, 446163, 467891, 450707, 451043, 452291, 450291, 449731, 449731, 445219, 451331, 450803, 450259, 454131, 450755, 450563, 450275, 450819, 450067, 449714, 452530, 450082, 451203, 450675, 451107, 450243, 451203, 451523, 452259, 450771, 450371, 453475}, + "graph_ns" -> {447731, 586980, 558308, 454739, 451587, 455075, 451826, 451363, 450563, 451203, 451891, 464947, 454787, 454723, 568036, 448547, 444595, 444947, 446099, 467827, 450659, 450995, 452243, 450227, 449667, 449667, 445171, 451283, 450739, 450211, 454083, 450691, 450499, 450227, 450771, 450019, 449650, 452466, 450034, 451171, 450627, 451043, 450179, 451139, 451491, 452195, 450707, 450307, 453395}, + "record_ns" -> {93233, 96881, 197378, 97473, 95809, 95025, 95120, 95024, 94624, 95648, 94768, 97280, 97649, 94401, 95297, 94673, 91777, 91857, 92337, 92273, 91824, 91904, 92304, 91984, 91633, 91537, 83921, 93169, 91681, 92145, 91937, 91777, 91905, 91985, 91953, 91569, 91648, 91632, 91888, 92816, 92560, 92208, 91952, 92240, 93072, 91649, 91921, 91633, 93393}, + "step_chip_ns" -> {354402, 490019, 360818, 357202, 355714, 359938, 356642, 356243, 355875, 355491, 356979, 367571, 357010, 360226, 472675, 353810, 352754, 353042, 353714, 375506, 358771, 359043, 359891, 358195, 357986, 358098, 361186, 358050, 358994, 358002, 362098, 358866, 358546, 358194, 358770, 358386, 357938, 360770, 358082, 358291, 358019, 358771, 358163, 358835, 358355, 360482, 358722, 358610, 359906}, + "chip_ns" -> {354402, 490019, 360818, 357202, 355714, 359938, 356642, 356243, 355875, 355491, 356979, 367571, 357010, 360226, 472675, 353810, 352754, 353042, 353714, 375506, 358771, 359043, 359891, 358195, 357986, 358098, 361186, 358050, 358994, 358002, 362098, 358866, 358546, 358194, 358770, 358386, 357938, 360770, 358082, 358291, 358019, 358771, 358163, 358835, 358355, 360482, 358722, 358610, 359906}, + "host_overhead_ns" -> {100849, 165665, 249410, 134209, 116273, 112737, 119233, 113329, 115696, 111008, 112848, 117952, 116753, 111297, 110433, 151489, 115041, 98801, 100097, 97233, 154529, 109712, 108672, 110176, 111457, 110369, 104001, 116481, 113729, 113969, 114609, 108417, 113665, 112897, 105057, 106401, 110273, 110369, 113073, 113889, 109712, 109776, 106448, 109024, 119312, 106353, 107409, 124497, 138753} +|>; +clean[k_] := Pick[Range[Length[receipt["rows"]]], MapThread[#1 == k && #2 == 0 &, {receipt["rows"], receipt["prompt_rows"]}]]; +(* DRA-66 gate, ms per token at 1 conversation, and the verdict: *) {Length[clean[1]], N[Median[receipt["host_overhead_ns"][[clean[1]]]] / 10^6], Median[receipt["host_overhead_ns"][[clean[1]]]] <= 500000} +(* per conversations k, clean beats: {beats, median total, chip, host overhead ms} *) Table[{k, Length[clean[k]], N[Median[receipt["total_ns"][[clean[k]]]] / 10^6], N[Median[receipt["chip_ns"][[clean[k]]]] / 10^6], N[Median[receipt["host_overhead_ns"][[clean[k]]]] / 10^6]}, {k, Select[Union[receipt["rows"]], Length[clean[#]] > 0 &]}] +(* host overhead at 1 conversation by where it sits (ms, medians): outside the step, step outside the graph, graph outside record and chip, record *) With[{c = clean[1], r = receipt}, N[{Median[(r["total_ns"] - r["step_ns"])[[c]]], Median[(r["step_ns"] - r["graph_ns"])[[c]]], Median[(r["graph_ns"] - r["record_ns"] - r["step_chip_ns"])[[c]]], Median[r["record_ns"][[c]]]} / 10^6]] diff --git a/evidence/dra-66-host-time-20261031/queue-dry-run.log b/evidence/dra-66-host-time-20261031/queue-dry-run.log new file mode 100644 index 00000000..1a1afe3a --- /dev/null +++ b/evidence/dra-66-host-time-20261031/queue-dry-run.log @@ -0,0 +1,14 @@ +# 2026-10-31T13:57:22Z ~/handoffs/pdra4-hive/chip/run-queue.sh --dry-run (run-queue.sh sha256 420b6cc76676d4ae17c2980345de722a0a3141358e2f49d37d763c7c87b7bc95, QUEUE.txt sha256 922486c3c1567f2954928411f5f365613fac75482fbf36db67a9b40217e43ba5) +queue: 10 slices +DRY would run DRA-75/s01-A-ladder (gb10 exclusive) +DRY would run DRA-75/s02-B-ladder (gb10 exclusive) +DRY would run DRA-76/s01-gdn-unit (gb10 exclusive) +DRY would run DRA-76/s02-gate-multi (gb10 exclusive) +DRY would run DRA-76/s03-gate-step (gb10 exclusive) +DRY would run DRA-76/s04-stamps (gb10 exclusive) +DRY would run DRA-75/s03-A-forced (gb10 exclusive) +DRY would run DRA-75/s04-B-forced (gb10 exclusive) +DRY would run DRA-66/s01-tokens (gb10 none) +DRY would run DRA-66/s02-stamps (gb10 none) +queue complete +exit 0 diff --git a/evidence/dra-66-host-time-20261031/seed-red-green.log b/evidence/dra-66-host-time-20261031/seed-red-green.log new file mode 100644 index 00000000..850820ea --- /dev/null +++ b/evidence/dra-66-host-time-20261031/seed-red-green.log @@ -0,0 +1,11 @@ +== AIEN_SAMPLING_MUTANT=ignore-seed (debug build) +test qwen36_batch::tests::seeds_spread_at_t07_through_the_batch_door ... FAILED +thread 'qwen36_batch::tests::seeds_spread_at_t07_through_the_batch_door' (2494102) panicked at crates/aien-serve-http/src/qwen36_batch/tests.rs:1267:5: +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 88 filtered out; finished in 0.22s +== AIEN_SAMPLING_MUTANT=force-greedy (debug build) +test qwen36_batch::tests::seeds_spread_at_t07_through_the_batch_door ... FAILED +thread 'qwen36_batch::tests::seeds_spread_at_t07_through_the_batch_door' (2494178) panicked at crates/aien-serve-http/src/qwen36_batch/tests.rs:1267:5: +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 88 filtered out; finished in 0.21s +== AIEN_SAMPLING_MUTANT= (debug build) +test qwen36_batch::tests::seeds_spread_at_t07_through_the_batch_door ... ok +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 88 filtered out; finished in 0.21s diff --git a/evidence/q36-decode-timeline-20261027/PROTOCOL.md b/evidence/q36-decode-timeline-20261027/PROTOCOL.md new file mode 100644 index 00000000..43ad65b5 --- /dev/null +++ b/evidence/q36-decode-timeline-20261027/PROTOCOL.md @@ -0,0 +1,45 @@ +# q36 decode timeline: zero-cost A/B protocol (frozen before any number, #785) + +Question: with `AIEN_Q36_DECODE_TIMELINE` unset (the default), does the instrumented door cost anything against the door without the instrumentation? + +## Arms + +- A (base): `aien-sovereign-core-mv` main `f30eb963`, which is the PR's base. +- B (head): branch `perf/q36-decode-timeline` at the commit that carries this file, with the switch unset. +- Both arms: omega `a647b6a9` through the same `pins/env.sh`, the same `rust-toolchain.toml`, `--release`, built with `nice -n 19 taskset -c 10-14 cargo ... -j5`. + +## Host A/B (runs now, host only) + +- Driver: `bench.patch.rs` in this folder. It is THROWAWAY and appended unchanged to `crates/aien-serve-http/src/qwen36_batch/tests.rs` in a scratch worktree of each arm, then built as each arm's test binary. It sends one request of 20,000 greedy tokens through `Qwen36BatchDoor::with_stepper` over a fake model that does no work, so it times only the door's beat loop, which is the code the switched-off path touches. +- Correctness gate: both arms must print the same token count (20,000) and the same token digest in every sample. Otherwise the run is void. +- Design: 2 discarded warm-up rounds, then 20 rounds. Within each round the two arms run in a seeded random order (Python `random.Random(785)`, recorded in the output), one process per arm per round, both on `taskset -c 12` under `nice -n 19`. Load1 is recorded before each round. +- Metric: ns per token (wall over the whole request / 20,000), one sample per arm per round. Report the median plus min..max for each arm, and the median of the per-round ratios B/A. +- Verdict: PASS if the median paired ratio B/A <= 1.02. Otherwise REGRESSION. Medians and ratios are computed in Wolfram. + +## Chip A/B (prepared in window.sh, NOT_RUN until an exclusive window) + +- Server per block: `--engine omega --model-dir /home/drakestapleton/models/qwen3.6-35b-a3b-fp8-95a723d0 --port 18190 --bind 127.0.0.1 --max-context 49152 --max-tokens-cap 16384 --thinking off --batch-slots 8`, env `AIEN_Q36_STROKE=1`, `AIEN_SERVE_GPU_LOCK=/tmp/aien-serve-18190.lock`, timeline switch unset. These are the live 18091 flags. +- Design: 4 blocks, with arm order drawn by `random.Random(785)` among the 6 orders that hold two A and two B. Each block is one server start, 1 discarded warm-up request, then 10 requests: the fixed prompt in window.sh, `temperature 0`, `max_tokens 200`, one at a time. +- Metric: tokens/s = `usage.completion_tokens` / request wall. Before each sample, `curl 127.0.0.1:18091/health` is recorded; the window has 18091 stopped, so any sample where 18091 answers with `in_flight > 0` is discarded and counted. The `spell over ... chip N ms/step` lines are kept as a second view. +- Correctness gate: every request in both arms returns the same text as the first A request. Otherwise void. +- Verdict: PASS if median tokens/s of B >= 0.99 x median of A (pooled over the 20 kept samples per arm). Otherwise REGRESSION. Medians are computed in Wolfram. + +## No re-run selection + +Each A/B runs once. A re-run happens only for a documented machine-load fault, and both runs are then reported. + +## The timeline run is not a speed receipt + +With the switch on, the chip writes one stamp per launch, which costs chip time. The 200-token timeline run says where the time goes, not how fast the step is. + +## Amendment 1 (before any chip number exists): chip arm A is bf51e6d6 + +A server built from `f30eb963` has no `AIEN_SERVE_GPU_LOCK`, so inside a window where Main holds `/tmp/aien-gb10.lock` its load would wait on that lock and fail. Chip arm A is therefore `bf51e6d6`: `f30eb963` plus only the lock restore, which is the parent of the timeline commit. Arm B stays the timeline commit. The host A/B keeps `f30eb963`, because its driver passes a private lock file in both arms. The verdict rules are unchanged. + +## Amendment 2 (host A/B, before any host number exists): driver fix + +The first host run produced no sample: in `bench.patch.rs` the fake returned no logits when the prompt's last feed asked for them, so the door never picked a first reply token and the request waited until the 1800 s job limit. The driver now returns a one-hot logits row whose argmax equals its own token. No timing from that run exists, so nothing is selected away. Every other rule is unchanged. + +## Amendment 3 (host A/B, before any host number exists): fixed step work + +With Amendment 2 the smoke run (outside the counted rounds) failed: the fake stepped so fast that the reply's reader fell 256 events behind and the door dropped the row, as designed. The fake now spins a fixed 100 us per step in both arms. Per token the time is then 100 us plus the door's own loop, so the 1.02 gate catches any added host cost above about 2 us per token (Wolfram check in the report). No timing from the smoke runs is used. diff --git a/evidence/q36-decode-timeline-20261027/RESULTS.md b/evidence/q36-decode-timeline-20261027/RESULTS.md new file mode 100644 index 00000000..6b7ea78d --- /dev/null +++ b/evidence/q36-decode-timeline-20261027/RESULTS.md @@ -0,0 +1,40 @@ +# q36 decode timeline: host results (#785) + +Pins: sc `6691c931` (timeline), arm A `f30eb963` for the host A/B, omega `a647b6a9`. Protocol: `PROTOCOL.md` (sha256 `babce814...7d00` at `472eba15`), with Amendments 1 to 3 written before any number they govern existed. + +## EXERCISED on host + +| Check | Result | File | +|---|---|---| +| `cargo test --release --no-fail-fast -p aien-serve-http -p aien-inference-abi -p aien-omega-q38` | all green except `tinyllama_parity` (4 of 6): the loader refuses the symlinked Hugging Face cache file (`symlink or nonregular checkpoint file`); this branch does not touch the loader or that test | `/home/drakestapleton/handoffs/DecodeTimeline/test-head.log` | +| Door timeline over a stamping fake, 20 tokens | 19 records, checker GREEN | `host-timeline/host-timeline.jsonl`, `host-check.txt` | +| `--check-decode-timeline --drop 5:dev:3` | exit 1, RED (3 findings) | `host-timeline/host-red-5-dev-3.txt` | +| `--drop 7:record:0` | exit 1, RED (11 findings) | `host-timeline/host-red-7-record-0.txt` | +| `--drop 3:host:4` | exit 1, RED (2 findings) | `host-timeline/host-red-3-host-4.txt` | +| `window.sh` precondition, lock held by another lane | `NOT_RUN`, exit 3, no server started, no BOARD line | `window-negcontrol.log` | + +## Host zero-cost A/B (switch unset) + +20 rounds after 2 warm-ups, seeded order (785), `taskset -c 12 nice -n 19`, 20,000 tokens per run, fake step 100 us. Same digest `565d66b3abf21a8a` and 20,000 tokens in all 44 runs. Load1 6.2 to 7.0 (shared box). + +WolframLanguageEvaluator on `host-ab/ab.wl`: + +| | A `f30eb963` | B `6691c931` | +|---|---|---| +| median ns per token | 107440.73 | 107504.26 | +| min..max ns per token | 107356.21..107579.22 | 107404.34..107742.43 | + +- `Median[nsB/nsA]` -> 1.00048088 (min..max 0.99959..1.00209). Gate `<= 1.02`: **PASS**. +- B was slower in 18 of 20 rounds, `SignedRankTest[nsB - nsA]` -> p 0.00042: a real host cost of `Median` difference 63.5 ns per token, which is `63.5*^-9/20.7*^-3` -> 3.07*10^-6 of the recorded 20.7 ms step. +- Gate sensitivity: `0.02 * 107440.73` -> 2148.8 ns per token. + +## NOT_RUN + +- Chip timeline (200 tokens on the 35B) and the chip A/B: they need a stopped 18091 and an exclusive window. `window.sh` runs both; the procedure is in `/home/drakestapleton/handoffs/DecodeTimeline/RESUME.md`. +- The ABI host marks and `row_timeline` on the real `Qwen38Omega`: compiled and covered by the door tests only through the fake; the chip run exercises them. + +## Addendum: missing-logits fix (`f551b1e2`) + +- `missing_logits_fail_the_request` (host, fake stepper that never returns logits, both chip-greedy settings): RED before the fix, "the door hung on a step without the logits it asked for: Timeout" after 20 s (`host-timeline/nologits-before.log`); GREEN after (`host-timeline/nologits-after.log`). +- Package tests at `f551b1e2`: same result as above, all green except `tinyllama_parity` 4 of 6 (`/home/drakestapleton/handoffs/DecodeTimeline/test-head2.log`). +- The host A/B above measured `6691c931`, before this fix. `window.sh` now pins the head binary at `f551b1e2` (sha256 `6eca898f...9c10`), so the chip A/B measures the final code. diff --git a/evidence/q36-decode-timeline-20261027/bench.patch.rs b/evidence/q36-decode-timeline-20261027/bench.patch.rs new file mode 100644 index 00000000..1fbd9175 --- /dev/null +++ b/evidence/q36-decode-timeline-20261027/bench.patch.rs @@ -0,0 +1,78 @@ +// THROWAWAY A/B driver (evidence only, not product code): appended to +// crates/aien-serve-http/src/qwen36_batch/tests.rs in BOTH arms, unchanged. +// One request of BENCH_TOKENS greedy tokens through the batch door over a +// fake model that spins a fixed 100 us per step, so the time above +// 20,000 x 100 us is the door's own beat loop: the code the switched-off decode timeline touches. + +struct BenchFake(Vec<(u64, usize)>); + +impl RowStep for BenchFake { + type Snap = (u64, usize); + fn row_snapshot(&mut self, r: usize, snap: &mut (u64, usize)) -> Result<(), String> { + *snap = self.0[r]; + Ok(()) + } + fn row_restore(&mut self, r: usize, snap: &(u64, usize)) -> Result<(), String> { + self.0[r] = *snap; + Ok(()) + } + fn row_count(&self) -> usize { + self.0.len() + } + fn row_reset(&mut self, r: usize) -> Result<(), String> { + self.0[r] = (0, 0); + Ok(()) + } + fn step_rows(&mut self, feed: &[RowFeed]) -> Result, String> { + // A fixed 100 us of busy work per step stands in for the chip, so the reply's reader + // (256 events of slack) keeps up the way it does at 20 ms/token. Without it the reader + // falls behind and the door drops the row. + let t = Instant::now(); + while t.elapsed() < Duration::from_micros(100) { + std::hint::spin_loop(); + } + Ok(feed + .iter() + .map(|f| { + let (st, pos) = &mut self.0[f.row]; + *st = mix(*st ^ (u64::from(f.token) << 20) ^ *pos as u64); + *pos += 1; + let token = (*st % 89) as u32 + 5; + // The prompt's last feed asks for logits: the door samples the first reply + // token from them. A one-hot row keeps that pick equal to `token`. + let logits = f.logits.then(|| { + let mut l = vec![0.0f32; VOCAB]; + l[token as usize] = 1.0; + l + }); + RowOut { + token, + logits, + stats: GraphStats::default(), + } + }) + .collect()) + } +} + +#[test] +#[ignore] +fn bench_door_beat() { + const BENCH_TOKENS: usize = 20_000; + let d = Qwen36BatchDoor::with_stepper( + BenchFake(vec![(0, 0); 8]), + 1 << 16, + lock_file(), + Duration::from_secs(5), + 16, + true, + ) + .unwrap(); + let prompt = [3u32, 1, 4, 1, 5, 9, 2, 6]; + let t = Instant::now(); + let (words, _) = run(&d, &prompt, &greedy(BENCH_TOKENS)); + let ns = t.elapsed().as_nanos(); + assert_eq!(words.len(), BENCH_TOKENS); + let digest = words.iter().fold(0u64, |h, &w| mix(h ^ u64::from(w))); + println!("BENCH tokens {} ns {} digest {:016x}", words.len(), ns, digest); +} diff --git a/evidence/q36-decode-timeline-20261027/host-ab/ab.wl b/evidence/q36-decode-timeline-20261027/host-ab/ab.wl new file mode 100644 index 00000000..bf4548d7 --- /dev/null +++ b/evidence/q36-decode-timeline-20261027/host-ab/ab.wl @@ -0,0 +1,3 @@ +(* correctness gate PASS: digests ['565d66b3abf21a8a'], tokens [20000] *) +nsA = {2147723448, 2150172178, 2147840587, 2147124250, 2148959792, 2148006526, 2149779519, 2148672496, 2148956792, 2147947068, 2150160689, 2148361244, 2148660804, 2147613713, 2148009658, 2150966802, 2150334453, 2150983759, 2150344881, 2151584495}; +nsB = {2150198059, 2150270335, 2149576354, 2148086804, 2151058969, 2150066526, 2150103685, 2149261335, 2150060178, 2149832692, 2149272983, 2149539504, 2149020883, 2148357193, 2151887172, 2151401560, 2152536373, 2151250019, 2154848688, 2151513714}; diff --git a/evidence/q36-decode-timeline-20261027/host-ab/bench.sha256 b/evidence/q36-decode-timeline-20261027/host-ab/bench.sha256 new file mode 100644 index 00000000..3d1bebe1 --- /dev/null +++ b/evidence/q36-decode-timeline-20261027/host-ab/bench.sha256 @@ -0,0 +1,2 @@ +73f11620eb5ed08e455b01da8ad58d31046f4b440adc91c1218b4d7436f6412b bench-A +2fb624fc3b07a4f19413bd3fdff3274881385c43121c82c0b032e215158743f5 bench-B diff --git a/evidence/q36-decode-timeline-20261027/host-ab/raw.json b/evidence/q36-decode-timeline-20261027/host-ab/raw.json new file mode 100644 index 00000000..7e412919 --- /dev/null +++ b/evidence/q36-decode-timeline-20261027/host-ab/raw.json @@ -0,0 +1,338 @@ +{ + "exe": { + "A": "/home/drakestapleton/handoffs/DecodeTimeline/ab-host/bench-A", + "B": "/home/drakestapleton/handoffs/DecodeTimeline/ab-host/bench-B" + }, + "rounds": [ + { + "round": -2, + "order": "BA", + "load1": "6.20", + "B": { + "tokens": 20000, + "ns": 2153683950, + "digest": "565d66b3abf21a8a" + }, + "A": { + "tokens": 20000, + "ns": 2149437448, + "digest": "565d66b3abf21a8a" + } + }, + { + "round": -1, + "order": "BA", + "load1": "6.18", + "B": { + "tokens": 20000, + "ns": 2151917002, + "digest": "565d66b3abf21a8a" + }, + "A": { + "tokens": 20000, + "ns": 2148549866, + "digest": "565d66b3abf21a8a" + } + }, + { + "round": 0, + "order": "AB", + "load1": "6.17", + "A": { + "tokens": 20000, + "ns": 2147723448, + "digest": "565d66b3abf21a8a" + }, + "B": { + "tokens": 20000, + "ns": 2150198059, + "digest": "565d66b3abf21a8a" + } + }, + { + "round": 1, + "order": "BA", + "load1": "6.16", + "B": { + "tokens": 20000, + "ns": 2150270335, + "digest": "565d66b3abf21a8a" + }, + "A": { + "tokens": 20000, + "ns": 2150172178, + "digest": "565d66b3abf21a8a" + } + }, + { + "round": 2, + "order": "BA", + "load1": "6.22", + "B": { + "tokens": 20000, + "ns": 2149576354, + "digest": "565d66b3abf21a8a" + }, + "A": { + "tokens": 20000, + "ns": 2147840587, + "digest": "565d66b3abf21a8a" + } + }, + { + "round": 3, + "order": "AB", + "load1": "6.12", + "A": { + "tokens": 20000, + "ns": 2147124250, + "digest": "565d66b3abf21a8a" + }, + "B": { + "tokens": 20000, + "ns": 2148086804, + "digest": "565d66b3abf21a8a" + } + }, + { + "round": 4, + "order": "BA", + "load1": "6.12", + "B": { + "tokens": 20000, + "ns": 2151058969, + "digest": "565d66b3abf21a8a" + }, + "A": { + "tokens": 20000, + "ns": 2148959792, + "digest": "565d66b3abf21a8a" + } + }, + { + "round": 5, + "order": "AB", + "load1": "6.28", + "A": { + "tokens": 20000, + "ns": 2148006526, + "digest": "565d66b3abf21a8a" + }, + "B": { + "tokens": 20000, + "ns": 2150066526, + "digest": "565d66b3abf21a8a" + } + }, + { + "round": 6, + "order": "AB", + "load1": "6.33", + "A": { + "tokens": 20000, + "ns": 2149779519, + "digest": "565d66b3abf21a8a" + }, + "B": { + "tokens": 20000, + "ns": 2150103685, + "digest": "565d66b3abf21a8a" + } + }, + { + "round": 7, + "order": "AB", + "load1": "6.31", + "A": { + "tokens": 20000, + "ns": 2148672496, + "digest": "565d66b3abf21a8a" + }, + "B": { + "tokens": 20000, + "ns": 2149261335, + "digest": "565d66b3abf21a8a" + } + }, + { + "round": 8, + "order": "AB", + "load1": "6.20", + "A": { + "tokens": 20000, + "ns": 2148956792, + "digest": "565d66b3abf21a8a" + }, + "B": { + "tokens": 20000, + "ns": 2150060178, + "digest": "565d66b3abf21a8a" + } + }, + { + "round": 9, + "order": "BA", + "load1": "6.27", + "B": { + "tokens": 20000, + "ns": 2149832692, + "digest": "565d66b3abf21a8a" + }, + "A": { + "tokens": 20000, + "ns": 2147947068, + "digest": "565d66b3abf21a8a" + } + }, + { + "round": 10, + "order": "BA", + "load1": "6.48", + "B": { + "tokens": 20000, + "ns": 2149272983, + "digest": "565d66b3abf21a8a" + }, + "A": { + "tokens": 20000, + "ns": 2150160689, + "digest": "565d66b3abf21a8a" + } + }, + { + "round": 11, + "order": "BA", + "load1": "6.29", + "B": { + "tokens": 20000, + "ns": 2149539504, + "digest": "565d66b3abf21a8a" + }, + "A": { + "tokens": 20000, + "ns": 2148361244, + "digest": "565d66b3abf21a8a" + } + }, + { + "round": 12, + "order": "BA", + "load1": "6.29", + "B": { + "tokens": 20000, + "ns": 2149020883, + "digest": "565d66b3abf21a8a" + }, + "A": { + "tokens": 20000, + "ns": 2148660804, + "digest": "565d66b3abf21a8a" + } + }, + { + "round": 13, + "order": "AB", + "load1": "6.26", + "A": { + "tokens": 20000, + "ns": 2147613713, + "digest": "565d66b3abf21a8a" + }, + "B": { + "tokens": 20000, + "ns": 2148357193, + "digest": "565d66b3abf21a8a" + } + }, + { + "round": 14, + "order": "AB", + "load1": "6.16", + "A": { + "tokens": 20000, + "ns": 2148009658, + "digest": "565d66b3abf21a8a" + }, + "B": { + "tokens": 20000, + "ns": 2151887172, + "digest": "565d66b3abf21a8a" + } + }, + { + "round": 15, + "order": "AB", + "load1": "6.31", + "A": { + "tokens": 20000, + "ns": 2150966802, + "digest": "565d66b3abf21a8a" + }, + "B": { + "tokens": 20000, + "ns": 2151401560, + "digest": "565d66b3abf21a8a" + } + }, + { + "round": 16, + "order": "AB", + "load1": "6.52", + "A": { + "tokens": 20000, + "ns": 2150334453, + "digest": "565d66b3abf21a8a" + }, + "B": { + "tokens": 20000, + "ns": 2152536373, + "digest": "565d66b3abf21a8a" + } + }, + { + "round": 17, + "order": "AB", + "load1": "6.72", + "A": { + "tokens": 20000, + "ns": 2150983759, + "digest": "565d66b3abf21a8a" + }, + "B": { + "tokens": 20000, + "ns": 2151250019, + "digest": "565d66b3abf21a8a" + } + }, + { + "round": 18, + "order": "AB", + "load1": "6.83", + "A": { + "tokens": 20000, + "ns": 2150344881, + "digest": "565d66b3abf21a8a" + }, + "B": { + "tokens": 20000, + "ns": 2154848688, + "digest": "565d66b3abf21a8a" + } + }, + { + "round": 19, + "order": "AB", + "load1": "6.83", + "A": { + "tokens": 20000, + "ns": 2151584495, + "digest": "565d66b3abf21a8a" + }, + "B": { + "tokens": 20000, + "ns": 2151513714, + "digest": "565d66b3abf21a8a" + } + } + ] +} \ No newline at end of file diff --git a/evidence/q36-decode-timeline-20261027/host-ab/run.py b/evidence/q36-decode-timeline-20261027/host-ab/run.py new file mode 100755 index 00000000..381273bb --- /dev/null +++ b/evidence/q36-decode-timeline-20261027/host-ab/run.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python3 +# THROWAWAY host A/B runner for evidence/q36-decode-timeline-20261027/PROTOCOL.md (#785). +# 2 warm-up rounds discarded, 20 rounds, arm order per round from random.Random(785), +# one process per arm per round on taskset -c 12 under nice -n 19. +import json, os, random, re, subprocess, sys + +here = os.path.dirname(os.path.abspath(__file__)) +exe = {a: open(os.path.join(here, f"exe-{a}.txt")).read().split()[0] for a in "AB"} +rng = random.Random(785) +out = {"exe": exe, "rounds": []} +for rnd in range(-2, 20): + order = ["A", "B"] + rng.shuffle(order) + load = open("/proc/loadavg").read().split()[0] + row = {"round": rnd, "order": "".join(order), "load1": load} + for a in order: + p = subprocess.run( + ["nice", "-n", "19", "taskset", "-c", "12", exe[a], "--ignored", "--exact", + "qwen36_batch::tests::bench_door_beat", "--nocapture", "--test-threads=1"], + capture_output=True, text=True) + m = re.search(r"BENCH tokens (\d+) ns (\d+) digest ([0-9a-f]+)", p.stdout) + if p.returncode != 0 or not m: + sys.exit(f"arm {a} round {rnd} failed rc={p.returncode}: {p.stdout[-500:]} {p.stderr[-500:]}") + row[a] = {"tokens": int(m[1]), "ns": int(m[2]), "digest": m[3]} + print(json.dumps(row), flush=True) + out["rounds"].append(row) +json.dump(out, open(os.path.join(here, "raw.json"), "w"), indent=1) +kept = [r for r in out["rounds"] if r["round"] >= 0] +digests = {r[a]["digest"] for r in out["rounds"] for a in "AB"} +tokens = {r[a]["tokens"] for r in out["rounds"] for a in "AB"} +gate = "PASS" if len(digests) == 1 and tokens == {20000} else "VOID" +with open(os.path.join(here, "ab.wl"), "w") as f: + f.write(f"(* correctness gate {gate}: digests {sorted(digests)}, tokens {sorted(tokens)} *)\n") + f.write("nsA = {%s};\n" % ", ".join(str(r["A"]["ns"]) for r in kept)) + f.write("nsB = {%s};\n" % ", ".join(str(r["B"]["ns"]) for r in kept)) +print("gate", gate) diff --git a/evidence/q36-decode-timeline-20261027/host-timeline/host-check.txt b/evidence/q36-decode-timeline-20261027/host-timeline/host-check.txt new file mode 100644 index 00000000..8331f4ec --- /dev/null +++ b/evidence/q36-decode-timeline-20261027/host-timeline/host-check.txt @@ -0,0 +1,2 @@ +decode timeline GREEN: 19 records, host-timeline.jsonl +green exit 0 diff --git a/evidence/q36-decode-timeline-20261027/host-timeline/host-red-3-host-4.txt b/evidence/q36-decode-timeline-20261027/host-timeline/host-red-3-host-4.txt new file mode 100644 index 00000000..de66272a --- /dev/null +++ b/evidence/q36-decode-timeline-20261027/host-timeline/host-red-3-host-4.txt @@ -0,0 +1,5 @@ +negative control: dropped 3:host:4 +RED: record 3 (beat 9): host phases ["sched_join", "sample", "sched_feed", "step_enter", "graph_record", "graph_submit_wait", "graph_exit", "logits_read", "step_return", "sched_post"] +RED: record 3 (beat 9): host 3 step_enter ends at 3820694, graph_record starts at 3820726 +decode timeline RED: 2 findings over 19 records, host-timeline.jsonl +drop 3:host:4 exit 1 diff --git a/evidence/q36-decode-timeline-20261027/host-timeline/host-red-5-dev-3.txt b/evidence/q36-decode-timeline-20261027/host-timeline/host-red-5-dev-3.txt new file mode 100644 index 00000000..1cf530bb --- /dev/null +++ b/evidence/q36-decode-timeline-20261027/host-timeline/host-red-5-dev-3.txt @@ -0,0 +1,6 @@ +negative control: dropped 5:dev:3 +RED: record 5 (beat 11): dev 2 ab ends at 7004773096, o_proj starts at 7004773196 +RED: record 5 (beat 11): 20 device spans for 21 launches +RED: record 5 (beat 11): launch-kind census differs from record 0 +decode timeline RED: 3 findings over 19 records, host-timeline.jsonl +drop 5:dev:3 exit 1 diff --git a/evidence/q36-decode-timeline-20261027/host-timeline/host-red-7-record-0.txt b/evidence/q36-decode-timeline-20261027/host-timeline/host-red-7-record-0.txt new file mode 100644 index 00000000..63b237e7 --- /dev/null +++ b/evidence/q36-decode-timeline-20261027/host-timeline/host-red-7-record-0.txt @@ -0,0 +1,14 @@ +negative control: dropped 7:record:0 +RED: record 7 (beat 14): seq 8 where 7 belongs (a record is missing or repeated) +RED: record 8 (beat 15): seq 9 where 8 belongs (a record is missing or repeated) +RED: record 9 (beat 16): seq 10 where 9 belongs (a record is missing or repeated) +RED: record 10 (beat 17): seq 11 where 10 belongs (a record is missing or repeated) +RED: record 11 (beat 18): seq 12 where 11 belongs (a record is missing or repeated) +RED: record 12 (beat 19): seq 13 where 12 belongs (a record is missing or repeated) +RED: record 13 (beat 20): seq 14 where 13 belongs (a record is missing or repeated) +RED: record 14 (beat 21): seq 15 where 14 belongs (a record is missing or repeated) +RED: record 15 (beat 22): seq 16 where 15 belongs (a record is missing or repeated) +RED: record 16 (beat 23): seq 17 where 16 belongs (a record is missing or repeated) +RED: record 17 (beat 24): seq 18 where 17 belongs (a record is missing or repeated) +decode timeline RED: 11 findings over 18 records, host-timeline.jsonl +drop 7:record:0 exit 1 diff --git a/evidence/q36-decode-timeline-20261027/host-timeline/host-summary.wl b/evidence/q36-decode-timeline-20261027/host-timeline/host-summary.wl new file mode 100644 index 00000000..4fbc6a65 --- /dev/null +++ b/evidence/q36-decode-timeline-20261027/host-timeline/host-summary.wl @@ -0,0 +1,30 @@ +(* aien.q36-decode-timeline/1: 19 beats; integer ns per beat; host clock for host:*, period, sync; chip PTIMER for dev:*, dev_span *) +timeline = <| + "period" -> {464770, 496851, 483555, 486947, 472866, 450115, 473731, 470291, 474802, 472451, 461747, 471619, 474834, 471619, 469091, 459522, 480707, 479907, 474851}, + "host:sched_join" -> {64, 35696, 18736, 19408, 10848, 12241, 9232, 7392, 12320, 9120, 9008, 9088, 9424, 9200, 7072, 14880, 16465, 17008, 8304}, + "host:sample" -> {3072, 2272, 2144, 2352, 1824, 1840, 1920, 3392, 2048, 2256, 1712, 1984, 1920, 2336, 1776, 1968, 2032, 1584, 1600}, + "host:sched_feed" -> {432, 224, 400, 224, 176, 144, 160, 160, 192, 144, 128, 160, 112, 192, 160, 176, 224, 160, 144}, + "host:step_enter" -> {80, 80, 144, 64, 80, 80, 80, 80, 80, 80, 80, 80, 96, 80, 80, 80, 112, 80, 80}, + "host:embed" -> {32, 48, 48, 32, 32, 32, 48, 48, 48, 48, 32, 48, 32, 48, 48, 48, 48, 48, 48}, + "host:graph_record" -> {102560, 98081, 104881, 104385, 102912, 103616, 104273, 102641, 103184, 104433, 94321, 103265, 104160, 103217, 102609, 104129, 104608, 103937, 102689}, + "host:graph_submit_wait" -> {353858, 354210, 354082, 357218, 353858, 329538, 354962, 353906, 353906, 353810, 353890, 354162, 356290, 353794, 354210, 332625, 354050, 354130, 356194}, + "host:graph_exit" -> {32, 48, 96, 48, 48, 48, 48, 48, 48, 48, 32, 48, 48, 48, 32, 32, 32, 48, 32}, + "host:logits_read" -> {16, 32, 32, 48, 32, 32, 48, 32, 48, 32, 48, 48, 48, 48, 48, 48, 48, 32, 48}, + "host:step_return" -> {1040, 2800, 1376, 1296, 1168, 1056, 1440, 1088, 1184, 1024, 1088, 1152, 1120, 1184, 1424, 2544, 1264, 1184, 2944}, + "host:sched_post" -> {3584, 3360, 1616, 1872, 1888, 1488, 1520, 1504, 1744, 1456, 1408, 1584, 1584, 1472, 1632, 2992, 1824, 1696, 2768}, + "dev:experts" -> {200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200}, + "dev:gdn" -> {300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300}, + "dev:attention" -> {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}, + "dev:router" -> {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}, + "dev:head_screen" -> {300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300}, + "dev:head_recheck" -> {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}, + "dev:head_plain" -> {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + "dev:token_pick" -> {200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200}, + "dev:glue" -> {800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800}, + "dev:unknown" -> {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + "dev_span" -> {2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100}, + "sync" -> {351758, 352110, 351982, 355118, 351758, 327438, 352862, 351806, 351806, 351710, 351790, 352062, 354190, 351694, 352110, 330525, 351950, 352030, 354094} +|>; +(* ms per beat, medians: *) N[Median /@ timeline / 10^6] +(* outside the chip + chip + sync vs the period: *) N[{Median[timeline["period"] - timeline["host:graph_submit_wait"]], Median[timeline["dev_span"]], Median[timeline["sync"]], Median[timeline["period"]]} / 10^6] +(* residual against the recorded 20.7 ms step: *) N[207/10 - Median[timeline["period"]] / 10^6] diff --git a/evidence/q36-decode-timeline-20261027/host-timeline/host-timeline.jsonl b/evidence/q36-decode-timeline-20261027/host-timeline/host-timeline.jsonl new file mode 100644 index 00000000..a8b37182 --- /dev/null +++ b/evidence/q36-decode-timeline-20261027/host-timeline/host-timeline.jsonl @@ -0,0 +1,19 @@ +{"schema":"aien.q36-decode-timeline/1","seq":0,"beat":6,"row":0,"step":0,"launches":21,"chip_ns":2100,"record_ns":102560,"total_ns":456418,"host":[{"name":"sched_join","t0":2353470,"t1":2353534},{"name":"sample","t0":2353534,"t1":2356606},{"name":"sched_feed","t0":2356606,"t1":2357038},{"name":"step_enter","t0":2357038,"t1":2357118},{"name":"embed","t0":2357118,"t1":2357150},{"name":"graph_record","t0":2357150,"t1":2459710},{"name":"graph_submit_wait","t0":2459710,"t1":2813568},{"name":"graph_exit","t0":2813568,"t1":2813600},{"name":"logits_read","t0":2813600,"t1":2813616},{"name":"step_return","t0":2813616,"t1":2814656},{"name":"sched_post","t0":2814656,"t1":2818240}],"dev":[{"name":"norm","t0":7002357150,"t1":7002357250},{"name":"mix","t0":7002357250,"t1":7002357350},{"name":"ab","t0":7002357350,"t1":7002357450},{"name":"gdn","t0":7002357450,"t1":7002357550},{"name":"o_proj","t0":7002357550,"t1":7002357650},{"name":"res","t0":7002357650,"t1":7002357750},{"name":"router","t0":7002357750,"t1":7002357850},{"name":"gate_up","t0":7002357850,"t1":7002357950},{"name":"swiglu","t0":7002357950,"t1":7002358050},{"name":"down","t0":7002358050,"t1":7002358150},{"name":"gather","t0":7002358150,"t1":7002358250},{"name":"res","t0":7002358250,"t1":7002358350},{"name":"norm","t0":7002358350,"t1":7002358450},{"name":"lm_head","t0":7002358450,"t1":7002358550},{"name":"lm_head","t0":7002358550,"t1":7002358650},{"name":"lm_head","t0":7002358650,"t1":7002358750},{"name":"argmax","t0":7002358750,"t1":7002358850},{"name":"argmax","t0":7002358850,"t1":7002358950},{"name":"lm_head","t0":7002358950,"t1":7002359050},{"name":"argmax","t0":7002359050,"t1":7002359150},{"name":"argmax","t0":7002359150,"t1":7002359250}]} +{"schema":"aien.q36-decode-timeline/1","seq":1,"beat":7,"row":0,"step":1,"launches":21,"chip_ns":2100,"record_ns":98081,"total_ns":452291,"host":[{"name":"sched_join","t0":2818240,"t1":2853936},{"name":"sample","t0":2853936,"t1":2856208},{"name":"sched_feed","t0":2856208,"t1":2856432},{"name":"step_enter","t0":2856432,"t1":2856512},{"name":"embed","t0":2856512,"t1":2856560},{"name":"graph_record","t0":2856560,"t1":2954641},{"name":"graph_submit_wait","t0":2954641,"t1":3308851},{"name":"graph_exit","t0":3308851,"t1":3308899},{"name":"logits_read","t0":3308899,"t1":3308931},{"name":"step_return","t0":3308931,"t1":3311731},{"name":"sched_post","t0":3311731,"t1":3315091}],"dev":[{"name":"norm","t0":7002856560,"t1":7002856660},{"name":"mix","t0":7002856660,"t1":7002856760},{"name":"ab","t0":7002856760,"t1":7002856860},{"name":"gdn","t0":7002856860,"t1":7002856960},{"name":"o_proj","t0":7002856960,"t1":7002857060},{"name":"res","t0":7002857060,"t1":7002857160},{"name":"router","t0":7002857160,"t1":7002857260},{"name":"gate_up","t0":7002857260,"t1":7002857360},{"name":"swiglu","t0":7002857360,"t1":7002857460},{"name":"down","t0":7002857460,"t1":7002857560},{"name":"gather","t0":7002857560,"t1":7002857660},{"name":"res","t0":7002857660,"t1":7002857760},{"name":"norm","t0":7002857760,"t1":7002857860},{"name":"lm_head","t0":7002857860,"t1":7002857960},{"name":"lm_head","t0":7002857960,"t1":7002858060},{"name":"lm_head","t0":7002858060,"t1":7002858160},{"name":"argmax","t0":7002858160,"t1":7002858260},{"name":"argmax","t0":7002858260,"t1":7002858360},{"name":"lm_head","t0":7002858360,"t1":7002858460},{"name":"argmax","t0":7002858460,"t1":7002858560},{"name":"argmax","t0":7002858560,"t1":7002858660}]} +{"schema":"aien.q36-decode-timeline/1","seq":2,"beat":8,"row":0,"step":2,"launches":21,"chip_ns":2100,"record_ns":104881,"total_ns":458963,"host":[{"name":"sched_join","t0":3315091,"t1":3333827},{"name":"sample","t0":3333827,"t1":3335971},{"name":"sched_feed","t0":3335971,"t1":3336371},{"name":"step_enter","t0":3336371,"t1":3336515},{"name":"embed","t0":3336515,"t1":3336563},{"name":"graph_record","t0":3336563,"t1":3441444},{"name":"graph_submit_wait","t0":3441444,"t1":3795526},{"name":"graph_exit","t0":3795526,"t1":3795622},{"name":"logits_read","t0":3795622,"t1":3795654},{"name":"step_return","t0":3795654,"t1":3797030},{"name":"sched_post","t0":3797030,"t1":3798646}],"dev":[{"name":"norm","t0":7003336563,"t1":7003336663},{"name":"mix","t0":7003336663,"t1":7003336763},{"name":"ab","t0":7003336763,"t1":7003336863},{"name":"gdn","t0":7003336863,"t1":7003336963},{"name":"o_proj","t0":7003336963,"t1":7003337063},{"name":"res","t0":7003337063,"t1":7003337163},{"name":"router","t0":7003337163,"t1":7003337263},{"name":"gate_up","t0":7003337263,"t1":7003337363},{"name":"swiglu","t0":7003337363,"t1":7003337463},{"name":"down","t0":7003337463,"t1":7003337563},{"name":"gather","t0":7003337563,"t1":7003337663},{"name":"res","t0":7003337663,"t1":7003337763},{"name":"norm","t0":7003337763,"t1":7003337863},{"name":"lm_head","t0":7003337863,"t1":7003337963},{"name":"lm_head","t0":7003337963,"t1":7003338063},{"name":"lm_head","t0":7003338063,"t1":7003338163},{"name":"argmax","t0":7003338163,"t1":7003338263},{"name":"argmax","t0":7003338263,"t1":7003338363},{"name":"lm_head","t0":7003338363,"t1":7003338463},{"name":"argmax","t0":7003338463,"t1":7003338563},{"name":"argmax","t0":7003338563,"t1":7003338663}]} +{"schema":"aien.q36-decode-timeline/1","seq":3,"beat":9,"row":0,"step":3,"launches":21,"chip_ns":2100,"record_ns":104385,"total_ns":461603,"host":[{"name":"sched_join","t0":3798646,"t1":3818054},{"name":"sample","t0":3818054,"t1":3820406},{"name":"sched_feed","t0":3820406,"t1":3820630},{"name":"step_enter","t0":3820630,"t1":3820694},{"name":"embed","t0":3820694,"t1":3820726},{"name":"graph_record","t0":3820726,"t1":3925111},{"name":"graph_submit_wait","t0":3925111,"t1":4282329},{"name":"graph_exit","t0":4282329,"t1":4282377},{"name":"logits_read","t0":4282377,"t1":4282425},{"name":"step_return","t0":4282425,"t1":4283721},{"name":"sched_post","t0":4283721,"t1":4285593}],"dev":[{"name":"norm","t0":7003820726,"t1":7003820826},{"name":"mix","t0":7003820826,"t1":7003820926},{"name":"ab","t0":7003820926,"t1":7003821026},{"name":"gdn","t0":7003821026,"t1":7003821126},{"name":"o_proj","t0":7003821126,"t1":7003821226},{"name":"res","t0":7003821226,"t1":7003821326},{"name":"router","t0":7003821326,"t1":7003821426},{"name":"gate_up","t0":7003821426,"t1":7003821526},{"name":"swiglu","t0":7003821526,"t1":7003821626},{"name":"down","t0":7003821626,"t1":7003821726},{"name":"gather","t0":7003821726,"t1":7003821826},{"name":"res","t0":7003821826,"t1":7003821926},{"name":"norm","t0":7003821926,"t1":7003822026},{"name":"lm_head","t0":7003822026,"t1":7003822126},{"name":"lm_head","t0":7003822126,"t1":7003822226},{"name":"lm_head","t0":7003822226,"t1":7003822326},{"name":"argmax","t0":7003822326,"t1":7003822426},{"name":"argmax","t0":7003822426,"t1":7003822526},{"name":"lm_head","t0":7003822526,"t1":7003822626},{"name":"argmax","t0":7003822626,"t1":7003822726},{"name":"argmax","t0":7003822726,"t1":7003822826}]} +{"schema":"aien.q36-decode-timeline/1","seq":4,"beat":10,"row":0,"step":4,"launches":21,"chip_ns":2100,"record_ns":102912,"total_ns":456770,"host":[{"name":"sched_join","t0":4285593,"t1":4296441},{"name":"sample","t0":4296441,"t1":4298265},{"name":"sched_feed","t0":4298265,"t1":4298441},{"name":"step_enter","t0":4298441,"t1":4298521},{"name":"embed","t0":4298521,"t1":4298553},{"name":"graph_record","t0":4298553,"t1":4401465},{"name":"graph_submit_wait","t0":4401465,"t1":4755323},{"name":"graph_exit","t0":4755323,"t1":4755371},{"name":"logits_read","t0":4755371,"t1":4755403},{"name":"step_return","t0":4755403,"t1":4756571},{"name":"sched_post","t0":4756571,"t1":4758459}],"dev":[{"name":"norm","t0":7004298553,"t1":7004298653},{"name":"mix","t0":7004298653,"t1":7004298753},{"name":"ab","t0":7004298753,"t1":7004298853},{"name":"gdn","t0":7004298853,"t1":7004298953},{"name":"o_proj","t0":7004298953,"t1":7004299053},{"name":"res","t0":7004299053,"t1":7004299153},{"name":"router","t0":7004299153,"t1":7004299253},{"name":"gate_up","t0":7004299253,"t1":7004299353},{"name":"swiglu","t0":7004299353,"t1":7004299453},{"name":"down","t0":7004299453,"t1":7004299553},{"name":"gather","t0":7004299553,"t1":7004299653},{"name":"res","t0":7004299653,"t1":7004299753},{"name":"norm","t0":7004299753,"t1":7004299853},{"name":"lm_head","t0":7004299853,"t1":7004299953},{"name":"lm_head","t0":7004299953,"t1":7004300053},{"name":"lm_head","t0":7004300053,"t1":7004300153},{"name":"argmax","t0":7004300153,"t1":7004300253},{"name":"argmax","t0":7004300253,"t1":7004300353},{"name":"lm_head","t0":7004300353,"t1":7004300453},{"name":"argmax","t0":7004300453,"t1":7004300553},{"name":"argmax","t0":7004300553,"t1":7004300653}]} +{"schema":"aien.q36-decode-timeline/1","seq":5,"beat":11,"row":0,"step":5,"launches":21,"chip_ns":2100,"record_ns":103616,"total_ns":433154,"host":[{"name":"sched_join","t0":4758459,"t1":4770700},{"name":"sample","t0":4770700,"t1":4772540},{"name":"sched_feed","t0":4772540,"t1":4772684},{"name":"step_enter","t0":4772684,"t1":4772764},{"name":"embed","t0":4772764,"t1":4772796},{"name":"graph_record","t0":4772796,"t1":4876412},{"name":"graph_submit_wait","t0":4876412,"t1":5205950},{"name":"graph_exit","t0":5205950,"t1":5205998},{"name":"logits_read","t0":5205998,"t1":5206030},{"name":"step_return","t0":5206030,"t1":5207086},{"name":"sched_post","t0":5207086,"t1":5208574}],"dev":[{"name":"norm","t0":7004772796,"t1":7004772896},{"name":"mix","t0":7004772896,"t1":7004772996},{"name":"ab","t0":7004772996,"t1":7004773096},{"name":"gdn","t0":7004773096,"t1":7004773196},{"name":"o_proj","t0":7004773196,"t1":7004773296},{"name":"res","t0":7004773296,"t1":7004773396},{"name":"router","t0":7004773396,"t1":7004773496},{"name":"gate_up","t0":7004773496,"t1":7004773596},{"name":"swiglu","t0":7004773596,"t1":7004773696},{"name":"down","t0":7004773696,"t1":7004773796},{"name":"gather","t0":7004773796,"t1":7004773896},{"name":"res","t0":7004773896,"t1":7004773996},{"name":"norm","t0":7004773996,"t1":7004774096},{"name":"lm_head","t0":7004774096,"t1":7004774196},{"name":"lm_head","t0":7004774196,"t1":7004774296},{"name":"lm_head","t0":7004774296,"t1":7004774396},{"name":"argmax","t0":7004774396,"t1":7004774496},{"name":"argmax","t0":7004774496,"t1":7004774596},{"name":"lm_head","t0":7004774596,"t1":7004774696},{"name":"argmax","t0":7004774696,"t1":7004774796},{"name":"argmax","t0":7004774796,"t1":7004774896}]} +{"schema":"aien.q36-decode-timeline/1","seq":6,"beat":12,"row":0,"step":6,"launches":21,"chip_ns":2100,"record_ns":104273,"total_ns":459235,"host":[{"name":"sched_join","t0":5208574,"t1":5217806},{"name":"sample","t0":5217806,"t1":5219726},{"name":"sched_feed","t0":5219726,"t1":5219886},{"name":"step_enter","t0":5219886,"t1":5219966},{"name":"embed","t0":5219966,"t1":5220014},{"name":"graph_record","t0":5220014,"t1":5324287},{"name":"graph_submit_wait","t0":5324287,"t1":5679249},{"name":"graph_exit","t0":5679249,"t1":5679297},{"name":"logits_read","t0":5679297,"t1":5679345},{"name":"step_return","t0":5679345,"t1":5680785},{"name":"sched_post","t0":5680785,"t1":5682305}],"dev":[{"name":"norm","t0":7005220014,"t1":7005220114},{"name":"mix","t0":7005220114,"t1":7005220214},{"name":"ab","t0":7005220214,"t1":7005220314},{"name":"gdn","t0":7005220314,"t1":7005220414},{"name":"o_proj","t0":7005220414,"t1":7005220514},{"name":"res","t0":7005220514,"t1":7005220614},{"name":"router","t0":7005220614,"t1":7005220714},{"name":"gate_up","t0":7005220714,"t1":7005220814},{"name":"swiglu","t0":7005220814,"t1":7005220914},{"name":"down","t0":7005220914,"t1":7005221014},{"name":"gather","t0":7005221014,"t1":7005221114},{"name":"res","t0":7005221114,"t1":7005221214},{"name":"norm","t0":7005221214,"t1":7005221314},{"name":"lm_head","t0":7005221314,"t1":7005221414},{"name":"lm_head","t0":7005221414,"t1":7005221514},{"name":"lm_head","t0":7005221514,"t1":7005221614},{"name":"argmax","t0":7005221614,"t1":7005221714},{"name":"argmax","t0":7005221714,"t1":7005221814},{"name":"lm_head","t0":7005221814,"t1":7005221914},{"name":"argmax","t0":7005221914,"t1":7005222014},{"name":"argmax","t0":7005222014,"t1":7005222114}]} +{"schema":"aien.q36-decode-timeline/1","seq":7,"beat":13,"row":0,"step":7,"launches":21,"chip_ns":2100,"record_ns":102641,"total_ns":456547,"host":[{"name":"sched_join","t0":5682305,"t1":5689697},{"name":"sample","t0":5689697,"t1":5693089},{"name":"sched_feed","t0":5693089,"t1":5693249},{"name":"step_enter","t0":5693249,"t1":5693329},{"name":"embed","t0":5693329,"t1":5693377},{"name":"graph_record","t0":5693377,"t1":5796018},{"name":"graph_submit_wait","t0":5796018,"t1":6149924},{"name":"graph_exit","t0":6149924,"t1":6149972},{"name":"logits_read","t0":6149972,"t1":6150004},{"name":"step_return","t0":6150004,"t1":6151092},{"name":"sched_post","t0":6151092,"t1":6152596}],"dev":[{"name":"norm","t0":7005693377,"t1":7005693477},{"name":"mix","t0":7005693477,"t1":7005693577},{"name":"ab","t0":7005693577,"t1":7005693677},{"name":"gdn","t0":7005693677,"t1":7005693777},{"name":"o_proj","t0":7005693777,"t1":7005693877},{"name":"res","t0":7005693877,"t1":7005693977},{"name":"router","t0":7005693977,"t1":7005694077},{"name":"gate_up","t0":7005694077,"t1":7005694177},{"name":"swiglu","t0":7005694177,"t1":7005694277},{"name":"down","t0":7005694277,"t1":7005694377},{"name":"gather","t0":7005694377,"t1":7005694477},{"name":"res","t0":7005694477,"t1":7005694577},{"name":"norm","t0":7005694577,"t1":7005694677},{"name":"lm_head","t0":7005694677,"t1":7005694777},{"name":"lm_head","t0":7005694777,"t1":7005694877},{"name":"lm_head","t0":7005694877,"t1":7005694977},{"name":"argmax","t0":7005694977,"t1":7005695077},{"name":"argmax","t0":7005695077,"t1":7005695177},{"name":"lm_head","t0":7005695177,"t1":7005695277},{"name":"argmax","t0":7005695277,"t1":7005695377},{"name":"argmax","t0":7005695377,"t1":7005695477}]} +{"schema":"aien.q36-decode-timeline/1","seq":8,"beat":14,"row":0,"step":8,"launches":21,"chip_ns":2100,"record_ns":103184,"total_ns":457090,"host":[{"name":"sched_join","t0":6152596,"t1":6164916},{"name":"sample","t0":6164916,"t1":6166964},{"name":"sched_feed","t0":6166964,"t1":6167156},{"name":"step_enter","t0":6167156,"t1":6167236},{"name":"embed","t0":6167236,"t1":6167284},{"name":"graph_record","t0":6167284,"t1":6270468},{"name":"graph_submit_wait","t0":6270468,"t1":6624374},{"name":"graph_exit","t0":6624374,"t1":6624422},{"name":"logits_read","t0":6624422,"t1":6624470},{"name":"step_return","t0":6624470,"t1":6625654},{"name":"sched_post","t0":6625654,"t1":6627398}],"dev":[{"name":"norm","t0":7006167284,"t1":7006167384},{"name":"mix","t0":7006167384,"t1":7006167484},{"name":"ab","t0":7006167484,"t1":7006167584},{"name":"gdn","t0":7006167584,"t1":7006167684},{"name":"o_proj","t0":7006167684,"t1":7006167784},{"name":"res","t0":7006167784,"t1":7006167884},{"name":"router","t0":7006167884,"t1":7006167984},{"name":"gate_up","t0":7006167984,"t1":7006168084},{"name":"swiglu","t0":7006168084,"t1":7006168184},{"name":"down","t0":7006168184,"t1":7006168284},{"name":"gather","t0":7006168284,"t1":7006168384},{"name":"res","t0":7006168384,"t1":7006168484},{"name":"norm","t0":7006168484,"t1":7006168584},{"name":"lm_head","t0":7006168584,"t1":7006168684},{"name":"lm_head","t0":7006168684,"t1":7006168784},{"name":"lm_head","t0":7006168784,"t1":7006168884},{"name":"argmax","t0":7006168884,"t1":7006168984},{"name":"argmax","t0":7006168984,"t1":7006169084},{"name":"lm_head","t0":7006169084,"t1":7006169184},{"name":"argmax","t0":7006169184,"t1":7006169284},{"name":"argmax","t0":7006169284,"t1":7006169384}]} +{"schema":"aien.q36-decode-timeline/1","seq":9,"beat":15,"row":0,"step":9,"launches":21,"chip_ns":2100,"record_ns":104433,"total_ns":458243,"host":[{"name":"sched_join","t0":6627398,"t1":6636518},{"name":"sample","t0":6636518,"t1":6638774},{"name":"sched_feed","t0":6638774,"t1":6638918},{"name":"step_enter","t0":6638918,"t1":6638998},{"name":"embed","t0":6638998,"t1":6639046},{"name":"graph_record","t0":6639046,"t1":6743479},{"name":"graph_submit_wait","t0":6743479,"t1":7097289},{"name":"graph_exit","t0":7097289,"t1":7097337},{"name":"logits_read","t0":7097337,"t1":7097369},{"name":"step_return","t0":7097369,"t1":7098393},{"name":"sched_post","t0":7098393,"t1":7099849}],"dev":[{"name":"norm","t0":7006639046,"t1":7006639146},{"name":"mix","t0":7006639146,"t1":7006639246},{"name":"ab","t0":7006639246,"t1":7006639346},{"name":"gdn","t0":7006639346,"t1":7006639446},{"name":"o_proj","t0":7006639446,"t1":7006639546},{"name":"res","t0":7006639546,"t1":7006639646},{"name":"router","t0":7006639646,"t1":7006639746},{"name":"gate_up","t0":7006639746,"t1":7006639846},{"name":"swiglu","t0":7006639846,"t1":7006639946},{"name":"down","t0":7006639946,"t1":7006640046},{"name":"gather","t0":7006640046,"t1":7006640146},{"name":"res","t0":7006640146,"t1":7006640246},{"name":"norm","t0":7006640246,"t1":7006640346},{"name":"lm_head","t0":7006640346,"t1":7006640446},{"name":"lm_head","t0":7006640446,"t1":7006640546},{"name":"lm_head","t0":7006640546,"t1":7006640646},{"name":"argmax","t0":7006640646,"t1":7006640746},{"name":"argmax","t0":7006640746,"t1":7006640846},{"name":"lm_head","t0":7006640846,"t1":7006640946},{"name":"argmax","t0":7006640946,"t1":7006641046},{"name":"argmax","t0":7006641046,"t1":7006641146}]} ``` The diff is longer than this page shows; the raw diff has all of it.