step 13: tool-call arguments in any order (llama.cpp patch), harness watchdog and HTTP-served judge, DeepSeek/GLM rows, record draft

patches/llama.cpp-any-argument-order.patch (common/chat-auto-parser-generator.cpp, common/parsers/deepseek.cpp):
the generated tool-call grammars accept required arguments in any order. Upstream takes them in schema order,
which holds when its own sampler is grammar-constrained; this engine samples unconstrained, and DeepSeek V4
Flash and GLM 5.3 Flash both wrote content before path for pi's write tool, so finished calls came back as
parse errors (USTRAT-7). Same fix the fork already carries for the Qwen3-Coder parser. GLM's md-toc run passes
with it; DeepSeek rerun in progress.

tools/acceptance: 300 s per-tool-call watchdog inside the container; the minesweeper judge serves the work tree
over HTTP (the headless browser refuses file: URLs) and counts errors correctly; rejudge.sh, summarize.py;
pi max output 24576 tokens. tools/pod/bringup.sh copies data/expert-profile.bin into the Flash-Next pack (the
engine exits without it). docs/MODEL-FILES.md: DeepSeek V4 Flash UD-IQ2_XXS and GLM 5.3 Flash 3.0bit rows
with hashes and first-start results on the 2x B200 pod. bench/unbiased/2026-10-19-step13-acceptance/: record
in progress (server lines, engine info, findings; result tables to follow).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Robert KarlandClaude Fable 5.1 committed 2026-10-18 19:46:54 -07:00
1 parent a8469d55b5
commit 3a37ac6315
33 files changed
+364 -12

No files matched your search

+7
View File
@@ -93,6 +93,13 @@ Recorded here because a client written for one of the two may notice.
because the grammar's tool-call group is optional and has no end anchor, such a call was dropped silently:
the client got `finish_reason=stop` and an empty answer (UnbiasedStrata 1, 2026-10-08, REGINA-104). Qwen3.6's
template routes to the same parser. Carried over unchanged; it applies cleanly at this pin.
- `llama.cpp-any-argument-order.patch` (`common/chat-auto-parser-generator.cpp`, `common/parsers/deepseek.cpp`): the same for every
template the auto-generated PEG grammar serves (DeepSeek V4 Flash's DSML, GLM 5.3 Flash's `<arg_key>` form, and
the rest). Upstream accepts the required arguments only in the schema's order, which holds when its own sampler
is constrained by the grammar; this engine samples unconstrained, and both models wrote `content` before `path`
for a `write` tool that declares `path` first, so a finished, well-formed call was reported to the client as
"output does not match the expected peg-native format" (PLAN.md step 13, 2026-10-19, USTRAT-7). Whether every
required argument is present is left to the tool, as upstream already leaves it for optional-only tools.
## Engine source (`src/`, `include/`)
@@ -0,0 +1,63 @@
# Step 13: model acceptance (PLAN.md step 13, 2026-10-19)
A model family is accepted when a coding agent gets real work done through the fork's server with it, under the sampling
its model card asks for, and when the API-only checks pass with speed within 15 % of the step-6/9 figures for the same
box. Harness: `tools/acceptance/` (pi 0.85.1 in a Docker container with tools, one prompt per task, judges that do not
read the transcript); API checks: `frontend/tests/acceptance-real-engine.sh`. This directory is the record; the raw runs
(`pi.jsonl`, work trees, judge screenshots) stay in `tools/acceptance/runs/` on the Mac and are not committed.
## Boxes and servers
| Box | Card(s) | Served through the fork | Port on the Mac | Start line |
| --- | --- | --- | --- | --- |
| A6000 VM (rk@192.168.50.10) | RTX A6000 48 GB | Qwen3.6-35B-A3B UD-IQ4_XS (`strata-poly`, MTP, `--mmproj`) | 18091 | `bench/unbiased/2026-10-18-a6000-qwen36-iq4xs-images-step8/server-command.sh` |
| RunPod RTX 3090 (`tools/pod/bringup.sh 86 small`, 2026-10-19) | RTX 3090 24 GB, cgroup 31 cores | Qwen3.8-Flash-Next IQ3_XXS (`strata`, `--expert-cache auto`, `--pool-workers 24`); Qwen3.6 UD-Q3_K_M (`strata-poly`) one at a time | 18092; 18094 | `servers/3090-start.sh` |
| RunPod 2x B200 (`bringup.sh 100 big`) | 2x B200 180 GB, cgroup 46.5 cores, 2 TB RAM | DeepSeek V4 Flash UD-IQ2_XXS on card 0 (`strata-poly`, 91 GB used); GLM 5.3 Flash 3.0bit on card 1 (113 GB used) | 18095; 18096 | `servers/b200-start.sh` |
Every model file was downloaded fresh from Hugging Face at the pinned revision onto the pods' container disks
(`tools/pod/README.md`); hashes in `docs/MODEL-FILES.md`. Engine lines at start: `servers/*-engine-info.txt`.
## Tasks
md-toc (CLI + own tests; 4 hidden pytest cases), kvstore (HTTP KV store; black-box driver with a restart), bugfix (three
planted bugs; seed tests must stay byte-identical, hidden tests added), minesweeper (single-page game; headless Chromium
finds 81 `.cell`s, a click reveals, no console error). Sampling: temperature 0.6, top_k 20, top_p 0.95, seed 7
(`--thinking medium` in pi; `low` for GLM, see finding 2); minesweeper also at temperature 1.0. Prompts in
`tools/acceptance/tasks/*/prompt.md`.
## Results
RESULTS_TABLE
## Findings
1. **GLM 5.3 Flash could not start through the fork** (USTRAT-6, fixed in this step): the front end reads the vocabulary
with a vocab-only llama.cpp load, and llama.cpp rejects the file's architecture name `glm5-next` (neurall's fork)
before the vocab-only early return. The load is retried with `general.architecture` overridden to `llama`
(`frontend/strata_context.cpp`); nothing architecture-specific is read on that path. DeepSeek V4 Flash (`deepseek2`
family, known) started first time: 32 s to ready, 78 tok/s decode on short prompts on one B200.
2. **GLM's template honours `reasoning_effort` only as `low` or `high`; anything else is `max`.** pi's `--thinking
medium` therefore ran GLM at maximum effort and the first turn thought until the 8,192-token cap (31,000
characters on CommonMark edge cases) with no tool call. The runs below use `--thinking low` for GLM. The server
passes the request's `reasoning_effort` into the template as llama.cpp does; `--chat-template-kwargs` is the
server-side default when a client does not send one.
3. **Tool calls with required arguments out of schema order failed to parse** (USTRAT-7, fixed in this step): DeepSeek
(DSML) and GLM (`<arg_key>`) both wrote `content` before `path` for a `write` tool that declares `path` first, on
every long `write`/`edit`. llama.cpp's generated PEG grammar takes required arguments in schema order, which holds
when its own sampler is constrained by the grammar; this engine samples unconstrained ("a grammar was requested;
this engine does not constrain sampling, parsing only"), so a finished, well-formed call was returned to pi as an
error and pi ended the run. `patches/llama.cpp-any-argument-order.patch` accepts any order, as the
fork's existing Qwen3-Coder patch does. Qwen3.6 and Flash-Next (Hermes JSON arguments) never hit it.
4. **With thinking turned off by `chat_template_kwargs.thinking=false`, DeepSeek's content begins with a stray
`</think>`.** With thinking on (the default) reasoning is split correctly. Recorded, not fixed.
5. **Harness.** The headless browser (lookingglass) refuses `file:` URLs; the judge serves the work tree over HTTP. A
tool call that runs longer than 300 s is killed inside the container (the Qwen3.6 Minesweeper agent's own Node test
hung three times); the kill is logged in the run's `harness-notes.txt`. Pods: the Flash-Next pack needs the shipped
`data/expert-profile.bin` copied in (the engine exits without it; `bringup.sh` now does it); `ulimit -l` raised for
the PLE table lock.
6. **Pod bring-up facts** are in `tools/pod/README.md`: pod-to-pod copy of the tree (90 s) instead of laptop-to-pod
(hours); HF downloads at 1 to 2 GB/s on both pods (the 2x B200 pod fetched 300 GB in 17 min).
## API-only acceptance (`frontend/tests/acceptance-real-engine.sh`)
API_TABLE
@@ -0,0 +1 @@
{"choices": [{"finish_reason": "length", "index": 0, "message": {"role": "assistant", "content": "The fog rolled in like a gray tide, swallowing the coastline whole. Elias stood at the top of the Iron Point Lighthouse, his hand resting on the cold brass railing. For thirty years, this structure had been his only companion, a stone sentinel against the chaotic sea. The beam swept out in rhythmic pulses, a heartbeat of light piercing the gloom, warning ships of the jagged rocks hidden beneath the churning waves.\n\nElias loved the solitude, but he also feared it. The silence here was heavy, pressing against his eardrums. He spent his days polishing the lens, trimming the wick, and watching the horizon for any sign of life. Most days, there was nothing. Just the endless gray. But today, a small fishing boat bobbed dangerously close to the shoals. The captain, a young man Elias had never met, was struggling against the current. The light was their only hope, but the fog was thick enough to obscure even the beam\u2019s reflection.\n\nElias grabbed the radio handset. Static crackled, then died. He shouted into the void, his voice raw and desperate. \"Turn left! Hard left!\" There was no response. The boat drifted closer to the rocks. Elias felt a surge of panic"}}], "created": 1792378007, "model": "qwen3.8-flash-next-iq3_xxs-3090", "system_fingerprint": "b1-3cf0325", "object": "chat.completion", "usage": {"completion_tokens": 256, "prompt_tokens": 30, "total_tokens": 286, "prompt_tokens_details": {"cached_tokens": 0}}, "id": "chatcmpl-theQ0Q8olzRqJPXYXrsmeKBrrF4EGEhp", "timings": {"cache_n": 0, "prompt_n": 30, "prompt_ms": 408.828, "prompt_per_token_ms": 13.6276, "prompt_per_second": 73.38049252986588, "predicted_n": 256, "predicted_ms": 3222.774, "predicted_per_token_ms": 12.638329411764705, "predicted_per_second": 79.12438166622916, "draft_n": 221, "draft_n_accepted": 111}}
@@ -0,0 +1 @@
{"choices": [{"finish_reason": "length", "index": 0, "message": {"role": "assistant", "content": "The salt had eaten the brass fittings long ago, leaving them green and pitted like old teeth. Elias didn\u2019t mind. He liked the decay. It meant time was still moving, even here, at the edge of the world where the Atlantic gnawed at the granite foundations of the tower.\n\nEvery night, Elias climbed the one hundred and forty-four steps. His knees cracked in protest, a dry, wooden sound that echoed in the spiral stairwell. At the top, the Fresnel lens waited, a cathedral of glass and prisms. He polished it with a chamois cloth, his breath fogging the cold air. The beam swept out, a golden finger pointing into the dark, cutting through the fog that rolled in from the sea like a living thing.\n\nHe wasn\u2019t lonely. He was solitary. There was a difference. Loneliness was a hole in the chest; solitude was a room with the door closed. In this room, Elias kept the light. He kept the rhythm. Three seconds dark, three seconds light. *Blink. Blink.* It was the heartbeat of the coast. Ships passed in the distance, tiny sparks of warning, trusting the beam to keep them from the rocks. Elias trusted the rocks to keep them from the"}}], "created": 1792378010, "model": "qwen3.8-flash-next-iq3_xxs-3090", "system_fingerprint": "b1-3cf0325", "object": "chat.completion", "usage": {"completion_tokens": 256, "prompt_tokens": 30, "total_tokens": 286, "prompt_tokens_details": {"cached_tokens": 0}}, "id": "chatcmpl-EwOSkOEkiEtn9yM9KIJLQq7CeIrGfoIH", "timings": {"cache_n": 0, "prompt_n": 30, "prompt_ms": 318.436, "prompt_per_token_ms": 10.614533333333332, "prompt_per_second": 94.21045359193056, "predicted_n": 256, "predicted_ms": 2866.92, "predicted_per_token_ms": 11.242823529411766, "predicted_per_second": 88.94562806077602, "draft_n": 219, "draft_n_accepted": 113}}
@@ -0,0 +1 @@
{"object":"list","data":[{"id":"qwen3.8-flash-next-iq3_xxs-3090","object":"model","created":1792377996,"owned_by":"unbiasedstrata","context_length":65536,"input_modalities":["text"],"meta":{"vocab_type":true,"n_vocab":248320,"n_ctx":65536,"engine":"strata"}}]}
@@ -0,0 +1,10 @@
== /v1/models
['qwen3.8-flash-next-iq3_xxs-3090']
== 1. sampled chat with thinking: answer present, reasoning separated, finish=stop
{"content": "391", "reasoning_chars": 134, "finish": "stop", "ok": true}
== 2. same request, same seed, twice: identical ids (sampling is seeded)
{"a": "The endless blue expanse of the sea stretches to the horizon, whispering ancient secrets with every ", "same": false}
(seeded sampling not reproducible: recorded, not failed; drafting changes the path)
== 3. tool call, pi-shaped: a tool_calls entry with a JSON-parsable argument object
{"tool_calls": [{"type": "function", "function": {"name": "read", "arguments": "{\"path\":\"/etc/hostname\"}"}, "id": "lIS9te6jK0wExMD0sn12lGgSrq1GwhGF"}], "ok": true}
== 4. decode speed: 3 x 256 tokens of prose, thinking off, median tokens/s from the server's timings
@@ -0,0 +1 @@
{"choices":[{"finish_reason":"stop","index":0,"message":{"role":"assistant","content":"The endless blue expanse of the sea stretches to the horizon, whispering ancient secrets with every rolling wave."}}],"created":1792377999,"model":"qwen3.8-flash-next-iq3_xxs-3090","system_fingerprint":"b1-3cf0325","object":"chat.completion","usage":{"completion_tokens":23,"prompt_tokens":19,"total_tokens":42,"prompt_tokens_details":{"cached_tokens":0}},"id":"chatcmpl-tRfdvvP0t3oLfHq5wf3hIUpdc7WfY5uK","timings":{"cache_n":0,"prompt_n":19,"prompt_ms":320.513,"prompt_per_token_ms":16.869105263157895,"prompt_per_second":59.27996680321859,"predicted_n":23,"predicted_ms":486.458,"predicted_per_token_ms":22.111727272727276,"predicted_per_second":45.22487038963281,"draft_n":23,"draft_n_accepted":10}}
@@ -0,0 +1 @@
{"choices":[{"finish_reason":"stop","index":0,"message":{"role":"assistant","content":"The endless blue expanse of the sea stretches to the horizon, whispering ancient secrets carried by the rhythmic pull of the tides."}}],"created":1792378001,"model":"qwen3.8-flash-next-iq3_xxs-3090","system_fingerprint":"b1-3cf0325","object":"chat.completion","usage":{"completion_tokens":29,"prompt_tokens":19,"total_tokens":48,"prompt_tokens_details":{"cached_tokens":12}},"id":"chatcmpl-KE2csDtQzpDnaejhqtMWwI67GPMUt5aP","timings":{"cache_n":12,"prompt_n":7,"prompt_ms":62.34,"prompt_per_token_ms":8.905714285714286,"prompt_per_second":112.28745588707088,"predicted_n":29,"predicted_ms":414.764,"predicted_per_token_ms":14.813,"predicted_per_second":67.50826976304597,"draft_n":32,"draft_n_accepted":16}}
@@ -0,0 +1 @@
{"choices":[{"finish_reason":"stop","index":0,"message":{"role":"assistant","content":"391","reasoning_content":"We need answer user: \"What is 17 * 23? Answer with the number only.\" Need compute 17*23=391. Need final only number. Ensure no extra.\n"}}],"created":1792377998,"model":"qwen3.8-flash-next-iq3_xxs-3090","system_fingerprint":"b1-3cf0325","object":"chat.completion","usage":{"completion_tokens":51,"prompt_tokens":68,"total_tokens":119,"prompt_tokens_details":{"cached_tokens":0}},"id":"chatcmpl-BcXX66GchUC6OsWRUPb1qC1wGZDM6n7C","timings":{"cache_n":0,"prompt_n":68,"prompt_ms":743.612,"prompt_per_token_ms":10.935470588235294,"prompt_per_second":91.44553880249379,"predicted_n":51,"predicted_ms":753.355,"predicted_per_token_ms":15.0671,"predicted_per_second":66.36977255078946,"draft_n":44,"draft_n_accepted":36}}
@@ -0,0 +1 @@
{"choices":[{"finish_reason":"tool_calls","index":0,"message":{"role":"assistant","content":"","reasoning_content":"The user wants me to read a specific file: /etc/hostname. This is a straightforward request. Let me use the read tool.\n","tool_calls":[{"type":"function","function":{"name":"read","arguments":"{\"path\":\"/etc/hostname\"}"},"id":"lIS9te6jK0wExMD0sn12lGgSrq1GwhGF"}]}}],"created":1792378002,"model":"qwen3.8-flash-next-iq3_xxs-3090","system_fingerprint":"b1-3cf0325","object":"chat.completion","usage":{"completion_tokens":57,"prompt_tokens":314,"total_tokens":371,"prompt_tokens_details":{"cached_tokens":0}},"id":"chatcmpl-vIFGzWMrufwssAScT3Ryhpq2PIbFqekq","timings":{"cache_n":0,"prompt_n":314,"prompt_ms":745.531,"prompt_per_token_ms":2.3743025477707005,"prompt_per_second":421.17631594125527,"predicted_n":57,"predicted_ms":590.012,"predicted_per_token_ms":10.53592857142857,"predicted_per_second":94.91332379680415,"draft_n":53,"draft_n_accepted":40}}
@@ -0,0 +1 @@
{"choices": [{"finish_reason": "length", "index": 0, "message": {"role": "assistant", "content": "The salt spray had long since stained Elias\u2019s knuckles a permanent, rusty orange. For forty years, he had been the sentinel of Blackwood Point, a jagged tooth of granite jutting into the churning Atlantic. His world was reduced to the rhythmic sweep of the Fresnel lens, the groan of the iron gears, and the relentless, indifferent roar of the sea below.\n\nTonight, the storm was particularly vicious. Rain lashed against the thick glass of the lantern room like handfuls of gravel, threatening to extinguish the light that had guided sailors to safety for over a century. Elias adjusted his oilskin coat, his arthritic knees protesting with every step up the spiral stairs. He checked the fuel gauge. It was low. Too low.\n\nA sharp crack echoed through the tower, louder than the thunder. A branch, torn from the ancient oak on the cliffside, had smashed into the lower gallery. Dust and debris rained down from the ceiling. Elias froze. The structural integrity of the base was compromised. If the foundation cracked, the entire tower could slide into the abyss.\n\nHe looked at the light, steady and unwavering despite the chaos outside. It was the only thing that mattered. A ship, the *"}}], "created": 1792377923, "model": "qwen3.6-35b-a3b-ud-iq4_xs", "system_fingerprint": "b11062-3cf03257f", "object": "chat.completion", "usage": {"completion_tokens": 256, "prompt_tokens": 30, "total_tokens": 286, "prompt_tokens_details": {"cached_tokens": 0}}, "id": "chatcmpl-9HDQqjVo4LMYVxvLFL4jC0iqlvCHiaPt", "timings": {"cache_n": 0, "prompt_n": 30, "prompt_ms": 102.954, "prompt_per_token_ms": 3.4318, "prompt_per_second": 291.39227227693925, "predicted_n": 256, "predicted_ms": 1462.393, "predicted_per_token_ms": 5.734874509803921, "predicted_per_second": 174.37173181217358, "draft_n": 170, "draft_n_accepted": 124}}
@@ -0,0 +1 @@
{"choices": [{"finish_reason": "length", "index": 0, "message": {"role": "assistant", "content": "The brass railing was cold against Elias\u2019s palms, a familiar chill that had seeped into his bones over forty years. Below, the Atlantic churned, a restless beast of black water and white foam, slamming against the granite teeth of the cliff. Inside the lantern room, the great Fresnel lens rotated with a hypnotic, rhythmic *click-whir, click-whir*, casting its sweeping beam across the dark expanse.\n\nElias wasn\u2019t just a keeper; he was the guardian of a threshold. He had watched ships come and go, their lights like dying fireflies in the storm\u2019s grip. He knew the moods of the sea better than he knew the lines of his own weathered face. Tonight, however, the silence was different. It wasn\u2019t the absence of sound, but a heavy, waiting pressure. The barometer had dropped hours ago, and the wind carried the metallic tang of ozone.\n\nA shadow detached itself from the darkness of the horizon. A vessel, small and unlit, drifted dangerously close to the jagged reef known as Devil\u2019s Back. Elias didn\u2019t hesitate. He adjusted the lamp\u2019s intensity, pouring every watt of energy into the beam, aiming it like a spear. He grabbed the signal lamp, its"}}], "created": 1792377924, "model": "qwen3.6-35b-a3b-ud-iq4_xs", "system_fingerprint": "b11062-3cf03257f", "object": "chat.completion", "usage": {"completion_tokens": 256, "prompt_tokens": 30, "total_tokens": 286, "prompt_tokens_details": {"cached_tokens": 0}}, "id": "chatcmpl-SZQJaIr7Cy9sI2zrn0chgOazFyETf8Go", "timings": {"cache_n": 0, "prompt_n": 30, "prompt_ms": 101.101, "prompt_per_token_ms": 3.370033333333333, "prompt_per_second": 296.73297000029675, "predicted_n": 256, "predicted_ms": 1389.713, "predicted_per_token_ms": 5.4498549019607845, "predicted_per_second": 183.49112370683733, "draft_n": 160, "draft_n_accepted": 131}}
@@ -0,0 +1 @@
{"choices": [{"finish_reason": "length", "index": 0, "message": {"role": "assistant", "content": "The salt air always tasted like iron and old secrets. Elias adjusted his woolen collar, the damp chill of the Atlantic seeping through the stone walls of the lighthouse. For forty years, he had been the silent guardian of Blackwood Rock, a jagged tooth of granite jutting into the churning grey sea. His world was reduced to the rhythmic sweep of the Fresnel lens, the groan of the gears, and the endless, indifferent horizon.\n\nTonight, the storm was unlike any he had witnessed. The wind howled like a wounded beast, battering the glass panes with violent fists. Rain lashed against the lantern room, blurring the beam of light that cut through the darkness. Elias climbed the spiral stairs, his knees protesting with every step, to check the oil reserves. The pressure was immense; ships relied on this light not just for guidance, but for survival.\n\nAs he reached the top, a flash of lightning illuminated the sea below. Something was wrong. A distress flare, red and desperate, pulsed from the waves. Elias squinted, his heart hammering against his ribs. A small fishing trawler, battered and listing heavily to port, was being dragged toward the razor-sharp reefs. There was"}}], "created": 1792377926, "model": "qwen3.6-35b-a3b-ud-iq4_xs", "system_fingerprint": "b11062-3cf03257f", "object": "chat.completion", "usage": {"completion_tokens": 256, "prompt_tokens": 30, "total_tokens": 286, "prompt_tokens_details": {"cached_tokens": 0}}, "id": "chatcmpl-t0AimJONujY2rtfdkbPCkQfYeZXUC0gI", "timings": {"cache_n": 0, "prompt_n": 30, "prompt_ms": 101.066, "prompt_per_token_ms": 3.368866666666667, "prompt_per_second": 296.8357311064057, "predicted_n": 256, "predicted_ms": 1458.645, "predicted_per_token_ms": 5.720176470588235, "predicted_per_second": 174.81978137243811, "draft_n": 171, "draft_n_accepted": 125}}
@@ -0,0 +1 @@
{"object":"list","data":[{"id":"qwen3.6-35b-a3b-ud-iq4_xs","object":"model","created":1792377919,"owned_by":"unbiasedstrata","context_length":32768,"input_modalities":["text","image"],"meta":{"vocab_type":true,"n_vocab":248320,"n_ctx":32768,"engine":"strata-poly"}}]}
@@ -0,0 +1 @@
{"choices": [{"finish_reason": "stop", "index": 0, "message": {"role": "assistant", "content": "260"}}], "created": 1792377928, "model": "qwen3.6-35b-a3b-ud-iq4_xs", "system_fingerprint": "b11062-3cf03257f", "object": "chat.completion", "usage": {"completion_tokens": 4, "prompt_tokens": 8275, "total_tokens": 8279, "prompt_tokens_details": {"cached_tokens": 0}}, "id": "chatcmpl-9EttNQIyfaDCHd2lWqfImwD20Rkf4k3E", "timings": {"cache_n": 0, "prompt_n": 8275, "prompt_ms": 2160.819, "prompt_per_token_ms": 0.26112616314199394, "prompt_per_second": 3829.56647456358, "predicted_n": 4, "predicted_ms": 16.517, "predicted_per_token_ms": 5.5056666666666665, "predicted_per_second": 181.6310468002664, "draft_n": 3, "draft_n_accepted": 2}}
@@ -0,0 +1,15 @@
== /v1/models
['qwen3.6-35b-a3b-ud-iq4_xs']
== 1. sampled chat with thinking: answer present, reasoning separated, finish=stop
{"content": "391", "reasoning_chars": 675, "finish": "stop", "ok": true}
== 2. same request, same seed, twice: identical ids (sampling is seeded)
{"a": "The endless blue horizon stretches out to meet the sky, whispering ancient secrets with every crashi", "same": true}
== 3. tool call, pi-shaped: a tool_calls entry with a JSON-parsable argument object
{"tool_calls": [{"type": "function", "function": {"name": "read", "arguments": "{\"path\":\"/etc/hostname\"}"}, "id": "6v5VsRHUJXhON6Lz7dvy0ZLt5T8ccp9C"}], "ok": true}
== 4. decode speed: 3 x 256 tokens of prose, thinking off, median tokens/s from the server's timings
{"decode_tok_s": [174.4, 183.5, 174.8], "median": 174.8, "expected": 207.0, "floor": 175.9, "ok": false}
== 5. prompt reading: one ~6k-token prompt, tokens/s from the server's timings
{"prompt_tokens": 8275, "pp_tok_s": 3829.6, "answer": "260"}
== /health
{"status":"ok","busy":false,"service":"strata","loaded":true,"model":"qwen3.6-35b-a3b-ud-iq4_xs","max_context":32768}
ACCEPTANCE_FAIL qwen3.6-35b-a3b-ud-iq4_xs
@@ -0,0 +1 @@
{"choices":[{"finish_reason":"stop","index":0,"message":{"role":"assistant","content":"The endless blue horizon stretches out to meet the sky, whispering ancient secrets with every crashing wave."}}],"created":1792377921,"model":"qwen3.6-35b-a3b-ud-iq4_xs","system_fingerprint":"b11062-3cf03257f","object":"chat.completion","usage":{"completion_tokens":21,"prompt_tokens":19,"total_tokens":40,"prompt_tokens_details":{"cached_tokens":0}},"id":"chatcmpl-hdc19m9JMzooiPa3ftqKZ6YZw8K4H21F","timings":{"cache_n":0,"prompt_n":19,"prompt_ms":74.893,"prompt_per_token_ms":3.941736842105263,"prompt_per_second":253.69527192127435,"predicted_n":21,"predicted_ms":128.914,"predicted_per_token_ms":6.4456999999999995,"predicted_per_second":155.1421878151326,"draft_n":14,"draft_n_accepted":8}}
@@ -0,0 +1 @@
{"choices":[{"finish_reason":"stop","index":0,"message":{"role":"assistant","content":"The endless blue horizon stretches out to meet the sky, whispering ancient secrets with every crashing wave."}}],"created":1792377921,"model":"qwen3.6-35b-a3b-ud-iq4_xs","system_fingerprint":"b11062-3cf03257f","object":"chat.completion","usage":{"completion_tokens":21,"prompt_tokens":19,"total_tokens":40,"prompt_tokens_details":{"cached_tokens":18}},"id":"chatcmpl-7E2i2yQ30uXsevpphf5zor4kbxWERPsA","timings":{"cache_n":18,"prompt_n":1,"prompt_ms":17.877,"prompt_per_token_ms":17.877,"prompt_per_second":55.937797169547466,"predicted_n":21,"predicted_ms":116.785,"predicted_per_token_ms":5.83925,"predicted_per_second":171.25487006036735,"draft_n":13,"draft_n_accepted":9}}
@@ -0,0 +1 @@
{"choices":[{"finish_reason":"stop","index":0,"message":{"role":"assistant","content":"391","reasoning_content":"Here's a thinking process:\n\n1. **Identify the User's Request:** The user wants to know the product of 17 and 23, and specifically requests the answer with \"the number only\".\n\n2. **Calculate the Product:**\n - 17 * 23\n - I can break it down: 17 * 20 = 340\n - 17 * 3 = 51\n - 340 + 51 = 391\n - Alternatively, use standard multiplication:\n ```\n 17\n x 23\n ----\n 51 (17 * 3)\n 340 (17 * 20)\n ----\n 391\n ```\n - Result: 391\n\n3. **Format the Output:** The user explicitly said \"Answer with the number only.\" So I will output just \"391\".\n\n4. **Final Check:** 17 * 23 = 391. Matches calculation. Format matches request. Ready.✅\n"}}],"created":1792377920,"model":"qwen3.6-35b-a3b-ud-iq4_xs","system_fingerprint":"b11062-3cf03257f","object":"chat.completion","usage":{"completion_tokens":257,"prompt_tokens":26,"total_tokens":283,"prompt_tokens_details":{"cached_tokens":0}},"id":"chatcmpl-op4BfhAQiPOCsD2EH5RYLmswv85TlsvR","timings":{"cache_n":0,"prompt_n":26,"prompt_ms":123.322,"prompt_per_token_ms":4.743153846153846,"prompt_per_second":210.83018439532282,"predicted_n":257,"predicted_ms":1202.41,"predicted_per_token_ms":4.6969140625,"predicted_per_second":212.90574762352276,"draft_n":214,"draft_n_accepted":177}}
@@ -0,0 +1 @@
{"choices":[{"finish_reason":"tool_calls","index":0,"message":{"role":"assistant","content":"","reasoning_content":"The user wants to read the content of the file `/etc/hostname`.\nI will use the `read` tool with the path `/etc/hostname`.\nThen I will display the content to the user.\nNo special parameters are needed.\nI am ready.\n","tool_calls":[{"type":"function","function":{"name":"read","arguments":"{\"path\":\"/etc/hostname\"}"},"id":"6v5VsRHUJXhON6Lz7dvy0ZLt5T8ccp9C"}]}}],"created":1792377921,"model":"qwen3.6-35b-a3b-ud-iq4_xs","system_fingerprint":"b11062-3cf03257f","object":"chat.completion","usage":{"completion_tokens":84,"prompt_tokens":276,"total_tokens":360,"prompt_tokens_details":{"cached_tokens":0}},"id":"chatcmpl-dpEW7MMKTMZFaPcR0aCXMAuyezrNB2Yn","timings":{"cache_n":0,"prompt_n":276,"prompt_ms":120.446,"prompt_per_token_ms":0.4363985507246377,"prompt_per_second":2291.4833203261214,"predicted_n":84,"predicted_ms":394.349,"predicted_per_token_ms":4.751192771084337,"predicted_per_second":210.47346386069194,"draft_n":59,"draft_n_accepted":53}}
@@ -0,0 +1 @@
a8469d55 step 13: acceptance harness (pi in Docker, four tasks, judges), API-only acceptance script, GLM vocabulary load fix
@@ -0,0 +1,7 @@
# model id (as the fork server announces it) host port on this Mac (ssh tunnel to the box) context box
qwen3.6-35b-a3b-ud-iq4_xs 18091 32768 A6000 VM
qwen3.8-flash-next-iq3_xxs 18090 65536 A6000 VM
qwen3.8-flash-next-iq3_xxs-3090 18092 65536 RTX 3090 pod
qwen3.6-35b-a3b-ud-q3_k_m-3090 18094 32768 RTX 3090 pod
deepseek-v4-flash-ud-iq2_xxs-b200 18095 32768 2x B200 pod
glm-5.3-flash-3.0bit-b200 18096 32768 2x B200 pod
1 # model id (as the fork server announces it) host port on this Mac (ssh tunnel to the box) context box
2 qwen3.6-35b-a3b-ud-iq4_xs 18091 32768 A6000 VM
3 qwen3.8-flash-next-iq3_xxs 18090 65536 A6000 VM
4 qwen3.8-flash-next-iq3_xxs-3090 18092 65536 RTX 3090 pod
5 qwen3.6-35b-a3b-ud-q3_k_m-3090 18094 32768 RTX 3090 pod
6 deepseek-v4-flash-ud-iq2_xxs-b200 18095 32768 2x B200 pod
7 glm-5.3-flash-3.0bit-b200 18096 32768 2x B200 pod
@@ -0,0 +1,38 @@
strata: PLE table mlock failed (Cannot allocate memory; raise `ulimit -l`): its pages stay faulted in but may be reclaimed
strata generate: profile /opt/us2-models/pack-iq3-xxs/expert-profile.bin: 24576 ranked pairs, built for 24576 slots
strata generate: pre-filled 10531 of 10531 slots from the profile in 0.9 s (20475 MB/s); slot 0 verified
strata generate: R4 hit path ON - resident experts are computed on the GPU
strata generate: token graph hit path: 10531 resident experts, decided on the device
strata serve: STRATA_ROUTE_TAIL_SKIP=7 is ON (default): a missed expert that every token of a verify window routes at rank 7 or lower is skipped (+10..20% decode on 12-16 GB cards that miss experts, a
0.31.725.353 I engine info: arena_mib=40925
0.31.725.364 I engine info: context=65536
0.31.725.364 I engine info: conversation_cache_mib=0
0.31.725.373 I engine info: conversation_cache_min_free_mib=2560
0.31.725.373 I engine info: conversation_cache_min_tokens=0
0.31.725.373 I engine info: conversation_cache_slots=4
0.31.725.374 I engine info: cvec=0
0.31.725.374 I engine info: engine=0.1.45
0.31.725.375 I engine info: expert_cache_mib=17485
0.31.725.375 I engine info: expert_cache_primary_mib=17485
0.31.725.375 I engine info: expert_slots=10531
0.31.725.375 I engine info: expert_slots_primary=10531
0.31.725.376 I engine info: kv=int8
0.31.725.378 I engine info: kv_resident=32768
0.31.725.378 I engine info: logit_bias=1
0.31.725.379 I engine info: lookup=3
0.31.725.379 I engine info: mtp_max=4
0.31.725.379 I engine info: pcie_frac=0.55
0.31.725.379 I engine info: pool_workers=24
0.31.725.380 I engine info: prefill_cap=8192
0.31.725.380 I engine info: prefill_pipe=0
0.31.725.380 I engine info: prefill_stages=1
0.31.725.380 I engine info: spec=6
0.31.725.381 I engine info: spec_min_p=0.50
0.31.725.381 I engine info: stream_all_min=1024
0.31.725.381 I engine info: tail_role_token=-1
0.31.725.381 I engine info: vram_elastic=0
0.31.725.381 I engine info: vram_free_mib=465
0.31.725.385 I engine ready: context 65536 tokens, model qwen3.8-flash-next-iq3_xxs-3090
NVIDIA GeForce RTX 3090, 24576 MiB, 580.159.03
3113000 100000
Mem: 1007 156 665 2 195 851
@@ -0,0 +1,18 @@
#!/bin/bash
# start.sh <flash-next|q3km|iq4xs> : fork front end + engine on the 3090 (24 GB), one model at a time. Flags are the
# fork README 24 GB lines; --pool-workers 24 keeps under the cgroup quota (31 cores). Ports as tools/acceptance/models.tsv
# (the tunnel to the Mac maps them 1:1).
set -u
F=/opt/us2-build; M=/opt/us2-models; S=/opt/us2-servers; cd $S
SH1=$M/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf; SH2=$M/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf
case $1 in
flash-next) PORT=18092; ALIAS=qwen3.8-flash-next-iq3_xxs-3090; ENGINE=$F/build/bin/strata; MODEL=$SH1
ARGS="--pack $M/pack-iq3-xxs --native $SH1 --ple-gguf $SH2 --expert-profile $M/pack-iq3-xxs/expert-profile.bin --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp $M/mtp --max-context 65536 --kv int8 --ple-io ram --pool-workers 24 --kv-resident 32768";;
q3km) PORT=18094; ALIAS=qwen3.6-35b-a3b-ud-q3_k_m-3090; ENGINE=$F/build/bin/strata-poly; MODEL=$M/qwen36-mtp/Qwen3.6-35B-A3B-UD-Q3_K_M.gguf
ARGS="--model $MODEL --max-context 32768 --expert-profile $S/expert-profile-q3km.txt --tail-skip 6";;
iq4xs) PORT=18093; ALIAS=qwen3.6-35b-a3b-ud-iq4_xs-3090; ENGINE=$F/build/bin/strata-poly; MODEL=$M/qwen36-mtp/Qwen3.6-35B-A3B-UD-IQ4_XS.gguf
ARGS="--model $MODEL --max-context 32768 --expert-profile $S/expert-profile-iq4xs.txt --tail-skip 6";;
*) echo "flash-next|q3km|iq4xs"; exit 2;;
esac
echo "$(date -u +%FT%TZ) start $1 port $PORT" >> $S/starts.log
ulimit -l unlimited 2>/dev/null; exec $F/build/bin/unbiased-strata --engine $ENGINE -m $MODEL --host 0.0.0.0 --port $PORT --alias $ALIAS --sse-ping-interval 10 -- $ARGS
@@ -0,0 +1,35 @@
== deepseek
0.00.117.944 I llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.
0.18.828.158 I engine info: batch_slots=0
0.18.828.170 I engine info: context=32768
0.18.828.171 I engine info: conversation_cache_mib=8192
0.18.828.172 I engine info: conversation_cache_min_free_mib=2560
0.18.828.172 I engine info: conversation_cache_slots=4
0.18.828.173 I engine info: engine=0.1.45
0.18.828.174 I engine info: expert_cache_mib=80036
0.18.828.175 I engine info: expert_slots=11008
0.18.828.175 I engine info: pool_workers=46
0.18.828.176 I engine info: vram_elastic=1
0.18.828.177 I engine info: vram_free_mib=91672
0.18.828.180 I engine ready: context 32768 tokens, model deepseek-v4-flash-ud-iq2_xxs-b200
== glm
0.00.158.841 I llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.
0.00.295.054 I validate_override: Using metadata override ( str) 'general.architecture' = 0.00.295.056 I llama
0.00.308.845 I llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.
0.00.619.338 I validate_override: Using metadata override ( str) 'general.architecture' = 0.00.619.339 I llama
0.22.873.625 I engine info: batch_slots=0
0.22.873.637 I engine info: context=32768
0.22.873.638 I engine info: conversation_cache_mib=8192
0.22.873.639 I engine info: conversation_cache_min_free_mib=2560
0.22.873.639 I engine info: conversation_cache_slots=4
0.22.873.640 I engine info: engine=0.1.45
0.22.873.641 I engine info: expert_cache_mib=102225
0.22.873.641 I engine info: expert_slots=12096
0.22.873.642 I engine info: pool_workers=46
0.22.873.642 I engine info: vram_elastic=1
0.22.873.643 I engine info: vram_free_mib=69514
0.22.873.646 I engine ready: context 32768 tokens, model glm-5.3-flash-3.0bit-b200
NVIDIA B200, 183359 MiB, 595.91.07
NVIDIA B200, 183359 MiB, 595.91.07
4650000 100000
Mem: 2015 584 405 111 1149 1431
@@ -0,0 +1,14 @@
#!/bin/bash
# start.sh <deepseek|glm> : fork front end + strata-poly, one card each (DeepSeek on GPU 0, GLM on GPU 1), as docs/DEEPSEEK.md
# and docs/GLM.md give the engine args, --pool-workers below the cgroup quota (46 cores).
set -u; FE_EXTRA=${FE_EXTRA:-}
F=/opt/us2-build; M=/opt/us2-models; S=/opt/us2-servers; cd $S
case $1 in
deepseek) GPU=0; PORT=18095; ALIAS=deepseek-v4-flash-ud-iq2_xxs-b200; MODEL=$M/deepseek/UD-IQ2_XXS/DeepSeek-V4-Flash-0731-UD-IQ2_XXS-00001-of-00003.gguf
ARGS="--model $MODEL --max-context 32768 --expert-profile $S/deepseek.profile --conversation-cache-mib 8192";;
glm) GPU=1; PORT=18096; ALIAS=glm-5.3-flash-3.0bit-b200; MODEL=$M/glm/GLM-5.3-Flash-GSQ-RCO-3.0bit-q4kattn.gguf
ARGS="--model $MODEL --max-context 32768 --expert-profile $S/glm.profile --conversation-cache-mib 8192";;
*) echo "deepseek|glm"; exit 2;;
esac
echo "$(date -u +%FT%TZ) start $1 gpu $GPU port $PORT" >> $S/starts.log
ulimit -l unlimited 2>/dev/null; exec env CUDA_VISIBLE_DEVICES=$GPU $F/build/bin/unbiased-strata --engine $F/build/bin/strata-poly -m $MODEL --host 0.0.0.0 --port $PORT --alias $ALIAS --sse-ping-interval 10 $FE_EXTRA -- $ARGS
+2
View File
@@ -14,6 +14,8 @@ with correct text, streaming, a tool call and reasoning, through `frontend/tests
| `Qwen3.6-35B-A3B-UD-IQ4_XS.gguf` (MTP draft block in the file; `/Volumes/models/qwen3.6/MTP/…-IQ4_XS-MTP.gguf` locally is a 1,067-byte LFS pointer, not the file) | `unsloth/Qwen3.6-35B-A3B-MTP-GGUF` @ `5bc3e238` | 18,209,036,576 | `df27a780435b7b45c2597536112ea3cb091f8544c3d0c3318d9f4258b31f7adf` | `strata-poly` | pod, A6000 VM | works (2026-10-17: A6000 `bench/unbiased/2026-10-17-a6000-qwen36-ud-iq4xs-mtp-step6/`, 207 to 215 tok/s decode on short prompts; RTX 3090 pod `…-3090pod-qwen36-ud-iq4xs-mtp-step6/`, 205 to 245 tok/s; pi completed a multi-step coding task against it on the A6000, `…-step7-pi/`); chosen as the local-use quant | **passed** (2026-10-18, A6000 VM, as the row above: 16 sequences, 2,972 steps): T2 passes on every set and arm, 0.59 to 1.35x; T1 fails at 2 of 2,672 positions in the base arm (`d4k` 249 inside a degenerate repetition loop where llama.cpp's own two runs are 0.3 to 1.3 nats apart, `r16k` 440 a near tie), 3 with drafting on; `--check-batch 4` passes on the short set |
| `Qwen3.6-35B-A3B-UD-IQ4_XS.gguf` (no draft block) | `unsloth/Qwen3.6-35B-A3B-GGUF` | 17,730,509,792 | `649d7508507b84638732c4f52c24c8b15843c6dca2f3ff793ae07c14a67ebbb3` | `strata-poly` | pod | on disk, untried: without the draft block the engine runs without speculation | not run |
| `Qwen3.6-35B-A3B-UD-Q3_K_M.gguf` (no draft block) | `unsloth/Qwen3.6-35B-A3B-GGUF` | 16,600,710,112 | `1b715841683f960bd9a49f008181bd910ee169b78d4cf465b6fde7f4d929ff99` | `strata-poly` | pod | on disk, untried; downloaded by mistake for the row above, kept to compare | not run |
| `DeepSeek-V4-Flash-0731-UD-IQ2_XXS-00001-of-00003.gguf` + `-00002-` + `-00003-of-00003.gguf` | `unsloth/DeepSeek-V4-Flash-0731-GGUF` @ `fbbb5b93` | 5,257,664 + 49,890,588,800 + 40,964,890,464 | `c58c9d62eac7b62e9578b52613f425e48313d7212ab8d1d76caed8ea8de26595`, `65a113df6d4469f16db6882b6919e153c464c3c78c833f5e1b41a33803cdbd52`, `a69102ddfaf4a84426e11fdb66716654f4260dc3a1de3ade9fd50e006b8691d3` | `strata-poly` | 2x B200 pod (one card, 91 GB of VRAM used at a 32K context) | works (2026-10-19, first start through the fork, `tools/pod/bringup.sh 100 big` files; docs/DEEPSEEK.md's run config as engine args, `--conversation-cache-mib 8192`): ready 32 s after start; 78 tok/s decode on short prompts, 94 tok/s prompt reading on a 22-token prompt, reasoning split into `reasoning_content` with thinking on; with `chat_template_kwargs.thinking=false` the content begins with a stray `</think>` (to look at); PLAN.md step 13 agent runs in `tools/acceptance/runs/` | not run (step 12 covered the 24 GB-class models) |
| `GLM-5.3-Flash-GSQ-RCO-3.0bit-q4kattn.gguf` (draft block in the file) | `neuralll/GLM-5.3-Flash-GSQ-RCO-3.0bit-Q4Kattn-GGUF` @ `7feedfeb` | 113,585,695,168 | `5f03b74ffe7513479795ca60a0fd8c40cbb3101769672b2c91b3df01138d9f6d` | `strata-poly` | 2x B200 pod (one card, 113 GB of VRAM used at a 32K context) | works after a fix (2026-10-19): the front end's vocabulary load refused the file's architecture name `glm5-next`, which llama.cpp does not know (USTRAT-6); the load is retried with the name overridden (vocabulary only), after which the server starts, the template renders (`[gMASK]<sop><|system|>Reasoning Effort: …`) and answers; 74 tok/s decode on a short prompt (5 of 11 drafts accepted), reasoning split with thinking on; PLAN.md step 13 agent runs in `tools/acceptance/runs/` | not run |
| `mmproj-F16.gguf` (Qwen3.6 vision projector, `qwen3vl_merger`, projection width 2048; on the VM at `/mnt/ds4/unbiased-strata/qwen36/`, on the pod at `/opt/us2-models/qwen36-mtp/`) | `unsloth/Qwen3.6-35B-A3B-MTP-GGUF` | 899,283,584 | `71f3cbc1f7cc0f30d09d41cfa924c0060827ebc33bf15ace7e86661e856f0160` | front end (`--mmproj`; the encoder runs in `unbiased-strata`, the engine takes the rows over `GENI`) | A6000 VM, pod | works (2026-10-18, A6000 VM with UD-IQ4_XS: `bench/unbiased/2026-10-18-a6000-qwen36-iq4xs-images-step8/`; six facts read off a 1920x1080 screenshot at the 300-row default, 15 s to encode on the VM's Ryzen 7 1700; CPU encoder only, see README "Known limits") | not in scope (the encoder is llama.cpp's own code in the front end) |
Rules: a file is added here when it is first downloaded for this fork, with its hash from the Hugging Face LFS object id
@@ -0,0 +1,77 @@
diff --git a/common/chat-auto-parser-generator.cpp b/common/chat-auto-parser-generator.cpp
index b78789d..bfd762c 100644
--- a/common/chat-auto-parser-generator.cpp
+++ b/common/chat-auto-parser-generator.cpp
@@ -391,22 +391,21 @@ common_peg_parser analyze_tools::build_tool_parser_tag_tagged(parser_build_conte
}
});
- // Build required arg sequence in definition order
- common_peg_parser args_seq = p.eps();
- for (size_t i = 0; i < required_parsers.size(); i++) {
- if (i > 0) {
- args_seq = args_seq + p.space();
- }
- args_seq = args_seq + required_parsers[i];
+ // UnbiasedStrata 2: every argument, required or optional, in any order. Upstream requires the required
+ // arguments in the schema's order, which holds when its sampler is constrained by this grammar; here the
+ // engine samples unconstrained and DeepSeek V4 Flash and GLM 5.3 Flash write `content` before `path` for a
+ // `write` tool that declares `path` first, so the finished, well-formed call failed to parse. A missing
+ // required argument is left for the client to report, as it is for optional-only tools.
+ common_peg_parser any_arg = p.choice();
+ for (const auto & req : required_parsers) {
+ any_arg |= req;
}
-
- // Build optional args with flexible ordering
- if (!optional_parsers.empty()) {
- common_peg_parser any_opt = p.choice();
- for (const auto & opt : optional_parsers) {
- any_opt |= opt;
- }
- args_seq = args_seq + p.repeat(p.space() + any_opt, 0, -1);
+ for (const auto & opt : optional_parsers) {
+ any_arg |= opt;
+ }
+ common_peg_parser args_seq = p.eps();
+ if (!required_parsers.empty() || !optional_parsers.empty()) {
+ args_seq = p.repeat(p.space() + any_arg, required_parsers.empty() ? 0 : 1, -1);
}
if (!arguments.start.empty()) {
diff --git a/common/parsers/deepseek.cpp b/common/parsers/deepseek.cpp
index 9ca4bb3..ae538f0 100644
--- a/common/parsers/deepseek.cpp
+++ b/common/parsers/deepseek.cpp
@@ -178,20 +178,18 @@ common_chat_params common_chat_params_init_deepseek_v3_2(const common_chat_templ
}
});
- common_peg_parser args_seq = p.eps();
- for (size_t i = 0; i < required_parsers.size(); i++) {
- if (i > 0) {
- args_seq = args_seq + p.space();
- }
- args_seq = args_seq + required_parsers[i];
+ // UnbiasedStrata 2: every argument in any order (see common/chat-auto-parser-generator.cpp for the reason:
+ // this engine samples unconstrained, and DeepSeek V4 Flash writes `content` before `path`).
+ common_peg_parser any_arg = p.choice();
+ for (const auto & req : required_parsers) {
+ any_arg |= req;
}
-
- if (!optional_parsers.empty()) {
- common_peg_parser any_opt = p.choice();
- for (const auto & opt : optional_parsers) {
- any_opt |= opt;
- }
- args_seq = args_seq + p.repeat(p.space() + any_opt, 0, -1);
+ for (const auto & opt : optional_parsers) {
+ any_arg |= opt;
+ }
+ common_peg_parser args_seq = p.eps();
+ if (!required_parsers.empty() || !optional_parsers.empty()) {
+ args_seq = p.repeat(p.space() + any_arg, required_parsers.empty() ? 0 : 1, -1);
}
common_peg_parser invoke_body = args_seq;
+13 -9
View File
@@ -20,15 +20,19 @@ case $TASK in
python3 -c "import json,sys; print(json.dumps({'pass': $rc==0, 'tests_untouched': sys.argv[1]==sys.argv[2], 'pytest': sys.argv[3].splitlines()[-1]}))" "$changed" "$orig" "$out"; exit $rc ;;
minesweeper)
[ -f "$WORK/index.html" ] || { echo '{"pass": false, "why": "no index.html"}'; exit 1; }
export PATH="$HOME/.bun/bin:$PATH"; B="bun run $HOME/Code/lookingglass/src/cli.ts"
export PATH="$HOME/.bun/bin:$PATH"; lg() { bun run "$HOME/Code/lookingglass/src/cli.ts" "$@"; }
# one browser: campaigns on different servers may judge at the same moment
LOCK=/tmp/us2-judge-browser.lock; n=0; until mkdir "$LOCK" 2>/dev/null; do sleep 2; n=$((n+1)); [ $n -gt 300 ] && { rmdir "$LOCK"; }; done; trap 'rmdir "$LOCK" 2>/dev/null' EXIT
$B console --clear > /dev/null 2>&1; $B goto "file://$WORK/index.html" > /dev/null 2>&1
cells=$($B js "document.querySelectorAll('.cell').length" 2>/dev/null | tr -dc 0-9)
revealed=$($B js "var c=document.querySelector('.cell[data-row=\"4\"][data-col=\"4\"]'); if(c){c.click();} document.querySelectorAll('.cell.revealed').length" 2>/dev/null | tr -dc 0-9)
errs=$($B console --errors 2>/dev/null | grep -c -i "error")
$B screenshot "$WORK/../judge-screenshot.png" > /dev/null 2>&1
pass=false; [ "${cells:-0}" -ge 81 ] && [ "${revealed:-0}" -ge 1 ] && [ "${errs:-1}" -eq 0 ] && pass=true
echo "{\"pass\": $pass, \"cells\": ${cells:-0}, \"revealed_after_click\": ${revealed:-0}, \"console_errors\": ${errs:-1}}"; [ $pass = true ] ;;
LOCK=/tmp/us2-judge-browser.lock; n=0; until mkdir "$LOCK" 2>/dev/null; do sleep 2; n=$((n+1)); [ $n -gt 300 ] && { rmdir "$LOCK"; }; done
# the browser refuses file: URLs, so the work dir is served over HTTP for the duration
PORT=$(python3 -c 'import socket; s=socket.socket(); s.bind(("127.0.0.1",0)); print(s.getsockname()[1])')
(cd "$WORK" && python3 -m http.server --bind 127.0.0.1 "$PORT" > /dev/null 2>&1) & HTTP=$!
trap 'kill $HTTP 2>/dev/null; rmdir "$LOCK" 2>/dev/null' EXIT; sleep 1
lg console --clear > /dev/null 2>&1; lg goto "http://127.0.0.1:$PORT/index.html" > /dev/null 2>&1; sleep 1
cells=$(lg js "document.querySelectorAll('.cell').length" 2>/dev/null | tr -dc 0-9)
revealed=$(lg js "var c=document.querySelector('.cell[data-row=\"4\"][data-col=\"4\"]'); if(c){c.click();} document.querySelectorAll('.cell.revealed').length" 2>/dev/null | tr -dc 0-9)
errlines=$(lg console --errors 2>/dev/null | grep -v -i "no console errors" | grep -c .)
lg screenshot "$WORK/../judge-screenshot.png" > /dev/null 2>&1
pass=false; [ "${cells:-0}" -ge 81 ] && [ "${revealed:-0}" -ge 1 ] && [ "${errlines:-1}" -eq 0 ] && pass=true
echo "{\"pass\": $pass, \"cells\": ${cells:-0}, \"revealed_after_click\": ${revealed:-0}, \"console_errors\": ${errlines:-1}}"; [ $pass = true ] ;;
*) echo '{"pass": false, "why": "unknown task"}'; exit 1 ;;
esac
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
# rejudge.sh <run-dir>... : run judge.sh again on finished runs (after a judge fix) and update judge.json + meta.json.
set -u; HERE=$(cd "$(dirname "$0")" && pwd)
for RUN in "$@"; do
task=$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1]))["task"])' "$RUN/meta.json")
"$HERE/judge.sh" "$task" "$RUN/work" > "$RUN/judge.json" 2> "$RUN/judge.err"; jrc=$?
python3 - "$RUN" "$jrc" <<'PY'
import json, sys, pathlib
run, jrc = pathlib.Path(sys.argv[1]), int(sys.argv[2]); meta = json.loads((run / "meta.json").read_text())
try: judge = json.loads((run / "judge.json").read_text().strip().splitlines()[-1])
except Exception: judge = {"pass": False, "why": "judge output unreadable"}
meta["judge"], meta["judge_exit"] = judge, jrc; (run / "meta.json").write_text(json.dumps(meta, indent=1))
print(run.name, json.dumps(judge))
PY
done
+10 -2
View File
@@ -20,7 +20,7 @@ import json, sys, pathlib
d, served, port, temp, topk, topp, seed = sys.argv[1:]; d = pathlib.Path(d)
(d / "models.json").write_text(json.dumps({"providers": {"UnbiasedStrata 2": {
"baseUrl": f"http://host.docker.internal:{port}/v1", "api": "openai-completions", "apiKey": "local",
"models": [{"id": served, "name": served, "reasoning": True, "input": ["text"], "contextWindow": 32768, "maxTokens": 8192,
"models": [{"id": served, "name": served, "reasoning": True, "input": ["text"], "contextWindow": 32768, "maxTokens": 24576,
"cost": {"input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0},
"samplingParams": {"temperature": float(temp), "top_k": int(topk), "top_p": float(topp), "min_p": 0, "presence_penalty": 0, "repeat_penalty": 1, "seed": int(seed)},
"compat": {"supportsStore": False, "supportsDeveloperRole": False, "supportsReasoningEffort": True, "maxTokensField": "max_tokens", "requiresReasoningContentOnAssistantMessages": True}}]}}}, indent=1))
@@ -44,9 +44,17 @@ if command -v tmux > /dev/null; then
tmux has-session -t $TMUX_SESSION 2> /dev/null || tmux new-session -d -s $TMUX_SESSION -n hub "echo 'us2 acceptance runs; one window per run'; bash"
tmux new-window -d -t $TMUX_SESSION -n "$(echo "$MODEL" | cut -c1-14)/$TASK" "docker logs -f $NAME 2>&1 | python3 $HERE/pretty.py; echo; echo '[container exited] run dir $RUN'; bash"
fi
# watchdog: a tool call that runs more than TOOL_CAP_S (default 300 s) is killed inside the container, as a person at the
# terminal would do; pi then sees the tool fail and goes on. Logged to harness-notes.txt.
TOOL_CAP_S=${TOOL_CAP_S:-300}
( while docker inspect -f '{{.State.Running}}' "$NAME" 2>/dev/null | grep -q true; do
docker exec "$NAME" sh -c "ps -eo pid=,etimes=,comm= | awk '\$1>1 && \$2>$TOOL_CAP_S && \$3!=\"ps\" && \$3!=\"sh\" && \$3!=\"awk\" {print \$1, \$2, \$3}'" 2>/dev/null | while read -r pid et comm; do
[ -n "$pid" ] && { docker exec "$NAME" kill -9 "$pid" 2>/dev/null; echo "$(date -u +%FT%TZ) watchdog killed pid $pid ($comm) after ${et}s" >> "$RUN/harness-notes.txt"; }
done; sleep 30; done ) &
WATCHDOG=$!
# wait, with a wall-clock cap
rc=$(timeout "$TIMEOUT_S" docker wait "$NAME" 2>/dev/null); [ -n "$rc" ] || { docker kill "$NAME" > /dev/null 2>&1; rc=124; echo "TIMEOUT after ${TIMEOUT_S}s" >&2; }
END=$(date +%s)
END=$(date +%s); kill $WATCHDOG 2>/dev/null
docker logs "$NAME" > "$RUN/pi.jsonl" 2> "$RUN/pi.log"; docker rm "$NAME" > /dev/null 2>&1
curl -s -m 5 "http://127.0.0.1:$PORT/props" > "$RUN/server-after.json" 2>/dev/null || true
# judge
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env python3
"""summarize.py [runs-dir] -> a Markdown table of every run's meta.json (one row per run, newest last), and a per-model
pass count. Used for the step-13 write-up."""
import json, sys, pathlib
runs = pathlib.Path(sys.argv[1] if len(sys.argv) > 1 else pathlib.Path(__file__).parent / "runs")
rows = []
for d in sorted(runs.iterdir()):
m = d / "meta.json"
if not m.exists(): continue
j = json.loads(m.read_text()); j["run"] = d.name; j["notes"] = (d / "harness-notes.txt").read_text().strip().replace("\n", "; ") if (d / "harness-notes.txt").exists() else ""
rows.append(j)
print("| Run | Model | Task | T | Pass | Wall s | Turns | Tool calls | In tok | Out tok | Errors | Judge | Harness notes |")
print("| --- | --- | --- | ---: | --- | ---: | ---: | ---: | ---: | ---: | ---: | --- | --- |")
for j in rows:
judge = {k: v for k, v in j["judge"].items() if k != "pass"}
print(f"| `{j['run']}` | {j['model']} | {j['task']} | {j['temperature']} | {'**pass**' if j['judge'].get('pass') else 'fail'} | {j['wall_s']} | {j['assistant_turns']} | {j['tool_calls']} | {j['input_tokens']} | {j['output_tokens']} | {len(j['errors'])} | {json.dumps(judge)[:120].replace('|', '/')} | {j['notes'][:160]} |")
print()
by = {}
for j in rows: by.setdefault(j["model"], []).append(j)
print("| Model | Runs | Passed | Tasks passed |"); print("| --- | ---: | ---: | --- |")
for m, js in by.items():
print(f"| {m} | {len(js)} | {sum(1 for j in js if j['judge'].get('pass'))} | {', '.join(sorted({j['task'] + ('@' + str(j['temperature']) if j['temperature'] != 0.6 else '') for j in js if j['judge'].get('pass')}))} |")
+1 -1
View File
@@ -29,7 +29,7 @@ wait
echo "downloads and builds finished $(date -u +%FT%TZ)"; tail -n 1 dl-*.log
# --- Flash-Next pack and MTP draft directory (upstream's tools, as its installer runs them) ---
SH1=$M/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf
( cd $F && python3 tools/iq_pack.py --gguf $SH1 --out $M/pack-iq3-xxs > $B/pack.log 2>&1 && echo "pack ok" || echo "pack FAILED (pack.log)" ) &
( cd $F && python3 tools/iq_pack.py --gguf $SH1 --out $M/pack-iq3-xxs > $B/pack.log 2>&1 && cp data/expert-profile.bin $M/pack-iq3-xxs/expert-profile.bin && echo "pack ok" || echo "pack FAILED (pack.log)" ) & # the shipped expert ranking, as the installer places it; the engine exits without it
( cd $F && STRATA_SOURCE=huggingface python3 tools/mtp_fetch.py fetch --out $M/mtp-src > $B/mtp.log 2>&1 \
&& python3 tools/mtp_pack.py --src $M/mtp-src --experts q2_0 --out $M/mtp-src/mtp-q2_0.gguf >> $B/mtp.log 2>&1 \
&& python3 tools/mtp_rt.py --gguf $M/mtp-src/mtp-q2_0.gguf --out $M/mtp >> $B/mtp.log 2>&1 \