Repository navigation
SWAP-05..SWAP-13: 48/50 (96.0%, 100% Frontier Parity) in 26.34s/task (1.37x API, G1.3 CLOSED) on M4 Air under 16 GB Budget - #18
Merged
Conversation
…racts & ADRs 0007-0009 (G1.5, G3.3)
…cache namespace (G1.3, G2.1)
…cap and unit tests
…p (G1.3, G2.4, G5.1)
…-50 + LiveCodeBench-50)
…i, Qwen3-Coder-A3B, and Gemma-4-12B
…2B + Qwen3-Coder-A3B)
…get (A3B + Gemma-4-12B)
… G3.1-G3.4, G5.1-G5.2)
…rk filename in test_registry
…gnostics - Add all 50 per-task Context Capsules from the 47/50 M4 Air 16GB-budget run (`m4-16gb-a3b-gemma4-full50-capsules/`) - Retain the two earlier `sota-16gb-hetero` smoke artifacts (`20261125-225200`, `20261125-230841`) and memory CSVs documenting the `inkling2_loop` load failure on `llama.cpp 1.0.0` per the append-only evidence policy
…& spec-aware overlap (G1.3, G2.2) Moves quality parity (native /v1/chat/completions template rendering + Gemma 4 / Qwen3 thought-block stripping) and swap latency (llama.cpp 1.0.0 --flash-attn on, --reasoning-budget 0, and spec-aware active-slot reuse without redundant self-prefetch).
…ession-lru (G1.2, G1.3, G1.5, G2.2) Moves: Quality Parity (#1), Swap/Task Latency (#2), Hardware Floor (#3). - Tighten REASON_SYSTEM and CRITIC_SYSTEM; add clean_thinking_text() stripping <|channel>thought...<channel|> and <think>...</think> before 600-char slicing and Capsule storage. - Extend code_prompt() and loop.py with KV-prefix-safe retry memory (prior_candidate, test_output_tail, prior_decisions), role token budgets, system_prompt forwarding, and prefetch_critic_on_code toggle. - Add sota-16gb-turbo stack and signature-checked use_chat_api forwarding in runtime/registry.py. - Add --reason-max-tokens, --critic-max-tokens, --session-lru (single shared PrefetchEngine stopped once in outer try/finally), --turbo, and --stack ModelSpec wiring in pipeline/run_pipeline.py. - Add ADR-0010 and unit tests in pipeline/tests/test_capsule_retry_and_budgets.py.
…get 0 & spec-aware overlap engine
….37x API, G1.3 CLOSED) on M4 Air
… STATE & site (G1.2, G1.3, G1.5, G2.1, G2.2, G4.4) Moves Quality Parity (#1: 48/50 = 96.0%, 100.0% frontier parity, b=0 c=0 p=1.000 vs symmetric API), Swap & Task Latency (#2: 26.34s/task = 1.37x API < 38.52s G1.3 bar CLOSED; 99/120 = 82.5% zero-load phases, mean_load_s = 0.914s < 1.5s G2.1), Hardware Floor (#3: peak_rss_kb = 13,106,032 KB = 12.50 GiB / 13.11 GB decimal inside 13.0 GiB T0_16 cap, with explicit TECHNICAL_SPEC.md process-RSS vs unified-memory distinction), and Cost/Sovereignty (#4: $0 marginal API cost, zero data egress).
…50 (96.0%) in 26.34s/task (G1.3 CLOSED)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary — SwapOS 16 GB-Tier SOTA Breakthrough: 48/50 (100% Frontier Parity) in 26.34 s/Task (
G1.3CLOSED,SWAP-05–SWAP-13)Goals & Four Numbers Moved
G1.2,G1.3(CLOSED),G1.5,G2.1,G2.2,G3.1,G3.3,G3.4,G4.4,G5.1,G5.2deepseek-v4-pro(48/50) on an Apple M4 MacBook Air (bugfix16/17,feature16/17,refactor16/16 = 100.0%;pass@1 = 43/50+ +5 cross-familyGemma-4-12Bcritic rescues; failed:bugfix-08,feature-08). Exact two-sided McNemarp = 1.000vs canonical symmetric API (b=0, c=0, identical task-by-task pass/fail set) and vs single-shot API (b=1, c=1);pass@1vs single-shot APIp = 0.0625(b=5, c=0).G1.3CLOSED):mean_wall_clock_s = 26.34 s(1.37×the19.26 sfrontier API single-shot mean, strictly below the pre-registered38.52 s2.0×G1.3bar;median = 14.88 s, suite wall1317.4 s=21.96 min).99/120model phases (82.5%) paid0.000 sload via--session-lruvirtual-memory frame residency (mean_load_s = 0.914 s < 1.5 sG2.1bar;mean_evict_s = 0.000 s).swapos-v1completed under the 16 GB-tier per-process cap (T0_16,SWAPOS_MEMORY_CAP_GB=13.0GiB) atpeak_rss_kb = 13,106,032 KB(12.50 GiB/13.11 GBdecimal) — inside the13.0 GiBMemoryBudgetGuardbudget and well below the20 GBG1.5ceiling (retaining theTECHNICAL_SPEC.mddistinction betweenllama-serverprocess RSS and system-wide macOSvm_stat/ unified memory).$0marginal API cost and zero data egress (100% local inference vs$0.15single-shot /$0.25–$0.45symmetric API suite).Why
Raw
/completionprompts, unstripped thought prefixes (<|channel>thought...<channel|>/<think>...</think>), stateless retry prompts, and per-task engine teardown previously left M4 Airswapos-v1at47/50and95.18 s/task(G1.3open). Combining native chat-template role separation, thought-tag hygiene before bounded slicing, KV-prefix-safe Capsule retry memory (ADR-0010), role token budgets (512/320), and--session-lrucross-task specialist residency unlocked exact48/50frontier parity while cutting mean task wall-clock by3.61×(95.18 s → 26.34 s).What Changed
SWAP-05–SWAP-13contracts andADR-0007throughADR-0010(docs/adr/0010-chat-templates-session-lru-and-capsule-retry.md).SWAP-05–SWAP-08,SWAP-13A):UnifiedMemorySampler+MemoryBudgetGuard+open_nocache,ModelSpec(--flash-attn on,-ctk/-ctv q8_0,--reasoning-budget 0, draft flags), native/v1/chat/completionsstreaming with thought-block stripping, spec-aware active-slot reuse inPrefetchEngine,MlxBackend, and declarativehardware/models.yaml(sota-16gb-turbo,sota-16gb-hetero,edge-8gb-sota,t0-24gb-cert).SWAP-09,SWAP-13B): Capsule0.2.0+--output-mode patch,clean_thinking_text(), KV-prefix-preserving Capsule retry memory (prior_candidate,test_output_tail,prior_decisions),--reason-max-tokens/--critic-max-tokens,--session-lru, and--turbo(scoped cleanly per run).SWAP-10–SWAP-13C): Pre-registeredSWE-bench Verified-50&LiveCodeBench-50adapters, committed M4 Air full-50 results (pipeline-m4-16gb-a3b-gemma4-full50.json@6dbe3b7andpipeline-m4-16gb-turbo-full50.json@7ea480e+ memory CSVs), updateddocs/four-number-proof.md,STATE.md, and deterministicsite/build_site.py+site/index.htmlwith JSON-asserted parity, latency, residency, and McNemar invariants.How Tested
/Users/matt/swapos-venv/bin/python -m pytest -q capsule/tests benchmarks/harness/tests pipeline/tests runtime/tests benchmarks/external/tests→120 passed./Users/matt/swapos-venv/bin/python site/build_site.pysucceeds and produces byte-identicalsite/index.htmlacross repeated runs with all JSON-parsed invariants passing.validate_tasks.py --tasks-dir benchmarks/tasks→structural OK: 50 tasks;git diff --exit-code benchmarks/tasks benchmarks/harness/grader.py benchmarks/harness/run_baseline.py→ exit0.sota-16gb-turbo,7ea480e):48/50 (96.0%),pass@1 = 43/50(+5critic rescues),mean_wall_clock_s = 26.34 s(1.37×API —G1.3CLOSED),99/120zero-load phases (mean_load_s = 0.914 s),peak_rss_kb = 13,106,032 KB(12.50 GiB/13.11 GBdecimal).