Best AI for coding / head-to-head
Gemini 3.1 Pro Preview vs GPT-5.6 Terrafor coding
GPT-5.6 Terra wins, 93–88
Same 18 coding tasks, marked blind by three rival labs. GPT-5.6 Terra took 10 tasks, Gemini 3.1 Pro Preview took 3, 5 tied. Tested 16 Aug 2026.
Where they differed most
Explain precisely why this React effect loops forever, then give the fixed version. const [items, setItems] = useState([]); useEffect(() => { fetch('/api/items').then(r => r.json()).then(setItems); }, [items]);
### Why it loops forever The infinite loop occurs due to a combination of **React's dependency tracking** and **JavaScript's reference equality**. Here is the precise step-by-step breakdown of the loop: 1. **Initial Render:** The component mounts, and `items` is initialized to an empty array `[]`. 2. **Effect Runs:** Because it's the first render, the `useEffect` runs and triggers the `fetch` request. 3. **State Update:** The fetch resolves, parses the JSON, and calls `setItems()` with the fetched array. 4. **Re-render:** Updating the state…
`items` is both: 1. A dependency of the effect: `}, [items])` 2. Updated by the effect: `.then(setItems)` That creates this cycle: 1. Component renders with `items = []`. 2. The effect runs because it runs after the initial render. 3. `fetch` resolves and `r.json()` produces a new array/object value. 4. `setItems(newItems)` updates state. 5. React re-renders. 6. The `items` dependency is now a different reference than before (`Object.is(oldItems, newItems)` is false). 7. React runs the effect again. 8. It fetches again, creates another new a…
Task by task
| Task | Gemini 3.1 Pro Preview | GPT-5.6 Terra |
|---|---|---|
| Duration parser | 8 | 8 |
| Find the bug | 9 | 10 |
| SQL without window functions | 10 | 10 |
| Infinite useEffect | 8 | 10 |
| Typed debounce | 9 | 10 |
| Leftmost binary search | 9 | 10 |
| Security review | 9 | 10 |
| Safe migration | 8 | 9 |
| Fix the code not the test | 10 | 9 |
| Race condition | 9 | 9 |
| Retry with backoff | 9 | 8 |
| Recursive type | 10 | 9 |
| Bash one-liner | 8 | 9 |
| Explain and cost | 10 | 10 |
| Regex with limits | 8 | 9 |
| Callback to async | 8 | 9 |
| Diagnose from a trace | 8 | 8 |
| Idempotency | 8 | 10 |
Full receipts: Gemini 3.1 Pro Preview, GPT-5.6 Terra · 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 Terra?
GPT-5.6 Terra — 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 Terra · Gemini 3.1 Pro Preview vs GPT-5.6 Luna · GPT-5.6 Sol vs GPT-5.6 Terra · Gemini 3.1 Pro Preview vs GPT-5.6 Sol · GLM 5.2 vs GPT-5.6 Terra · GPT-5.3-Codex vs GPT-5.6 Terra
Full ranking: Best AI for coding · model pages: Gemini 3.1 Pro Preview, GPT-5.6 Terra