Research Question: RQ-model-quality-oc
How do five models reachable via the OpenCode harness (Opus 4.7 via Portkey + four non-Anthropic models from the Portkey catalog) differ in code quality and TDD discipline on game-of-life-example-mapping with the exact-single-context-v2-testlist-fix-oc workflow?
game-of-life-example-mapping
| n, run dates | Code quality | Size | Correctness | TDD discipline | Cost | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | |
| model: opus-4-7-portkeyn = 5, 2026-05-25 | 160 ยฑ 15.18 | 11.4 ยฑ 4.83 ๐ | 8.03 ยฑ 3.07 ๐ | 7.60 ยฑ 2.30 ๐ | 2.91 ยฑ 1.00 ๐ | 18.6 ยฑ 3.58 ๐ | 7.59 ยฑ 1.76 ๐ | 3.30 ยฑ 0.97 ๐ | 3.60 ยฑ 1.14 ๐ | 38.2 ยฑ 4.02 | 9.40 ยฑ 0.55 | 100% ยฑ 0 ๐ | 100%5/5 | 4.80 ยฑ 3.70 | 4.80 ยฑ 3.70 | 3.9 ยฑ 0.5 min | 1.8M ยฑ 732k ๐ | $1.84 ยฑ 0.57 |
| model: kimi-k2-6n = 5, 2026-05-25 | 111 ยฑ 95.22 | 9.40 ยฑ 8.23 | 8.40 ยฑ 6.80 | 7.60 ยฑ 4.28 | 4.85 ยฑ 3.00 | 15.2 ยฑ 12.66 | 9.90 ยฑ 6.09 | 8.30 ยฑ 6.44 | 4.40 ยฑ 2.88 | 22.4 ยฑ 19.81 | 7.00 ยฑ 2.74 | 57% ยฑ 40 | 100%5/5 | 2.00 ยฑ 4.47 | 2.00 ยฑ 4.47 | 18.1 ยฑ 7.4 min | 2.3M ยฑ 1.3M | $1.00 ยฑ 0.53 |
| model: glm-5-1n = 5, 2026-05-25 | 193 ยฑ 25.95 | 11.6 ยฑ 4.72 ๐ | 7.80 ยฑ 2.93 ๐ | 7.00 ยฑ 1.41 ๐ | 3.39 ยฑ 1.10 ๐ | 19.8 ยฑ 9.09 ๐ | 10.0 ยฑ 3.06 ๐ | 8.50 ยฑ 1.73 | 2.80 ยฑ 2.68 ๐ | 46.4 ยฑ 6.07 | 9.80 ยฑ 0.84 | 100% ยฑ 0 ๐ | 100%5/5 | 4.40 ยฑ 2.19 | 4.40 ยฑ 2.19 | 13.9 ยฑ 2.9 min | 3.0M ยฑ 581k | $4.13 ยฑ 0.82 |
| model: gemini-3-5-flashn = 5, 2026-05-25 | 200 ยฑ 36.02 | 16.0 ยฑ 4.69 ๐ | 14.1 ยฑ 4.97 | 10.4 ยฑ 2.19 | 6.00 ยฑ 1.66 | 18.6 ยฑ 12.88 ๐ | 15.6 ยฑ 14.00 ๐ | 14.9 ยฑ 14.32 ๐ | 4.00 ยฑ 2.24 ๐ | 52.2 ยฑ 10.45 | 8.40 ยฑ 0.55 | 100% ยฑ 0 ๐ | 100%5/5 | 0.40 ยฑ 0.89 | 0.40 ยฑ 0.89 | 2.6 ยฑ 0.5 min ๐ | 2.8M ยฑ 616k | $0.32 ยฑ 0.06 ๐ |
| model: deepseek-v4-flashn = 5, 2026-05-27 | 189 ยฑ 33.38 | 13.2 ยฑ 3.70 ๐ | 8.78 ยฑ 3.47 ๐ | 9.40 ยฑ 0.89 | 3.99 ยฑ 0.36 | 27.6 ยฑ 3.44 | 13.1 ยฑ 2.24 | 9.80 ยฑ 3.95 | 4.00 ยฑ 1.58 ๐ | 44.8 ยฑ 4.21 | 9.20 ยฑ 0.45 | 100% ยฑ 0 ๐ | 100%5/5 | 1.40 ยฑ 1.34 | 1.40 ยฑ 1.34 | 10.2 ยฑ 1.0 min | 2.7M ยฑ 742k | n/c |
| model: deepseek-v4-pron = 4 of 5, 2026-05-28 | 138 ยฑ 8.12 ๐ | 13.0 ยฑ 4.62 ๐ | 12.0 ยฑ 6.00 ๐ | 9.50 ยฑ 1.73 | 3.35 ยฑ 0.41 ๐ | 16.5 ยฑ 9.88 ๐ | 9.66 ยฑ 8.24 ๐ | 6.50 ยฑ 9.68 ๐ | 3.00 ยฑ 1.15 ๐ | 28.3 ยฑ 0.50 | 8.75 ยฑ 2.22 | 100% ยฑ 0 ๐ | 100%4/4 | 6.00 ยฑ 4.24 | 6.75 ยฑ 4.35 | 19.6 ยฑ 4.2 min | 3.0M ยฑ 656k | $1.49 ยฑ 0.35 |
Runs behind this table
- 2026-05-25_20-01-05_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_opus-4-7-portkey
- 2026-05-25_20-01-05_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_opus-4-7-portkey-2
- 2026-05-25_20-01-05_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_opus-4-7-portkey-3
- 2026-05-25_20-01-05_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_opus-4-7-portkey-4
- 2026-05-25_20-04-55_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_opus-4-7-portkey
- 2026-05-25_20-05-06_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_kimi-k2-6
- 2026-05-25_20-05-23_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_kimi-k2-6
- 2026-05-25_20-06-03_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_kimi-k2-6
- 2026-05-25_20-08-32_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_kimi-k2-6
- 2026-05-25_20-20-40_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_glm-5-1
- 2026-05-25_20-20-40_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_glm-5-1-2
- 2026-05-25_20-22-55_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_glm-5-1
- 2026-05-25_20-34-46_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_gemini-3-5-flash
- 2026-05-25_20-36-59_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_kimi-k2-6
- 2026-05-25_20-37-30_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_gemini-3-5-flash
- 2026-05-25_20-38-07_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_gemini-3-5-flash
- 2026-05-25_20-38-37_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_glm-5-1
- 2026-05-25_20-52-37_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_glm-5-1
- 2026-05-25_20-53-11_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_gemini-3-5-flash
- 2026-05-25_21-02-31_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_gemini-3-5-flash
- 2026-05-27_23-02-48_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_deepseek-v4-flash
- 2026-05-27_23-12-35_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_deepseek-v4-flash
- 2026-05-27_23-24-13_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_deepseek-v4-flash
- 2026-05-27_23-33-31_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_deepseek-v4-flash
- 2026-05-27_23-44-43_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_deepseek-v4-flash
- 2026-05-28_01-55-37_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_deepseek-v4-pro
- 2026-05-28_02-18-00_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_deepseek-v4-pro
- 2026-05-28_02-32-31_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_deepseek-v4-pro
- 2026-05-28_02-56-26_game-of-life-example-mapping_v5.1-testlist-scope-fix-oc_deepseek-v4-pro
Findings
RQ-model-quality-oc โ Findings
Setup: game-of-life-example-mapping ร exact-single-context-v2-testlist-fix-oc ร n=5 per cell (30 runs total, 29 without timeout). As of 2026-05-28.
Overview
Code quality as primary outcome (lower = better except where noted); correctness (verification_pct, higher = better) as gating precondition.
| Metric | Direction | opus-4-7-portkey | glm-5-1 | gemini-3-5-flash | kimi-k2-6 | deepseek-v4-flash | deepseek-v4-pro |
|---|---|---|---|---|---|---|---|
verification_pct (mean) |
higher | 1.00 ๐ | 1.00 ๐ | 1.00 ๐ | 0.57 | 1.00 ๐ | 0.85 |
verification_pct (std) |
lower | 0.00 ๐ | 0.00 ๐ | 0.00 ๐ | 0.40 | 0.00 ๐ | 0.33 |
tests_passing (rate) |
higher | 100% ๐ | 100% ๐ | 100% ๐ | 100% ๐ | 100% ๐ | 80% |
completed_within_budget (rate) |
higher | 100% ๐ | 100% ๐ | 100% ๐ | 100% ๐ | 100% ๐ | 80% |
smell_total (mean) |
lower | 3.6 | 2.8 ๐ | 4.0 | 4.4 | 4.0 | 4.2 |
cognitive_max (mean) |
lower | 11.4 ๐ | 11.6 ๐ | 16.0 | 9.4 | 13.2 | 11.4 |
cognitive_avg (mean) |
lower | 8.03 ๐ | 7.8 ๐ | 14.07 | 8.4 | 8.78 | 10.6 |
mccabe_max (mean) |
lower | 7.6 | 7.0 ๐ | 10.4 | 7.6 | 9.4 | 8.6 |
mccabe_avg (mean) |
lower | 2.91 ๐ | 3.39 | 6.0 | 4.85 | 3.99 | 3.28 |
longest_function (mean) |
lower | 18.6 ๐ | 19.8 | 18.6 ๐ | 15.2 | 27.6 | 15.0 |
avg_loc_per_function (mean) |
lower | 7.59 ๐ | 10.05 | 15.63 | 9.9 | 13.10 | 9.53 |
median_loc_per_function (mean) |
lower | 3.3 ๐ | 8.5 | 14.9 | 8.3 | 9.8 | 7.0 |
lines_of_code (mean) |
lower (at equal correctness) | 38.2 ๐ | 46.4 | 52.2 | 22.4 | 44.8 | 24.6 |
tests_total (mean) |
higher | 9.4 ๐ | 9.8 ๐ | 8.4 | 7.0 | 9.2 ๐ | 8.6 |
cycle_count (mean) |
โ | 3.0 | 2.2 | 7.0 | 5.0 | 5.4 | 7.6 |
refactorings_applied (mean) |
โ | 1.6 | 2.4 | 3.6 | 3.4 | 4.8 | 4.6 |
predictions_total (mean) |
higher (skill compliance) | 4.8 ๐ | 4.4 | 0.4 | 2.0 | 1.4 | 6.2 ๐ |
duration_seconds (mean) |
lower | 231 | 835 | 153 ๐ | 1083 | 612 | 2381 |
total_tokens (mean) |
lower | 1.82 M ๐ | 2.96 M | 2.80 M | 2.28 M | 2.71 M | 2.82 M |
cost_usd (mean, $/run) |
lower (at equal correctness) | $1.84 | $0.74 | $1.06 | $1.06 | $0.10 ๐ | $0.37 |
cost_usd (mean, $/perfect-run) |
lower | $1.84 | $0.74 | $1.06 | $2.65 | $0.10 ๐ | $0.46 |
Trophy rule on correctness gating: Trophies for quality/efficiency metrics go only to models with verification_pct = 1.0. Kimi-K2 drops out of the pool at 0.57 mean (3 of 5 runs below 0.5) โ its low cognitive_max (9.4), low lines_of_code (22.4) and short functions are partly stub artifacts (too few tests). DeepSeek-V4-Pro narrowly drops out of the pool at 0.85 โ 4/5 runs are perfect, but 1 run timed out at 0.27 verification, so its low code_mass (124) and lines_of_code (24.6) do not count as clean winners. cycle_count and refactorings_applied are ambivalent (more cycles โ better, depending on skill compliance) โ no trophy. predictions_total is exceptionally noted with a direction here: it measures compliance with the single-context-v2 skill format.
cognitive_max, cognitive_avg and longest_function: Opus and GLM are separated by less than 1 ฯ โ spread rule โ both ๐. At longest_function Flash is exactly level with Opus (18.6) โ third ๐.
Cost calculation: per run from transcript-metrics.json.total_tokens ร pricing per 1M tokens. Sources 2026-05-28: Anthropic pricing page (Opus), OpenRouter API (GLM/Kimi/DeepSeek), Vertex Standard (Gemini Flash). reasoning tokens are billed at the output rate. DeepSeek cache read is not explicitly stated on OpenRouter; conservative estimate 25 % of the input price.
| Model | input | output | cache_read |
|---|---|---|---|
| opus-4-7 (via Vertex EU) | $5.00 | $25.00 | $0.50 (10%) |
| glm-5-1 (OpenRouter) | $0.98 | $3.08 | $0.18 |
| kimi-k2-6 (OpenRouter) | $0.73 | $3.49 | $0.37 |
| gemini-3-5-flash (Vertex Standard) | $1.50 | $9.00 | $0.15 |
| deepseek-v4-flash (OpenRouter) | $0.10 | $0.20 | $0.025 (25%) |
| deepseek-v4-pro (OpenRouter) | $0.44 | $0.87 | $0.11 (25%) |
Portkey gateway markup not included.
Cost breakdown per mean run (tokens as mean over n=5):
| Model | input โ cost | output (+reasoning) โ cost | cache_read โ cost | total |
|---|---|---|---|---|
| opus-4-7-portkey | 116 k ร $5.00 = $0.58 | 16.9 k ร $25.00 = $0.42 | 1.68 M ร $0.50 = $0.84 | $1.84 |
| glm-5-1 | 144 k ร $0.98 = $0.14 | 30.9 k ร $3.08 = $0.10 | 2.79 M ร $0.18 = $0.50 | $0.74 |
| kimi-k2-6 | 371 k ร $0.73 = $0.27 | 27.7 k ร $3.49 = $0.10 | 1.88 M ร $0.37 = $0.70 | $1.06 |
| gemini-3-5-flash | 400 k ร $1.50 = $0.60 | 11.2 k ร $9.00 = $0.10 | 2.39 M ร $0.15 = $0.36 | $1.06 |
| deepseek-v4-flash | 299 k ร $0.10 = $0.03 | 30.5 k ร $0.20 = $0.01 | 2.38 M ร $0.025 = $0.06 | $0.10 |
| deepseek-v4-pro | 110 k ร $0.44 = $0.05 | 32.9 k ร $0.87 = $0.03 | 2.68 M ร $0.11 = $0.29 | $0.37 |
$/perfect-run scales with the share of runs with verification_pct = 1.0: Kimi $1.06/run ร (5/2 verified) = $2.65 per correct solution. DeepSeek-V4-Pro $0.37/run ร (5/4 verified) = $0.46. Other models 5/5 verified โ unchanged.
F-1.1 โ Opus 4.7 writes the most compact implementation
Opus delivers the shortest solution across all code-volume and function-size metrics (LoC, code_mass, avg/median_loc_per_function) at full external correctness and at the same time has the lowest token consumption (1.82 M vs 2.28โ2.96 M for the other models with verification_pct = 1.0).
| Model | lines_of_code | avg_loc_per_function | median_loc_per_function | total_tokens |
|---|---|---|---|---|
| opus-4-7-portkey | 38.2 ๐ | 7.59 ๐ | 3.3 ๐ | 1.82 M ๐ |
| glm-5-1 | 46.4 | 10.05 | 8.5 | 2.96 M |
| gemini-3-5-flash | 52.2 | 15.63 | 14.9 | 2.80 M |
| deepseek-v4-flash | 44.8 | 13.10 | 9.8 | 2.71 M |
| kimi-k2-6* | 22.4 | 9.9 | 8.3 | 2.28 M |
| deepseek-v4-pro* | 24.6 | 9.53 | 7.0 | 2.82 M |
* not trophy-eligible (verification_pct < 1.0).
The median LoC/function of 3.3 (vs 7.0โ14.9 for the others) means: Opus consistently extracts small helpers. At avg_loc_per_function Opus, at 7.59, is about half the size of Gemini Flash (15.63) and 40 % more compact than DeepSeek-V4-Flash (13.10).
F-1.2 โ GLM 5.1 holds the Opus level in complexity
GLM 5.1 reaches values equal to or better than Opus 4.7 across smell_total, cognitive_* and mccabe_max. Both clearly beat Gemini Flash and DeepSeek-V4-Flash (cognitive-max spread 1.6โ4.4 points).
| Metric | opus-4-7-portkey | glm-5-1 | gemini-3-5-flash | deepseek-v4-flash |
|---|---|---|---|---|
| smell_total | 3.6 | 2.8 ๐ | 4.0 | 4.0 |
| cognitive_max | 11.4 ๐ | 11.6 ๐ | 16.0 | 13.2 |
| cognitive_avg | 8.03 ๐ | 7.8 ๐ | 14.07 | 8.78 |
| mccabe_max | 7.6 | 7.0 ๐ | 10.4 | 9.4 |
| mccabe_avg | 2.91 ๐ | 3.39 | 6.0 | 3.99 |
GLM 5.1 thereby confirms here too (game-of-life) the impression from RQ-model-novel-oc (claim-office): near-Opus quality at OpenRouter prices. In code volume, however, Opus is clearly more compact (F-1.1).
F-1.3 โ Kimi-K2 writes too few tests, fails external verification
5/5 Kimi runs report tests_passing=true, but only 2/5 reach verification_pct = 1.0 (the rest: 0.20, 0.27, 0.40). Mean tests_total is the lowest at 7.0 (vs Opus 9.4, GLM 9.8, Flash 8.4, deepseek-flash 9.2) with the highest spread (std 2.74, range 4โ9).
Pattern: Kimi minimizes the test list and then implements only what its own reduced suite demands โ the internal vitest runs green, but the external game-of-life-verification suite uncovers cases Kimi never tested in the first place. This is exactly the pattern claim-office-verification was originally built against: internally green tests are no proof of correctness.
| Run | verification_pct | tests_total |
|---|---|---|
| 1 | 1.00 | 9 |
| 2 | 1.00 | 9 |
| 3 | 0.40 | 7 |
| 4 | 0.27 | 6 |
| 5 | 0.20 | 4 |
F-1.4 โ Gemini 3.5 Flash: fast, but the most complex code
At 153 s/run Flash is by far the fastest (Opus 231 s, deepseek-flash 612 s, GLM 835 s, Kimi 1083 s, deepseek-pro 2381 s) and reaches full correctness, but writes the most complex code: highest cognitive_max (16), cognitive_avg (14.07), mccabe_max (10.4), mccabe_avg (6.0) and the longest functions on average (avg_loc_per_function 15.63 vs Opus 7.59). Trade-off: speed against maintainability.
F-1.5 โ Skill-tool compliance is model-dependent
v5.1-oc requires prediction markers per red phase. Across the six models four different compliance profiles emerge:
| Model | predictions_total (mean) | predictions_correct (mean) | Compliance profile |
|---|---|---|---|
| deepseek-v4-pro | 6.2 ๐ | 5.6 (90%) | Consistent, format-faithful |
| opus-4-7-portkey | 4.8 ๐ | 4.8 (100%) | Consistent, format-faithful |
| glm-5-1 | 4.4 | 4.4 (100%) | Consistent, format-faithful |
| kimi-k2-6 | 2.0 | 2.0 (100%) | Partial, drifts into inline mode |
| deepseek-v4-flash | 1.4 | 1.4 (100%) | Partial, drifts into inline mode |
| gemini-3-5-flash | 0.4 | 0.4 (100%) | Ignores the format almost entirely |
Where predictions are written, they are nearly 100 % correct โ i.e. the marker drop is not an accuracy problem, but a question of format compliance. Confirms H3 from the RQ README: a low cycle_count (Flash 7.0) with a low predictions_total (0.4) is not "weak TDD discipline", but a failure to recognize the skill format. At the same time deepseek-v4-pro shows the highest skill compliance with 6.2 predictions_total โ and also the highest cycle_count (7.6).
F-1.6 โ DeepSeek-V4-Flash: cheapest path to the correct solution
DeepSeek-V4-Flash reaches full external correctness (5/5 perfect, std 0.00) at a per-run cost of ~$0.10 โ an order of magnitude below the next-cheapest models (GLM-5.1 $0.74, deepseek-v4-pro $0.37, gemini-flash and kimi $1.06). At tests_total (9.2) and mccabe_avg (3.99) it sits mid-field, in code size (LoC 44.8, code_mass 189) at the upper end โ the trade-off is clear: cheap + correct vs compact.
| Model | $/perfect-run | duration | LoC | cognitive_max |
|---|---|---|---|---|
| deepseek-v4-flash | $0.10 ๐ | 612 s | 44.8 | 13.2 |
| glm-5-1 | $0.74 | 835 s | 46.4 | 11.6 ๐ |
| gemini-3-5-flash | $1.06 | 153 s ๐ | 52.2 | 16.0 |
| opus-4-7-portkey | $1.84 | 231 s | 38.2 ๐ | 11.4 ๐ |
For pure correctness without a complexity requirement, Flash is 18ร cheaper than Opus here. The code-volume premium (44.8 vs 38.2 LoC) is small.
F-1.7 โ DeepSeek-V4-Pro: skill-compliance champion, but tail risk in duration
With predictions_total = 6.2 and cycle_count = 7.6, DeepSeek-V4-Pro produces the most structured TDD chain of all models โ beyond Opus (4.8) and GLM (4.4). Prediction accuracy stays high at 90 % (5.6/6.2).
BUT: 1 of 5 runs hit the 7202 s container timeout (verification_pct = 0.27, tests_passing = false); the mean duration is the highest of all models at 2381 s and extremely variable at std=2704 s (range 854โ7202 s). The other 4 runs are stable at ~1100 s with perfect verification.
| Run | duration_s | verification_pct | predictions_total | cycle_count |
|---|---|---|---|---|
| 1 (timeout) | 7202 | 0.27 | 3 | 6 |
| 2 | 1326 | 1.00 | 6 | 7 |
| 3 | 854 | 1.00 | 5 | 8 |
| 4 | 1417 | 1.00 | 7 | 8 |
| 5 | 1107 | 1.00 | 11 | 9 |
The finding parallels the skill-loop issue documented for Gemini 2.5 Pro in the RQ README, but in milder form (4/5 instead of 0/3 successes). For production use Pro needs auto-recovery mechanics or a shorter timeout โ in the lab setting the completed_within_budget = 80 % signal is sufficient.