Best AI for coding / head-to-head
Gemini 3.1 Pro Preview vs GPT-5.3-Codexfor coding
GPT-5.3-Codex wins, 92–88
Same 18 coding tasks, marked blind by three rival labs. GPT-5.3-Codex took 9 tasks, Gemini 3.1 Pro Preview took 2, 7 tied. Tested 16 Aug 2026.
Where they differed most
Design an idempotent POST /payments endpoint so a client retry cannot charge twice. Describe the key, where it is stored, what happens on a concurrent duplicate, and what you return the second time. Maximum 200 words. Name the failure mode your design still has.
**Key:** A client-generated UUID passed in the `Idempotency-Key` HTTP header. **Storage:** A transactional database (e.g., PostgreSQL) or distributed cache (e.g., Redis) storing the key, request payload hash, execution status (pending/completed), and the final HTTP response. **Concurrent Duplicate:** Handled via atomic operations (e.g., Redis `SETNX` or a SQL `UNIQUE` constraint). The first request atomically inserts the key and marks it "pending". If a concurrent duplicate arrives, the atomic insert fails. The server detects the "pending" s…
Use a client-supplied **Idempotency-Key** (UUID) on `POST /payments`, scoped by `merchant_id` (or customer+endpoint). Store it in a durable `payment_idempotency` table: - `(merchant_id, idempotency_key)` **UNIQUE** - `request_hash` (amount/currency/source fingerprint) - `status` (`processing|succeeded|failed`) - `payment_id` - full `http_status` + `response_body` - timestamps/TTL Flow: 1. Start DB transaction. 2. `INSERT ... ON CONFLICT DO NOTHING` a row with `processing`. 3. If insert succeeds, this request “owns” execution; call processor…
Task by task
| Task | Gemini 3.1 Pro Preview | GPT-5.3-Codex |
|---|---|---|
| Duration parser | 8 | 9 |
| Find the bug | 9 | 10 |
| SQL without window functions | 10 | 10 |
| Infinite useEffect | 8 | 9 |
| Typed debounce | 9 | 10 |
| Leftmost binary search | 9 | 10 |
| Security review | 9 | 9 |
| Safe migration | 8 | 8 |
| Fix the code not the test | 10 | 10 |
| 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.3-Codex · 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.3-Codex?
GPT-5.3-Codex — it scored 92/100 against 88/100 on our 18-task coding suite, winning 9 tasks to 2 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.3-Codex vs GPT-5.6 Luna · Gemini 3.1 Pro Preview vs GPT-5.6 Luna · GPT-5.3-Codex vs GPT-5.6 Sol · Gemini 3.1 Pro Preview vs GPT-5.6 Sol · GPT-5.3-Codex vs GPT-5.6 Terra · Gemini 3.1 Pro Preview vs GPT-5.6 Terra
Full ranking: Best AI for coding · model pages: Gemini 3.1 Pro Preview, GPT-5.3-Codex