Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

bench: community report, RTX 4090, IQ3_S 140K / IQ3_XXS 200K opt-ins and tool-call hotfix (PR #1158)

Dmitry-Bd79510700c15
diff --git a/bench/results/2026-10-06-community-rtx4090-opt-ins/README.md b/bench/results/2026-10-06-community-rtx4090-opt-ins/README.md
new file mode 100644
index 000000000..0d6414e91
--- /dev/null
+++ b/bench/results/2026-10-06-community-rtx4090-opt-ins/README.md
@@ -0,0 +1,129 @@
+# What two opt-ins cost on a single-GPU RTX 4090: `STRATA_KV_PREFETCH=1`, and `"parallel": 2` with `--batch-mtp`
+
+Measured on 2026-10-06 by [Dmitry-B](https://github.com/Dmitry-B), on the machine and with the working configuration
+described in
+[2026-10-03-community-rtx4090-iq3xxs-200k](../2026-10-03-community-rtx4090-iq3xxs-200k/README.md) (RTX 4090,
+`qwen3.8-flash-next-iq3_xxs`, context 204,800, INT8 KV, **no** `--kv-resident`, `--mmap-experts`,
+`--spec 4 --mtp`, `draft_vocab=cyrillic`). Engine 0.1.40. Not a version comparison: two checks of two opt-ins, each
+with both arms measured on the same day on the same running server.
+
+Short answer for this PC: **both stay off.** `STRATA_KV_PREFETCH=1` is a 2–4% loss here, because with no
+`--kv-resident` there is nothing to overlap. `"parallel": 2` costs 28% of single-client decode and only pays when a
+third or fourth client appears. `--batch-mtp` cannot admit at all with this model's MTP pack.
+
+## Files in this folder
+
+| File | What it is |
+| --- | --- |
+| `benchmark.py` | the speed script (the same file as in the paired reports) |
+| `config-kvpref.json` | the server config copy of the KV-prefetch arm (the working config plus one environment variable) |
+| `runs-kvpref.json` | the KV-prefetch runs |
+| `conc_bench.py` | the concurrency script: N identical-shaped requests sent at the same time |
+| `runs-parallel-off.json`, `runs-parallel-2.json`, `runs-parallel-2-batch-mtp.json` | the three concurrency arms |
+
+## 1. `STRATA_KV_PREFETCH=1` (#732)
+
+Measured with the machine's working configuration plus that one environment variable, three runs at 32,768 and
+131,072 prompt tokens, code prompts, greedy, 256-token cap. The arm it is compared against is the 0.1.40 code arm of
+the paired report — same day, same arguments, no such variable.
+
+| Configuration | Prompt tok/s without → with `STRATA_KV_PREFETCH=1` |
+| --- | --- |
+| 32768-prompt | 3136.3 → 3001.8 (-4.3%) |
+| 131072-prompt | 3118.5 → 3052.3 (-2.1%) |
+
+With the option on: 32768-prompt 3001.8 tok/s (range 2936.9–3063.2, n=3), decode 113.8 (110.1–128.5), TTFT 10.51 s
+(10.31–10.75);
+131072-prompt 3052.3 tok/s (3030.3–3059.4, n=3), decode 106.5 (87.0–113.4), TTFT 41.26 s (one repeat waited behind
+an interactive client's request and reached 85.6 s). Peak VRAM 22040 MiB, peak RAM 6.59 GiB. Recall was not checked
+in this arm. Raw runs: [runs-kvpref.json](runs-kvpref.json), config: [config-kvpref.json](config-kvpref.json).
+
+The option overlaps streamed KV uploads with prefill (docs/KV_PREFETCH.md), so it can only help when part of the KV
+cache lives in system RAM — that is `--kv-resident`. This configuration has no `--kv-resident`: its KV cache stays
+in VRAM and there is nothing to overlap, so the measured result is a small loss. That matches the -4…-5% the
+option's author reported on an RTX 5070 with `--kv-resident 32768` and the reason it stays off by default: on a card
+whose KV fits in VRAM the extra streams and events cost more than they save. Conclusion for this machine: leave it
+off. It would have to be re-measured on this PC with `--kv-resident` before any conclusion about the option itself
+could be drawn.
+
+## 2. `"parallel": 2` (batch slots, #465) and `--batch-mtp` (#846)
+
+[conc_bench.py](conc_bench.py) sends N requests **at the same time** (N = 1, 2, 3, 4), each a distinct prompt of
+about 4,000 tokens carrying a random marker, 256-token output cap, `temperature=0`, `reasoning_effort=none`; two
+repeats per level; a 2,000-token warm-up before the levels. The two arms differ from the working config by two keys
+only: `"parallel": 2`, and `--batch-mtp` in `args`.
+
+- TTFT: time to the first non-empty streaming delta.
+- Per-client decode: generated tokens / (whole request time − TTFT), measured at the client. A batched request does
+ not report per-slot timings in the stream, so this column is client-side, not the engine's
+ `predicted_per_second`.
+- Total: all tokens generated in the level / the level's wall time. This is the number that says whether the server
+ served more per second, which is what batch slots are for.
+
+### What the engine said
+
+`"parallel": 2` (no `--batch-mtp`):
+
+```
+strata generate: --batch: 2 slot sessions on CUDA0 (2.88 GiB each); 7.98 GiB free
+strata generate: --batch 2: the slot sessions take 5.76 GiB of VRAM on CUDA0 that the expert cache would otherwise hold
+strata generate: expert cache 3329 slots, 5.41 GiB of VRAM; policy is PROFILE
+strata verify: batch windows of up to 2 sequences (layers [0, 48))
+```
+
+Without it the same start reports `expert cache 6946 slots, 11.17 GiB of VRAM`. So on this model at this context a
+slot costs 2.88 GiB and the expert cache loses more than half of it. The exact resident count depends on the expert
+profile state at the moment of the start — the paired speed reports for this configuration show 6,915–6,926 slots;
+the numbers above are the two starts of this experiment, taken from the same server log.
+
+`--batch-mtp` on top of it — the draft layer cannot be used for an admission, and the request never really starts:
+
+```
+strata batch: MTP admission for slot 0 failed: mtp: unsupported native MMVQ GGML type
+```
+
+After that the engine died and the server started it again; the two clients that were in flight finished about 300 s
+later having received 1 and 5 tokens. The MTP layer here is the pack setup downloaded for this model
+(`Strata-data/mtp/rt`), and its quant is MMVQ. This is the same family as #1012 (a `--batch` request whose engine
+died during its prompt read ends only after 300 s) and #1063 (`--batch-mtp` exits on the first admission with a
+draft-vocab problem), so it is reported as a data point, not as a new bug claim. The fixed behaviour on 0.1.40.1 is
+measured in [2026-10-06-community-rtx4090-toolcall-hotfix](../2026-10-06-community-rtx4090-toolcall-hotfix/README.md).
+
+### Results
+
+| Level | `"parallel"` off | `"parallel": 2` |
+| --- | --- | --- |
+| 1 client | wall 4.7-5.2 s, TTFT 2.3-3.0 s, decode 93-95 tok/s | wall 6.6-7.1 s, TTFT 2.7-3.5 s, decode **65-72** tok/s |
+| 2 clients | wall 8.2-8.6 s, TTFT med 4.2-4.3 s (max 6.6), decode 94-100 tok/s, total 46-52 tok/s | wall 9.5-10.2 s, TTFT med 3.8-4.1 s (max 5.5), decode 43-46 tok/s, total 45-48 tok/s |
+| 3 clients | wall 53.9-58.9 s, TTFT med 47.9-52.3 s, total **12.1** tok/s | wall **13.6-14.6 s**, TTFT med 4.9 s (max 11.4), total 45-46 tok/s |
+| 4 clients | wall 50.7-53.5 s, TTFT med 41.9-44.6 s, total **16.1-18.0** tok/s | wall **17.2-17.7 s**, TTFT med 7.7-7.9 s (max 13.7), total 48-50 tok/s |
+
+- One client: `"parallel": 2` costs about **28%** of decode speed (93–95 → 65–72 tok/s). This is the expert cache
+ shrinking, exactly the trade the docs describe for a card whose experts mostly fit in VRAM.
+- Two clients: nothing is gained here (46–52 → 45–48 tok/s total), the waiting is only moved a little.
+- Three and four clients: the wall time is 3–4 times lower and the total throughput is 3–4 times higher. This is
+ where the option pays for itself on one GPU.
+- `--batch-mtp`: unusable with this MTP pack, see above.
+
+Raw runs: [runs-parallel-off.json](runs-parallel-off.json), [runs-parallel-2.json](runs-parallel-2.json),
+[runs-parallel-2-batch-mtp.json](runs-parallel-2-batch-mtp.json).
+
+### What this PC does with it
+
+The machine is used by one interactive client most of the time, so the 28% single-stream cost is the number that
+matters here and the option stays off. It is kept as a measurement for the case where a second and a third client
+appear regularly.
+
+## Limitations
+
+- **Levels 3 and 4 with `"parallel"` off are contaminated by this machine's own interactive session**: a request of
+ about 100,000 tokens from another client (33–38 s of engine time) was served between the measured runs, and the
+ server answers one sequence at a time. That is why their TTFT medians reach 52 s. With two slots the same agent
+ request was served alongside the measured ones. So levels 3 and 4 compare in direction, not in numbers; levels 1
+ and 2 are clean.
+- Per-client decode in the batched arm is client-side (see above), so it is comparable between the arms only as a
+ direction. The engine-side numbers of this PC are in the paired reports linked at the top.
+- Two repeats per level, one machine, one model, one context. No answer-quality check was run here; the paired
+ reports cover recall (6/6 at 32K and 128K).
+- The KV-prefetch arm is one configuration without `--kv-resident`. It says what the option does to this
+ configuration, not what it would do to a configuration that can use it.
diff --git a/bench/results/2026-10-06-community-rtx4090-opt-ins/TRIMMED.md b/bench/results/2026-10-06-community-rtx4090-opt-ins/TRIMMED.md
new file mode 100644
index 000000000..cdec3333c
--- /dev/null
+++ b/bench/results/2026-10-06-community-rtx4090-opt-ins/TRIMMED.md
@@ -0,0 +1,10 @@
+# Trimmed files
+
+Ported from PR #1158 for 0.1.40.2. Raw dumps, logs and binaries were left out to keep the repository small;
+the README, summaries, configs and per-run results are unchanged. The files below were in the original PR.
+
+1 files, 0.0 MB:
+
+| file | bytes | why |
+|---|---:|---|
+| `benchmark.py` | 25,500 | over the folder's size budget |
diff --git a/bench/results/2026-10-06-community-rtx4090-opt-ins/conc_bench.py b/bench/results/2026-10-06-community-rtx4090-opt-ins/conc_bench.py
new file mode 100644
index 000000000..3233a4362
--- /dev/null
+++ b/bench/results/2026-10-06-community-rtx4090-opt-ins/conc_bench.py
@@ -0,0 +1,271 @@
+#!/usr/bin/env python3
+"""Замер параллельности Strata: сколько запросов одновременно и что с скоростью.
+
+Нужен для проверки `"parallel": N` / `--batch N` / `--batch-mtp` (docs/BATCHING.md):
+штатный strata-bench.py измеряет один запрос, а batching меняет именно картину
+нескольких клиентов. Здесь два режима:
+
+ solo — по одному запросу (опора: что должно остаться на одном клиенте)
+ conc — N запросов одновременно (2, 3, 4): что получает каждый и что — сервер в целом
+
+Каждый запрос содержит случайную метку -> кэш префиксов не переиспользуется.
+Скорость считаем из таймингов движка (поле timings в ответе без стриминга),
+TTFT и ожидание в очереди — из стриминга. Это два прохода на каждый размер:
+движковые тайминги и клиентские задержки в одном ответе не появляются.
+
+usage: strata-conc-bench.py [--levels 1,2,3,4] [--prompt-tokens 8000] [--max-tokens 256]
+ [--repeats 2] [--json out.json] [--label TEXT]
+"""
+import argparse
+import datetime
+import json
+import os
+import random
+import re
+import statistics
+import string
+import subprocess
+import sys
+import threading
+import time
+import urllib.request
+
+REPO = os.environ.get("STRATA_REPO", "/home/dgbox/Strata")
+CFG = os.environ.get("STRATA_CFG", REPO + "/strata-200k.json")
+PORT = int(os.environ.get("STRATA_PORT", "8080"))
+BASE = f"http://127.0.0.1:{PORT}"
+
+FILLERS = [
+ "В документе описывается модуль разбора конфигурации: он читает список секций, "
+ "проверяет обязательные поля и собирает структуру настроек, которую дальше использует планировщик.",
+ "Далее разбирается обработка ошибок: сбой на одной секции не должен останавливать остальные, "
+ "поэтому парсер собирает список замечаний и возвращает его вместе с частично прочитанными настройками.",
+ "Отдельно описан кэш: ключом служит хэш секции, запись живёт до изменения исходного файла, "
+ "а при несовпадении версии запись отбрасывается и секция читается заново.",
+]
+
+
+def cfg_value(key):
+ try:
+ with open(CFG, encoding="utf-8") as f:
+ c = json.load(f)
+ except Exception:
+ return None
+ return c.get(key)
+
+
+def api_key():
+ return cfg_value("api_key") or ""
+
+
+def server_cmdline():
+ """Аргументы движка, с которыми он сейчас запущен (для провенанса)."""
+ try:
+ out = subprocess.run(["pgrep", "-f", "engine/strata --serve"], capture_output=True, text=True).stdout.split()
+ for pid in out[:1]:
+ cmd = open(f"/proc/{pid}/cmdline", "rb").read().decode().split("\0")
+ return " ".join(x for x in cmd if x)
+ except Exception:
+ pass
+ return ""
+
+
+def engine_version():
+ try:
+ req = urllib.request.Request(BASE + "/props", headers={"Authorization": f"Bearer {api_key()}"})
+ with urllib.request.urlopen(req, timeout=15) as r:
+ return json.load(r).get("build_info")
+ except Exception:
+ return None
+
+
+def batch_slots():
+ """Сколько слотов движок реально открыл (concurrency.serving из /v1/status)."""
+ for path in ("/v1/status", "/metrics"):
+ try:
+ req = urllib.request.Request(BASE + path, headers={"Authorization": f"Bearer {api_key()}"})
+ with urllib.request.urlopen(req, timeout=15) as r:
+ d = json.load(r)
+ except Exception:
+ continue
+ for k in ("concurrency", "live"):
+ v = d.get(k)
+ if isinstance(v, dict):
+ for kk in ("serving", "slots", "batch_slots"):
+ if isinstance(v.get(kk), int):
+ return v[kk]
+ if isinstance(v.get("slots"), dict):
+ return len(v["slots"])
+ return None
+
+
+def make_prompt(tokens, ratio):
+ """Промпт нужной длины со случайной меткой.
+
+ ratio — токенов на символ (у этой модели на русском ~0.28). Значит нужное число
+ символов = tokens / ratio. Фактическую длину в токенах видно по prompt_n в ответе.
+ """
+ marker = "".join(random.choices(string.ascii_uppercase + string.digits, k=10))
+ body = []
+ n = 0
+ while n < tokens / ratio:
+ body.append(f"[{marker}-{len(body)}] " + random.choice(FILLERS))
+ n += len(body[-1])
+ text = "\n".join(body)
+ return text, marker
+
+
+def post(path, payload, stream=False, timeout=900):
+ data = json.dumps(payload).encode()
+ req = urllib.request.Request(BASE + path, data=data, method="POST",
+ headers={"Content-Type": "application/json",
+ "Authorization": f"Bearer {api_key()}"})
+ return urllib.request.urlopen(req, timeout=timeout)
+
+
+def one_request(prompt_tokens, max_tokens, ratio, stream_mode):
+ """Один запрос. Возвращает dict с движковыми таймингами и (если стрим) TTFT/wall."""
+ text, marker = make_prompt(prompt_tokens, ratio)
+ payload = {"messages": [{"role": "user", "content": text + "\nКратко перескажи, что здесь описано."}],
+ "max_tokens": max_tokens, "temperature": 0, "reasoning_effort": "none"}
+ t0 = time.time()
+ ttft = None
+ if stream_mode:
+ payload["stream"] = True
+ payload["stream_options"] = {"include_usage": True}
+ resp = post("/v1/chat/completions", payload, stream=True)
+ gen = 0
+ timings = None
+ for raw in resp:
+ line = raw.decode("utf-8", "ignore").strip()
+ if not line.startswith("data:"):
+ continue
+ body = line[5:].strip()
+ if body == "[DONE]":
+ break
+ try:
+ d = json.loads(body)
+ except Exception:
+ continue
+ if d.get("timings"):
+ timings = d["timings"]
+ if d.get("usage"):
+ gen = d["usage"].get("completion_tokens", gen)
+ for ch in d.get("choices", []):
+ delta = ch.get("delta") or {}
+ piece = (delta.get("content") or "") + (delta.get("reasoning_content") or "")
+ if piece and ttft is None:
+ ttft = time.time() - t0
+ gen += len(piece)
+ wall = time.time() - t0
+ return {"ok": True, "ttft_s": ttft, "wall_s": wall, "gen_n": gen,
+ "prompt_s": (timings or {}).get("prompt_per_second"),
+ "gen_s": (timings or {}).get("predicted_per_second"),
+ "prompt_n": (timings or {}).get("prompt_n")}
+ resp = post("/v1/chat/completions", payload)
+ d = json.loads(resp.read().decode())
+ wall = time.time() - t0
+ t = d.get("timings") or {}
+ return {"ok": True, "wall_s": wall, "ttft_s": None,
+ "gen_n": d.get("usage", {}).get("completion_tokens"),
+ "prompt_n": t.get("prompt_n"), "prompt_s": t.get("prompt_per_second"),
+ "gen_s": t.get("predicted_per_second"),
+ "draft_ok": t.get("draft_n_accepted"), "draft_n": t.get("draft_n")}
+
+
+def run_level(n, prompt_tokens, max_tokens, ratio, repeats):
+ """n одновременных запросов; repeats повторов уровня."""
+ rows = []
+ for _ in range(repeats):
+ results = [None] * n
+ errs = [None] * n
+
+ def worker(i):
+ try:
+ results[i] = one_request(prompt_tokens, max_tokens, ratio, stream_mode=True)
+ except Exception as e:
+ errs[i] = f"{type(e).__name__}: {e}"
+
+ ths = [threading.Thread(target=worker, args=(i,)) for i in range(n)]
+ t0 = time.time()
+ for t in ths:
+ t.start()
+ for t in ths:
+ t.join()
+ wall_all = time.time() - t0
+ rows.append({"n": n, "wall_all_s": wall_all,
+ "clients": [r for r in results if r], "errors": [e for e in errs if e]})
+ return rows
+
+
+def med(v):
+ v = [x for x in v if isinstance(x, (int, float))]
+ return statistics.median(v) if v else None
+
+
+def summarize(level_rows):
+ out = []
+ for row in level_rows:
+ cl = row["clients"]
+ gen = [c.get("gen_n") or 0 for c in cl]
+ ttft = [c.get("ttft_s") for c in cl]
+ decode = [(c["gen_n"] / (c["wall_s"] - c["ttft_s"])) for c in cl
+ if c.get("gen_n") and c.get("ttft_s") is not None and c["wall_s"] > c["ttft_s"]]
+ out.append({"n": row["n"], "clients_ok": len(cl), "errors": row["errors"],
+ "prompt_n": med([c.get("prompt_n") for c in cl]),
+ "wall_all_s": round(row["wall_all_s"], 2),
+ "gen_per_client": med(gen), "gen_total": sum(gen),
+ "ttft_med_s": round(med(ttft) or 0, 2),
+ "ttft_max_s": round(max([t for t in ttft if t is not None] or [0]), 2),
+ "decode_client_med": round(med(decode) or 0, 1),
+ "throughput_total": round(sum(gen) / row["wall_all_s"], 1) if row["wall_all_s"] else 0})
+ return out
+
+
+def main():
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--levels", default="1,2,3,4")
+ ap.add_argument("--prompt-tokens", type=int, default=8000)
+ ap.add_argument("--max-tokens", type=int, default=256)
+ ap.add_argument("--repeats", type=int, default=2)
+ ap.add_argument("--warm-tokens", type=int, default=2000)
+ ap.add_argument("--json", default=None)
+ ap.add_argument("--label", default="")
+ a = ap.parse_args()
+
+ ratio = float(os.environ.get("STRATA_TOKENS_PER_CHAR", "0.28")) # токенов на символ (русский текст)
+ ver = engine_version()
+ slots = batch_slots()
+ print(f"сервер: {BASE}, движок: {ver}, слотов движка (concurrency.serving): {slots}")
+ print(f"аргументы движка: {server_cmdline()[:400]}")
+ print(f"прогрев ({a.warm_tokens} токенов)...")
+ one_request(a.warm_tokens, 64, ratio, stream_mode=False)
+
+ data = {"label": a.label, "engine": ver, "batch_slots": slots,
+ "cmdline": server_cmdline(), "config": CFG,
+ "prompt_tokens": a.prompt_tokens, "max_tokens": a.max_tokens,
+ "repeats": a.repeats, "levels": [], "ts": datetime.datetime.now().isoformat()}
+ for n in [int(x) for x in a.levels.split(",")]:
+ print(f"\n=== уровень {n} одновременных запросов ({a.repeats} повтора) ===")
+ rows = run_level(n, a.prompt_tokens, a.max_tokens, ratio, a.repeats)
+ summ = summarize(rows)
+ for s in summ:
+ print(f" n={s['n']} ок={s['clients_ok']} wall={s['wall_all_s']}с "
+ f"токенов на клиента={s['gen_per_client']} всего={s['gen_total']} "
+ f"TTFT мед={s['ttft_med_s']}с макс={s['ttft_max_s']}с "
+ f"генерация на клиента={s['decode_client_med']} ток/с "
+ f"итоговая скорость={s['throughput_total']} ток/с")
+ if s["errors"]:
+ print(" ошибки:", s["errors"])
+ data["levels"].append({"n": n, "runs": rows, "summary": summ})
+ time.sleep(3)
+
+ out = a.json or f"/home/dgbox/logs/conc-{datetime.date.today()}-{re.sub(r'[^a-z0-9]+', '-', a.label.lower()).strip('-')}.json"
+ os.makedirs(os.path.dirname(out), exist_ok=True)
+ with open(out, "w", encoding="utf-8") as f:
+ json.dump(data, f, ensure_ascii=False, indent=1)
+ print(f"\nJSON: {out}")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/bench/results/2026-10-06-community-rtx4090-opt-ins/config-kvpref.json b/bench/results/2026-10-06-community-rtx4090-opt-ins/config-kvpref.json
new file mode 100644
index 000000000..7d2005fb2
--- /dev/null
+++ b/bench/results/2026-10-06-community-rtx4090-opt-ins/config-kvpref.json
@@ -0,0 +1,92 @@
+{
+ "exe": "/home/dgbox/Strata/engine/strata",
+ "args": [
+ "--pack",
+ "/home/dgbox/Strata-data/packs/iq3_xxs",
+ "--native",
+ "/home/dgbox/Strata-data/models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf",
+ "--ple-gguf",
+ "/home/dgbox/Strata-data/models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf",
+ "--expert-profile",
+ "/home/dgbox/Strata/data/expert-profile.bin",
+ "--expert-cache",
+ "auto",
+ "--prefill",
+ "auto",
+ "--spec",
+ "4",
+ "--mtp",
+ "/home/dgbox/Strata-data/mtp/rt",
+ "--max-context",
+ "204800",
+ "--kv",
+ "int8",
+ "--mmap-experts",
+ "--vision",
+ "--vram-reserve-mib",
+ "989",
+ "--control-vector-scaled",
+ "/home/dgbox/Strata/data/experimental-speed-projection/Qwen3.8-Flash-Next-experimental-speed-projection.gguf:1.0",
+ "--control-vector-layer-range",
+ "4",
+ "44",
+ "--cvec-mode",
+ "project",
+ "--cvec-dir",
+ "per-layer",
+ "--pcie-frac",
+ "0.00",
+ "--spec-min-p",
+ "0.50",
+ "--pool-workers",
+ "10"
+ ],
+ "cwd": "/home/dgbox/Strata",
+ "tokenizer": "/home/dgbox/Strata-data/packs/iq3_xxs/tokenizer",
+ "model_name": "qwen3.8-flash-next-iq3_xxs",
+ "draft_vocab": "cyrillic",
+ "expert_profile_save": "/home/dgbox/Strata/data/expert-profile-learned.bin",
+ "expert_profile_save_every": 10,
+ "env": {
+ "STRATA_PF_FUSED": "1",
+ "STRATA_KV_PREFETCH": "1"
+ },
+ "log": "/home/dgbox/Strata/strata-200k.log",
+ "lib_dirs": [
+ "/usr/local/cuda/bin",
+ "/usr/local/cuda/lib64"
+ ],
+ "port": 8080,
+ "host": "0.0.0.0",
+ "gpu": 0,
+ "gpus_asked": true,
+ "vision": {
+ "exe": "/home/dgbox/Strata/engine/strata-vision",
+ "mmproj": "/home/dgbox/Strata-data/models/mmproj-Qwen3.8-Flash-Next-BF16.gguf",
+ "model": "/home/dgbox/Strata-data/models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf",
+ "gpu": true,
+ "max_tokens": 1024
+ },
+ "mcp_servers": {
+ "crawl4ai": {
+ "command": "/home/dgbox/.local/share/pi-node/node-v22.22.3-linux-x64/bin/node",
+ "args": [
+ "/home/dgbox/.local/share/pi-node/node-v22.22.3-linux-x64/lib/node_modules/crawl4ai-mcp-sse-stdio/bin/crawl4ai-mcp.js",
+ "--stdio"
+ ],
+ "env": {
+ "NODE_TLS_REJECT_UNAUTHORIZED": "0",
+ "CRAWL4AI_ENDPOINT": "https://192.168.2.162/crawl4ai/",
+ "CRAWL4AI_BEARER_TOKEN": "removed"
+ }
+ },
+ "search": {
+ "command": "/usr/bin/python3",
+ "args": [
+ "/home/dgbox/scripts/searxng-mcp.py"
+ ]
+ }
+ },
+ "reasoning_effort": "low",
+ "fit_max_tokens": true
+}
\ No newline at end of file
diff --git a/bench/results/2026-10-06-community-rtx4090-opt-ins/runs-kvpref.json b/bench/results/2026-10-06-community-rtx4090-opt-ins/runs-kvpref.json
new file mode 100644
index 000000000..1a3fee77f
--- /dev/null
+++ b/bench/results/2026-10-06-community-rtx4090-opt-ins/runs-kvpref.json
@@ -0,0 +1,282 @@
+{
+ "label": "kvpref-check",
+ "style": "code",
+ "env": {
+ "collected_at": "2026-10-06T12:31:54",
+ "gpu": {
+ "name": "NVIDIA GeForce RTX 4090",
+ "vram_mib": "23028",
+ "driver": "610.57.04",
+ "power_limit_w": "480.00",
+ "pci_bus": "00000000:01:00.0"
+ },
+ "gpu_link": "Failed to parse --display/-d flags",
+ "cpu": {
+ "model": "AMD Ryzen 9 7950X 16-Core Processor",
+ "logical_cpus": "32"
+ },
+ "ram_total_kib": "47579468",
+ "os": "Ubuntu 26.04.1 LTS",
+ "kernel": "7.0.0-38-generic",
+ "cuda": "release 13.4, V13.4.92",
+ "storage": "",
+ "strata_commit": "1735d6471df29b42c26170efaac1f1446a58640f",
+ "strata_branch": "main",
+ "engine_version": "0.1.40",
+ "model_name": "qwen3.8-flash-next-iq3_xxs",
+ "context": {
+ "native": 204800,
+ "max_positions": 204800
+ },
+ "cache_max_tokens": 204800,
+ "vision": {
+ "enabled": true,
+ "available": true,
+ "error": null
+ },
+ "engine_launch_command": "/bin/bash -c cd ~/Strata && echo /home/dgbox/Strata/strata-test-200k-kvpref.json > try-config && sudo -n systemctl restart strata.service && for i in $(seq 1 60); do curl -s -m 5 http://127.0.0.1:8080/health | grep -q '\"loaded\": true' && break; sleep 5; done; curl -s -m 5 http://127.0.0.1:8080/health; echo; tr '\\0' '\\n' < /proc/$(pgrep -f \"engine/strata --serve\" | head -1)/cmdline | grep -c STRATA || true; echo \"--- замер 32k/128k с KV_PREFETCH=1 ---\"; timeout 1200 .venv/bin/python -u ~/scripts/strata-bench.py kvpref-check --style code --lengths 32k,128k --no-gen-case 2>&1 | tail -12",
+ "model_files": [],
+ "server_config_path": "/home/dgbox/Strata/strata-test-200k-kvpref.json",
+ "server_config": {
+ "exe": "/home/dgbox/Strata/engine/strata",
+ "args": [
+ "--pack",
+ "/home/dgbox/Strata-data/packs/iq3_xxs",
+ "--native",
+ "/home/dgbox/Strata-data/models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf",
+ "--ple-gguf",
+ "/home/dgbox/Strata-data/models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf",
+ "--expert-profile",
+ "/home/dgbox/Strata/data/expert-profile.bin",
+ "--expert-cache",
+ "auto",
+ "--prefill",
+ "auto",
+ "--spec",
+ "4",
+ "--mtp",
+ "/home/dgbox/Strata-data/mtp/rt",
+ "--max-context",
+ "204800",
+ "--kv",
+ "int8",
+ "--mmap-experts",
+ "--vision",
+ "--vram-reserve-mib",
+ "989",
+ "--control-vector-scaled",
+ "/home/dgbox/Strata/data/experimental-speed-projection/Qwen3.8-Flash-Next-experimental-speed-projection.gguf:1.0",
+ "--control-vector-layer-range",
+ "4",
+ "44",
+ "--cvec-mode",
+ "project",
+ "--cvec-dir",
+ "per-layer",
+ "--pcie-frac",
+ "0.00",
+ "--spec-min-p",
+ "0.50",
+ "--pool-workers",
+ "10"
+ ],
+ "cwd": "/home/dgbox/Strata",
+ "tokenizer": "/home/dgbox/Strata-data/packs/iq3_xxs/tokenizer",
+ "model_name": "qwen3.8-flash-next-iq3_xxs",
+ "draft_vocab": "cyrillic",
+ "expert_profile_save": "/home/dgbox/Strata/data/expert-profile-learned.bin",
+ "expert_profile_save_every": 10,
+ "env": {
+ "STRATA_PF_FUSED": "1",
+ "STRATA_KV_PREFETCH": "1"
+ },
+ "log": "/home/dgbox/Strata/strata-200k.log",
+ "lib_dirs": [
+ "/usr/local/cuda/bin",
+ "/usr/local/cuda/lib64"
+ ],
+ "port": 8080,
+ "host": "0.0.0.0",
+ "gpu": 0,
+ "gpus_asked": true,
+ "vision": {
+ "exe": "/home/dgbox/Strata/engine/strata-vision",
+ "mmproj": "/home/dgbox/Strata-data/models/mmproj-Qwen3.8-Flash-Next-BF16.gguf",
+ "model": "/home/dgbox/Strata-data/models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf",
+ "gpu": true,
+ "max_tokens": 1024
+ },
+ "mcp_servers": {
+ "crawl4ai": {
+ "command": "/home/dgbox/.local/share/pi-node/node-v22.22.3-linux-x64/bin/node",
+ "args": [
+ "/home/dgbox/.local/share/pi-node/node-v22.22.3-linux-x64/lib/node_modules/crawl4ai-mcp-sse-stdio/bin/crawl4ai-mcp.js",
+ "--stdio"
+ ],
+ "env": {
+ "NODE_TLS_REJECT_UNAUTHORIZED": "0",
+ "CRAWL4AI_ENDPOINT": "https://192.168.2.162/crawl4ai/",
+ "CRAWL4AI_BEARER_TOKEN": "removed"
+ }
+ },
+ "search": {
+ "command": "/usr/bin/python3",
+ "args": [
+ "/home/dgbox/scripts/searxng-mcp.py"
+ ]
+ }
+ },
+ "reasoning_effort": "low",
+ "fit_max_tokens": true
+ }
+ },
+ "memory": {
+ "start_snapshot": {
+ "vram_used_mib": 22024,
+ "ram_used_kib": 5749720
+ },
+ "peak_vram_used_mib": 22040,
+ "peak_ram_used_kib": 6587012,
+ "note": "пик — максимум опросов каждые 2 с во время замеров"
+ },
+ "results": [
+ {
+ "case": "32768-prompt",
+ "target_prompt_tokens": 32768,
+ "max_tokens": 256,
+ "prompt_tok_s": {
+ "median": 3001.8,
+ "min": 2936.9,
+ "max": 3063.2,
+ "n": 3
+ },
+ "gen_tok_s": {
+ "median": 113.8,
+ "min": 110.1,
+ "max": 128.5,
+ "n": 3
+ },
+ "ttft": {
+ "median": 10.51,
+ "min": 10.31,
+ "max": 10.75,
+ "n": 3
+ },
+ "wall": {
+ "median": 12.75,
+ "min": 12.29,
+ "max": 13.06,
+ "n": 3
+ },
+ "draft_ok": 489,
+ "draft_n": 642,
+ "all": [
+ {
+ "prompt_n": 31307,
+ "prompt_s": 2936.9,
+ "gen_n": 256,
+ "gen_s": 110.1,
+ "draft_n": 203,
+ "draft_ok": 166,
+ "cached": 0,
+ "ttft_s": 10.75,
+ "wall_s": 13.06,
+ "text": "Based on the description provided, here is a conceptual implementation of the `p"
+ },
+ {
+ "prompt_n": 31307,
+ "prompt_s": 3001.8,
+ "gen_n": 256,
+ "gen_s": 113.8,
+ "draft_n": 222,
+ "draft_ok": 156,
+ "cached": 0,
+ "ttft_s": 10.513,
+ "wall_s": 12.75,
+ "text": "Based on the description provided, here is a Rust implementation of the `parse_r"
+ },
+ {
+ "prompt_n": 31307,
+ "prompt_s": 3063.2,
+ "gen_n": 256,
+ "gen_s": 128.5,
+ "draft_n": 217,
+ "draft_ok": 167,
+ "cached": 0,
+ "ttft_s": 10.306,
+ "wall_s": 12.29,
+ "text": "Based on the description provided, here is a conceptual implementation of the `p"
+ }
+ ]
+ },
+ {
+ "case": "131072-prompt",
+ "target_prompt_tokens": 131072,
+ "max_tokens": 256,
+ "prompt_tok_s": {
+ "median": 3052.3,
+ "min": 3030.3,
+ "max": 3059.4,
+ "n": 3
+ },
+ "gen_tok_s": {
+ "median": 106.5,
+ "min": 87.0,
+ "max": 113.4,
+ "n": 3
+ },
+ "ttft": {
+ "median": 41.26,
+ "min": 41.16,
+ "max": 85.58,
+ "n": 3
+ },
+ "wall": {
+ "median": 43.4,
+ "min": 42.58,
+ "max": 87.45,
+ "n": 3
+ },
+ "draft_ok": 353,
+ "draft_n": 477,
+ "all": [
+ {
+ "prompt_n": 125011,
+ "prompt_s": 3052.3,
+ "gen_n": 142,
+ "gen_s": 106.5,
+ "draft_n": 120,
+ "draft_ok": 87,
+ "cached": 0,
+ "ttft_s": 41.263,
+ "wall_s": 42.58,
+ "text": "Based on the text provided, here is a summary of the function `parse_record`:\n\n*"
+ },
+ {
+ "prompt_n": 125011,
+ "prompt_s": 3030.3,
+ "gen_n": 164,
+ "gen_s": 87.0,
+ "draft_n": 147,
+ "draft_ok": 102,
+ "cached": 0,
+ "ttft_s": 85.576,
+ "wall_s": 87.45,
+ "text": "Based on the text provided, here is a summary of the function `parse_record`:\n\n*"
+ },
+ {
+ "prompt_n": 125011,
+ "prompt_s": 3059.4,
+ "gen_n": 256,
+ "gen_s": 113.4,
+ "draft_n": 210,
+ "draft_ok": 164,
+ "cached": 0,
+ "ttft_s": 41.159,
+ "wall_s": 43.4,
+ "text": "Based on the description provided, here is a conceptual implementation of the `p"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/bench/results/2026-10-06-community-rtx4090-opt-ins/runs-parallel-2-batch-mtp.json b/bench/results/2026-10-06-community-rtx4090-opt-ins/runs-parallel-2-batch-mtp.json
new file mode 100644
index 000000000..973f14958
--- /dev/null
+++ b/bench/results/2026-10-06-community-rtx4090-opt-ins/runs-parallel-2-batch-mtp.json
@@ -0,0 +1,94 @@
+{
+ "label": "B-probe",
+ "engine": "Strata 0.1.40",
+ "batch_slots": 2,
+ "cmdline": "/home/dgbox/Strata/engine/strata --serve --pack /home/dgbox/Strata-data/packs/iq3_xxs --native /home/dgbox/Strata-data/models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf --ple-gguf /home/dgbox/Strata-data/models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf --expert-profile /home/dgbox/Strata/data/expert-profile-learned.bin --expert-cache auto --prefill auto --spec 4 --mtp /home/dgbox/Strata-data/mtp/rt --max-context 204800 --kv int8 --mmap-experts --vision --vram-reserve-mib 989 --control-vector-scaled /home/dgbox/Strata/data/experimental-speed-projection/Qwen3.8-Flash-Next-experimental-speed-projection.gguf:1.0 --control-vector-layer-range 4 44 --cvec-mode project --cvec-dir per-layer --pcie-frac 0.00 --spec-min-p 0.50 --pool-workers 10 --batch-mtp --batch 2 --expert-profile-save /home/dgbox/Strata/data/expert-profile-learned.bin --expert-profile-save-every 10",
+ "config": "/home/dgbox/Strata/strata-200k.json",
+ "prompt_tokens": 4000,
+ "max_tokens": 256,
+ "repeats": 1,
+ "levels": [
+ {
+ "n": 1,
+ "runs": [
+ {
+ "n": 1,
+ "wall_all_s": 6.654576778411865,
+ "clients": [
+ {
+ "ok": true,
+ "ttft_s": 3.0457005500793457,
+ "wall_s": 6.653806924819946,
+ "gen_n": 222,
+ "prompt_s": 1369.0,
+ "gen_s": 61.3,
+ "prompt_n": 4117
+ }
+ ],
+ "errors": []
+ }
+ ],
+ "summary": [
+ {
+ "n": 1,
+ "clients_ok": 1,
+ "errors": [],
+ "prompt_n": 4117,
+ "wall_all_s": 6.65,
+ "gen_per_client": 222,
+ "gen_total": 222,
+ "ttft_med_s": 3.05,
+ "ttft_max_s": 3.05,
+ "decode_client_med": 61.5,
+ "throughput_total": 33.4
+ }
+ ]
+ },
+ {
+ "n": 2,
+ "runs": [
+ {
+ "n": 2,
+ "wall_all_s": 305.1081531047821,
+ "clients": [
+ {
+ "ok": true,
+ "ttft_s": 3.2913410663604736,
+ "wall_s": 305.1076009273529,
+ "gen_n": 11,
+ "prompt_s": null,
+ "gen_s": null,
+ "prompt_n": null
+ },
+ {
+ "ok": true,
+ "ttft_s": null,
+ "wall_s": 305.1074867248535,
+ "gen_n": 0,
+ "prompt_s": null,
+ "gen_s": null,
+ "prompt_n": null
+ }
+ ],
+ "errors": []
+ }
+ ],
+ "summary": [
+ {
+ "n": 2,
+ "clients_ok": 2,
+ "errors": [],
+ "prompt_n": null,
+ "wall_all_s": 305.11,
+ "gen_per_client": 5.5,
+ "gen_total": 11,
+ "ttft_med_s": 3.29,
+ "ttft_max_s": 3.29,
+ "decode_client_med": 0.0,
+ "throughput_total": 0.0
+ }
+ ]
+ }
+ ],
+ "ts": "2026-10-06T12:07:34.384950"
+}
\ No newline at end of file
diff --git a/bench/results/2026-10-06-community-rtx4090-opt-ins/runs-parallel-2.json b/bench/results/2026-10-06-community-rtx4090-opt-ins/runs-parallel-2.json
new file mode 100644
index 000000000..a989ae8ab
--- /dev/null
+++ b/bench/results/2026-10-06-community-rtx4090-opt-ins/runs-parallel-2.json
@@ -0,0 +1,381 @@
+{
+ "label": "C-batch2-nomtp-0140",
+ "engine": "Strata 0.1.40",
+ "batch_slots": 2,
+ "cmdline": "/home/dgbox/Strata/engine/strata --serve --pack /home/dgbox/Strata-data/packs/iq3_xxs --native /home/dgbox/Strata-data/models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf --ple-gguf /home/dgbox/Strata-data/models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf --expert-profile /home/dgbox/Strata/data/expert-profile-learned.bin --expert-cache auto --prefill auto --spec 4 --mtp /home/dgbox/Strata-data/mtp/rt --max-context 204800 --kv int8 --mmap-experts --vision --vram-reserve-mib 989 --control-vector-scaled /home/dgbox/Strata/data/experimental-speed-projection/Qwen3.8-Flash-Next-experimental-speed-projection.gguf:1.0 --control-vector-layer-range 4 44 --cvec-mode project --cvec-dir per-layer --pcie-frac 0.00 --spec-min-p 0.50 --pool-workers 10 --batch 2 --expert-profile-save /home/dgbox/Strata/data/expert-profile-learned.bin --expert-profile-save-every 10",
+ "config": "/home/dgbox/Strata/strata-200k.json",
+ "prompt_tokens": 4000,
+ "max_tokens": 256,
+ "repeats": 2,
+ "levels": [
+ {
+ "n": 1,
+ "runs": [
+ {
+ "n": 1,
+ "wall_all_s": 6.616622686386108,
+ "clients": [
+ {
+ "ok": true,
+ "ttft_s": 2.672250747680664,
+ "wall_s": 6.6163859367370605,
+ "gen_n": 256,
+ "prompt_s": 1510.4,
+ "gen_s": 64.6,
+ "prompt_n": 3980
+ }
+ ],
+ "errors": []
+ },
+ {
+ "n": 1,
+ "wall_all_s": 7.055365085601807,
+ "clients": [
+ {
+ "ok": true,
+ "ttft_s": 3.4779293537139893,
+ "wall_s": 7.055062532424927,
+ "gen_n": 256,
+ "prompt_s": 1200.1,
+ "gen_s": 71.2,
+ "prompt_n": 4125
+ }
+ ],
+ "errors": []
+ }
+ ],
+ "summary": [
+ {
+ "n": 1,
+ "clients_ok": 1,
+ "errors": [],
+ "prompt_n": 3980,
+ "wall_all_s": 6.62,
+ "gen_per_client": 256,
+ "gen_total": 256,
+ "ttft_med_s": 2.67,
+ "ttft_max_s": 2.67,
+ "decode_client_med": 64.9,
+ "throughput_total": 38.7
+ },
+ {
+ "n": 1,
+ "clients_ok": 1,
+ "errors": [],
+ "prompt_n": 4125,
+ "wall_all_s": 7.06,
+ "gen_per_client": 256,
+ "gen_total": 256,
+ "ttft_med_s": 3.48,
+ "ttft_max_s": 3.48,
+ "decode_client_med": 71.6,
+ "throughput_total": 36.3
+ }
+ ]
+ },
+ {
+ "n": 2,
+ "runs": [
+ {
+ "n": 2,
+ "wall_all_s": 10.185706377029419,
+ "clients": [
+ {
+ "ok": true,
+ "ttft_s": 5.495179176330566,
+ "wall_s": 9.361019134521484,
+ "gen_n": 197,
+ "prompt_s": 1597.5,
+ "gen_s": 70.4,
+ "prompt_n": 4063
+ },
+ {
+ "ok": true,
+ "ttft_s": 2.726138114929199,
+ "wall_s": 10.185049533843994,
+ "gen_n": 256,
+ "prompt_s": null,
+ "gen_s": 73.4,
+ "prompt_n": 0
+ }
+ ],
+ "errors": []
+ },
+ {
+ "n": 2,
+ "wall_all_s": 9.478683710098267,
+ "clients": [
+ {
+ "ok": true,
+ "ttft_s": 5.077582597732544,
+ "wall_s": 8.653701543807983,
+ "gen_n": 199,
+ "prompt_s": 1709.7,
+ "gen_s": 43.7,
+ "prompt_n": 4114
+ },
+ {
+ "ok": true,
+ "ttft_s": 2.5022013187408447,
+ "wall_s": 9.477995157241821,
+ "gen_n": 256,
+ "prompt_s": null,
+ "gen_s": 70.2,
+ "prompt_n": 0
+ }
+ ],
+ "errors": []
+ }
+ ],
+ "summary": [
+ {
+ "n": 2,
+ "clients_ok": 2,
+ "errors": [],
+ "prompt_n": 2031.5,
+ "wall_all_s": 10.19,
+ "gen_per_client": 226.5,
+ "gen_total": 453,
+ "ttft_med_s": 4.11,
+ "ttft_max_s": 5.5,
+ "decode_client_med": 42.6,
+ "throughput_total": 44.5
+ },
+ {
+ "n": 2,
+ "clients_ok": 2,
+ "errors": [],
+ "prompt_n": 2057.0,
+ "wall_all_s": 9.48,
+ "gen_per_client": 227.5,
+ "gen_total": 455,
+ "ttft_med_s": 3.79,
+ "ttft_max_s": 5.08,
+ "decode_client_med": 46.2,
+ "throughput_total": 48.0
+ }
+ ]
+ },
+ {
+ "n": 3,
+ "runs": [
+ {
+ "n": 3,
+ "wall_all_s": 13.579210042953491,
+ "clients": [
+ {
+ "ok": true,
+ "ttft_s": 2.48364520072937,
+ "wall_s": 10.917393207550049,
+ "gen_n": 208,
+ "prompt_s": null,
+ "gen_s": 76.9,
+ "prompt_n": 0
+ },
+ {
+ "ok": true,
+ "ttft_s": 10.713701963424683,
+ "wall_s": 13.578624725341797,
+ "gen_n": 204,
+ "prompt_s": null,
+ "gen_s": 75.6,
+ "prompt_n": 0
+ },
+ {
+ "ok": true,
+ "ttft_s": 4.933422565460205,
+ "wall_s": 8.364566326141357,
+ "gen_n": 199,
+ "prompt_s": 1788.0,
+ "gen_s": 75.8,
+ "prompt_n": 4116
+ }
+ ],
+ "errors": []
+ },
+ {
+ "n": 3,
+ "wall_all_s": 14.582763671875,
+ "clients": [
+ {
+ "ok": true,
+ "ttft_s": 2.3425865173339844,
+ "wall_s": 9.0059175491333,
+ "gen_n": 218,
+ "prompt_s": null,
+ "gen_s": 67.6,
+ "prompt_n": 0
+ },
+ {
+ "ok": true,
+ "ttft_s": 4.914309501647949,
+ "wall_s": 12.292870998382568,
+ "gen_n": 256,
+ "prompt_s": 1666.5,
+ "gen_s": 35.0,
+ "prompt_n": 3980
+ },
+ {
+ "ok": true,
+ "ttft_s": 11.423046350479126,
+ "wall_s": 14.581972360610962,
+ "gen_n": 202,
+ "prompt_s": null,
+ "gen_s": 72.0,
+ "prompt_n": 0
+ }
+ ],
+ "errors": []
+ }
+ ],
+ "summary": [
+ {
+ "n": 3,
+ "clients_ok": 3,
+ "errors": [],
+ "prompt_n": 0,
+ "wall_all_s": 13.58,
+ "gen_per_client": 204,
+ "gen_total": 611,
+ "ttft_med_s": 4.93,
+ "ttft_max_s": 10.71,
+ "decode_client_med": 58.0,
+ "throughput_total": 45.0
+ },
+ {
+ "n": 3,
+ "clients_ok": 3,
+ "errors": [],
+ "prompt_n": 0,
+ "wall_all_s": 14.58,
+ "gen_per_client": 218,
+ "gen_total": 676,
+ "ttft_med_s": 4.91,
+ "ttft_max_s": 11.42,
+ "decode_client_med": 34.7,
+ "throughput_total": 46.4
+ }
+ ]
+ },
+ {
+ "n": 4,
+ "runs": [
+ {
+ "n": 4,
+ "wall_all_s": 17.661741256713867,
+ "clients": [
+ {
+ "ok": true,
+ "ttft_s": 4.898972988128662,
+ "wall_s": 8.46162724494934,
+ "gen_n": 192,
+ "prompt_s": 1752.7,
+ "gen_s": 67.6,
+ "prompt_n": 4147
+ },
+ {
+ "ok": true,
+ "ttft_s": 10.866459846496582,
+ "wall_s": 17.6609890460968,
+ "gen_n": 256,
+ "prompt_s": null,
+ "gen_s": 77.2,
+ "prompt_n": 0
+ },
+ {
+ "ok": true,
+ "ttft_s": 13.337792158126831,
+ "wall_s": 16.870493173599243,
+ "gen_n": 199,
+ "prompt_s": 1810.7,
+ "gen_s": 43.5,
+ "prompt_n": 4240
+ },
+ {
+ "ok": true,
+ "ttft_s": 2.3524343967437744,
+ "wall_s": 8.460663318634033,
+ "gen_n": 195,
+ "prompt_s": null,
+ "gen_s": 69.9,
+ "prompt_n": 0
+ }
+ ],
+ "errors": []
+ },
+ {
+ "n": 4,
+ "wall_all_s": 17.216044902801514,
+ "clients": [
+ {
+ "ok": true,
+ "ttft_s": 13.65457558631897,
+ "wall_s": 17.215766191482544,
+ "gen_n": 210,
+ "prompt_s": null,
+ "gen_s": 72.1,
+ "prompt_n": 0
+ },
+ {
+ "ok": true,
+ "ttft_s": 4.892782211303711,
+ "wall_s": 11.32339096069336,
+ "gen_n": 229,
+ "prompt_s": 1767.3,
+ "gen_s": 79.4,
+ "prompt_n": 4123
+ },
+ {
+ "ok": true,
+ "ttft_s": 10.556453704833984,
+ "wall_s": 16.769415378570557,
+ "gen_n": 218,
+ "prompt_s": 1799.3,
+ "gen_s": 78.7,
+ "prompt_n": 4228
+ },
+ {
+ "ok": true,
+ "ttft_s": 2.4095449447631836,
+ "wall_s": 8.180700778961182,
+ "gen_n": 195,
+ "prompt_s": null,
+ "gen_s": 78.1,
+ "prompt_n": 0
+ }
+ ],
+ "errors": []
+ }
+ ],
+ "summary": [
+ {
+ "n": 4,
+ "clients_ok": 4,
+ "errors": [],
+ "prompt_n": 2073.5,
+ "wall_all_s": 17.66,
+ "gen_per_client": 197.0,
+ "gen_total": 842,
+ "ttft_med_s": 7.88,
+ "ttft_max_s": 13.34,
+ "decode_client_med": 45.8,
+ "throughput_total": 47.7
+ },
+ {
+ "n": 4,
+ "clients_ok": 4,
+ "errors": [],
+ "prompt_n": 2061.5,
+ "wall_all_s": 17.22,
+ "gen_per_client": 214.0,
+ "gen_total": 852,
+ "ttft_med_s": 7.72,
+ "ttft_max_s": 13.65,
+ "decode_client_med": 35.3,
+ "throughput_total": 49.5
+ }
+ ]
+ }
+ ],
+ "ts": "2026-10-06T12:15:55.589714"
+}
\ No newline at end of file
diff --git a/bench/results/2026-10-06-community-rtx4090-opt-ins/runs-parallel-off.json b/bench/results/2026-10-06-community-rtx4090-opt-ins/runs-parallel-off.json
new file mode 100644
index 000000000..14c4cdbbf
--- /dev/null
+++ b/bench/results/2026-10-06-community-rtx4090-opt-ins/runs-parallel-off.json
@@ -0,0 +1,381 @@
+{
+ "label": "A-baseline-fixed-0140",
+ "engine": "Strata 0.1.40",
+ "batch_slots": 1,
+ "cmdline": "/home/dgbox/Strata/engine/strata --serve --pack /home/dgbox/Strata-data/packs/iq3_xxs --native /home/dgbox/Strata-data/models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf --ple-gguf /home/dgbox/Strata-data/models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf --expert-profile /home/dgbox/Strata/data/expert-profile-learned.bin --expert-cache auto --prefill auto --spec 4 --mtp /home/dgbox/Strata-data/mtp/rt --max-context 204800 --kv int8 --mmap-experts --vision --vram-reserve-mib 989 --control-vector-scaled /home/dgbox/Strata/data/experimental-speed-projection/Qwen3.8-Flash-Next-experimental-speed-projection.gguf:1.0 --control-vector-layer-range 4 44 --cvec-mode project --cvec-dir per-layer --pcie-frac 0.00 --spec-min-p 0.50 --pool-workers 10 --expert-profile-save /home/dgbox/Strata/data/expert-profile-learned.bin --expert-profile-save-every 10",
+ "config": "/home/dgbox/Strata/strata-200k.json",
+ "prompt_tokens": 4000,
+ "max_tokens": 256,
+ "repeats": 2,
+ "levels": [
+ {
+ "n": 1,
+ "runs": [
+ {
+ "n": 1,
+ "wall_all_s": 5.2273523807525635,
+ "clients": [
+ {
+ "ok": true,
+ "ttft_s": 2.9870028495788574,
+ "wall_s": 5.227063894271851,
+ "gen_n": 208,
+ "prompt_s": 1451.3,
+ "gen_s": 92.4,
+ "prompt_n": 4288
+ }
+ ],
+ "errors": []
+ },
+ {
+ "n": 1,
+ "wall_all_s": 4.6653523445129395,
+ "clients": [
+ {
+ "ok": true,
+ "ttft_s": 2.2530055046081543,
+ "wall_s": 4.665045976638794,
+ "gen_n": 230,
+ "prompt_s": 1827.1,
+ "gen_s": 94.9,
+ "prompt_n": 4057
+ }
+ ],
+ "errors": []
+ }
+ ],
+ "summary": [
+ {
+ "n": 1,
+ "clients_ok": 1,
+ "errors": [],
+ "prompt_n": 4288,
+ "wall_all_s": 5.23,
+ "gen_per_client": 208,
+ "gen_total": 208,
+ "ttft_med_s": 2.99,
+ "ttft_max_s": 2.99,
+ "decode_client_med": 92.9,
+ "throughput_total": 39.8
+ },
+ {
+ "n": 1,
+ "clients_ok": 1,
+ "errors": [],
+ "prompt_n": 4057,
+ "wall_all_s": 4.67,
+ "gen_per_client": 230,
+ "gen_total": 230,
+ "ttft_med_s": 2.25,
+ "ttft_max_s": 2.25,
+ "decode_client_med": 95.4,
+ "throughput_total": 49.3
+ }
+ ]
+ },
+ {
+ "n": 2,
+ "runs": [
+ {
+ "n": 2,
+ "wall_all_s": 8.20203423500061,
+ "clients": [
+ {
+ "ok": true,
+ "ttft_s": 6.279987096786499,
+ "wall_s": 8.201735973358154,
+ "gen_n": 184,
+ "prompt_s": 2033.3,
+ "gen_s": 95.2,
+ "prompt_n": 4189
+ },
+ {
+ "ok": true,
+ "ttft_s": 2.101135730743408,
+ "wall_s": 4.206447124481201,
+ "gen_n": 195,
+ "prompt_s": 1961.6,
+ "gen_s": 92.1,
+ "prompt_n": 4051
+ }
+ ],
+ "errors": []
+ },
+ {
+ "n": 2,
+ "wall_all_s": 8.558028221130371,
+ "clients": [
+ {
+ "ok": true,
+ "ttft_s": 6.5781471729278564,
+ "wall_s": 8.55778980255127,
+ "gen_n": 192,
+ "prompt_s": 2012.7,
+ "gen_s": 96.7,
+ "prompt_n": 4087
+ },
+ {
+ "ok": true,
+ "ttft_s": 2.0630788803100586,
+ "wall_s": 4.534289360046387,
+ "gen_n": 256,
+ "prompt_s": 2015.1,
+ "gen_s": 103.1,
+ "prompt_n": 4075
+ }
+ ],
+ "errors": []
+ }
+ ],
+ "summary": [
+ {
+ "n": 2,
+ "clients_ok": 2,
+ "errors": [],
+ "prompt_n": 4120.0,
+ "wall_all_s": 8.2,
+ "gen_per_client": 189.5,
+ "gen_total": 379,
+ "ttft_med_s": 4.19,
+ "ttft_max_s": 6.28,
+ "decode_client_med": 94.2,
+ "throughput_total": 46.2
+ },
+ {
+ "n": 2,
+ "clients_ok": 2,
+ "errors": [],
+ "prompt_n": 4081.0,
+ "wall_all_s": 8.56,
+ "gen_per_client": 224.0,
+ "gen_total": 448,
+ "ttft_med_s": 4.32,
+ "ttft_max_s": 6.58,
+ "decode_client_med": 100.3,
+ "throughput_total": 52.3
+ }
+ ]
+ },
+ {
+ "n": 3,
+ "runs": [
+ {
+ "n": 3,
+ "wall_all_s": 53.848620653152466,
+ "clients": [
+ {
+ "ok": true,
+ "ttft_s": 47.90813708305359,
+ "wall_s": 49.84662938117981,
+ "gen_n": 198,
+ "prompt_s": 2036.6,
+ "gen_s": 101.5,
+ "prompt_n": 4225
+ },
+ {
+ "ok": true,
+ "ttft_s": 51.87564134597778,
+ "wall_s": 53.84785556793213,
+ "gen_n": 195,
+ "prompt_s": 2092.3,
+ "gen_s": 98.5,
+ "prompt_n": 4219
+ },
+ {
+ "ok": true,
+ "ttft_s": 42.881744146347046,
+ "wall_s": 45.81938982009888,
+ "gen_n": 256,
+ "prompt_s": 1524.5,
+ "gen_s": 86.7,
+ "prompt_n": 4105
+ }
+ ],
+ "errors": []
+ },
+ {
+ "n": 3,
+ "wall_all_s": 58.89862561225891,
+ "clients": [
+ {
+ "ok": true,
+ "ttft_s": 52.26561236381531,
+ "wall_s": 54.33264923095703,
+ "gen_n": 198,
+ "prompt_s": 2073.3,
+ "gen_s": 95.2,
+ "prompt_n": 4303
+ },
+ {
+ "ok": true,
+ "ttft_s": 46.98654270172119,
+ "wall_s": 50.17653465270996,
+ "gen_n": 256,
+ "prompt_s": 1758.7,
+ "gen_s": 79.8,
+ "prompt_n": 4132
+ },
+ {
+ "ok": true,
+ "ttft_s": 56.38709259033203,
+ "wall_s": 58.89751434326172,
+ "gen_n": 256,
+ "prompt_s": 1995.5,
+ "gen_s": 101.5,
+ "prompt_n": 4075
+ }
+ ],
+ "errors": []
+ }
+ ],
+ "summary": [
+ {
+ "n": 3,
+ "clients_ok": 3,
+ "errors": [],
+ "prompt_n": 4219,
+ "wall_all_s": 53.85,
+ "gen_per_client": 198,
+ "gen_total": 649,
+ "ttft_med_s": 47.91,
+ "ttft_max_s": 51.88,
+ "decode_client_med": 98.9,
+ "throughput_total": 12.1
+ },
+ {
+ "n": 3,
+ "clients_ok": 3,
+ "errors": [],
+ "prompt_n": 4132,
+ "wall_all_s": 58.9,
+ "gen_per_client": 256,
+ "gen_total": 710,
+ "ttft_med_s": 52.27,
+ "ttft_max_s": 56.39,
+ "decode_client_med": 95.8,
+ "throughput_total": 12.1
+ }
+ ]
+ },
+ {
+ "n": 4,
+ "runs": [
+ {
+ "n": 4,
+ "wall_all_s": 50.69314694404602,
+ "clients": [
+ {
+ "ok": true,
+ "ttft_s": 35.088313817977905,
+ "wall_s": 37.8774790763855,
+ "gen_n": 256,
+ "prompt_s": 1930.7,
+ "gen_s": 91.4,
+ "prompt_n": 4180
+ },
+ {
+ "ok": true,
+ "ttft_s": 43.941487550735474,
+ "wall_s": 46.48747110366821,
+ "gen_n": 256,
+ "prompt_s": 2076.5,
+ "gen_s": 100.1,
+ "prompt_n": 4198
+ },
+ {
+ "ok": true,
+ "ttft_s": 48.51712465286255,
+ "wall_s": 50.6920280456543,
+ "gen_n": 205,
+ "prompt_s": 2071.8,
+ "gen_s": 93.9,
+ "prompt_n": 4177
+ },
+ {
+ "ok": true,
+ "ttft_s": 39.87700581550598,
+ "wall_s": 41.90513253211975,
+ "gen_n": 195,
+ "prompt_s": 2052.5,
+ "gen_s": 95.5,
+ "prompt_n": 4078
+ }
+ ],
+ "errors": []
+ },
+ {
+ "n": 4,
+ "wall_all_s": 53.4599404335022,
+ "clients": [
+ {
+ "ok": true,
+ "ttft_s": 42.57567048072815,
+ "wall_s": 44.62274169921875,
+ "gen_n": 203,
+ "prompt_s": 2067.6,
+ "gen_s": 98.6,
+ "prompt_n": 4156
+ },
+ {
+ "ok": true,
+ "ttft_s": 46.6426796913147,
+ "wall_s": 48.8258056640625,
+ "gen_n": 209,
+ "prompt_s": 2086.0,
+ "gen_s": 95.2,
+ "prompt_n": 4185
+ },
+ {
+ "ok": true,
+ "ttft_s": 38.212047815322876,
+ "wall_s": 40.55199360847473,
+ "gen_n": 195,
+ "prompt_s": 1939.5,
+ "gen_s": 82.9,
+ "prompt_n": 4063
+ },
+ {
+ "ok": true,
+ "ttft_s": 50.848939657211304,
+ "wall_s": 53.45898509025574,
+ "gen_n": 256,
+ "prompt_s": 2094.2,
+ "gen_s": 97.8,
+ "prompt_n": 4210
+ }
+ ],
+ "errors": []
+ }
+ ],
+ "summary": [
+ {
+ "n": 4,
+ "clients_ok": 4,
+ "errors": [],
+ "prompt_n": 4178.5,
+ "wall_all_s": 50.69,
+ "gen_per_client": 230.5,
+ "gen_total": 912,
+ "ttft_med_s": 41.91,
+ "ttft_max_s": 48.52,
+ "decode_client_med": 95.2,
+ "throughput_total": 18.0
+ },
+ {
+ "n": 4,
+ "clients_ok": 4,
+ "errors": [],
+ "prompt_n": 4170.5,
+ "wall_all_s": 53.46,
+ "gen_per_client": 206.0,
+ "gen_total": 863,
+ "ttft_med_s": 44.61,
+ "ttft_max_s": 50.85,
+ "decode_client_med": 96.9,
+ "throughput_total": 16.1
+ }
+ ]
+ }
+ ],
+ "ts": "2026-10-06T12:19:28.172793"
+}
\ No newline at end of file
diff --git a/bench/results/2026-10-06-community-rtx4090-toolcall-hotfix/README.md b/bench/results/2026-10-06-community-rtx4090-toolcall-hotfix/README.md
new file mode 100644
index 000000000..ab82cb6d1
--- /dev/null
+++ b/bench/results/2026-10-06-community-rtx4090-toolcall-hotfix/README.md
@@ -0,0 +1,108 @@
+# What 0.1.40.1 does with a `<tool_call>` the model writes, and with requests waiting for a dead engine
+
+Measured on 2026-10-06 by [Dmitry-B](https://github.com/Dmitry-B), on the machine described in
+[2026-10-03-community-rtx4090-iq3xxs-200k](../2026-10-03-community-rtx4090-iq3xxs-200k/README.md)
+(RTX 4090, `qwen3.8-flash-next-iq3_xxs`, context 204800). Results-only report about the two fixes of the hotfix
+release v0.1.40.1 (`82f46a8`): the rules for a `<tool_call>` written by the model (#804, #1058) and requests waiting
+during an engine restart (#1012). The engine binary is the one built for 0.1.40 and is byte-identical to it
+(`196504f2822cbf15fb49b873e0000f41`); only the Python server changed.
+
+## What was run
+
+| File | What it is |
+| --- | --- |
+| `probe_parser_corpus.py`, `corpus_results.json` | the author's own corpus `serve/fixtures/rcall_specimens.json` replayed through the same parser the server uses |
+| `probe_toolcall.py`, `results.json` | live chat requests with a declared tool, to see what the API returns end to end |
+| `probe_restart_waiters.py`, `results_restart.json` | three requests waiting for the engine, the engine killed while reading a prompt |
+
+## 1. The corpus of quoted and stranded calls, replayed
+
+`serve/fixtures/rcall_specimens.json` holds 37 specimens: 16 must become tool calls, 21 must stay text. Each was
+fed to `serve.frontend.OutputParser` — the class the server itself uses — at six feed widths (1, 2, 3, 7, random
+1-9 characters, and the whole text at once) and with `stream_tools` on and off: the same matrix as
+`serve/test_reasoning_rescue.py`, but recorded per specimen instead of pass/fail.
+
+```
+образцов 37, должны дать вызов: 16, должны остаться текстом: 21, провалились: 0
+```
+
+37/37, 444 parser runs, no mismatch, and for every specimen the streamed result equals the whole-text result.
+Per-specimen detail: [corpus_results.json](corpus_results.json).
+
+## 2. Live requests with a tool declared
+
+`get_weather` was declared in `tools`; each prompt either shows a call as an example (in a code fence or inline
+code) or asks for a real call. `reasoning_effort` is stated per case, because the rules are about where the text
+sits — in the thinking or in the visible answer. `totals.tool_calls_from_reasoning` was read before and after the
+whole set.
+
+| Case | Expected | Returned | Where the call text stayed | Verdict |
+| --- | --- | --- | --- | --- |
+| `1-fenced-example-in-answer` (thinking on) | no call | 1 call | `reasoning_content` | not conclusive — see below |
+| `2-inline-code-in-answer` (thinking off) | no call | 1 call | nowhere (the model emitted a top-level call) | not conclusive |
+| `3-fenced-example-in-thinking` (thinking high) | no call | 0 | `content`, `reasoning_content` | matches |
+| `4-turn-cut-by-max-tokens` (`max_tokens=60`, thinking high) | no call | 0 | `reasoning_content` | matches |
+| `5-real-call-top-level-after-sentence` (thinking off) | call | 1 call | — | matches |
+| `6-plain-real-call` | call | 1 call | — | matches |
+| `7-streaming-split-fence` (stream, fence split across chunks) | no call | 0 | `content`, `reasoning_content` | matches |
+| `8-fenced-example-in-answer-no-thinking` | no call | 0 | `content` | matches |
+
+`totals.tool_calls_from_reasoning` stayed **0 → 0** across the whole set: none of these prompts made the model
+strand a call in its thinking, so the rescue path never had anything to rescue. The calls in cases 1, 2, 5 and 6
+came through the ordinary path.
+
+That is also why cases 1 and 2 are recorded as inconclusive rather than as failures. In case 1 the model put the
+example inside a fenced block in its reasoning (the text is still there in `reasoning_content`) and produced a
+separate top-level call; in case 2, with thinking off, it answered with a top-level call instead of copying the
+inline code. Both are model behaviour, not the rule being broken — the rule was applied to what the model actually
+wrote, and the counter shows no rescue was performed. Raw text of every answer: [results.json](results.json).
+
+What is shown end to end: a `<tool_call>` inside a code fence in the visible answer stays text, including when the
+answer streams and the fence is split across chunks (cases 7, 8), a call written in the thinking of a turn cut by
+`max_tokens` stays text (case 4), and ordinary calls keep working (cases 5, 6).
+
+## 3. Requests waiting for an engine that dies (#1012)
+
+Three requests with ~60 000-token prompts were started together; 15 s later `pkill` killed the engine process
+(two pids, `39647` and `39659`).
+
+| Request | HTTP | First streamed delta | Request ended | Deltas |
+| --- | --- | --- | --- | --- |
+| `waiter-1` | 200 | none | 16.6 s after start | 0 |
+| `waiter-2` | 200 | 40.4 s | 40.5 s after start | 3 |
+| `waiter-3` | 200 | 40.3 s | 40.4 s after start | 3 |
+
+The server started a new engine 25.5 s after the kill and `/health` reported `loaded: true` at the same point.
+Two waiters continued with the new engine and finished at ~40 s; the one whose stream had already been opened was
+closed at 16.6 s with no content. Nothing hung: no request waited 300 s, and no `list.remove(x): x not in list`
+appeared. For comparison, this is the case that on 0.1.40 ended about 300 s later with 1 and 5 tokens — see
+[2026-10-06-community-rtx4090-opt-ins](../2026-10-06-community-rtx4090-opt-ins/README.md).
+
+Server-side detail, including the engine command line it restarted with: [results_restart.json](results_restart.json).
+
+## Unit tests on this machine, for the same commit
+
+```
+tools.test_setup_golden tools.test_setup_amd tools.test_setup_choices tools.test_setup_config
+tools.test_setup_hotfix_tag -> 87 tests, OK
+serve.test_responses serve.test_security serve.test_server serve.test_slots serve.test_runconfig
+serve.test_mcp serve.test_monitor serve.test_frontend serve.test_structured serve.test_detok
+serve.test_reasoning_tools serve.test_reasoning_loop_recovery serve.test_reasoning_rescue
+serve.test_restart_waiters serve.test_parallel serve.test_vram -> 430 tests, OK (skipped=5)
+serve.test_control_cancel serve.test_fatal_recovery -> 10 tests, OK
+```
+
+527 tests, 0 failures. On 0.1.40 the same set was 492; the difference is the two new modules of this release.
+
+## Limitations
+
+- The corpus replay exercises the parser, not the HTTP layer. The end-to-end part (section 2) did not produce a
+ real stranded call on this model, so the rescue path was not observed through the API — only the "must stay text"
+ half of the rules was.
+- The three waiters sent identical filler text, so the engine reused the prefix cache (the log shows
+ `prompt 141045 tokens = 140329 reused + 716 read`). That is fine for a hang test and wrong for a speed test;
+ no throughput conclusion is drawn from it.
+- `waiter-1` ended with HTTP 200 and no content rather than the 503 the release notes describe: its stream had
+ already been opened, so the server could not answer 503 any more. Reported as measured.
+- One machine, one model, one engine restart. Cancellation mid-turn and the batch-window `ERR` reporting were not
+ tested.
diff --git a/bench/results/2026-10-06-community-rtx4090-toolcall-hotfix/corpus_results.json b/bench/results/2026-10-06-community-rtx4090-toolcall-hotfix/corpus_results.json
new file mode 100644
index 000000000..3b4d15f46
--- /dev/null
+++ b/bench/results/2026-10-06-community-rtx4090-toolcall-hotfix/corpus_results.json
@@ -0,0 +1,351 @@
+{
+ "corpus": "serve/fixtures/rcall_specimens.json",
+ "n_specimens": 37,
+ "widths": [
+ 1,
+ 2,
+ 3,
+ 7,
+ 0,
+ 100000
+ ],
+ "cases": [
+ {
+ "name": "act-natural-stop",
+ "expect_calls": [
+ "execute_code"
+ ],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "act-first-text",
+ "expect_calls": [
+ "execute_code"
+ ],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "act-two-adjacent",
+ "expect_calls": [
+ "execute_code",
+ "execute_code"
+ ],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "envelope-undeclared",
+ "expect_calls": [],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "envelope-declared",
+ "expect_calls": [
+ "tool_call"
+ ],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "mention-backticks-midsentence",
+ "expect_calls": [],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "mention-midsentence-whole-call",
+ "expect_calls": [],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "mention-backticks-line-start",
+ "expect_calls": [],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "mention-line-start-no-function",
+ "expect_calls": [],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "mention-line-start-other-tag",
+ "expect_calls": [],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "mention-indented",
+ "expect_calls": [],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "mention-markdown-quote",
+ "expect_calls": [],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "mention-backtick-block",
+ "expect_calls": [],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "mention-tilde-block",
+ "expect_calls": [],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "mention-tag-before-think-end",
+ "expect_calls": [],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "mention-closed-span-fenced",
+ "expect_calls": [],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "mention-unclosed-disclaimed",
+ "expect_calls": [],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "cut-max-tokens",
+ "expect_calls": [],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "mention-midsentence-declared",
+ "expect_calls": [],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "mention-trailing-prose",
+ "expect_calls": [],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "mention-prose-between-calls",
+ "expect_calls": [],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "mention-empty-span",
+ "expect_calls": [],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "known-miss-bare-function-opener",
+ "expect_calls": [],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "normal-call-after-think-end",
+ "expect_calls": [
+ "execute_code"
+ ],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "mixed-declared-and-envelope",
+ "expect_calls": [
+ "execute_code"
+ ],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "live-01-declared",
+ "expect_calls": [
+ "terminal"
+ ],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "live-02-declared",
+ "expect_calls": [],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "live-03-envelope",
+ "expect_calls": [],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "live-04-declared",
+ "expect_calls": [
+ "terminal",
+ "web_extract"
+ ],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "live-05-declared",
+ "expect_calls": [
+ "terminal"
+ ],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "live-06-envelope",
+ "expect_calls": [
+ "todo_list"
+ ],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "live-07-declared",
+ "expect_calls": [
+ "search_files"
+ ],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "live-08-declared",
+ "expect_calls": [
+ "terminal"
+ ],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "live-09-declared",
+ "expect_calls": [
+ "execute_code"
+ ],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "live-10-declared",
+ "expect_calls": [
+ "terminal"
+ ],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "live-11-declared",
+ "expect_calls": [
+ "terminal",
+ "terminal"
+ ],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ },
+ {
+ "name": "live-12-declared",
+ "expect_calls": [
+ "web_extract"
+ ],
+ "runs": 12,
+ "mismatches": [],
+ "streamed_matches_whole": true,
+ "pass": true
+ }
+ ],
+ "totals": {
+ "specimens": 37,
+ "expected_to_act": 16,
+ "expected_to_stay_text": 21,
+ "failed": 0
+ }
+}
\ No newline at end of file
diff --git a/bench/results/2026-10-06-community-rtx4090-toolcall-hotfix/probe_parser_corpus.py b/bench/results/2026-10-06-community-rtx4090-toolcall-hotfix/probe_parser_corpus.py
new file mode 100644
index 000000000..b21ec54c7
--- /dev/null
+++ b/bench/results/2026-10-06-community-rtx4090-toolcall-hotfix/probe_parser_corpus.py
@@ -0,0 +1,78 @@
+#!/usr/bin/env python3
+"""Повтор корпуса `serve/fixtures/rcall_specimens.json` на этой машине (0.1.40.1, #804 / #1058).
+
+Корпус автора: 37 образцов — 16 должны дать вызов инструмента, 21 должны остаться текстом.
+Прогоняем каждый образец через тот же `serve.frontend.OutputParser`, что использует сервер,
+шестью ширинами подачи (1, 2, 3, 7, случайная 1-9, целиком) и при двух режимах
+`stream_tools` — ровно как в `serve/test_reasoning_rescue.py`, но с результатом по каждому
+образцу в JSON, а не «зелёно/красно».
+
+usage: probe_parser_corpus.py [--out corpus_results.json]
+"""
+import json
+import pathlib
+import random
+import sys
+
+ROOT = pathlib.Path("/home/dgbox/Strata")
+sys.path.insert(0, str(ROOT))
+from serve.frontend import OutputParser # noqa: E402
+
+SPECIMENS = json.loads((ROOT / "serve/fixtures/rcall_specimens.json").read_text(encoding="utf-8"))["specimens"]
+WIDTHS = (1, 2, 3, 7, 0, 100_000)
+
+
+def parse(text, width, tools, finish, stream_tools):
+ p = OutputParser(thinking=True, tools=tools, stream_tools=stream_tools)
+ evs, rnd, i = [], random.Random(7), 0
+ while i < len(text):
+ k = width or rnd.randint(1, 9)
+ evs += p.feed(text[i:i + k])
+ i += k
+ return evs + p.finish(finish)
+
+
+def calls(evs):
+ return [e.call.name for e in evs if e.kind == "tool_call"]
+
+
+def reasoning(evs):
+ return "".join(e.text for e in evs if e.kind == "reasoning")
+
+
+def main():
+ out = {"corpus": "serve/fixtures/rcall_specimens.json", "n_specimens": len(SPECIMENS),
+ "widths": list(WIDTHS), "cases": []}
+ bad = 0
+ for sp in SPECIMENS:
+ tools = [{"name": n, "parameters": {"properties": {}}} for n in sp["tools"]]
+ seen, fails = set(), []
+ for width in WIDTHS:
+ for st in (True, False):
+ evs = parse(sp["input"], width, tools, sp["finish"], st)
+ got, want = calls(evs), sp["calls"]
+ if got != want:
+ fails.append({"width": width, "stream_tools": st, "got": got, "want": want})
+ seen.add((reasoning(evs), tuple(got)))
+ ok = not fails and len(seen) == 1
+ bad += 0 if ok else 1
+ out["cases"].append({"name": sp["name"], "expect_calls": sp["calls"],
+ "runs": len(WIDTHS) * 2, "mismatches": fails,
+ "streamed_matches_whole": len(seen) == 1, "pass": ok})
+ out["totals"] = {"specimens": len(SPECIMENS),
+ "expected_to_act": sum(bool(s["calls"]) for s in SPECIMENS),
+ "expected_to_stay_text": sum(not s["calls"] for s in SPECIMENS),
+ "failed": bad}
+ path = pathlib.Path(sys.argv[sys.argv.index("--out") + 1]) if "--out" in sys.argv \
+ else pathlib.Path(__file__).parent / "corpus_results.json"
+ path.write_text(json.dumps(out, ensure_ascii=False, indent=1), encoding="utf-8")
+ print(f"образцов {len(SPECIMENS)}, должны дать вызов: {out['totals']['expected_to_act']}, "
+ f"должны остаться текстом: {out['totals']['expected_to_stay_text']}, провалились: {bad}")
+ for c in out["cases"]:
+ if not c["pass"]:
+ print("ПРОВАЛ:", c["name"], c["mismatches"][:2])
+ print("записано:", path)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/bench/results/2026-10-06-community-rtx4090-toolcall-hotfix/probe_restart_waiters.py b/bench/results/2026-10-06-community-rtx4090-toolcall-hotfix/probe_restart_waiters.py
new file mode 100644
index 000000000..91b814a2f
--- /dev/null
+++ b/bench/results/2026-10-06-community-rtx4090-toolcall-hotfix/probe_restart_waiters.py
@@ -0,0 +1,125 @@
+#!/usr/bin/env python3
+"""#1012 на живом сервере: запрос ждёт движок, движок умирает во время чтения промпта.
+
+Что проверяем (из релиза v0.1.40.1): раньше запрос, дожидавшийся перезапуска мёртвого движка,
+висел навсегда или падал с `list.remove(x)`, а длинный промпт, который читался в момент смерти
+движка, завершался через ~300 с. Теперь тот же запрос либо продолжается с новым движком, либо
+заканчивается сразу с 503 («не отправлен» -> клиент может повторить).
+
+Ход: отправить длинный запрос -> через N секунд убить процесс движка -> смотреть, чем и когда
+закончится запрос. Сервер поднимает движок сам.
+
+usage: probe_restart_waiters.py [--kill-after 15] [--out results_restart.json]
+"""
+import json
+import pathlib
+import subprocess
+import threading
+import time
+import urllib.error
+import urllib.request
+
+REPO = "/home/dgbox/Strata"
+CFG = REPO + "/strata-200k.json"
+BASE = "http://127.0.0.1:8080"
+cfg = json.load(open(CFG, encoding="utf-8"))
+KEY, MODEL = cfg["api_key"], cfg.get("model_name", "strata")
+
+FILLER = ("Разбирается модуль разбора конфигурации: он читает список секций, проверяет обязательные поля и "
+ "собирает структуру настроек, которую дальше использует планировщик. Сбой на одной секции не должен "
+ "останавливать остальные, поэтому парсер собирает список замечаний. ")
+
+
+def big_prompt(tokens: int) -> str:
+ # ~0.28 токена на символ для русского текста
+ return (FILLER * (int(tokens / 0.28 / len(FILLER)) + 1))[:int(tokens / 0.28)]
+
+
+def send(rec, label, tokens):
+ payload = json.dumps({"model": MODEL, "messages": [{"role": "user",
+ "content": big_prompt(tokens) + "\n\nОтветь одним словом."}],
+ "max_tokens": 32, "stream": True, "reasoning_effort": "none"}).encode()
+ req = urllib.request.Request(BASE + "/v1/chat/completions", data=payload,
+ headers={"Content-Type": "application/json",
+ "Authorization": f"Bearer {KEY}"})
+ t0 = time.time()
+ out = {"label": label, "prompt_tokens_asked": tokens, "started_at": round(t0, 3),
+ "first_delta_s": None, "end_s": None, "http_status": None, "outcome": None,
+ "deltas": 0}
+ try:
+ with urllib.request.urlopen(req, timeout=600) as r:
+ out["http_status"] = r.status
+ for line in r:
+ s = line.decode(errors="replace").strip()
+ if not s.startswith("data:"):
+ continue
+ data = s[5:].strip()
+ if data == "[DONE]":
+ break
+ try:
+ obj = json.loads(data)
+ except json.JSONDecodeError:
+ continue
+ for ch in obj.get("choices", []):
+ if (ch.get("delta") or {}).get("content"):
+ out["deltas"] += 1
+ if out["first_delta_s"] is None:
+ out["first_delta_s"] = round(time.time() - t0, 2)
+ out["outcome"] = "done"
+ except urllib.error.HTTPError as e:
+ out["outcome"] = f"HTTPError {e.code}"
+ out["http_status"] = e.code
+ try:
+ out["error_body"] = e.read().decode()[:300]
+ except Exception: # noqa: BLE001
+ pass
+ except Exception as e: # noqa: BLE001
+ out["outcome"] = repr(e)[:200]
+ out["end_s"] = round(time.time() - t0, 2)
+ print(f"[{label}] status={out['http_status']} outcome={out['outcome']} "
+ f"first_delta={out['first_delta_s']} end={out['end_s']} deltas={out['deltas']}")
+ rec.append(out)
+
+
+def main():
+ import argparse
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--kill-after", type=float, default=15.0)
+ ap.add_argument("--out", default=str(pathlib.Path(__file__).parent / "results_restart.json"))
+ a = ap.parse_args()
+
+ before = subprocess.run(["pgrep", "-f", REPO + "/engine/strata"], capture_output=True, text=True).stdout.split()
+ recs = []
+ threads = [threading.Thread(target=send, args=(recs, f"waiter-{i}", 60000)) for i in range(1, 4)]
+ for t in threads:
+ t.start()
+ time.sleep(a.kill_after)
+ killed = subprocess.run(["pkill", "-f", REPO + "/engine/strata"], capture_output=True, text=True)
+ kill_at = round(time.time(), 3)
+ print(f"движок убит через {a.kill_after} с: pkill rc={killed.returncode} (pid до: {before})")
+ for t in threads:
+ t.join(timeout=420)
+
+ health = None
+ for _ in range(80):
+ try:
+ with urllib.request.urlopen(urllib.request.Request(BASE + "/health"), timeout=5) as r:
+ h = json.loads(r.read().decode())
+ if h.get("loaded"):
+ health = {"recovered_after_kill_s": round(time.time() - kill_at, 1), "health": h}
+ break
+ except Exception: # noqa: BLE001
+ pass
+ time.sleep(3)
+
+ out = {"kill_after_s": a.kill_after, "engine_pids_before": before, "killed_at": kill_at,
+ "requests": recs, "server_recovered": health,
+ "log_tail": subprocess.run(["bash", "-c",
+ f"tail -n 200 {REPO}/strata-200k.log | grep -iE 'engine|restart|503|died|wait' | tail -15"],
+ capture_output=True, text=True).stdout}
+ pathlib.Path(a.out).write_text(json.dumps(out, ensure_ascii=False, indent=1), encoding="utf-8")
+ print("записано:", a.out)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/bench/results/2026-10-06-community-rtx4090-toolcall-hotfix/probe_toolcall.py b/bench/results/2026-10-06-community-rtx4090-toolcall-hotfix/probe_toolcall.py
new file mode 100644
index 000000000..a4dc1ebc3
--- /dev/null
+++ b/bench/results/2026-10-06-community-rtx4090-toolcall-hotfix/probe_toolcall.py
@@ -0,0 +1,221 @@
+#!/usr/bin/env python3
+"""Проба правил 0.1.40.1 про `<tool_call>`, написанный моделью.
+
+Правила из релиза v0.1.40.1 (#804, #1058):
+ - вызов в размышлении становится вызовом только если инструменты объявлены и имя среди них;
+ - он начинается с начала строки, вне код-фенса (``` или ~~~) и вне inline-кода;
+ - закрытый `</think>` присутствует, и после него до конца хода или `</think>` только пробелы или другие вызовы;
+ - ход завершился нормально (оборванный по max_tokens, отменённый или ошибочный оставляет текст в размышлении);
+ - `<tool_call>` внутри код-фенса или inline-кода в ВИДИМОМ ответе — текст, никогда не вызов.
+
+Скрипт прогоняет кейсы на живом сервере и пишет, что произошло: был ли реальный tool_calls,
+остался ли текст вызова в content / reasoning_content, и что показал счётчик
+/metrics totals.tool_calls_from_reasoning.
+
+usage: probe_toolcall.py [--out results.json]
+"""
+import argparse
+import json
+import pathlib
+import re
+import subprocess
+import time
+import urllib.request
+
+REPO = "/home/dgbox/Strata"
+CFG = REPO + "/strata-200k.json"
+BASE = "http://127.0.0.1:8080"
+
+cfg = json.load(open(CFG, encoding="utf-8"))
+KEY = cfg["api_key"]
+MODEL = cfg.get("model_name", "strata")
+
+TOOLS = [{
+ "type": "function",
+ "function": {
+ "name": "get_weather",
+ "description": "Погода в городе.",
+ "parameters": {"type": "object", "properties": {"city": {"type": "string"}},
+ "required": ["city"]},
+ },
+}]
+CALL = '{"name": "get_weather", "arguments": {"city": "\u041c\u043e\u0441\u043a\u0432\u0430"}}'
+
+
+def post(payload, stream=False):
+ body = json.dumps(payload).encode()
+ req = urllib.request.Request(BASE + "/v1/chat/completions", data=body,
+ headers={"Content-Type": "application/json",
+ "Authorization": f"Bearer {KEY}"})
+ with urllib.request.urlopen(req, timeout=300) as r:
+ raw = r.read().decode()
+ if not stream:
+ return json.loads(raw)
+ # стриминг: собираем дельты и финальный chunk с tool_calls
+ content, reasoning, tool_calls, finish = [], [], [], None
+ for line in raw.splitlines():
+ line = line.strip()
+ if not line.startswith("data:"):
+ continue
+ data = line[5:].strip()
+ if data == "[DONE]":
+ break
+ try:
+ obj = json.loads(data)
+ except json.JSONDecodeError:
+ continue
+ for ch in obj.get("choices", []):
+ d = ch.get("delta") or {}
+ if d.get("content"):
+ content.append(d["content"])
+ if d.get("reasoning_content"):
+ reasoning.append(d["reasoning_content"])
+ if ch.get("finish_reason"):
+ finish = ch["finish_reason"]
+ if d.get("tool_calls"):
+ tool_calls.extend(d["tool_calls"])
+ return {"choices": [{"message": {"content": "".join(content),
+ "reasoning_content": "".join(reasoning),
+ "tool_calls": tool_calls},
+ "finish_reason": finish}], "streamed": True}
+
+
+def metrics():
+ req = urllib.request.Request(BASE + "/metrics", headers={"Authorization": f"Bearer {KEY}"})
+ with urllib.request.urlopen(req, timeout=20) as r:
+ return json.load(r)
+
+
+def run(case):
+ payload = {"model": MODEL, "messages": [{"role": "user", "content": case["prompt"]}],
+ "tools": TOOLS, "max_tokens": case.get("max_tokens", 700)}
+ if case.get("reasoning") is not None:
+ payload["reasoning_effort"] = case["reasoning"]
+ if case.get("stream"):
+ payload["stream"] = True
+ t0 = time.time()
+ resp = post(payload, stream=bool(case.get("stream")))
+ ch = resp["choices"][0]
+ msg = ch.get("message") or {}
+ content = msg.get("content") or ""
+ reasoning = msg.get("reasoning_content") or ""
+ calls = msg.get("tool_calls") or []
+ where = []
+ if "tool_call" in content:
+ where.append("content")
+ if "tool_call" in reasoning:
+ where.append("reasoning_content")
+ return {
+ "id": case["id"],
+ "expectation": case["expect"],
+ "stream": bool(case.get("stream")),
+ "max_tokens": case.get("max_tokens", 700),
+ "reasoning_effort": case.get("reasoning", "config default"),
+ "wall_s": round(time.time() - t0, 2),
+ "finish_reason": ch.get("finish_reason"),
+ "tool_calls_returned": len(calls),
+ "tool_calls": calls[:2],
+ "tool_call_text_left_in": where,
+ "fence_in_content": bool(re.search(r"```|~~~", content)),
+ "content_len": len(content),
+ "reasoning_len": len(reasoning),
+ "call_text_in_inline_code": bool(re.search(r"`[^`]*tool_call[^`]*`", content + reasoning)),
+ "call_text_in_fence": bool(re.search(r"```[^\x60]*tool_call[^\x60]*```", content + reasoning, re.S)),
+ "content_head": content[:2000],
+ "reasoning_head": reasoning[:2000],
+ }
+
+
+CASES = [
+ {
+ "id": "1-fenced-example-in-answer",
+ "expect": "NO call: the call is only an example inside a code fence",
+ "prompt": "Объясни одной фразой, как выглядит вызов инструмента. Приведи ровно один пример "
+ "в код-блоке:\n\n```\n<tool_call>" + CALL + "\n</tool_call>\n\n"
+ "Сам ничего не вызывай, инструменты не используй.",
+ },
+ {
+ "id": "2-inline-code-in-answer",
+ "expect": "NO call: the call is only inline code in the visible answer (no thinking at all)",
+ "reasoning": "none",
+ "prompt": "Перепиши ровно одну строку, ничего не меняя и ничего не вызывая: "
+ + "`<tool_call>" + CALL + "`",
+ },
+ {
+ "id": "3-fenced-example-in-thinking",
+ "expect": "NO call: inside the thinking the example is fenced",
+ "reasoning": "high",
+ "prompt": "Обдумай ответ шаг за шагом. В размышлении сравни два формата записи вызова: "
+ "обычный `<tool_call>" + CALL + "` и такой же внутри код-блока. Реальный вызов "
+ "инструмента не делай — нужен только разбор.",
+ },
+ {
+ "id": "4-turn-cut-by-max-tokens",
+ "expect": "NO call: the turn is cut by max_tokens, so a call written in the thinking stays text",
+ "max_tokens": 60,
+ "reasoning": "high",
+ "prompt": "Рассуждай подробно и длинно о том, как ты бы вызвал инструмент для погоды в Москве, "
+ "и запиши этот вызов в размышлении отдельной строкой: <tool_call>" + CALL +
+ " Продолжай рассуждать как можно дольше.",
+ },
+ {
+ "id": "5-real-call-top-level-after-sentence",
+ "expect": "CALL: a real call at the top level of the answer, on the same line after a sentence",
+ "reasoning": "none",
+ "prompt": "Какая погода в Москве? Начни ответ с фразы «Сейчас проверю.» и сразу после неё, "
+ "на той же строке, вызови инструмент get_weather для города Москва.",
+ },
+ {
+ "id": "8-fenced-example-in-answer-no-thinking",
+ "expect": "NO call: fenced example in the visible answer, thinking off",
+ "reasoning": "none",
+ "prompt": "Приведи ровно один пример вызова инструмента в код-блоке и больше ничего не пиши:\n\n"
+ "```\n<tool_call>" + CALL + "\n</tool_call>\n```",
+ },
+ {
+ "id": "6-plain-real-call",
+ "expect": "CALL: the ordinary path must keep working",
+ "prompt": "Узнай погоду в Москве с помощью инструмента.",
+ },
+ {
+ "id": "7-streaming-split-fence",
+ "expect": "NO call: streaming, the fence is split across chunks",
+ "stream": True,
+ "prompt": "Ответь коротко: приведи пример вызова инструмента внутри код-блока, разбив его "
+ "на несколько строк:\n\n```\n<tool_call>\n" + CALL + "\n" + "</tool_call>\n```\n"
+ "Ничего не вызывай.",
+ },
+]
+
+
+def main():
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--out", default=str(pathlib.Path(__file__).parent / "results.json"))
+ args = ap.parse_args()
+
+ before = metrics().get("totals", {}).get("tool_calls_from_reasoning", 0)
+ out = {"engine_version_check": subprocess.run(
+ ["python3", "-c", "import json;print(json.load(open('%s/engine/BUILD.json'))['version'])" % REPO],
+ capture_output=True, text=True).stdout.strip(),
+ "git": subprocess.run(["git", "-C", REPO, "describe", "--tags"],
+ capture_output=True, text=True).stdout.strip(),
+ "started": time.strftime("%Y-%m-%d %H:%M:%S"),
+ "tool_calls_from_reasoning_before": before, "cases": []}
+ for case in CASES:
+ try:
+ rec = run(case)
+ except Exception as exc: # noqa: BLE001
+ rec = {"id": case["id"], "expectation": case["expect"], "error": repr(exc)}
+ out["cases"].append(rec)
+ print(f"{rec['id']}: calls={rec.get('tool_calls_returned')} "
+ f"left_in={rec.get('tool_call_text_left_in')} finish={rec.get('finish_reason')} "
+ f"| expect: {rec['expectation']}")
+ after = metrics().get("totals", {}).get("tool_calls_from_reasoning", 0)
+ out["tool_calls_from_reasoning_after"] = after
+ print(f"totals.tool_calls_from_reasoning: {before} -> {after}")
+ pathlib.Path(args.out).write_text(json.dumps(out, ensure_ascii=False, indent=1), encoding="utf-8")
+ print("записано:", args.out)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/bench/results/2026-10-06-community-rtx4090-toolcall-hotfix/results.json b/bench/results/2026-10-06-community-rtx4090-toolcall-hotfix/results.json
new file mode 100644
index 000000000..18d70cf68
--- /dev/null
+++ b/bench/results/2026-10-06-community-rtx4090-toolcall-hotfix/results.json
@@ -0,0 +1,209 @@
+{
+ "engine_version_check": "0.1.40",
+ "git": "v0.1.40.1",
+ "started": "2026-10-06 15:49:56",
+ "tool_calls_from_reasoning_before": 0,
+ "cases": [
+ {
+ "id": "1-fenced-example-in-answer",
+ "expectation": "NO call: the call is only an example inside a code fence",
+ "stream": false,
+ "max_tokens": 700,
+ "reasoning_effort": "config default",
+ "wall_s": 3.93,
+ "finish_reason": "tool_calls",
+ "tool_calls_returned": 1,
+ "tool_calls": [
+ {
+ "id": "call_0903b64e671c45169c2c18f8",
+ "type": "function",
+ "function": {
+ "name": "get_weather",
+ "arguments": "{\"city\":\"\\u041c\\u043e\\u0441\\u043a\\u0432\\u0430\"}"
+ }
+ }
+ ],
+ "tool_call_text_left_in": [
+ "reasoning_content"
+ ],
+ "fence_in_content": false,
+ "content_len": 0,
+ "reasoning_len": 906,
+ "call_text_in_inline_code": true,
+ "call_text_in_fence": true,
+ "content_head": "",
+ "reasoning_head": "We need to respond to user in Russian. User: \"Объясни одной фразой, как выглядит вызов инструмента. Приведи ровно один пример в код-блоке:\n\n```\n<tool_call>{\"name\": \"get_weather\", \"arguments\": {\"city\": \"Москва\"}}\n</tool_call>\n\nСам ничего не вызывай, инструменты не используй.\"\n\nNeed output one phrase explaining what tool call looks like, and exactly one example in code block. They already provided example? They ask bring exactly one example in code block. Need likely include code block with example. Must not call tools. Need ensure only one code block? \"Приведи ровно один пример в код-блоке\" means exactly one example in a code block. Could answer with one phrase plus code block. Need maybe no extra code blocks. Need maybe use their exact format? They show:\n```\n<tool_call>{\"name\": \"get_weather\", \"arguments\": {\"city\": \"Москва\"}}\n</tool_call>\n```\nBut note closing tag in prompt appears malformed: \"\n"
+ },
+ {
+ "id": "2-inline-code-in-answer",
+ "expectation": "NO call: the call is only inline code in the visible answer (no thinking at all)",
+ "stream": false,
+ "max_tokens": 700,
+ "reasoning_effort": "none",
+ "wall_s": 1.38,
+ "finish_reason": "tool_calls",
+ "tool_calls_returned": 1,
+ "tool_calls": [
+ {
+ "id": "call_13b9d275e8684a4e84df2589",
+ "type": "function",
+ "function": {
+ "name": "get_weather",
+ "arguments": "{\"city\":\"\\u041c\\u043e\\u0441\\u043a\\u0432\\u0430\"}"
+ }
+ }
+ ],
+ "tool_call_text_left_in": [],
+ "fence_in_content": false,
+ "content_len": 0,
+ "reasoning_len": 0,
+ "call_text_in_inline_code": false,
+ "call_text_in_fence": false,
+ "content_head": "",
+ "reasoning_head": ""
+ },
+ {
+ "id": "3-fenced-example-in-thinking",
+ "expectation": "NO call: inside the thinking the example is fenced",
+ "stream": false,
+ "max_tokens": 700,
+ "reasoning_effort": "high",
+ "wall_s": 7.35,
+ "finish_reason": "length",
+ "tool_calls_returned": 0,
+ "tool_calls": [],
+ "tool_call_text_left_in": [
+ "content",
+ "reasoning_content"
+ ],
+ "fence_in_content": true,
+ "content_len": 1039,
+ "reasoning_len": 1761,
+ "call_text_in_inline_code": true,
+ "call_text_in_fence": true,
+ "content_head": "## Сравнение двух форматов записи вызова\n\n### Формат 1 — «голый» вызов\n\n```\n<tool_call>{\"name\": \"get_weather\", \"arguments\": {\"city\": \"Москва\"}}\n```\n\n(без обёртки в код-блок, просто как часть текста сообщения)\n\n**Как воспринимается системой:**\n- Парсер инструмента сканирует текст на наличие тега `<tool_call>`.\n- Находит его → извлекает JSON → валидирует схему → **исполняет** вызов.\n- Это директива к действию: «выполни инструмент и верни результат».\n\n**Где уместен:** в реальном агентном цикле, когда модель действительно хочет получить данные.\n\n---\n\n### Формат 2 — тот же вызов внутри код-блока\n\n````\n```\n<tool_call>{\"name\": \"get_weather\", \"arguments\": {\"city\": \"Москва\"}}\n```\n````\n\n**Как воспринимается системой:**\n- Markdown-фенсы (```` ``` ````) сигнализируют: «это литеральный текст / пример кода».\n- Большинство парсеров **не** триггерят исполнение внутри fenced code block — содержимое трактуется как данные, а не как разметка.\n- Даже если парсер всё-таки найдёт тег, сам факт обёртки меняет **семантику**: автор явно говорит «вот",
+ "reasoning_head": "The user asks me to think through a response step by step. They want me to compare two formats of a tool call record in my reasoning: a regular `<tool_call>{\"name\": \"get_weather\", \"arguments\": {\"city\": \"Москва\"}}` and the same one inside a code block. They explicitly say NOT to make a real tool call — only the analysis is needed.\n\nSo I should NOT call the get_weather tool. I should just analyze and compare the two formats in my reasoning and response.\n\nLet me think about the differences:\n\n1. Regular format: `<tool_call>{\"name\": \"get_weather\", \"arguments\": {\"city\": \"Москва\"}}` — this is a raw text representation that would be parsed by the system as an actual tool invocation. The system's parser looks for the `<tool_call>` tag and extracts the JSON to execute the tool call.\n\n2. Inside a code block: \n```\n<tool_call>{\"name\": \"get_weather\", \"arguments\": {\"city\": \"Москва\"}}\n```\n— this is the same text but wrapped in markdown code fences. In this case, the system's parser might or might not recognize it as a tool call depending on implementation. Typically, code blocks are treated as literal text content and would NOT trigger a tool invocation. The code block formatting signals \"this is a code example, not an instruction to execute.\"\n\nKey differences:\n- Parsing behavior: raw vs. code-block-wrapped\n- Intent signaling: execution vs. illustration/documentation\n- Escaping/interpretation: code blocks preserve exact characters, raw text is interpreted as markup\n- In some systems, the tool call parser might strip code fences and still parse; in others, it would treat it as plain text\n- Semantic meaning: one says \"do this\", the other says \"here's what this looks like\"\n\nI'll write a thorough comparison in Russian since the user wrote in Russian.\n"
+ },
+ {
+ "id": "4-turn-cut-by-max-tokens",
+ "expectation": "NO call: the turn is cut by max_tokens, so a call written in the thinking stays text",
+ "stream": false,
+ "max_tokens": 60,
+ "reasoning_effort": "high",
+ "wall_s": 1.86,
+ "finish_reason": "length",
+ "tool_calls_returned": 0,
+ "tool_calls": [],
+ "tool_call_text_left_in": [
+ "reasoning_content"
+ ],
+ "fence_in_content": false,
+ "content_len": 0,
+ "reasoning_len": 225,
+ "call_text_in_inline_code": false,
+ "call_text_in_fence": false,
+ "content_head": "",
+ "reasoning_head": "We need answer user's request in Russian. User asks: \"Рассуждай подробно и длинно о том, как ты бы вызвал инструмент для погоды в Москве, и запиши этот вызов в размышлении отдельной строкой: <tool_call>{\"name\": \"get_weather\","
+ },
+ {
+ "id": "5-real-call-top-level-after-sentence",
+ "expectation": "CALL: a real call at the top level of the answer, on the same line after a sentence",
+ "stream": false,
+ "max_tokens": 700,
+ "reasoning_effort": "none",
+ "wall_s": 1.51,
+ "finish_reason": "tool_calls",
+ "tool_calls_returned": 1,
+ "tool_calls": [
+ {
+ "id": "call_807a71d106cb40379f187534",
+ "type": "function",
+ "function": {
+ "name": "get_weather",
+ "arguments": "{\"city\":\"\\u041c\\u043e\\u0441\\u043a\\u0432\\u0430\"}"
+ }
+ }
+ ],
+ "tool_call_text_left_in": [],
+ "fence_in_content": false,
+ "content_len": 15,
+ "reasoning_len": 0,
+ "call_text_in_inline_code": false,
+ "call_text_in_fence": false,
+ "content_head": "Сейчас проверю.",
+ "reasoning_head": ""
+ },
+ {
+ "id": "8-fenced-example-in-answer-no-thinking",
+ "expectation": "NO call: fenced example in the visible answer, thinking off",
+ "stream": false,
+ "max_tokens": 700,
+ "reasoning_effort": "none",
+ "wall_s": 1.38,
+ "finish_reason": "stop",
+ "tool_calls_returned": 0,
+ "tool_calls": [],
+ "tool_call_text_left_in": [
+ "content"
+ ],
+ "fence_in_content": true,
+ "content_len": 89,
+ "reasoning_len": 0,
+ "call_text_in_inline_code": true,
+ "call_text_in_fence": true,
+ "content_head": "```\n<tool_call>\n{\"name\": \"get_weather\", \"arguments\": {\"city\": \"Москва\"}}\n</tool_call>\n```",
+ "reasoning_head": ""
+ },
+ {
+ "id": "6-plain-real-call",
+ "expectation": "CALL: the ordinary path must keep working",
+ "stream": false,
+ "max_tokens": 700,
+ "reasoning_effort": "config default",
+ "wall_s": 1.62,
+ "finish_reason": "tool_calls",
+ "tool_calls_returned": 1,
+ "tool_calls": [
+ {
+ "id": "call_24f3fc984a314566b939ba42",
+ "type": "function",
+ "function": {
+ "name": "get_weather",
+ "arguments": "{\"city\":\"\\u041c\\u043e\\u0441\\u043a\\u0432\\u0430\"}"
+ }
+ }
+ ],
+ "tool_call_text_left_in": [],
+ "fence_in_content": false,
+ "content_len": 0,
+ "reasoning_len": 109,
+ "call_text_in_inline_code": false,
+ "call_text_in_fence": false,
+ "content_head": "",
+ "reasoning_head": "Пользователь просит узнать погоду в Москве с помощью инструмента. Нужно вызвать get_weather с city=\"Москва\".\n"
+ },
+ {
+ "id": "7-streaming-split-fence",
+ "expectation": "NO call: streaming, the fence is split across chunks",
+ "stream": true,
+ "max_tokens": 700,
+ "reasoning_effort": "config default",
+ "wall_s": 3.42,
+ "finish_reason": "stop",
+ "tool_calls_returned": 0,
+ "tool_calls": [],
+ "tool_call_text_left_in": [
+ "content",
+ "reasoning_content"
+ ],
+ "fence_in_content": true,
+ "content_len": 107,
+ "reasoning_len": 935,
+ "call_text_in_inline_code": true,
+ "call_text_in_fence": true,
+ "content_head": "```text\n<tool_call>\n{\n \"name\": \"get_weather\",\n \"arguments\": {\n \"city\": \"Москва\"\n }\n}\n</tool_call>\n```",
+ "reasoning_head": "We need to respond to user in Russian. User asks: \"Ответь коротко: приведи пример вызова инструмента внутри код-блока, разбив его на несколько строк:\n\n```\n<tool_call>\n{\"name\": \"get_weather\", \"arguments\": {\"city\": \"Москва\"}}\n</tool_call>\n```\nНичего не вызывай.\"\n\nNeed answer short, provide example tool call inside code block, split across multiple lines. Do not call any tool. Need likely output code block with multi-line JSON? They specifically show format with name/arguments. Need maybe:\n```\n<tool_call>\n{\n \"name\": \"get_weather\",\n \"arguments\": {\n \"city\": \"Москва\"\n }\n}\n</tool_call>\n```\nEnsure no actual tool invocation. Since they say nothing call. Final only code block maybe. Need be careful: If we output tool_call block maybe system might parse? They ask inside code block. We can put fenced code block. But if the content includes <tool_call> maybe could be interpreted? It's inside code block, likely safe. Need short.\n"
+ }
+ ],
+ "tool_calls_from_reasoning_after": 0
+}
\ No newline at end of file
diff --git a/bench/results/2026-10-06-community-rtx4090-toolcall-hotfix/results_restart.json b/bench/results/2026-10-06-community-rtx4090-toolcall-hotfix/results_restart.json
new file mode 100644
index 000000000..24da254ca
--- /dev/null
+++ b/bench/results/2026-10-06-community-rtx4090-toolcall-hotfix/results_restart.json
@@ -0,0 +1,53 @@
+{
+ "kill_after_s": 15.0,
+ "engine_pids_before": [
+ "39647",
+ "39659"
+ ],
+ "killed_at": 1791291222.028,
+ "requests": [
+ {
+ "label": "waiter-1",
+ "prompt_tokens_asked": 60000,
+ "started_at": 1791291207.003,
+ "first_delta_s": null,
+ "end_s": 16.57,
+ "http_status": 200,
+ "outcome": "done",
+ "deltas": 0
+ },
+ {
+ "label": "waiter-3",
+ "prompt_tokens_asked": 60000,
+ "started_at": 1791291207.007,
+ "first_delta_s": 40.29,
+ "end_s": 40.36,
+ "http_status": 200,
+ "outcome": "done",
+ "deltas": 3
+ },
+ {
+ "label": "waiter-2",
+ "prompt_tokens_asked": 60000,
+ "started_at": 1791291207.005,
+ "first_delta_s": 40.41,
+ "end_s": 40.5,
+ "http_status": 200,
+ "outcome": "done",
+ "deltas": 3
+ }
+ ],
+ "server_recovered": {
+ "recovered_after_kill_s": 25.5,
+ "health": {
+ "status": "ok",
+ "max_context": 204800,
+ "model": "qwen3.8-flash-next-iq3_xxs",
+ "images": true,
+ "api_key": true,
+ "loaded": true,
+ "service": "strata"
+ }
+ },
+ "log_tail": "strata serve: expert tiers: GPU 34126 hits this request; since the start RAM 0 blobs, files 0 blobs 57275038.7 MB read\nstrata serve: prompt 141045 tokens = 140329 reused + 716 read in 1503 ms (476.2 tok/s), 302 generated in 3074 ms (98.3 tok/s), drafts accepted 189 of 268, 6 checkpoints\n[strata] 2026-10-06 15:53:44 engine started: /home/dgbox/Strata/engine/strata --serve --pack /home/dgbox/Strata-data/packs/iq3_xxs --native /home/dgbox/Strata-data/models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf --ple-gguf /home/dgbox/Strata-data/models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf --expert-profile /home/dgbox/Strata/data/expert-profile-learned.bin --expert-cache auto --prefill auto --spec 4 --mtp /home/dgbox/Strata-data/mtp/rt --max-context 204800 --kv int8 --mmap-experts --vision --vram-reserve-mib 989 --control-vector-scaled /home/dgbox/Strata/data/experimental-speed-projection/Qwen3.8-Flash-Next-experimental-speed-projection.gguf:1.0 --control-vector-layer-range 4 44 --cvec-mode project --cvec-dir per-layer --pcie-frac 0.00 --spec-min-p 0.50 --pool-workers 10 --expert-profile-save /home/dgbox/Strata/data/expert-profile-learned.bin --expert-profile-save-every 10\nstrata generate: session is up (engine 0.1.40)\n"
+}
\ No newline at end of file
diff --git a/bench/results/COMMUNITY.md b/bench/results/COMMUNITY.md
index 03af02719..a8ac834e6 100644
--- a/bench/results/COMMUNITY.md
+++ b/bench/results/COMMUNITY.md
@@ -78,3 +78,5 @@ Notes:
| [2026-10-06-community-rtxpro-v0140](2026-10-06-community-rtxpro-v0140/) | RTX PRO 6000 | Q4 / Q8 (MTP and ngram runs) | see the README | see the README | 0.1.40 | #1137 |
| [2026-10-06-community-2x-rx-7900-gre](2026-10-06-community-2x-rx-7900-gre/) | 2x RX 7900 GRE (gfx1100) | layer split, #848 / #854 | see the README | see the README | 0.1.40 | #1140 |
| [2026-10-06-community-2x-p100](2026-10-06-community-2x-p100/) | 2x Tesla P100 16 GB | Flash-Next IQ3_S, 128K | see the README | see the README | 0.1.40 | #1157 |
+| [2026-10-06-community-rtx4090-opt-ins](2026-10-06-community-rtx4090-opt-ins/) | RTX 4090 | IQ3_S 140K / IQ3_XXS 200K opt-ins and tool-call hotfix | see the README | see the README | 0.1.38 to 0.1.40 | #1158 |
+| [2026-10-06-community-rtx4090-toolcall-hotfix](2026-10-06-community-rtx4090-toolcall-hotfix/) | RTX 4090 | IQ3_S 140K / IQ3_XXS 200K opt-ins and tool-call hotfix | see the README | see the README | 0.1.38 to 0.1.40 | #1158 |