Gemma 4 26B-A4B head-to-head vs Qwen (4 prompts, via grade_run.py API)

Ran via tools/grade_run.py against LM Studio (no clipboard). Results:
  TTS:        80 Minor Flaws  PASSES (real N-worker concurrency) <- Qwen 49, didn't parse
  Rust:       72 Minor Flaws  COMPILES CLEAN (0 errs w/ deps)     <- Qwen 50, 7 real errors
  Webhook:    55 Critical     uses forbidden aiohttp (won't run)  <- Qwen 75, passed
  Automation: 48 Critical     SyntaxError (global-after-assign)   <- first run for both

DECISIVE head-to-head: Gemma generalizes where Qwen fails (TTS, Rust),
but Qwen beats it on stdlib-discipline prompts (webhook). The two are
COMPLEMENTARY local offloads, not redundant.

Fixed: grade_run.py extractor (markdown/prose wrapping, multi-fence lang
selection), TTFT-null handling in generator. TTFT capture from LM Studio
API still needs the right stats key (left null + noted).

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-07-28 18:42:58 -07:00
co-authored by Claude
parent b82c665ec6
commit b9f45a7c46
7 changed files with 1310 additions and 8 deletions
+19 -7
View File
@@ -109,16 +109,28 @@ def main():
if tok_sec is None and comp_tokens and wall:
tok_sec = round(comp_tokens / wall, 2)
# save the raw output
# save the raw output — extract the code block if the model wrapped it in
# markdown fences or surrounded it with prose. Handles: (a) complete fenced
# block, (b) prose preamble + fence, (c) bare code + trailing stray fence/prose.
out_path = os.path.join(HERE, "outputs", f"{args.name}.{ext}")
os.makedirs(os.path.dirname(out_path), exist_ok=True)
# strip common markdown fences if present
import re as _re
text = content.strip()
if text.startswith("```"):
lines = text.split("\n")
if lines[0].startswith("```"): lines = lines[1:]
if lines and lines[-1].strip() == "```": lines = lines[:-1]
text = "\n".join(lines)
pairs = list(_re.finditer(r"```(?:[a-zA-Z0-9_+-]*)?\n(.*?)```", text, _re.S))
if pairs:
text = pairs[0].group(1).strip()
else:
out, started = [], False
for l in text.split("\n"):
if l.strip().startswith("```"):
break # stray fence ends the code
if not started and _re.match(r"^\s*(#!|import |from |async |def |class |use |pub )", l):
started = True
if started:
if _re.match(r"^\s*(- |\* |\d+\. |> |# )", l) and not _re.match(r"^\s*(import |from |def |class |async |return |if |for |while |try|except|with )", l):
break # trailing markdown prose
out.append(l)
text = "\n".join(out).strip() if out else text
open(out_path, "w").write(text)
print(f"✓ saved {len(text)} bytes -> {os.path.relpath(out_path, HERE)}")