Best AI for coding / head-to-head
Gemini 3.1 Pro Preview vs Kimi K3for coding
Kimi K3 wins, 89–88
Same 18 coding tasks, marked blind by three rival labs. Kimi K3 took 9 tasks, Gemini 3.1 Pro Preview took 5, 4 tied. Tested 16 Aug 2026.
Where they differed most
Write an async retry wrapper in TypeScript: exponential backoff with jitter, a maximum attempt count, and it must NOT retry on 4xx responses other than 429. Maximum 30 lines. State what happens on the final failure.
```typescript
export async function withRetry<T>(fn: () => Promise<T>, maxAttempts: number): Promise<T> {
for (let attempt = 1; ; attempt++) {
try {
return await fn();
} catch (error: any) {
const status = error?.status ?? error?.response?.status;
const isFatal4xx = status >= 400 && status < 500 && status !== 429;
if (isFatal4xx || attempt >= maxAttempts) throw error;
const delay = (2 ** attempt) * 100 + Math.random() * 100; // Exponential + Jitter
await new Promise(res => setTimeout(r…```typescript
export async function withRetry<T>(
task: () => Promise<T>,
maxAttempts = 5,
baseDelayMs = 200,
): Promise<T> {
for (let attempt = 1; ; attempt++) {
try {
return await task();
} catch (raw) {
const e = raw as { status?: number; response?: { status?: number } };
const status = e.status ?? e.response?.status; // fetch-style or axios-style
const fourxx = status !== undefined && status >= 400 && status < 500;
if ((fourxx && status !== 429) || attempt >= maxAttempts) throw raw;
const…Task by task
| Task | Gemini 3.1 Pro Preview | Kimi K3 |
|---|---|---|
| Duration parser | 8 | 10 |
| Find the bug | 9 | 10 |
| SQL without window functions | 10 | 10 |
| Infinite useEffect | 8 | 9 |
| Typed debounce | 9 | 10 |
| Leftmost binary search | 9 | 8 |
| Security review | 9 | 9 |
| Safe migration | 8 | 9 |
| Fix the code not the test | 10 | 9 |
| Race condition | 9 | 9 |
| Retry with backoff | 9 | 5 |
| Recursive type | 10 | 8 |
| Bash one-liner | 8 | 9 |
| Explain and cost | 10 | 9 |
| Regex with limits | 8 | 10 |
| Callback to async | 8 | 8 |
| Diagnose from a trace | 8 | 9 |
| Idempotency | 8 | 9 |
Full receipts: Gemini 3.1 Pro Preview, Kimi K3 · 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 Kimi K3?
Kimi K3 — it scored 89/100 against 88/100 on our 18-task coding suite, winning 9 tasks to 5 with 4 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 Kimi K3 · Gemini 3.1 Pro Preview vs GPT-5.6 Luna · GPT-5.6 Sol vs Kimi K3 · Gemini 3.1 Pro Preview vs GPT-5.6 Sol · GPT-5.6 Terra vs Kimi K3 · Gemini 3.1 Pro Preview vs GPT-5.6 Terra
Full ranking: Best AI for coding · model pages: Gemini 3.1 Pro Preview, Kimi K3