Activate Strata v0.2.3 with verified staged native build

This commit is contained in:
Mikei386 committed 2026-10-23 17:45:35 +02:00
1 parent 1892303c7f
commit 9abee55397
9 files changed
+319 -6

No files matched your search

@@ -0,0 +1,93 @@
# Strata v0.2.3 staged build · 23 October 2026
Initial authorization: background build only. **Michael subsequently authorized activation with “autauschen”; activation completed.**
No production runtime/source/recipe/profile change, no inference or benchmark.
The original v0.2.2 / Engine0.1.47 stays active. Do not interpret a successful
candidate build as model-serving acceptance or authorization to activate.
Official tag v0.2.3: annotated tag cad69daf8cbde12ef1fafd891ad69288e0ed2501,
peeled commit 5c8dd322528cc84f68f461ad54a506b9da8fa8d4, Engine0.1.48.
Persistent candidate stage on Athena:
`/opt/athena-deck-dev/runtime/state/strata-candidate-v0.2.3`.
`runtime/candidate-status.json` records building/built/failed and always
`activated:false`; `runtime/candidate-build.log` records compiler output.
The separate `recipe` contains a copy of the existing native installer and a
candidate-only updated strata_sources.json. Production pins are unchanged.
Temporary compiler container `athena-strata-build-023`, existing image
`athena-deck-standalone:8cf88a02e30444e8`, auto-removes on exit. CPU quota2,
RAM/swap6GiB (no additional swap), nice15, no GPU devices/ports, capabilities
dropped, no new privileges. Only writable candidate runtime is mounted;
production CUDA13 toolkit is mounted read-only. No model directory or private
Deck state is mounted. CMake Ninja compile pool2/link pool1 bounds upstream's
explicit -j6 without editing upstream program sources.
Uses unchanged native deploy/install_strata.py, private CUDA13.0.48,
architectures86;120. CPU vision encoder is compiled from the same candidate
source using the existing native CMake recipe; projector weights are not read
or downloaded. Version/BUILD.json and binary hashes are recorded after success.
No model-start acceptance until authorized activation at idle.
The build script has **no activation path**. Build completion never replaces
production. Production engine/server/ready marker and profiles/endpoint/audio/
CPU files are checked by hashes in `production-before.json` without copying
private configuration contents into this documentation.
After a future Go: first check build success, production active/waiting requests,
current layout and matching native CUDA/vision dependencies. Finish any failed
build before considering replacement. Apply the same fixed source/recipe to
persistent native integration and production Deck recipe, preserve current
weights/packs/MTP/vision/profile settings, and make only the required idle
activation. Validate version, health and one authorized synthetic request.
Do not reintroduce deleted IQ3_S weights or enable DFlash2/tuning without scope.
Remove the temporary candidate once promotion is complete; no permanent second
runtime is intended.
Native Debian: run the same installer as the service account into a separate
candidate directory, explicit existing CUDA13 compiler and both architectures;
standard CMake job pools/resource limits bound compilation. Docker supplies only
today's compiler environment. Full fresh-Debian restore qualification remains
open as documented in deploy/STRATA_NATIVE.md; a staged build does not close it.
## Build completion observed
Engine and CPU vision encoder are built; actual executable reports
`strata 0.1.48`, official BUILD.json archs86/120 verified. Companion
libstrata_kq.so built. Hashes in build-result.json. Temporary compiler container
auto-removed; production binary/server/ready/config hashes match pre-build.
No model inference/activation test performed. Still awaiting Michael's Go.
First pass compiled the engine but the wrapper assumed `.venv/bin/cmake` for
vision; upstream reused `/usr/bin/cmake`, so vision failed before execution.
Wrapper corrected to use upstream ensure_build_tools() paths for both CMake
and Ninja. Second pass reused the finished engine and completed CPU vision.
Upstream sources and production remained untouched by this wrapper repair.
## Authorized activation completed
After Michael's explicit Go, the exact official release was promoted at idle.
Image `athena-deck-standalone:strata-0.1.48-20261023`, actual `strata 0.1.48`,
endpoint running and container healthy. Original `flash-next-strata-iq3-dual`
profile loaded; GPU order, split and parallel capacity unchanged. Profiles,
endpoint, reasoning-budget, audio-policy and cpu-partition hashes identical.
TTS and STT loaded. Temporary candidate/runtime deleted after verifying promoted
engine/library/vision/BUILD.json hashes against build-result.json. No backup,
new weights, DFlash2, host/Hermes restart or permanent parallel runtime.
One synthetic endpoint request:34 input /128 output tokens, decode49.3tok/s,
prompt634.5ms, whole request50.94s including model loading. Cold first request,
not a speed comparison or evidence of a regression/improvement. No answer text
saved. See activation-result.json for metrics.
19 focused Strata/reasoning tests pass. Two additional encrypted-backup tests
could not execute locally because the Mac Python lacks cryptography; they are
not reported as passed, and no production backup was created. A local Git-fetch
from the candidate was refused due to repository ownership before any stop;
fetching the same fixed commit from official GitHub resolved this safely.
The production source checkout preserves unrelated untracked source-side files.
The native vision installer was updated to use upstream tool discovery, matching
the successful candidate build. No full native fresh-host restore qualification.
Earlier staged-build/no-activation paragraphs describe the state before Go.
Current source/recipe pins and actual runtime are v0.2.3/0.1.48.
@@ -0,0 +1,87 @@
{
"release": "v0.2.3",
"version": "0.1.48",
"commit": "5c8dd322528cc84f68f461ad54a506b9da8fa8d4",
"previous_profile": "flash-next-strata-iq3-dual",
"backup_created": false,
"settings_before": {
"profiles.json": "e56a9cab15bed73d6bdd95dec0fe03c1eec636b8a3130e070e06b8b475210f3e",
"endpoint.json": "1777010839b4cf905d1d52a76aaec55cc0d2e72fd8634a98dfecf1cc705f9d18",
"reasoning-budget.json": "4884a379adf2f888415041b81ef55a01a2c22ef7a41ca1554460f410bec5cf0c",
"audio-policy.json": "f48dedea718968c00c0647ca90c1402bdabac9ce600dbeddc495817680527a3f",
"cpu-partition.json": "078d9215c41d7beafe42391a6a25c9aa34ad7f5b88ebbf40e2c178123e6611c1"
},
"phase": "complete",
"actual_version": "strata 0.1.48",
"request_test": {
"usage": {
"prompt_tokens": 34,
"completion_tokens": 128,
"total_tokens": 162,
"prompt_tokens_details": {
"cached_tokens": 0
}
},
"timings": {
"cache_n": 0,
"prompt_n": 34,
"prompt_ms": 634.5,
"prompt_per_token_ms": 18.662,
"prompt_per_second": 53.6,
"predicted_n": 128,
"predicted_ms": 2597.3,
"predicted_per_token_ms": 20.291,
"predicted_per_second": 49.3,
"draft_n": 76,
"draft_n_accepted": 44
},
"wall_seconds_including_load": 50.939893201051746,
"complete": true
},
"settings_unchanged": true,
"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
},
"image": "athena-deck-standalone:strata-0.1.48-20261023",
"container_health": "healthy"
}
@@ -0,0 +1,19 @@
{
"state": "built",
"activated": false,
"version": "strata 0.1.48",
"commit": "5c8dd322528cc84f68f461ad54a506b9da8fa8d4",
"architectures": [
86,
120
],
"cuda": "13.0",
"cpu_vision_built": true,
"hashes": {
"BUILD.json": "f066d48e33f9936cd103499569361001eede646cf1346950c28a5d1126d0fe28",
"strata": "7cc72eb6b910dde73a360fe005c25a56c044818b28f1b03c6801200559554648",
"strata-vision": "dc574415301b7ac11aa8767c1c467604a4c14cf3b5c48155f6f1cb900864fcd2",
"libstrata_kq.so": "4db85d5b2527a9af38fe56faf551a7f1dd2f622dd4ee07913b1998e453f4cf48"
},
"finished": 1792769826.9582257
}
@@ -0,0 +1,21 @@
import json,os,subprocess,time,shutil,hashlib
from pathlib import Path
root=Path('/var/lib/deck/strata-runtime');source=root/'source';status=root/'candidate-status.json';log=root/'candidate-build.log'
def run(phase,cmd,env=None):
status.write_text(json.dumps(dict(state='building',phase=phase,updated=time.time(),activated=False)))
print(phase,flush=True)
with log.open('a') as f:subprocess.run(list(map(str,cmd)),env=env,stdout=f,stderr=subprocess.STDOUT,check=True)
try:
root.joinpath('home').mkdir(exist_ok=True)
env=dict(os.environ,CMAKE_TOOLCHAIN_FILE=str(root/'compile-pools.cmake'))
run('Native engine 0.1.48, CUDA13, SM86/120',['python3','/build/deploy/install_strata.py','--destination',root,'--nvcc',root/'cuda/bin/nvcc'],env)
env.update(PATH=str(source/'.venv/bin')+os.pathsep+env.get('PATH',''))
tools=json.loads(subprocess.check_output([str(source/'.venv/bin/python'),'-c','import setup,json; print(json.dumps(list(map(str,setup.ensure_build_tools()))))'],cwd=source,env=env,text=True).strip().splitlines()[-1]);cmake=Path(tools[0]);ninja=tools[1]
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 build',[cmake,'--build',source/'build-vision-cpu','--target','strata-vision','-j','2'],env)
shutil.copy2(source/'build-vision-cpu/bin/strata-vision',source/'engine/strata-vision')
version=subprocess.check_output([str(source/'engine/strata'),'--version'],text=True,stderr=subprocess.STDOUT).strip();assert '0.1.48' in version
hashes={p.name:hashlib.file_digest(p.open('rb'),'sha256').hexdigest() for p in (source/'engine').iterdir() if p.is_file()}
status.write_text(json.dumps(dict(state='built',activated=False,version=version,commit='5c8dd322528cc84f68f461ad54a506b9da8fa8d4',architectures=[86,120],cuda='13.0',cpu_vision_built=True,hashes=hashes,finished=time.time()),indent=2));print('Candidate built; production not changed; awaiting Michael Go.',flush=True)
except BaseException as e:
status.write_text(json.dumps(dict(state='failed',error=type(e).__name__+': '+str(e),activated=False,updated=time.time()),indent=2));raise
@@ -0,0 +1,3 @@
set(CMAKE_JOB_POOLS "strata_compile=2;strata_link=1" CACHE STRING "Bound background compilation")
set(CMAKE_JOB_POOL_COMPILE strata_compile CACHE STRING "Compile pool")
set(CMAKE_JOB_POOL_LINK strata_link CACHE STRING "Link pool")
@@ -0,0 +1,66 @@
import json,subprocess,sys,time,urllib.request,importlib.util,hashlib,shutil,os
from pathlib import Path
base=Path('/opt/athena-deck-dev/runtime');state=base/'state';stage=state/'strata-candidate-v0.2.3';prod=state/'strata-runtime';candidate=stage/'runtime';source=prod/'source';key=json.load(sys.stdin)['key'];recipe=json.loads((stage/'app/strata_sources.json').read_text());built=json.loads((candidate/'candidate-status.json').read_text())
assert built['state']=='built' and built['commit']==recipe['code'] and built['version']=='strata 0.1.48'
for name,digest in built['hashes'].items():assert hashlib.file_digest((candidate/'source/engine'/name).open('rb'),'sha256').hexdigest()==digest
spec=importlib.util.spec_from_file_location('deck_install','/opt/athena-deck-dev/source/deploy/install.py');m=importlib.util.module_from_spec(spec);spec.loader.exec_module(m);c=m.load_manifest(base);assert m.owned(c['name'],base)['State']['Running'];worker=json.loads((state/'strata-worker/worker.json').read_text());previous=worker['model_name'];oldimage=c['image']
def request(path,port=8108,body=None,timeout=15):
r=urllib.request.Request('http://127.0.0.1:'+str(port)+path,data=None if body is None else json.dumps(body).encode(),headers={'Authorization':'Bearer '+key,'Content-Type':'application/json'})
with urllib.request.urlopen(r,timeout=timeout) as f:return json.load(f)
def idle():
until=time.monotonic()+1800
while time.monotonic()<until:
if request('/api/v1/status')['endpoint']['active_requests']==0:
time.sleep(2)
if request('/api/v1/status')['endpoint']['active_requests']==0:return
time.sleep(2)
raise RuntimeError('Requests did not drain; no forced interruption')
def hashes():return {n:hashlib.file_digest((state/n).open('rb'),'sha256').hexdigest() for n in ('profiles.json','endpoint.json','reasoning-budget.json','audio-policy.json','cpu-partition.json') if (state/n).exists()}
before=hashes();result=dict(release='v0.2.3',version='0.1.48',commit=recipe['code'],previous_profile=previous,backup_created=False,settings_before=before)
def save(phase):result['phase']=phase;(stage/'activation-result.json').write_text(json.dumps(result,indent=2));print(phase,flush=True)
# Stage a tiny persistent recipe layer before any downtime; never rebuild base images.
save('Preparing persistent recipe image')
(stage/'Dockerfile').write_text('FROM '+oldimage+'\nUSER root\nCOPY app/strata_sources.json /app/strata_sources.json\nCOPY app/deploy/install_strata_vision.py /app/deploy/install_strata_vision.py\nRUN chmod 0644 /app/strata_sources.json /app/deploy/install_strata_vision.py\nUSER 65534:65534\n')
image='athena-deck-standalone:strata-0.1.48-20261023';subprocess.run(['docker','build','-t',image,str(stage)],check=True)
git=['git','-c','safe.directory='+str(source),'-C',str(source)];assert not subprocess.check_output(git+['status','--porcelain','--untracked-files=no'],text=True).strip();subprocess.run(git+['fetch','--depth','1','https://github.com/Niko1221/Strata.git',recipe['code']],check=True)
# Existing assets are reused unchanged, not redownloaded/repacked.
storage=Path(c['strata_storage']);markers=[]
for q,entry in recipe['models'].items():
p=storage/'models'/q/'prepared.json'
if not p.exists():continue
d=json.loads(p.read_text());assert d['sha256']==entry['sha256'];assert (storage/d['native']).stat().st_size==entry['size'];assert (storage/d['ple']).stat().st_size==recipe['ple']['size'];assert (storage/d['pack']/'experts.bin').is_file();markers.append(p)
assert markers
idle();assert before==hashes();save('Idle confirmed; promoting built runtime')
subprocess.run(['docker','stop','--time','45',c['name']],check=True)
try:
subprocess.run(git+['checkout','--detach',recipe['code']],check=True)
for rel in ('.venv','engine','third_party/llama.cpp','build','build-vision-cpu'):
target=source/rel;incoming=candidate/'source'/rel
if not incoming.exists():continue
if target.exists():shutil.rmtree(target)
target.parent.mkdir(parents=True,exist_ok=True);shutil.move(str(incoming),str(target))
shutil.copy2(candidate/'compile-pools.cmake',prod/'compile-pools.cmake');shutil.copy2(candidate/'ready.json',prod/'ready.json')
vision=json.loads((prod/'vision-ready.json').read_text());vision['code']=recipe['code'];(prod/'vision-ready.json').write_text(json.dumps(vision,indent=2))
for p in markers:
d=json.loads(p.read_text());d['commit']=recipe['code'];p.write_text(json.dumps(d))
subprocess.run(['chown','-R','65534:65534',str(source)],check=True)
for p in [prod/'ready.json',prod/'vision-ready.json',prod/'compile-pools.cmake',*markers]:os.chown(p,65534,65534)
subprocess.run(['docker','rm',c['name']],check=True);c['image']=image;c.pop('previous_image',None);m.launch(c);m.ready(c);m.write_manifest(base,c)
shutil.copy2(stage/'app/strata_sources.json','/opt/athena-deck-dev/source/strata_sources.json');shutil.copy2(stage/'app/deploy/install_strata_vision.py','/opt/athena-deck-dev/source/deploy/install_strata_vision.py')
save('Activated; verifying version and prior profile with short request')
version=subprocess.check_output(['docker','exec',c['name'],'/var/lib/deck/strata-runtime/source/engine/strata','--version'],text=True).strip();assert '0.1.48' in version;result['actual_version']=version
idle();start=time.monotonic();usage={};timings={};done=False;has_content=False
body=dict(model=previous,messages=[{'role':'user','content':'Schreibe einen sachlichen deutschen Absatz über zuverlässige Datensicherung. Mindestens 150 Wörter.'}],max_tokens=128,temperature=0,seed=42,reasoning_effort='none',stream=True,stream_options={'include_usage':True})
r=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'})
with urllib.request.urlopen(r,timeout=600) as f:
for line in f:
if not line.startswith(b'data:'):continue
data=line[5:].strip()
if data==b'[DONE]':done=True;break
d=json.loads(data);assert 'error' not in d;usage=d.get('usage') or usage;timings=d.get('timings') or d.get('backend_timings') or timings;has_content=has_content or any(x.get('delta',{}).get('content') for x in d.get('choices',[]))
assert done and has_content and usage.get('completion_tokens',0)>0
result['request_test']=dict(usage=usage,timings=timings,wall_seconds_including_load=time.monotonic()-start,complete=True)
after=json.loads((state/'strata-worker/worker.json').read_text());assert after['model_name']==previous and after['gpu']==worker['gpu'] and after['layer_split']==worker['layer_split'] and after['parallel']==worker['parallel'];result['settings_unchanged']=before==hashes();assert result['settings_unchanged'];result['endpoint']=request('/api/v1/status')['endpoint'];result['image']=image
health=json.loads(subprocess.check_output(['docker','inspect','--format','{{json .State.Health}}',c['name']],text=True));result['container_health']=health['Status'];save('complete')
except BaseException:
save('failed; activation requires inspection; no backup or unverified fallback');raise