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
aien-sovereign-core-mv / docs / campaigns / next-phase-1 / ACCEPTANCE-v3.md
| 1 | # NEXT-PHASE-1 campaign v3: acceptance criteria (frozen before any v3 code or run) |
| 2 | |
| 3 | ```text |
| 4 | campaign_id = "next-phase-1" |
| 5 | spec_version = 3 |
| 6 | status = FROZEN at the commit that adds this file. The v3 code (measured |
| 7 | attempt budget, driver S8 fix) lands in LATER commits. The one |
| 8 | commit before this file (3ec13bd) adds only observation: an |
| 9 | AIEN_STEP_LOG line and chat template tests, no behaviour change. |
| 10 | base = sovereign-core main 91751b6 (v2, #217 merged). |
| 11 | ``` |
| 12 | |
| 13 | v1 and v2 stand as recorded; their receipts (`92acb566...` and the three before it, `2c12a5ba...`) |
| 14 | are never edited. v2 verdict FAIL on task completion: attempt 1 echoed the prompt in 48 tokens |
| 15 | (16 056 ms) and the 25 s budget left no room for attempt 2. |
| 16 | |
| 17 | ## 1. Task, steps, receipts, pass criteria: unchanged |
| 18 | |
| 19 | ACCEPTANCE.md Sections 1, 2 and 4 and ACCEPTANCE-v2.md Section 2 apply unchanged: the bounded |
| 20 | task, steps S1..S8, the environment class, both receipt formats, every threshold of the v2 table |
| 21 | and the rescue definition. One driver launch, one goal, one task, two daemon starts. |
| 22 | |
| 23 | ## 2. Measured input (control run 2026-10-06 03:11Z, GB10, quietlock hold) |
| 24 | |
| 25 | Raw records (outputs verbatim, client timestamps, `step:` lines) are in the campaign log |
| 26 | directory `np1-logs/v3-control/` of the run host; the numbers below are copied from them. |
| 27 | |
| 28 | **Prompt format (control).** The exact v2 request (`proposal_prompt` with the v2 goal, the v2 |
| 29 | workspace path and `README.md, docs`) was sent through plain `StreamTurn`, outside the |
| 30 | composition, greedy, 48 tokens. |
| 31 | - The production path already applies the model's chat template: `submit_turn` |
| 32 | (crates/aien-runtime/src/server.rs) formats every `StreamTurn` and every compose proposal with |
| 33 | `format_tinyllama_chat`, then encodes with special tokens. Source of the template: |
| 34 | `TinyLlama-1.1B-Chat-v1.0/tokenizer_config.json`, sha256 |
| 35 | `7b41ba7d0eb91e77914ca3dafde559ea3e19878769b7e68409e89bed5222e77a`, field `chat_template`. |
| 36 | Rendered with the Hugging Face settings (trim_blocks, lstrip_blocks) it gives |
| 37 | `<|user|>\n{prompt}</s>\n<|assistant|>\n`, byte-identical to AIEN's (PROVEN BY TEST: |
| 38 | `chat_template_test::streamturn_formatting_matches_the_model_template`; the hand rendering |
| 39 | of the jinja is INFERRED, no jinja engine was run). With the real tokenizer the prompt starts |
| 40 | with BOS (id 1) and holds one EOS (id 2): 135 tokens (PROVEN BY TEST). |
| 41 | - So "raw as v2 did" and "model template" are the same request. Sent twice (cold, warm), the |
| 42 | output was identical both times (sha256 `0fd0c04e5198bd53...`, equal to v2 S3 attempt 1), |
| 43 | first line `Goal: Create the file README.md ...`: no `filename:` first line (MEASURED). |
| 44 | **The echo is not a prompt-format bug.** v3 therefore declares no change to the request text. |
| 45 | - Exploratory, outside the brief: the format instruction as a system turn and the goal as the |
| 46 | user turn gave `To create the file NOTES.md ... you can follow these steps:` (no filename line). |
| 47 | |
| 48 | **Fixed cost (one daemon, 135-token prompt, wall from send to `TurnFinished`).** |
| 49 | |
| 50 | | max_tokens | wall, two calls | backend steps | |
| 51 | |-----------:|-----------------|---------------| |
| 52 | | 1 | 3.131 s, 3.144 s | prefill 128-token chunk + 7-token chunk | |
| 53 | | 8 | 4.258 s, 4.174 s | prefill + 7 decode steps | |
| 54 | | 48 | 11.056 s, 11.028 s | prefill + 47 decode steps | |
| 55 | | 48 (first call after start) | 16.122 s | first 128-token chunk 8 010 ms | |
| 56 | |
| 57 | - Prefill, warm: 128-token chunk 2 769 to 2 872 ms (mean 2 839 ms over 8 calls, about 45 tokens/s); |
| 58 | 7-token chunk mean 255 ms; 15-token chunk 389 ms (MEASURED, `step:` lines). |
| 59 | - Decode: 162 to 169 ms per token, mean 166.6 ms, i.e. **6.0 tokens/s** (MEASURED). |
| 60 | - Wall minus backend step time: under 60 ms per call (11.5 ms and 58 ms on the 1- and 48-token calls checked) (socket, tokenizer, block_on, polling). |
| 61 | - **Where the fixed cost sits:** the prompt prefill, about 3.09 s warm for 135 tokens. Not a model |
| 62 | load per call (the model loads once at daemon start, 15.5 s), not the socket or `block_on` |
| 63 | (under 60 ms). KV allocation is inside the prefill step and not separable from these logs |
| 64 | (UNKNOWN). The first call after a daemon start pays about 5.2 s more inside its first prefill |
| 65 | step (MEASURED; cause UNKNOWN from these logs). v2 attempt 1 was such a first call. |
| 66 | - Model: T(n) = 3.14 s + (n - 1) x 0.1666 s for this prompt; predicts 3.14 / 4.31 / 10.97 s |
| 67 | for 1 / 8 / 48 tokens against 3.13 / 4.17 to 4.26 / 11.03 to 11.06 s measured. |
| 68 | |
| 69 | ## 3. Declared changes (v3) |
| 70 | |
| 71 | (a) **Chat template: no change, pinned.** The Skill keeps formatting the proposal request with |
| 72 | the model's own chat template through `submit_turn` (production path, source cited in Section 2). |
| 73 | v3 adds the test that pins it to the tokenizer_config.json template. |
| 74 | |
| 75 | (b) **Attempt budget from the measurement.** |
| 76 | - Ceiling: `rx_compose_run` waits at most 30 000 ms for quiescence |
| 77 | (omega 62b6a28 `src/runtime/rx_compose.c:1192`), NOT raised. Non-Skill time inside S3 in v2: |
| 78 | 16 107 - 16 056 = 51 ms (MEASURED). |
| 79 | - Total Skill budget B = 30 000 - 1 000 margin = **29 000 ms** (v2: 25 000 ms). |
| 80 | - Full warm attempt with the retry prompt (173 tokens = chunks of 128 and 45; 48 new tokens): |
| 81 | 2 839 (chunk 128) + 896 (chunk 45: 136 + 45 x 16.9, the line through the 7- and 15-token |
| 82 | chunks, INFERRED extrapolation) + 47 x 166.6 = 7 830 (decode) + 60 (wall overhead) |
| 83 | = 11 625 ms. Per-attempt budget A = **12 000 ms** (11 625 rounded up, about 3 % margin). |
| 84 | - Rule: attempt 1 always starts; attempt k > 1 starts only if the remaining budget is at least |
| 85 | A (v2: at least the measured duration of attempt k-1, which a cold first attempt inflated); |
| 86 | each attempt's limit is the remaining budget. |
| 87 | - Expected in this run: attempt 1 cold, about 16.1 s, leaves about 12.9 s >= 12.0 s, so attempt 2 |
| 88 | runs (about 11.6 s) and leaves about 1.3 s < 12.0 s: no attempt 3 unless an attempt ends early |
| 89 | at end of sequence. What attempt 2 answers is UNKNOWN. |
| 90 | |
| 91 | (c) **Unchanged:** `max_tokens` = 48, at most 3 attempts per task, greedy decoding, the parser |
| 92 | and the correction line of ACCEPTANCE-v2 Section 3. |
| 93 | |
| 94 | (d) **Driver: S8 is scored on its own.** When S6 cites nothing, the driver still runs S8 (and |
| 95 | the pre-restart recall), without `--ids` / `--prefix`; the recall then returns the host |
| 96 | records, so "Correctness: recall" compares the S1 constraint text with what S8 returns, no |
| 97 | longer a side effect of S3. S6 tolerates an empty citation list. |
| 98 | |
| 99 | ## 4. Binding and run conditions |
| 100 | |
| 101 | As ACCEPTANCE-v2 Section 5: omega pinned by `omega.lock` = 62b6a28 for both the GPU engine and |
| 102 | librx_compose; GB10 hold through `quietlock hold --minutes <= 20` with start and release |
| 103 | whispers; one driver launch; the verdict is whatever the rows give. Performance is an |
| 104 | observation: the summary reports tokens/s. |