Best AI for coding / head-to-head
Gemini 3.1 Pro Preview vs Qwen3.7 Maxfor coding
Qwen3.7 Max wins, 90–88
Same 18 coding tasks, marked blind by three rival labs. Qwen3.7 Max took 6 tasks, Gemini 3.1 Pro Preview 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):
"""
Parses a duration string (e.g., '1h30m', '45s') and returns the total in seconds.
Raises ValueError if the string is malformed.
"""
if not isinstance(s, str):
raise ValueError("Input must be a string")
# Regex enforces the format and order (hours -> minutes -> seconds) with no spaces.
# All groups are optional, but at least one must be present.
pattern = r'^(?:(?P<hours>\d+)h)?(?:(?P<minutes>\d+)m)?(?:(?P<seconds>\d+)s)?$'
match = re.match(patte…```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
| Task | Gemini 3.1 Pro Preview | Qwen3.7 Max |
|---|---|---|
| Duration parser | 8 | 10 |
| Find the bug | 9 | 9 |
| SQL without window functions | 10 | 9 |
| Infinite useEffect | 8 | 10 |
| Typed debounce | 9 | 8 |
| Leftmost binary search | 9 | 10 |
| Security review | 9 | 9 |
| Safe migration | 8 | 8 |
| Fix the code not the test | 10 | 9 |
| Race condition | 9 | 9 |
| Retry with backoff | 9 | 10 |
| Recursive type | 10 | 9 |
| Bash one-liner | 8 | 9 |
| Explain and cost | 10 | 9 |
| Regex with limits | 8 | 8 |
| Callback to async | 8 | 10 |
| Diagnose from a trace | 8 | 8 |
| Idempotency | 8 | 8 |
Full receipts: Gemini 3.1 Pro Preview, Qwen3.7 Max · judges claude-sonnet-5, gpt-5.6-terra, grok-4.5
Questions people ask
Which is better for coding: Gemini 3.1 Pro Preview or Qwen3.7 Max?
Qwen3.7 Max — it scored 90/100 against 88/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 Qwen3.7 Max · Gemini 3.1 Pro Preview vs GPT-5.6 Luna · GPT-5.6 Sol vs Qwen3.7 Max · Gemini 3.1 Pro Preview vs GPT-5.6 Sol · GPT-5.6 Terra vs Qwen3.7 Max · Gemini 3.1 Pro Preview vs GPT-5.6 Terra
Full ranking: Best AI for coding · model pages: Gemini 3.1 Pro Preview, Qwen3.7 Max