Best AI for coding / head-to-head

Gemini 3.1 Pro Preview vs GPT-5.6 Solfor coding

The verdict

GPT-5.6 Sol wins, 9388

Same 18 coding tasks, marked blind by three rival labs. GPT-5.6 Sol took 10 tasks, Gemini 3.1 Pro Preview took 3, 5 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):
    """
    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

_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

TaskGemini 3.1 Pro PreviewGPT-5.6 Sol
Duration parser810
Find the bug99
SQL without window functions1010
Infinite useEffect810
Typed debounce99
Leftmost binary search910
Security review910
Safe migration89
Fix the code not the test1010
Race condition99
Retry with backoff98
Recursive type109
Bash one-liner89
Explain and cost109
Regex with limits89
Callback to async89
Diagnose from a trace89
Idempotency89

Full receipts: Gemini 3.1 Pro Preview, GPT-5.6 Sol · 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 GPT-5.6 Sol?

GPT-5.6 Sol — it scored 93/100 against 88/100 on our 18-task coding suite, winning 10 tasks to 3 with 5 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 · Gemini 3.1 Pro Preview vs GPT-5.6 Luna · GPT-5.6 Sol vs GPT-5.6 Terra · GLM 5.2 vs GPT-5.6 Sol · GPT-5.3-Codex vs GPT-5.6 Sol · GPT-5.5 vs GPT-5.6 Sol

Full ranking: Best AI for coding · model pages: Gemini 3.1 Pro Preview, GPT-5.6 Sol