Best AI for coding / head-to-head
GLM 5.2 vs GPT-5.6 Solfor coding
GPT-5.6 Sol wins, 93–92
Same 18 coding tasks, marked blind by three rival labs. GPT-5.6 Sol took 6 tasks, GLM 5.2 took 5, 7 tied. Tested 16 Aug 2026.
Where they differed most
Write a Python function parse_duration(s) that converts strings like '1h30m', '45s', '2h', '90m', '1h2m3s' into total seconds. Raise ValueError on anything malformed. Include three assert-based tests, one of which covers a malformed input.
```python
import re
def parse_duration(s):
"""
Convert a duration string like '1h30m', '45s', '2h', '90m', '1h2m3s' into total seconds.
The string must consist of one or more components, each being a non-negative integer
followed by a unit 'h', 'm', or 's'. Units must appear in the order h, m, s (each at most once).
Raises ValueError on any malformed input.
"""
if not s:
raise ValueError("Empty string")
# Match all number+unit pairs
pattern = re.compile(r'(\d+)([hms])')
matches = patter…```python
import re
_DURATION_PATTERN = re.compile(
r"(?:(?P<hours>[0-9]+)h)?"
r"(?:(?P<minutes>[0-9]+)m)?"
r"(?:(?P<seconds>[0-9]+)s)?"
)
def parse_duration(s):
if not isinstance(s, str) or not s:
raise ValueError("Malformed duration")
match = _DURATION_PATTERN.fullmatch(s)
if not match:
raise ValueError(f"Malformed duration: {s!r}")
hours = int(match.group("hours") or 0)
minutes = int(match.group("minutes") or 0)
seconds = int(match.group("seconds") or 0)
return hours * 3600 + minu…Task by task
| Task | GLM 5.2 | GPT-5.6 Sol |
|---|---|---|
| Duration parser | 8 | 10 |
| Find the bug | 10 | 9 |
| SQL without window functions | 10 | 10 |
| Infinite useEffect | 10 | 10 |
| Typed debounce | 8 | 9 |
| Leftmost binary search | 10 | 10 |
| Security review | 9 | 10 |
| Safe migration | 7 | 9 |
| Fix the code not the test | 10 | 10 |
| Race condition | 9 | 9 |
| Retry with backoff | 10 | 8 |
| Recursive type | 10 | 9 |
| Bash one-liner | 10 | 9 |
| Explain and cost | 9 | 9 |
| Regex with limits | 8 | 9 |
| Callback to async | 10 | 9 |
| Diagnose from a trace | 8 | 9 |
| Idempotency | 9 | 9 |
Full receipts: GLM 5.2, GPT-5.6 Sol · judges claude-sonnet-5, gemini-3.1-pro-preview, gpt-5.6-terra
Questions people ask
Which is better for coding: GLM 5.2 or GPT-5.6 Sol?
GPT-5.6 Sol — it scored 93/100 against 92/100 on our 18-task coding suite, winning 6 tasks to 5 with 7 tied. Every answer was marked blind by three judges from three rival AI labs.
How was this tested?
Both models answered the identical published coding tasks. Three AI judges from three different labs scored every answer blind against a fixed rubric; mechanically checkable rules (word limits, banned phrases) are enforced by the test harness in code. The raw outputs and judge verdicts are downloadable.
More coding head-to-heads: GPT-5.6 Luna vs GPT-5.6 Sol · GLM 5.2 vs GPT-5.6 Luna · GPT-5.6 Sol vs GPT-5.6 Terra · GPT-5.3-Codex vs GPT-5.6 Sol · GPT-5.5 vs GPT-5.6 Sol · GPT-5.6 Sol vs Qwen3.7 Max
Full ranking: Best AI for coding · model pages: GLM 5.2, GPT-5.6 Sol