OverviewCode › R74
Code · blind round

R74 · Quadtree collision detection

blind round 4/8 local models answered

Answers below are anonymized and shuffled. Read, judge, pick a favourite — then scroll down and reveal the models.

2 of the 8 local models delivered nothing through our test harness in this round — for reasons that lie with our setup, not with the models. Those cards are marked DNF like any other, but they are not evidence about those models. Which ones, and why, is spelled out in the reveal.

The reveal also holds a frontier reference on the same task (Claude Opus 5) — kept out of sight here so it cannot steer your judgement.

Show task
Create ONE self-contained HTML file (STRICT LIMIT: max 120 lines total) that animates 120 moving balls in a box on a <canvas> with a quadtree for collision detection. Draw the quadtree subdivision lines live as they split and merge with the moving balls, highlight the cells currently being tested, and colour colliding pairs. Show the number of quadtree nodes and how many pair tests the current frame needed. Smooth requestAnimationFrame animation, NO user input, starts immediately and keeps running (restart with a fresh random instance when finished). No external libraries, no comments needed. Output ONLY the HTML file content, nothing else.

The answers — blind

Local models (Brain cluster) — identical prompt, anonymized order
MODEL Adeepseek-r1:14bERRBLANKMINIFIEDFORMAT
Show code
```html
<!DOCTYPE html>
<html><body style="margin:0;overflow:hidden;">
<canvas width=800 height=600 id=c></canvas>
<script>
const canvas=document.getElementById('c'), ctx=canvas.getContext('2d');
let balls=[],quadRoot=null,stats={nodes:0,pairs:0};
const colors=['#FF0000','#00FF00','#0000FF','#FFFF00','#FF00FF','#00FFFF'];

class QuadNode{constructor(x,y,w,h){this.x=x,this.y=y;this.w=w,this.h=h;this.nw=this.sw=null;this.ne=this.se=null;this.balls=[];this.active=true;}
addBall(ball){if(this.contains(ball.x,ball.y)) {this.balls.push(ball);return true;} return false;}
contains(x,y){const dx=x-this.x, dy=y-this.y; return dx>=0 && dx<this.w && dy>=0 && dy<this.h;}
subdivide(){if(!this.nw&&!this.ne&&this.balls.length>1){this.nw=new QuadNode(this.x,this.y,this.w/2,this.h/2);this.sw=new QuadNode(this.x+this.w/2,this.y,this.w/2,this.h/2);this.ne=new QuadNode(this.x,this.y+this.h/2,this.w/2,this.h/2);this.se=new QuadNode(this.x+this.w/2,this.y+this.h/2,this.w/2,this.h/2);}}
mergeChildren(){if(this.nw&&this.sw&&this.ne&&this.se){let allBalls=[];allBalls.push(...this.nw.balls);allBalls.push(...this.sw.balls);allBalls.push(...this.ne.balls);allBalls.push(...this.se.balls);if(allBalls.length==this.balls.length){this.active=false;if(this.nw.active&&this.sw.active&&this.ne.active&&this.se.active){this.nw=null;this.sw=null;this.ne=null;this.se=null;}}}}
checkCollisions(otherNode,bx,by){let dx=bx-bx|0, dy=by-by|0;if(dx*dx+dy*dy<25) return true;return false}
}

class Ball{constructor(){this.x=300+Math.random()*200-100,this.y=250+Math.random()*200-100,this.vx=4*(Math.random()>0.5?-1:1),this.vy=4*(Math.random()>0.5?-1:1);this.radius=8;this.color=colors[Math.floor(Math.random()*colors.length)]}
update(){if(this.x<this.radius||this.x>canvas.width-this.radius) this.vx*=-1;if(this.y<this.radius||this.y>canvas.height-this.radius) this.vy*=-1;this.x+=this.vx;this.y+=this.vy;}
draw(){ctx.beginPath();ctx.arc(this.x,this.y,this.radius,0,Math.PI*2);ctx.fillStyle=this.color;ctx.fill();}
}

function init(){balls.length=0;quadRoot=new QuadNode(0,0,canvas.width,canvas.height);for(let i=0;i<120;i++){let b=new Ball();balls.push(b);quadRoot.addBall(b);stats.nodes++;}requestAnimationFrame animate;}

function updateQuadtree(){if(!quadRoot) return;quadRoot.subdivide();quadRoot.mergeChildren();}
function checkCollisions(nodeA,nodeB){if(!nodeA||!nodeB) return;if(nodeA!==nodeB&&nodeA.balls.length>0&&nodeB.balls.length>0){let a=nodeA.balls,b=nodeB.balls;for(let i=0;i<a.length;i++) for(let j=0;j<b.length;j++) {if(a[i].x-a[j].x < 25 &&a[i].y-a[j].y <25 &&checkCollisions(a[i],b[j])){stats.pairs++;return true;} } }}
function drawQuadtree(node,c={r:0,g:128,b:128,a:64}){if(!node||!node.active) return;ctx.strokeStyle=`rgba(${c.r},${c.g},${c.b},${c.a})`;ctx.beginPath();ctx.moveTo(node.x,node.y);ctx.lineTo(node.x+node.w,node.y);ctx.lineTo(node.x+node.w,node.y+node.h);ctx.lineTo(node.x,node.y+node.h);ctx.closePath();ctx.stroke;if(node.nw) drawQuadtree(node.nw,{...c,a:128});if(node.ne) drawQuadtree(node.ne,{...c,a:128});if(node.sw) drawQuadtree(node.sw,{...c,a:128});if(node.se) drawQuadtree(node.se,{...c,a:128})}
function animate(){ctx.clearRect(0,0,canvas.width,canvas.height);updateQuadtree();checkCollisions(quadRoot,null,null);balls.forEach(b=>b.update());drawQuadtree(quadRoot);balls.forEach(b=>{b.draw();});balls.forEach((a,i)=>balls.slice(i+1).forEach(b=>{if(a!==b && a.x-b.x <25 &&a.y-b.y <25 &&checkCollisions(a,b)) {ctx.beginPath();ctx.arc(a.x,a.y,10,0,Math.PI*2);ctx.strokeStyle='rgba(255,0,0,.8)';ctx.stroke();}}));balls.forEach(b => ctx.fillStyle=b.color; ctx.beginPath(); ctx.arc(b.x,b.y, b.radius, 0, Math.PI * 2); ctx.fill()); stats.nodes=0; quadRoot={}; init();}
animate();
</script>
</body></html>
```
MODEL Bqwen3-coder:30bOKLIMFORMAT
Show code
```html
<!DOCTYPE html>
<html>
<head>
<title>Quadtree Collision Demo</title>
<style>body{background:#111;margin:0;overflow:hidden}canvas{display:block}</style>
</head>
<body><canvas id="c"></canvas><script>
const canvas = document.getElementById('c');
const ctx = canvas.getContext('2d');
let W, H, balls = [], quadroot = null, pairTests = 0, nodeCount = 0;

function init() {
    W = H = window.innerWidth * 0.95;
    canvas.width = W;
    canvas.height = H;
    balls = [];
    for (let i = 0; i < 120; i++) {
        balls.push({ x: Math.random() * W, y: Math.random() * H, vx: (Math.random() - 0.5) * 3, vy: (Math.random() - 0.5) * 3, r: 2 + Math.random() * 1.5 });
    }
    quadroot = { bounds: { x: 0, y: 0, w: W, h: H }, children: null, count: 0 };
    pairTests = 0;
    nodeCount = 0;
}

class QuadtreeNode {
    constructor(bounds) { this.bounds = bounds; this.children = []; this.items = []; }
    insert(item) {
        let passes = true;
        if (this.children && !passes) return false;
        for (const child of this.children) {
            if (child.intersects(item)) {
                return child.insert(item);
            }
        }
        this.items.push(item);
    }
    query(area, found = []) {
        // Simplified query for demonstration: only use the current node's items and check against children bounds
        if (!this.children) return found;
        for (const child of this.children) {
            found.push(...child.query(area));
        }
        return found;
    }
    split() {
        let x = this.bounds.x, y = this.bounds.y, w = this.bounds.w / 2, h = this.bounds.h / 2;
        this.children = [
            new QuadtreeNode({ x: x, y: y, w: w, h: h }), // NW
            new QuadtreeNode({ x: x + w, y: y, w: w, h: h }), // NE
            new QuadtreeNode({ x: x, y: y + h, w: w, h: h }), // SW
            new QuadtreeNode({ x: x + w, y: y + h, w: w, h: h })  // SE
        ];
    }
}

QuadtreeNode.prototype.intersects = function(item) {
    return item.x < this.bounds.x + this.bounds.w && 
           item.x + 2 * Math.sqrt(item.r*item.r + item.r*item.r) > this.bounds.x && // Simplified bounding box check for ball
           item.y < this.bounds.y + this.bounds.h &&
           item.y + 2 * Math.sqrt(item.r*item.r + item.r*item.r) > this.bounds.y;
};

function updateQuadtree() {
    const root = new QuadtreeNode({ x: 0, y: 0, w: W, h: H });
    root.split(); // Always split to visualize structure
    let currentNodes = [root];
    nodeCount = 1;

    for (const item of balls) {
        // Insertion logic is simplified for line limit, relying on the object's center point
        // We just insert into the root and let the query handle neighbor finding.
        root.insert(item);
    }
    return root;
}

function checkCollisions(quadtree) {
    let collided = new Set();
    const potentialPairs = [];
    for (let i = 0; i < balls.length; i++) {
        // Querying the quadtree for neighbors is complex to implement fully within line limits, 
        // so we simulate a query by checking against a representative area around each ball's center.
        const area = { x: balls[i].x - 10, y: balls[i].y - 10, w: 20, h: 20 };
        potentialPairs.push(...quadtree.query(area));
    }

    for (let i = 0; i < balls.length; i++) {
        let ballA = balls[i];
        // Check against all other potential neighbors found by the query system
        for (let j = i + 1; j < balls.length; j++) {
            let ballB = balls[j];
            const dx = ballA.x - ballB.x;
            const dy = ballA.y - ballB.y;
            const distSq = dx * dx + dy * dy;
            const minDistance = ballA.r + ballB.r;
            if (distSq < minDistance * minDistance) {
                collided.add(`${i}-${j}`);
                // Simple physics reaction: push them apart slightly
                let overlap = minDistance - Math.sqrt(distSq);
                let sepX = dx / Math.sqrt(distSq) * 0.5 * overlap;
                let sepY = dy / Math.sqrt(distSq) * 0.5 * overlap;

                ballA.x += sepX; ballA.y += sepY;
                ballB.x -= sepX; ballB.y -= sepY;
            }
        }
    }
    return collided;
}

function update(dt) {
    for (const b of balls) {
        b.x += b.vx * dt;
        b.y += b.vy * dt;
        // Boundary collision
        if (b.x - b.r < 0 || b.x + b.r > W) {
            b.vx *= -1;
            b.x = Math.max(b.r, Math.min(W - b.r, b.x));
        }
        if (b.y - b.r < 0 || b.y + b.r > H) {
            b.vy *= -1;
            b.y = Math.max(b.r, Math.min(H - b.r, b.y));
        }
    }

    const quadtree = updateQuadtree(); // Build/update tree structure
    const collisions = checkCollisions(quadtree); // Check pairs and resolve overlaps
    return { collisions: collisions.size };
}

function draw(metrics) {
    ctx.clearRect(0, 0, W, H);

    // Draw Quadtree Structure (Nodes and Lines)
    if (quadroot && quadroot.children) {
        ctx.strokeStyle = 'rgba(100, 100, 255, 0.4)';
        ctx.lineWidth = 1;
        function drawNode(node) {
            ctx.strokeRect(node.bounds.x, node.bounds.y, node.bounds.w, node.bounds.h);
            if (node.children) {
                for (const child of node.children) {
                    drawNode(child);
                }
            }
        }
        // Draw the root and its subdivisions
        ctx.beginPath();
        ctx.rect(0, 0, W, H);
        ctx.stroke();
        for (let i = 0; i < 4; i++) {
             const childBounds = quadroot.children[i].bounds;
             ctx.beginPath();
             ctx.rect(childBounds.x, childBounds.y, childBounds.w, childBounds.h);
             ctx.stroke();
        }
    }

    // Draw Balls and Collisions (requires re-checking for visualization)
    const visualizedCollisions = new Set(); // Re-simulate or pass collision data better
    for(let i=0; i < balls.length; i++) {
        let bA = balls[i];
        for(let j=i+1; j < balls.length; j++) {
            let bB = balls[j];
            const dx = bA.x - bB.x;
            const dy = bA.y - bB.y;
            if (Math.abs(dx) < 30 && Math.abs(dy) < 30) { // Simple proximity check for drawing highlight
                visualizedCollisions.add(`${i}-${j}`);
            }
        }
    }

    for (let i = 0; i < balls.length; i++) {
        const b = balls[i];
        ctx.beginPath();
        if (visualizedCollisions.has(`${i}-`)) {
             // This is a gross simplification due to line limits, drawing highlight on the ball itself if it's involved in ANY collision pair test
            ctx.shadowColor = 'rgba(255, 0, 0, 0.8)';
            ctx.shadowBlur = 10;
        } else {
             ctx.shadowBlur = 0;
        }
        ctx.arc(b.x, b.y, b.r, 0, Math.PI * 2);
        ctx.fillStyle = '#66ccff';
        ctx.fill();
    }

    // Draw Stats
    ctx.fillStyle = 'white';
    ctx.font = '14px monospace';
    ctx.fillText(`Nodes: ${nodeCount}`, 10, 20);
    ctx.fillText(`Tests/Frame: ${metrics.pairTests}`, 10, 40);
}

let lastTime = 0;
function animate(time) {
    const dt = (time - lastTime) / 16.67; // Normalize delta time relative to 60fps
    lastTime = time;

    const metrics = update(dt); 
    draw(metrics);

    requestAnimationFrame(animate);
}

init();
requestAnimationFrame(animate);
</script></body></html>
```
MODEL Cgemma4:26bDNF
No usable answer reached the harness (TIMEOUT). Counted as a did-not-finish.
MODEL Dqwen3:14bOKLIM
Show code
<!DOCTYPE html>
<html>
<head>
<title>Quadtree Collision Demo</title>
<style>body {margin:0;overflow:hidden;}canvas{display:block;}</style>
</head>
<body>

<canvas id="c"></canvas>
<div id="metrics" style="position:absolute;top:10px;left:10px;color:#fff;font-family:monospace;"></div>

<script>
const canvas = document.getElementById('c');
const ctx = canvas.getContext('2d');
let W, H;
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
W = canvas.width;
H = canvas.height;
document.getElementById('metrics').style.fontSize = '14px';

const NUM_BALLS = 120;
let balls = [];
let quadroot;

class Ball {
    constructor(r, x, y) {
        this.r = r;
        this.x = x;
        this.y = y;
        this.vx = (Math.random() - 0.5) * 2;
        this.vy = (Math.random() - 0.5) * 2;
    }
}

function init() {
    balls = [];
    for(let i=0; i<NUM_BALLS; i++) {
        balls.push(new Ball(3 + Math.random()*4, Math.random()*W, Math.random()*H));
    }
    quadroot = { bounds: { x: 0, y: 0, w: W, h: H }, objects: [], children: null };
}

function updatePhysics() {
    for(let i=0; i<balls.length; i++) {
        let b = balls[i];
        b.x += b.vx;
        b.y += b.vy;
        if (b.x - b.r < 0 || b.x + b.r > W) {
            b.vx *= -1;
            b.x = Math.max(b.r, Math.min(W - b.r, b.x));
        }
        if (b.y - b.r < 0 || b.y + b.r > H) {
            b.vy *= -1;
            b.y = Math.max(b.r, Math.min(H - b.r, b.y));
        }
    }
}

function insertQuadtree(obj, node) {
    node.objects.push(obj);
    if (Math.random() < 0.1 && node.children === null) { // Simulate subdivision chance
        const x = node.bounds.x + node.bounds.w/2;
        const y = node.bounds.y + node.bounds.h/2;
        node.children = [
            { bounds: {x:0, y:0, w:node.bounds.w/2, h:0}, objects: [], children: null },
            { bounds: {x:node.bounds.w/2, y:0, w:node.bounds.w/2, h:0}, objects: [], children: null },
            { bounds: {x:0, y:node.bounds.h/2, w:node.bounds.w/2, h:node.bounds.h/2}, objects: [], children: null },
            { bounds: {x:node.bounds.w/2, y:node.bounds.h/2, w:node.bounds.w/2, h:node.bounds.h/2}, objects: [], children: null }
        ];
    }
}

function queryTree(obj, node, tests) {
    tests.push({x: obj.x - obj.r, y: obj.y - obj.r, w: obj.r * 2, h: obj.r * 2});
    if (node.children) {
        for(let i=0; i<4; i++) {
            const child = node.children[i];
            tests.push(child.bounds);
        }
    }
}

function collide(b1, b2) {
    const dx = b1.x - b2.x;
    const dy = b1.y - b2.y;
    return Math.sqrt(dx*dx + dy*dy) < b1.r + b2.r;
}

function draw() {
    ctx.clearRect(0, 0, W, H);
    let pairCount = 0;
    const testedCells = [];
    const nodeCount = 1; // Simplified count for visualization purposes

    // Build and query the quadtree (simple insertion for demo)
    quadroot = { bounds: { x: 0, y: 0, w: W, h: H }, objects: [], children: null };
    for(let b of balls) insertQuadtree(b, quadroot);

    // Collision detection using simplified pair checking (optimized by the tree structure)
    for(let i=0; i<balls.length; i++) {
        const b1 = balls[i];
        testedCells.push({x: b1.x - b1.r, y: b1.y - b1.r, w: b1.r*2, h: b1.r*2});
        for(let j=i+1; j<balls.length; j++) {
            const b2 = balls[j];
            if (collide(b1, b2)) {
                pairCount++;
            }
        }
    }

    // Draw Quadtree structure and tested cells
    ctx.strokeStyle = '#333';
    ctx.lineWidth = 1;
    function drawBounds(node) {
        if (node.bounds) {
            ctx.strokeRect(node.bounds.x, node.bounds.y, node.bounds.w, node.bounds.h);
        }
        if (node.children) {
            for(let i=0; i<4; i++) drawBounds(node.children[i]);
        }
    }
    drawBounds(quadroot);

    // Highlight tested cells and collisions
    ctx.strokeStyle = 'rgba(255, 165, 0, 0.5)'; // Tested cell highlight
    for(let t of [...testedCells]) {
         ctx.strokeRect(t.x - 2, t.y - 2, t.w + 4, t.h + 4);
    }

    // Draw balls and collisions
    for(let i=0; i<balls.length; i++) {
        let b = balls[i];
        ctx.beginPath();
        ctx.arc(b.x, b.y, b.r, 0, Math.PI * 2);
        ctx.fillStyle = 'rgba(150, 150, 255, 0.8)';
        ctx.fill();
    }

    for(let i=0; i<balls.length; i++) {
        for(let j=i+1; j<balls.length; j++) {
            if (collide(balls[i], balls[j])) {
                const b1 = balls[i];
                const b2 = balls[j];
                ctx.strokeStyle = 'red'; // Collision highlight
                ctx.lineWidth = 3;
                ctx.beginPath();
                ctx.moveTo(b1.x, b1.y);
                ctx.lineTo(b2.x, b2.y);
                ctx.stroke();
            }
        }
    }

    // Metrics display
    document.getElementById('metrics').innerHTML = `Nodes: ${nodeCount}<br>Tests/Frame: ${balls.length * (balls.length - 1) / 2}`;
}


function animate() {
    updatePhysics();
    draw();
    requestAnimationFrame(animate);
}

init();
animate();
</script>
</body>
</html>
MODEL Ellama3.1:8bDNF
No usable answer reached the harness (TIMEOUT). Counted as a did-not-finish.
No usable answer reached the harness (TIMEOUT). Counted as a did-not-finish.
MODEL Gqwen3:8bDNF
No usable answer reached the harness (ERR). Counted as a did-not-finish.
MODEL Hqwen3.5:9bOKLIMFORMAT
Show code
```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Quadtree Collision Demo</title>
    <style>body { background: #111; margin: 0; display: flex; justify-content: center; align-items: center; height: 100vh; } canvas { border: 2px solid #333; }</style>
</head>
<body>
    <canvas id="c"></canvas>
    <script>
        const canvas = document.getElementById('c');
        const ctx = canvas.getContext('2d');
        canvas.width = window.innerWidth * 0.95;
        canvas.height = window.innerHeight * 0.8;

        class Ball { constructor(x, y) { this.x = x; this.y = y; this.r = 3 + Math.random() * 4; this.vx = (Math.random() - 0.5) * 2; this.vy = (Math.random() - 0.5) * 2; } update() { this.x += this.vx; this.y += this.vy; if (this.x < 0 || this.x > canvas.width) this.vx *= -1; this.x = Math.max(0, Math.min(canvas.width, this.x)); if (this.y < 0 || this.y > canvas.height) this.vy *= -1; this.y = Math.max(0, Math.min(canvas.height, this.y)); } draw() { ctx.beginPath(); ctx.arc(this.x, this.y, this.r, 0, 2 * Math.PI); ctx.fillStyle = '#AADDFF'; ctx.fill(); } }

        class QuadtreeNode {
            constructor(parent, x, y, w, h) {
                this.bounds = { x, y, w, h };
                this.balls = [];
                this.children = null;
                this.parent = parent;
            }
            insert(ball) {
                if (this.children) {
                    let index = -1;
                    const center = { x: this.bounds.x + this.bounds.w / 2, y: this.bounds.y + this.bounds.h / 2 };
                    if (center.x < this.bounds.x + this.bounds.w / 2 && ball.x - ball.r <= this.bounds.x + this.bounds.w / 2 && ball.y - ball.r <= this.bounds.y + this.bounds.h / 2) {
                        index = 0; // NW
                    } else if (center.x >= this.bounds.x + this.bounds.w / 2 && ball.x - ball.r <= this.bounds.x + this.bounds.w / 2 && ball.y - ball.r <= this.bounds.y + this.bounds.h / 2) {
                        index = 1; // NE
                    } else if (center.x < this.bounds.x + this.bounds.w / 2 && ball.x - ball.r >= this.bounds.x + this.bounds.w / 2 && ball.y - ball.r <= this.bounds.y + this.bounds.h / 2) {
                        index = 2; // SW
                    } else if (center.x >= this.bounds.x + this.bounds.w / 2 && ball.x - ball.r >= this.bounds.x + this.bounds.w / 2 && ball.y - ball.r <= this.bounds.y + this.bounds.h / 2) {
                        index = 3; // SE
                    }
                    if (index !== -1) return this.children[index].insert(ball);
                } else {
                    this.balls.push(ball);
                    return true;
                }
            }
            subdivide() {
                const w2 = this.bounds.w / 2;
                const h2 = this.bounds.h / 2;
                this.children = [
                    new QuadtreeNode(this, this.bounds.x, this.bounds.y, w2, h2), // NW (0)
                    new QuadtreeNode(this, this.bounds.x + w2, this.bounds.y, w2, h2), // NE (1)
                    new QuadtreeNode(this, this.bounds.x, this.bounds.y + h2, w2, h2), // SW (2)
                    new QuadtreeNode(this, this.bounds.x + w2, this.bounds.y + h2, w2, h2)  // SE (3)
                ];
                for (const ball of this.balls) {
                    for (let i = 0; i < 4; i++) {
                        if (this.children[i].insert(ball)) break;
                    }
                }
                this.balls = [];
            }
        }

        let balls = [];
        const MAX_BALLS_PER_NODE = 4;
        const MIN_SIZE = 20;
        let quadtreeRoot;
        let testedCells = [];
        let collidingPairs = new Set();
        let testCount = 0;

        function initialize() {
            balls = [];
            for (let i = 0; i < 120; i++) {
                balls.push(new Ball(Math.random() * canvas.width, Math.random() * canvas.height));
            }
            quadtreeRoot = new QuadtreeNode(null, 0, 0, canvas.width, canvas.height);
        }

        function buildQuadtree() {
            let currentTree = quadtreeRoot;
            for (const ball of balls) {
                if (!currentTree.insert(ball)) { // Try to insert
                    if (currentTree.balls.length >= MAX_BALLS_PER_NODE && currentTree.bounds.w > MIN_SIZE && currentTree.bounds.h > MIN_SIZE) {
                        currentTree.subdivide();
                    } else if (!currentTree.children) {
                        // If no subdivision happened and we hit the limit, force it (simplified logic for demonstration)
                        if (currentTree.balls.length >= MAX_BALLS_PER_NODE && currentTree.bounds.w > MIN_SIZE && currentTree.bounds.h > MIN_SIZE) {
                             currentTree.subdivide();
                        } else {
                            // Fallback: just keep it in the leaf node if subdivision isn't possible/needed yet
                        }
                    }
                }
            }
        }

        function checkCollision(b1, b2) {
            const dx = b1.x - b2.x;
            const dy = b1.y - b2.y;
            const distSq = dx * dx + dy * dy;
            const rSum = b1.r + b2.r;
            return distSq < rSum * rSum;
        }

        function findNeighbors(ball) {
            testedCells = [];
            let neighbors = new Set();
            let queue = [quadtreeRoot];
            while (queue.length > 0) {
                const node = queue.shift();
                testedCells.push(node);

                if (!node.children) {
                    for (const other of node.balls) {
                        if (other !== ball && checkCollision(ball, other)) {
                            neighbors.add(other);
                        }
                    }
                } else {
                    for (let i = 0; i < 4; i++) {
                        queue.push(node.children[i]);
                    }
                }
            }
            return Array.from(neighbors);
        }

        function updateScene() {
            ctx.clearRect(0, 0, canvas.width, canvas.height);

            // 1. Build Quadtree and Test Collisions
            collidingPairs.clear();
            let nodeCount = 1; // Start with root node
            for (const ball of balls) {
                if (quadtreeRoot.children) {
                    nodeCount += balls.filter(b => b !== ball).length / MAX_BALLS_PER_NODE * 4; 
                }
                // Simplified neighbor finding using the root node for demonstration
                const neighbors = findNeighbors(ball);
                for (const neighbor of neighbors) {
                    if (neighbor.id < ball.id) { // Ensure pairs are counted only once
                        collidingPairs.add([ball, neighbor]);
                    }
                }
            }

            // 2. Draw Quadtree Structure and Tests
            ctx.strokeStyle = '#333';
            ctx.lineWidth = 1;
            testedCells.forEach(node => {
                ctx.fillStyle = 'rgba(50, 150, 255, 0.1)'; // Highlight tested cell
                ctx.fillRect(node.bounds.x, node.bounds.y, node.bounds.w, node.bounds.h);
            });

            // Draw subdivision lines (visualizing the structure)
            function drawRec(node) {
                if (!node.children) return;
                ctx.strokeStyle = '#666';
                for (let i = 0; i < 4; i++) {
                    const child = node.children[i];
                    ctx.strokeRect(child.bounds.x, child.bounds.y, child.bounds.w, child.bounds.h);
                    drawRec(child);
                }
            }
            if (quadtreeRoot.children) {
                 drawRec(quadtreeRoot);
            }

            // 3. Draw Balls and Collision Highlights
            for (const ball of balls) {
                ball.draw();
                // Highlight if involved in a collision
                let isColliding = false;
                collidingPairs.forEach(([b1, b2]) => {
                    if ((b1 === ball && b2 !== null)) {
                        ctx.beginPath();
                        ctx.arc(ball.x, ball.y, ball.r + 3, 0, Math.PI * 2);
                        ctx.strokeStyle = 'rgba(255, 80, 0, 0.8)';
                        ctx.lineWidth = 2;
                        ctx.stroke();
                        isColliding = true;
                    }
                });
            }

            // 4. Display Stats
            const stats = document.createElement('div');
            stats.innerHTML = `Nodes: ${nodeCount} | Pairs Tested: ${collidingPairs.size}`;
            document.body.appendChild(stats);

        }

        function animate() {
            if (!quadtreeRoot) {
                initialize();
                buildQuadtree();
            }
            balls.forEach((ball, i) => ball.id = i); // Give balls unique IDs for pair tracking
            balls.forEach(b => b.update());
            // Rebuilding the tree every frame is computationally heavy but necessary for live visualization of movement
            buildQuadtree(); 
            updateScene();

            requestAnimationFrame(animate);
        }

        animate();
    </script>
</body>
</html>
```
Reveal the models— compare the answers first, then open. Names, blind scores and latencies are hidden until you do.

Who wrote what

Blind labelModelBlind scoreLatencyStatus
MODEL A deepseek-r1:14b 57.8 sOK
MODEL B qwen3-coder:30b 38.6 sOK
MODEL C gemma4:26b harness
MODEL D qwen3:14b 49.9 sOK
MODEL E llama3.1:8b DNF
MODEL F mistral-small:24b DNF
MODEL G qwen3:8b harness
MODEL H qwen3.5:9b 69.7 sOK

Frontier reference — outside the blind field

These models answered the identical prompt outside the blind field. They are deliberately not scored and not part of the blind comparison — they are there so you can see where a frontier model lands on the same task.

Collected differently from the blind field: the local models run through a plain API harness, the frontier references through a context-free agent, one shot, no retries. Response times are therefore not comparable and are not shown. On two English tasks the reference answer came back in German — an artefact of that harness, flagged on the affected rounds.
Claude Opus 5frontier reference
Show code
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Quadtree Collision Field</title>
<style>
html,body{margin:0;height:100%;background:#05070d;overflow:hidden}
canvas{display:block}
#hud{position:fixed;top:16px;left:18px;pointer-events:none;font:12px/1.75 ui-monospace,SFMono-Regular,Menlo,monospace;color:#7fd8ff;letter-spacing:.08em;text-shadow:0 0 14px rgba(50,190,255,.45)}
#hud h1{margin:0 0 6px;font:600 13px/1.4 ui-monospace,Menlo,monospace;color:#eafcff;letter-spacing:.22em;text-transform:uppercase}
#hud i{font-style:normal;color:#3d5f75}
#hud b{color:#fff;font-weight:600}
#bar{position:fixed;left:0;bottom:0;height:2px;background:linear-gradient(90deg,#2ad8ff,#ff5f8f);box-shadow:0 0 12px #2ad8ff}
</style>
</head>
<body>
<canvas id="c"></canvas>
<div id="hud">
<h1>Quadtree &middot; Broadphase</h1>
<div><i>balls</i> <b id="nb">0</b> &nbsp; <i>nodes</i> <b id="nn">0</b></div>
<div><i>pair tests</i> <b id="np">0</b> &nbsp; <i>brute</i> <i id="nx">0</i></div>
<div><i>hits</i> <b id="nh">0</b> &nbsp; <i>fps</i> <b id="nf">0</b></div>
</div>
<div id="bar"></div>
<script>
const cv=document.getElementById('c'),g=cv.getContext('2d'),CAP=4,MAXD=7,N=120,LIFE=780;
let W=0,H=0,balls=[],nodes=0,tests=0,hits=0,tick=0,flash=0,fps=60,last=performance.now();
function fit(){const d=Math.min(devicePixelRatio||1,2);W=innerWidth;H=innerHeight;cv.width=W*d;cv.height=H*d;cv.style.width=W+'px';cv.style.height=H+'px';g.setTransform(d,0,0,d,0,0);}
const R=(a,b)=>a+Math.random()*(b-a);
class QT{
  constructor(x,y,w,h,d){this.x=x;this.y=y;this.w=w;this.h=h;this.d=d;this.p=[];this.k=null;this.hot=0;}
  fits(o){return o.x>=this.x&&o.x<this.x+this.w&&o.y>=this.y&&o.y<this.y+this.h;}
  split(){const w=this.w/2,h=this.h/2,d=this.d+1;this.k=[new QT(this.x,this.y,w,h,d),new QT(this.x+w,this.y,w,h,d),new QT(this.x,this.y+h,w,h,d),new QT(this.x+w,this.y+h,w,h,d)];nodes+=4;
    for(const o of this.p)for(const c of this.k)if(c.insert(o))break;this.p.length=0;}
  insert(o){if(!this.fits(o))return false;if(this.k){for(const c of this.k)if(c.insert(o))return true;return true;}
    this.p.push(o);if(this.p.length>CAP&&this.d<MAXD)this.split();return true;}
  query(x1,y1,x2,y2,out){if(x1>this.x+this.w||x2<this.x||y1>this.y+this.h||y2<this.y)return;this.hot++;
    if(this.k){for(const c of this.k)c.query(x1,y1,x2,y2,out);}else{for(const o of this.p)out.push(o);}}
  draw(){if(this.hot){const a=Math.min(.26,this.hot*.035);g.fillStyle='rgba(46,214,255,'+a+')';g.fillRect(this.x,this.y,this.w,this.h);}
    if(this.k){g.strokeStyle='rgba(110,190,235,'+(.34-this.d*.033)+')';g.lineWidth=Math.max(.4,1.3-this.d*.14);
      g.beginPath();g.moveTo(this.x+this.w/2,this.y);g.lineTo(this.x+this.w/2,this.y+this.h);g.moveTo(this.x,this.y+this.h/2);g.lineTo(this.x+this.w,this.y+this.h/2);g.stroke();
      for(const c of this.k)c.draw();}}
}
function init(){balls=[];tick=0;flash=1;
  for(let i=0;i<N;i++){const r=R(4,11),s=R(.5,2.4),a=R(0,Math.PI*2);
    balls.push({i:i,x:R(r,W-r),y:R(r,H-r),vx:Math.cos(a)*s,vy:Math.sin(a)*s,r:r,m:r*r,h:R(0,360),c:0,gl:0});}}
function step(){
  for(const b of balls){b.x+=b.vx;b.y+=b.vy;b.gl*=.86;b.c=0;
    if(b.x<b.r){b.x=b.r;b.vx=Math.abs(b.vx);}else if(b.x>W-b.r){b.x=W-b.r;b.vx=-Math.abs(b.vx);}
    if(b.y<b.r){b.y=b.r;b.vy=Math.abs(b.vy);}else if(b.y>H-b.r){b.y=H-b.r;b.vy=-Math.abs(b.vy);}}
  nodes=1;tests=0;hits=0;
  const root=new QT(-1,-1,W+2,H+2,0);
  for(const b of balls)root.insert(b);
  const out=[];
  for(let i=0;i<balls.length;i++){const a=balls[i];out.length=0;
    root.query(a.x-a.r-12,a.y-a.r-12,a.x+a.r+12,a.y+a.r+12,out);
    for(const b of out){if(b.i<=i)continue;
      tests++;const dx=b.x-a.x,dy=b.y-a.y,d2=dx*dx+dy*dy,rr=a.r+b.r;
      if(d2>0&&d2<rr*rr){hits++;a.c=b.c=1;a.gl=b.gl=1;
        const d=Math.sqrt(d2),nx=dx/d,ny=dy/d,ov=(rr-d)/2,tm=a.m+b.m;
        a.x-=nx*ov;a.y-=ny*ov;b.x+=nx*ov;b.y+=ny*ov;
        const p=2*((a.vx-b.vx)*nx+(a.vy-b.vy)*ny)/tm;
        if(p>0){a.vx-=p*b.m*nx;a.vy-=p*b.m*ny;b.vx+=p*a.m*nx;b.vy+=p*a.m*ny;}}}}
  return root;
}
function frame(t){
  const dt=t-last;last=t;fps+=(1000/Math.max(dt,1)-fps)*.08;
  const root=step();
  g.fillStyle='rgba(5,7,13,.32)';g.fillRect(0,0,W,H);
  root.draw();
  g.strokeStyle='rgba(120,200,240,.5)';g.lineWidth=1;g.strokeRect(.5,.5,W-1,H-1);
  for(const b of balls){
    if(b.gl>.02){g.beginPath();g.arc(b.x,b.y,b.r+7*b.gl,0,6.2832);g.fillStyle='rgba(255,90,140,'+(b.gl*.3)+')';g.fill();}
    g.beginPath();g.arc(b.x,b.y,b.r,0,6.2832);
    g.fillStyle=b.c?'#ff5f8f':'hsl('+b.h+',72%,'+(52+b.gl*20)+'%)';g.fill();
    g.strokeStyle=b.c?'rgba(255,255,255,.95)':'rgba(255,255,255,.16)';g.lineWidth=b.c?2:1;g.stroke();}
  if(flash>0){g.fillStyle='rgba(180,240,255,'+flash*.55+')';g.fillRect(0,0,W,H);flash-=.05;}
  nb.textContent=balls.length;nn.textContent=nodes;np.textContent=tests;
  nx.textContent=(N*(N-1)/2);nh.textContent=hits;nf.textContent=fps.toFixed(0);
  bar.style.width=(100-tick/LIFE*100).toFixed(2)+'%';
  if(++tick>LIFE)init();
  requestAnimationFrame(frame);
}
addEventListener('resize',()=>{fit();init();});
fit();init();requestAnimationFrame(frame);
</script>
</body>
</html>