Best AI for coding / head-to-head

GLM 5.2 vs Qwen3.7 Maxfor coding

The verdict

GLM 5.2 wins, 9290

Same 18 coding tasks, marked blind by three rival labs. GLM 5.2 took 6 tasks, Qwen3.7 Max took 2, 10 tied. Tested 16 Aug 2026.

Where they differed most

The task — Duration parser

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

def parse_duration(s: str) -> int:
    """
    Converts a duration string (e.g., '1h30m', '45s', '1h2m3s') into total seconds.
    Raises ValueError on malformed inputs.
    """
    if not isinstance(s, str):
        raise ValueError(f"Expected a string, got {type(s).__name__}")
        
    # Regex explanation:
    # ^             : Start of string
    # (?:(\d+)h)?   : Optional non-capturing group for hours, capturing the digits
    # (?:(\d+)m)?   : Optional non-capturing group for minutes, capturing the digits
    # (?:…

Task by task

TaskGLM 5.2Qwen3.7 Max
Duration parser810
Find the bug109
SQL without window functions109
Infinite useEffect1010
Typed debounce88
Leftmost binary search1010
Security review99
Safe migration78
Fix the code not the test109
Race condition99
Retry with backoff1010
Recursive type109
Bash one-liner109
Explain and cost99
Regex with limits88
Callback to async1010
Diagnose from a trace88
Idempotency98

Full receipts: GLM 5.2, Qwen3.7 Max · 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 Qwen3.7 Max?

GLM 5.2 — it scored 92/100 against 90/100 on our 18-task coding suite, winning 6 tasks to 2 with 10 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: GLM 5.2 vs GPT-5.6 Luna · GPT-5.6 Luna vs Qwen3.7 Max · GLM 5.2 vs GPT-5.6 Sol · GPT-5.6 Sol vs Qwen3.7 Max · GLM 5.2 vs GPT-5.6 Terra · GPT-5.6 Terra vs Qwen3.7 Max

Full ranking: Best AI for coding · model pages: GLM 5.2, Qwen3.7 Max