Activate Strata 0.1.52 and record verified tuning and quality results

This commit is contained in:
Mikei386 committed 2026-10-28 11:53:38 +01:00
1 parent 745ee0700e
commit ef7820d571
42 files changed
+37984 -6

No files matched your search

+20 -2
View File
@@ -1,4 +1,4 @@
# Athena Deck: specialist handoff · 27 October 2026
# Athena Deck: specialist handoff · 28 October 2026
Start here before working on Michael's Athena server or Athena Deck. This is a
curated project handoff, not imported chat history. Read applicable `AGENTS.md`,
@@ -23,7 +23,25 @@ keys, obtain broad admin tokens from another service or invent a dashboard login
Management UI sessions and API access have different authority. A missing idle
counter is not proof of idle. Read the documented authenticated drain semantics.
## Verified Strata and hardware snapshot
## Latest completed Strata update · 28 October 2026
Strata v0.2.7 / engine 0.1.52, pinned
`5e8a4cca7d690ac60ca37eb09e7d0e010099ad6d`, is activated after Michael's Go.
The original Qwen dual profile is loaded and tested; GPU order/split16, two
262144-token slots and protected user settings remain unchanged. TTS/STT are
loaded, Deck/API healthy and owned test containers gone. Qwen must remain loaded
again; this completed maintenance Go is not permission for later restarts/tests.
37 arms screened, 36 completed after correcting an invalid prefill-pipe argument.
Focused repeated/64K/128K/near-256K/cache/arrival checks passed. Pipeline without
batch-MTP is the tested tuning recommendation, **not automatically applied**;
production retains batch-groups1. Quality: 120 actual answers, blind scored;
24 isolated fixed code tests passed, with remaining semantic/diagnostic caveats.
[Full result and evidence](maintenance/strata-027-staged-2026-10-27/RESULTS.md).
Native full fresh-host/restore acceptance remains open; DeepSeek/vision only
built and version/hash checked, not model-tested during this update.
## Earlier verified Strata and hardware snapshot
Checked read-only at setup on 27 October 2026:
+18
View File
@@ -1,3 +1,21 @@
## 28.10.2026 · Strata v0.2.7 / Engine0.1.52 active; original Qwen restored
Pinned 5e8a4cca7d690ac60ca37eb09e7d0e010099ad6d, native SM86/SM120 builds and
CPU vision verified. Original app/TTS base preserved in a recipe-only image.
37 variants screened, 36 complete after a corrected test-argument retry; the
unmodified vendor arm failed its fresh-context stream. Focused reference versus
pipeline-without-batch-MTP follow-up passed all16 trials. Three-run short-pair
median14.494→11.916s; cached8K pair15.341→12.467s. Fresh64K pair90.443→69.956s
in one matched new-version comparison.128K pair/cache and near256K retrieval pass.
120 actual quality answers: reference53/60 core successes, pipeline56/60; one
blind assessor, no demonstrated broad quality gain.24/24 fixed code tests pass,
but two functions retain a manually identified list-versus-tuple defect.
Original production Qwen profile is loaded/tested, batch-groups1 retained;
tuning recommendation not automatically applied. Protected settings unchanged,
TTS/STT loaded, Deck/API healthy, no owned test containers. No old-engine inference.
Fresh-host native restore and DeepSeek/vision model acceptance remain separate.
[Results, evidence, caveats and reproduction](maintenance/strata-027-staged-2026-10-27/RESULTS.md).
## 26.10.2026 · DeepSeek0.1.51 / IQ2_XXS: one64K test completed, Qwen restored
64,487input/128output tokens, six experts, both GPUs. Prefill142.3tok/s,
@@ -0,0 +1,141 @@
# Strata v0.2.7 / Engine 0.1.52 · Athena maintenance and tuning
**Completed and production-restored on 28 October 2026.**
[Results, recommendation, quality assessment and limits](RESULTS.md).
## Authority and comparison policy
Michael authorized the isolated build, then explicitly approved replacement and
new-version inference tests. He renewed the completion request after the native
WireGuard repair. **No old-version inference is allowed**: previous benchmark
values come from [historical.json](historical.json), with their original fixture,
hardware, resident-budget and cache caveats. This is not a controlled release A/B.
Pinned upstream release: `v0.2.7`, commit
`5e8a4cca7d690ac60ca37eb09e7d0e010099ad6d`, engine `0.1.52`.
No quantization, weights, TTS candidate, driver or GPU-unlock change is included.
## Verified build and preparation
- Separate Qwen and DeepSeek builds for CUDA SM86 and SM120; CPU vision built.
- Binary versions, artifact hashes, exact source commit, tracked-source
cleanliness, both CMake architecture caches, loader dependencies and server
help checked by [verify_candidate.py](verify_candidate.py).
- No `cuobjdump` evidence was produced: architecture cache checks are not direct
fatbinary inspection.
- Existing model weights, PLE, MTP and expert packs are reused.
- Recipe-only image was based on the **actual** live
`athena-deck-standalone:tts-alias-20261027`, not a historical app image.
- [matrix.py](matrix.py) declares 37 screening variants, including GPU order,
layer splits, one-card/one-slot cases, batching/MTP, reserves, CPU placement,
prefill, PCIe/adaptation and separate quality-changing modes.
- Synthetic 64K/256K fixtures and 20 fixed quality tasks are reused. The test
template contains only allowlisted fields, no inherited API key. Each isolated
test worker receives a fresh local ephemeral token.
## Completed maintenance execution
The operator's existing authenticated browser session and the managed Athena
API identity have different roles. The browser's normal management API was used
for graceful admission stop; the managed API key is used only for its permitted
status/inference routes and is passed over SSH stdin, never argv or Git.
Before draining, the authenticated endpoint reported all of the following:
`active_requests=0`, scheduler `active_requests=0`, `waiting_requests=0`,
`tts_waiting_requests=0`, `switching=false`. Other queried work did not report
running jobs. After the ordinary endpoint stop, `state=stopped`, all counters
remained zero, the production Strata worker was absent and both GPUs had no
compute processes. No admitted or queued production work was forcibly ended.
[activate.py](activate.py) swaps the verified **native runtime filesystem**
without a Docker dependency in its `promote_runtime()` operation. The existing
private CUDA toolkit and learned expert profile are preserved. The old source
is retained by rename under the staging directory for recovery, not re-run or
benchmarked. User profiles, audio policy and CPU partition are hash-protected.
The current app image stays unchanged during isolated tests. Its prepared
recipe-only replacement and original endpoint autostart preference are handed
off only in the final restoration step; no admin session is fabricated.
**Current acceptance boundary:** all 37 screening variants have been attempted;
36 completed successfully. The unmodified provider-default arm failed. An
initial malformed `prefill-pipe` invocation has been corrected and successfully
repeated; its original failed evidence remains intact. Pipeline without batch
MTP is the balanced-screen finalist. Only this finalist and the new-engine
reference received the focused repeated, long/cache/arrival and quality checks.
All 16 follow-up trials completed, with 120 quality answers scored before
unblinding and 24 generated-code answers actually executed in isolated sandboxes.
No additional combinations or provider calibration runs were opened. The
recipe-only image handoff is complete; the original production Qwen profile is
loaded and model-tested, user settings hashes match, TTS/STT are loaded and no
owned test containers remain. The tuning finalist was not automatically applied.
### Pilot instrumentation finding
The first pilot measured correct stream/backend timings but counted CPU and I/O
only through the Python server's main-thread children. The engine is spawned
from another thread. The new ancestry walk follows **every thread's children**;
its regression test first failed, then passed with the fix. The first pilot is
retained but excluded from ranking by [report.py](report.py). The corrected
reference run actually measured roughly four logical CPU-equivalents, rather
than the misleading near-zero Python-parent value. That utilization figure is
not a count of distinct physical cores.
### Unmodified provider defaults
This is a distinct arm, not quietly substituted with Deck settings. Its first
screen chose layer split 20 and enabled residency-biased routing on the 3060.
The worker reported only **26 MiB free on the 5080** after loading. Short solo
and pair cases completed, but the fresh-context stream failed. This arm is
therefore not a valid performance winner. A generic server diagnostic suggests
memory exhaustion, but the precise cause is not established by that text alone.
Any later safety-reserve adjustment must be explicitly labelled, not presented
as unmodified vendor defaults.
### Corrected prefill-pipe invocation
The fixed upstream CLI requires `--prefill-pipe R`, not a boolean switch.
The initial invocation omitted R and printed usage; this was a test-harness
error, not evidence of an unstable feature. The regression test first failed,
then passed after correcting both value insertion and removal. The replacement
run uses R=1 (evening the existing chunk count), completes all screening cases,
and does not displace the chosen pipeline finalist. Other R values and the
upstream calibration helper remain unmeasured, not implicitly optimized.
## Execution environments and records
| Component | Actual execution environment |
| --- | --- |
| `operator_transport.py`, `sweep.py` | This NAS Hermes profile; `PYTHONPATH=/opt/hermes /opt/hermes/.venv/bin/python`. Reuses the existing profile-scoped managed Athena route; does not install into or change Hermes. |
| `activate.py`, `host_support.py`, `run_tests.py`, `prepare*.py`, `verify_candidate.py` | Athena host Python, staged at `/opt/athena-deck-dev/strata-027-preparation-20261027/`. |
| `engine_test.py`, `matrix.py`, fixed helper/fixtures | Owned isolated test container, UID/GID 65534, read-only runtime/model inputs, network disabled, 59 GiB memory/no extra swap, 12-CPU quota, owned output directory only. |
| Native Strata binaries/server | Pinned native runtime and private CUDA toolkit; optional current container is a transport, not a native product prerequisite. |
Host state and real results:
- `/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/activation-result.json`
- `/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/verification.json`
- `/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/`
- NAS sweep journal:
`/opt/data/profiles/athena-deck/cache/scratch/strata-027-review/screen-sweep-20261028.json`
[run_tests.py](run_tests.py) refuses an old runtime commit, unknown/draining
production state, an existing production worker or foreign GPU compute. It
continually checks the maintenance window, host RAM/swap and its own deadline,
and may stop only its verified owned test container. Failures remain failures;
[sweep.py](sweep.py) records every attempted arm, not just successful ones.
## Native install, update and restore limits
The shared source pin in `strata_sources.json` is the native installer/restore
input. Preserve the dependencies, explicit state/model paths, toolkit sources
and driver requirements in [STRATA_NATIVE.md](../../../deploy/STRATA_NATIVE.md).
A fresh Debian restore must rebuild Qwen/DeepSeek and CPU vision from the fixed
source and lock recipes, re-fetch public original weights by their fixed
revision/hash, rebuild expert/MTP packs and restore private settings/identities
from the protected restore package. No weights, private files or keys belong in
Git. The old runtime remains a recovery input until acceptance; switching back
requires another drained operational handoff, never a concurrent old/new worker.
Neither the current container handoff nor these model tests establish a complete
fresh-host native installation or encrypted end-to-end restore acceptance. That
product requirement remains open; no host reboot or migration is authorized here.
@@ -0,0 +1,191 @@
# Strata v0.2.7 / Engine 0.1.52: Ergebnis und Abnahme
**28. Oktober 2026 · Update produktiv abgeschlossen.** Qwen ist wieder geladen,
Deck und API sind gesund. Die bisherigen Profile, Endpunkt-, Audio-, CPU- und
Reasoning-Einstellungen sind bytegleich zum Zustand vor dem Wartungsfenster.
TTS und STT sind wieder geladen. Keine Testcontainer bleiben zurück.
**Getesteter Favorit:** bisherige GPU-Reihenfolge 3060 → 5080 und Layer-Split 16
beibehalten, zwei Pipeline-Gruppen automatisch wählen lassen, **Batch-MTP aus**.
Das ist keine Empfehlung, MTP auch bei Einzelanfragen generell abzuschalten.
Die getestete Variante verwendet dort weiterhin den vorhandenen Solo-MTP-Pfad.
**Diese Optimierung wurde nicht automatisch produktiv übernommen.** Das
wiederhergestellte Qwen-Profil verwendet weiterhin `--batch-groups 1` und seine
bisherigen Parameter; nur die neue Engine und deren gepinntes Rezept sind aktiv.
Für eine dauerhafte Übernahme des Favoriten ist ein gesondertes Go erforderlich.
## Vergleich innerhalb der neuen Engine
Referenz = bisheriges Deck-Profil auf **derselben neuen Engine 0.1.52**.
IQ3_XXS, unveränderte Gewichte, zwei Slots à 262144, int8-KV mit 32768
GPU-residenten Tokens, 1024 MiB Reserve auf beiden GPUs, bisherige CPU-Aufteilung,
59 GiB Containerlimit. Residency-Bias ist im qualifizierten Profil explizit aus
(`STRATA_ROUTE_PRIOR=0`); Tail-Skip bleibt 0.
Zeiten enthalten die eigentliche Anfrage, **nicht** den Modellstart von jeweils
ungefähr 71 Sekunden. Die kurzen Fälle wurden je dreimal mit frischen Prozessen
und verschachtelter Referenz-/Finalisten-Reihenfolge geprüft; Tabelle = Median.
Die langen Fälle wurden je einmal geprüft, nicht als wiederholte Serien verkauft.
| Lastfall | Neue Referenz | Pipeline ohne Batch-MTP | Weniger Zeit | Läufe je Variante |
|---|---:|---:|---:|---:|
| Einzelanfrage, 512 Ausgabetokens | 8,780 s | 8,656 s | 1,42 % | 3 |
| Zwei kurze Anfragen, je 512 Ausgabetokens | 14,494 s | **11,916 s** | **17,79 %** | 3 |
| Zwei frische 8K-Kontexte, je 256 Ausgabetokens | 20,014 s | **18,711 s** | **6,51 %** | 3 |
| Zwei gecachte 8K-Folgeturns, je 512 Ausgabetokens | 15,341 s | **12,467 s** | **18,74 %** | 3 |
| Zwei frische 64K-Kontexte, je 256 Ausgabetokens | 90,443 s | **69,956 s** | **22,65 %** | 1 |
| Einzelanfrage mit 261114 Eingabe-/256 Ausgabetokens | 141,908 s | 136,322 s | 3,94 % | 1 |
Bei Einzelanfragen ist kein belastbarer großer Gewinn erkennbar. Der klare
Vorteil liegt in den hier geprüften **parallelen** Lastfällen. Das ist der beste
vertieft geprüfte Kandidat dieses Suchlaufs, kein bewiesenes globales Optimum.
### Cache und größere Kontexte
- **64K:** drei Folgeturns je Variante vollständig. Referenz: 17,92 / 18,35 /
13,86 s; Pipeline: 13,15 / 14,05 / 12,75 s. Der erste Folgeturn verwendete
65770 bzw. 65773 Cache-Tokens, spätere entsprechend mehr.
- Im dritten 64K-Folgeturn endete eine Ausgabe regulär früher: Referenz
229+512, Pipeline 254+512 Ausgabetokens. Dieser Turn ist deshalb **kein**
exakt gleich langer Outputvergleich. Die kurzen Tabellenfälle und der
frische 64K-Fall erreichten dagegen in beiden Varianten dieselben Tokenzahlen.
- **128K-Paar, Pipeline:** 131072 und 131075 Eingabetokens, 133,85 s für das
frische Paar. Drei Folgeturns: 15,78 / 14,92 / 15,71 s. Große Präfixe wurden
wiederverwendet; ein späterer Turn musste einen kleinen zusätzlichen Abschnitt
neu lesen. Keine Behauptung stets vollständig identischer Präfixnutzung.
- **Nahe 256K, beide Varianten:** 261114 Eingabetokens, 256 Ausgabetokens,
frischer Kontext, jeweils **3/3 Suchmarken gefunden**. Referenz meldete
1903,0 Prefill-/56,1 Decode-Token/s; Pipeline 1981,9 / 57,8. Einzelmessungen.
- **Ankunftstest:** Während einer laufenden Ausgabe wurde ein frischer
65518-Token-Prompt zugelassen. Beide Streams vollständig; die erste Ausgabe
brauchte 61,55 s für 2048 Tokens, der neue lange Request 36,95 s einschließlich
32,17 s bis zum ersten Text. Es gibt hierfür keinen paarigen Referenzlauf und
keinen Nachweis unterbrechungsfreier Echtzeitgenerierung.
Backend-Phasenraten sind separat in den Rohdaten enthalten. Bei paralleler
Verarbeitung können die berichteten Decode-Zeitspannen auch Wartezeit neben
einem anderen Prefill enthalten. Deshalb werden Paar-Wallzeiten verwendet und
nicht die beiden Backend-Raten als angebliche Gesamtrate addiert.
## Suchumfang und Fehler
**37 Konfigurationsvarianten versucht, 36 erfolgreich abgeschlossen.** Darunter
GPU-Splits 8/12/16/20/24/28/32/auto, umgekehrte GPU-Reihenfolge, nur 5080,
Single-Slot, Pipeline/MTP, CPU-Pool, PCIe-Anteil, Prefill und Reserven.
[Alle erfolgreichen Varianten als CSV](evidence/screen-table.csv) und
[strukturierte Auswertung](evidence/screen-analysis.json).
- Nur die 5080 war beim frischen 8K-Paar schneller, aber bei Ausgabe und
gecachten Folgeturns deutlich schlechter. Sie ist kein allgemeiner Gewinner.
- Andere GPU-Splits verdrängten Split 16 im ausgewogenen Screening nicht.
- Sechs statt vier physische Strata-Kerne brachten im Screening einen kleineren
Vorteil als der Pipeline-Favorit. Ein paralleler TTS-Lasttest wurde **nicht**
beauftragt oder ausgeführt; die bestehende Audio-CPU-Zuordnung blieb erhalten.
- **Unveränderte Anbieterdefaults:** automatische Aufteilung wählte Split 20;
Residency-Bias war auf der 3060 aktiv. Nach dem Laden wurden nur **26 MiB
freier VRAM auf der 5080** gemeldet. Kurze Fälle liefen, der frische
Kontextstream scheiterte. Keine Empfehlung. Eine allgemeine Servermeldung
nennt RAM-Mangel als typische Ursache, beweist hier aber keinen OOM-Kill.
- **Testskriptfehler, nicht Strata-Fehler:** `--prefill-pipe` wurde zunächst ohne
den erforderlichen Zahlenparameter aufgerufen. Mit R=1 korrigiert und
erfolgreich nachgeholt; der fehlerhafte Erstversuch bleibt dokumentiert.
- **Pilotmessung:** CPU-/I/O-Erfassung übersah zunächst den aus einem anderen
Python-Thread gestarteten Engine-Prozess. Der korrigierte Nachfahrenlauf
erfasst alle Threads. Regressionstest zuerst rot, danach grün. Der erste
Pilot bleibt erhalten, ist aber aus der Rangfolge ausgeschlossen.
Nach Michaels Kritik am Zeitaufwand wurde die Vertiefung bewusst auf **einen
Favoriten gegen die neue Referenz** begrenzt. Keine zusätzlichen Kombinationen
oder Anbieter-Kalibrierung ausgeführt. Die qualitätsändernden Routing-/KVA-Arme
wurden nur gescreent und sind **nicht vollständig qualifiziert oder empfohlen**.
## Qualität: 120 tatsächliche Antworten, blind bewertet
20 vorab vorhandene synthetische Aufgaben × drei Seeds × zwei Varianten.
Feste Rubrik: Fach-/Funktionsrichtigkeit 4, Anweisungstreue 2,
Belege/Unsicherheit 2, Deutsch 2. Die Identitäten wurden innerhalb dreier
balancierter Seed-Pakete zufällig anonym codiert, nicht dem Prüfer
angezeigt. Identische Antwort-/Werkzeugbefunde konnten dieselbe bereits
vergebene Bewertung erhalten. Alle 120 Antworten sind abgedeckt.
Die vollständige Bewertung wurde **vor Entblindung** gespeichert und gehasht:
`874984c54e8a49dbda146a0c3b8f5a8a1aa46fbbd8836f4fcafe8f768d3abc9e`.
[Unveränderte Blindbewertung](evidence/blind-assessment-all.json),
[Zusammenfassung](evidence/quality-summary.json) und
[Einzelantworten mit offengelegter Zuordnung](evidence/quality-scored-answers.json).
| Befund | Neue Referenz | Pipeline ohne Batch-MTP |
|---|---:|---:|
| Antworten | 60 | 60 |
| Kernerfolg nach manueller Rubrik | 53/60 | 56/60 |
| Mittlere Punktzahl /10 | 8,983 | 9,100 |
| Technische Fehler / abgebrochene Antworten | 0 | 0 |
| Tokenlimit-Abbrüche in der Qualitätssuite | 0 | 0 |
| Ungültige oder unerlaubte Mock-Werkzeugaufrufe | 0 | 0 |
**Kein erkennbarer Qualitätsnachteil des Favoriten in diesem kleinen Test; kein
bewiesener Qualitätsgewinn.** Nur ein subjektiver Prüfer, 20 unabhängige Aufgaben,
keine unabhängige Laborprüfung. Die Qualitätssuite läuft mit jeweils einer
aktiven Unterhaltung; sie beweist nicht umfassende semantische Gleichwertigkeit
aller parallelen CUDA-/Batchpfade oder seltener Langzeit-Agentenfehler.
Konkrete Grenzen bleiben sichtbar:
- Beide Varianten stellten bei der cgroup-Diagnose Reclaim/Swap zu sicher als
belegte Latenzursache dar und schlugen ungefragt Limiterhöhungen vor.
- Mehrere Referenzantworten erfanden einen zusätzlichen bestätigten
Proxy-Testbefund. Die korrekte Hauptdiagnose macht erfundene Belege nicht richtig.
- Einzelne Grammatik-/Sprachfehler bleiben, z. B. `umleitet`, `korregte`,
`Loglesen wanted` oder `longer TLB-flushes`.
- **24/24 generierte Codeantworten bestanden die vorab festgelegten Tests** in
tatsächlichen kurzlebigen Containern: ohne Netzwerk, GPUs oder Host-Mounts,
read-only, UID 65534, Speicher-/CPU-/PID-Limits; Container danach entfernt.
Trotzdem gab es bei zwei Intervallfunktionen einen manuell erkannten Fehler:
Ein erstes, nicht verschmolzenes Listenintervall bleibt Liste statt Tupel.
Die festen Tests verwenden Tupel. Dieser Abzug stammt aus der zusätzlich
offengelegten Codeprüfung, nicht aus angeblich vorab festgelegten Tests.
- Werkzeuge lieferten ausschließlich simulierte Daten. Keine echten Dienste,
Fahrpläne oder MCP-Aktionen wurden durch die Qualitätssuite ausgeführt.
## Historische Orientierung, kein Altversionslauf
| Dokumentierter alter Befund | Heutige Messung | Grenze |
|---|---|---|
| 64K-Paar, Engine 0.1.45: 96,57 s | Neue Referenz 90,44 s; Pipeline 69,96 s | Damals 24,46 GiB residente Experten/58 GiB Limit; heute ungefähr 30,5–30,6 GiB/59 GiB sowie andere Software-/Hardwarestände |
| Gecachtes 64K-Paar 0.1.45: 17,56 s | Erster neuer Folgeturn 17,92 / 13,15 s | Einzelne historische Messung; adaptive Platzierung und Ausgaben variieren |
| Nahe 256K, Engine 0.1.51: 1891,2 Prefill-/52,4 Decode-Token/s | Neue Referenz 1903,0 / 56,1; Pipeline 1981,9 / 57,8 | Je ein Lauf, kein kontrollierter Versions-A/B-Test |
**Keine Inferenz mit der alten Engine ausgeführt**, auch kein neuer Warmup oder
Altversions-Restorationstest. Quellen und weitere Bedingungen:
[historical.json](historical.json).
## Betrieb, Reproduktion und offene Abnahme
- Engine-Commit: `5e8a4cca7d690ac60ca37eb09e7d0e010099ad6d`.
- Beide nativen Engines 0.1.52 für SM86/SM120 und CPU-Vision gebaut und
versions-/hash-/linkagegeprüft. **DeepSeek und Bildinferenz wurden bei diesem
Update nicht modellgetestet.** Kein direkter Fatbinary-Nachweis per cuobjdump.
- Aktives Rezept-Image wurde ausschließlich aus dem tatsächlich laufenden
`tts-alias-20261027`-Appstand abgeleitet. Keine neue TTS-Kandidatenaktivierung,
keine Gewichts-, Treiber-, Host-Neustart- oder GPU-Unlock-Änderung.
- Referenz/Finalist: keine gemessenen OOM-Kills oder Limit-Ereignisse in den
verglichenen Fällen. Größte dort erfasste cgroup-Speicherbelegung 51,434 bzw.
51,010 GiB; kein 24-Stunden-Stabilitätsnachweis.
- Getestet wurden zwei 128K-Kontexte und ein nahezu voller 262K-Kontext,
**nicht** zwei gleichzeitig vollständig gefüllte 262K-Kontexte.
- Alte Runtime-Quelldateien sind für eine kontrollierte Wiederherstellung in
der Staging-Ablage erhalten; keine alte Engine läuft parallel. Build- und
Vorbereitungsnachweise beschreiben ihren damaligen unaktivierten Zustand.
Maßgeblich für die abgeschlossene Aktivierung ist
[activation.json](evidence/activation.json); der gebaute Kandidatenquellbaum
wurde an seinen nativen Produktivpfad verschoben und ist nicht mehr separat
am ursprünglichen Kandidatenpfad ausführbar.
- Native Voraussetzungen, gepinnte Quellen/Abhängigkeiten, öffentliche Modelle
und private Restore-Daten: [STRATA_NATIVE.md](../../../deploy/STRATA_NATIVE.md).
Die Containerprüfung ersetzt **keine** komplette frische Debian-Installation
mit verschlüsseltem Ende-zu-Ende-Restore. Diese Abnahme bleibt offen.
[Ausführungsumgebungen und Skripte](README.md) ·
[55 tatsächliche Laufdatensätze einschließlich verworfener Versuche](evidence/runs.json) ·
[Reproduzierbarer vertiefter Plan](evidence/focused-followup-plan.json).
@@ -0,0 +1,257 @@
"""Athena host operations for an explicitly approved Strata 0.1.52 maintenance window.
The native runtime swap does not depend on Docker. This site's image handoff is
separate and performed only after tests, using the actual current application.
No password/session fabrication, model requests, VPN access or model downloads.
"""
import argparse
import hashlib
import importlib.util
import json
import os
from pathlib import Path
import shutil
import subprocess
import sys
import time
import urllib.request
import host_support as host
import matrix
OLD_COMMIT = '4b9e05a2a806a3fe24f7b2560d98626c37dade35'
RECORD = host.STAGE / 'activation-result.json'
def digest(path):
with Path(path).open('rb') as stream:
return hashlib.file_digest(stream, 'sha256').hexdigest()
def save(record, phase):
record.update(phase=phase, updated_at=time.time())
RECORD.write_text(json.dumps(record, indent=2) + '\n')
RECORD.chmod(0o600)
print(json.dumps({'phase': phase, 'release': 'v0.2.7'}), flush=True)
def prepare():
if RECORD.exists():
raise RuntimeError('Existing activation record: inspect rather than overwrite it')
manifest, info = host.installed()
prepared = json.loads((host.STAGE / 'prepared-image.json').read_text())
verified = json.loads((host.STAGE / 'verification.json').read_text())
candidate = host.STAGE / 'runtime'
built = json.loads((candidate / 'candidate-status.json').read_text())
assert built['state'] == 'built' and built['commit'] == matrix.COMMIT
assert verified['build_verified'] is True and verified['commit'] == matrix.COMMIT
assert prepared['base_image_id'] == info['Image']
assert prepared['base_image'] == manifest['image']
assert prepared['commit'] == matrix.COMMIT
assert json.loads((host.STATE / 'strata-runtime/ready.json').read_text())['commit'] == OLD_COMMIT
previous = host.STATE / 'strata-runtime/source'
previous_git = ['git', '-c', 'safe.directory=' + str(previous), '-C', str(previous)]
assert subprocess.check_output(previous_git + ['rev-parse', 'HEAD'], text=True).strip() == OLD_COMMIT
assert not subprocess.check_output(previous_git + ['status', '--porcelain', '--untracked-files=no'], text=True).strip()
for name, expected in verified['artifacts'].items():
assert digest(candidate / 'source/engine' / name) == expected, name
source = candidate / 'source'
git = ['git', '-c', 'safe.directory=' + str(source), '-C', str(source)]
assert subprocess.check_output(git + ['rev-parse', 'HEAD'], text=True).strip() == matrix.COMMIT
assert not subprocess.check_output(git + ['status', '--porcelain', '--untracked-files=no'], text=True).strip()
worker = json.loads((host.STATE / 'strata-worker/worker.json').read_text())
endpoint = host.STATE / 'endpoint.json'
record = dict(release='v0.2.7', version=matrix.VERSION, commit=matrix.COMMIT,
previous_commit=OLD_COMMIT, previous_image=info['Config']['Image'],
previous_image_id=info['Image'], prepared_image=prepared['image'],
prepared_image_id=prepared['image_id'], settings_before=host.settings_hashes(),
endpoint_autostart_before=json.loads(endpoint.read_text())['autostart'],
worker_before={k: worker.get(k) for k in
('model_name', 'gpu', 'gpu_order', 'layer_split', 'parallel')},
runtime_updated=False, image_activated=False, inference_performed=False)
save(record, 'prepared; awaiting authenticated endpoint drain')
def promote_runtime(candidate, runtime, retained):
"""Native filesystem operation; caller must establish stopped/drained ownership."""
if retained.exists():
raise RuntimeError('Prior retained source exists; no destructive retry')
previous = runtime / 'source'
for name in ('ready.json', 'compile-pools.cmake', 'deepseek-build.json'):
assert (candidate / name).is_file(), name
# Keep learned expert placement, never replace it with a build-time default.
learned = previous / 'data/expert-profile.bin'
if learned.is_file():
target = candidate / 'source/data/expert-profile.bin'
target.parent.mkdir(parents=True, exist_ok=True)
shutil.copy2(learned, target)
previous.rename(retained)
try:
(candidate / 'source').rename(previous)
except BaseException:
retained.rename(previous)
raise
for name in ('ready.json', 'compile-pools.cmake', 'deepseek-build.json'):
shutil.copy2(candidate / name, runtime / name)
os.chown(runtime / name, 65534, 65534)
vision = runtime / 'vision-ready.json'
if vision.is_file():
value = json.loads(vision.read_text())
value['code'] = matrix.COMMIT
vision.write_text(json.dumps(value, indent=2))
os.chown(vision, 65534, 65534)
def promote(key):
record = json.loads(RECORD.read_text())
assert record['phase'] == 'prepared; awaiting authenticated endpoint drain'
manifest, info = host.installed()
assert info['Image'] == record['previous_image_id']
host.assert_drained(key)
time.sleep(2)
host.assert_drained(key)
current = host.settings_hashes()
assert all(current[k] == v for k, v in record['settings_before'].items() if k != 'endpoint.json')
record['settings_during_tests'] = current
save(record, 'drained; swapping native runtime with old source retained for recovery')
promote_runtime(host.STAGE / 'runtime', host.STATE / 'strata-runtime', host.STAGE / 'previous-source')
for name, expected in json.loads((host.STAGE / 'verification.json').read_text())['artifacts'].items():
assert digest(host.STATE / 'strata-runtime/source/engine' / name) == expected
record['runtime_updated'] = True
save(record, 'native runtime updated; endpoint stopped; tests may run; image handoff pending')
def finalize(key):
record = json.loads(RECORD.read_text())
assert record['runtime_updated'] is True and record['image_activated'] is False
assert host.settings_hashes() == record['settings_during_tests'], 'User settings changed; do not overwrite'
host.assert_drained(key)
manifest, info = host.installed()
assert info['Image'] == record['previous_image_id']
assert json.loads((host.STATE / 'strata-runtime/ready.json').read_text())['commit'] == matrix.COMMIT
# Public model markers must follow the engine pin to avoid needless repacking.
recipe_path = host.STAGE / 'image-recipe/strata_sources.json'
recipe = json.loads(recipe_path.read_text())
canonical = Path('/opt/athena-deck-dev/source/strata_sources.json')
expected_previous = json.loads(json.dumps(recipe))
expected_previous.update(code=record['previous_commit'], version='0.1.51')
expected_previous['performance']['IQ3_XXS']['environment'].pop('STRATA_ROUTE_PRIOR', None)
assert json.loads(canonical.read_text()) == expected_previous, 'Canonical recipe changed; preserve concurrent work'
storage = host.safe_storage(manifest['strata_storage'])
for quant, entry in recipe['models'].items():
marker = storage / 'models' / quant / 'prepared.json'
if not marker.is_file():
continue
value = json.loads(marker.read_text())
assert value['sha256'] == entry['sha256']
assert (storage / value['native']).stat().st_size == entry['size']
assert (storage / value['ple']).stat().st_size == recipe['ple']['size']
assert (storage / value['pack'] / 'experts.bin').is_file()
value['commit'] = matrix.COMMIT
marker.write_text(json.dumps(value))
os.chown(marker, 65534, 65534)
image_id = subprocess.check_output(['docker', 'image', 'inspect', '--format', '{{.Id}}', record['prepared_image']], text=True).strip()
assert image_id == record['prepared_image_id']
spec = importlib.util.spec_from_file_location('deck_install', '/opt/athena-deck-dev/source/deploy/install.py')
installer = importlib.util.module_from_spec(spec)
spec.loader.exec_module(installer)
assert installer.owned(manifest['name'], host.BASE)['State']['Running']
record['counts_before_image_handoff'] = host.status(key)['endpoint']['counts']
save(record, 'tests finished; handing off recipe image and restoring endpoint preference')
# The endpoint remains stopped in memory until the approved app recreation.
# Restore only our own temporary autostart change, not a fabricated admin session.
endpoint = host.STATE / 'endpoint.json'
value = json.loads(endpoint.read_text())
value['autostart'] = record['endpoint_autostart_before']
endpoint.write_text(json.dumps(value, indent=2))
os.chown(endpoint, 65534, 65534)
subprocess.run(['docker', 'stop', '--time', '45', manifest['name']], check=True)
subprocess.run(['docker', 'rm', manifest['name']], check=True)
manifest['image'] = record['prepared_image']
manifest.pop('previous_image', None)
installer.launch(manifest)
installer.ready(manifest)
installer.write_manifest(host.BASE, manifest)
shutil.copy2(recipe_path, canonical)
record['image_activated'] = True
record['settings_after'] = host.settings_hashes()
record['settings_unchanged'] = record['settings_after'] == record['settings_before']
record['container_health'] = json.loads(subprocess.check_output(['docker', 'inspect', manifest['name']], text=True))[0]['State'].get('Health', {}).get('Status')
save(record, 'recipe image activated; endpoint preference restored; Qwen inference verification required')
assert record['settings_unchanged'], 'Investigate settings hash mismatch without overwriting user changes'
def verify_restored(key):
record = json.loads(RECORD.read_text())
assert record['image_activated'] is True
assert json.loads((host.STATE / 'strata-runtime/ready.json').read_text())['commit'] == matrix.COMMIT
manifest, info = host.installed()
assert info['Image'] == record['prepared_image_id']
model = record['worker_before']['model_name']
marker = 'ATHENA_STRATA_027_OK'
body = dict(model=model, messages=[{'role': 'user', 'content': 'Antworte ausschließlich mit: ' + marker}],
max_tokens=64, temperature=0, seed=42, reasoning_effort='none',
stream=True, stream_options={'include_usage': True})
request = urllib.request.Request('http://127.0.0.1:8120/v1/chat/completions',
data=json.dumps(body).encode(), headers={'Authorization': 'Bearer ' + key,
'Content-Type': 'application/json'})
done, content, usage, timings = False, '', {}, {}
started = time.monotonic()
with urllib.request.urlopen(request, timeout=600) as response:
for line in response:
if not line.startswith(b'data:'):
continue
raw = line[5:].strip()
if raw == b'[DONE]':
done = True
break
value = json.loads(raw)
assert 'error' not in value
usage = value.get('usage') or usage
timings = value.get('timings') or value.get('backend_timings') or timings
content += ''.join(choice.get('delta', {}).get('content') or '' for choice in value.get('choices', []))
assert done and usage.get('completion_tokens', 0) > 0 and marker in content
worker = json.loads((host.STATE / 'strata-worker/worker.json').read_text())
assert all(worker.get(k) == v for k, v in record['worker_before'].items())
probe = "import json,sys,urllib.request;x=json.load(sys.stdin);r=urllib.request.Request('http://127.0.0.1:'+str(x['port'])+'/health',headers={'Authorization':'Bearer '+x['api_key']});d=json.load(urllib.request.urlopen(r,timeout=10));print(json.dumps({'status':d.get('status'),'loaded':d.get('loaded')}))"
health = json.loads(subprocess.check_output(['docker', 'exec', '-i', manifest['name'], 'python3', '-c', probe], input=json.dumps(worker), text=True))
assert health == {'status': 'ok', 'loaded': True}
record.update(inference_performed=True, restored_profile=model, restored_worker_health=health,
restoration_probe=dict(complete=True, marker_found=True, usage=usage, timings=timings,
wall_seconds_including_load=time.monotonic() - started),
settings_after=host.settings_hashes())
record['settings_unchanged'] = record['settings_before'] == record['settings_after']
assert record['settings_unchanged']
record['container_health'] = host.installed()[1]['State'].get('Health', {}).get('Status')
assert record['container_health'] == 'healthy'
deadline = time.monotonic() + 90
while True:
record['endpoint'] = host.status(key)['endpoint']
counts = record['endpoint']['counts']
before = record.get('counts_before_image_handoff', {})
audio_ready = all(not before.get(kind, {}).get('loaded') or counts.get(kind, {}).get('loaded')
for kind in ('tts', 'stt'))
if audio_ready or time.monotonic() >= deadline:
break
time.sleep(1)
record['previously_loaded_audio_restored'] = audio_ready
assert audio_ready, 'Previously loaded audio services did not return; no audio inference was forced'
assert record['endpoint']['state'] == 'running'
save(record, 'complete; recipe image active; original Qwen loaded and tested; user settings unchanged')
def main():
parser = argparse.ArgumentParser()
parser.add_argument('operation', choices=['prepare', 'promote', 'finalize', 'verify'])
parser.add_argument('--go', action='store_true')
options = parser.parse_args()
if not options.go:
parser.error('Explicit Michael Go required; nothing changed')
if options.operation == 'prepare':
prepare()
else:
key = json.load(sys.stdin)['key']
{'promote': promote, 'finalize': finalize, 'verify': verify_restored}[options.operation](key)
if __name__ == '__main__':
main()
@@ -0,0 +1,83 @@
"""Rank only real complete screen artifacts; no automatic production winner."""
import argparse
import json
import math
from pathlib import Path
import statistics
from typing import Any
import matrix
CASES = ('solo-short-0', 'parallel-short-0', 'parallel-cold-8192', 'parallel-cached-8192-turn0')
def analyze(data: dict[str, Any]) -> dict[str, Any]:
groups = {}
failed = []
excluded = []
for name, record in data['runs'].items():
provenance = record.get('result/provenance.json', {})
host = record.get('host-result.json', {})
if provenance.get('phase') != 'screen':
continue
arm = provenance['arm']
if not provenance.get('resource_accounting'):
excluded.append({'run': name, 'reason': 'pilot CPU/IO accounting incomplete'})
continue
if provenance.get('state') != 'complete' or host.get('failure') or host.get('settings_unchanged') is not True:
failed.append({'run': name, 'arm': arm['id'], 'reason': provenance.get('error') or host.get('failure') or 'incomplete'})
continue
rows = record.get('result/results.json', [])
if any(row['resources'].get('oom_kill_delta') for row in rows):
failed.append({'run': name, 'arm': arm['id'], 'reason': 'measured OOM kill'})
continue
key = '+'.join(arm.get('components', [arm['id']]))
group = groups.setdefault(key, {'arm': arm, 'runs': [], 'cases': {}})
group['runs'].append(name)
for row in rows:
group['cases'].setdefault(row['case'], []).append(row)
summarized = {}
for key, group in groups.items():
cases = {}
for case, rows in group['cases'].items():
cases[case] = dict(repeats=len(rows), median_wall_seconds=statistics.median(r['wall_seconds'] for r in rows),
backend_decode_tok_s_per_request=[[trial.get('backend_timings', {}).get('predicted_per_second') for trial in r['rows']] for r in rows],
backend_prefill_tok_s_per_request=[[trial.get('backend_timings', {}).get('prompt_per_second') for trial in r['rows']] for r in rows],
cpu_equivalent_cores=[r['resources']['cpu_cores'] for r in rows],
read_gib=[r['resources']['read_gib'] for r in rows],
peak_memory_gib=max(r['resources']['peak_memory_gib'] for r in rows),
cache_tokens=[[x['usage'].get('prompt_tokens_details', {}).get('cached_tokens') for x in r['rows']] for r in rows])
summarized[key] = dict(arm=group['arm'], runs=group['runs'], cases=cases)
baseline = summarized.get('deck-reference-new', {}).get('cases', {})
ranked = []
for key, result in summarized.items():
if result['arm']['slots'] != 2 or result['arm']['quality_tradeoff'] or not all(c in result['cases'] and c in baseline for c in CASES):
continue
ratios = [baseline[c]['median_wall_seconds'] / result['cases'][c]['median_wall_seconds'] for c in CASES]
ranked.append(dict(variant=key, balanced_screen_speed_ratio=math.prod(ratios) ** (1 / len(ratios))))
ranked.sort(key=lambda r: r['balanced_screen_speed_ratio'], reverse=True)
boards = {}
for case in CASES:
boards[case] = sorted([dict(variant=key, **{'median_wall_seconds': result['cases'][case]['median_wall_seconds']})
for key, result in summarized.items() if result['arm']['slots'] == 2 and not result['arm']['quality_tradeoff'] and case in result['cases']], key=lambda r: r['median_wall_seconds'])
attempted = {v.get('result/provenance.json', {}).get('arm', {}).get('id') for v in data['runs'].values() if v.get('host-result.json')}
expected = {row['id'] for row in matrix.arms()}
return dict(commit=matrix.COMMIT, expected_screen_arms=len(expected), attempted_screen_arms=len(expected & attempted),
missing_screen_arms=sorted(expected - attempted), complete_variants=summarized,
failed_runs=failed, excluded_pilot_runs=excluded,
balanced_finalist_selection=ranked, separate_workload_leaderboards=boards,
acceptance='Screening only; require repeated finalists, long/cache/arrival cases and quality. No automatic production setting change.')
def main():
parser = argparse.ArgumentParser()
parser.add_argument('evidence', type=Path)
parser.add_argument('--output', type=Path, required=True)
options = parser.parse_args()
result = analyze(json.loads(options.evidence.read_text()))
options.output.write_text(json.dumps(result, indent=2, ensure_ascii=False) + '\n')
assert json.loads(options.output.read_text()) == result
print(json.dumps({k: result[k] for k in ('attempted_screen_arms', 'expected_screen_arms', 'missing_screen_arms', 'balanced_finalist_selection')}, indent=2))
if __name__ == '__main__':
main()
@@ -0,0 +1,104 @@
"""Build the pinned candidate only; never loads a model or activates production."""
import hashlib
import json
import os
from pathlib import Path
import shutil
import subprocess
import time
COMMIT = '5e8a4cca7d690ac60ca37eb09e7d0e010099ad6d'
VERSION = '0.1.52'
ROOT = Path(os.environ.get('STRATA_CANDIDATE_ROOT', '/var/lib/deck/strata-runtime'))
RECIPE = Path(os.environ.get('STRATA_CANDIDATE_RECIPE', '/build'))
SOURCE = ROOT / 'source'
STATUS = ROOT / 'candidate-status.json'
LOG = ROOT / 'candidate-build.log'
STARTED = time.time()
def status(state, phase, **extra):
value = dict(state=state, phase=phase, release='v0.2.7', commit=COMMIT,
activated=False, inference_performed=False, started=STARTED,
updated=time.time(), **extra)
temporary = STATUS.with_suffix('.tmp')
temporary.write_text(json.dumps(value, indent=2) + '\n')
temporary.replace(STATUS)
def run(phase, command, env, cwd=None):
status('building', phase)
print(phase, flush=True)
with LOG.open('a') as output:
subprocess.run(list(map(str, command)), env=env, cwd=cwd,
stdout=output, stderr=subprocess.STDOUT, check=True)
def main():
(ROOT / 'home').mkdir(exist_ok=True)
cuda = ROOT / 'cuda'
env = dict(os.environ, CMAKE_TOOLCHAIN_FILE=str(ROOT / 'compile-pools.cmake'),
LD_LIBRARY_PATH=str(cuda / 'lib64') + ':' + str(cuda / 'lib') + ':' +
os.environ.get('LD_LIBRARY_PATH', ''), OPENBLAS_NUM_THREADS='1',
OMP_NUM_THREADS='1', CMAKE_BUILD_PARALLEL_LEVEL='1')
run('Qwen native engine: CUDA 13, SM86 and SM120',
['python3', RECIPE / 'deploy/install_strata.py', '--destination', ROOT,
'--nvcc', cuda / 'bin/nvcc', '--architectures', '86;120'], env)
python = SOURCE / '.venv/bin/python'
env['PATH'] = str(python.parent) + ':' + str(cuda / 'bin') + ':' + env['PATH']
tools = subprocess.check_output(
[python, '-c', 'import json,setup;print(json.dumps(list(map(str,setup.ensure_build_tools()))))'],
cwd=SOURCE, env=env, text=True).strip().splitlines()[-1]
cmake, ninja = json.loads(tools)
run('CPU vision configure',
[cmake, '-S', SOURCE / 'tools/vision', '-B', SOURCE / 'build-vision-cpu',
'-G', 'Ninja', '-DCMAKE_MAKE_PROGRAM=' + ninja, '-DCMAKE_BUILD_TYPE=Release',
'-DLLAMA_DIR=' + str(SOURCE / 'third_party/llama.cpp'),
'-DSTRATA_VISION_CUDA=OFF', '-DSTRATA_PORTABLE=ON'], env)
run('CPU vision compile',
[cmake, '--build', SOURCE / 'build-vision-cpu', '--target', 'strata-vision', '-j', '1'], env)
shutil.copy2(SOURCE / 'build-vision-cpu/bin/strata-vision', SOURCE / 'engine/strata-vision')
# DeepSeek changes ggml CPU flags: keep a separate build tree.
script = '''import os,setup
from pathlib import Path
nvcc=str(Path(os.environ['STRATA_CANDIDATE_ROOT'])/'cuda/bin/nvcc')
defs=['-DSTRATA_ENABLE_CUDA=ON','-DSTRATA_BUILD_TESTS=OFF','-DSTRATA_BUILD_DSV41=ON',
'-DSTRATA_Q6K_EXPERTS=ON','-DSTRATA_MMQ_KQUANTS=ON','-DCMAKE_CUDA_ARCHITECTURES=86;120',
'-DCMAKE_CUDA_COMPILER='+nvcc,*setup.toolkit_root_defs(nvcc),
'-DSTRATA_GGML_DIR='+str(setup.ROOT/'third_party/llama.cpp'),
*setup.host_compiler_defs(True),*setup.engine_defs([86,120],13)]
setup.cmake_build(setup.ROOT,setup.ROOT/'build-dsv41','strata-dsv41',defs,None,'build-dsv41.bat')
'''
env['STRATA_CANDIDATE_ROOT'] = str(ROOT)
run('DeepSeek native engine: separate tree, SM86 and SM120',
[python, '-c', script], env, cwd=SOURCE)
shutil.copy2(SOURCE / 'build-dsv41/strata-dsv41', SOURCE / 'engine/strata-dsv41')
versions = {}
for name in ('strata', 'strata-dsv41'):
value = subprocess.check_output([SOURCE / 'engine' / name, '--version'],
env=env, text=True, stderr=subprocess.STDOUT).strip()
if VERSION not in value:
raise RuntimeError('Unexpected binary version: ' + name)
versions[name] = value
build = json.loads((SOURCE / 'engine/BUILD.json').read_text())
assert set(map(int, build['archs'])) == {86, 120}
assert subprocess.check_output(['git', '-C', SOURCE, 'rev-parse', 'HEAD'], text=True).strip() == COMMIT
assert not subprocess.check_output(
['git', '-C', SOURCE, 'status', '--porcelain', '--untracked-files=no'], text=True).strip()
hashes = {p.name: hashlib.file_digest(p.open('rb'), 'sha256').hexdigest()
for p in (SOURCE / 'engine').iterdir() if p.is_file()}
(ROOT / 'deepseek-build.json').write_text(json.dumps(dict(
commit=COMMIT, version=versions['strata-dsv41'], architectures=[86, 120],
source='official-native-build', executable='source/engine/strata-dsv41'), indent=2) + '\n')
status('built', 'Awaiting Michael Go; production untouched', versions=versions,
architectures=[86, 120], cuda='13.0', cpu_vision_built=True,
deepseek_built=True, hashes=hashes, finished=time.time())
print('Built and version-checked. No activation; no inference.', flush=True)
if __name__ == '__main__':
try:
main()
except BaseException as error:
status('failed', 'Build requires inspection', error=type(error).__name__ + ': ' + str(error))
raise
@@ -0,0 +1,67 @@
"""Athena-host generated-code checker, only for the assigned synthetic quality suite.
Input: JSON stdin with code/tests. Uses current managed Deck image, no model
inference, network, GPUs, host mounts or credentials. Output still needs code
review: generated code could print misleading success text.
"""
import json
from pathlib import Path
import subprocess
import sys
import uuid
import host_support as host
SCRIPT = '''import json,sys,resource
resource.setrlimit(resource.RLIMIT_CPU,(2,2))
resource.setrlimit(resource.RLIMIT_FSIZE,(1048576,1048576))
resource.setrlimit(resource.RLIMIT_NOFILE,(64,64))
payload=json.load(sys.stdin)
try:
scope={};exec(compile(payload['code'],'candidate','exec'),scope);exec(compile(payload['tests'],'fixed-tests','exec'),scope)
print(json.dumps({'passed':True}))
except BaseException as error:
print(json.dumps({'passed':False,'error':type(error).__name__}))
'''
def main():
payload = json.load(sys.stdin)
if set(payload) != {'code', 'tests'} or not all(isinstance(value, str) for value in payload.values()):
raise ValueError('Only synthetic code and fixed tests are accepted')
_, info = host.installed()
name = 'athena-strata-027-code-' + uuid.uuid4().hex[:12]
label = 'athena.deck.strata027.code'
command = ['docker', 'create', '--name', name, '--label', label + '=' + name,
'-i', '--network', 'none', '--read-only', '--tmpfs', '/scratch:rw,noexec,nosuid,size=16m',
'--cap-drop', 'ALL', '--security-opt', 'no-new-privileges', '--memory', '256m',
'--memory-swap', '256m', '--cpus', '1', '--pids-limit', '32', '--user', '65534:65534',
'-e', 'TMPDIR=/scratch', '-e', 'NVIDIA_VISIBLE_DEVICES=void', '-e', 'CUDA_VISIBLE_DEVICES=',
'--entrypoint', 'python3', info['Config']['Image'], '-I', '-c', SCRIPT]
created = False
try:
subprocess.run(command, check=True, stdout=subprocess.DEVNULL)
created = True
container = json.loads(subprocess.check_output(['docker', 'inspect', name], text=True))[0]
assert container['Config']['Labels'][label] == name
assert container['HostConfig']['NetworkMode'] == 'none'
assert container['HostConfig']['ReadonlyRootfs'] is True
assert not container['HostConfig'].get('DeviceRequests')
assert not container['HostConfig'].get('Devices')
assert not container['Mounts']
assert 'NVIDIA_VISIBLE_DEVICES=void' in container['Config']['Env']
result = subprocess.run(['docker', 'start', '-a', '-i', name],
input=json.dumps(payload), text=True, capture_output=True, timeout=15)
print(json.dumps(dict(returncode=result.returncode, stdout=result.stdout[-4000:],
stderr=result.stderr[-1000:], sandbox_controls_verified=True, code_review_required=True)))
except subprocess.TimeoutExpired:
print(json.dumps(dict(passed=False, error='sandbox_timeout', code_review_required=True)))
finally:
if created:
container = json.loads(subprocess.check_output(['docker', 'inspect', name], text=True))[0]
if container['Config']['Labels'].get(label) == name:
subprocess.run(['docker', 'rm', '-f', name], check=True, stdout=subprocess.DEVNULL)
assert subprocess.run(['docker', 'inspect', name], capture_output=True).returncode != 0
if __name__ == '__main__':
main()
@@ -0,0 +1,59 @@
"""Collect only allowlisted synthetic test evidence from the Athena host.
NAS-side script. Never copies worker configs, credentials, production histories,
private prompts or unrestricted logs. Generated files remain separate from Git
publication until reviewed.
"""
import argparse
import json
from pathlib import Path
import shlex
import subprocess
REMOTE = r'''
import json
from pathlib import Path
root=Path('/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7')
result={'runs':{},'activation':json.loads((root/'activation-result.json').read_text()),
'verification':json.loads((root/'verification.json').read_text())}
prefixes=('strata prefill:', 'strata generate: resident RAM mode:',
'strata generate: --batch-groups', 'strata generate: --batch-mtp',
'strata generate: STRATA_PIPED_MTP', 'strata generate: CPU pool',
'strata serve: layer split:', 'strata generate: layer split auto:',
'strata verify: residency-biased', 'strata verify: pipelined batch windows',
'strata serve: CUDA0:', 'strata serve: CUDA1:', 'strata serve: WARNING:',
'strata batch (pipelined,')
for directory in sorted((root/'tests/runs').iterdir()):
if not directory.is_dir():continue
evidence={}
for name in ('host-result.json','result/provenance.json','result/results.json','result/arrival.json'):
path=directory/name
if path.is_file():evidence[name]=json.loads(path.read_text())
for path in (directory/'result').glob('*-rep[012].jsonl'):
evidence[path.name]=[json.loads(line) for line in path.read_text().splitlines() if line]
log=directory/'result/engine.log'
if log.is_file():
evidence['resolved-runtime-metadata']=[line for line in log.read_text(errors='replace').splitlines()
if line.startswith(prefixes) and not any(word in line.lower() for word in ('api_key','api key','authorization','bearer'))]
result['runs'][directory.name]=evidence
print(json.dumps(result))
'''
def main():
parser=argparse.ArgumentParser()
parser.add_argument('--output',type=Path,required=True)
options=parser.parse_args()
raw=subprocess.check_output(['athena-ssh',shlex.join(['python3','-c',REMOTE])],text=True,timeout=60)
data=json.loads(raw)
options.output.parent.mkdir(parents=True,exist_ok=True)
temp=options.output.with_suffix('.tmp')
temp.write_text(json.dumps(data,indent=2,ensure_ascii=False)+'\n')
temp.replace(options.output)
assert json.loads(options.output.read_text())==data
complete=[name for name,record in data['runs'].items()
if record.get('result/provenance.json',{}).get('state')=='complete']
print(json.dumps({'collected_runs':len(data['runs']),'complete_runs':len(complete),'output':str(options.output)}))
if __name__=='__main__':main()
@@ -0,0 +1,282 @@
"""One isolated v0.2.7 arm. Default is plan-only; never operates production."""
import argparse
import concurrent.futures
import gzip
import hashlib
import importlib.util
import json
import os
from pathlib import Path
import secrets
import signal
import socket
import subprocess
import threading
import time
import urllib.request
import matrix
HERE = Path(__file__).resolve().parent
def load_module(name, filename):
spec = importlib.util.spec_from_file_location(name, filename)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
return module
def owned_processes(pid, proc_root=Path('/proc')):
found = [pid]
for current in found:
try:
threads = list((proc_root / str(current) / 'task').iterdir())
except FileNotFoundError:
continue
for thread in threads:
try:
children = (thread / 'children').read_text().split()
except FileNotFoundError:
continue
found.extend(int(child) for child in children if int(child) not in found)
return found
def resource_snapshot(pid, cgroup):
stat = dict((k, int(v)) for k, v in
(line.split() for line in (cgroup / 'memory.stat').read_text().splitlines()))
events = dict((k, int(v)) for k, v in
(line.split() for line in (cgroup / 'memory.events').read_text().splitlines()))
pressure = {}
for line in (cgroup / 'memory.pressure').read_text().splitlines():
words = line.split()
pressure[words[0]] = int(next(w.split('=')[1] for w in words if w.startswith('total=')))
read_bytes = ticks = 0
for current in owned_processes(pid):
try:
process = Path('/proc') / str(current)
values = (process / 'stat').read_text().rsplit(')', 1)[1].split()
ticks += int(values[11]) + int(values[12])
io = dict(line.split(':', 1) for line in (process / 'io').read_text().splitlines())
read_bytes += int(io['read_bytes'])
except FileNotFoundError:
pass
return dict(at=time.monotonic(), memory=int((cgroup / 'memory.current').read_text()),
read_bytes=read_bytes, cpu_ticks=ticks, refault=stat.get('workingset_refault_file', 0),
major_fault=stat.get('pgmajfault', 0), max_events=events.get('max', 0),
oom=events.get('oom', 0), oom_kill=events.get('oom_kill', 0), pressure=pressure)
def selected_metadata(text):
"""Only our synthetic test log; retain configuration/fallback metadata, not prompts."""
prefixes = ('strata prefill:', 'strata generate: resident RAM mode:',
'strata generate: batch MTP', 'strata verify: residency-biased',
'strata serve: layer split:', 'strata generate: layer split auto:')
return [line for line in text.splitlines() if line.startswith(prefixes)]
def run(options):
arm = next(row for row in matrix.executable_arms() if row['id'] == options.arm)
if arm.get('calibrated'):
path = HERE / 'calibration-settings.json'
raw = path.read_bytes()
calibration = json.loads(raw)
if calibration.get('source_commit') != matrix.COMMIT or calibration.get('base_arm') != 'deck-reference-new':
raise RuntimeError('Wrong calibration provenance; no model started')
allowed = set(matrix.TUNED_FLAGS) | {'--pool-workers', '--prefill-pipe'}
if not isinstance(calibration.get('settings'), dict) or not set(calibration['settings']) <= allowed:
raise RuntimeError('Unexpected provider calibration setting')
arm['flags'].update(calibration['settings'])
arm['calibration_sha256'] = hashlib.sha256(raw).hexdigest()
if options.combine:
additions = [next(row for row in matrix.arms() if row['id'] == name)
for name in options.combine.split(',')]
arm = matrix.combine(arm, additions)
runtime = options.runtime.resolve()
ready = json.loads((runtime / 'ready.json').read_text())
if ready.get('commit') != matrix.COMMIT:
raise RuntimeError('Only the pinned NEW version may be benchmarked')
source = runtime / 'source'
env = dict(os.environ, LD_LIBRARY_PATH=str(runtime / 'cuda/lib64') + ':' +
str(runtime / 'cuda/lib') + ':' + os.environ.get('LD_LIBRARY_PATH', ''),
PYTHONDONTWRITEBYTECODE='1')
version = subprocess.check_output([source / 'engine/strata', '--version'], env=env, text=True)
if matrix.VERSION not in version:
raise RuntimeError('Wrong engine version; no model started')
template = json.loads(options.template.read_text())
options.output.mkdir(parents=True, exist_ok=False)
os.chmod(options.output, 0o700)
for client in (0, 1):
fixture = HERE / f'fixture-65536-{client}.json.gz'
if fixture.exists():
(options.output / f'fixture-65536-{client}.json').write_bytes(gzip.decompress(fixture.read_bytes()))
token = secrets.token_urlsafe(24)
with socket.socket() as listener:
listener.bind(('127.0.0.1', 0))
port = listener.getsockname()[1]
cfg = matrix.configuration(template, arm, runtime, options.output, token, port)
config_path = options.output / 'config.json'
config_path.write_text(json.dumps(cfg))
config_path.chmod(0o600)
env = {k: v for k, v in env.items() if not k.startswith('STRATA_')}
env.update(cfg['env'])
env['CUDA_VISIBLE_DEVICES'] = ','.join(map(str, arm['gpu']))
old = load_module('historical_benchmark_helpers', HERE / 'legacy_benchmark.py')
old.ROOT, old.SOURCE, old.KEY, old.MODEL = options.output, source, token, cfg['model_name']
old.RESULTS = []
base = f'http://127.0.0.1:{port}'
process = None
provenance = dict(arm=arm, phase=options.phase, version=version.strip(),
commit=matrix.COMMIT, historical_comparison_not_controlled=True,
resource_accounting='all-thread descendant CPU/proc IO; container memory',
inherited_template_key_discarded=True, load_seconds=None)
try:
if options.phase == 'calibrate':
# The provider's own tuner, on the pinned NEW engine, isolated by the host launcher.
with (options.output / 'calibration.log').open('w') as output:
subprocess.run(['taskset', '-c', ','.join(map(str, arm['cpus'])),
str(source / '.venv/bin/python'), str(source / 'tools/calibrate.py'), str(config_path)],
cwd=source, env=env, stdout=output, stderr=subprocess.STDOUT, check=True, timeout=7200)
provenance.update(state='complete', result_type='provider calibration; verify on long/cached workloads')
return
with (options.output / 'server.log').open('w') as output:
start = time.monotonic()
process = subprocess.Popen(
['taskset', '-c', ','.join(map(str, arm['cpus'])), str(source / '.venv/bin/python'),
str(source / 'serve/server.py'), '--engine', 'strata', '--config', str(config_path),
'--host', '127.0.0.1', '--port', str(port), '--fit-max-tokens'],
cwd=source, env=env, stdout=output, stderr=subprocess.STDOUT, start_new_session=True)
while time.monotonic() - start < 600:
if process.poll() is not None:
raise RuntimeError('Candidate worker failed while loading; not a speed result')
try:
with old.http(base, '/health', timeout=3) as response:
health = json.load(response)
if health.get('status') == 'ok' and health.get('loaded') is True:
break
except OSError:
pass
time.sleep(1)
else:
raise TimeoutError('Candidate load timeout')
provenance['load_seconds'] = time.monotonic() - start
with old.http(base, '/v1/status', timeout=10) as response:
status = json.load(response)
if status.get('concurrency', {}).get('serving') != arm['slots']:
raise RuntimeError('Requested slot capacity not confirmed')
old.numeric = lambda: resource_snapshot(process.pid, options.cgroup)
if options.phase == 'quality':
quality = load_module('synthetic_quality_helpers', HERE / 'quality_steps.py')
(options.output / 'cases.json').write_bytes((HERE / 'cases.json').read_bytes())
# Reuse the fixed tasks, rubric and mock-only tool loop; change only transport/model endpoint.
original_urlopen = quality.urllib.request.urlopen
def local_open(request, *args, **kwargs):
if request.full_url != 'http://127.0.0.1:19082/v1/chat/completions':
raise RuntimeError('Unexpected quality transport')
body = json.loads(request.data)
body['model'] = cfg['model_name']
redirected = urllib.request.Request(base + '/v1/chat/completions',
data=json.dumps(body).encode(), headers=dict(request.header_items()))
return original_urlopen(redirected, *args, **kwargs)
quality.urllib.request.urlopen = local_open
try:
quality_rows = quality.run_cases(options.output, arm['id'], options.repeat,
{'Authorization': 'Bearer ' + token, 'Content-Type': 'application/json'})
provenance['quality_technical_gate'] = len(quality_rows) == 20 and all(
not row.get('error') and not row.get('truncated') for row in quality_rows)
provenance['blind_quality_scoring'] = 'pending; technical completion is not quality acceptance'
if not provenance['quality_technical_gate']:
raise RuntimeError('Quality trial incomplete/truncated or mock tool failure')
finally:
quality.urllib.request.urlopen = original_urlopen
else:
short = [[dict(role='system', content=f'Kurzmessung 0, Gespräch {i}. Schreibe auf Deutsch.'),
dict(role='user', content='Schreibe einen ausführlichen Fachtext mit mindestens 1200 Wörtern über ' +
('Home Assistant.' if i else 'Datensicherung.'))] for i in range(2)]
old.measure(base, arm['id'], 'solo-short-0', [short[0]])
if arm['slots'] > 1:
short[0][0]['content'] += ' Parallele Messung.'
old.measure(base, arm['id'], 'parallel-short-0', short)
if options.phase == 'full256k':
request = json.loads((HERE / 'baseline-256k-request.json').read_text())
result = old.measure(base, arm['id'], 'near-full-256k', [request['messages']],
request.get('max_tokens', 256))
provenance['marker_check'] = [marker in result[0]['_content'] for marker in
('ALPHA_314159', 'BETA_271828', 'GAMMA_161803')]
if not all(provenance['marker_check']):
raise RuntimeError('Near-full-context marker retrieval failed')
else:
target = {'screen': 8192, 'long64k': 65536, 'long128k': 131072,
'arrival': 65536}[options.phase]
conversations = [old.fixture(base, target, i) for i in range(arm['slots'])]
if options.phase == 'arrival':
with concurrent.futures.ThreadPoolExecutor(max_workers=2) as pool:
first = pool.submit(old.generate, base, short[0], 2048)
time.sleep(1)
second = pool.submit(old.generate, base, conversations[-1], 256)
rows = [first.result(), second.result()]
(options.output / 'arrival.json').write_text(json.dumps(
[{k: v for k, v in row.items() if k != '_content'} for row in rows], indent=2))
else:
rows = old.measure(base, arm['id'], f'parallel-cold-{target}', conversations, 256)
turns = 1 if options.phase == 'screen' else 3
for turn in range(turns):
conversations = [message + [dict(role='assistant', content=row['_content']),
dict(role='user', content='Führe den Fachtext mit mindestens 1200 weiteren Wörtern fort.')]
for message, row in zip(conversations, rows)]
rows = old.measure(base, arm['id'], f'parallel-cached-{target}-turn{turn}', conversations, 512)
provenance['metrics_complete'] = bool(old.RESULTS)
if any(row['resources']['oom_kill_delta'] for row in old.RESULTS):
raise RuntimeError('OOM observed; candidate rejected')
provenance['state'] = 'complete'
except BaseException as error:
provenance.update(state='failed', error=type(error).__name__ + ': ' + str(error))
raise
finally:
try:
provenance['cgroup_final_events'] = {key: int(value) for key, value in
(line.split() for line in (options.cgroup / 'memory.events').read_text().splitlines())}
provenance['cgroup_peak_memory_bytes'] = int((options.cgroup / 'memory.peak').read_text())
if provenance['cgroup_final_events'].get('oom_kill', 0) and provenance.get('state') == 'complete':
provenance.update(state='failed', error='OOM kill recorded in owned test cgroup')
except OSError as error:
provenance['cgroup_counter_error'] = type(error).__name__
if process and process.poll() is None:
os.killpg(process.pid, signal.SIGTERM)
try:
process.wait(timeout=30)
except subprocess.TimeoutExpired:
os.killpg(process.pid, signal.SIGKILL)
process.wait()
config_path.unlink(missing_ok=True)
log = options.output / 'engine.log'
if log.exists():
provenance['resolved_metadata'] = selected_metadata(log.read_text(errors='replace'))
(options.output / 'provenance.json').write_text(json.dumps(provenance, indent=2))
def main(argv=None):
parser = argparse.ArgumentParser()
parser.add_argument('--execute', action='store_true')
parser.add_argument('--go', action='store_true')
parser.add_argument('--arm', choices=[a['id'] for a in matrix.executable_arms()], default='deck-reference-new')
parser.add_argument('--combine', default='')
parser.add_argument('--phase', choices=['screen', 'long64k', 'long128k', 'full256k', 'arrival', 'quality', 'calibrate'], default='screen')
parser.add_argument('--runtime', type=Path)
parser.add_argument('--template', type=Path)
parser.add_argument('--output', type=Path)
parser.add_argument('--cgroup', type=Path, default=Path('/sys/fs/cgroup'))
parser.add_argument('--repeat', type=int, choices=[0, 1, 2], default=0)
options = parser.parse_args(argv)
if not options.execute:
print(json.dumps(matrix.plan(), indent=2))
return 0
if not options.go:
parser.error('No inference without a separate explicit --go')
if not all((options.runtime, options.template, options.output)):
parser.error('--runtime, --template and --output required')
return run(options)
if __name__ == '__main__':
main()
@@ -0,0 +1,162 @@
{
"release": "v0.2.7",
"version": "0.1.52",
"commit": "5e8a4cca7d690ac60ca37eb09e7d0e010099ad6d",
"previous_commit": "4b9e05a2a806a3fe24f7b2560d98626c37dade35",
"previous_image": "athena-deck-standalone:tts-alias-20261027",
"previous_image_id": "sha256:021fac6624999f7fde01cf5cc82845e6fba4d84663759f6375a12e6aa30bbb86",
"prepared_image": "athena-deck-standalone:strata-0.1.52-prepared-20261027",
"prepared_image_id": "sha256:161e0cd1b61b10f6d7e97b36d8fe6c77654ada9d14a3428747e9f46605e16414",
"settings_before": {
"profiles.json": "7bd61f29604c7bed7e495ccfe1e27f462fdae9ef8508051cef5eec61aa22ea6e",
"endpoint.json": "c434aad8ba9f94e33c1203d7886aaa8c25c6ed1ad432f87127e4f33978bce453",
"audio-policy.json": "f48dedea718968c00c0647ca90c1402bdabac9ce600dbeddc495817680527a3f",
"cpu-partition.json": "078d9215c41d7beafe42391a6a25c9aa34ad7f5b88ebbf40e2c178123e6611c1",
"reasoning-budget.json": "4884a379adf2f888415041b81ef55a01a2c22ef7a41ca1554460f410bec5cf0c"
},
"endpoint_autostart_before": true,
"worker_before": {
"model_name": "flash-next-strata-iq3-dual",
"gpu": [
0,
1
],
"gpu_order": "as_given",
"layer_split": "16",
"parallel": 2
},
"runtime_updated": true,
"image_activated": true,
"inference_performed": true,
"phase": "complete; recipe image active; original Qwen loaded and tested; user settings unchanged",
"updated_at": 1793183810.0201097,
"settings_during_tests": {
"profiles.json": "7bd61f29604c7bed7e495ccfe1e27f462fdae9ef8508051cef5eec61aa22ea6e",
"endpoint.json": "3566b1f54a2736ac63d93daeb98fb156f4b0dcf595e506557b5ca08005ba1c9b",
"audio-policy.json": "f48dedea718968c00c0647ca90c1402bdabac9ce600dbeddc495817680527a3f",
"cpu-partition.json": "078d9215c41d7beafe42391a6a25c9aa34ad7f5b88ebbf40e2c178123e6611c1",
"reasoning-budget.json": "4884a379adf2f888415041b81ef55a01a2c22ef7a41ca1554460f410bec5cf0c"
},
"counts_before_image_handoff": {
"llm": {
"enabled": 12,
"available": 9,
"loaded": false,
"supported": true
},
"image": {
"enabled": 1,
"available": 1,
"loaded": false,
"supported": true
},
"tts": {
"enabled": 1,
"available": 1,
"loaded": true,
"supported": true
},
"stt": {
"enabled": 1,
"available": 1,
"loaded": true,
"supported": true
},
"music": {
"enabled": 2,
"available": 2,
"loaded": false,
"supported": true
},
"voice": {
"enabled": 1,
"available": 1,
"loaded": false,
"supported": true
}
},
"settings_after": {
"profiles.json": "7bd61f29604c7bed7e495ccfe1e27f462fdae9ef8508051cef5eec61aa22ea6e",
"endpoint.json": "c434aad8ba9f94e33c1203d7886aaa8c25c6ed1ad432f87127e4f33978bce453",
"audio-policy.json": "f48dedea718968c00c0647ca90c1402bdabac9ce600dbeddc495817680527a3f",
"cpu-partition.json": "078d9215c41d7beafe42391a6a25c9aa34ad7f5b88ebbf40e2c178123e6611c1",
"reasoning-budget.json": "4884a379adf2f888415041b81ef55a01a2c22ef7a41ca1554460f410bec5cf0c"
},
"settings_unchanged": true,
"container_health": "healthy",
"restored_profile": "flash-next-strata-iq3-dual",
"restored_worker_health": {
"status": "ok",
"loaded": true
},
"restoration_probe": {
"complete": true,
"marker_found": true,
"usage": {
"prompt_tokens": 27,
"completion_tokens": 10,
"total_tokens": 37,
"prompt_tokens_details": {
"cached_tokens": 0
}
},
"timings": {
"cache_n": 0,
"prompt_n": 27,
"prompt_ms": 463.7,
"prompt_per_token_ms": 17.174,
"prompt_per_second": 58.2,
"predicted_n": 10,
"predicted_ms": 385.8,
"predicted_per_token_ms": 38.58,
"predicted_per_second": 25.9,
"draft_n": 11,
"draft_n_accepted": 7
},
"wall_seconds_including_load": 66.70794959799969
},
"endpoint": {
"state": "running",
"port": 8120,
"counts": {
"llm": {
"enabled": 12,
"available": 12,
"loaded": true,
"supported": true
},
"image": {
"enabled": 1,
"available": 1,
"loaded": false,
"supported": true
},
"tts": {
"enabled": 1,
"available": 1,
"loaded": true,
"supported": true
},
"stt": {
"enabled": 1,
"available": 1,
"loaded": true,
"supported": true
},
"music": {
"enabled": 2,
"available": 2,
"loaded": false,
"supported": true
},
"voice": {
"enabled": 1,
"available": 1,
"loaded": false,
"supported": true
}
},
"active_requests": 0
},
"previously_loaded_audio_restored": true
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,38 @@
{
"release": "v0.2.7",
"commit": "5e8a4cca7d690ac60ca37eb09e7d0e010099ad6d",
"activated": false,
"inference_performed": false,
"build_verified": true,
"versions": {
"strata": "strata 0.1.52",
"strata-dsv41": "strata-dsv41 0.1.52 build 5e8a4cca7"
},
"architectures": {
"build": "86;120",
"build-dsv41": "86;120"
},
"artifacts": {
"BUILD.json": "42dfbc34ea52f4d165a16c0cadf3f5b54f3655e291ab2c71fb9425b7e1457d01",
"strata": "7b1b79c9ae91cdd3a166c2ebfcb1b59c7544bc581746d8f6dcc47b18e6d8c524",
"strata-dsv41": "86b25adc0c48cee8f645a26a0e24622c131993bea34f66610e3688b9dd27f3a6",
"strata-vision": "d2c062c965a6bef5fb7e3c8295f1c6b5b2d5049f0b1ac50a62b9d10fd835be88",
"libstrata_kq.so": "41894f7fd01df06110cc716597151fa54ec1dd5dae4db75db0e8d16ef9f01ded"
},
"loader_checks": {
"versions": {
"strata": "strata 0.1.52",
"strata-dsv41": "strata-dsv41 0.1.52 build 5e8a4cca7"
},
"server_help": true,
"linkage": {
"strata": "resolved",
"strata-dsv41": "resolved",
"strata-vision": "resolved"
},
"fatbin_architectures": {}
},
"production_changed_paths": [],
"production_container_unchanged": true,
"production_health": "healthy"
}
@@ -0,0 +1,62 @@
{
"checked_at": "2026-10-28T11:52:00.828293+01:00",
"binary_version": "strata 0.1.52",
"source_pin": "5e8a4cca7d690ac60ca37eb09e7d0e010099ad6d",
"image_id": "sha256:161e0cd1b61b10f6d7e97b36d8fe6c77654ada9d14a3428747e9f46605e16414",
"health": "healthy",
"endpoint": {
"state": "running",
"port": 8120,
"counts": {
"llm": {
"enabled": 12,
"available": 12,
"loaded": true,
"supported": true
},
"image": {
"enabled": 1,
"available": 1,
"loaded": false,
"supported": true
},
"tts": {
"enabled": 1,
"available": 1,
"loaded": true,
"supported": true
},
"stt": {
"enabled": 1,
"available": 1,
"loaded": true,
"supported": true
},
"music": {
"enabled": 2,
"available": 2,
"loaded": false,
"supported": true
},
"voice": {
"enabled": 1,
"available": 1,
"loaded": false,
"supported": true
}
},
"active_requests": 0
},
"worker": {
"model_name": "flash-next-strata-iq3-dual",
"gpu": [
0,
1
],
"gpu_order": "as_given",
"layer_split": "16",
"parallel": 2
},
"protected_settings_match": true,
"test_containers": []
}
@@ -0,0 +1,305 @@
{
"commit": "5e8a4cca7d690ac60ca37eb09e7d0e010099ad6d",
"plan": [
{
"arm": "deck-reference-new",
"phase": "screen",
"repeat": 1,
"deadline": 1200
},
{
"arm": "pipeline-no-mtp",
"phase": "screen",
"repeat": 1,
"deadline": 1200
},
{
"arm": "pipeline-no-mtp",
"phase": "screen",
"repeat": 2,
"deadline": 1200
},
{
"arm": "deck-reference-new",
"phase": "screen",
"repeat": 2,
"deadline": 1200
},
{
"arm": "deck-reference-new",
"phase": "long64k",
"repeat": 0,
"deadline": 1800
},
{
"arm": "pipeline-no-mtp",
"phase": "long64k",
"repeat": 0,
"deadline": 1800
},
{
"arm": "pipeline-no-mtp",
"phase": "long128k",
"repeat": 0,
"deadline": 1800
},
{
"arm": "deck-reference-new",
"phase": "full256k",
"repeat": 0,
"deadline": 1800
},
{
"arm": "pipeline-no-mtp",
"phase": "full256k",
"repeat": 0,
"deadline": 1800
},
{
"arm": "pipeline-no-mtp",
"phase": "arrival",
"repeat": 0,
"deadline": 1800
},
{
"arm": "deck-reference-new",
"phase": "quality",
"repeat": 0,
"deadline": 1800
},
{
"arm": "pipeline-no-mtp",
"phase": "quality",
"repeat": 0,
"deadline": 1800
},
{
"arm": "pipeline-no-mtp",
"phase": "quality",
"repeat": 1,
"deadline": 1800
},
{
"arm": "deck-reference-new",
"phase": "quality",
"repeat": 1,
"deadline": 1800
},
{
"arm": "deck-reference-new",
"phase": "quality",
"repeat": 2,
"deadline": 1800
},
{
"arm": "pipeline-no-mtp",
"phase": "quality",
"repeat": 2,
"deadline": 1800
}
],
"attempts": [
{
"trial": {
"arm": "deck-reference-new",
"phase": "screen",
"repeat": 1,
"deadline": 1200
},
"returncode": 0,
"elapsed_seconds": 144.2693930530222,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/deck-reference-new-screen-27ad7eed\", \"production_changed\": false}\n",
"stderr": ""
},
{
"trial": {
"arm": "pipeline-no-mtp",
"phase": "screen",
"repeat": 1,
"deadline": 1200
},
"returncode": 0,
"elapsed_seconds": 137.85929333500098,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/pipeline-no-mtp-screen-4696365b\", \"production_changed\": false}\n",
"stderr": ""
},
{
"trial": {
"arm": "pipeline-no-mtp",
"phase": "screen",
"repeat": 2,
"deadline": 1200
},
"returncode": 0,
"elapsed_seconds": 137.43927926698234,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/pipeline-no-mtp-screen-972d46a1\", \"production_changed\": false}\n",
"stderr": ""
},
{
"trial": {
"arm": "deck-reference-new",
"phase": "screen",
"repeat": 2,
"deadline": 1200
},
"returncode": 0,
"elapsed_seconds": 145.3174100560136,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/deck-reference-new-screen-51bfd63c\", \"production_changed\": false}\n",
"stderr": ""
},
{
"trial": {
"arm": "deck-reference-new",
"phase": "long64k",
"repeat": 0,
"deadline": 1800
},
"returncode": 0,
"elapsed_seconds": 249.37108591099968,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/deck-reference-new-long64k-643fd2d7\", \"production_changed\": false}\n",
"stderr": ""
},
{
"trial": {
"arm": "pipeline-no-mtp",
"phase": "long64k",
"repeat": 0,
"deadline": 1800
},
"returncode": 0,
"elapsed_seconds": 218.63255311502144,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/pipeline-no-mtp-long64k-38989ccb\", \"production_changed\": false}\n",
"stderr": ""
},
{
"trial": {
"arm": "pipeline-no-mtp",
"phase": "long128k",
"repeat": 0,
"deadline": 1800
},
"returncode": 0,
"elapsed_seconds": 288.91642286098795,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/pipeline-no-mtp-long128k-41e69dba\", \"production_changed\": false}\n",
"stderr": ""
},
{
"trial": {
"arm": "deck-reference-new",
"phase": "full256k",
"repeat": 0,
"deadline": 1800
},
"returncode": 0,
"elapsed_seconds": 253.01315521798097,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/deck-reference-new-full256k-cbe5ce37\", \"production_changed\": false}\n",
"stderr": ""
},
{
"trial": {
"arm": "pipeline-no-mtp",
"phase": "full256k",
"repeat": 0,
"deadline": 1800
},
"returncode": 0,
"elapsed_seconds": 247.0258165569976,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/pipeline-no-mtp-full256k-55ef52c4\", \"production_changed\": false}\n",
"stderr": ""
},
{
"trial": {
"arm": "pipeline-no-mtp",
"phase": "arrival",
"repeat": 0,
"deadline": 1800
},
"returncode": 0,
"elapsed_seconds": 167.93690775398863,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/pipeline-no-mtp-arrival-8088b648\", \"production_changed\": false}\n",
"stderr": ""
},
{
"trial": {
"arm": "deck-reference-new",
"phase": "quality",
"repeat": 0,
"deadline": 1800
},
"returncode": 0,
"elapsed_seconds": 252.13968398899306,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/deck-reference-new-quality-7b5bce40\", \"production_changed\": false}\n",
"stderr": ""
},
{
"trial": {
"arm": "pipeline-no-mtp",
"phase": "quality",
"repeat": 0,
"deadline": 1800
},
"returncode": 0,
"elapsed_seconds": 265.4778316990123,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/pipeline-no-mtp-quality-d35428a3\", \"production_changed\": false}\n",
"stderr": ""
},
{
"trial": {
"arm": "pipeline-no-mtp",
"phase": "quality",
"repeat": 1,
"deadline": 1800
},
"returncode": 0,
"elapsed_seconds": 268.54032877797727,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/pipeline-no-mtp-quality-c7276ab7\", \"production_changed\": false}\n",
"stderr": ""
},
{
"trial": {
"arm": "deck-reference-new",
"phase": "quality",
"repeat": 1,
"deadline": 1800
},
"returncode": 0,
"elapsed_seconds": 261.63135063200025,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/deck-reference-new-quality-0f0b5d72\", \"production_changed\": false}\n",
"stderr": ""
},
{
"trial": {
"arm": "deck-reference-new",
"phase": "quality",
"repeat": 2,
"deadline": 1800
},
"returncode": 0,
"elapsed_seconds": 255.21709629404359,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/deck-reference-new-quality-4ebd4b14\", \"production_changed\": false}\n",
"stderr": ""
},
{
"trial": {
"arm": "pipeline-no-mtp",
"phase": "quality",
"repeat": 2,
"deadline": 1800
},
"returncode": 0,
"elapsed_seconds": 261.702729386976,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/pipeline-no-mtp-quality-aaa879e3\", \"production_changed\": false}\n",
"stderr": ""
}
],
"started_at": 1793180028.0427537,
"state": "all_trials_attempted",
"current": {
"arm": "pipeline-no-mtp",
"phase": "quality",
"repeat": 2,
"deadline": 1800
},
"finished_at": 1793183582.5571892,
"failed": 0
}
@@ -0,0 +1,18 @@
[
{"arm":"deck-reference-new","phase":"screen","repeat":1,"deadline":1200},
{"arm":"pipeline-no-mtp","phase":"screen","repeat":1,"deadline":1200},
{"arm":"pipeline-no-mtp","phase":"screen","repeat":2,"deadline":1200},
{"arm":"deck-reference-new","phase":"screen","repeat":2,"deadline":1200},
{"arm":"deck-reference-new","phase":"long64k","repeat":0,"deadline":1800},
{"arm":"pipeline-no-mtp","phase":"long64k","repeat":0,"deadline":1800},
{"arm":"pipeline-no-mtp","phase":"long128k","repeat":0,"deadline":1800},
{"arm":"deck-reference-new","phase":"full256k","repeat":0,"deadline":1800},
{"arm":"pipeline-no-mtp","phase":"full256k","repeat":0,"deadline":1800},
{"arm":"pipeline-no-mtp","phase":"arrival","repeat":0,"deadline":1800},
{"arm":"deck-reference-new","phase":"quality","repeat":0,"deadline":1800},
{"arm":"pipeline-no-mtp","phase":"quality","repeat":0,"deadline":1800},
{"arm":"pipeline-no-mtp","phase":"quality","repeat":1,"deadline":1800},
{"arm":"deck-reference-new","phase":"quality","repeat":1,"deadline":1800},
{"arm":"deck-reference-new","phase":"quality","repeat":2,"deadline":1800},
{"arm":"pipeline-no-mtp","phase":"quality","repeat":2,"deadline":1800}
]
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,78 @@
{
"assessment_sha256": "874984c54e8a49dbda146a0c3b8f5a8a1aa46fbbd8836f4fcafe8f768d3abc9e",
"answers": 120,
"independent_cases": 20,
"single_blind_assessor": true,
"variants": {
"deck-reference-new": {
"answers": 60,
"core_successes": 53,
"mean_score_out_of_10": 8.983,
"technical_errors": 0,
"truncations": 0,
"invalid_mock_calls": 0,
"categories": {
"anweisungen": {
"answers": 12,
"mean_score": 9.333,
"core_successes": 12
},
"coding": {
"answers": 12,
"mean_score": 9.667,
"core_successes": 11
},
"deutsch": {
"answers": 12,
"mean_score": 9.75,
"core_successes": 12
},
"diagnose": {
"answers": 12,
"mean_score": 6.833,
"core_successes": 6
},
"werkzeuge": {
"answers": 12,
"mean_score": 9.333,
"core_successes": 12
}
}
},
"pipeline-no-mtp": {
"answers": 60,
"core_successes": 56,
"mean_score_out_of_10": 9.1,
"technical_errors": 0,
"truncations": 0,
"invalid_mock_calls": 0,
"categories": {
"anweisungen": {
"answers": 12,
"mean_score": 9.5,
"core_successes": 12
},
"coding": {
"answers": 12,
"mean_score": 9.917,
"core_successes": 11
},
"deutsch": {
"answers": 12,
"mean_score": 9.75,
"core_successes": 12
},
"diagnose": {
"answers": 12,
"mean_score": 7.083,
"core_successes": 9
},
"werkzeuge": {
"answers": 12,
"mean_score": 9.25,
"core_successes": 12
}
}
}
}
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,310 @@
{
"commit": "5e8a4cca7d690ac60ca37eb09e7d0e010099ad6d",
"phase": "screen",
"expected_arms": [
"deck-reference-new",
"compat-026",
"vendor-defaults",
"layer-major-off",
"pipeline-no-mtp",
"pipeline-mtp-1",
"pipeline-mtp-2",
"pipeline-mtp-1-adapt",
"split-8",
"split-12",
"split-20",
"split-24",
"split-28",
"split-32",
"split-auto",
"gpu-5080-only",
"reverse-gpu-order",
"single-slot",
"reserve-1280",
"reserve-1536",
"reserve-1792",
"pcie-auto",
"pcie-0",
"pcie-0.20",
"pcie-0.55",
"pcie-0.70",
"prefill-auto-4096",
"prefill-auto-16384",
"prefill-pipe",
"spec-2",
"spec-6",
"spec-min-0.50",
"spec-min-0.90",
"all-cpu-pool5",
"adapt-default",
"routing-vendor-default",
"approx-long-prompt"
],
"attempts": [
{
"arm": "deck-reference-new",
"returncode": 0,
"elapsed_seconds": 146.76066422602162,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/deck-reference-new-screen-14fe1f98\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "compat-026",
"returncode": 0,
"elapsed_seconds": 146.87704779801425,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/compat-026-screen-dfb8a453\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "vendor-defaults",
"returncode": 1,
"elapsed_seconds": 120.49766391300363,
"stdout": "",
"stderr": "Traceback (most recent call last):\n File \"/opt/athena-deck-dev/strata-027-preparation-20261027/run_tests.py\", line 117, in <module>\n main()\n ~~~~^^\n File \"/opt/athena-deck-dev/strata-027-preparation-20261027/run_tests.py\", line 113, in main\n return run(options, key)\n File \"/opt/athena-deck-dev/strata-027-preparation-20261027/run_tests.py\", line 93, in run\n raise RuntimeError('Arm failed/aborted; inspect its recorded evidence; not a speed result')\nRuntimeError: Arm failed/aborted; inspect its recorded evidence; not a speed result\n"
},
{
"arm": "layer-major-off",
"returncode": 0,
"elapsed_seconds": 144.93822194903623,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/layer-major-off-screen-26af8759\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "pipeline-no-mtp",
"returncode": 0,
"elapsed_seconds": 138.50775457295822,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/pipeline-no-mtp-screen-e41058a8\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "pipeline-mtp-1",
"returncode": 0,
"elapsed_seconds": 140.97306844004197,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/pipeline-mtp-1-screen-fd104a2a\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "pipeline-mtp-2",
"returncode": 0,
"elapsed_seconds": 139.88843909301795,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/pipeline-mtp-2-screen-7c14b54e\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "pipeline-mtp-1-adapt",
"returncode": 0,
"elapsed_seconds": 142.5232204949716,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/pipeline-mtp-1-adapt-screen-a40ed024\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "split-8",
"returncode": 0,
"elapsed_seconds": 155.48035095899832,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/split-8-screen-f04cd4fb\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "split-12",
"returncode": 0,
"elapsed_seconds": 148.47884621703997,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/split-12-screen-102d1c35\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "split-20",
"returncode": 0,
"elapsed_seconds": 149.11606589099392,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/split-20-screen-f9b70273\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "split-24",
"returncode": 0,
"elapsed_seconds": 165.47005356301088,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/split-24-screen-f335364f\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "split-28",
"returncode": 0,
"elapsed_seconds": 184.8189852500218,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/split-28-screen-c9b3c43d\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "split-32",
"returncode": 0,
"elapsed_seconds": 213.46902782696998,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/split-32-screen-3aa23b43\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "split-auto",
"returncode": 0,
"elapsed_seconds": 159.67141063697636,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/split-auto-screen-96242c1e\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "gpu-5080-only",
"returncode": 0,
"elapsed_seconds": 139.32748982898192,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/gpu-5080-only-screen-4b8d4e24\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "reverse-gpu-order",
"returncode": 0,
"elapsed_seconds": 186.3570872079581,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/reverse-gpu-order-screen-cbe2f12b\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "single-slot",
"returncode": 0,
"elapsed_seconds": 104.86497209500521,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/single-slot-screen-306f64be\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "reserve-1280",
"returncode": 0,
"elapsed_seconds": 148.22332428302616,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/reserve-1280-screen-07400eed\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "reserve-1536",
"returncode": 0,
"elapsed_seconds": 147.0967385219992,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/reserve-1536-screen-9717a702\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "reserve-1792",
"returncode": 0,
"elapsed_seconds": 152.14912469900446,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/reserve-1792-screen-55906e78\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "pcie-auto",
"returncode": 0,
"elapsed_seconds": 143.31770862196572,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/pcie-auto-screen-dc7a9016\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "pcie-0",
"returncode": 0,
"elapsed_seconds": 146.84854047000408,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/pcie-0-screen-8a4b3f55\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "pcie-0.20",
"returncode": 0,
"elapsed_seconds": 147.05528662004508,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/pcie-0.20-screen-3c5d3203\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "pcie-0.55",
"returncode": 0,
"elapsed_seconds": 143.4140897860052,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/pcie-0.55-screen-1b53b5fe\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "pcie-0.70",
"returncode": 0,
"elapsed_seconds": 143.15291484701447,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/pcie-0.70-screen-ff13a0bf\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "prefill-auto-4096",
"returncode": 0,
"elapsed_seconds": 146.190174243995,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/prefill-auto-4096-screen-ee812f28\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "prefill-auto-16384",
"returncode": 0,
"elapsed_seconds": 138.92862405395135,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/prefill-auto-16384-screen-4846c515\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "prefill-pipe",
"returncode": 1,
"elapsed_seconds": 9.051343808008824,
"stdout": "",
"stderr": "Traceback (most recent call last):\n File \"/opt/athena-deck-dev/strata-027-preparation-20261027/run_tests.py\", line 117, in <module>\n main()\n ~~~~^^\n File \"/opt/athena-deck-dev/strata-027-preparation-20261027/run_tests.py\", line 113, in main\n return run(options, key)\n File \"/opt/athena-deck-dev/strata-027-preparation-20261027/run_tests.py\", line 93, in run\n raise RuntimeError('Arm failed/aborted; inspect its recorded evidence; not a speed result')\nRuntimeError: Arm failed/aborted; inspect its recorded evidence; not a speed result\n"
},
{
"arm": "spec-2",
"returncode": 0,
"elapsed_seconds": 145.60406212700764,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/spec-2-screen-e0651f6b\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "spec-6",
"returncode": 0,
"elapsed_seconds": 146.05417544400552,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/spec-6-screen-b1164d6b\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "spec-min-0.50",
"returncode": 0,
"elapsed_seconds": 145.41268037603004,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/spec-min-0.50-screen-9196805a\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "spec-min-0.90",
"returncode": 0,
"elapsed_seconds": 146.506040585984,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/spec-min-0.90-screen-166b087d\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "all-cpu-pool5",
"returncode": 0,
"elapsed_seconds": 142.8811306990101,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/all-cpu-pool5-screen-52246f3a\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "adapt-default",
"returncode": 0,
"elapsed_seconds": 147.26281638699584,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/adapt-default-screen-a6064536\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "routing-vendor-default",
"returncode": 0,
"elapsed_seconds": 146.72868006501812,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/routing-vendor-default-screen-dbccaa8c\", \"production_changed\": false}\n",
"stderr": ""
},
{
"arm": "approx-long-prompt",
"returncode": 0,
"elapsed_seconds": 146.8434635399608,
"stdout": "{\"complete\": true, \"output\": \"/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.7/tests/runs/approx-long-prompt-screen-0528db6f\", \"production_changed\": false}\n",
"stderr": ""
}
],
"started_at": 1793174376.479974,
"state": "all_arms_attempted",
"current_arm": "approx-long-prompt",
"finished_at": 1793179737.2809076,
"successful": 35,
"failed": 2
}
@@ -0,0 +1,37 @@
variant,slots,quality_tradeoff,repeats,solo_wall_s,short_pair_wall_s,fresh8k_wall_s,cached8k_wall_s
adapt-default,2,False,1,8.892834415019024,14.253551547997631,20.66873738000868,15.263690822990611
all-cpu-pool5,2,False,1,8.19712364798761,13.226158694014885,19.639917035005055,13.912697855994338
approx-long-prompt,2,True,1,8.779043325019302,14.061767484003212,20.027726433996577,14.747743026004173
compat-026,2,False,1,8.973199650004972,14.216598464990966,20.395381045003887,14.847724472987466
deck-reference-new,2,False,3,8.78038774500601,14.494325164996553,20.014442670013523,15.340881764976075
gpu-5080-only,2,False,1,11.616043561982224,20.780926448001992,16.127161022013752,22.71889477901277
layer-major-off,2,False,1,8.787072631996125,14.089991693996126,20.030074832000537,14.610899391002022
pcie-0,2,False,1,8.996177889988758,14.809088679001434,20.504190309002297,15.35507336599403
pcie-0.20,2,False,1,9.304163310007425,14.982763389009051,20.336440989020048,15.971490456024185
pcie-0.55,2,False,1,8.714283154986333,13.42088939200039,19.9461287749873,15.02584775199648
pcie-0.70,2,False,1,8.697994253016077,13.459065130999079,19.731078754994087,14.305683915998088
pcie-auto,2,False,1,8.363476319005713,13.447256416024175,19.72966661900864,13.823816365998937
pipeline-mtp-1,2,False,1,8.843437764997361,12.564474981016247,18.932262471993454,12.610575572005473
pipeline-mtp-1-adapt,2,False,1,8.862642947002314,12.455201748991385,19.215229969995562,14.008869001001585
pipeline-mtp-2,2,False,1,8.868995849014027,12.488866666011745,19.238163303001784,13.144396143994527
pipeline-no-mtp,2,False,3,8.65587551498902,11.916466220020084,18.710607298009563,12.466519590001553
prefill-auto-16384,2,False,1,8.94379894901067,14.11206683400087,19.86685368901817,15.207310174999293
prefill-auto-4096,2,False,1,8.8007808419934,14.472956341982353,20.702254955016542,16.087477274995763
prefill-pipe,2,False,1,8.769305461988552,14.046128931018757,20.065059519023634,15.18391991200042
reserve-1280,2,False,1,9.136499082000228,14.485737823997624,20.410020737996092,15.095006340008695
reserve-1536,2,False,1,9.313047884003026,14.653002696984913,20.627258838998387,15.093888738017995
reserve-1792,2,False,1,9.295708458987065,14.647525854001287,21.654067722993204,16.064673538989155
reverse-gpu-order,2,False,1,15.465756284014788,23.273414330993546,34.24038853798993,25.11560440401081
routing-vendor-default,2,True,1,8.634641537995776,14.12820012497832,20.31148978602141,14.49921104797977
single-slot,1,False,1,7.986049310013186,,10.028091496002162,6.971722193004098
spec-2,2,False,1,8.890295460994821,14.3908629079815,20.038221096998313,14.636577245022636
spec-6,2,False,1,8.942362873000093,14.034934884984978,20.526825990004,16.04197115098941
spec-min-0.50,2,False,1,9.332754542003386,14.366237092996016,20.032908740016865,15.27748521900503
spec-min-0.90,2,False,1,8.859180125989951,14.56505266498425,20.566143934003776,14.995015249995049
split-12,2,False,1,9.083140909002395,14.888665726990439,18.678638654004317,15.997854558983818
split-20,2,False,1,9.597749348002253,14.369733405008446,22.437504386994988,15.891439772996819
split-24,2,False,1,12.056439091014909,19.291080121998675,27.21408277298906,20.918910835986026
split-28,2,False,1,15.12356955499854,24.6780602580111,32.75016039700131,25.618643557012547
split-32,2,False,1,19.228713440999854,32.42352213000413,38.71521541301627,35.21655077001196
split-8,2,False,1,9.46037819000776,16.425696722988505,18.82920537699829,17.58725858302205
split-auto,2,False,1,10.599553116015159,16.458942107012263,23.562517772981664,17.265859521983657
1 variant slots quality_tradeoff repeats solo_wall_s short_pair_wall_s fresh8k_wall_s cached8k_wall_s
2 adapt-default 2 False 1 8.892834415019024 14.253551547997631 20.66873738000868 15.263690822990611
3 all-cpu-pool5 2 False 1 8.19712364798761 13.226158694014885 19.639917035005055 13.912697855994338
4 approx-long-prompt 2 True 1 8.779043325019302 14.061767484003212 20.027726433996577 14.747743026004173
5 compat-026 2 False 1 8.973199650004972 14.216598464990966 20.395381045003887 14.847724472987466
6 deck-reference-new 2 False 3 8.78038774500601 14.494325164996553 20.014442670013523 15.340881764976075
7 gpu-5080-only 2 False 1 11.616043561982224 20.780926448001992 16.127161022013752 22.71889477901277
8 layer-major-off 2 False 1 8.787072631996125 14.089991693996126 20.030074832000537 14.610899391002022
9 pcie-0 2 False 1 8.996177889988758 14.809088679001434 20.504190309002297 15.35507336599403
10 pcie-0.20 2 False 1 9.304163310007425 14.982763389009051 20.336440989020048 15.971490456024185
11 pcie-0.55 2 False 1 8.714283154986333 13.42088939200039 19.9461287749873 15.02584775199648
12 pcie-0.70 2 False 1 8.697994253016077 13.459065130999079 19.731078754994087 14.305683915998088
13 pcie-auto 2 False 1 8.363476319005713 13.447256416024175 19.72966661900864 13.823816365998937
14 pipeline-mtp-1 2 False 1 8.843437764997361 12.564474981016247 18.932262471993454 12.610575572005473
15 pipeline-mtp-1-adapt 2 False 1 8.862642947002314 12.455201748991385 19.215229969995562 14.008869001001585
16 pipeline-mtp-2 2 False 1 8.868995849014027 12.488866666011745 19.238163303001784 13.144396143994527
17 pipeline-no-mtp 2 False 3 8.65587551498902 11.916466220020084 18.710607298009563 12.466519590001553
18 prefill-auto-16384 2 False 1 8.94379894901067 14.11206683400087 19.86685368901817 15.207310174999293
19 prefill-auto-4096 2 False 1 8.8007808419934 14.472956341982353 20.702254955016542 16.087477274995763
20 prefill-pipe 2 False 1 8.769305461988552 14.046128931018757 20.065059519023634 15.18391991200042
21 reserve-1280 2 False 1 9.136499082000228 14.485737823997624 20.410020737996092 15.095006340008695
22 reserve-1536 2 False 1 9.313047884003026 14.653002696984913 20.627258838998387 15.093888738017995
23 reserve-1792 2 False 1 9.295708458987065 14.647525854001287 21.654067722993204 16.064673538989155
24 reverse-gpu-order 2 False 1 15.465756284014788 23.273414330993546 34.24038853798993 25.11560440401081
25 routing-vendor-default 2 True 1 8.634641537995776 14.12820012497832 20.31148978602141 14.49921104797977
26 single-slot 1 False 1 7.986049310013186 10.028091496002162 6.971722193004098
27 spec-2 2 False 1 8.890295460994821 14.3908629079815 20.038221096998313 14.636577245022636
28 spec-6 2 False 1 8.942362873000093 14.034934884984978 20.526825990004 16.04197115098941
29 spec-min-0.50 2 False 1 9.332754542003386 14.366237092996016 20.032908740016865 15.27748521900503
30 spec-min-0.90 2 False 1 8.859180125989951 14.56505266498425 20.566143934003776 14.995015249995049
31 split-12 2 False 1 9.083140909002395 14.888665726990439 18.678638654004317 15.997854558983818
32 split-20 2 False 1 9.597749348002253 14.369733405008446 22.437504386994988 15.891439772996819
33 split-24 2 False 1 12.056439091014909 19.291080121998675 27.21408277298906 20.918910835986026
34 split-28 2 False 1 15.12356955499854 24.6780602580111 32.75016039700131 25.618643557012547
35 split-32 2 False 1 19.228713440999854 32.42352213000413 38.71521541301627 35.21655077001196
36 split-8 2 False 1 9.46037819000776 16.425696722988505 18.82920537699829 17.58725858302205
37 split-auto 2 False 1 10.599553116015159 16.458942107012263 23.562517772981664 17.265859521983657
@@ -0,0 +1,86 @@
"""NAS-side serial execution of a reviewed, finite follow-up plan.
Uses only the existing operator transport. Every planned trial, including an
incomplete/failed trial, remains in the journal. No automatic setting promotion.
"""
import argparse
import json
from pathlib import Path
import subprocess
import sys
import time
from typing import Any
import matrix
PHASES = {'screen', 'long64k', 'long128k', 'full256k', 'arrival', 'quality', 'calibrate'}
SAFETY_ERRORS = ('Host RAM/swap safety', 'became active or unavailable',
'GPU compute processes still exist', 'explicitly stopped/drained',
'Connection timed out', 'Permission denied', 'Owned test container',
'Production app image changed', 'User settings changed',
'Foreign GPU work appeared', 'GPU ownership unavailable')
def validate(plan):
allowed = {row['id'] for row in matrix.executable_arms()}
if not isinstance(plan, list) or not plan:
raise ValueError('Nonempty explicit plan required')
for row in plan:
if not isinstance(row, dict) or set(row) - {'arm', 'phase', 'repeat', 'combine', 'deadline'}:
raise ValueError('Unexpected plan fields')
if row.get('arm') not in allowed or row.get('phase') not in PHASES or row.get('repeat', 0) not in (0, 1, 2):
raise ValueError('Unknown arm, phase or repeat')
for name in row.get('combine', '').split(','):
if name and name not in {arm['id'] for arm in matrix.arms()}:
raise ValueError('Unknown combination')
if type(row.get('deadline', 1800)) is not int or not 60 <= row.get('deadline', 1800) <= 9000:
raise ValueError('Invalid finite deadline')
return plan
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--go', action='store_true')
parser.add_argument('--plan', type=Path, required=True)
parser.add_argument('--journal', type=Path, required=True)
options = parser.parse_args()
if not options.go:
parser.error('Explicit Michael Go required')
if options.journal.exists():
raise RuntimeError('Existing progress must not be overwritten')
plan = validate(json.loads(options.plan.read_text()))
record: dict[str, Any] = dict(commit=matrix.COMMIT, plan=plan, attempts=[], started_at=time.time(), state='running')
options.journal.parent.mkdir(parents=True, exist_ok=True)
def save():
temp = options.journal.with_suffix('.tmp')
temp.write_text(json.dumps(record, indent=2) + '\n')
temp.replace(options.journal)
save()
for index, trial in enumerate(plan):
record['current'] = trial
save()
print(json.dumps({'position': index + 1, 'total': len(plan), 'trial': trial, 'state': 'starting'}), flush=True)
command = [sys.executable, str(Path(__file__).with_name('operator_transport.py')), 'run', '--go',
'--arm', trial['arm'], '--phase', trial['phase'], '--repeat', str(trial.get('repeat', 0)),
'--deadline', str(trial.get('deadline', 1800))]
if trial.get('combine'):
command += ['--combine', trial['combine']]
started = time.monotonic()
result = subprocess.run(command, text=True, capture_output=True)
record['attempts'].append(dict(trial=trial, returncode=result.returncode,
elapsed_seconds=time.monotonic() - started, stdout=result.stdout, stderr=result.stderr))
save()
print(json.dumps({'completed_attempts': len(record['attempts']), 'total': len(plan),
'trial': trial, 'returncode': result.returncode}), flush=True)
if result.returncode and any(error in result.stdout + result.stderr for error in SAFETY_ERRORS):
record['state'] = 'aborted_safety_or_transport'
save()
raise SystemExit(2)
record.update(state='all_trials_attempted', finished_at=time.time(),
failed=sum(row['returncode'] != 0 for row in record['attempts']))
save()
assert len(record['attempts']) == len(plan)
print(json.dumps({'state': record['state'], 'attempts': len(record['attempts']), 'failed': record['failed']}), flush=True)
if __name__ == '__main__':
main()
@@ -0,0 +1,11 @@
{
"comparison_policy": "Historical observations only. No old-version inference or new old-version baseline. Cross-date figures are not a controlled causal version A/B.",
"observations": [
{"id": "prefill-auto-20261013", "engine": "0.1.43.1", "quant": "IQ3_XXS", "input_tokens": [1736, 6728, 26696], "prefill_tokens_per_second": [559.6, 1175.1, 1712.5], "source": "docs/experiments/iq3-prefill-2026-10-13/README.md"},
{"id": "pipeline-fixed16-20261014", "engine": "0.1.43.1", "expert_budget_gib": 16, "serial_short_pair_wall_s": 15.4, "pipeline_short_pair_wall_s": 11.3, "serial_fresh64k_pair_wall_s": 201.1, "pipeline_fresh64k_pair_wall_s": 162.0, "serial_cached_pair_wall_s": 21.7, "pipeline_cached_pair_wall_s": 98.3, "source": "docs/experiments/strata-batch-groups-2026-10-14/README.md"},
{"id": "ram-upgrade-20261020", "engine": "0.1.45", "slots": 2, "input_tokens": [65515, 65518], "fresh64k_pair_wall_s": 96.57, "cached64k_pair_wall_s": 17.56, "fresh_physical_reads_gib": 6.78, "cached_physical_reads_gib": 0.306, "actual_expert_budget_gib": 24.46, "cgroup_memory_gib": 58, "source": "docs/experiments/strata-dual-ram-2026-10-20/README.md"},
{"id": "half-context-20261020", "engine": "0.1.45", "single_input_tokens": 131072, "single_decode_tokens_per_second": 69.8, "single_ttft_s": 64.82, "dual_input_tokens": [131072, 131075], "dual_pair_wall_s": 198.28, "dual_physical_reads_gib": 8.891, "cgroup_memory_gib": 59, "source": "docs/experiments/strata-half-context-2026-10-20/README.md"},
{"id": "quality-xxs-20261023", "engine": "0.1.47", "quant": "IQ3_XXS", "tasks": 20, "repeats": 3, "core_successes": 57, "answers": 60, "weighted_decode_tokens_per_second": 77.5, "weighted_prefill_tokens_per_second": 169.9, "blind_score_out_of_10": 9.43, "source": "docs/experiments/strata-iq3-quality-2026-10-23/RESULTS.md"},
{"id": "near-full256k-postboot-20261026", "engine": "0.1.51", "input_tokens": 261114, "output_tokens": 256, "prefill_tokens_per_second": 1891.2, "decode_tokens_per_second": 52.4, "ttft_s": 138.2236, "wall_s": 143.0865, "prompt_cache_tokens": 0, "marker_successes": 3, "runs": 1, "source": "docs/maintenance/gpu-unlock-prepared-2026-10-26/README.md"}
]
}
@@ -0,0 +1,54 @@
"""Shared read-only host checks. No administrative login, drain or service stop."""
import hashlib
import json
from pathlib import Path
import subprocess
import urllib.request
BASE = Path('/opt/athena-deck-dev/runtime')
STATE = BASE / 'state'
STAGE = STATE / 'strata-candidate-v0.2.7'
def installed():
manifest = json.loads((BASE / 'installation.json').read_text())
info = json.loads(subprocess.check_output(['docker', 'inspect', manifest['name']], text=True))[0]
if manifest['name'] != 'athena-deck-dev' or not info['State']['Running']:
raise RuntimeError('Expected running managed Deck not found')
return manifest, info
def status(key):
request = urllib.request.Request('http://127.0.0.1:8108/api/v1/status',
headers={'Authorization': 'Bearer ' + key})
with urllib.request.urlopen(request, timeout=10) as response:
return json.load(response)
def assert_drained(key, check_gpus=True):
endpoint = status(key).get('endpoint', {})
count = endpoint.get('active_requests')
if endpoint.get('state') != 'stopped' or type(count) is not int or count != 0:
raise RuntimeError('Deck must be explicitly stopped/drained via its normal UI; unknown is not idle')
if (STATE / 'strata-worker/worker.json').exists():
raise RuntimeError('Production Strata worker is still present; no unload is performed here')
if check_gpus:
raw = subprocess.check_output(['nvidia-smi', '--query-compute-apps=pid',
'--format=csv,noheader,nounits'], text=True).strip()
if raw:
raise RuntimeError('GPU compute processes still exist; no foreign process is stopped')
return endpoint
def settings_hashes():
return {name: hashlib.file_digest((STATE / name).open('rb'), 'sha256').hexdigest()
for name in ('profiles.json', 'endpoint.json', 'audio-policy.json',
'cpu-partition.json', 'reasoning-budget.json') if (STATE / name).is_file()}
def safe_storage(path):
value = Path(path)
if not value.is_absolute() or 'vpn.auth' in value.parts or 'vpn' in value.parts or \
str(value).startswith('/mnt/nvme-storage/appdata/OpenVPN-KIT'):
raise ValueError('Not an allowed model storage path')
return value
@@ -0,0 +1,158 @@
"""Pure candidate matrix. No model calls, credentials or production changes."""
import copy
import json
from pathlib import Path
COMMIT = '5e8a4cca7d690ac60ca37eb09e7d0e010099ad6d'
VERSION = '0.1.52'
HERE = Path(__file__).resolve().parent
CURRENT_CPUS = [0, 1, 2, 3, 6, 7, 8, 9]
ALL_CPUS = list(range(12))
TUNED_FLAGS = ('--pcie-frac', '--spec-min-p', '--adapt-every', '--adapt-swaps', '--adapt-decay')
CPU_FLAGS = ('--host-core', '--pool-cores', '--pool-workers', '--aux-cpus')
def setarg(args, flag, value):
while flag in args:
index = args.index(flag)
del args[index:index + (1 if flag in ('--batch-mtp', '--vision') else 2)]
if value is not None and value is not False:
args.append(flag)
if value is not True:
args.append(str(value))
def arms():
rows = []
def add(name, **settings):
row = dict(id=name, slots=2, context=262144, split='16', gpu=[0, 1],
cpus=CURRENT_CPUS, flags={}, env={}, quality_tradeoff=False)
row.update(settings)
rows.append(row)
add('deck-reference-new')
add('compat-026', env={'STRATA_DEFAULTS': '026'})
add('vendor-defaults', vendor=True, split='auto', cpus=ALL_CPUS, quality_tradeoff=True)
add('layer-major-off', env={'STRATA_PREFILL_LAYER_MAJOR': '0'})
add('pipeline-no-mtp', flags={'--batch-groups': 'auto', '--batch-mtp': None})
for n in (1, 2):
add(f'pipeline-mtp-{n}', flags={'--batch-groups': 'auto'}, env={'STRATA_PIPED_MTP': str(n)})
add('pipeline-mtp-1-adapt', flags={'--batch-groups': 'auto'},
env={'STRATA_PIPED_MTP': '1', 'STRATA_PIPE_ADAPT_EVERY': '4'})
for split in ('8', '12', '20', '24', '28', '32', 'auto'):
add('split-' + split, split=split)
add('gpu-5080-only', gpu=[1], split=None)
add('reverse-gpu-order', gpu=[1, 0], split='24')
add('single-slot', slots=1)
for reserve in (1280, 1536, 1792):
add(f'reserve-{reserve}', flags={'--vram-reserve-mib': str(reserve),
'--vram-reserve-later-mib': str(reserve)})
for value in (None, '0', '0.20', '0.55', '0.70'):
add('pcie-' + ('auto' if value is None else value), flags={'--pcie-frac': value})
for value in ('auto:4096', 'auto:16384'):
add('prefill-' + value.replace(':', '-'), flags={'--prefill': value})
add('prefill-pipe', flags={'--prefill-pipe': '1'})
for count in (2, 6):
add(f'spec-{count}', flags={'--spec': str(count)})
for value in ('0.50', '0.90'):
add('spec-min-' + value, flags={'--spec-min-p': value})
add('all-cpu-pool5', cpus=ALL_CPUS, flags={'--host-core': 'first', '--pool-cores': '1,2,3,4,5',
'--pool-workers': '5', '--aux-cpus': '6,7,8,9,10,11'})
add('adapt-default', flags={'--adapt-every': None, '--adapt-swaps': None, '--adapt-decay': None})
add('routing-vendor-default', env={'STRATA_ROUTE_PRIOR': None}, quality_tradeoff=True)
add('approx-long-prompt', env={'STRATA_KVA': '1'}, quality_tradeoff=True)
assert len({row['id'] for row in rows}) == len(rows)
return rows
def extra_arms():
"""Explicit follow-up arms; never change the original 37-arm screen count."""
reference = copy.deepcopy(arms()[0])
reference.update(id='deck-calibrated', calibrated=True)
vendor = copy.deepcopy(next(row for row in arms() if row['id'] == 'vendor-defaults'))
vendor.update(id='vendor-safe-1536', safety_override='1536 MiB reserve on each card')
vendor['flags'] = {'--vram-reserve-mib': '1536', '--vram-reserve-later-mib': '1536'}
return [reference, vendor]
def executable_arms():
return arms() + extra_arms()
def configuration(template, arm, runtime, output, token, port):
result = copy.deepcopy(template)
result.pop('api_key', None)
result.pop('previous_model', None)
result.pop('gpu_roles', None)
result.pop('split_serve', None)
args = result['args']
env = dict(result.get('env', {}))
# Start from a declared state, not inherited experimental speed switches.
env = {k: v for k, v in env.items() if k in
('STRATA_ROUTE_TAIL_SKIP', 'STRATA_STAGE_TRIM', 'STRATA_RESIDENT_HEADROOM_GIB')}
env.update(STRATA_ROUTE_PRIOR='0', STRATA_ROUTE_TAIL_SKIP='0')
if arm.get('vendor'):
for flag in (*TUNED_FLAGS, *CPU_FLAGS, '--batch-groups', '--batch-mtp',
'--vram-reserve-mib', '--vram-reserve-later-mib'):
setarg(args, flag, None)
env = {} # The pinned provider defaults, including per-card routing bias.
setarg(args, '--max-context', arm['context'])
for flag, value in arm['flags'].items():
setarg(args, flag, value)
for key, value in arm['env'].items():
if value is None:
env.pop(key, None)
else:
env[key] = value
if arm['slots'] == 1:
setarg(args, '--batch-mtp', None)
setarg(args, '--batch-groups', None)
if len(arm['gpu']) == 1:
result.pop('layer_split', None)
for flag in ('--vram-reserve-later-mib',):
setarg(args, flag, None)
else:
result['layer_split'] = arm['split']
result.update(exe=str(runtime / 'source/engine/strata'), cwd=str(runtime / 'source'),
host='127.0.0.1', port=port, api_key=token, env=env, gpu=arm['gpu'],
gpu_order='as_given', parallel=arm['slots'], model_name='synthetic-strata-027',
open_browser=False, vram_elastic=False, log=str(output / 'engine.log'))
# Keep existing CPU vision/model paths; no weight downloads or new quantization.
if result.get('vision') and isinstance(result['vision'], dict):
result['vision']['exe'] = str(runtime / 'source/engine/strata-vision')
return result
def combine(primary, additions):
result = copy.deepcopy(primary)
if primary.get('vendor') or any(row.get('vendor') for row in additions):
raise ValueError('Measure the unmodified vendor arm separately')
result['components'] = [primary['id']] + [row['id'] for row in additions]
for row in additions:
result['flags'].update(row['flags'])
result['env'].update(row['env'])
result['quality_tradeoff'] |= row['quality_tradeoff']
if row['id'].startswith(('split-', 'gpu-', 'reverse-')):
result['split'], result['gpu'] = row['split'], row['gpu']
if row['id'] == 'single-slot':
result['slots'] = 1
if row['id'] == 'all-cpu-pool5':
result['cpus'] = row['cpus']
return result
def plan():
return dict(release='v0.2.7', commit=COMMIT, engine=VERSION,
historical_only=True, old_version_execution_forbidden=True,
phases=['screen all arms with short solo/pair and fresh/cached 8K',
'repeat finalists interleaved; 64K fresh pair and 3 cached turns',
'combine winning split/scheduler/reserve/tuning; repeat, do not assume additive gains',
'finalists: 128K pair, 261114-token solo, arrival of a long prompt during decode',
'finalists and every quality tradeoff: existing 20 tasks, seeds 42/43/44; blind scoring',
'retain separate solo, concurrent, long-context and quality-constrained leaderboards'],
arms=arms(),
promotion_requires_separate_go=True, inference_requires_separate_go=True,
no_automatic_production_configuration=True)
if __name__ == '__main__':
print(json.dumps(plan(), indent=2))
@@ -0,0 +1,70 @@
"""NAS Hermes-profile transport, not an Athena-host script.
Run with PYTHONPATH=/opt/hermes /opt/hermes/.venv/bin/python. Uses only this
profile's existing managed Athena API identity in memory, never its password.
"""
import argparse
import contextlib
import io
import json
import logging
from pathlib import Path
import shlex
import subprocess
import matrix
PROFILE = Path('/opt/data/profiles/athena-deck')
HOST_SCRIPTS = '/opt/athena-deck-dev/strata-027-preparation-20261027/'
def key():
from hermes_constants import set_hermes_home_override, reset_hermes_home_override
from agent.secret_scope import build_profile_secret_scope, set_secret_scope, reset_secret_scope
from hermes_cli.runtime_provider import resolve_runtime_provider
logging.disable(logging.CRITICAL)
home = set_hermes_home_override(PROFILE)
scope = set_secret_scope(build_profile_secret_scope(PROFILE), profile_home=str(PROFILE))
try:
with contextlib.redirect_stdout(io.StringIO()):
route = resolve_runtime_provider(requested='Athena')
assert route['base_url'].rstrip('/') == 'http://192.168.1.212:8120/v1'
value = route['api_key']
assert isinstance(value, str) and value
return value
finally:
reset_secret_scope(scope)
reset_hermes_home_override(home)
def call(operation, arm=None, phase='screen', repeat=0, combine='', deadline=1800):
if operation in ('promote', 'finalize', 'verify'):
command = ['python3', HOST_SCRIPTS + 'activate.py', operation, '--go']
elif operation == 'run':
assert arm in {row['id'] for row in matrix.executable_arms()}
command = ['python3', HOST_SCRIPTS + 'run_tests.py', '--execute', '--go', '--arm', arm,
'--phase', phase, '--repeat', str(repeat), '--deadline', str(deadline)]
if combine:
command += ['--combine', combine]
else:
raise ValueError('Unknown approved operation')
return subprocess.run(['athena-ssh', shlex.join(command)],
input=json.dumps({'key': key()}), text=True).returncode
def main():
parser = argparse.ArgumentParser()
parser.add_argument('operation', choices=['promote', 'finalize', 'verify', 'run'])
parser.add_argument('--go', action='store_true')
parser.add_argument('--arm', choices=[row['id'] for row in matrix.executable_arms()])
parser.add_argument('--phase', choices=['screen', 'long64k', 'long128k', 'full256k', 'arrival', 'quality', 'calibrate'], default='screen')
parser.add_argument('--repeat', type=int, choices=[0, 1, 2], default=0)
parser.add_argument('--combine', default='')
parser.add_argument('--deadline', type=int, default=1800)
options = parser.parse_args()
if not options.go:
parser.error('Explicit Michael Go required before resolving the managed identity')
raise SystemExit(call(options.operation, options.arm, options.phase, options.repeat, options.combine, options.deadline))
if __name__ == '__main__':
main()
@@ -0,0 +1,99 @@
"""Athena build transport. Writes only the isolated candidate, never production."""
import argparse
import hashlib
import json
from pathlib import Path
import shutil
import subprocess
import time
COMMIT = '5e8a4cca7d690ac60ca37eb09e7d0e010099ad6d'
BASE = Path('/opt/athena-deck-dev/runtime')
PRODUCTION = BASE / 'state/strata-runtime'
STAGE = BASE / 'state/strata-candidate-v0.2.7'
RUNTIME = STAGE / 'runtime'
NAME = 'athena-strata-build-027'
def production_hashes():
paths = [PRODUCTION / 'source/engine/strata', PRODUCTION / 'source/serve/server.py',
PRODUCTION / 'ready.json', Path('/opt/athena-deck-dev/source/strata_sources.json')]
paths += [BASE / 'state' / name for name in
('profiles.json', 'endpoint.json', 'audio-policy.json', 'cpu-partition.json', 'reasoning-budget.json')]
return {str(p): hashlib.file_digest(p.open('rb'), 'sha256').hexdigest()
for p in paths if p.is_file()}
def prepare():
available = int(next(line.split()[1] for line in Path('/proc/meminfo').read_text().splitlines()
if line.startswith('MemAvailable:'))) / 1024 ** 2
if available < 6:
raise RuntimeError('Less than 6 GiB available: build not started; production untouched')
if shutil.disk_usage(BASE / 'state').free < 20 * 1024 ** 3:
raise RuntimeError('Less than 20 GiB free: build not started')
cfg = json.loads((BASE / 'installation.json').read_text())
info = json.loads(subprocess.check_output(['docker', 'inspect', cfg['name']], text=True))[0]
assert info['State']['Running']
image = info['Config']['Image'] # Preserve the actual current app/TTS image, not an old handoff image.
if STAGE.exists():
marker = json.loads((STAGE / 'candidate.json').read_text())
assert marker['commit'] == COMMIT and marker['activated'] is False
status_path = RUNTIME / 'candidate-status.json'
if status_path.exists() and json.loads(status_path.read_text())['state'] in ('building', 'built'):
raise RuntimeError('Candidate already building/built: inspect it; do not launch a duplicate')
source = RUNTIME / 'source'
if not source.exists():
source.mkdir(parents=True)
subprocess.run(['git', 'init', '-q', source], check=True)
subprocess.run(['git', '-C', source, 'fetch', '--depth', '1',
'https://github.com/Niko1221/Strata.git', COMMIT], check=True)
subprocess.run(['git', '-C', source, 'checkout', '-q', '--detach', 'FETCH_HEAD'], check=True)
assert subprocess.check_output(['git', '-C', source, 'rev-parse', 'HEAD'], text=True).strip() == COMMIT
(STAGE / 'candidate.json').write_text(json.dumps(dict(
release='v0.2.7', commit=COMMIT, activated=False, purpose='build-only-awaiting-explicit-Go'), indent=2) + '\n')
recipe = STAGE / 'recipe'
(recipe / 'deploy').mkdir(parents=True, exist_ok=True)
for name in ('install_strata.py', 'strata_toolkit.py', 'strata-cuda13.lock.json'):
shutil.copy2(Path('/opt/athena-deck-dev/source/deploy') / name, recipe / 'deploy' / name)
sources = json.loads(Path('/opt/athena-deck-dev/source/strata_sources.json').read_text())
sources.update(code=COMMIT, version='0.1.52')
(recipe / 'strata_sources.json').write_text(json.dumps(sources, indent=2) + '\n')
shutil.copy2(Path(__file__).with_name('build.py'), recipe / 'build.py')
(RUNTIME / 'compile-pools.cmake').write_text(
'set(CMAKE_JOB_POOLS "strata_compile=1;strata_link=1" CACHE STRING "Background limits")\n'
'set(CMAKE_JOB_POOL_COMPILE strata_compile CACHE STRING "Compile pool")\n'
'set(CMAKE_JOB_POOL_LINK strata_link CACHE STRING "Link pool")\n')
before = dict(created=time.time(), production_hashes=production_hashes(),
production_image=image, production_started=info['State']['StartedAt'],
production_container=cfg['name'], mem_available_gib=available,
activated=False, inference_performed=False)
(STAGE / 'production-before.json').write_text(json.dumps(before, indent=2) + '\n')
# STAGE was created by this controller and contains only its own public build inputs.
subprocess.run(['chown', '-R', '65534:65534', STAGE], check=True)
command = ['docker', 'run', '-d', '--rm', '--name', NAME, '--cpus', '1', '--cpu-shares', '2',
'--memory', '2560m', '--memory-swap', '6g', '--pids-limit', '384',
'--cap-drop', 'ALL', '--security-opt', 'no-new-privileges', '--user', '65534:65534',
'--entrypoint', 'nice', '-e', 'HOME=/var/lib/deck/strata-runtime/home',
'-e', 'NVIDIA_VISIBLE_DEVICES=void', '-e', 'CUDA_VISIBLE_DEVICES=',
'-e', 'OPENBLAS_NUM_THREADS=1', '-e', 'OMP_NUM_THREADS=1',
'-v', str(RUNTIME) + ':/var/lib/deck/strata-runtime',
'-v', str(PRODUCTION / 'cuda') + ':/var/lib/deck/strata-runtime/cuda:ro',
'-v', str(recipe) + ':/build:ro', image, '-n', '19', 'python3', '/build/build.py']
cid = subprocess.check_output(command, text=True).strip()
after = json.loads(subprocess.check_output(['docker', 'inspect', NAME], text=True))[0]
assert not after['HostConfig'].get('DeviceRequests')
assert len(after['Mounts']) == 3
assert sum(bool(mount['RW']) for mount in after['Mounts']) == 1
assert after['HostConfig']['NanoCpus'] == 1_000_000_000
print(json.dumps(dict(build_started=True, container_id=cid[:12], stage=str(STAGE),
image=image, cpu_quota=1, memory_gib=2.5, memory_plus_swap_gib=6,
gpu_devices_exposed=False, production_unchanged=True, activated=False)))
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--start-build', action='store_true')
options = parser.parse_args()
if not options.start_build:
parser.error('Explicit --start-build required; no changes made')
prepare()
@@ -0,0 +1,55 @@
"""NAS-side anonymization of real synthetic quality answers before manual scoring.
Do not open identity-map.json until blind-assessment.json has been finalized.
No additional model/API call or generated-code execution is performed here.
"""
import argparse
import json
import os
from pathlib import Path
import secrets
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--evidence', type=Path, required=True)
parser.add_argument('--output', type=Path, required=True)
options = parser.parse_args()
if options.output.exists():
raise RuntimeError('Refuse to overwrite a blind evaluation')
data = json.loads(options.evidence.read_text())
answers, identities = [], {}
for run, record in data['runs'].items():
provenance = record.get('result/provenance.json', {})
if provenance.get('phase') != 'quality':
continue
arm = provenance['arm']
for name, rows in record.items():
if not name.endswith('.jsonl'):
continue
for row in rows:
identity = secrets.token_hex(8)
identities[identity] = dict(run=run, variant='+'.join(arm.get('components', [arm['id']])),
case_id=row['case_id'], repeat=row['repeat'], seed=row['seed'])
answers.append(dict(answer_id=identity, case_id=row['case_id'], category=row['category'],
answer=row['answer'], error=row.get('error'), truncated=row.get('truncated', False),
tool_checks=row.get('tool_checks', [])))
if not answers:
raise RuntimeError('No actual quality answers to anonymize')
secrets.SystemRandom().shuffle(answers)
options.output.mkdir(mode=0o700)
(options.output / 'blind-answers.json').write_text(json.dumps(answers, indent=2, ensure_ascii=False) + '\n')
mapping = options.output / 'identity-map.json'
mapping.write_text(json.dumps(identities, indent=2) + '\n')
os.chmod(mapping, 0o600)
cases = sorted({answer['case_id'] for answer in answers})
for case in cases:
(options.output / ('blind-' + case + '.json')).write_text(json.dumps(
[answer for answer in answers if answer['case_id'] == case], indent=2, ensure_ascii=False) + '\n')
assert len(identities) == len(answers)
print(json.dumps({'answers': len(answers), 'independent_cases': len(cases),
'identity_map_withheld': True, 'output': str(options.output)}))
if __name__ == '__main__':
main()
@@ -0,0 +1,48 @@
"""Prepare a tiny app recipe image only. Never starts/stops production or activates it."""
import argparse
import json
from pathlib import Path
import subprocess
import host_support as host
import matrix
def prepare_image():
_, info = host.installed()
context = host.STAGE / 'image-recipe'
context.mkdir(mode=0o700, exist_ok=True)
recipe = json.loads(Path('/opt/athena-deck-dev/source/strata_sources.json').read_text())
recipe.update(code=matrix.COMMIT, version=matrix.VERSION)
recipe['performance']['IQ3_XXS']['environment']['STRATA_ROUTE_PRIOR'] = '0'
(context / 'strata_sources.json').write_text(json.dumps(recipe, indent=2) + '\n')
(context / 'Dockerfile').write_text('FROM ' + info['Config']['Image'] + '\n'
'USER root\nCOPY --chmod=0644 strata_sources.json /app/strata_sources.json\nUSER 65534:65534\n')
(context / '.dockerignore').write_text('*\n!Dockerfile\n!strata_sources.json\n')
tag = 'athena-deck-standalone:strata-0.1.52-prepared-20261027'
subprocess.run(['docker', 'build', '--network', 'none', '--pull=false', '-t', tag, context], check=True)
image_id = subprocess.check_output(['docker', 'image', 'inspect', '--format', '{{.Id}}', tag], text=True).strip()
probe = ('import json;d=json.load(open("/app/strata_sources.json"));'
'print(json.dumps({"code":d["code"],"version":d["version"],'
'"route_prior":d["performance"]["IQ3_XXS"]["environment"]["STRATA_ROUTE_PRIOR"]}))')
actual = json.loads(subprocess.check_output(['docker', 'run', '--rm', '--network', 'none',
'--cpus', '0.25', '--memory', '128m', '--entrypoint', 'python3', tag, '-c', probe], text=True))
assert actual == dict(code=matrix.COMMIT, version=matrix.VERSION, route_prior='0')
_, after = host.installed()
assert after['Image'] == info['Image'] and after['State']['StartedAt'] == info['State']['StartedAt']
record = dict(image=tag, image_id=image_id, base_image=info['Config']['Image'],
base_image_id=info['Image'], commit=matrix.COMMIT, activated=False,
production_unchanged=True, actual_recipe=actual,
production_source_pin_unchanged=True)
target = host.STAGE / 'prepared-image.json'
target.write_text(json.dumps(record, indent=2) + '\n')
assert json.loads(target.read_text()) == record
print(json.dumps(record))
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--prepare-image', action='store_true')
arguments = parser.parse_args()
if not arguments.prepare_image:
parser.error('--prepare-image required; no activation path exists in this tool')
prepare_image()
@@ -0,0 +1,41 @@
"""Capture only allowlisted test configuration; no API key, model call or unload."""
import argparse
import json
import os
from pathlib import Path
import host_support as host
FIELDS = ('args', 'tokenizer', 'gpu', 'gpu_order', 'layer_split', 'parallel',
'reasoning_loop_recovery', 'vision', 'env')
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--capture', action='store_true')
options = parser.parse_args()
if not options.capture:
parser.error('--capture required; nothing read or changed')
worker = json.loads((host.STATE / 'strata-worker/worker.json').read_text())
template = {field: worker[field] for field in FIELDS if field in worker}
template['env'] = {k: v for k, v in template.get('env', {}).items()
if k in ('STRATA_ROUTE_TAIL_SKIP', 'STRATA_STAGE_TRIM', 'STRATA_RESIDENT_HEADROOM_GIB')}
manifest, _ = host.installed()
roots = [host.safe_storage(manifest['strata_storage'])]
roots += [host.safe_storage(value) for value in manifest.get('strata_storage_mounts', [])]
directory = host.STAGE / 'tests'
directory.mkdir(mode=0o700, exist_ok=True)
os.chown(directory, 65534, 65534)
for name, value in (('template.json', template),
('model-mounts.json', sorted(set(map(str, roots))))):
target = directory / name
target.write_text(json.dumps(value, indent=2) + '\n')
target.chmod(0o600)
os.chown(target, 65534, 65534)
actual = json.loads(target.read_text())
assert actual == value
print(json.dumps(dict(captured=True, fields=sorted(template), credentials_saved=False,
inference_performed=False, production_changed=False)))
if __name__ == '__main__':
main()
@@ -0,0 +1,64 @@
"""Summarize real future run artifacts; never invent a result or declare quality from speed."""
import argparse
from collections import defaultdict
import json
from pathlib import Path
import statistics
def summarize(root):
accepted = []
failures = []
groups = defaultdict(list)
for directory in sorted(root.iterdir()) if root.exists() else []:
if not directory.is_dir():
continue
host_path = directory / 'host-result.json'
provenance_path = directory / 'result/provenance.json'
if not host_path.is_file() or not provenance_path.is_file():
failures.append(dict(run=directory.name, reason='missing completion evidence'))
continue
host = json.loads(host_path.read_text())
provenance = json.loads(provenance_path.read_text())
if host.get('failure') or host.get('settings_unchanged') is not True or provenance.get('state') != 'complete':
failures.append(dict(run=directory.name, reason='failed/aborted or settings changed'))
continue
if (directory / 'result/results.json').is_file() and not provenance.get('resource_accounting'):
failures.append(dict(run=directory.name,
reason='initial pilot: CPU/IO accounting omitted thread-spawned engine; excluded from ranking; timings retained as evidence'))
continue
arm = provenance['arm']
variant = tuple(arm.get('components', [arm['id']]))
accepted.append(directory.name)
results_path = directory / 'result/results.json'
if not results_path.is_file():
continue # Quality/calibration are separate evidence, not throughput measurements.
for row in json.loads(results_path.read_text()):
if row['resources'].get('oom_kill_delta'):
failures.append(dict(run=directory.name, reason='OOM in measured case'))
continue
backend = [request.get('backend_timings', {}).get('predicted_per_second') for request in row['rows']]
key = (variant, provenance['phase'], row['case'])
groups[key].append(dict(wall_seconds=row['wall_seconds'],
aggregate_whole_request_output_tok_s=row['aggregate_output_tok_s'],
backend_decode_tok_s_per_request=backend,
cached_tokens_per_request=[request.get('usage', {}).get('prompt_tokens_details', {}).get('cached_tokens')
for request in row['rows']],
resources=row['resources'], quality_tradeoff=arm['quality_tradeoff']))
measurements = []
for (variant, phase, case), rows in sorted(groups.items()):
measurements.append(dict(variant=list(variant), phase=phase, case=case, repeats=len(rows),
median_wall_seconds=statistics.median(row['wall_seconds'] for row in rows),
median_whole_request_output_tok_s=statistics.median(row['aggregate_whole_request_output_tok_s'] for row in rows),
quality_tradeoff=any(row['quality_tradeoff'] for row in rows), trials=rows))
return dict(accepted_runs=accepted, failed_or_incomplete_runs=failures, measurements=measurements,
historical_comparison='descriptive only; no old-version run',
quality_acceptance='requires blind scoring and isolated code checks; never inferred from throughput',
winner=None, winner_reason='No automatic production winner; validate repeats, cache retention, headroom and quality')
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('runs', type=Path)
options = parser.parse_args()
print(json.dumps(summarize(options.runs), indent=2))
@@ -0,0 +1,151 @@
"""Host launcher for one future approved NEW-version arm; default is plan-only."""
import argparse
import json
from pathlib import Path
import subprocess
import sys
import time
import uuid
import host_support as host
import matrix
def owned_processes(pid, proc_root=Path('/proc')):
"""Only inspect descendants of the already verified owned test container."""
found = [pid]
for current in found:
try:
threads = list((proc_root / str(current) / 'task').iterdir())
except FileNotFoundError:
continue
for thread in threads:
try:
children = (thread / 'children').read_text().split()
except FileNotFoundError:
continue
found.extend(int(child) for child in children if int(child) not in found)
return found
def run(options, key):
runtime = host.STATE / 'strata-runtime'
if json.loads((runtime / 'ready.json').read_text()).get('commit') != matrix.COMMIT:
raise RuntimeError('New version must be installed first; OLD-version tests are forbidden')
manifest, info = host.installed()
activation = json.loads((host.STAGE / 'activation-result.json').read_text())
if info['Image'] != activation['previous_image_id']:
raise RuntimeError('Production app image changed; no test launched; preserve concurrent work')
if host.settings_hashes() != activation['settings_during_tests']:
raise RuntimeError('User settings changed; no test launched; preserve concurrent work')
host.assert_drained(key)
time.sleep(2)
host.assert_drained(key)
before = host.settings_hashes()
tests = host.STAGE / 'tests'
for name in ('template.json', 'model-mounts.json', 'legacy_benchmark.py', 'quality_steps.py',
'cases.json', 'baseline-256k-request.json', 'engine_test.py', 'matrix.py'):
if not (tests / name).is_file():
raise RuntimeError('Missing prepared asset: ' + name)
run_id = options.arm + '-' + options.phase + '-' + uuid.uuid4().hex[:8]
output = tests / 'runs' / run_id
output.mkdir(parents=True, mode=0o700, exist_ok=False)
subprocess.run(['chown', '65534:65534', output], check=True)
name = 'athena-strata-027-test-' + uuid.uuid4().hex[:10]
mounts = json.loads((tests / 'model-mounts.json').read_text())
command = ['docker', 'run', '-d', '--rm', '--name', name, '--network', 'none',
'--gpus', 'all', '--read-only', '--cap-drop', 'ALL', '--security-opt', 'no-new-privileges',
'--user', '65534:65534', '--cpus', '12', '--memory', '59g', '--memory-swap', '59g',
'--pids-limit', '512', '--tmpfs', '/scratch:rw,noexec,nosuid,size=64m,mode=1777',
'-e', 'TMPDIR=/scratch',
'-e', 'PYTHONDONTWRITEBYTECODE=1', '-e', 'NVIDIA_DRIVER_CAPABILITIES=compute,utility',
'--entrypoint', 'python3', '-v', str(runtime) + ':/var/lib/deck/strata-runtime:ro',
'-v', str(tests) + ':/test:ro', '-v', str(output) + ':/experiment']
for value in mounts:
path = host.safe_storage(value)
command += ['-v', str(path) + ':' + str(path) + ':ro']
command += [info['Config']['Image'], '/test/engine_test.py', '--execute', '--go',
'--arm', options.arm, '--phase', options.phase, '--repeat', str(options.repeat),
'--runtime', '/var/lib/deck/strata-runtime', '--template', '/test/template.json',
'--output', '/experiment/result']
if options.combine:
command += ['--combine', options.combine]
subprocess.run(command, check=True, stdout=subprocess.DEVNULL)
failure = None
started = time.monotonic()
initial_swap = None
try:
while True:
check = subprocess.run(['docker', 'inspect', name], text=True, capture_output=True)
if check.returncode:
break
instance = json.loads(check.stdout)[0]
if not any(m['Source'] == str(output) and m['RW'] for m in instance['Mounts']):
raise RuntimeError('Owned test container verification failed')
if not instance['State']['Running']:
break
try:
owned = set(owned_processes(instance['State']['Pid']))
raw = subprocess.check_output(['nvidia-smi', '--query-compute-apps=pid',
'--format=csv,noheader,nounits'], text=True, timeout=8)
if {int(pid) for pid in raw.split()} - owned:
failure = 'Foreign GPU work appeared; owned test stopped without touching foreign work'
except (OSError, ValueError, subprocess.SubprocessError):
failure = 'GPU ownership unavailable; owned test stopped; unknown is not idle'
try:
host.assert_drained(key, check_gpus=False)
except Exception:
failure = 'Production endpoint/worker became active or unavailable; owned test stopped'
mem = {line.split(':')[0]: int(line.split()[1])
for line in Path('/proc/meminfo').read_text().splitlines()}
swap = mem['SwapTotal'] - mem['SwapFree']
if initial_swap is None:
initial_swap = swap
if mem['MemAvailable'] < 2 * 1024 ** 2 or swap - initial_swap > 128 * 1024:
failure = 'Host RAM/swap safety threshold reached'
if time.monotonic() - started > options.deadline and not failure:
failure = 'Per-arm deadline reached'
if failure:
subprocess.run(['docker', 'stop', '--time', '20', name], check=True)
break
time.sleep(3)
finally:
own = subprocess.run(['docker', 'inspect', name], text=True, capture_output=True)
if own.returncode == 0:
instance = json.loads(own.stdout)[0]
if any(m['Source'] == str(output) and m['RW'] for m in instance['Mounts']):
subprocess.run(['docker', 'stop', '--time', '20', name], check=True)
unchanged = before == host.settings_hashes()
record = dict(run_id=run_id, arm=options.arm, combine=options.combine, phase=options.phase,
application_image=info['Config']['Image'], application_image_id=info['Image'],
failure=failure, settings_unchanged=unchanged,
production_restarted=False, production_automatically_restored=False,
operator_must_restore_endpoint_and_previous_profile=True)
(output / 'host-result.json').write_text(json.dumps(record, indent=2) + '\n')
provenance = output / 'result/provenance.json'
if failure or not unchanged or not provenance.is_file() or json.loads(provenance.read_text()).get('state') != 'complete':
reason = failure or ('User settings changed' if not unchanged else 'candidate failed or incomplete')
raise RuntimeError('Arm failed/aborted: ' + reason + '; inspect recorded evidence; not a speed result')
print(json.dumps(dict(complete=True, output=str(output), production_changed=False)))
def main(argv=None):
parser = argparse.ArgumentParser()
parser.add_argument('--execute', action='store_true')
parser.add_argument('--go', action='store_true')
parser.add_argument('--arm', choices=[row['id'] for row in matrix.executable_arms()], default='deck-reference-new')
parser.add_argument('--combine', default='')
parser.add_argument('--phase', choices=['screen', 'long64k', 'long128k', 'full256k', 'arrival', 'quality', 'calibrate'], default='screen')
parser.add_argument('--repeat', type=int, choices=[0, 1, 2], default=0)
parser.add_argument('--deadline', type=int, default=1800)
options = parser.parse_args(argv)
if not options.execute:
print(json.dumps(matrix.plan(), indent=2))
return 0
if not options.go:
parser.error('Separate explicit --go required before credentials or host state are read')
key = json.load(sys.stdin)['key'] # Existing managed API identity, in memory only.
return run(options, key)
if __name__ == '__main__':
main()
@@ -0,0 +1,70 @@
"""NAS-only bounded screening controller; no automatic production setting changes.
Requires the existing authorized maintenance window and managed Athena route.
Every arm is attempted once and recorded, including failures. Run only with
PYTHONPATH=/opt/hermes /opt/hermes/.venv/bin/python.
"""
import argparse
import json
from pathlib import Path
import subprocess
import sys
import time
from typing import Any
import matrix
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--go', action='store_true')
parser.add_argument('--journal', type=Path, required=True)
options = parser.parse_args()
if not options.go:
parser.error('Explicit Michael Go required')
if options.journal.exists():
raise RuntimeError('Journal exists: inspect and explicitly resume; never overwrite progress')
rows = matrix.arms()
record: dict[str, Any] = dict(commit=matrix.COMMIT, phase='screen', expected_arms=[row['id'] for row in rows],
attempts=[], started_at=time.time(), state='running')
options.journal.parent.mkdir(parents=True, exist_ok=True)
def save():
temp = options.journal.with_suffix('.tmp')
temp.write_text(json.dumps(record, indent=2) + '\n')
temp.replace(options.journal)
save()
for index, row in enumerate(rows):
record['current_arm'] = row['id']
save()
print(json.dumps({'arm': row['id'], 'position': index + 1, 'total': len(rows), 'state': 'starting'}), flush=True)
started = time.monotonic()
result = subprocess.run([sys.executable, str(Path(__file__).with_name('operator_transport.py')),
'run', '--go', '--arm', row['id'], '--phase', 'screen', '--deadline', '1200'], text=True, capture_output=True)
attempt = dict(arm=row['id'], returncode=result.returncode,
elapsed_seconds=time.monotonic() - started,
stdout=result.stdout, stderr=result.stderr)
record['attempts'].append(attempt)
save()
print(json.dumps({'arm': row['id'], 'returncode': result.returncode,
'attempted': len(record['attempts']), 'total': len(rows)}), flush=True)
if result.returncode:
print(result.stderr[-2500:], flush=True)
# A failed candidate is recorded, not hidden. A host/production/transport
# safety error ends the sweep rather than repeatedly challenging it.
infrastructure = ('Host RAM/swap safety', 'became active or unavailable',
'GPU compute processes still exist', 'explicitly stopped/drained',
'Connection timed out', 'Permission denied', 'Owned test container',
'Production app image changed', 'User settings changed')
if any(text in result.stderr + result.stdout for text in infrastructure):
record['state'] = 'aborted_safety_or_transport'
save()
raise SystemExit(2)
assert [row['arm'] for row in record['attempts']] == record['expected_arms']
record.update(state='all_arms_attempted', finished_at=time.time(),
successful=sum(row['returncode'] == 0 for row in record['attempts']),
failed=sum(row['returncode'] != 0 for row in record['attempts']))
save()
print(json.dumps({k: record[k] for k in ('state', 'successful', 'failed')}), flush=True)
if __name__ == '__main__':
main()
@@ -0,0 +1,49 @@
"""Native filesystem promotion tests; synthetic files, no services or credentials."""
import contextlib
import io
from pathlib import Path
import tempfile
import unittest
from unittest.mock import patch
import activate
class NativePromotionTests(unittest.TestCase):
def test_no_go_exits_before_access(self):
with patch('sys.argv', ['activate.py', 'prepare']), patch.object(activate, 'prepare', side_effect=AssertionError('must not run')), contextlib.redirect_stderr(io.StringIO()):
with self.assertRaises(SystemExit) as error:
activate.main()
self.assertEqual(error.exception.code, 2)
def test_native_swap_preserves_cuda_and_learned_profile(self):
with tempfile.TemporaryDirectory() as name:
base = Path(name)
runtime, candidate, retained = base / 'runtime', base / 'candidate', base / 'retained'
for path in (runtime / 'source/data', runtime / 'cuda', candidate / 'source/engine'):
path.mkdir(parents=True)
(runtime / 'source/data/expert-profile.bin').write_bytes(b'synthetic-learned-placement')
(runtime / 'source/old-public-code').write_text('old')
(runtime / 'cuda/synthetic-toolkit').write_text('keep')
(candidate / 'source/engine/strata').write_text('new')
for item in ('ready.json', 'compile-pools.cmake', 'deepseek-build.json'):
(candidate / item).write_text('{}')
(runtime / 'vision-ready.json').write_text('{"code":"old","custom":"keep"}')
with patch.object(activate.os, 'chown'):
activate.promote_runtime(candidate, runtime, retained)
self.assertEqual((runtime / 'source/engine/strata').read_text(), 'new')
self.assertEqual((runtime / 'source/data/expert-profile.bin').read_bytes(), b'synthetic-learned-placement')
self.assertEqual((runtime / 'cuda/synthetic-toolkit').read_text(), 'keep')
self.assertTrue((retained / 'old-public-code').is_file())
self.assertIn('"custom": "keep"', (runtime / 'vision-ready.json').read_text())
def test_refuses_existing_retained_source_without_modification(self):
with tempfile.TemporaryDirectory() as name:
base = Path(name)
retained = base / 'retained'
retained.mkdir()
with self.assertRaisesRegex(RuntimeError, 'destructive retry'):
activate.promote_runtime(base / 'candidate', base / 'runtime', retained)
if __name__ == '__main__':
unittest.main()
@@ -0,0 +1,141 @@
"""Offline preparation checks only. No model loads, GPU requests or production access."""
import contextlib
import copy
import io
import json
from pathlib import Path
import tempfile
import unittest
from unittest.mock import patch
import engine_test
import host_support
import matrix
import run_tests
TEMPLATE = dict(api_key='must-not-survive', gpu=[0, 1], layer_split='16', parallel=2,
args=['--pack', '/models/pack', '--native', '/models/model.gguf', '--ple-gguf', '/models/ple.gguf',
'--mtp', '/models/mtp', '--expert-cache', 'auto', '--prefill', 'auto', '--spec', '4',
'--spec-min-p', '0.70', '--max-context', '262144', '--kv', 'int8', '--kv-resident', '32768',
'--vram-reserve-mib', '1024', '--vram-reserve-later-mib', '1024', '--batch-mtp',
'--batch-groups', '1', '--pcie-frac', '0.35', '--adapt-every', '1', '--adapt-swaps', '80',
'--adapt-decay', '0.97', '--host-core', 'first', '--pool-cores', '1,2,3', '--pool-workers', '3',
'--aux-cpus', '6,7,8,9', '--resident-experts'],
env={'STRATA_STAGE_TRIM': '1', 'STRATA_ROUTE_TAIL_SKIP': '0', 'STRATA_RESIDENT_HEADROOM_GIB': '6'})
class PreparationTests(unittest.TestCase):
def cfg(self, arm):
return matrix.configuration(TEMPLATE, arm, Path('/candidate'), Path('/out'), 'synthetic-test-key', 19001)
def test_all_arm_ids_unique_and_no_template_mutation(self):
before = copy.deepcopy(TEMPLATE)
rows = matrix.arms()
self.assertEqual(len(rows), len({row['id'] for row in rows}))
for row in rows:
with self.subTest(arm=row['id']):
cfg = self.cfg(row)
self.assertEqual(cfg['exe'], '/candidate/source/engine/strata')
self.assertEqual(cfg['api_key'], 'synthetic-test-key')
self.assertNotIn('must-not-survive', json.dumps(cfg))
self.assertEqual(cfg['args'].count('--max-context'), 1)
self.assertEqual(cfg['parallel'], row['slots'])
self.assertEqual(TEMPLATE, before)
def test_reference_retains_serial_groups_and_safe_route(self):
cfg = self.cfg(matrix.arms()[0])
self.assertEqual(cfg['args'][cfg['args'].index('--batch-groups') + 1], '1')
self.assertEqual(cfg['env']['STRATA_ROUTE_PRIOR'], '0')
self.assertNotIn('STRATA_PREFILL_LAYER_MAJOR', cfg['env'])
def test_provider_defaults_remove_our_overrides(self):
cfg = self.cfg(next(row for row in matrix.arms() if row['id'] == 'vendor-defaults'))
self.assertEqual(cfg['env'], {})
for flag in (*matrix.TUNED_FLAGS, *matrix.CPU_FLAGS, '--batch-groups', '--batch-mtp'):
self.assertNotIn(flag, cfg['args'])
self.assertEqual(cfg['layer_split'], 'auto')
def test_single_card_single_slot_and_reverse(self):
rows = {row['id']: row for row in matrix.arms()}
single = self.cfg(rows['gpu-5080-only'])
self.assertNotIn('layer_split', single)
self.assertEqual(single['gpu'], [1])
slot = self.cfg(rows['single-slot'])
self.assertNotIn('--batch-mtp', slot['args'])
self.assertEqual(self.cfg(rows['reverse-gpu-order'])['gpu'], [1, 0])
def test_followups_keep_original_screen_and_vendor_identity(self):
self.assertEqual(len(matrix.arms()), 37)
extras = {row['id']: row for row in matrix.extra_arms()}
cfg = self.cfg(extras['vendor-safe-1536'])
self.assertEqual(cfg['env'], {})
self.assertTrue(extras['vendor-safe-1536']['quality_tradeoff'])
self.assertEqual(cfg['args'][cfg['args'].index('--vram-reserve-later-mib') + 1], '1536')
self.assertTrue(extras['deck-calibrated']['calibrated'])
def test_prefill_pipe_requires_a_numeric_argument_and_removes_it_cleanly(self):
row = next(row for row in matrix.arms() if row['id'] == 'prefill-pipe')
args = self.cfg(row)['args']
index = args.index('--prefill-pipe')
self.assertEqual(args[index:index + 2], ['--prefill-pipe', '1'])
args = ['--prefill-pipe', '768', '--spec', '4']
matrix.setarg(args, '--prefill-pipe', None)
self.assertEqual(args, ['--spec', '4'])
def test_combined_finalist_keeps_explicit_components(self):
rows = {row['id']: row for row in matrix.arms()}
result = matrix.combine(rows['split-12'], [rows['pipeline-mtp-1'], rows['reserve-1536']])
cfg = self.cfg(result)
self.assertEqual(cfg['layer_split'], '12')
self.assertEqual(cfg['env']['STRATA_PIPED_MTP'], '1')
self.assertEqual(cfg['args'][cfg['args'].index('--vram-reserve-mib') + 1], '1536')
with self.assertRaises(ValueError):
matrix.combine(rows['vendor-defaults'], [rows['split-12']])
def test_plan_does_not_read_credentials_or_host(self):
for module in (run_tests, engine_test):
with self.subTest(module=module.__name__), patch('json.load', side_effect=AssertionError('secret read')), \
patch.object(module, 'run', side_effect=AssertionError('execution')), contextlib.redirect_stdout(io.StringIO()):
self.assertEqual(module.main([]), 0)
def test_execute_without_go_rejected_before_io(self):
for module in (run_tests, engine_test):
with self.subTest(module=module.__name__), patch('json.load', side_effect=AssertionError('secret read')), \
contextlib.redirect_stderr(io.StringIO()):
with self.assertRaises(SystemExit) as result:
module.main(['--execute'])
self.assertEqual(result.exception.code, 2)
def test_old_runtime_refused_before_model_or_subprocess(self):
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
(root / 'ready.json').write_text(json.dumps({'commit': '4b9e05a2a806a3fe24f7b2560d98626c37dade35'}))
with patch.object(engine_test.subprocess, 'check_output', side_effect=AssertionError('must not execute')):
with self.assertRaisesRegex(RuntimeError, 'NEW version'):
engine_test.main(['--execute', '--go', '--runtime', str(root), '--template', '/absent', '--output', '/absent'])
def test_missing_idle_counter_rejected(self):
for value in ({'state': 'stopped'}, {'state': 'stopped', 'active_requests': False},
{'state': 'running', 'active_requests': 0}, {'state': 'stopped', 'active_requests': 1}):
with self.subTest(value=value), patch.object(host_support, 'status', return_value={'endpoint': value}):
with self.assertRaises(RuntimeError):
host_support.assert_drained('synthetic', check_gpus=False)
def test_storage_rejects_excluded_paths_without_access(self):
for value in ('relative', '/vpn', '/mnt/nvme-storage/appdata/OpenVPN-KIT'):
with self.assertRaises(ValueError):
host_support.safe_storage(value)
self.assertEqual(host_support.safe_storage('/data/athena-deck-strata'), Path('/data/athena-deck-strata'))
def test_actual_fixture_markers_and_quality_count(self):
docs = Path(__file__).resolve().parents[2]
request = json.loads((docs / 'maintenance/gpu-unlock-prepared-2026-10-26/evidence/baseline-256k-request.json').read_text())
text = json.dumps(request['messages'])
for marker in ('ALPHA_314159', 'BETA_271828', 'GAMMA_161803'):
self.assertIn(marker, text)
cases = json.loads((docs / 'experiments/strata-iq3-quality-2026-10-23/cases.json').read_text())
self.assertEqual(len(cases), 20)
self.assertEqual(len({case['id'] for case in cases}), 20)
if __name__ == '__main__':
unittest.main()
@@ -0,0 +1,23 @@
"""Regression: a Python server can spawn its engine from a non-main thread."""
from pathlib import Path
import tempfile
import unittest
import engine_test
import run_tests
class ProcessAccountingTests(unittest.TestCase):
def test_follows_children_of_every_thread_not_only_main(self):
with tempfile.TemporaryDirectory() as name:
root = Path(name)
for pid, tid, children in ((100, 100, ''), (100, 101, '200'), (200, 200, '300'), (300, 300, '')):
path = root / str(pid) / 'task' / str(tid)
path.mkdir(parents=True, exist_ok=True)
(path / 'children').write_text(children)
for module in (engine_test, run_tests):
with self.subTest(module=module.__name__):
self.assertEqual(module.owned_processes(100, proc_root=root), [100, 200, 300])
if __name__ == '__main__':
unittest.main()
@@ -0,0 +1,44 @@
"""Synthetic artifact acceptance/ranking checks; never executes model code."""
import copy
import unittest
import analyze_screens
import matrix
def record(arm, seconds=10, complete=True, accounting=True):
rows = [dict(case=case, wall_seconds=seconds,
rows=[dict(usage={'prompt_tokens_details': {'cached_tokens': 0}},
backend_timings={'predicted_per_second': 12, 'prompt_per_second': 34})],
resources=dict(oom_kill_delta=0, cpu_cores=2, read_gib=0, peak_memory_gib=4))
for case in analyze_screens.CASES]
provenance = dict(arm=arm, phase='screen', state='complete' if complete else 'failed')
if accounting:
provenance['resource_accounting'] = 'synthetic-all-thread-accounting'
return {'host-result.json': dict(failure=None, settings_unchanged=True),
'result/provenance.json': provenance, 'result/results.json': rows}
class ScreenAnalysisTests(unittest.TestCase):
def test_failed_and_initial_pilot_cannot_win(self):
arm = matrix.arms()[0]
data = {'runs': {'reference': record(arm), 'failed-fast': record(arm, 1, complete=False),
'pilot-fast': record(arm, 1, accounting=False)}}
result = analyze_screens.analyze(data)
self.assertEqual(result['complete_variants'][arm['id']]['cases']['solo-short-0']['median_wall_seconds'], 10)
self.assertEqual(len(result['failed_runs']), 1)
self.assertEqual(len(result['excluded_pilot_runs']), 1)
self.assertEqual(result['balanced_finalist_selection'][0]['balanced_screen_speed_ratio'], 1)
def test_quality_and_slot_changes_are_not_dual_slot_safe_winners(self):
base = matrix.arms()[0]
unsafe = copy.deepcopy(base)
unsafe.update(id='synthetic-quality-change', quality_tradeoff=True)
solo = copy.deepcopy(base)
solo.update(id='synthetic-single-slot', slots=1)
result = analyze_screens.analyze({'runs': {'base': record(base), 'unsafe': record(unsafe, 1), 'solo': record(solo, 1)}})
self.assertEqual([row['variant'] for row in result['balanced_finalist_selection']], ['deck-reference-new'])
self.assertEqual(result['complete_variants']['deck-reference-new']['cases']['solo-short-0']['backend_decode_tok_s_per_request'], [[12]])
if __name__ == '__main__':
unittest.main()
@@ -0,0 +1,78 @@
"""Independent read-only candidate verification; versions/help only, no model inference."""
import hashlib
import json
from pathlib import Path
import re
import subprocess
import host_support as host
import matrix
def main():
runtime = host.STAGE / 'runtime'
built = json.loads((runtime / 'candidate-status.json').read_text())
assert built['state'] == 'built' and built['commit'] == matrix.COMMIT
assert built['activated'] is False and built['inference_performed'] is False
source = runtime / 'source'
git = ['git', '-c', 'safe.directory=' + str(source), '-C', str(source)]
assert subprocess.check_output(git + ['rev-parse', 'HEAD'], text=True).strip() == matrix.COMMIT
assert not subprocess.check_output(git + ['status', '--porcelain', '--untracked-files=no'], text=True).strip()
actual_hashes = {name: hashlib.file_digest((source / 'engine' / name).open('rb'), 'sha256').hexdigest()
for name in built['hashes']}
assert actual_hashes == built['hashes']
architectures = {}
for tree in ('build', 'build-dsv41'):
cache = (source / tree / 'CMakeCache.txt').read_text()
value = re.search(r'^CMAKE_CUDA_ARCHITECTURES:(?:STRING|UNINITIALIZED)=(.+)$', cache, re.M)
assert value and set(value.group(1).split(';')) == {'86', '120'}
architectures[tree] = value.group(1)
manifest, info = host.installed()
script = '''import json,os,pathlib,subprocess,re
p=pathlib.Path('/var/lib/deck/strata-runtime/source')
env=dict(os.environ,LD_LIBRARY_PATH='/var/lib/deck/strata-runtime/cuda/lib64:/var/lib/deck/strata-runtime/cuda/lib')
versions={name:subprocess.check_output([p/'engine'/name,'--version'],env=env,text=True,stderr=subprocess.STDOUT).strip() for name in ('strata','strata-dsv41')}
subprocess.check_output([p/'.venv/bin/python',p/'serve/server.py','--help'],env=env,text=True,stderr=subprocess.STDOUT)
linkage={}
for name in ('strata','strata-dsv41','strata-vision'):
text=subprocess.check_output(['ldd',p/'engine'/name],env=env,text=True,stderr=subprocess.STDOUT)
if 'not found' in text:raise RuntimeError('Missing linkage: '+name)
linkage[name]='resolved'
cu=pathlib.Path('/var/lib/deck/strata-runtime/cuda/bin/cuobjdump')
fatbins={}
if cu.exists():
for name in ('strata','strata-dsv41'):
text=subprocess.check_output([cu,'--list-elf',p/'engine'/name],env=env,text=True,stderr=subprocess.STDOUT)
fatbins[name]=sorted(set(re.findall(r'sm_(86|120)',text)))
print(json.dumps(dict(versions=versions,server_help=True,linkage=linkage,fatbin_architectures=fatbins)))
'''
result = json.loads(subprocess.check_output(['docker', 'run', '--rm', '--network', 'none',
'--cpus', '0.5', '--memory', '512m', '--cap-drop', 'ALL', '--security-opt', 'no-new-privileges',
'--user', '65534:65534', '--entrypoint', 'python3',
'-e', 'PYTHONDONTWRITEBYTECODE=1', '-e', 'NVIDIA_VISIBLE_DEVICES=void',
'-v', str(runtime) + ':/var/lib/deck/strata-runtime:ro',
'-v', str(host.STATE / 'strata-runtime/cuda') + ':/var/lib/deck/strata-runtime/cuda:ro',
info['Config']['Image'], '-c', script], text=True, timeout=180))
assert all(matrix.VERSION in value for value in result['versions'].values())
if result['fatbin_architectures']:
assert all(set(values) == {'86', '120'} for values in result['fatbin_architectures'].values())
before = json.loads((host.STAGE / 'production-before.json').read_text())
current = {}
for path in before['production_hashes']:
value = Path(path)
current[path] = hashlib.file_digest(value.open('rb'), 'sha256').hexdigest() if value.is_file() else None
changes = [path for path, digest in before['production_hashes'].items() if current[path] != digest]
_, after = host.installed()
record = dict(release='v0.2.7', commit=matrix.COMMIT, activated=False, inference_performed=False,
build_verified=True, versions=result['versions'], architectures=architectures,
artifacts=actual_hashes, loader_checks=result, production_changed_paths=changes,
production_container_unchanged=before['production_started'] == after['State']['StartedAt'] and
before['production_image'] == after['Config']['Image'],
production_health=after['State'].get('Health', {}).get('Status'))
target = host.STAGE / 'verification.json'
target.write_text(json.dumps(record, indent=2) + '\n')
assert json.loads(target.read_text()) == record
print(json.dumps(record, indent=2))
if __name__ == '__main__':
main()
@@ -0,0 +1,73 @@
"""Foreground watcher: protects production by stopping ONLY this candidate builder."""
import argparse
import json
from pathlib import Path
import subprocess
import time
import prepare
def memory():
values = {line.split(':')[0]: int(line.split()[1])
for line in Path('/proc/meminfo').read_text().splitlines()}
return values['MemAvailable'] / 1024 ** 2, (values['SwapTotal'] - values['SwapFree']) / 1024
def inspect_builder():
result = subprocess.run(['docker', 'inspect', prepare.NAME], text=True, capture_output=True)
if result.returncode:
return None
info = json.loads(result.stdout)[0]
writable = [m['Source'] for m in info['Mounts'] if m['RW']]
if writable != [str(prepare.RUNTIME)]:
raise RuntimeError('Builder ownership/mount verification failed; no container stopped')
return info
def main(start=False):
initial_available, initial_swap = memory()
if start:
prepare.prepare()
low = 0
last_phase = None
began = time.monotonic()
while True:
info = inspect_builder()
path = prepare.RUNTIME / 'candidate-status.json'
status = json.loads(path.read_text()) if path.exists() else {}
phase = status.get('phase', 'initializing')
if phase != last_phase:
print(json.dumps(dict(phase=phase, state=status.get('state'), activated=False)), flush=True)
last_phase = phase
if info is None:
print(json.dumps(dict(builder_removed=True, final_state=status.get('state'),
phase=phase, activated=False)), flush=True)
return 0 if status.get('state') == 'built' else 1
available, swap = memory()
low = low + 1 if available < 3 else 0
reason = None
if low >= 2:
reason = 'Host MemAvailable below 3 GiB twice; production has priority'
elif swap - initial_swap > 512:
reason = 'Host swap grew more than 512 MiB; production has priority'
elif time.monotonic() - began > 12 * 3600:
reason = '12-hour builder deadline'
if reason:
# Exact owned builder only. Never pause/stop Deck, workers, GPUs or other containers.
inspect_builder()
subprocess.run(['docker', 'stop', '--time', '10', prepare.NAME], check=True)
record = dict(state='aborted_for_production', reason=reason,
mem_available_gib=available, swap_growth_mib=swap - initial_swap,
initial_available_gib=initial_available, activated=False,
production_interrupted=False, at=time.time())
(prepare.STAGE / 'build-guard.json').write_text(json.dumps(record, indent=2) + '\n')
print(json.dumps(record), flush=True)
return 2
time.sleep(3)
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--start-build', action='store_true')
arguments = parser.parse_args()
raise SystemExit(main(arguments.start_build))