Upload 28 files
Browse filesFiles changed (28)
- tools/alone_timing.shAdded+41
- tools/baseline_speed.shAdded+23
- tools/bench.pyAdded+181
- tools/card.pyAdded+144
- tools/deep16_final.shAdded+21
- tools/deep16_worker.shAdded+31
- tools/deep_run.shAdded+56
- tools/demo_live.shAdded+51
- tools/docker_wrapper.shAdded+12
- tools/fix_scoring.shAdded+45
- tools/ft_eval.shAdded+35
- tools/governor.shAdded+36
- tools/make_release.pyAdded+126
- tools/or_proxy.pyAdded+166
- tools/parity.pyAdded+112
- tools/prune_run.shAdded+40
- tools/report_baseline.pyAdded+159
- tools/report_deep.pyAdded+187
- tools/report_size.pyAdded+90
- tools/report_speed.pyAdded+96
- tools/report_train.pyAdded+170
- tools/rescore_queue.shAdded+33
- tools/review_run.shAdded+28
- tools/round2.shAdded+32
- tools/selectors_run.shAdded+31
- tools/serve.shAdded+44
- tools/speed_engine.shAdded+54
- tools/variant_attempts.shAdded+26
1234567891011121314151617181920212223242526272829303132333435363738394041#!/usr/bin/env bash# How long deep mode takes for one task when nothing else uses the GPU: for each of the first TASKS tasks of the# evaluation subset, N attempts of that one task side by side on one engine, timed from start to the last attempt's end.# GPU=0 PORT=9000 N=8 TASKS=5 START=1 bash tools/alone_timing.shset -uR=/data/train/miniGPU=${GPU:-0}; PORT=${PORT:-9000}; N=${N:-8}; TASKS=${TASKS:-5}export DOCKER=/usr/bin/dockerlog() { echo "$(date -u +%FT%TZ) [alone] $*"; }cd $R/srcif [ "${START:-0}" = 1 ]; then /usr/bin/docker rm -f mini-prune-g$GPU mini-deep-g$GPU mini-var-g$GPU >/dev/null 2>&1 GPU=$GPU PORT=$PORT NAME=mini-deep-g$GPU SERVED=inkling-2-mini MODEL_DIR=$R/models/Inkling-2-Mini DRAFTER_DIR=$R/models/Inkling-2-Mini-DFlash2 \ PREPARED=$R/models/dflash2-prepared bash engine/serve.sh > $R/logs/serve-alone-g$GPU.log 2>&1 || { log "THE ENGINE DID NOT START"; exit 1; }fimkdir -p $R/results/alone: > $R/results/alone/timing.jsonlfor i in $(seq 0 $((TASKS - 1))); do $R/venv/bin/python -c "import json,sys; d=json.load(open('$R/src/eval/subset.json')); json.dump({'instance_ids': [d['instance_ids'][$i]]}, open('$R/results/alone/task-$i.json','w')); print(d['instance_ids'][$i])" > $R/results/alone/task-$i.id t0=$(date +%s.%N) TAG=alone-t$i POOL=$R/results/alone/task-$i.json DATA=verified SPLIT=test STEPS=100 MAXTOK=8192 WORKERS=1 ATTEMPTS="$(seq -s ' ' 1 $N)" PORTS="$PORT" \ bash train/gen.sh > $R/logs/alone-$i.log 2>&1 t1=$(date +%s.%N) $R/venv/bin/python - "$R/results/alone" "$i" "$N" "$t0" "$t1" >> $R/results/alone/timing.jsonl <<'EOF'import glob, json, sysd, i, n, t0, t1 = sys.argv[1], sys.argv[2], int(sys.argv[3]), float(sys.argv[4]), float(sys.argv[5])iid = open(f"{d}/task-{i}.id").read().strip()made, steps = 0, []for k in range(1, n + 1): try: p = json.load(open(f"{d}-t{i}/att-{k}/preds.json")) made += 1 if (p.get(iid, {}).get("model_patch") or "").strip() else 0 t = json.load(open(glob.glob(f"{d}-t{i}/att-{k}/*/*.traj.json")[0])) steps.append(sum(1 for m in t["messages"] if m["role"] == "assistant")) except Exception: passprint(json.dumps({"instance_id": iid, "n": n, "seconds": round(t1 - t0, 1), "attempts_with_patch": made, "steps_per_attempt": steps}))EOF log "$(tail -1 $R/results/alone/timing.jsonl)"donelog "done"1234567891011121314151617181920212223#!/usr/bin/env bash# Step 0, speed: the stock model on one GPU under each public engine's own recipe, measured by tools/bench.py.# GPU=0 PORT=9000 bash tools/baseline_speed.sh [configs...] default: vllm-plain vllm-dspark sglang-plain sglang-dsparkset -uR=/data/train/miniGPU=${GPU:-0}; PORT=${PORT:-9000}CONFIGS=${*:-vllm-plain vllm-dspark sglang-plain sglang-dspark}cd $R/srcfor c in $CONFIGS; do engine=${c%%-*}; spec=0; [ "${c##*-}" = dspark ] && spec=1 echo "== $c start $(date -u +%FT%TZ)" if ! curl -s -m 3 "http://127.0.0.1:$PORT/v1/models" | grep -q '"id"' || [ "$(cat $R/logs/serving-g$GPU.txt 2>/dev/null)" != "$c" ]; then ENGINE=$engine GPU=$GPU PORT=$PORT SPEC=$spec NAME=mini-speed-g$GPU bash tools/serve.sh || { echo "== $c SERVER FAILED"; continue; } echo "$c" > $R/logs/serving-g$GPU.txt fi sudo -n docker logs mini-speed-g$GPU > $R/logs/boot-$c.log 2>&1 $R/venv/bin/python tools/bench.py --url "http://127.0.0.1:$PORT" --model inkling-2-mini --label "$c" --out $R/results/raw/speed \ || echo "== $c BENCH FAILED" echo "== $c done $(date -u +%FT%TZ)"donesudo -n docker rm -f mini-speed-g$GPU >/dev/null 2>&1rm -f $R/logs/serving-g$GPU.txtecho "== baseline speed finished $(date -u +%FT%TZ)"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181"""Speed of one OpenAI-compatible endpoint, measured the same way for every engine.
python tools/bench.py --url http://127.0.0.1:9000 --model inkling-2-mini --label vllm-plain --out results/raw/speed
Measures, with greedy decoding on fixed coding prompts: single stream : time to first token, output tokens per second after the first token concurrency : the same at 8, 32 and 64 streams at once (per stream and summed) prefill : prompt tokens per second for prompts of about 4K and 64K tokens (max_tokens=1)Token counts come from the server's own usage report. Nothing is estimated: a failed request is counted as failed."""import argparseimport asyncioimport globimport jsonimport statisticsimport timeimport uuid
import aiohttp
TOPICS = [ "an LRU cache with O(1) get and put", "a trie with insert, search and prefix counting", "Dijkstra's shortest path with a binary heap", "a thread-safe bounded queue", "a tokenizer for arithmetic expressions and a recursive descent parser for them", "a rate limiter using the token bucket algorithm", "an interval tree with overlap queries", "a union-find structure with path compression", "a streaming median with two heaps", "topological sort with cycle detection", "a binary search over a rotated sorted array", "a least-squares line fit without numpy", "a retry decorator with exponential backoff and jitter", "a diff of two text files, line by line", "an async worker pool with a concurrency limit", "a Bloom filter with a configurable false positive rate",]ASKS = [ "Write a complete, tested Python implementation of {t}. Explain the design first, then give the code and five unit tests.", "Review the idea of implementing {t} in Python. List the edge cases, then write the code with type hints and docstrings.", "Implement {t} in Python, then walk through its time and space complexity step by step and show a usage example.", "Write {t} in Python as a small module with a command line entry point, input validation and clear error messages.",]PROMPTS = [a.format(t=t) for t in TOPICS for a in ASKS] # 64 fixed prompts
def long_prompt(target_tokens, salt): """Real source text of about target_tokens tokens. The salt at the start defeats prefix caching.""" budget = int(target_tokens * 3.3) parts, size = [], 0 for p in sorted(glob.glob("/usr/lib/python3*/*.py")): try: t = open(p, encoding="utf-8", errors="ignore").read() except OSError: continue parts.append(f"# file: {p}\n{t}\n") size += len(parts[-1]) if size >= budget: break return f"Run id {salt}. Below is source code. After it, answer with the single word: done.\n\n" + "".join(parts)[:budget] + "\n\nAnswer now."
async def one(session, url, model, prompt, max_tokens, extra): body = {"model": model, "messages": [{"role": "user", "content": prompt}], "max_tokens": max_tokens, "temperature": 0, "stream": True, "stream_options": {"include_usage": True}} body.update(extra) t0 = time.perf_counter() first = last = None usage = None chunks = 0 try: async with session.post(url + "/v1/chat/completions", json=body) as r: if r.status != 200: return {"ok": False, "status": r.status, "error": (await r.text())[:200]} async for raw in r.content: line = raw.decode("utf-8", "ignore").strip() if not line.startswith("data:"): continue data = line[5:].strip() if data == "[DONE]": break d = json.loads(data) if d.get("usage"): usage = d["usage"] for c in d.get("choices") or []: delta = c.get("delta") or {} if any(delta.get(k) for k in ("content", "reasoning_content", "reasoning", "tool_calls")): now = time.perf_counter() first = first or now last = now chunks += 1 except Exception as e: return {"ok": False, "status": "exception", "error": f"{type(e).__name__}: {e}"[:200]} if not usage or first is None: return {"ok": False, "status": "no_usage_or_no_token", "chunks": chunks} out = usage.get("completion_tokens", 0) return {"ok": True, "ttft": first - t0, "total": last - t0, "out": out, "in": usage.get("prompt_tokens", 0), "decode_tps": (out - 1) / (last - first) if out > 1 and last > first else None, "chunks": chunks}
async def prefill_one(session, url, model, prompt, extra): """One long prompt, one output token, not streamed: the whole request time is the prefill (plus one token).""" body = {"model": model, "messages": [{"role": "user", "content": prompt}], "max_tokens": 1, "temperature": 0} body.update(extra) t0 = time.perf_counter() try: async with session.post(url + "/v1/chat/completions", json=body) as r: if r.status != 200: return {"ok": False, "status": r.status, "error": (await r.text())[:200]} d = await r.json() except Exception as e: return {"ok": False, "status": "exception", "error": f"{type(e).__name__}: {e}"[:200]} u = d.get("usage") or {} if not u.get("prompt_tokens"): return {"ok": False, "status": "no_usage"} cached = ((u.get("prompt_tokens_details") or {}).get("cached_tokens")) or 0 return {"ok": True, "ttft": time.perf_counter() - t0, "in": u["prompt_tokens"], "cached": cached}
def summarize(rs, wall): ok = [r for r in rs if r.get("ok")] tps = [r["decode_tps"] for r in ok if r["decode_tps"]] ttft = sorted(r["ttft"] for r in ok) pct = lambda xs, p: xs[min(len(xs) - 1, int(round(p * (len(xs) - 1))))] if xs else None return {"requests": len(rs), "ok": len(ok), "failed": len(rs) - len(ok), "errors": sorted({str(r.get("status")) + ":" + str(r.get("error", ""))[:80] for r in rs if not r.get("ok")})[:3], "out_tokens": sum(r["out"] for r in ok), "wall_s": round(wall, 3), "sum_out_tps": round(sum(r["out"] for r in ok) / wall, 1) if wall else None, "per_stream_decode_tps_median": round(statistics.median(tps), 1) if tps else None, "per_stream_decode_tps_min": round(min(tps), 1) if tps else None, "ttft_ms_median": round(pct(ttft, 0.5) * 1000, 1) if ttft else None, "ttft_ms_p90": round(pct(ttft, 0.9) * 1000, 1) if ttft else None}
async def run_level(session, a, conc, n, max_tokens, extra): sem = asyncio.Semaphore(conc) prompts = [PROMPTS[i % len(PROMPTS)] for i in range(n)]
async def guarded(p): async with sem: return await one(session, a.url, a.model, p, max_tokens, extra) t0 = time.perf_counter() rs = await asyncio.gather(*[guarded(p) for p in prompts]) return summarize(rs, time.perf_counter() - t0), rs
async def main(): ap = argparse.ArgumentParser() ap.add_argument("--url", required=True) ap.add_argument("--model", required=True) ap.add_argument("--label", required=True) ap.add_argument("--out", default="results/raw/speed") ap.add_argument("--max-tokens", type=int, default=512) ap.add_argument("--levels", default="1,8,32,64") ap.add_argument("--prefill", default="4000,64000") ap.add_argument("--extra", default="{}", help="JSON merged into every request body") a = ap.parse_args() extra = json.loads(a.extra) res = {"label": a.label, "url": a.url, "model": a.model, "max_tokens": a.max_tokens, "temperature": 0, "prompts": len(PROMPTS), "started_utc": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()), "extra": extra, "levels": {}, "prefill": {}} timeout = aiohttp.ClientTimeout(total=3600, sock_read=1800) async with aiohttp.ClientSession(timeout=timeout, connector=aiohttp.TCPConnector(limit=0)) as s: await run_level(s, a, 1, 2, 64, extra) # warm-up, not recorded for conc in [int(x) for x in a.levels.split(",") if x]: n = 16 if conc == 1 else max(2 * conc, 32) summary, rs = await run_level(s, a, conc, n, a.max_tokens, extra) res["levels"][str(conc)] = summary print(a.label, "concurrency", conc, json.dumps(summary), flush=True) for target in [int(x) for x in a.prefill.split(",") if x]: reps = [] for _ in range(3): r = await prefill_one(s, a.url, a.model, long_prompt(target, uuid.uuid4().hex), extra) reps.append(r) ok = [r for r in reps if r.get("ok")] res["prefill"][str(target)] = { "reps": len(reps), "ok": len(ok), "prompt_tokens": [r["in"] for r in ok], "cached_tokens": [r["cached"] for r in ok], "request_s": [round(r["ttft"], 3) for r in ok], "prefill_tps_median": round(statistics.median(r["in"] / r["ttft"] for r in ok), 1) if ok else None, "errors": [str(r.get("status")) + ":" + str(r.get("error", ""))[:120] for r in reps if not r.get("ok")][:2]} print(a.label, "prefill", target, json.dumps(res["prefill"][str(target)]), flush=True) import os os.makedirs(a.out, exist_ok=True) with open(f"{a.out}/{a.label}.json", "w", encoding="utf-8") as f: json.dump(res, f, indent=1) print("wrote", f"{a.out}/{a.label}.json")
if __name__ == "__main__": asyncio.run(main())123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144"""Fill the model card's marks from the result files, so no score in the card is typed by hand.
from card import fill; text = fill(template_text, "results") python tools/card.py results # prints what would be filled in
Reads results/agent/<run>/summary.json, results/<attempts>/att-<k>/summary.json and results/alone/timing.jsonl,as tools/pull_results.sh leaves them."""import globimport jsonimport statisticsimport sys
REPO = "RightNowAI/RightNow-Mini"
def load(p): try: return json.load(open(p, encoding="utf-8")) except Exception: return None
def clean(s): """A score counts once no instance's scoring is left errored: none errored, or each was scored again alone.""" return bool(s) and (not s.get("error") or (s.get("rescored_alone") is not None and not s["rescored_alone"].get("still_error")))
def facts(res): f = {}
def run(lab): s = load(f"{res}/agent/{lab}/summary.json") return s["resolved"] if clean(s) else None f["opus"] = run("opus55-1") f["stock"] = [x for x in (run(f"stock-{k}") for k in (1, 2, 3)) if x is not None] f["ft"] = [x for x in (run(f"ft-{k}") for k in (1, 2, 3)) if x is not None] f["ft2"] = [x for x in (run(f"ft2-{k}") for k in (1, 2, 3)) if x is not None] att = {} for d in glob.glob(f"{res}/deep/att-*"): s = load(d + "/summary.json") if clean(s): att[int(d.replace("\\", "/").rsplit("-", 1)[1])] = s f["singles"] = [att[k]["resolved"] for k in sorted(att)] for rule in "ARC": f[rule] = {n: run(f"deep{rule}-n{n}") for n in (2, 4, 8, 16, 32) if run(f"deep{rule}-n{n}") is not None} f["upper"] = {} for n in (2, 4, 8, 16, 32): if all(k in att for k in range(1, n + 1)): f["upper"][n] = len(set().union(*[set(att[k]["resolved_ids"]) for k in range(1, n + 1)])) f["reviewed"] = {n: (load(f"{res}/agent/deepC-n{n}/select.json") or {}).get("reviewed") for n in f["C"]} for tag in ("prune96", "prune64", "ft08"): got = [] for d in sorted(glob.glob(f"{res}/{tag}/att-*")): s = load(d + "/summary.json") if clean(s): got.append(s["resolved"]) f[tag] = got try: f["alone"] = [json.loads(x) for x in open(f"{res}/alone/timing.jsonl", encoding="utf-8") if x.strip()] except OSError: f["alone"] = [] return f
def fill(text, res): f = facts(res) A, R, C, singles = f["A"], f["R"], f["C"], f["singles"] med = statistics.median(singles) if singles else None med_s = str(int(med)) if med is not None and med == int(med) else str(med) best_n = max(A, key=lambda n: (A[n], -n)) if A else None head = f"{A[best_n]} of 100 SWE-bench Verified tasks with {best_n} attempts" if A else "(not scored)" rows = ["| Setup | Attempts per task | Resolved of 100 |", "|---|---|---|", f"| Opus 5.5, through OpenRouter | 1 | {f['opus']} |", f"| Inkling 2 Mini, greedy decoding, plain vLLM | 1 | {', '.join(map(str, f['stock']))} ({len(f['stock'])} passes) |", f"| Inkling 2 Mini, temperature 0.8, RightNow Mini engine | 1 | {min(singles)} to {max(singles)}, median {med_s} ({len(singles)} passes) |"] for i, n in enumerate(sorted(A)): rows.append(f"| {'**Deep mode**' if i == 0 else ''} | {n} | **{A[n]}** |") for n in sorted(C): rows.append(f"| Deep mode with a reviewing session | {n}, and one more session for {f['reviewed'].get(n)} of the tasks | **{C[n]}** |") rule_c = "" if C: pairs = ", ".join(f"{C[n]} against {A.get(n)} at N={n}" for n in sorted(C)) better = all(C[n] > A.get(n, 0) for n in C) rule_c = ("A further step was measured: on the tasks where the attempts disagree, one more session of the model with tools reads the " "candidate patches, writes a reproduction, tries each candidate in the task's container and submits the final patch " f"(`deep/review.yaml`, `tools/review_run.sh`). It resolves {pairs}" + (" for plain agreement." if better else " for plain agreement, so it is not the default.")) notes = [] both = [n for n in sorted(A) if n in f["upper"]] if both: notes.append("- At least one of the N attempts resolves the task for " + ", ".join(str(f["upper"][n]) for n in both) + " of the 100 tasks at N = " + ", ".join(map(str, both)) + ". That is an upper bound, known only from the benchmark's tests; choosing without them keeps " + ", ".join(str(A[n]) for n in both) + ".") if R: notes.append("- Having the model read the candidate patches and vote did worse than plain agreement (" + ", ".join(f"{R[n]} at N={n}" for n in sorted(R)) + "), so deep mode does not use it.") if f["alone"]: mins = sorted(x["seconds"] / 60 for x in f["alone"] if x.get("steps_per_attempt")) if mins: notes.append(f"- Time: with the GPU to itself, one task with {f['alone'][0]['n']} attempts side by side took {mins[0]:.1f} to {mins[-1]:.1f} minutes " f"(median {statistics.median(mins):.1f}) on the first {len(mins)} tasks of the subset. Larger N was not timed alone. `results/deep.md` has the times of the batch runs, where each GPU served 60 sessions at once.") notes.append("- Scores at temperature 0.8 move from pass to pass; the table gives the range. Opus 5.5 was run once, with the provider's default sampling.") failed = [] failed.append("- **Token-identical speed-up** (gate: 200 prompts, no token difference from the plain engine). 6 of 200 prompts are identical with drafting. " "vLLM's own draft-head recipe fails the same way (6 of 200). The engine is published with this said; `DRAFT=0` gives the plain engine.") failed.append("- **1,000 tokens per second on one stream** (target). Measured: 729.6.") failed.append("- **Faster than Strata on the same GPU** (gate). Not measured: Strata is a desktop engine with its own re-quantized packs and was not run on this node.") if f["ft"] or f["ft2"]: parts = [] if f["ft"]: parts.append(f"round 1 scored {', '.join(map(str, f['ft']))}") if f["ft2"]: parts.append(f"round 2 scored {', '.join(map(str, f['ft2']))}") failed.append("- **A fine-tune that beats the stock model** (gate: every fine-tuned greedy pass above every stock pass). The stock passes scored " f"{', '.join(map(str, f['stock']))}; fine-tuning on the model's own passing attempts, {' and '.join(parts)}" + (f"; at temperature 0.8 round 1 scored {', '.join(map(str, f['ft08']))} against {min(singles)} to {max(singles)}" if f["ft08"] else "") + ". The fine-tuned weights are not shipped (`results/train.md`).") else: failed.append("- **A fine-tune that beats the stock model** (gate: every fine-tuned greedy pass above every stock pass). Two rounds of fine-tuning on " "the model's own passing attempts did not lower the training loss, and their evaluation passes were not finished when this card " "was written. The fine-tuned weights are not shipped (`results/train.md`).") if f["prune96"] or f["prune64"]: failed.append("- **A smaller model with the same score** (gate: within the unpruned model's range). Keeping 96 of 128 experts per layer (16.3 GB instead of 20.2) scored " f"{', '.join(map(str, f['prune96']))} against {min(singles)} to {max(singles)}; keeping 64 (12.4 GB) scored {', '.join(map(str, f['prune64']))}. " "Nothing was retrained after pruning. The pruned weights are not shipped (`results/size.md`).") top = A[best_n] if A else None if top is not None and f["opus"] is not None and top >= f["opus"]: # the brief's headline rule: only deep mode matches head = (f"{top} of 100 SWE-bench Verified tasks with {best_n} attempts, which matches Opus 5.5 on that 100-task subset ({f['opus']} in one attempt)") failed.append(f"- **Matching Opus 5.5 in one attempt** on this subset. One attempt: {med_s} at the median. Opus 5.5: {f['opus']}. " f"Deep mode reaches {top} with {best_n} attempts.") else: failed.append(f"- **Matching Opus 5.5** on this subset. One attempt: {med_s} at the median. Deep mode: {top} at best ({best_n} attempts). Opus 5.5: {f['opus']}.") marks = {"@@HEAD_DEEP@@": head, "@@HEAD_SINGLE@@": f"{min(singles)} to {max(singles)}", "@@CODING_TABLE@@": "\n".join(rows), "@@RULE_C@@": rule_c, "@@CODING_NOTES@@": "\n".join(notes), "@@FAILED@@": "\n".join(failed), "@@REPO@@": REPO} for k, v in marks.items(): text = text.replace(k, v) return text
if __name__ == "__main__": print(json.dumps(facts(sys.argv[1] if len(sys.argv) > 1 else "results"), indent=1, default=str))123456789101112131415161718192021#!/usr/bin/env bash# When attempts FROM to TO are complete: choose with N=TO, score, and score those attempts alone.# PORT=9006 bash tools/deep16_final.sh N=16: both selection rules (a live engine on PORT votes)# FROM=17 TO=32 RULES=A bash tools/deep16_final.sh N=32: rule A only (no model call)set -uR=/data/train/miniPORT=${PORT:-9006}; FROM=${FROM:-9}; TO=${TO:-16}; RULES=${RULES:-A R}log() { echo "$(date -u +%FT%TZ) [final N=$TO] $*"; }cd $R/srcdone_all() { for k in $(seq $FROM $TO); do grep -q "agent done" $R/results/deep/att-$k/meta.txt 2>/dev/null && [ -s $R/results/deep/att-$k/preds.json ] || return 1; done; }until done_all; do sleep 20; donelog "attempts $FROM to $TO complete"RULES="$RULES" NS="$TO" PORT=$PORT bash tools/selectors_run.sh &n=0for k in $(seq $FROM $TO); do ( LABEL=deep-att-$k OUT=$R/results/deep/att-$k EW=6 bash eval/score.sh > $R/logs/deep-score-$k.log 2>&1 ) & n=$((n + 1)); [ $((n % 4)) = 0 ] && waitdonewaitlog "single attempts $FROM to $TO resolved: $(for k in $(seq $FROM $TO); do python3 -c "import json;print(json.load(open('$R/results/deep/att-$k/summary.json'))['resolved'])" 2>/dev/null; done | tr '\n' ' ')"log "done"12345678910111213141516171819202122232425262728293031#!/usr/bin/env bash# One GPU working through deep mode's attempt pairs. Several workers share the list: a pair is taken by making its# lock folder, so no pair runs twice.# GPU=6 PORT=9006 START=0 bash tools/deep16_worker.sh START=1 starts RightNow Mini's engine on that GPU first# PAIRS="17 18;19 20" sets the list (default: attempts 9 to 16). WAIT_NO='pattern' waits until no process matches.set -uR=/data/train/miniGPU=${GPU:?}; PORT=${PORT:?}; NAME=${NAME:-mini-deep-g$GPU}PAIRS=${PAIRS:-9 10;11 12;13 14;15 16}export DOCKER=/usr/bin/dockerlog() { echo "$(date -u +%FT%TZ) [gpu $GPU] $*"; }cd $R/srcif [ -n "${WAIT_NO:-}" ]; then while pgrep -f "$WAIT_NO" >/dev/null; do sleep 15; done; fiif [ "${START:-0}" = 1 ]; then /usr/bin/docker rm -f mini-vllm-g$GPU mini-prune-g$GPU mini-var-g$GPU mini-deep-g$GPU >/dev/null 2>&1 sleep 6 GPU=$GPU PORT=$PORT NAME=$NAME SERVED=inkling-2-mini MODEL_DIR=$R/models/Inkling-2-Mini DRAFTER_DIR=$R/models/Inkling-2-Mini-DFlash2 \ PREPARED=$R/models/dflash2-prepared bash engine/serve.sh > $R/logs/serve-deep16-g$GPU.log 2>&1 || { log "THE ENGINE DID NOT START"; exit 1; }ficurl -s -m 5 http://127.0.0.1:$PORT/v1/models | grep -q inkling || { log "no server on port $PORT"; exit 1; }mkdir -p $R/results/deep/.locksIFS=';' read -ra LIST <<< "$PAIRS"for batch in "${LIST[@]}"; do [ -e $R/results/DEEP_STOP ] && { log "stop file: no new pair"; break; } mkdir "$R/results/deep/.locks/$(echo $batch | tr ' ' '-')" 2>/dev/null || continue log "attempts $batch" TAG=deep POOL=$R/src/eval/subset.json DATA=verified SPLIT=test STEPS=100 MAXTOK=8192 WORKERS=30 ATTEMPTS="$batch" PORTS="$PORT" \ bash train/gen.sh > $R/logs/deep-gen-$(echo $batch | tr ' ' '-').log 2>&1 log "attempts $batch ended: $(for k in $batch; do python3 -c "import json;print(len(json.load(open('$R/results/deep/att-$k/preds.json'))))" 2>/dev/null; done | tr '\n' ' ')"donelog "worker done"1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556#!/usr/bin/env bash# Deep mode on the evaluation subset: sampled attempts on RightNow Mini's engine (one GPU), then the selection.# GPU=0 PORT=9000 DEEP_STOP=1500 BATCHES="1 2;3 4" SELECT="2 4" bash tools/deep_run.sh (run on the node in tmux)# Attempts run two at a time (30 agent sessions each) so one GPU is not swamped. Each attempt is also scored alone:# those are single-attempt scores at temperature 0.8, and the base the deep score must be read against.set -uR=/data/train/miniGPU=${GPU:-0}; PORT=${PORT:-9000}; STOP=${DEEP_STOP:-1500}; NAME=mini-deep-g$GPUexport DOCKER=/usr/bin/dockerlog() { echo "$(date -u +%FT%TZ) $*"; }utc_now() { date -u +%H%M; }count() { python3 -c "import json;print(len(json.load(open('$1'))))" 2>/dev/null || echo 0; }cd $R/srcif [ -n "${WAIT_FOR:-}" ]; then log "deep: waiting for: $WAIT_FOR" until grep -q "$WAIT_FOR" ${WAIT_LOG:-$R/logs/speed_engine.log} 2>/dev/null; do sleep 15; donefiGPU=$GPU PORT=$PORT NAME=$NAME SERVED=inkling-2-mini MODEL_DIR=$R/models/Inkling-2-Mini DRAFTER_DIR=$R/models/Inkling-2-Mini-DFlash2 \ PREPARED=$R/models/dflash2-prepared bash engine/serve.sh > $R/logs/serve-deep.log 2>&1 || { log "deep: THE ENGINE DID NOT START"; exit 1; }log "deep: engine up on GPU $GPU"DONE=""IFS=";" read -r -a BATCH_LIST <<< "${BATCHES:-1 2;3 4;5 6;7 8}"for batch in "${BATCH_LIST[@]}"; do [ "$(utc_now)" -ge "$STOP" ] && break log "deep: attempts $batch" TAG=deep POOL=$R/src/eval/subset.json DATA=verified SPLIT=test STEPS=100 MAXTOK=8192 WORKERS=30 ATTEMPTS="$batch" PORTS="$PORT" \ bash train/gen.sh > $R/logs/deep-gen-$(echo $batch | tr ' ' '-').log 2>&1 & G=$! while kill -0 $G 2>/dev/null; do if [ "$(utc_now)" -ge "$STOP" ]; then log "deep: $STOP reached, stopping the attempts still running" for p in $(pgrep -f 'results/deep/[a]tt-'); do kill "$p" 2>/dev/null; done break fi sleep 20 done wait $G 2>/dev/null for k in $batch; do [ "$(count $R/results/deep/att-$k/preds.json)" -ge 100 ] && DONE="$DONE $k"; done log "deep: complete attempts so far:$DONE"donen=0for k in $DONE; do ( LABEL=deep-att-$k OUT=$R/results/deep/att-$k EW=8 bash eval/score.sh > $R/logs/deep-score-$k.log 2>&1 ) & n=$((n + 1)); [ $((n % 4)) = 0 ] && waitdonewaitlog "deep: single attempts (temperature 0.8) resolved: $(for k in $DONE; do python3 -c "import json;print(json.load(open('$R/results/deep/att-$k/summary.json'))['resolved'])" 2>/dev/null; done | tr '\n' ' ')"for n in ${SELECT:-2 4 8}; do ok=1; for k in $(seq 1 $n); do [ "$(count $R/results/deep/att-$k/preds.json)" -ge 100 ] || ok=0; done [ "$ok" = 1 ] || { log "deep: N=$n: not all of attempts 1 to $n are complete"; continue; } $R/venv/bin/python deep/select.py --attempts $R/results/deep --n $n --url http://127.0.0.1:$PORT --model inkling-2-mini \ --out $R/results/agent/deep-n$n > $R/logs/deep-select-$n.log 2>&1 ( LABEL=deep-n$n EW=12 bash eval/score.sh >> $R/logs/deep-select-$n.log 2>&1 ) log "deep: N=$n: $(tail -1 $R/logs/deep-select-$n.log | cut -c1-220)"donelog "deep: done"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051#!/usr/bin/env bash# Run the side-by-side demo server once against live endpoints and record what each side streamed.# MINI_URL=http://127.0.0.1:9007 MINI_MODEL=inkling-2-mini OTHER_URL=http://127.0.0.1:18811 bash tools/demo_live.sh# Writes results/raw/demo_live.json: per side, the HTTP status, seconds, characters and whether text arrived.set -uR=/data/train/miniPORT=${PORT:-8701}export MINI_URL=${MINI_URL:-http://127.0.0.1:9007} MINI_MODEL=${MINI_MODEL:-inkling-2-mini}export OTHER_URL=${OTHER_URL:-http://127.0.0.1:18811} OTHER_MODEL=${OTHER_MODEL:-anthropic/claude-opus-5.5} OTHER_KEY_ENV=${OTHER_KEY_ENV:-DEMO_NO_KEY}cd $R/src$R/venv/bin/python demo/server.py --port $PORT --max-tokens 400 > $R/logs/demo_live.log 2>&1 &S=$!sleep 4$R/venv/bin/python - "$PORT" > $R/results/raw/demo_live.json <<'EOF'import json, sys, time, urllib.requestport = sys.argv[1]out = {"task": "Write a Python function that merges overlapping intervals. Code only.", "measured": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())}out["page"] = urllib.request.urlopen(f"http://127.0.0.1:{port}/", timeout=20).statusout["info"] = json.load(urllib.request.urlopen(f"http://127.0.0.1:{port}/info", timeout=20))for side in ("mini", "other"): t0 = time.time() rec = {} try: req = urllib.request.Request(f"http://127.0.0.1:{port}/stream/{side}", data=json.dumps({"task": out["task"]}).encode(), headers={"Content-Type": "application/json"}) with urllib.request.urlopen(req, timeout=300) as r: rec["status"] = r.status text, first, usage = "", None, None for line in r: line = line.decode("utf-8", "replace").strip() if not line.startswith("data: ") or line == "data: [DONE]": continue try: d = json.loads(line[6:]) except ValueError: continue for c in d.get("choices") or []: piece = (c.get("delta") or {}).get("content") or (c.get("delta") or {}).get("reasoning") or (c.get("delta") or {}).get("reasoning_content") or "" if piece and first is None: first = time.time() - t0 text += piece usage = d.get("usage") or usage rec.update(seconds=round(time.time() - t0, 2), first_text_s=round(first, 2) if first else None, characters=len(text), completion_tokens=(usage or {}).get("completion_tokens"), has_def=("def " in text)) except Exception as e: rec.update(error=f"{type(e).__name__}: {str(e)[:200]}", seconds=round(time.time() - t0, 2)) out[side] = recprint(json.dumps(out, indent=1))EOFkill $S 2>/dev/nullcat $R/results/raw/demo_live.json123456789101112#!/bin/sh# The docker command the agent harness uses on the node.# A task container gets its own block of 8 cores out of cores 32-255, so a test run inside sizes itself to 8 cores.# Cores 0-31 are kept for the speed measurements. The training pool's task states are mounted read-only at /patches.# No sudo here: on 2026-12-01 the `sudo` in front of every `docker exec` used about 75 cores by itself. The login# user reads the docker socket through an ACL instead (tools/fix_sudo.sh).if [ "$1" = run ]; then shift b=$(( ($$ % 28) * 8 + 32 )) exec /usr/bin/docker run --cpuset-cpus "$b-$((b + 7))" -v /data/train/mini/pool_patches:/patches:ro "$@"fiexec /usr/bin/docker "$@"123456789101112131415161718192021222324252627282930313233343536373839404142434445#!/usr/bin/env bash# One-off on 2026-12-01 16:40Z, safe to run again. Two faults in the scoring of that afternoon:# 1. eval/rescore.sh ran the harness in the run's folder, so its report landed next to the run's own files and the# merge, which looks in rescore/, found none and recorded "scored again, nothing resolved" without reading a result.# 2. the harness's last step failed for some runs while hundreds of other containers came and went, so they have# per-instance reports and no run report ("NO REPORT FILE").# This moves the misplaced reports, forgets the empty merges and merges again from the real reports, then scores# again every run that finished scoring without a summary. Nothing is scored from memory: every number is re-read.# bash tools/fix_scoring.shR=/data/train/miniP=$R/venv/bin/pythonlog() { echo "$(date -u +%FT%TZ) [fix] $*" | tee -a $R/logs/fix_scoring.log; }cd $R/srctmux kill-session -t rq 2>/dev/nullfor p in $(pgrep -f 'eval/[r]escore.sh'); do kill "$p" 2>/dev/null; donesleep 2for d in $R/results/agent/* $R/results/deep/att-* $R/results/prune*/att-*; do [ -s "$d/summary.json" ] || continue [ "$(basename "$d")" = opus55-1 ] && continue # its rescoring ran in rescore/ and was merged correctly case "$d" in */att-*) label=$(basename "$(dirname "$d")")-$(basename "$d") ;; *) label=$(basename "$d") ;; esac mkdir -p "$d/rescore" mv "$d"/*-rescore.json "$d/rescore/" 2>/dev/null $P eval/rescore_merge.py reset "$d" "$label" >/dev/null rm -rf "$d/rescore.lock" if ls "$d"/rescore/*.json >/dev/null 2>&1; then log "$label: $($P eval/rescore_merge.py merge "$d" "$label" | cut -c1-200)" mkdir -p "$d/rescore.lock" else rm -rf "$d/rescore" fidone# runs whose scoring ended with no summary: score again (finished instances are read back, the rest are run)n=0for d in $R/results/agent/* $R/results/deep/att-* $R/results/prune*/att-*; do [ -s "$d/preds.json" ] && [ ! -s "$d/summary.json" ] || continue grep -q "scoring done" "$d/meta.txt" 2>/dev/null || continue pgrep -f "run_id $(basename "$d") " >/dev/null && continue case "$d" in */att-*) label=$(basename "$(dirname "$d")")-$(basename "$d") ;; *) label=$(basename "$d") ;; esac pgrep -f "run_id $label " >/dev/null && continue n=$((n + 1)) tmux new-session -d -s "again$(date +%s)x$n" "cd $R/src && LABEL=$label OUT=$d EW=6 bash eval/score.sh > $R/logs/again-$label.log 2>&1; echo \"\$(date -u +%FT%TZ) [fix] $label scored again: \$(tail -1 $R/logs/again-$label.log | cut -c1-200)\" >> $R/logs/fix_scoring.log" log "$label: scoring again"donetmux new-session -d -s rq "bash $R/src/tools/rescore_queue.sh 2>&1 | tee -a $R/logs/rescore_queue.log"log "done; rescore queue restarted"1234567891011121314151617181920212223242526272829303132333435#!/usr/bin/env bash# After training: put the fine-tuned weights into the released format, then evaluate them exactly as the stock model# was evaluated (the same engine line with no drafting, the same agent, the same subset), three passes.# bash tools/ft_eval.sh (run on the node in tmux; uses GPUs 3, 4 and 5)set -uR=/data/train/miniRUN=${RUN:-$R/runs/sft-r1}; MNAME=${MNAME:-RightNow-Mini}; GPUS=${GPUS:-3 4 5}; PREFIX=${PREFIX:-ft}G1=${GPUS%% *}log() { echo "$(date -u +%FT%TZ) $*"; }cd $R/src[ -d $RUN/merged-16bit ] || { log "ft: no merged model in $RUN"; exit 1; }if [ ! -s $R/models/$MNAME/graft_report.json ]; thensudo -n rm -rf $R/models/$MNAMEtaskset -c 32-255 $R/venv-train/bin/python train/graft.py apply --stock $R/models/Inkling-2-Mini --identity $R/models/mergetest-16bit \ --merged $RUN/merged-16bit --map $R/runs/graft_map.json --lora $RUN/lora --out $R/models/$MNAME > $R/logs/graft_apply.log 2>&1log "ft: graft exit $?: $(tail -1 $R/logs/graft_apply.log | cut -c1-300)"fi[ -s $R/models/$MNAME/model-00001-of-00001.safetensors ] || { log "ft: NO GRAFTED MODEL"; exit 1; }for g in $GPUS; do ( ENGINE=vllm GPU=$g PORT=900$g SPEC=0 NAME=mini-vllm-g$g MODEL=/models/$MNAME bash tools/serve.sh > $R/logs/serve-ft-g$g.log 2>&1 ) &donewaitlog "ft: servers: $(for g in $GPUS; do tail -1 $R/logs/serve-ft-g$g.log; done | tr '\n' '/')"curl -s -m 5 http://127.0.0.1:900$G1/v1/models | grep -q inkling || { log "ft: THE ENGINE DID NOT SERVE THE FINE-TUNED MODEL: $(tail -5 $R/logs/serve-ft-g$G1.log | cut -c1-200 | tr '\n' ' ')"; exit 1; }$R/venv/bin/python tools/parity.py capture --url http://127.0.0.1:900$G1 --model inkling-2-mini --label $PREFIX --out $R/results/raw/parity/$PREFIX.json > /dev/null 2>&1log "ft: tokens against stock (expected to differ: the weights changed): $($R/venv/bin/python tools/parity.py compare $R/results/raw/parity/stock.json $R/results/raw/parity/$PREFIX.json --json $R/results/raw/parity/compare-$PREFIX.json | cut -c1-200)"i=0for g in $GPUS; do i=$((i + 1)) ( LABEL=$PREFIX-$i URL=http://127.0.0.1:900$g/v1 WORKERS=32 taskset -c 32-255 bash eval/run_agent.sh > $R/logs/$PREFIX-$i.log 2>&1 LABEL=$PREFIX-$i EW=12 bash eval/score.sh >> $R/logs/$PREFIX-$i.log 2>&1 log "$PREFIX-$i: $(tail -1 $R/logs/$PREFIX-$i.log | cut -c1-200)" ) &donewaitlog "ft: done"123456789101112131415161718192021222324252627282930313233343536#!/usr/bin/env bash# Keeps one task from taking the whole machine. A benchmark test that starts one thread per core (scikit-learn does)# took 222 of 256 cores and slowed every other run on 2026-12-01.# Twice a second, each new container is given its own block of cores, so a program inside sees that many cores and# sizes its thread pool to them (a time quota alone would leave it starting 224 threads on a few cores' worth of time):# scoring containers (the benchmark's tests): 16 cores agent task containers: 8 cores (set by the wrapper too)# model servers for generation and evaluation: cores 48-255# one scikit-learn instance of the subset whose test collapses when its cores are shared (even a block kept for it# collapsed once several runs were scored at the same time): its container is stopped here, so the run records an# error for it, and eval/rescore.sh scores it alone. Every run is treated this way.# The limit has to land before the tests start. With the first version of this script (every 10 s) it sometimes landed# after: the test then ran hundreds of threads on 16 cores and ran out of time (see eval/rescore.sh).# Cores 0 to 31 are never given out here: they are kept for the speed measurements and for eval/rescore.sh, which sets# its own containers' cores. Each container is set once.# bash tools/governor.sh (run on the node, in tmux)set -uD=/usr/bin/dockerSEEN=/tmp/mini_governor_seen3.txt: > "$SEEN"n=0while true; do for c in $($D ps --format '{{.Names}}'); do grep -qxF "$c" "$SEEN" && continue n=$((n + 1)) case "$c" in sweb.eval.*-rescore) ;; sweb.eval.scikit-learn__scikit-learn-14710.*) $D kill "$c" >/dev/null 2>&1 ;; # always scored alone, see above sweb.eval.*|swesmith.*) b=$(( (n % 13) * 16 + 48 )); $D update --cpus 0 --cpuset-cpus "$b-$((b + 15))" "$c" >/dev/null 2>&1 ;; minisweagent-*) b=$(( (n % 26) * 8 + 48 )); $D update --cpus 0 --cpuset-cpus "$b-$((b + 7))" "$c" >/dev/null 2>&1 ;; mini-*) $D update --cpuset-cpus 48-255 "$c" >/dev/null 2>&1 ;; *) ;; esac echo "$c" >> "$SEEN" done sleep 0.5done123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126"""Build the folder that goes to Hugging Face (everything but the weights, which stay on the node until upload).
python tools/make_release.py # writes release/RightNow-Mini/
Copies the model card, the licence and notice, the code (engine, deep mode, demo, evaluation, training, tools, tests)and the results. Leaves out internal notes (docs/brief.md), one-off scripts of the night on the node, and rawtrajectories. Then scans every text file, this one included, for the names listed in a file that is not released,and refuses to finish if one is found."""import hashlibimport osimport reimport shutilimport zipfileimport sysfrom pathlib import Path
ROOT = Path(__file__).resolve().parent.parentDEST = ROOT / "release" / "RightNow-Mini"TOP = ["LICENSE", "NOTICE", "README.md", "config.json"]DRAFTER = ROOT / "tmp" / "drafter" # the prepared draft model, copied from the node (not in git)CODE = { "engine": ["build_drafter.py", "serve.sh"], "deep": ["__init__.py", "server.py", "select.py", "review.yaml", "make_candidates.py", "merge_review.py"], "demo": ["__init__.py", "server.py", "index.html"], "eval": ["make_subset.py", "subset.json", "run_agent.sh", "score.sh", "rescore.sh", "rescore_merge.py", "instance_report.py", "relay_model.py"], "train": ["make_pool.py", "make_task_states.py", "gen.sh", "grade.sh", "collect_grades.py", "build_sft.py", "sft.py", "graft.py", "merge_test.py", "expert_usage.py", "prune_experts.py", "pull_pool.sh", "prefetch_branches.sh", "pool/pool.json", "pool/disjoint.json"], "tools": ["bench.py", "parity.py", "serve.sh", "baseline_speed.sh", "speed_engine.sh", "governor.sh", "docker_wrapper.sh", "or_proxy.py", "report_baseline.py", "report_speed.py", "report_train.py", "report_deep.py", "report_size.py", "make_release.py", "card.py", "alone_timing.sh", "selectors_run.sh", "rescore_queue.sh", "variant_attempts.sh", "prune_run.sh", "deep_run.sh", "deep16_worker.sh", "deep16_final.sh", "ft_eval.sh", "round2.sh", "review_run.sh", "fix_scoring.sh", "demo_live.sh"], "tests": ["__init__.py", "test_deep.py", "test_demo.py"], "docs": ["licenses.md"],}NAMES = ROOT / "tools" / "private_names.txt" # one regular expression per line; not part of the releaseFORBIDDEN = Noneif NAMES.exists(): FORBIDDEN = re.compile("|".join(x.strip() for x in NAMES.read_text(encoding="utf-8").splitlines() if x.strip() and not x.startswith("#")), re.I)TEXT = {".py", ".sh", ".md", ".json", ".txt", ".html", ".jsonl", ".yaml", ".log", ".sha256", ""}# the host name of the node appears in a few raw logs (a sudo warning): replaced, nothing else is changedSCRUB = re.compile(rb"unable to resolve host \S+")
def main(): if DEST.exists(): shutil.rmtree(DEST) DEST.mkdir(parents=True) for name in TOP: shutil.copy(ROOT / "release_src" / name, DEST / name) sys.path.insert(0, str(ROOT / "tools")) import card (DEST / "README.md").write_text(card.fill((DEST / "README.md").read_text(encoding="utf-8"), str(ROOT / "results")), encoding="utf-8", newline="\n") missing = [] if os.environ.get("INCLUDE_DRAFTER") != "1": pass # the default: no weights in the release; the engine prepares the drafter itself elif (DRAFTER / "model.safetensors").exists(): (DEST / "drafter").mkdir() sha = hashlib.sha256() with open(DRAFTER / "model.safetensors", "rb") as f: for block in iter(lambda: f.read(1 << 24), b""): sha.update(block) (DEST / "drafter" / "README.md").write_text((ROOT / "release_src" / "drafter_README.md").read_text(encoding="utf-8") .replace("@@DRAFTER_SHA@@", sha.hexdigest()), encoding="utf-8", newline="\n") shutil.copy(DRAFTER / "config.json", DEST / "drafter" / "config.json") try: os.link(DRAFTER / "model.safetensors", DEST / "drafter" / "model.safetensors") # a hard link, not a second copy except OSError: missing.append("drafter/model.safetensors (upload it from tmp/drafter)") else: missing.append("drafter/ (tmp/drafter/model.safetensors is not on this machine)") for folder, names in CODE.items(): for n in names: src = ROOT / folder / n if not src.exists(): missing.append(f"{folder}/{n}") continue dst = DEST / folder / n dst.parent.mkdir(parents=True, exist_ok=True) shutil.copy(src, dst) # results: the result files as they are; every raw file behind them in one archive, results/data.zip res = ROOT / "results" stage = DEST / "results" / "_data" for p in sorted(res.rglob("*")): rel = p.relative_to(res) if not p.is_file() or p.suffix not in (".md", ".json", ".jsonl", ".txt", ".sha256", ".log"): continue dst = (DEST / "results" / rel) if (p.suffix == ".md" and len(rel.parts) == 1) else (stage / rel) dst.parent.mkdir(parents=True, exist_ok=True) text = p.read_bytes() text = SCRUB.sub(b"unable to resolve host the-node", text) dst.write_bytes(text) hits = [] for p in sorted(DEST.rglob("*")): if p.is_file() and p.suffix in TEXT: try: text = p.read_text(encoding="utf-8") except UnicodeDecodeError: continue for i, line in enumerate(text.splitlines(), 1): m = FORBIDDEN.search(line) if FORBIDDEN else None if m: # no file is exempt, this one included hits.append(f"{p.relative_to(DEST)}:{i}: {m.group(0)}") if not hits and stage.exists(): with zipfile.ZipFile(DEST / "results" / "data.zip", "w", zipfile.ZIP_DEFLATED) as z: for p in sorted(stage.rglob("*")): if p.is_file(): z.write(p, p.relative_to(stage).as_posix()) shutil.rmtree(stage) files = [p for p in DEST.rglob("*") if p.is_file()] size = sum(p.stat().st_size for p in files) left = [m for m in re.findall(r"@@[A-Z0-9_]+@@", (DEST / "README.md").read_text(encoding="utf-8"))] if left: print("the card still has unfilled marks:", sorted(set(left))) if missing: print("missing (not copied):", missing) if hits: print(f"{len(hits)} internal names found, first ones:") for h in hits[:25]: print(" ", h) sys.exit(1) print(f"{DEST}: {len(files)} files, {size / 1e6:.1f} MB, " + ("no internal names found" if FORBIDDEN else "NAMES NOT CHECKED: tools/private_names.txt is missing"))
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166"""A relay for the paid comparison model. It holds the API key in memory, so no harness file or command carries it.
It forwards chat completions to OpenRouter, allows only the comparison model, asks OpenRouter for the cost ofevery call, adds it up, and refuses once the cap is reached. It logs counts and cost, never a prompt or a reply.It listens on 127.0.0.1 only and takes the key on stdin, so the key is never in a file, a command line or a log:
printf '%s\n' "$KEY" | python tools/or_proxy.py --key-stdin --daemon --cap-usd 240 --ledger results/or_ledger.jsonl
It does not stream: a request with "stream" set gets one whole reply (the agent harness does not stream)."""import argparseimport http.clientimport jsonimport osimport sslimport threadingimport timefrom http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
HOST = "openrouter.ai"LOCK = threading.Lock()STATE = {"spent": 0.0, "requests": 0, "errors": 0, "in_tok": 0, "out_tok": 0}ARGS = NoneKEY = NoneCTX = ssl.create_default_context()
def upstream(method, path, body=None, timeout=900): conn = http.client.HTTPSConnection(HOST, timeout=timeout, context=CTX) headers = {"Authorization": f"Bearer {KEY}", "Content-Type": "application/json", "X-Title": "eval"} conn.request(method, path, body=body, headers=headers) r = conn.getresponse() data = r.read() conn.close() return r.status, data
def ledger(line): with open(ARGS.ledger, "a", encoding="utf-8") as f: f.write(json.dumps(line) + "\n")
class H(BaseHTTPRequestHandler): protocol_version = "HTTP/1.1"
def log_message(self, *a): pass
def reply(self, code, obj): b = json.dumps(obj).encode() self.send_response(code) self.send_header("Content-Type", "application/json") self.send_header("Content-Length", str(len(b))) self.end_headers() self.wfile.write(b)
def do_GET(self): if self.path.rstrip("/") in ("/health", "/v1/health"): with LOCK: return self.reply(200, dict(STATE, cap=ARGS.cap_usd, model=ARGS.model)) if self.path.rstrip("/") == "/v1/models": return self.reply(200, {"object": "list", "data": [{"id": ARGS.model, "object": "model"}]}) self.reply(404, {"error": "not here"})
def do_POST(self): if not self.path.rstrip("/").endswith("/chat/completions"): return self.reply(404, {"error": "only chat completions"}) try: req = json.loads(self.rfile.read(int(self.headers.get("Content-Length", "0")))) except Exception: return self.reply(400, {"error": "bad json"}) with LOCK: if STATE["spent"] >= ARGS.cap_usd: return self.reply(402, {"error": {"message": f"spend cap of USD {ARGS.cap_usd} reached", "type": "cap"}}) req["model"] = ARGS.model # the one comparison model, whatever the caller names req["stream"] = False req["usage"] = {"include": True} # OpenRouter then returns the cost of the call t0 = time.time() try: status, data = upstream("POST", "/api/v1/chat/completions", json.dumps(req).encode()) except Exception as e: with LOCK: STATE["errors"] += 1 ledger({"t": round(t0), "status": "relay_error", "kind": type(e).__name__}) return self.reply(502, {"error": {"message": f"relay: {type(e).__name__}", "type": "relay"}}) cost = in_tok = out_tok = 0 try: u = (json.loads(data).get("usage") or {}) cost, in_tok, out_tok = float(u.get("cost") or 0), int(u.get("prompt_tokens") or 0), int(u.get("completion_tokens") or 0) except Exception: pass with LOCK: STATE["requests"] += 1 STATE["spent"] += cost STATE["in_tok"] += in_tok STATE["out_tok"] += out_tok if status != 200: STATE["errors"] += 1 spent = STATE["spent"] ledger({"t": round(t0), "status": status, "s": round(time.time() - t0, 2), "in": in_tok, "out": out_tok, "cost": cost, "spent": round(spent, 4)}) self.send_response(status) self.send_header("Content-Type", "application/json") self.send_header("Content-Length", str(len(data))) self.end_headers() self.wfile.write(data)
def main(): global ARGS, KEY ap = argparse.ArgumentParser() ap.add_argument("--port", type=int, default=18811) ap.add_argument("--cap-usd", type=float, default=300.0) ap.add_argument("--model", default="", help="OpenRouter id; empty = find the Opus 5.5 id in the model list") ap.add_argument("--ledger", default="tmp/or_ledger.jsonl") ap.add_argument("--key-stdin", action="store_true", help="read the key from the first line of stdin: it is then only in this process's memory") ap.add_argument("--daemon", action="store_true") ap.add_argument("--log", default="logs/or_proxy.log") ARGS = ap.parse_args() if ARGS.key_stdin: # the key then exists only in this process's memory: no file, no argv, no env import sys KEY = sys.stdin.readline().strip() if not KEY: raise SystemExit("no key on stdin") else: KEY = os.environ["OPENROUTER_API_KEY"] if ARGS.daemon: # detach, so the SSH session that passed the key can end if os.fork() > 0: os._exit(0) os.setsid() if os.fork() > 0: os._exit(0) fd = os.open(ARGS.log, os.O_WRONLY | os.O_CREAT | os.O_APPEND, 0o600) os.dup2(fd, 1) os.dup2(fd, 2) os.dup2(os.open(os.devnull, os.O_RDONLY), 0) os.makedirs(os.path.dirname(ARGS.ledger) or ".", exist_ok=True) # what this key is, without spending: label and limits only st, data = upstream("GET", "/api/v1/key", timeout=60) try: k = json.loads(data).get("data", {}) print("key check:", st, {x: k.get(x) for x in ("label", "limit", "limit_remaining", "usage", "is_free_tier", "is_provisioning_key")}, flush=True) except Exception: print("key check:", st, data[:200], flush=True) st, data = upstream("GET", "/api/v1/models", timeout=60) ids = {m["id"]: m for m in json.loads(data).get("data", [])} if st == 200 else {} if not ARGS.model: cand = sorted(i for i in ids if "opus" in i and ("5.5" in i or "5-5" in i)) print("opus 5.5 candidates:", cand, flush=True) ARGS.model = next((c for c in cand if ":" not in c), cand[0] if cand else "") m = ids.get(ARGS.model) print("model:", ARGS.model, "pricing:", (m or {}).get("pricing"), "context:", (m or {}).get("context_length"), flush=True) if not m: raise SystemExit("the comparison model is not in OpenRouter's list") with open(ARGS.ledger, "r", encoding="utf-8") if os.path.exists(ARGS.ledger) else open(os.devnull) as f: for line in f: try: STATE["spent"] += float(json.loads(line).get("cost") or 0) except Exception: pass print(f"relay on 127.0.0.1:{ARGS.port}, cap USD {ARGS.cap_usd}, already spent {STATE['spent']:.2f}", flush=True) ThreadingHTTPServer(("127.0.0.1", ARGS.port), H).serve_forever()
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112"""Greedy parity: does an engine configuration give the same tokens as the stock model?
python tools/parity.py capture --url http://127.0.0.1:9000 --model inkling-2-mini --out results/raw/parity/stock-a.json python tools/parity.py compare results/raw/parity/stock-a.json results/raw/parity/candidate.json --md results/parity.md
Capture: 200 fixed coding prompts, one request at a time (a request's tokens can depend on what shares its batch),temperature 0, 128 new tokens, the server's own token ids. Compare: prompts whose token ids are equal, and for theothers the position of the first difference. Nothing is rounded: a prompt is equal or it is not."""import argparseimport jsonimport sysimport timeimport urllib.request
TOPICS = [ "an LRU cache with O(1) get and put", "a trie with insert, search and prefix counting", "Dijkstra's shortest path with a binary heap", "a thread-safe bounded queue", "a tokenizer for arithmetic expressions and a recursive descent parser for them", "a rate limiter using the token bucket algorithm", "an interval tree with overlap queries", "a union-find structure with path compression", "a streaming median with two heaps", "topological sort with cycle detection", "a binary search over a rotated sorted array", "a least-squares line fit without numpy", "a retry decorator with exponential backoff and jitter", "a diff of two text files, line by line", "an async worker pool with a concurrency limit", "a Bloom filter with a configurable false positive rate", "a ring buffer with overwrite", "a matrix class with multiplication and transpose", "a JSON pretty printer without the json module", "a priority queue with decrease-key", "a simple regular expression matcher for . and *", "a Sudoku validator and solver", "an event emitter with once and off", "a memoization decorator with a size limit", "a CSV reader that handles quoted fields", "a date range iterator that skips weekends", "a k-means clustering routine in pure Python", "a segment tree for range sums", "a URL router with path parameters", "a finite state machine for a traffic light", "a line-based key-value store with a write-ahead log", "a Huffman encoder and decoder", "an N-queens solver with backtracking", "a text wrapper that justifies lines", "a dependency resolver for packages with version ranges", "a minimal HTTP request parser", "a balanced parentheses checker with positions", "a longest common subsequence function with the reconstruction", "a sparse vector with dot product", "a scheduler for cron-like expressions", "a tree diff for nested dictionaries", "a moving average over a time window", "a simple template engine with {{ name }} substitution", "a graph cycle finder that returns one cycle", "a roman numeral converter both ways", "a consistent hashing ring", "a binary heap based merge of k sorted lists", "a flood fill on a grid with 8 neighbours", "a unit converter with a small registry", "a debounce function for callbacks",]ASKS = [ "Write a complete, tested Python implementation of {t}. Explain the design first, then give the code and five unit tests.", "Review the idea of implementing {t} in Python. List the edge cases, then write the code with type hints and docstrings.", "Implement {t} in Python, then walk through its time and space complexity step by step and show a usage example.", "Write {t} in Python as a small module with a command line entry point, input validation and clear error messages.",]PROMPTS = [a.format(t=t) for t in TOPICS for a in ASKS]assert len(PROMPTS) == 200
def ask(url, model, prompt, max_tokens): body = {"model": model, "messages": [{"role": "user", "content": prompt}], "max_tokens": max_tokens, "temperature": 0, "return_token_ids": True, "logprobs": False, "cache_salt": f"parity-{time.time_ns()}"} req = urllib.request.Request(url + "/v1/chat/completions", data=json.dumps(body).encode(), headers={"Content-Type": "application/json"}) with urllib.request.urlopen(req, timeout=600) as r: d = json.loads(r.read()) c = d["choices"][0] m = c["message"] return {"ids": c.get("token_ids"), "text": (m.get("reasoning") or m.get("reasoning_content") or "") + "\x00" + (m.get("content") or ""), "out": d["usage"]["completion_tokens"]}
def capture(a): rows = [] t0 = time.time() for i, p in enumerate(PROMPTS[:a.n]): rows.append(ask(a.url, a.model, p, a.max_tokens)) if i % 50 == 49: print(f"{i + 1} prompts, {time.time() - t0:.0f} s", flush=True) doc = {"url": a.url, "model": a.model, "label": a.label, "n": len(rows), "max_tokens": a.max_tokens, "temperature": 0, "one_request_at_a_time": True, "captured_utc": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()), "has_token_ids": all(r["ids"] is not None for r in rows), "rows": rows} json.dump(doc, open(a.out, "w")) print(f"wrote {a.out}: {len(rows)} prompts, token ids: {doc['has_token_ids']}, {time.time() - t0:.0f} s")
def compare(a): ref, cand = json.load(open(a.ref)), json.load(open(a.cand)) n = min(ref["n"], cand["n"]) by_ids = ref["has_token_ids"] and cand["has_token_ids"] equal, first_diff, tokens = 0, [], 0 for r, c in zip(ref["rows"][:n], cand["rows"][:n]): x, y = (r["ids"], c["ids"]) if by_ids else (r["text"], c["text"]) tokens += len(x) if by_ids else r["out"] if x == y: equal += 1 else: first_diff.append(next((i for i, (p, q) in enumerate(zip(x, y)) if p != q), min(len(x), len(y)))) res = {"reference": ref["label"], "candidate": cand["label"], "prompts": n, "compared_by": "token ids" if by_ids else "text", "max_tokens": ref["max_tokens"], "prompts_equal": equal, "prompts_different": n - equal, "reference_tokens": tokens, "first_difference_positions": sorted(first_diff)} print(json.dumps(res)) if a.json: json.dump(res, open(a.json, "w"), indent=1) return res
def main(): ap = argparse.ArgumentParser() sub = ap.add_subparsers(dest="cmd", required=True) c = sub.add_parser("capture") c.add_argument("--url", required=True) c.add_argument("--model", required=True) c.add_argument("--label", required=True) c.add_argument("--out", required=True) c.add_argument("--n", type=int, default=200) c.add_argument("--max-tokens", type=int, default=128) d = sub.add_parser("compare") d.add_argument("ref") d.add_argument("cand") d.add_argument("--json", default="") a = ap.parse_args() capture(a) if a.cmd == "capture" else compare(a)
if __name__ == "__main__": sys.exit(main())12345678910111213141516171819202122232425262728293031323334353637383940#!/usr/bin/env bash# Track 3, smaller: drop the least-used experts of every layer (128 to 96, then 128 to 64) and measure what it costs.# Nothing is retrained here: this is the cost of pruning alone, at temperature 0.8, two attempts per variant, next to# the unpruned model's attempts under the same settings (results/deep/att-*).# GPU=0 PORT=9000 bash tools/prune_run.sh (run on the node in tmux)set -uR=/data/train/miniGPU=${GPU:-0}; PORT=${PORT:-9000}; BASE=${BASE:-$R/models/Inkling-2-Mini}export DOCKER=/usr/bin/dockerlog() { echo "$(date -u +%FT%TZ) $*"; }cd $R/srcuntil grep -q "^USAGE\|Traceback\|Error" $R/logs/expert_usage.log 2>/dev/null; do sleep 10; donelog "usage: $(grep '^USAGE' $R/logs/expert_usage.log | cut -c1-500) $(grep -E 'Error' $R/logs/expert_usage.log | tail -1 | cut -c1-200)"[ -s $R/runs/expert_usage.json ] || { log "prune: NO USAGE FILE"; exit 1; }for K in ${KEEPS:-96 64}; do M=RightNow-Mini-e$K sudo -n rm -rf $R/models/$M taskset -c 32-255 $R/venv-train/bin/python train/prune_experts.py --stock $BASE --usage $R/runs/expert_usage.json --keep $K --out $R/models/$M > $R/logs/prune-$K.log 2>&1 log "prune $K: $(grep '^PRUNED' $R/logs/prune-$K.log | cut -c1-300) $(grep -E 'Error|exit' $R/logs/prune-$K.log | tail -1 | cut -c1-200)" [ -s $R/models/$M/prune_report.json ] || continue if ! GPU=$GPU PORT=$PORT NAME=mini-prune-g$GPU SERVED=inkling-2-mini MODEL_DIR=$R/models/$M DRAFTER_DIR=$R/models/Inkling-2-Mini-DFlash2 \ PREPARED=$R/models/dflash2-prepared bash engine/serve.sh > $R/logs/serve-prune-$K.log 2>&1; then log "prune $K: THE ENGINE DID NOT SERVE IT: $(/usr/bin/docker logs mini-prune-g$GPU 2>&1 | grep -E 'Error|error' | tail -2 | cut -c1-240 | tr '\n' ' ')" continue fi log "prune $K: served; one answer: $(curl -s -m 120 http://127.0.0.1:$PORT/v1/chat/completions -H 'Content-Type: application/json' -d '{"model":"inkling-2-mini","max_tokens":40,"temperature":0,"messages":[{"role":"user","content":"Write one line of Python that prints hello."}]}' | python3 -c "import sys,json; m=json.load(sys.stdin)['choices'][0]['message']; print(repr(((m.get('reasoning') or '') + ' || ' + (m.get('content') or ''))[:160]))" 2>&1)" taskset -c 0-31 $R/venv/bin/python tools/bench.py --url http://127.0.0.1:$PORT --model inkling-2-mini --label e$K --levels 1,64 --prefill "" --out $R/results/raw/speed-prune > $R/logs/bench-prune-$K.log 2>&1 log "prune $K: speed: $(grep 'concurrency 1 ' $R/logs/bench-prune-$K.log | cut -c1-200)" TAG=prune$K POOL=$R/src/eval/subset.json DATA=verified SPLIT=test STEPS=100 MAXTOK=8192 WORKERS=30 ATTEMPTS="1 2" PORTS="$PORT" \ bash train/gen.sh > $R/logs/prune$K-gen.log 2>&1 for k in 1 2; do ( LABEL=prune$K-att-$k OUT=$R/results/prune$K/att-$k EW=8 bash eval/score.sh > $R/logs/prune$K-score-$k.log 2>&1 ) & donedonewait/usr/bin/docker rm -f mini-prune-g$GPU >/dev/null 2>&1for K in ${KEEPS:-96 64}; do log "prune $K: resolved of 100, two attempts at temperature 0.8: $(for k in 1 2; do python3 -c "import json;print(json.load(open('$R/results/prune$K/att-$k/summary.json'))['resolved'])" 2>/dev/null; done | tr '\n' ' ')"donelog "prune: done"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159"""Write results/baseline.md from the raw files on the node. Every figure is read from a file; a missing one is said.
python tools/report_baseline.py /data/train/mini > results/baseline.md"""import globimport jsonimport osimport sys
R = sys.argv[1] if len(sys.argv) > 1 else "/data/train/mini"
def load(p): try: return json.load(open(p)) except Exception: return None
def speed_rows(folder): rows = [] for c in ("vllm-plain", "vllm-dspark", "sglang-plain", "sglang-dspark"): d = load(f"{folder}/{c}.json") if not d: rows.append(f"| {c} | not measured | | | | | | | |") continue L, P = d["levels"], d["prefill"] g = lambda k, f: (L.get(k) or {}).get(f) pf = lambda k: (P.get(k) or {}).get("prefill_tps_median") fmt = lambda v, n=0: "not measured" if v is None else (f"{v:,.{n}f}") rows.append(f"| {c} | {fmt(g('1', 'per_stream_decode_tps_median'), 1)} | {fmt(g('1', 'ttft_ms_median'), 1)} | " f"{fmt(g('8', 'per_stream_decode_tps_median'), 1)} / {fmt(g('8', 'sum_out_tps'))} | " f"{fmt(g('32', 'per_stream_decode_tps_median'), 1)} / {fmt(g('32', 'sum_out_tps'))} | " f"{fmt(g('64', 'per_stream_decode_tps_median'), 1)} / {fmt(g('64', 'sum_out_tps'))} | " f"{fmt(pf('4000'))} | {fmt(pf('64000'))} | {d['started_utc']} |") return rows
def main(): out = [] w = out.append sub = load(f"{R}/src/eval/subset.json") images = open(f"{R}/results/images.txt").read().strip().splitlines() if os.path.exists(f"{R}/results/images.txt") else [] w("# Baseline: the stock model on this node") w("") w("Measured on 2026-12-01 on one node with 8 NVIDIA B300 GPUs. Every figure below was measured here; nothing is") w("copied from a model card or a vendor page. A figure that could not be measured says so.") w("") w("- Model: `thinkingmachines/Inkling-2-Mini` at revision `fcd43a4241eb71e9f56f5f4d4bb125438cc613d9` (Apache-2.0).") for line in images: w(f"- Engine image: `{line}`") w("- One GPU per engine. Each engine was started as its own documentation says (see `tools/serve.sh`).") w("") w("## Speed") w("") w("Client: `tools/bench.py`, the same for every engine. Greedy decoding, 64 fixed coding prompts, 512 new tokens") w("per request, token counts from the server's own usage report. Single stream: 16 requests one after another.") w("At 8, 32 and 64 streams: that many requests in flight, at least 32 requests. Tokens per second per stream is") w("counted after the first token (median over streams); the sum is all output tokens over the wall time.") w("Prefill: one prompt of real source code, one output token, not streamed; prompt tokens over the request time,") w("median of 3, each prompt with a new prefix so nothing is cached.") w("") w("| Engine line | 1 stream, tok/s | First token, ms | 8 streams, per stream / sum | 32 streams | 64 streams | Prefill 4K, tok/s | Prefill 64K, tok/s | Started (UTC) |") w("|---|---|---|---|---|---|---|---|---|") for r in speed_rows(f"{R}/results/raw/speed"): w(r) w("") w("`plain` is the engine with no speculative decoding. `dspark` is the engine's own fast recipe, which drafts with") w("the draft head that ships inside the checkpoint.") w("") if os.path.isdir(f"{R}/results/raw/speed-run1-under-load"): w("A first sweep ran while other jobs loaded the machine's CPUs (one benchmark test took 222 of 256 cores during") w("the SGLang rows). It is kept in `raw/speed-run1-under-load/` and not used. For this sweep, cores 0 to 31 were") w("kept free for the engine under test and its client.") w("") w("| Engine line (first sweep, not used) | 1 stream, tok/s | First token, ms | 8 streams | 32 streams | 64 streams | Prefill 4K | Prefill 64K | Started (UTC) |") w("|---|---|---|---|---|---|---|---|---|") for r in speed_rows(f"{R}/results/raw/speed-run1-under-load"): w(r) w("") strata = f"{R}/results/raw/strata.txt" w("### Strata") w("") w(open(strata).read().strip() if os.path.exists(strata) else "Not measured.") w("") w("## The evaluation subset") w("") if sub: w(f"{sub['n']} of the {sub['total_instances']} instances of `{sub['dataset']}` (split `{sub['split']}`), drawn once: " f"`{sub['method']}` with seed {sub['seed']}. The list is `eval/subset.json`.") w("") w("| Repository | Instances |") w("|---|---|") for k, v in sub["instances_per_repo"].items(): w(f"| {k} | {v} |") w("") w("## Scores on the subset") w("") w("Agent: mini-swe-agent 2.4.6 with its own `swebench.yaml` (one bash tool, no other tools), 250 steps at most,") w("16,384 new tokens at most per step. One attempt per task. Scoring: the SWE-bench harness 4.0.4 with the") w("benchmark's own images and tests. A task with no patch counts as not resolved: every score is out of 100.") w("") w("| Run | Model | Resolved of 100 | Submitted a patch | Agent pass (UTC) | Notes |") w("|---|---|---|---|---|---|") notes = load(f"{R}/results/raw/run_notes.json") or {} for d in sorted(glob.glob(f"{R}/results/agent/*/")): label = os.path.basename(d.rstrip("/")) if not (label.startswith("stock-") or label.startswith("opus")): continue s = load(d + "summary.json") meta = open(d + "meta.txt").read() if os.path.exists(d + "meta.txt") else "" t = [x.split()[3] for x in meta.splitlines() if " start " in x and "scoring" not in x][:1] + \ [x.split()[4] for x in meta.splitlines() if "agent done" in x][:1] model = "Opus 5.5, through OpenRouter (`anthropic/claude-opus-5.5`)" if label.startswith("opus") else "stock Inkling 2 Mini, vLLM plain, temperature 0" if s: extra = 0 for rf in glob.glob(d + "rescore/*.json"): rr = load(rf) or {} extra += len(set(rr.get("resolved_ids") or []) - set(s.get("resolved_ids") or [])) ra = s.get("rescored_alone") if ra is not None and ra.get("resolved"): res = (f"**{s['resolved']}** ({s['resolved_first_scoring']} in the scoring run; {len(ra['resolved'])} more when the instance " "whose scoring errored was scored alone)") elif ra is not None: res = f"**{s['resolved']}** (the instance whose scoring errored was scored again alone: not resolved)" else: res = f"**{s['resolved'] + extra}**" + (f" ({s['resolved']} in the scoring run; {extra} more when the instance whose scoring errored was scored alone)" if extra else "") if s.get("error") and not extra: res += " (one instance's scoring errored; not yet scored again alone)" w(f"| {label} | {model} | {res} | {s.get('submitted')} | {' to '.join(t)} | {notes.get(label, '')} |") else: w(f"| {label} | {model} | not scored yet | | {' to '.join(t)} | {notes.get(label, '')} |") w("") led = f"{R}/results/or_ledger.jsonl" if os.path.exists(led): rows = [json.loads(x) for x in open(led) if x.strip()] allok = [x for x in rows if x.get("status") == 200] first = min((x.get("t") or 0) for x in allok) if allok else 0 ok = [x for x in allok if (x.get("t") or 0) < first + 3600] # the benchmark pass took under 15 minutes later = [x for x in allok if x not in ok] if later: w(f"(The relay served {len(later)} more call(s) to Opus 5.5 later that day, when the demo page was tried once: " f"USD {sum(x.get('cost') or 0 for x in later):.2f}. They are not part of the figures below.)") w("") w(f"Opus 5.5 was called {len(ok)} times ({sum(x['in'] for x in ok):,} prompt tokens, {sum(x['out'] for x in ok):,} output tokens) " f"for USD {sum(x.get('cost') or 0 for x in ok):.2f}, as OpenRouter reported per call. It ran with the provider's default " "sampling (no temperature was sent) and prompt caching on.") w("") inc = f"{R}/results/raw/incidents.md" if os.path.exists(inc): w("## What went wrong during these runs") w("") w(open(inc).read().strip()) w("") print("\n".join(out))
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187"""Write results/deep.md from the files on the node. Every figure is read from a file; a missing one is said.
python tools/report_deep.py /data/train/mini [deep] > results/deep.md"""import collectionsimport globimport jsonimport statisticsimport sys
R = sys.argv[1] if len(sys.argv) > 1 else "/data/train/mini"TAG = sys.argv[2] if len(sys.argv) > 2 else "deep"
def load(p): try: return json.load(open(p)) except Exception: return None
def minutes(traj): ts = [(m.get("extra") or {}).get("timestamp") for m in traj["messages"] if m["role"] in ("assistant", "tool")] ts = [t for t in ts if t] return (max(ts) - min(ts)) / 60 if len(ts) > 1 else None
def main(): out = [] w = out.append ids = (load(f"{R}/src/eval/subset.json") or {}).get("instance_ids", []) w("# Deep mode: several attempts, one answer" + ("" if TAG == "deep" else f" (the variant in `results/{TAG}`)")) w("") w("Measured on 2026-12-01 on the node. Deep mode sends one task to N attempts of the model at temperature 0.8 and") w("returns one patch, chosen without the benchmark's tests (`deep/select.py`). As a model id for any chat request it is") w("`rightnow-mini-deep` (`deep/server.py`).") w("") w("Attempts: the bash-only agent of `baseline.md`, at most 100 steps and 8,192 new tokens a step, served by the engine") w("of `speed.md` (drafting on).") w("") att = {} dur = collections.defaultdict(dict) for d in sorted(glob.glob(f"{R}/results/{TAG}/att-*")): k = int(d.rsplit("-", 1)[1]) s = load(d + "/summary.json") st = collections.Counter() for f in glob.glob(d + "/*/*.traj.json"): try: t = json.load(open(f)) except ValueError: continue st[t["info"].get("exit_status")] += 1 m = minutes(t) if m is not None: dur[t.get("instance_id") or f.split("/")[-2]][k] = m att[k] = (s, st) w("## Single attempts at temperature 0.8") w("") w("| Attempt | Resolved of 100 | Runs that submitted a patch | Runs that hit the step limit |") w("|---|---|---|---|") singles = [] for k, (s, st) in sorted(att.items()): owed = bool(s) and s.get("error") and (s.get("rescored_alone") is None or s["rescored_alone"].get("still_error")) if s and not owed: singles.append(s["resolved"]) cell = "not scored" if not s else (f"{s['resolved']} so far ({s['error']} instances errored in scoring, to be scored again)" if owed else str(s["resolved"])) w(f"| {k} | {cell} | {st.get('Submitted', 0)} | {st.get('LimitsExceeded', 0)} |") w("") if singles: w(f"Single attempts with complete scoring ({len(singles)}): lowest {min(singles)}, median {statistics.median(singles)}, highest {max(singles)} of 100.") w("") resolved_by = collections.defaultdict(set) for k, (s, _st) in att.items(): for i in (s or {}).get("resolved_ids", []): resolved_by[i].add(k) w("## Deep mode") w("") w("Three ways to choose are scored. All start the same way: a patch that more than half of the attempts share wins.") w("When no patch has that majority:") w("") w("- rule A takes the patch most attempts share, then the shortest, with no model call;") w("- rule B asks the model to read the distinct patches and vote three times (reasoning effort 0.3, candidate order rotated);") w("- rule C gives the model one more session with tools in the task's container: it reads the candidates, writes a") w(" reproduction, tries each candidate and submits the final patch (`deep/review.yaml`, `tools/review_run.sh`). If that") w(" session returns no patch, rule A's choice stands.") w("") w("No rule sees the benchmark's tests.") w("") w("| N | Rule A: most shared patch | Rule B: the model reads and votes | Rule C: a reviewing session with tools | Tasks with a majority patch | Reviews in B that cast no vote | No attempt made a patch | At least one of the N attempts resolved it (upper bound, uses the benchmark's tests) |") w("|---|---|---|---|---|---|---|---|") PA, PB, PC = ("deepA", "deepR", "deepC") if TAG == "deep" else (TAG + "A", TAG + "R", TAG + "C") deep = {} for n in (2, 4, 8, 16, 32): sa, sb = load(f"{R}/results/agent/{PA}-n{n}/summary.json"), load(f"{R}/results/agent/{PB}-n{n}/summary.json") la, lb = load(f"{R}/results/agent/{PA}-n{n}/select.json"), load(f"{R}/results/agent/{PB}-n{n}/select.json") if not (sa or sb or la or lb): continue dec = (lb or la or {}).get("decided", {}) oracle = sum(1 for i in ids if any(k <= n for k in resolved_by.get(i, ()))) if all(att.get(k, (None,))[0] for k in range(1, n + 1)) else None deep[n] = (sa or {}).get("resolved"), (sb or {}).get("resolved") sc = load(f"{R}/results/agent/{PC}-n{n}/summary.json") def cell(x, none): if not x: return none owed = x.get("error") and (x.get("rescored_alone") is None or x["rescored_alone"].get("still_error")) return f"{x['resolved']} so far ({x['error']} instances to be scored again)" if owed else "**%d**" % x["resolved"] w(f"| {n} | {cell(sa, 'not scored')} | {cell(sb, 'not scored' if lb else 'not run')} | {cell(sc, 'not run')} | {dec.get('agreement', '')} | " f"{('%s of %s' % (lb.get('reviews_with_no_vote', ''), dec.get('review', ''))) if lb else 'not run'} | {dec.get('no attempt produced a patch', 0)} | " f"{oracle if oracle is not None else 'not all attempts scored'} |") w("") for n in (2, 4, 8, 16, 32): lc = load(f"{R}/results/agent/{PC}-n{n}/select.json") if lc: rt = lc.get("returned", {}) w(f"Rule C at N={n}: {lc.get('reviewed')} tasks went to a reviewing session. It returned one of the candidates unchanged for " f"{rt.get('candidate', 0)}, a patch of its own for {rt.get('new patch', 0)} and nothing for {rt.get('no patch, rule A kept', 0)}; " f"its answer differs from rule A's for {lc.get('changed_from_rule_a')} tasks.") w("") first = [] for n in (2, 4, 8): s0, l0 = load(f"{R}/results/agent/{TAG}-n{n}/summary.json"), load(f"{R}/results/agent/{TAG}-n{n}/select.json") if s0 and l0: rv = [t for t in l0["tasks"] if t["how"] == "review"] first.append(f"N={n}: {s0['resolved']} ({sum(1 for t in rv if not t.get('votes'))} of {len(rv)} reviews cast no vote)") if first: w("A first run of rule B asked for the answer within 4,096 tokens at the model's default reasoning effort. The model spent") w("them reasoning and gave no answer in most reviews, so those tasks fell to the tie-break (the most shared patch, then the") w(f"shortest). Its scores are kept in `agent/{TAG}-n*` and are not the ones above: " + "; ".join(first) + ".") w("") opus = load(f"{R}/results/agent/opus55-1/summary.json") extra = 0 for rf in glob.glob(f"{R}/results/agent/opus55-1/rescore/*.json"): extra += len(set((load(rf) or {}).get("resolved_ids") or []) - set((opus or {}).get("resolved_ids") or [])) if opus: w(f"Opus 5.5 on the same 100 tasks, one attempt: {opus['resolved'] + extra} (`baseline.md`).") w("") runs = glob.glob(f"{R}/results/agent/{PA}-n*") + glob.glob(f"{R}/results/agent/{PB}-n*") + glob.glob(f"{R}/results/agent/{PC}-n*") + glob.glob(f"{R}/results/{TAG}/att-*") sums = {d: load(d + "/summary.json") or {} for d in runs} done = [d for d in runs if sums[d].get("rescored_alone") is not None] owed = [d.split("/results/")[1] for d in runs if sums[d].get("error") and sums[d].get("rescored_alone") is None] gained = [d.split("/results/")[1] for d in done if sums[d]["rescored_alone"]["resolved"]] w("Scoring an instance can error on a busy machine: a docker call times out while hundreds of other containers start and") w("stop, and one instance (`scikit-learn__scikit-learn-14710`) runs out of time when its cores are shared.") w("Wherever an instance's scoring errored it was scored again alone and that result is the one counted") w(f"(`eval/rescore.sh`; every run alike, Opus 5.5's too). Done for {len(done)} of the runs above; it added a resolved task in " f"{len(gained)}" + (f" ({', '.join(sorted(gained))})" if gained else "") + "." + (f" Not yet done when this file was written: {', '.join(sorted(owed))}." if owed else "")) w("") w("## Wall clock") w("") for n in sorted(deep): per = [max(v[k] for k in range(1, n + 1)) for v in dur.values() if all(k in v for k in range(1, n + 1))] sel = load(f"{R}/results/agent/{PB}-n{n}/select.json") or {} secs = sorted(t.get("seconds", 0) for t in sel.get("tasks", [])) if per: per.sort() line = (f"- N={n}: the slowest of the N attempts took {statistics.median(per):.1f} minutes at the median task and " f"{per[int(len(per) * 0.9)]:.1f} at the 90th percentile") if secs: line += (f"; choosing by rule B took {statistics.median(secs):.0f} s at the median and {secs[int(len(secs) * 0.9)]:.0f} s at the " "90th percentile (rule A takes no time)") w(line + ".") w("") w("These times are from a batch run: the attempts of all 100 tasks shared the GPU (60 agent sessions on one B300 at a time),") w("so they are an upper reading of what one task alone would take.") alone = [] try: alone = [json.loads(x) for x in open(f"{R}/results/alone/timing.jsonl") if x.strip()] except OSError: pass if alone: w("") w(f"One task alone (`tools/alone_timing.sh`): the first {len(alone)} tasks of the subset, each given the whole GPU, " f"{alone[0]['n']} attempts side by side, timed from the start to the end of the last attempt:") w("") w("| Task | Minutes | Attempts that made a patch | Steps per attempt |") w("|---|---|---|---|") for x in alone: st = x.get("steps_per_attempt") or [] w(f"| `{x['instance_id']}` | {x['seconds'] / 60:.1f} | {x['attempts_with_patch']} of {x['n']} | {min(st) if st else '?'} to {max(st) if st else '?'} |") else: w("One task alone was not timed.") print("\n".join(out))
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990"""Write results/size.md from the files on the node. Every figure is read from a file; a missing one is said.
python tools/report_size.py /data/train/mini > results/size.md"""import globimport jsonimport statisticsimport sys
R = sys.argv[1] if len(sys.argv) > 1 else "/data/train/mini"
def load(p): try: return json.load(open(p)) except Exception: return None
def scores(tag): out = [] for d in sorted(glob.glob(f"{R}/results/{tag}/att-*")): s = load(d + "/summary.json") if s: out.append(s["resolved"]) return out
def main(): out = [] w = out.append u = load(f"{R}/runs/expert_usage.json") or {} w("# Size: fewer experts per layer") w("") w("Measured on 2026-12-01 on the node. The model routes every token to 8 of 128 experts in each layer. On coding") w("traffic some experts are chosen rarely, so the least-used ones of each layer were dropped. In the released") w("checkpoint every expert tensor and the router have the expert as their first dimension, so dropping an expert is") w("dropping its rows: nothing is re-quantized and no kept weight changes (`train/prune_experts.py`).") w("") if u: L = u["layers"] s96 = sorted(v["share_of_top_96"] for v in L.values()) s64 = sorted(v["share_of_top_64"] for v in L.values()) w(f"Usage was counted on {u['conversations']} of the kept training conversations ({u['tokens']:,} tokens, `train/expert_usage.py`), " f"{len(L)} layers. Share of all routing choices that go to the experts kept:") w("") w("| Experts kept per layer | Lowest layer | Median layer | Highest layer |") w("|---|---|---|---|") w(f"| 96 of 128 | {100 * s96[0]:.1f}% | {100 * s96[len(s96) // 2]:.1f}% | {100 * s96[-1]:.1f}% |") w(f"| 64 of 128 | {100 * s64[0]:.1f}% | {100 * s64[len(s64) // 2]:.1f}% | {100 * s64[-1]:.1f}% |") w("") w("## What it costs") w("") w("Nothing was retrained after pruning (the fine-tune in `train.md` did not move the model, so there was nothing to heal with).") w("Scores are single attempts on the 100-task evaluation subset at temperature 0.8, at most 100 steps and 8,192 new") w("tokens a step, on the engine of `speed.md`: the same settings as the unpruned model's attempts in `deep.md`.") w("") w("| Variant | Folder size | Single attempts, resolved of 100 | One stream on the engine, tokens per second |") w("|---|---|---|---|") base = scores("deep") sp = load(f"{R}/results/raw/speed-engine/dflash.json") w(f"| 128 experts (the released model) | 20.19 GB | {', '.join(map(str, base)) or 'not scored'} | " f"{(sp or {}).get('levels', {}).get('1', {}).get('per_stream_decode_tps_median', 'not measured')} |") verdict = {} for k in (96, 64): rep = load(f"{R}/models/RightNow-Mini-e{k}/prune_report.json") sc = scores(f"prune{k}") spk = load(f"{R}/results/raw/speed-prune/e{k}.json") if not rep: w(f"| {k} experts | not built | | |") continue w(f"| {k} experts | {rep['gb']} GB | {', '.join(map(str, sc)) or 'not scored'} | " f"{(spk or {}).get('levels', {}).get('1', {}).get('per_stream_decode_tps_median', 'not measured')} |") if sc and base: verdict[k] = (min(sc) >= min(base), sc) w("") if base: w(f"Gate (the brief's): the pruned model's score within noise of the unpruned model. The unpruned model's {len(base)} attempts " f"range from {min(base)} to {max(base)} (median {statistics.median(base)}). Read as: every attempt of the pruned variant inside that range or above it.") w("") for k, (ok, sc) in verdict.items(): w(f"- {k} experts: attempts {sc}. **{'Passed' if ok else 'Not passed'}.**") w("") w("The speed column is with drafting. The draft model was made for the released model; a pruned model disagrees with") w("it more often, so fewer drafted tokens are accepted.") print("\n".join(out))
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596"""Write results/speed.md from the raw files on the node. Every figure is read from a file; a missing one is said.
python tools/report_speed.py /data/train/mini > results/speed.md"""import jsonimport sys
R = sys.argv[1] if len(sys.argv) > 1 else "/data/train/mini"NAMES = {"stock": "vLLM, no drafting (the stock line)", "dspark": "vLLM with the draft head in the checkpoint (the public fast recipe)", "dflash": "**RightNow Mini engine**: vLLM with the prepared published drafter, its logit cap off", "dflash-keepcap": "the same with the drafter's logit cap as published"}
def load(p): try: return json.load(open(p)) except Exception: return None
def fmt(v, n=0): return "not measured" if v is None else f"{v:,.{n}f}"
def main(): out = [] w = out.append w("# Speed: the engine lines on one B300") w("") w("Measured on 2026-12-01 on one GPU (NVIDIA B300) of the node, one line after another on the same GPU, with the") w("same client (`tools/bench.py`: greedy decoding, 64 fixed coding prompts, 512 new tokens, token counts from the") w("server's usage report) and the same 200-prompt capture (`tools/parity.py`). Cores 0 to 31 were kept free for") w("the server under test and its client. Start each line with `engine/serve.sh` or `tools/serve.sh`.") w("") w("| Line | 1 stream, tok/s | First token, ms | 8 streams, per stream / sum | 32 streams | 64 streams | Prefill 4K, tok/s | Prefill 64K, tok/s |") w("|---|---|---|---|---|---|---|---|") single = {} for c in ("stock", "dspark", "dflash", "dflash-keepcap"): d = load(f"{R}/results/raw/speed-engine/{c}.json") if not d: w(f"| {NAMES[c]} | not measured | | | | | | |") continue L, P = d["levels"], d["prefill"] g = lambda k, f: (L.get(k) or {}).get(f) single[c] = g("1", "per_stream_decode_tps_median") w(f"| {NAMES[c]} | {fmt(single[c], 1)} | {fmt(g('1', 'ttft_ms_median'), 1)} | " + " | ".join(f"{fmt(g(k, 'per_stream_decode_tps_median'), 1)} / {fmt(g(k, 'sum_out_tps'))}" for k in ("8", "32", "64")) + f" | {fmt((P.get('4000') or {}).get('prefill_tps_median'))} | {fmt((P.get('64000') or {}).get('prefill_tps_median'))} |") w("") if single.get("stock") and single.get("dflash"): w(f"One stream: the engine line gives {single['dflash'] / single['stock']:.2f} times the stock line" + (f" and {single['dflash'] / single['dspark']:.2f} times the public fast recipe" if single.get("dspark") else "") + ".") w("") w("The other public engine measured, SGLang, is in `baseline.md` (224.9 tok/s plain and 422.5 tok/s with the draft head, one stream).") w("") w("## Does a line give the same tokens as the stock model?") w("") w("200 fixed coding prompts, one request at a time, temperature 0, 128 new tokens, the server's own token ids.") w("A prompt counts as equal only if every token id is equal.") w("") w("| Line, against the stock line | Prompts equal of 200 | Prompts different | First difference at token (min / median / max) |") w("|---|---|---|---|") for c, name in (("stock-again", "the stock line, captured a second time"), ("dspark", NAMES["dspark"]), ("dflash", NAMES["dflash"]), ("dflash-keepcap", NAMES["dflash-keepcap"])): d = load(f"{R}/results/raw/parity/compare-{c}.json") if not d: w(f"| {name} | not measured | | |") continue fd = d["first_difference_positions"] pos = f"{fd[0]} / {fd[len(fd) // 2]} / {fd[-1]}" if fd else "none" w(f"| {name} | **{d['prompts_equal']}** | {d['prompts_different']} | {pos} |") w("") rows = [] for c, name in (("dflash-vs-dspark", NAMES["dflash"]), ("dflash-keepcap-vs-dspark", NAMES["dflash-keepcap"])): d = load(f"{R}/results/raw/parity/compare-{c}.json") if d: fd = d["first_difference_positions"] rows.append(f"| {name} | **{d['prompts_equal']}** | {d['prompts_different']} | {fd[0]} / {fd[len(fd) // 2]} / {fd[-1]} |" if fd else f"| {name} | **{d['prompts_equal']}** | 0 | none |") if rows: w("The same capture, compared with the public fast recipe instead of the stock line:") w("") w("| Line, against the public fast recipe | Prompts equal of 200 | Prompts different | First difference at token (min / median / max) |") w("|---|---|---|---|") for r in rows: w(r) w("") w("What this says, plainly: drafting changes which tokens the engine checks together in one step, and on this model") w("the engine's arithmetic for a token depends slightly on what shares its step. The model still decides every") w("token, but where two candidate tokens are almost tied the choice can flip, and from that token on the text") w("differs. This engine build has no mode that removes that dependence for this model. So a line with drafting is") w("**not** token-identical to the stock line; the table above is the measured size of the difference.") print("\n".join(out))
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170"""Write results/train.md from the files on the node. Every figure is read from a file; a missing one is said.
python tools/report_train.py /data/train/mini > results/train.md"""import collectionsimport globimport jsonimport osimport statisticsimport sys
R = sys.argv[1] if len(sys.argv) > 1 else "/data/train/mini"
def load(p): try: return json.load(open(p)) except Exception: return None
def largest(graft): """The largest absolute change of any weight, from the per-tensor records of train/graft.py.""" vals = [] for v in (graft.get("changed") or {}).values(): if isinstance(v, dict): vals += [abs(x) for k, x in v.items() if isinstance(x, (int, float)) and "max" in k] elif isinstance(v, (int, float)): vals.append(abs(v)) return max(vals) if vals else "?"
def pass_info(label): d = f"{R}/results/agent/{label}" s = load(d + "/summary.json") st, steps = collections.Counter(), [] for f in glob.glob(d + "/*/*.traj.json"): try: t = json.load(open(f)) except ValueError: continue st[t["info"].get("exit_status")] += 1 steps.append(sum(1 for m in t["messages"] if m["role"] == "assistant")) return s, st, steps
def main(): out = [] w = out.append pool = load(f"{R}/src/train/pool/pool.json") or {} dis = load(f"{R}/src/train/pool/disjoint.json") or {} grades = load(f"{R}/results/gen/grades.json") or {} first = load(f"{R}/results/gen/grades-first-rate-limited.json") or {} stats = load(f"{R}/results/sft/stats.json") or {} info = load(f"{R}/runs/sft-r1/train_info.json") or {} graft = load(f"{R}/models/RightNow-Mini/graft_report.json") or {} w("# Training: self-distillation from the model's own passing attempts") w("") w("Measured on 2026-12-01 on the node (8 NVIDIA B300). Nothing below is estimated.") w("") w("## The data") w("") w(f"- Pool: `{pool.get('dataset')}` (licence {pool.get('license')}), {pool.get('n')} tasks: {pool.get('method')}, seed {pool.get('seed')}.") w(f"- Kept apart from the evaluation: the pool's {len(dis.get('training_repositories', []))} repositories and the benchmark's " f"{len(dis.get('evaluation_repositories', []))} share none (`train/pool/disjoint.json` lists both; `repositories_in_both` is " f"`{dis.get('repositories_in_both')}`, `disjoint` is `{dis.get('disjoint')}`). No SWE-bench task is in the pool.") w("- No closed model wrote any of it: every attempt is the stock Inkling 2 Mini on this node (vLLM with the checkpoint's own draft head),") w(" the same bash-only agent as the evaluation, temperature 0.8, at most 75 steps and 8,192 new tokens a step.") w("- A task's starting state is built in its container from the dataset itself (the bug applied, the tests that catch it removed);") w(" grading uses SWE-smith's own harness on the task's official branch, so a patch counts only if it fixes the real task.") w("") if grades: w("| Attempt | Tasks tried | Produced a patch | Passed the task's tests |") w("|---|---|---|---|") for k, v in sorted(grades.items()): w(f"| {k} | {v.get('attempted')} | {v.get('with_patch')} | {v.get('resolved')} |") w("") if stats: w(f"- Attempts that ran: {stats.get('trajectories')}. Passed: {stats.get('trajectories_passed')}. Distinct passing patches: {stats.get('distinct_passing_patches')}.") w(f"- Tasks with at least one passing attempt: {stats.get('tasks_with_a_passing_attempt')} of {pool.get('n')}.") w(f"- Kept for training: {stats.get('kept_conversations')} conversations, one per task: the passing attempt with the shortest context " f"(median {stats.get('median_tokens_at_end'):,} tokens at its end, longest {stats.get('max_tokens_at_end'):,}).") w("") if first: w("A first grading lost most tasks to GitHub's API limit (the harness asks the API about every task's repository, 60 calls an hour") w("without a token) and read three attempts as 0 passed. The harness was patched locally to skip that call and everything was") w("graded again; the first numbers are kept in `gen/grades-first-rate-limited.json` and not used.") w("") w("## The fine-tune") w("") w("Tool: Unsloth, LoRA on the attention weights only. The routed experts are not trained: the serving engine on this GPU") w("family takes them only in their released 4-bit and 8-bit form (it refused a merged model with 16-bit experts), so a model") w("whose experts changed could not be served by it. The tensors a round changed are written into a copy of the released") w("checkpoint (`train/graft.py`); the experts and their quantization stay byte for byte as released.") w("") w("| Round | LoRA rank (alpha) | Trainable parameters | Conversations (longest allowed) | Epochs | Learning rate | Steps | Loss: first 10 steps, last 10 steps, average | Tensors changed, largest change |") w("|---|---|---|---|---|---|---|---|---|") rounds = (("1", "sft-r1", "RightNow-Mini", "ft"), ("2", "sft-r2", "RightNow-Mini-r2", "ft2")) for name, run, model, _pre in rounds: info = load(f"{R}/runs/{run}/train_info.json") graft = load(f"{R}/models/{model}/graft_report.json") or {} if not info: w(f"| {name} | not finished | | | | | | | |") continue a = info.get("args", {}) losses = [x["loss"] for x in (info.get("log") or []) if "loss" in x] f10 = sum(losses[:10]) / max(1, len(losses[:10])) if losses else None l10 = sum(losses[-10:]) / max(1, len(losses[-10:])) if losses else None w(f"| {name} | {a.get('rank')} ({a.get('alpha')}) | {info.get('trainable_params'):,} of {info.get('total_params'):,} | " f"{info.get('conversations')} ({a.get('max_len'):,} tokens; {info.get('skipped_too_long_or_empty')} longer ones left out) | {a.get('epochs')} | {a.get('lr')} | " f"{info.get('steps')} | {'%.3f, %.3f, %.3f' % (f10, l10, info.get('train_loss')) if losses else '?'} | " f"{graft.get('changed_tensors', '?')}, {largest(graft)} |") w("") w("Loss is counted on the model's own reasoning, text and tool calls only. It did not go down in either round: the kept") w("conversations are the stock model's own passing attempts, which it already predicts well.") w("") w("## Scores on the evaluation subset") w("") w("One attempt per task, greedy decoding, the same engine line (vLLM, no drafting), agent and limits as `baseline.md`.") w("") w("| Pass | Model | Resolved of 100 | Runs that submitted a patch | Runs that hit the 250-step limit | Steps per run, median |") w("|---|---|---|---|---|---|") scores = collections.defaultdict(list) names = {"stock": "stock Inkling 2 Mini", "ft": "fine-tune round 1", "ft2": "fine-tune round 2"} for pre in ("stock", "ft", "ft2"): for k in (1, 2, 3): label = f"{pre}-{k}" if not os.path.isdir(f"{R}/results/agent/{label}"): continue s, st, steps = pass_info(label) if s: scores[pre].append(s["resolved"]) w(f"| {label} | {names[pre]} | {'**%d**' % s['resolved'] if s else 'not scored'} | {st.get('Submitted', 0) if st else ''} | " f"{st.get('LimitsExceeded', 0) if st else ''} | {statistics.median(steps) if steps else ''} |") w("") w("Gate (the brief's): the fine-tuned model must score higher than stock by more than run-to-run noise. Read as: every") w(f"fine-tuned pass above every stock pass, three passes each. Stock: {sorted(scores['stock'])}.") w("") for pre in ("ft", "ft2"): if not scores[pre]: w(f"- {names[pre]}: no pass scored.") elif len(scores["stock"]) == 3 and min(scores[pre]) <= max(scores["stock"]): w(f"- {names[pre]}: {sorted(scores[pre])}. **Not passed.**") elif len(scores["stock"]) == 3 and len(scores[pre]) == 3: w(f"- {names[pre]}: {sorted(scores[pre])}. **Passed.**") else: w(f"- {names[pre]}: {sorted(scores[pre])}. Not decided: {len(scores[pre])} of three passes scored, each above every stock pass so far.") w("") w("Greedy decoding is the setting the gate was written for, and it is this model's weak setting: at temperature 0 a run often") w("repeats itself until the step limit (the last two columns). At temperature 0.8 the stock model resolves far more (`deep.md`).") sampled = {} for tag, who in (("deep", "stock Inkling 2 Mini"), ("ft08", "fine-tune round 1"), ("ft208", "fine-tune round 2")): got = [] for d in sorted(glob.glob(f"{R}/results/{tag}/att-*"), key=lambda x: int(x.rsplit("-", 1)[1])): sm = load(d + "/summary.json") if sm: got.append(sm["resolved"]) if got: sampled[who] = got if len(sampled) > 1: w("So the same comparison at temperature 0.8 (single attempts, at most 100 steps, the engine with drafting):") w("") for who, got in sampled.items(): w(f"- {who}: {', '.join(map(str, got))} (median {statistics.median(got)})") w("") print("\n".join(out))
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233#!/usr/bin/env bash# Two lanes, each one run at a time: score again alone every instance whose scoring errored, for every scored run# (eval/rescore.sh). Each lane has 16 cores of its own (0-15 and 16-31). Runs until results/RESCORE_STOP exists.# bash tools/rescore_queue.sh (on the node, in tmux)set -uR=/data/train/miniP=$R/venv/bin/pythonlog() { echo "$(date -u +%FT%TZ) $*"; }cd $R/srctake() { for d in $R/results/agent/*[AR]-n* $R/results/agent/stock-* $R/results/agent/engine-* $R/results/agent/opus* $R/results/agent/ft* \ $R/results/deep/att-* $R/results/prune*/att-* $R/results/ft*/att-* $R/results/agent/deep-n*; do [ -s "$d/summary.json" ] || continue [ -e "$d/rescore.lock" ] && continue [ -n "$($P eval/rescore_merge.py ids "$d" x 2>/dev/null)" ] || continue mkdir "$d/rescore.lock" 2>/dev/null && { echo "$d"; return; } done}lane() { while [ ! -e $R/results/RESCORE_STOP ]; do d=$(take) if [ -z "$d" ]; then sleep 10; continue; fi case "$d" in */att-*) label=$(basename "$(dirname "$d")")-$(basename "$d") ;; *) label=$(basename "$d") ;; esac LANE=$1 LABEL=$label OUT=$d bash eval/rescore.sh > $R/logs/rescore-$label.log 2>&1 log "lane $1 $label: $(tail -1 $R/logs/rescore-$label.log | cut -c1-220)" done}for l in ${LANES:-0 1}; do # LANES="2 3" adds two more lanes (cores 32-63) when nothing else uses them lane $l & sleep 5donewaitlog "rescore queue: stopped"12345678910111213141516171819202122232425262728#!/usr/bin/env bash# Deep mode, rule C: for the tasks where the N attempts disagree, one more session of the model, with tools, in the# task's container: it reads the candidate patches, writes a reproduction, tries each candidate and submits the final# patch. It never sees the benchmark's tests. Then the result is scored.# N=8 PORT=9006 bash tools/review_run.sh (on the node in tmux; a live engine on PORT)# LIMIT=3 reviews only the first three tasks and does not score: a smoke test.set -uR=/data/train/miniN=${N:?}; PORT=${PORT:-9006}; TAG=${TAG:-deep}; WORKERS=${WORKERS:-40}P=$R/venv/bin/pythonlog() { echo "$(date -u +%FT%TZ) [review N=$N] $*"; }cd $R/srcD=$R/results/review/$TAG-n$N; C=$R/pool_patches/cands-$TAG-n$N[ -n "${LIMIT:-}" ] && D=$D-smokemkdir -p $Dlog "$($P deep/make_candidates.py --attempts $R/results/$TAG --n $N --out-patches $C --out-subset $D/subset.json)"if [ -n "${LIMIT:-}" ]; then $P -c "import json,sys; d=json.load(open(sys.argv[1])); d['instance_ids']=d['instance_ids'][:int(sys.argv[2])]; json.dump(d, open(sys.argv[1],'w'))" $D/subset.json "$LIMIT"fiLABEL=${TAG}C-review-n$N OUT=$D URL=http://127.0.0.1:$PORT/v1 WORKERS=$WORKERS TEMP=0.8 STEPS=100 MAXTOK=8192 SUBSET=$D/subset.json \ STARTUP="mkdir -p /tmp/candidates; cp /patches/cands-$TAG-n$N/{{instance_id}}/* /tmp/candidates/ 2>/dev/null; true" \ EXTRA_ARGS="-c $R/src/deep/review.yaml" taskset -c 32-255 bash eval/run_agent.sh > $R/logs/review-$TAG-n$N.log 2>&1log "sessions: $(tail -1 $R/logs/review-$TAG-n$N.log | cut -c1-220)"[ -n "${LIMIT:-}" ] && exit 0log "$($P deep/merge_review.py --base $R/results/agent/${TAG}A-n$N/preds.json --review $D/preds.json --subset $D/subset.json --cands $C \ --out $R/results/agent/${TAG}C-n$N --name rightnow-mini-$TAG-reviewed-n$N)"LABEL=${TAG}C-n$N EW=8 bash eval/score.sh > $R/logs/${TAG}C-score-$N.log 2>&1log "scored: $(tail -1 $R/logs/${TAG}C-score-$N.log | cut -c1-220)"1234567891011121314151617181920212223242526272829303132#!/usr/bin/env bash# A second, stronger fine-tune. The first one (rank 16, learning rate 1e-4, 52 steps) did not move: its loss was# 0.188 over the first ten steps and 0.195 over the last ten, and the weights changed by about 1e-5 on average.# This round: rank 64, learning rate 4e-4, three epochs, one conversation a step per GPU. Same data, same rule# (attention weights only, so the result can be served in the released format).# bash tools/round2.sh (run on the node in tmux; takes whichever of GPUs 0, 1 and 2 are free)set -uR=/data/train/minilog() { echo "$(date -u +%FT%TZ) $*"; }utc_now() { date -u +%H%M; }log "round 2: waiting for GPUs 0, 1 and 2 (until ${R2_START_BY:-1350} at the latest)"while [ -z "${R2_GPUS:-}" ]; do FREE="" for g in 0 1 2; do used=$(nvidia-smi --id=$g --query-gpu=memory.used --format=csv,noheader,nounits | tr -d ' ') [ "${used:-99999}" -lt 2000 ] && FREE="$FREE $g" done n=$(echo $FREE | wc -w) [ "$n" -ge 3 ] && break [ "$(utc_now)" -ge "${R2_START_BY:-1350}" ] && [ "$n" -ge 2 ] && break sleep 20doneFREE=$(echo ${R2_GPUS:-$FREE})n=$(echo $FREE | wc -w)log "round 2: training on GPUs $FREE"cd $R/srcOUT=$R/runs/sft-r2CUDA_VISIBLE_DEVICES=$(echo $FREE | tr ' ' ',') UNSLOTH_PARALLEL="dp=$n" UNSLOTH_MOE_DEQUANT_MAX_MB=64 taskset -c 32-255 $R/venv-train/bin/torchrun --nproc_per_node $n train/sft.py \ --model $R/models/Inkling-2-Mini --data $R/results/sft --out $OUT --max-len 32768 --epochs ${R2_EPOCHS:-3} --accum 1 --lr ${R2_LR:-4e-4} --rank 64 --alpha 64 --merge > $R/logs/sft-r2.log 2>&1log "round 2: training exit $?: $(grep -h -E '^(TRAINED|MERGED)' $R/logs/sft-r2.log | tail -2 | cut -c1-300 | tr '\n' ' ')"[ -d $OUT/merged-16bit ] || { log "round 2: NO MERGED MODEL: $(grep -E 'Error|error' $R/logs/sft-r2.log | tail -1 | cut -c1-200)"; exit 1; }RUN=$OUT MNAME=RightNow-Mini-r2 GPUS="$FREE" PREFIX=ft2 bash tools/ft_eval.sh12345678910111213141516171819202122232425262728293031#!/usr/bin/env bash# Deep mode's selection rules, scored for every N that has its attempts.# PORT=9006 NS="2 4 8" bash tools/selectors_run.sh (run on the node in tmux; a live engine on PORT does the review votes)# RULES=A skips rule B (no model call is then made).# Labels: deepA-n<N> = no model call (most shared patch, then shortest); deepR-n<N> = the model reviews and votes.# The first run's files (deep-n2, deep-n4, deep-n8) are kept: there the review cast almost no vote.set -uR=/data/train/miniPORT=${PORT:-9006}; TAG=${TAG:-deep} # TAG: the folder of attempts under results/ (deep, prune96, ...)RULES=${RULES:-A R}log() { echo "$(date -u +%FT%TZ) $*"; }cd $R/srcfor n in ${NS:-2 4 8}; do ok=1; for k in $(seq 1 $n); do [ -s $R/results/$TAG/att-$k/preds.json ] || ok=0; done [ "$ok" = 1 ] || { log "N=$n: attempts missing"; continue; } case " $RULES " in *" A "*) ( $R/venv/bin/python deep/select.py --attempts $R/results/$TAG --n $n --mode agree --url http://127.0.0.1:$PORT --model inkling-2-mini \ --name rightnow-mini-$TAG-agree-n$n --out $R/results/agent/${TAG}A-n$n > $R/logs/${TAG}A-select-$n.log 2>&1 LABEL=${TAG}A-n$n EW=8 bash eval/score.sh >> $R/logs/${TAG}A-select-$n.log 2>&1 log "agree N=$n: $(tail -1 $R/logs/${TAG}A-select-$n.log | cut -c1-200)" ) & ;; esac case " $RULES " in *" R "*) ( $R/venv/bin/python deep/select.py --attempts $R/results/$TAG --n $n --mode review --url http://127.0.0.1:$PORT --model inkling-2-mini \ --name rightnow-mini-$TAG-review-n$n --out $R/results/agent/${TAG}R-n$n > $R/logs/${TAG}R-select-$n.log 2>&1 log "review N=$n chosen: $(grep '"mode"' $R/logs/${TAG}R-select-$n.log | tail -1 | cut -c1-200)" LABEL=${TAG}R-n$n EW=8 bash eval/score.sh >> $R/logs/${TAG}R-select-$n.log 2>&1 log "review N=$n: $(tail -1 $R/logs/${TAG}R-select-$n.log | cut -c1-200)" ) & ;; esacdonewaitlog "selectors: done"1234567891011121314151617181920212223242526272829303132333435363738394041424344#!/usr/bin/env bash# Start one copy of the stock model on one GPU with a public engine, as its own docs say to.# ENGINE=vllm|sglang GPU=0 PORT=9000 SPEC=0|1 [MODEL=/models/Inkling-2-Mini] bash tools/serve.sh# SPEC=1 turns on the bundled DSpark speculator (the engines' own fast recipe). The server listens on 127.0.0.1 only.set -euR=/data/train/miniENGINE=${ENGINE:-vllm}; GPU=${GPU:-0}; PORT=${PORT:-9000}; SPEC=${SPEC:-0}MODEL=${MODEL:-/models/Inkling-2-Mini}; SERVED=${SERVED:-inkling-2-mini}NAME=${NAME:-mini-$ENGINE-g$GPU}EXTRA=${EXTRA:-}COMMON=(-d --name "$NAME" --gpus "device=$GPU" --ipc=host --network host -v $R/models:/models:ro -v $R/hf:/root/.cache/huggingface -e CUDA_ENABLE_COREDUMP_ON_EXCEPTION=0 -e DO_NOT_TRACK=1)sudo -n docker rm -f "$NAME" >/dev/null 2>&1 || trueif [ "$ENGINE" = vllm ]; then ARGS=(--model "$MODEL" --served-model-name "$SERVED" --tensor-parallel-size 1 --reasoning-parser inkling --enable-auto-tool-choice --tool-call-parser inkling --host 127.0.0.1 --port "$PORT") [ "$SPEC" = 1 ] && ARGS+=(--speculative-config '{"method":"dspark","num_speculative_tokens":7,"draft_sample_method":"probabilistic"}') # shellcheck disable=SC2086 sudo -n docker run "${COMMON[@]}" -e VLLM_NO_USAGE_STATS=1 ${IMAGE:-vllm/vllm-openai:nightly} "${ARGS[@]}" $EXTRAelif [ "$ENGINE" = sglang ]; then ARGS=(sglang serve --model-path "$MODEL" --served-model-name "$SERVED" --tp 1 --ep 1 --attention-backend fa4 --dtype bfloat16 --page-size 128 --grammar-backend xgrammar --reasoning-parser inkling --tool-call-parser inkling2 --host 127.0.0.1 --port "$PORT") ENVS=() if [ "$SPEC" = 1 ]; then ARGS+=(--speculative-algorithm DSPARK --speculative-num-draft-tokens 8) ENVS=(-e SGLANG_OPT_DSV41_DSPARK_MID_FOLD=1 -e SGLANG_OPT_DSV41_DSPARK_PREPARE_INPUTS_ONCE=1 -e SGLANG_OPT_DSV41_DSPARK_SKIP_PREFILLED_INPUTS=1 -e SGLANG_OPT_INKLING2_VERIFY_REL_BIAS_KERNEL=1) fi # shellcheck disable=SC2086 sudo -n docker run "${COMMON[@]}" "${ENVS[@]}" ${IMAGE:-lmsysorg/sglang:inkling-2-mini} "${ARGS[@]}" $EXTRAelse echo "unknown ENGINE $ENGINE"; exit 2fiecho "started $NAME on GPU $GPU port $PORT (spec=$SPEC)"# wait until it answers, or say why it did notfor i in $(seq 1 180); do if curl -s -m 3 "http://127.0.0.1:$PORT/v1/models" | grep -q '"id"'; then echo "ready after $((i*5)) s"; exit 0; fi if [ -z "$(sudo -n docker ps -q -f name="^$NAME$")" ]; then echo "CONTAINER EXITED"; sudo -n docker logs --tail 40 "$NAME" 2>&1 | cut -c1-300; exit 1; fi sleep 5doneecho "NOT READY after 900 s"; sudo -n docker logs --tail 30 "$NAME" 2>&1 | cut -c1-300; exit 1123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354#!/usr/bin/env bash# Track 1 measurements on one GPU: the engine lines side by side, each with the same speed client and the same# 200-prompt greedy capture, then every line's tokens compared with the stock line's.# GPU=0 PORT=9000 bash tools/speed_engine.sh (run on the node in tmux)# Lines: stock (no drafting, captured twice), dspark (the engine's own recipe: the draft head in the checkpoint),# dflash (engine/serve.sh: the prepared published drafter, logit cap off), dflash-keepcap (cap as published).set -uR=/data/train/miniGPU=${GPU:-0}; PORT=${PORT:-9000}; NAME=mini-engine-g$GPUexport DOCKER=/usr/bin/dockercd $R/srclog() { echo "$(date -u +%TZ) $*"; }PY="taskset -c 0-31 $R/venv/bin/python"URL=http://127.0.0.1:$PORTmkdir -p $R/results/raw/speed-engine $R/results/raw/parity[ -d $R/models/Inkling-2-Mini-DFlash2 ] || { echo "download incoai/Inkling-2-Mini-DFlash2 into $R/models/Inkling-2-Mini-DFlash2 first"; exit 1; }
measure() { # measure <label> /usr/bin/docker logs $NAME > $R/logs/boot-engine-$1.log 2>&1 $PY tools/bench.py --url $URL --model rightnow-mini --label $1 --out $R/results/raw/speed-engine || log "$1 BENCH FAILED" $PY tools/parity.py capture --url $URL --model rightnow-mini --label $1 --out $R/results/raw/parity/$1.json || log "$1 CAPTURE FAILED"}
LINES=" ${LINES:-stock dspark dflash dflash-keepcap} "want() { case "$LINES" in *" $1 "*) return 0;; esac; return 1; }
want stock && log "== stock"if want stock && GPU=$GPU PORT=$PORT NAME=$NAME MODEL_DIR=$R/models/Inkling-2-Mini DRAFT=0 bash engine/serve.sh; then measure stock $PY tools/parity.py capture --url $URL --model rightnow-mini --label stock-again --out $R/results/raw/parity/stock-again.jsonfi
want dspark && log "== dspark"if want dspark && ENGINE=vllm GPU=$GPU PORT=$PORT SPEC=1 NAME=$NAME SERVED=rightnow-mini bash tools/serve.sh; then measure dspark; fi
want dflash && log "== dflash"if want dflash && GPU=$GPU PORT=$PORT NAME=$NAME MODEL_DIR=$R/models/Inkling-2-Mini DRAFTER_DIR=$R/models/Inkling-2-Mini-DFlash2 \ PREPARED=$R/models/dflash2-prepared bash engine/serve.sh; then measure dflash; fi
want dflash-keepcap && log "== dflash-keepcap"if want dflash-keepcap && [ ! -s $R/models/dflash2-keepcap/model.safetensors ]; then mkdir -p $R/models/dflash2-keepcap /usr/bin/docker run --rm --entrypoint python3 -v $R/models/Inkling-2-Mini:/model:ro -v $R/models/Inkling-2-Mini-DFlash2:/drafter:ro \ -v $R/models/dflash2-keepcap:/prepared -v $R/src/engine:/engine:ro vllm/vllm-openai:nightly /engine/build_drafter.py /model /drafter /prepared --keep-softcapfiif GPU=$GPU PORT=$PORT NAME=$NAME MODEL_DIR=$R/models/Inkling-2-Mini DRAFTER_DIR=$R/models/Inkling-2-Mini-DFlash2 \ PREPARED=$R/models/dflash2-keepcap bash engine/serve.sh; then measure dflash-keepcap; fi
/usr/bin/docker rm -f $NAME >/dev/null 2>&1for c in stock-again dspark dflash dflash-keepcap; do [ -s $R/results/raw/parity/$c.json ] && $R/venv/bin/python tools/parity.py compare $R/results/raw/parity/stock.json $R/results/raw/parity/$c.json \ --json $R/results/raw/parity/compare-$c.jsondonelog "== speed engine finished"1234567891011121314151617181920212223242526#!/usr/bin/env bash# More single attempts (temperature 0.8, at most 100 steps, the evaluation subset) of one model folder on one GPU,# served by the engine with drafting, each scored. The same settings as results/deep/att-*.# TAG=prune96 M=RightNow-Mini-e96 GPU=4 PORT=9004 ATTEMPTS="3 4" bash tools/variant_attempts.sh# WAIT_NO='results/agent/[f]t-2 ' waits until no process matches before taking the GPU.set -uR=/data/train/miniTAG=${TAG:?}; M=${M:?}; GPU=${GPU:?}; PORT=${PORT:?}; ATTEMPTS=${ATTEMPTS:?}export DOCKER=/usr/bin/dockerlog() { echo "$(date -u +%FT%TZ) [$TAG gpu $GPU] $*"; }cd $R/srcif [ -n "${WAIT_NO:-}" ]; then while pgrep -f "$WAIT_NO" >/dev/null; do sleep 15; done; fi/usr/bin/docker rm -f mini-vllm-g$GPU mini-deep-g$GPU mini-prune-g$GPU mini-var-g$GPU >/dev/null 2>&1sleep 6GPU=$GPU PORT=$PORT NAME=mini-var-g$GPU SERVED=inkling-2-mini MODEL_DIR=$R/models/$M DRAFTER_DIR=$R/models/Inkling-2-Mini-DFlash2 \ PREPARED=$R/models/dflash2-prepared bash engine/serve.sh > $R/logs/serve-var-$TAG-g$GPU.log 2>&1 || { log "THE ENGINE DID NOT START"; exit 1; }log "serving $M; attempts $ATTEMPTS"TAG=$TAG POOL=$R/src/eval/subset.json DATA=verified SPLIT=test STEPS=100 MAXTOK=8192 WORKERS=30 ATTEMPTS="$ATTEMPTS" PORTS="$PORT" \ bash train/gen.sh > $R/logs/$TAG-gen-g$GPU.log 2>&1for k in $ATTEMPTS; do ( LABEL=$TAG-att-$k OUT=$R/results/$TAG/att-$k EW=8 bash eval/score.sh > $R/logs/$TAG-score-$k.log 2>&1 ) &donewaitlog "attempts $ATTEMPTS resolved: $(for k in $ATTEMPTS; do python3 -c "import json;print(json.load(open('$R/results/$TAG/att-$k/summary.json'))['resolved'])" 2>/dev/null; done | tr '\n' ' ')"[ "${KEEP_SERVER:-0}" = 1 ] || /usr/bin/docker rm -f mini-var-g$GPU >/dev/null 2>&1log "done"tools/alone_timing.shAdded+41
tools/baseline_speed.shAdded+23
tools/bench.pyAdded+181
tools/card.pyAdded+144
tools/deep16_final.shAdded+21
tools/deep16_worker.shAdded+31
tools/deep_run.shAdded+56
tools/demo_live.shAdded+51
tools/docker_wrapper.shAdded+12
tools/fix_scoring.shAdded+45
tools/ft_eval.shAdded+35
tools/governor.shAdded+36
tools/make_release.pyAdded+126
tools/or_proxy.pyAdded+166
tools/parity.pyAdded+112
tools/prune_run.shAdded+40
tools/report_baseline.pyAdded+159
tools/report_deep.pyAdded+187
tools/report_size.pyAdded+90
tools/report_speed.pyAdded+96
tools/report_train.pyAdded+170
tools/rescore_queue.shAdded+33
tools/review_run.shAdded+28
tools/round2.shAdded+32
tools/selectors_run.shAdded+31
tools/serve.shAdded+44
tools/speed_engine.shAdded+54
tools/variant_attempts.shAdded+26