Skip to content

Commit 8aa4106

Browse files
committed
Fix deferred backend availability, scoped Windows proxy rule and add sourced disk-backed RAG
1 parent 5fc262d commit 8aa4106

15 files changed

Lines changed: 476 additions & 36 deletions

‎SYNTA_V79.md‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Synta v79: availability recovery and disk-backed knowledge retrieval
2+
3+
Implemented:
4+
- `rlm/v100/mission_chat.py`: backend admission failures keep requests queued with bounded retry pacing. Other eligible requests can proceed. `/cancel-chat ID` cancels a queued request without requiring a model. Failures after an inference/tool execution starts are not blindly replayed.
5+
- `rlm/v100/live_status.py`, `dashboard_layout.py`, `remote_access.py`: unavailable RTX is visible in the dashboard header; failed and waiting chat states are distinct.
6+
- `tools/repair-synta-proxy-firewall.ps1`: verify the live owned proxy executable before adding a source-address-scoped rule for the actual Python executable. Does not disable firewall/VPN or expose Ollama broadly.
7+
- `tools/start-rtx3090-helper.ps1`: account for Windows venv Python redirector in future starts.
8+
- `rlm/v100/inference_benchmark.py`: up to 60 seconds of admission cooldown between variants; preserve measured baseline and partial results if pressure persists. No weakened thermal/VRAM limits and no automatic speedup claim.
9+
- `rlm/v100/knowledge_rag.py`: streaming XML/bz2 Wikipedia import, disk-backed SQLite FTS5 retrieval, bounded passages, source URL and revision attribution. Indexed replacement prevents duplicate reimports. Import commits every 100 articles and pauses below 4 GiB free disk. Wikitext is archived untrusted knowledge, not executable instructions or verified commercial facts. No GPU embeddings or added package dependencies.
10+
- `rlm/v100/research_tools.py`: `search_knowledge(query)` available to research tools and interactive master chat.
11+
12+
## Deployment
13+
14+
Run `tools/repair-synta-proxy-firewall.ps1` in elevated Windows PowerShell. Then verify from Debian with `curl --noproxy '*' --connect-timeout 5 --max-time 10 http://192.168.0.61:11435/api/tags`. This is not verified by the repository tests.
15+
16+
Run the pinned `tools/update-synta-v79.sh REV` on Debian. It preserves the accepted profile and refuses to interrupt an exclusive training experiment. It restarts the mission to load changed queue code and verifies the fresh dashboard collector at its configured address. It does not run GPU benchmarks while mission work owns the device.
17+
18+
## Wikipedia import
19+
20+
Obtain a public Wikipedia content XML export from https://dumps.wikimedia.org/ and retain its attribution/licensing metadata. Full corpus download/indexing requires substantial disk space and time; neither is performed by the updater. Import a pilot first:
21+
22+
```bash
23+
"$HOME/ai-v100/venvs/v100-continual/bin/python" -m rlm.v100.knowledge_rag \
24+
--root "$HOME/ai-v100" --dump /absolute/path/to/wiki.xml.bz2 \
25+
--language pl --max-pages 10000
26+
```
27+
28+
Use the corresponding language code. Raise `--max-pages` for the full export after measuring host disk, index size and retrieval latency. Query via `search_knowledge` in master chat. This importer indexes current main-namespace nonredirect wikitext pages. It does not render templates, index images, teach model weights, or establish investment skill.
29+
30+
## Context and model qualification
31+
32+
Current Gemma 4 12B's documented maximum is 256K tokens (https://ai.google.dev/gemma/docs/core/model_card_4). 500K is not enabled. Current accepted context is retained, not automatically doubled while training is active.
33+
34+
No larger/MoE model, task specialist, Engram layer, distributed VRAM pool or new GPU kernel is promoted by this release. Existing pinned helper identity guards remain intact. Separate models may improve role quality, but must be measured on actual hardware and independent tasks. Engram is a trained architecture, not a switch that installs Wikipedia into existing Gemma weights. Native n-gram decoding and CPU offload remain benchmark candidates; no measured gain has yet been established on the user's machines.
35+
36+
## Validation
37+
38+
Full Python suite: 1306 passed, 65 skipped, one pre-existing PEFT Conv1D warning. Two additional cooldown tests passed along with the RAG test. Ruff and Bash syntax checks passed. Windows PowerShell execution, whole-Wikipedia scale, GPU throughput and LAN connectivity require host receipts. No financial profit or accepted LoRA improvement is claimed.

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "rlms"
33
authors = [
44
{name = "Alex Zhang", email = "altzhang@mit.edu"},
55
]
6-
version = "0.1.3+v100.78"
6+
version = "0.1.3+v100.79"
77
description = "Recursive Language Models."
88
readme = "README.md"
99
license = "MIT"

‎rlm/v100/dashboard_layout.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
PAGE = r"""<!doctype html><html lang="en"><meta charset="utf-8">
1313
<meta name="viewport" content="width=device-width,initial-scale=1"><title>Synta - mission progress</title>
1414
<style>
15-
:root{color-scheme:dark}body{font:15px system-ui;background:#101721;color:#e9eef6;margin:0;padding:24px;max-width:1200px;margin:auto}h1{font-size:26px}h2{font-size:19px}small,.muted{color:#adbdd1}a{color:#9ac5ff}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}.card,section{background:#192433;border:1px solid #304259;border-radius:12px;padding:18px;margin:14px 0}.card{margin:0}.value{display:block;font-size:22px;margin-top:8px;overflow-wrap:anywhere}progress{width:100%;height:24px}pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;max-height:420px;overflow:auto}table{border-collapse:collapse;width:100%}td,th{text-align:left;padding:10px;border-bottom:1px solid #304259}svg{width:100%;max-height:250px}#warning{color:#ffbf86}button{padding:8px 14px;background:#294464;border:0;color:white;border-radius:6px;cursor:pointer}
15+
:root{color-scheme:dark}body{font:15px system-ui;background:#101721;color:#e9eef6;margin:0;padding:24px;max-width:1200px;margin:auto}h1{font-size:26px}h2{font-size:19px}small,.muted{color:#adbdd1}a{color:#9ac5ff}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}.card,section{background:#192433;border:1px solid #304259;border-radius:12px;padding:18px;margin:14px 0}.card{margin:0}.value{display:block;font-size:22px;margin-top:8px;overflow-wrap:anywhere}progress{width:100%;height:24px}pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;max-height:420px;overflow:auto}table{border-collapse:collapse;width:100%}td,th{text-align:left;padding:10px;border-bottom:1px solid #304259}svg{width:100%;max-height:250px}#warning{color:#ffbf86;white-space:pre-wrap}#warning:not(:empty){padding:12px;border:1px solid #ffbf86;border-radius:8px;font-weight:600}button{padding:8px 14px;background:#294464;border:0;color:white;border-radius:6px;cursor:pointer}
1616
</style>
1717
<h1>Synta - mission progress</h1><p class="muted">Read-only evidence. Paper P&amp;L and historical backtests are not actual income.</p>
1818
<p id="fresh">Loading data...</p><p id="warning"></p><p id="layout" class="muted"></p><button id="reload">Refresh snapshot</button>
@@ -108,7 +108,7 @@
108108
function render(data){if(latestInference&&inferenceStamp(latestInference)>=inferenceStamp(data.live))data=mergeInference(data,latestInference);latestSnapshot=data;const m=data.mission||{},r=data.report||{},ev=(m.state?.phase==='official-public-baseline'?r.mission_evidence?.official_benchmark:null)||m.evaluation||{},learn=m.learning||{},gpu=data.gpu||{};
109109
if(data.layout?.active_sha256&&layoutVersion!==data.layout.active_sha256){pendingLayout=true;$('reload').textContent='New layout available - load when ready'}$('layout').textContent='Master HTML: /workspace/dashboard/index.html | '+(data.layout?.state||'waiting')+(data.layout?.error?' | '+data.layout.error:'');
110110
$('fresh').textContent='Collected: '+new Date(data.collected_at*1000).toLocaleString()+' | Live snapshots every 5 s; aggregate audit runs separately | Run: '+fmt(m.run)+(data.report_freshness?.state==='stale'?' | STALE REPORT: '+fmt(data.report_freshness.updated_at):'')+' | Aggregate audit: '+fmt(data.report_collection?.state);
111-
workView(data);learningPanel(data);incomePanel(data);sourcesPanel(data);insightsView(data);archivePanel();$('warning').textContent=(data.errors||[]).join('\n');$('cards').replaceChildren();card('Mission',typeof m.running==='boolean'?(m.running?'running':'stopped'):'unknown');card('Phase',m.state?.phase);card('Server startup',m.server_startup?.stage);card('Learning cycles',learn.completed_cycles);card('Accepted weight updates',r.accepted_weight_updates_this_run);card('Confirmed optimizer updates',r.mission_evidence?.optimizer_updates_observed);card('GPU utilization',gpu.utilization===undefined?null:gpu.utilization+'%');
111+
workView(data);learningPanel(data);incomePanel(data);sourcesPanel(data);insightsView(data);archivePanel();$('warning').textContent=[...(data.errors||[]),...(data.live?.actors||[]).filter(a=>a.state==='unavailable'||a.stale===true).map(a=>`${a.label}: ${a.state==='unavailable'?'unavailable':'availability unconfirmed'} | ${a.detail||''}`)].join('\n');$('cards').replaceChildren();card('Mission',typeof m.running==='boolean'?(m.running?'running':'stopped'):'unknown');card('Phase',m.state?.phase);card('Server startup',m.server_startup?.stage);card('Learning cycles',learn.completed_cycles);card('Accepted weight updates',r.accepted_weight_updates_this_run);card('Confirmed optimizer updates',r.mission_evidence?.optimizer_updates_observed);card('GPU utilization',gpu.utilization===undefined?null:gpu.utilization+'%');
112112
$('evaluation').textContent=ev.total?`${ev.completed}/${ev.total} completed, ${ev.passed===undefined?'official grading':ev.passed+' passed'} (${ev.state})`:'No current evaluation counter';$('progress').max=ev.total||1;$('progress').value=ev.completed||0;$('case').textContent=ev.current_case?('Current case: '+ev.current_case):'';
113113
const ledger=r.live_paper||r.paper||{};$('paper').textContent=Object.entries(ledger.branches||{}).map(([name,b])=>`${name} | Equity ${fmt(b.equity)} ${ledger.currency||''} | Net P&L ${fmt(b.net_pnl_before_personal_tax)} | Costs ${fmt(b.modeled_costs)} | Resolved fills ${fmt(b.resolved_fills)}`).join('\n\n')||(r.paper_display_status||'Paper ledger status unavailable');if(ledger.updated_at)$('paper').textContent+='\n\nSaved report: '+ledger.updated_at+' | period '+(ledger.period||'live recorded state')+' | '+(ledger.scope||'');$('blockers').textContent=(r.paper_blockers||[]).join('\n')||(Array.isArray(r.paper_blockers)?'No blockers in recorded snapshot':'Paper blockers unavailable');$('workers').textContent=JSON.stringify({drones:r.drones,external_compute:r.external_compute,desktop:r.desktop,official_benchmark:r.official_benchmark},null,2);$('log').textContent=data.controller_log||'Log unavailable';$('evidence').textContent=JSON.stringify({report_freshness:data.report_freshness,report_collection:data.report_collection,last_cycle:learn.last_cycle,evidence:r.mission_evidence,collection_errors:data.errors},null,2);
114114
let audit=$('backtest-audit');if(!audit){audit=document.createElement('pre');audit.id='backtest-audit';const disclosure=document.createElement('details'),label=document.createElement('summary');disclosure.dataset.key='backtest-audit';label.textContent='Historical replay audit and evidence';disclosure.append(label,audit);$('chart').after(disclosure)}audit.textContent=r.backtest_audit?JSON.stringify(r.backtest_audit,null,2):'No recorded source replay audit. Drawdown is peak-to-trough loss, not standard deviation. Loss alone is not a data glitch.';

‎rlm/v100/inference_benchmark.py‎

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,13 @@ def pressure_reason(preflight: bool = False) -> str | None:
251251
temperature, free, watts = map(float, telemetry.stdout.splitlines()[0].split(","))
252252
if not all(math.isfinite(value) for value in (temperature, free, watts)):
253253
return "GPU resource sensors are not finite"
254-
if (
255-
temperature >= 75
256-
or free < (12288 if preflight and os.name == "nt" else 3072)
257-
or watts > 250
258-
):
259-
return "GPU temperature, free VRAM or board load exceeds admission budget"
254+
minimum = 12288 if preflight and os.name == "nt" else 3072
255+
if temperature >= 75:
256+
return f"GPU temperature {temperature:.1f} C exceeds admission threshold 75 C"
257+
if free < minimum:
258+
return f"Free VRAM {free:.0f} MiB is below admission requirement {minimum} MiB"
259+
if watts > 250:
260+
return f"GPU board draw {watts:.1f} W exceeds admission threshold 250 W"
260261
if os.name != "nt":
261262
return None
262263
import psutil
@@ -297,6 +298,31 @@ def pressure_stop(process, interrupted: threading.Event, finished: threading.Eve
297298
return
298299

299300

301+
def wait_admission(seconds: int = 60) -> str | None:
302+
deadline = time.monotonic() + seconds
303+
reported = None
304+
while True:
305+
reason = pressure_reason(preflight=True)
306+
if reason is None:
307+
return None
308+
if reason != reported:
309+
print(
310+
json.dumps(
311+
{
312+
"phase": "between-variants-cooldown",
313+
"reason": reason,
314+
"scope": "No next native process started; existing host work has priority",
315+
}
316+
),
317+
flush=True,
318+
)
319+
reported = reason
320+
remaining = deadline - time.monotonic()
321+
if remaining <= 0:
322+
return reason
323+
time.sleep(min(2, remaining))
324+
325+
300326
def run(profile: dict, output: Path, port: int = 8097) -> dict:
301327
if output.exists():
302328
raise FileExistsError("Use a new experiment directory")
@@ -355,9 +381,18 @@ def run(profile: dict, output: Path, port: int = 8097) -> dict:
355381
]
356382
)
357383
for variant in supported:
358-
reason = pressure_reason(preflight=True)
384+
reason = wait_admission()
359385
if reason:
360-
raise RuntimeError(reason + "; next variant not started")
386+
rows.append(
387+
{**variant, "state": "blocked", "error": reason + "; next variant not started"}
388+
)
389+
selection = select(rows)
390+
selection["benchmark_complete"] = False
391+
save(
392+
output / "results.json",
393+
{"variants": rows, "selection": selection, "model_sha256": model_hash},
394+
)
395+
return json.loads((output / "results.json").read_text())
361396
record = {**variant, "state": "starting"}
362397
save(output / "progress.json", record)
363398
environment = {
@@ -416,9 +451,13 @@ def run(profile: dict, output: Path, port: int = 8097) -> dict:
416451
process.wait(timeout=5)
417452
monitor.join(timeout=5)
418453
rows.append(record)
454+
selection = select(rows)
455+
selection["benchmark_complete"] = len(
456+
[row for row in rows if row["state"] == "measured"]
457+
) == len(supported)
419458
save(
420459
output / "results.json",
421-
{"variants": rows, "selection": select(rows), "model_sha256": model_hash},
460+
{"variants": rows, "selection": selection, "model_sha256": model_hash},
422461
)
423462
print(
424463
json.dumps(

0 commit comments

Comments
 (0)