Best AI for coding / head-to-head
Gemini 3.1 Pro Preview vs GPT-5.6 Lunafor coding
GPT-5.6 Luna wins, 93–88
Same 18 coding tasks, marked blind by three rival labs. GPT-5.6 Luna took 9 tasks, Gemini 3.1 Pro Preview took 2, 7 tied. Tested 16 Aug 2026.
Where they differed most
Refactor this to async/await with correct error propagation. Errors must not be swallowed. getUser(id, (e, user) => { if (e) return cb(e); getOrders(user.id, (e2, orders) => { if (e2) return cb(e2); getTotals(orders, (e3, totals) => cb(e3, totals)); }); });
Here are the two best ways to refactor this, depending on whether you want to completely modernize the function to return a Promise, or if you need to maintain the original callback (`cb`) signature for backwards compatibility. ### Option 1: Pure `async/await` (Recommended) If you are updating the surrounding code to support Promises, you can drop the callback entirely. In an `async` function, if any `await`ed Promise rejects, the error automatically bubbles up and rejects the returned Promise. **No errors are swallowed.** ```javascript async…
If the functions return promises:
```js
async function getUserTotals(id) {
const user = await getUser(id);
const orders = await getOrders(user.id);
return getTotals(orders);
}
```
Any error from `getUser`, `getOrders`, or `getTotals` automatically propagates as a rejected promise:
```js
try {
const totals = await getUserTotals(id);
console.log(totals);
} catch (err) {
console.error(err);
}
```
If the existing functions are callback-based, promisify them first:
```js
const { promisify } = require("node:util");
const getUserAsyn…Task by task
| Task | Gemini 3.1 Pro Preview | GPT-5.6 Luna |
|---|---|---|
| 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 | 10 |
| Retry with backoff | 9 | 9 |
| 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 | 10 |
Full receipts: Gemini 3.1 Pro Preview, GPT-5.6 Luna · 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 Luna?
GPT-5.6 Luna — it scored 93/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.6 Luna vs GPT-5.6 Sol · GPT-5.6 Luna vs GPT-5.6 Terra · GLM 5.2 vs GPT-5.6 Luna · GPT-5.3-Codex vs GPT-5.6 Luna · GPT-5.5 vs GPT-5.6 Luna · GPT-5.6 Luna vs Qwen3.7 Max
Full ranking: Best AI for coding · model pages: Gemini 3.1 Pro Preview, GPT-5.6 Luna