OverviewCode › R151
Code · blind round

R151 · Binary search tree growing node by node

blind round 7/11 local models answered

Every answer below carries the name of the model that wrote it. Blind refers to the scoring: the review was done without knowing which model produced which answer — the published result names them.

2 of the 11 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 — the reason is noted on the card itself.

Show task
Create ONE self-contained HTML file (STRICT LIMIT: max 7000 characters in total — this is a budget on characters, not on lines, so removing line breaks does not help) that animates a binary search tree on a <canvas>: insert about 15-20 random integer values one at a time using standard BST rules (each new value walks left or right by comparison from the root until it reaches an empty spot, no rotations or rebalancing), redrawing the whole tree after every insertion as circular nodes labelled with their value connected by straight edges to their parent, laid out so the tree visibly grows downward and widens level by level. Once all values are inserted, pick one of the existing values at random as a search target and animate a highlighted path of nodes and edges from the root down to that target following the real comparison steps (greater-goes-right, smaller-goes-left), pausing briefly at each visited node before continuing to the next. After the search finishes, clear the tree and restart with a fresh random set of values. Show the current node count. 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

Local models (Brain cluster) — identical prompt, shuffled order (the sequence is not a ranking)
qwen3:8bharness
No answer reached us (ERR) — and the reason lies with our setup, not with the model: reasoning consumed the entire token budget and the answer stayed empty; the gateway rejects budgets above 3000 tokens Counted as a did-not-finish, but it is not evidence about this model.
mistral-small:24bBLANKFORMAT
Show code
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Binary Search Tree Animation</title>
<style>
body { margin: 0; display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #f0f0f0; }
canvas { border: 1px solid #000; }
#info { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); font-family: Arial, sans-serif; font-size: 24px; color: #333; }
</style>
</head>
<body>
<canvas id="treeCanvas" width="800" height="600"></canvas>
<div id="info">Node Count: 0</div>
<script>
const canvas = document.getElementById('treeCanvas');
const ctx = canvas.getContext('2d');
const info = document.getElementById('info');
let nodeCount = 0;
let nodes = [];
let values = Array(15).fill().map(() => Math.floor(Math.random() * 100));
let currentValueIndex = 0;
let searchTarget, searchPath = [];
function drawTree() {
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    for (const node of nodes) {
        ctx.beginPath();
        ctx.arc(node.x, node.y, 20, 0, Math.PI * 2);
        ctx.fillStyle = 'white';
        ctx.fill();
        ctx.stroke();
        ctx.fillStyle = 'black';
        ctx.textAlign = 'center';
        ctx.font = '16px Arial';
        ctx.fillText(node.value, node.x, node.y + 4);
    }
    for (const node of nodes) {
        if (node.parent) {
            ctx.beginPath();
            ctx.moveTo(node.parent.x, node.parent.y);
            ctx.lineTo(node.x, node.y);
            ctx.stroke();
        }
    }
}
function insertValue(value) {
    let newNode = { value, x: canvas.width / 2, y: 30 };
    if (!nodes.length) nodes.push(newNode); else {
        let current = nodes[0];
        while (true) {
            newNode.parent = current;
            if (value < current.value) {
                if (!current.left) { current.left = newNode; break; }
                current = current.left;
            } else {
                if (!current.right) { current.right = newNode; break; }
                current = current.right;
            }
        }
    }
    nodes.push(newNode);
    nodeCount++;
}
function layoutTree(node, x, y, levelWidth) {
    if (node) {
        node.x = canvas.width / 2 - levelWidth + Math.random() * 20 - 10;
        node.y = y;
        let leftLevelWidth = 0.5 * levelWidth;
        let rightLevelWidth = 0.5 * levelWidth;
        if (node.left) layoutTree(node.left, x - levelWidth / 2, y + 80, leftLevelWidth);
        if (node.right) layoutTree(node.right, x + levelWidth / 2, y + 80, rightLevelWidth);
    }
}
function animateInsertion() {
    if (currentValueIndex < values.length) {
        insertValue(values[currentValueIndex]);
        currentValueIndex++;
        info.textContent = `Node Count: ${nodeCount}`;
        layoutTree(nodes[0], canvas.width / 2, 30, canvas.width);
        requestAnimationFrame(drawTree);
    } else startSearch();
}
function searchBST(target) {
    let path = [];
    let current = nodes[0];
    while (current) {
        path.push(current);
        if (target === current.value) break;
        current = target < current.value ? current.left : current.right;
    }
    return path;
}
async function animateSearch() {
    searchPath.forEach(node => node.highlighted = false);
    for (let i = 0; i < searchPath.length; i++) {
        searchPath[i].highlighted = true;
        drawTree();
        await new Promise(resolve => setTimeout(resolve, 500));
    }
    await new Promise(resolve => setTimeout(resolve, 1000));
    restart();
}
function startSearch() {
    searchTarget = values[Math.floor(Math.random() * values.length)];
    searchPath = searchBST(searchTarget).slice(0, -1);
    animateSearch();
}
async function restart() {
    nodes = [];
    values = Array(15).fill().map(() => Math.floor(Math.random() * 100));
    currentValueIndex = 0;
    nodeCount = 0;
    info.textContent = `Node Count: ${nodeCount}`;
    await new Promise(resolve => setTimeout(resolve, 500));
    animateInsertion();
}
function drawTreeHighlight() {
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    for (const node of nodes) {
        ctx.beginPath();
        ctx.arc(node.x, node.y, 20, 0, Math.PI * 2);
        if (node.highlighted) ctx.fillStyle = 'yellow'; else ctx.fillStyle = 'white';
        ctx.fill();
        ctx.stroke();
        ctx.fillStyle = 'black';
        ctx.textAlign = 'center';
        ctx.font = '16px Arial';
        ctx.fillText(node.value, node.x, node.y + 4);
    }
    for (const node of nodes) {
        if (node.parent && (!node.highlighted || node.parent.highlighted)) {
            ctx.beginPath();
            ctx.moveTo(node.parent.x, node.parent.y);
            ctx.lineTo(node.x, node.y);
            ctx.strokeStyle = node.highlighted ? 'yellow' : '#000';
            ctx.stroke();
        }
    }
}
animateInsertion();
</script>
</body>
</html>
```
qwen3:14bERRSTATLIMFORMAT
Show code
```html
<!DOCTYPE html>
<html><head><title>BST Animation</title><style>body{display:flex;justify-content:center;align-items:center;margin:0;}canvas{border:1px solid #ccc;background:#f9f9f9;}</style></head><script>const canvas = document.createElement('canvas');
canvas.width = 800;
canvas.height = 600;
document.body.appendChild(canvas);
const ctx = canvas.getContext('2d');

let tree = null;
let insertionQueue = [];
let state = 'INIT'; // INIT, INSERTING, SEARCHING, PAUSED
let animationFrameId = null;
let nodeCountDisplay = document.createElement('div');
nodeCountDisplay.style.position = 'absolute';
nodeCountDisplay.style.top = '10px';
nodeCountDisplay.style.left = '10px';
document.body.appendChild(nodeCountDisplay);

const MAX_NODES = 25;
let randomValues = [];

function Node(val, parent) {
    this.val = val;
    this.parent = parent;
    this.left = null;
    this.right = null;
}

function initializeTree() {
    tree = null;
    insertionQueue = [];
    randomValues = Array.from({length: Math.floor(Math.random() * 10) + 15}, () => Math.floor(Math.random() * 100) + 1);
    nodeCountDisplay.textContent = `Nodes: 0 / ${MAX_NODES}`;
    state = 'INIT';
}

function insertNode(val, root) {
    const newNode = new Node(val, null);
    if (!root) return newNode;

    let current = root;
    let parent = null;
    while (current) {
        parent = current;
        if (val < current.val) {
            current = current.left;
            newNode.parent = current ? current : parent; // Attempt to set correct parent, though BST structure handles this naturally later
        } else if (val > current.val) {
            current = current.right;
            newNode.parent = current ? current : parent;
        } else {
            return root; // Duplicate found (shouldn't happen with random set logic)
        }
    }

    if (val < parent.val && parent.left === null) {
        parent.left = newNode;
    } else if (val > parent.val && parent.right === null) {
        parent.right = newNode;
    }
    return root;
}

function buildTree(values) {
    let root = null;
    for (const val of values) {
        if (!root) {
            root = new Node(val, null);
        } else {
            root = insertNode(val, root);
        }
    }
    return root;
}

function drawTree(r) {
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    const START_X = 400;
    const LEVEL_HEIGHT = 80;
    const NODE_WIDTH = 60;
    const NODE_HEIGHT = 30;

    if (!r) return;

    let queue = [{node: r, level: 1, xOffset: START_X}];
    let nodesAtLevel = {};
    let maxNodes = Math.pow(2, Math.floor((canvas.height - NODE_HEIGHT) / LEVEL_HEIGHT));

    // Calculate required X spacing (simple breadth-first placement attempt)
    function mapNode(node, level, xStart, xSpacing) {
        const x = xStart + (xSpacing * 2) * Math.pow(0.85, level - 1);
        const y = LEVEL_HEIGHT * (level - 1) + 60;
        return { x: x, y: y };
    }

    // Simple recursive layout calculation for positioning the drawn nodes
    function calculatePositions(node, level, parentPos) {
        if (!node) return null;
        let pos = mapNode(node, level, START_X - (Math.pow(2, Math.min(level-1, 8)) * 50), 4);

        const leftChildPos = calculatePositions(node.left, level + 1, pos);
        const rightChildPos = calculatePositions(node.right, level + 1, pos);

        return { node: node, position: pos, leftPos: leftChildPos, rightPos: rightChildPos };
    }

    // The complexity of positioning requires simplifying the layout for performance/brevity
    // We will use a fixed column placement based on depth and relative index.
    const positions = [];
    function collectPositions(node, level) {
        if (!node) return;
        
        let x = START_X - (Math.pow(2, Math.min(level-1, 8)) * 40);
        let y = LEVEL_HEIGHT * (level - 1) + 60;

        positions.push({ node: node, x: x, y: y });
        collectPositions(node.left, level + 1);
        collectPositions(node.right, level + 1);
    }
    collectPositions(r, 1);

    // Draw Edges and Nodes based on calculated positions
    ctx.lineWidth = 2;
    for (let i = 0; i < positions.length - 1; i++) {
        const p1 = positions[i];
        if (!p1.node || !p1.node.parent) continue;

        // Find the parent position relative to the child's position
        const parentPosIndex = positions.findIndex(p => p.node === p1.node.parent);
        if (parentPosIndex !== -1) {
             ctx.beginPath();
             ctx.moveTo(positions[parentPosIndex].x, positions[parentPosIndex].y + 20);
             ctx.lineTo(p1.x, p1.y - 20);
             ctx.strokeStyle = '#333';
             ctx.stroke();
        }
    }

    // Draw Nodes (must be done after edges)
    for (const p of positions) {
        const { node, x, y } = p;
        ctx.beginPath();
        ctx.arc(x, y, 20, 0, Math.PI * 2);
        ctx.fillStyle = '#6aa';
        ctx.fill();
        ctx.strokeStyle = '#333';
        ctx.stroke();

        ctx.fillStyle = 'black';
        ctx.font = '14px sans-serif';
        ctx.textAlign = 'center';
        ctx.textBaseline = 'middle';
        ctx.fillText(node.val, x, y);
    }
}

function handleInsertion() {
    if (insertionQueue.length === 0) {
        state = 'SEARCHING_SETUP';
        return;
    }

    const val = insertionQueue.shift();
    let newRoot = tree ? insertNode(val, tree) : new Node(val, null);
    tree = newRoot;

    drawTree(tree);
    nodeCountDisplay.textContent = `Nodes: ${insertionQueue.length + 1} / ${MAX_NODES}`;

    setTimeout(() => {
        state = 'INIT'; // Transition state for next draw cycle
        animationFrameId = requestAnimationFrame(loop);
    }, 500);
}

function handleSearchSetup() {
    const values = Array.from({length: Math.floor(Math.random() * 10) + 15}, () => Math.floor(Math.random() * 100) + 1);
    const root = buildTree(values);
    tree = root;

    // Pick a random existing value that is not the root, if possible
    let targetVal = values[Math.floor(Math.random() * values.length)];
    if (targetVal === root.val) {
        targetVal = values[(Math.floor(Math.random() * (values.length - 1)) + 1) % (values.length - 1)];
    }

    animateSearch(root, targetVal);
}


function animateSearch(node, target) {
    let pathNodes = [];
    let current = node;
    let stepDelay = 200;

    function searchWalk(currentNode, targetValue) {
        if (!currentNode) return false;

        pathNodes.push(currentNode);
        const comparison = (targetValue < currentNode.val) ? 'L' : (targetValue > currentNode.val) ? 'R' : null;

        if (comparison === null) {
            return true; // Found
        } else if (comparison === 'L') {
            current = currentNode.left;
        } else {
            current = currentNode.right;
        }
        return searchWalk(current, targetValue);
    }

    searchWalk(node, target);

    let step = 0;
    function searchStep() {
        if (step >= pathNodes.length) {
            // Search finished
            state = 'FINISHED';
            setTimeout(() => {
                alert(`Search complete! Target ${target} was found/missed.`);
                handleSearchSetup(); // Restart loop
            }, 1000);
            return;
        }

        const nodeToHighlight = pathNodes[step];

        // Redraw the tree with highlights
        ctx.clearRect(0, 0, canvas.width, canvas.height);
        drawTreeWithHighlights(nodeToHighlight, step === pathNodes.length - 1);

        setTimeout(() => {
            state = 'PAUSED'; // Indicate waiting phase
            step++;
            animationFrameId = requestAnimationFrame(searchStep);
        }, stepDelay);
    }

    // Run the search animation loop
    animationFrameId = requestAnimationFrame(searchStep);
}


function drawTreeWithHighlights(highlightNode, isTarget) {
    const START_X = 400;
    const LEVEL_HEIGHT = 80;
    const NODE_WIDTH = 60;
    const NODE_HEIGHT = 30;

    // --- Simplified Layout Calculation (Re-using the structure from drawTree for simplicity) ---
    const positions = [];
    function collectPositions(node, level) {
        if (!node) return;
        let x = START_X - (Math.pow(2, Math.min(level-1, 8)) * 40);
        let y = LEVEL_HEIGHT * (level - 1) + 60;

        positions.push({ node: node, x: x, y: y });
        collectPositions(node.left, level + 1);
        collectPositions(node.right, level + 1);
    }
    collectPositions(tree, 1);


    // Draw Edges and Nodes (Standard drawing)
    ctx.lineWidth = 2;
    for (let i = 0; i < positions.length - 1; i++) {
        const p1 = positions[i];
        if (!p1.node || !p1.node.parent) continue;

        const parentPosIndex = positions.findIndex(p => p.node === p1.node.parent);
        if (parentPosIndex !== -1) {
             ctx.beginPath();
             ctx.moveTo(positions[parentPosIndex].x, positions[parentPosIndex].y + 20);
             ctx.lineTo(p1.x, p1.y - 20);
             ctx.strokeStyle = '#333';
             ctx.stroke();
        }
    }

    // Draw Nodes with highlights
    for (const p of positions) {
        const { node, x, y } = p;
        let fillStyle = '#6aa';
        let strokeStyle = '#333';
        let radius = 20;

        if (node === highlightNode) {
            fillStyle = isTarget ? '#aaa' : '#ffcc00'; // Target or Active Search Node
            strokeStyle = '#ff9900';
        } else if (p.node === tree && p !== positions[0]) {
             // Highlight root on search start
             if(typeof highlightNode === 'undefined') fillStyle = '#6aa';
        }

        ctx.beginPath();
        ctx.arc(x, y, radius, 0, Math.PI * 2);
        ctx.fillStyle = fillStyle;
        ctx.fill();
        ctx.strokeStyle = strokeStyle;
        ctx.stroke();

        ctx.fillStyle = 'black';
        ctx.font = '14px sans-serif';
        ctx.textAlign = 'center';
        ctx.textBaseline = 'middle';
        ctx.fillText(node.val, x, y);
    }
}


function loop() {
    if (state === 'INIT') {
        // Check if insertion is ready to proceed
        handleInsertion();
    } else if (state === 'SEARCHING_SETUP' || state === 'PAUSED') {
        // Wait for the search animation to finish its cycle/timeout
        animationFrameId = requestAnimationFrame(loop);
    }
}

// --- Initialization and Startup ---
initializeTree();
handleSearchSetup(); // Start immediately with the first full sequence (Build -> Search)
requestAnimationFrame(loop);

</script></html>
```
qwen3.5:9bERRBLANKLIMFORMAT
Show code
```html
<!DOCTYPE html>
<html>
<head>
<title>BST Animation</title>
<style>
body { background: #111; display: flex; justify-content: center; align-items: center; min-height: 100vh; margin: 0; }
canvas { border: 1px solid #333; background: #222; }
</style>
</head>
<body>
<canvas id="bstCanvas"></canvas>

<script>
const canvas = document.getElementById('bstCanvas');
const ctx = canvas.getContext('2d');
let nodeCount = 0;
let tree = null;
let animationState = {};
let frameId = null;

// Configuration
const CANVAS_WIDTH = 900;
const CANVAS_HEIGHT = 650;
canvas.width = CANVAS_WIDTH;
canvas.height = CANVAS_HEIGHT;

// BST Node structure
function TreeNode(val) {
    this.value = val;
    this.left = null;
    this.right = null;
    this.parent = null;
}

// Utility function to generate random unique integers (10-30 range for a compact tree)
function getRandomArray(count) {
    const set = new Set();
    while (set.size < count) {
        set.add(Math.floor(Math.random() * 20) + 10); // Range [10, 30]
    }
    return Array.from(set).sort(() => Math.random() - Math.random());
}

// --- BST Operations ---

function insertNode(root, val) {
    const newNode = new TreeNode(val);
    if (!root) return [newNode]; // Special case: empty tree
    
    let current = root;
    let parent = null;
    while (current) {
        parent = current;
        if (val < current.value) {
            current = current.left;
        } else if (val > current.value) {
            current = current.right;
        } else {
            // Should not happen with unique random values
            return [root]; 
        }
    }

    newNode.parent = parent;
    if (val < parent.value) {
        parent.left = newNode;
    } else {
        parent.right = newNode;
    }
    return [root]; // Returns the new root structure after insertion
}

// --- Visualization and Layout ---

/** 
 * Calculates coordinates for all nodes using a level-order traversal approach.
 * Assigns X based on horizontal position (relative index) and Y based on depth.
 */
function calculateLayout(root) {
    if (!root) return {};

    const layout = {}; // Stores {node: {x, y}, ...}
    const queue = [{ node: root, level: 0, x_offset: CANVAS_WIDTH / 2 }];
    let maxDepth = 0;
    let minX = CANVAS_WIDTH * 0.9;
    let maxX = 0;

    // BFS to determine coordinates
    while (queue.length > 0) {
        const { node, level, x_offset } = queue.shift();

        layout[node] = { x: x_offset, y: level * 70 + 50 }; // Fixed spacing assumption

        if (node.left) {
            queue.push({ node: node.left, level: level + 1, x_offset: x_offset - 120 });
        }
        if (node.right) {
            queue.push({ node: node.right, level: level + 1, x_offset: x_offset + 120 });
        }
    }

    // Simple layout adjustment to center and spread based on max width
    let allNodes = Object.values(layout);
    if (allNodes.length > 0) {
        const minXCoord = Math.min(...Object.values(layout).map(l => l.x));
        const maxXCoord = Math.max(...Object.values(layout).map(l => l.x));
        const range = maxXCoord - minXCoord;
        const scaleFactor = CANVAS_WIDTH / (range * 1.2); // Scale to fit comfortably

        for (let node in layout) {
            // Recenter the X coordinates while preserving relative spacing and vertical structure
            layout[node].x = Math.min(CANVAS_WIDTH - 50, Math.max(50, layout[node].x * scaleFactor + 50));
        }
    }

    return layout;
}


// --- Drawing Functions ---

function drawTree(root, layout) {
    ctx.clearRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT);

    const NODE_RADIUS = 18;
    const PRIMARY_COLOR = '#4CAF50';
    const EDGE_COLOR = '#666';
    const FADE_COLOR = 'rgba(255, 255, 255, 0.1)';

    // Draw edges first
    ctx.strokeStyle = EDGE_COLOR;
    ctx.lineWidth = 2;
    for (let node in layout) {
        const n = node;
        const l = layout[n];

        if (l.parent && l.parent !== root) { // Skip drawing parent to root connection here
            // Draw child -> parent edge
            ctx.beginPath();
            ctx.moveTo(l.x, l.y);
            ctx.lineTo(layout[l.parent].x, layout[l.parent].y);
            ctx.stroke();
        }
    }

    // Draw nodes second (and handle root connection explicitly)
    for (let node in layout) {
        const n = node;
        const l = layout[n];
        
        // 1. Draw Node Circle & Label
        ctx.beginPath();
        ctx.arc(l.x, l.y, NODE_RADIUS, 0, Math.PI * 2);
        ctx.fillStyle = PRIMARY_COLOR;
        ctx.fill();
        ctx.strokeStyle = '#388E3C';
        ctx.lineWidth = 2;
        ctx.stroke();

        ctx.fillStyle = 'white';
        ctx.textAlign = 'center';
        ctx.textBaseline = 'middle';
        ctx.font = 'bold 14px Arial';
        ctx.fillText(n.value, l.x, l.y);
    }
    document.getElementById('nodeCount').textContent = nodeCount;
}

// --- Animation Phases ---

function animateInsertion(root) {
    if (!animationState.inserting || animationState.insertedNodes.length >= 20) {
        finishAnimation();
        return;
    }

    const newNodeValue = Math.floor(Math.random() * 20) + 10;
    let newRoot = root;

    // Check for duplicates (rare but possible)
    if (tree && tree.contains(newNodeValue)) {
        console.warn("Skipping duplicate insertion.");
        animationState.insertedNodes.push(null); // Simulate no change state
        return; 
    }
    
    newRoot = insertNode(root, newNodeValue);
    tree = newRoot;
    nodeCount++;

    // Update state and redraw
    animationState.insertedNodes.push(true);
    drawTree(newRoot, calculateLayout(newRoot));

    if (frameId) {
        window.requestAnimationFrame(() => animateInsertion(newRoot));
    } else {
        frameId = window.requestAnimationFrame(() => animateInsertion(newRoot));
    }
}


function animateSearch(startNode, targetValue) {
    animationState.searchPath = [];
    let currentNode = startNode;
    let currentStep = 0;

    // Initialize path and state
    animationState.pathNodes = [startNode];
    animationState.pathEdges = new Set(); // Stores pairs of nodes (parent, child)

    const ANIMATION_SPEED = 700; // ms per step

    function searchStep() {
        if (!currentNode || currentStep > 0 && currentNode.value === targetValue) {
            // Search finished or reached null branch
            animationState.isSearching = false;
            drawTree(tree, calculateLayout(tree));
            setTimeout(() => restartCycle(), 1500); // Wait before restarting
            return;
        }

        let nextNode = null;
        let edgeFound = new Set(); // To track which edges are highlighted this step

        if (targetValue < currentNode.value) {
            nextNode = currentNode.left;
            edgeFound.add(`${currentNode.value}_${Math.round(nextNode.value)}`);
        } else if (targetValue > currentNode.value) {
            nextNode = currentNode.right;
            edgeFound.add(`${currentNode.value}_${Math.round(nextNode.value)}`);
        }

        // Update path state
        if (nextNode) {
             animationState.pathNodes.push(nextNode);
             animationState.pathEdges.add(`${Math.min(currentNode.value, nextNode.value)}_${Math.max(currentNode.value, nextNode.value)}`);
        } else if (currentStep === 0 && targetValue !== currentNode.value) {
            // Edge case: Target not found starting from root
             animationState.isSearching = false;
             setTimeout(() => restartCycle(), 1500);
             return;
        }

        currentNode = nextNode;
        currentStep++;

        drawSearch(calculateLayout(tree), edgeFound, currentNode);

        // Schedule the next step
        if (frameId) {
            cancelAnimationFrame(frameId);
        }
        frameId = setTimeout(() => searchStep(), ANIMATION_SPEED);
    }

    searchStep(); 
}

function drawSearch(layout, currentEdges, finalNode) {
    ctx.clearRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT);
    const NODE_RADIUS = 18;
    const PRIMARY_COLOR = '#4CAF50';
    const EDGE_COLOR = '#666';
    const HIGHLIGHT_COLOR = 'yellow';

    // Draw all edges (faded)
    ctx.strokeStyle = EDGE_COLOR;
    ctx.lineWidth = 2;
    for (let node in layout) {
        const n = node;
        const l = layout[n];
        if (l.parent && l.parent !== treeRoot) {
            ctx.beginPath();
            ctx.moveTo(l.x, l.y);
            ctx.lineTo(layout[l.parent].x, layout[l.parent].y);
            ctx.stroke();
        }
    }

    // Draw current step highlights (bright)
    if (currentEdges && currentEdges.size > 0) {
         ctx.strokeStyle = HIGHLIGHT_COLOR;
         ctx.lineWidth = 3;
         for (const edgeKey of currentEdges) {
             // Simple heuristic to find the two nodes connected by this key
             let n1, n2;
             if (edgeKey.includes('_')) {
                 [n1, n2] = edgeKey.split('_').map(Number);
             } else {
                continue;
            }

             // This approach is flawed due to the complexity of finding nodes by value from the layout map. 
             // Simplified: Just draw a temporary bounding box around the path for visual effect.
         }
    }


    // Draw all nodes (standard)
     for (let node in layout) {
        const l = layout[node];
        ctx.beginPath();
        ctx.arc(l.x, l.y, NODE_RADIUS, 0, Math.PI * 2);
        ctx.fillStyle = PRIMARY_COLOR;
        ctx.fill();
        ctx.strokeStyle = '#388E3C';
        ctx.lineWidth = 2;
        ctx.stroke();

        ctx.fillStyle = 'white';
        ctx.textAlign = 'center';
        ctx.textBaseline = 'middle';
        ctx.font = 'bold 14px Arial';
        ctx.fillText(node.value, l.x, l.y);
    }


    // Highlight the target node (if reached)
    if (finalNode && finalNode.value === animationState.targetValue) {
        const l = layout[finalNode];
        ctx.beginPath();
        ctx.arc(l.x, l.y, NODE_RADIUS + 5, 0, Math.PI * 2);
        ctx.strokeStyle = 'red';
        ctx.lineWidth = 4;
        ctx.stroke();
    }

    // Highlight the current node (where search stopped this frame)
    if (finalNode && finalNode !== treeRoot) {
         const l = layout[finalNode];
        ctx.beginPath();
        ctx.arc(l.x, l.y, NODE_RADIUS + 5, 0, Math.PI * 2);
        ctx.strokeStyle = 'yellow';
        ctx.lineWidth = 4;
        ctx.stroke();
    }

    // If this is the final draw (after search)
     if (!animationState.isSearching && layout[finalNode]) {
         drawTree(tree, calculateLayout(tree));
     }
}


function startCycle() {
    nodeCount = 0;
    tree = null;
    animationState = {};

    // Phase 1: Insertion Animation
    const numNodes = Math.floor(Math.random() * 5) + 18; // 18 to 23 nodes
    const values = getRandomArray(numNodes);
    let currentRoot = null;
    
    animationState.isInserting = true;
    animationState.insertedNodes = [];

    // Build the tree iteratively for animation state management
    values.forEach(val => {
        if (!currentRoot) {
            currentRoot = new TreeNode(val);
            currentRoot.parent = null;
            tree = currentRoot;
        } else {
            const nextRoot = insertNode(currentRoot, val);
            tree = nextRoot;
            currentRoot = nextRoot;
        }
    });

    // Start the animation loop
    animationState.isInserting = true;
    frameId = window.requestAnimationFrame(() => animateInsertion(currentRoot));
}


function searchTarget() {
    if (!tree) return;

    const valuesArray = [];
    let temp = tree;
    while(temp) {
        valuesArray.push(temp.value);
        if (temp.left) temp = temp.left; else if (temp.right) temp = temp.right; else { temp = null; }
    }
    // Fast way to get all values: BFS/DFS traversal
    const queue = [tree];
    let allValues = [];
    while(queue.length > 0) {
        const node = queue.shift();
        allValues.push(node);
        if (node.left) queue.push(node.left);
        if (node.right) queue.push(node.right);
    }


    // Pick a random existing value as the target
    const randomIndex = Math.floor(Math.random() * allValues.length);
    const targetNode = allValues[randomIndex];
    const targetValue = targetNode.value;

    animationState.isSearching = true;
    animationState.targetValue = targetValue;
    
    // Ensure the layout is redrawn before search starts
    drawTree(tree, calculateLayout(tree)); 
    
    setTimeout(() => {
        if (frameId) cancelAnimationFrame(frameId);
        animateSearch(tree, targetValue);
    }, 1500); // Pause after insertion to show the final tree state
}

function restartCycle() {
    // Set a delay before starting the next cycle
    setTimeout(() => {
        if (frameId) cancelAnimationFrame(frameId);
        startCycle();
    }, 2000);
}


// --- Initialization ---
window.onload = function() {
    startCycle();
};

</script>
</body>
</html>
```
llama3.1:8bERRBLANKLIMFORMAT
Show code
```html
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Binary Search Tree Animation</title>
    <style>
        body {
            margin: 0;
            overflow: hidden;
        }
        #canvas {
            border: 1px solid black;
        }
    </style>
</head>
<body>
<canvas id="canvas" width="800" height="600"></canvas>
<script>
    let canvas = document.getElementById('canvas');
    let ctx = canvas.getContext('2d');
    canvas.width = window.innerWidth - 20;
    canvas.height = window.innerHeight - 20;

    class Node {
        constructor(value, x, y) {
            this.value = value;
            this.x = x;
            this.y = y;
            this.left = null;
            this.right = null;
        }
    }

    let root = null;
    let treeNodes = [];

    function drawTree() {
        ctx.clearRect(0, 0, canvas.width, canvas.height);
        if (root) {
            drawNode(root);
        }
        document.getElementById('node-count').textContent = 'Node count: ' + treeNodeCount();
        drawText(root, root.x, root.y - 20);
    }

    function drawNode(node) {
        ctx.beginPath();
        ctx.arc(node.x, node.y, 10, 0, Math.PI * 2);
        ctx.fillStyle = 'red';
        ctx.fill();
        ctx.font = '12px Arial';
        ctx.textAlign = "center";
        ctx.textBaseline = "middle";
        ctx.fillText(node.value.toString(), node.x, node.y + 5);

        if (node.left) {
            ctx.beginPath();
            ctx.moveTo(node.x, node.y);
            ctx.lineTo(node.left.x, node.y + 30);
            ctx.stroke();

            ctx.beginPath();
            ctx.arc(node.left.x, node.y + 30, 10, 0, Math.PI * 2);
            ctx.fillStyle = 'red';
            ctx.fill();
            ctx.textAlign = "center";
            ctx.textBaseline = "middle";
            ctx.fillText(node.left.value.toString(), node.left.x, node.y + 35);

        }
        if (node.right) {
            ctx.beginPath();
            ctx.moveTo(node.x, node.y);
            ctx.lineTo(node.right.x, node.y + 30);
            ctx.stroke();

            ctx.beginPath();
            ctx.arc(node.right.x, node.y + 30, 10, 0, Math.PI * 2);
            ctx.fillStyle = 'red';
            ctx.fill();
            ctx.textAlign = "center";
            ctx.textBaseline = "middle";
            ctx.fillText(node.right.value.toString(), node.right.x, node.y + 35);

        }
    }

    function drawText(root, x, y) {
        if (root.left || root.right) {
            if (root.left) {
                drawText(root.left, x - 150, y);
            }
            if (root.right) {
                drawText(root.right, x + 150, y);
            }
        } else {
            ctx.font = '16px Arial';
            ctx.textAlign = "center";
            ctx.textBaseline = "middle";
            ctx.fillStyle = 'black';
            ctx.fillText('Root', x, y - 20);

        }

    }

    function treeNodeCount() {
        if (root) {
            return countNodes(root);
        }
        return 0;
    }

    function countNodes(node) {
        if (!node) {
            return 0;
        }
        return 1 + countNodes(node.left) + countNodes(node.right);
    }

    let values = [];
    for (let i = 0; i < 15; i++) {
        values.push(Math.floor(Math.random() * 100));
    }
    function insertValue(value) {
        if (!root) {
            root = new Node(value, canvas.width / 2, 20);
            treeNodes.push(root);
        } else {
            let node = findNode(root, value);
            if (node === null || !value) {
                return;
            }
            let newNode = new Node(value, node.x + (Math.random() < 0.5 ? -150 : 150), node.y + 30);

            if (value > newNode.value) {
                node.right = newNode;
                treeNodes.push(newNode);
            } else {
                node.left = newNode;
                treeNodes.push(newNode);
            }
        }

        drawTree();
    }

    function findNode(node, value) {
        while (node) {
            if (value == node.value || !value) return node;

            let comparisonResult = compare(value, node.value);

            if (comparisonResult === 1 && node.right) {
                node = node.right;
                continue
            } else if (node.left) {
                node = node.left;
            }
        }

        function compare(a, b) {
            if (a > b) return 1;
            else if (b > a) return -1;
            else return 0;

        }

        return null;
    }

    const randomValue = () => Math.floor(Math.random() * 100);
    let targetNode = findNode(root, randomValue());
    function searchTarget() {
        ctx.clearRect(0, 0, canvas.width, canvas.height);
        if (targetNode) {
            drawPath(targetNode);

            document.getElementById('node-count').textContent = 'Node count: ' + treeNodeCount();

            const animateSearch = () => {
                requestAnimationFrame(() => {
                    let pathLength = treeNodes.indexOf(targetNode) - 0;
                    if (pathLength < treeNodes.length - 1) {

                        for (let i = 0; i <= pathLength; i++) {
                            drawPath(treeNodes[i]);
                        }
                        ctx.font = '16px Arial';
                        ctx.textAlign = "center";
                        ctx.fillStyle = 'black';
                        let currentText = '';

                        if (i == treeNodes.length -1) {

                            for (let node of treeNodes.slice(0, i)) {
                                currentText += node.value + ' ';
                            }
                        } else {
                            for (let j = 0; j < treeNodes.length - pathLength - 1; j++) {
                                currentText += treeNodes[j].value + ' ';
                            }

                        }
                        ctx.fillText(currentText, canvas.width / 2, 20);
                    } else if (pathLength == treeNodes.length - 1) {

                        for (let i = 0; i < treeNodes.length - 1; i++) {
                            drawPath(treeNodes[i]);
                        }
                        drawPath(treeNodes[treeNodes.length-1]);

                        ctx.font = '16px Arial';
                        ctx.textAlign = "center";
                        ctx.fillStyle = 'black';

                        for (let node of treeNodes.slice(0, treeNodes.length - 1)) {
                            currentText += node.value + ' ';
                        }
                    }

                    animateSearch();
                });
            };
            animateSearch();
        } else {

            insertValue(randomValue())

        }
    }

    function drawPath(node) {
        ctx.beginPath();
        ctx.arc(node.x, node.y, 10, 0, Math.PI * 2);
        ctx.fillStyle = 'yellow';
        ctx.fill();

        if (node.left != null) {
            ctx.beginPath();
            ctx.moveTo(node.x, node.y);
            ctx.lineTo(node.left.x, node.y + 30);
            ctx.strokeStyle = "black";
            ctx.stroke();
            ctx.beginPath();
            ctx.arc(node.left.x, node.y + 30, 10, 0, Math.PI * 2);
            ctx.fillStyle = 'yellow';
            ctx.fill();

        }
        if (node.right != null) {
            ctx.beginPath();
            ctx.moveTo(node.x, node.y);
            ctx.lineTo(node.right.x, node.y + 30);
            ctx.strokeStyle = "black";
            ctx.stroke();
            ctx.beginPath();
            ctx.arc(node.right.x, node.y + 30, 10, 0, Math.PI * 2);
            ctx.fillStyle = 'yellow';
            ctx.fill();

        }

    }

    let startTime = Date.now();
    const animateTree = () => {
        requestAnimationFrame(() => {
            searchTarget();
            if (Date.now() - startTime > 5000) {

                root = null;
                treeNodes.splice(0, treeNodes.length);
                document.getElementById('node-count').textContent = 'Node count: 0';
                values = [];
                for (let i = 0; i < 15; i++) {
                    values.push(Math.floor(Math.random() * 100));
                }
                startTime = Date.now();
            } else {
                animateTree();
            }

        });

    };

    drawTree();

    animateTree()
</script>
<div id="node-count"></div>
</body>

</html>
```
deepseek-r1:14bERRBLANKFORMAT
Show code
```html
<!DOCTYPE html>
<html><body style="background:#000;margin:0;display:flex;flex-direction:column;align-items:center">
<canvas id=c width=800 height=600></canvas>
<div id=count style="color:#fff">Nodes: 0</div>
<script>
function TreeCanvas(cElement) {
    let canvas = cElement;
    let ctx = canvas.getContext('2d');
    let nodes = [];
    let nodeCount = 0;
    let animationId;
    let maxVal=15;
    
    function Node(v) {
        this.v = v; this.left=null;this.right=null;
        this.x=null; this.y=null; this.width=40;
    }
    
    Node.prototype.draw = function() {
        ctx.beginPath();
        ctx.arc(this.x, this.y, 20, 0, Math.PI*2);
        ctx.fillStyle='#fff';ctx.fill();
        ctx.strokeStyle='#000';ctx.stroke();
        
        if(this.v>9) ctx.font='15px Arial'; else ctx.font='20px Arial';
        ctx.fillStyle='#000';ctx.textAlign='center'; 
        ctx.fillText(this.v.toString(), this.x, this.y);
    };
    
    function connect(n,p) {
        if(!p.x||!n.x) return;
        ctx.beginPath();
        ctx.moveTo(p.x, p.y+25);
        ctx.lineTo((p.x+p.rightChildX)/2, (p.y+p.y+100)/2);
        ctx.stroke();
    }
    
    function insert(v,p,callback) {
        if(!p) {let n=new Node(v);n.x=canvas.width/2;n.y=30;nodes.push(n);return n;}
        
        if(v < p.v) {
            if(p.left) return insert(v, p.left,callback);
            let n = new Node(v);
            n.x = p.x - 50;
            n.y = p.y + 100;
            nodes.push(n);
            callback?.();
            p.left=n;
        } else {
            if(p.right) return insert(v,p.right,callback);
            let n=new Node(v);
            n.x=p.x+50;n.y=p.y+100;nodes.push(n);callback?.();p.right=n
        }
    }
    
    function reset() {nodes=[];nodeCount=0;}
    
    function drawTree() {
        ctx.fillStyle='#000';ctx.fillRect(0,0,canvas.width,canvas.height);
        nodes.forEach(n => n.draw());
        const paths = [];
        for(let node of nodes) {
            if(node.parent) paths.push([node.parent, node]);
            else if(node.left||node.right) paths.push([node, node.left||node.right])
        }
        paths.forEach(([p,c]) => connect(c,p));
    }
    
    function randomInt(min,max) {return Math.floor(Math.random()*(max-min+1)+min)}
    
    function insertRandomNode() {
        let v=randomInt(0,99); 
        let newRoot=insert(v,null,( ()=>{nodeCount++;drawTree();}) );
        if(maxVal<20 && nodes.length==Math.pow(2,maxVal)-1) maxVal++;
    }
    
    function searchHighlight(target) {
        ctx.fillStyle='#ff0000';ctx.globalAlpha=0.5;
        let path=[null];
        let current=root;
        while(current!=target) {
            path.push(current);
            if(target.v < current.v) current=current.left; 
            else current=current.right;
        }
        path.push(target);path.reverse();
        
        for(let i=1;i<path.length-1;i++) {
            setTimeout(() => {
                drawTree();
                path[i].draw();
                ctx.globalAlpha=0.8;
            }, 50*i);
        }
    }
    
    let root=null;
    function initAnimation() {
        reset();nodeCount=0;root=null;
        
        for(let i=0;i<15;i++) insertRandomNode();
        
        const target = nodes[Math.floor(Math.random()*nodes.length)];
        searchHighlight(target);
        
        setTimeout(initAnimation, 2000 + (nodes.length-1)*50);
    }
    
    initAnimation();
</script>
</body></html>
```
gemma4:26bharness
No answer reached us (ERR) — and the reason lies with our setup, not with the model: reasoning consumed the entire token budget (3 min 28 s, zero characters of answer); larger budgets are refused by the gateway Counted as a did-not-finish, but it is not evidence about this model.
qwen3-coder:30bERRBLANKLIMFORMAT
Show code
```html
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><title>BST Animation</title></head><body style="margin:0;overflow:hidden;"><canvas id="bstCanvas" width="960" height="720"></canvas><script>
const canvas = document.getElementById('bstCanvas');
const ctx = canvas.getContext('2d');

class Node {
    constructor(value) {
        this.value = value;
        this.left = null;
        this.right = null;
        this.parent = null;
        // Visualization properties
        this.x = 0;
        this.y = 0;
        this.depth = 0;
    }
}

let root = null;
const MAX_NODES = Math.floor(Math.random() * (25 - 18 + 1)) + 18; // 18 to 25 nodes
let currentStep = 0;
let animationQueue = [];
let isAnimating = false;

function insert(newValue) {
    if (!root) {
        root = new Node(newValue);
        return root;
    }
    let current = root;
    let parent = null;

    while (current && current.value !== newValue) {
        parent = current;
        if (newValue < current.value) {
            current = current.left;
        } else if (newValue > current.value) {
            current = current.right;
        } else {
            return root; // Duplicate not allowed
        }
    }

    const newNode = new Node(newValue);
    newNode.parent = parent;
    if (!parent) return root; // Should only happen if root was null, handled above
    
    if (newValue < parent.value) {
        parent.left = newNode;
    } else {
        parent.right = newNode;
    }
    return root;
}

function calculateLayout(node, depth, x_offset) {
    if (!node) return 0;

    const spacing = Math.max(50, Math.min(200, canvas.width / (Math.pow(2, node.depth)))); // Dynamic horizontal scaling
    const y_step = 70;
    const x_pos = x_offset + (spacing * Math.pow(2, depth));

    node.y = y_step * depth + 50;
    node.x = x_pos;
    node.depth = depth;

    let totalWidth = spacing / 2;
    totalWidth += calculateLayout(node.left, depth + 1, x_offset);
    if (node.right) {
        // Adjust offset for the right subtree to prevent overlap and maintain relative spacing
        const adjustedOffset = x_offset + (spacing * Math.pow(2, depth)) + totalWidth;
        totalWidth += calculateLayout(node.right, depth + 1, adjustedOffset);
    }

    return totalWidth;
}


function drawTree(highlightNodes = [], searchPath = []) {
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    
    if (!root) return;

    // Calculate positions before drawing
    calculateLayout(root, 0, 50);

    // Draw Edges and Nodes
    const drawElement = (node, isHighlight = false, isSearch = false) => {
        ctx.strokeStyle = 'rgba(100, 100, 100, 0.8)';
        ctx.fillStyle = isHighlight ? 'red' : (isSearch && node === highlightNodes[0] ? 'orange' : '#4CAF50');
        ctx.lineWidth = 2;

        // Draw Edge
        if (node !== root) {
            const p = node.parent;
            ctx.strokeStyle = isHighlight ? 'red' : searchPath.includes(p) && searchPath.includes(node) ? '#FF9800' : '#aaa';
            ctx.beginPath();
            ctx.moveTo(p.x, p.y);
            ctx.lineTo(node.x, node.y);
            ctx.stroke();
        }

        // Draw Node Circle
        const size = 20;
        ctx.beginPath();
        ctx.arc(node.x, node.y, size, 0, Math.PI * 2);
        if (isHighlight) {
             ctx.shadowColor = 'red';
             ctx.shadowBlur = 15;
             ctx.fill();
             ctx.strokeStyle = 'red';
             ctx.lineWidth = 3;
         } else if (isSearch && node === highlightNodes[0]) {
            ctx.fillStyle = '#FF9800';
            ctx.shadowColor = 'rgba(255, 160, 0, 0.7)';
            ctx.shadowBlur = 15;
            ctx.fill();
            ctx.strokeStyle = '#FF9800';
             ctx.lineWidth = 3;
        } else {
             ctx.fillStyle = '#4CAF50';
             ctx.shadowColor = 'none';
             ctx.shadowBlur = 5;
             ctx.fill();
             ctx.strokeStyle = '#388E3C';
             ctx.lineWidth = 2;
        }

        // Draw Label
        ctx.fillStyle = '#fff';
        ctx.textAlign = 'center';
        ctx.textBaseline = 'middle';
        ctx.font = '14px Arial';
        ctx.fillText(node.value, node.x, node.y);
    };

    // Use a queue/breadth-first approach to ensure parent drawing happens before child drawing (for correct edges)
    const drawQueue = [root];
    while (drawQueue.length > 0) {
        const node = drawQueue.shift();
        let isHighlightNode = highlightNodes.includes(node);
        let isSearchTarget = searchPath.includes(node);

        // Pass the current node's state to drawing function
        drawElement(node, isHighlightNode, isSearchTarget);

        if (node.left) drawQueue.push(node.left);
        if (node.right) drawQueue.push(node.right);
    }
}

function animateInsertionStep() {
    if (!animationQueue.length || currentStep >= animationQueue.length) {
        // Finished insertion phase
        setTimeout(setupSearchPhase, 500);
        return;
    }

    const step = animationQueue[currentStep];
    drawTree(); // Redraws the tree with the latest structure
    animationQueue.shift(); // We only need to process one frame per call now
    currentStep++;
    setTimeout(animateInsertionStep, 200);
}


function setupSearchPhase() {
    if (!root || !root.left && !root.right) {
        alert("Tree is too small or empty.");
        runCycle();
        return;
    }

    // Select a random node that isn't the root (to show movement)
    let allNodes = [];
    const collectNodes = (node) => {
        if (!node) return;
        allNodes.push(node);
        collectNodes(node.left);
        collectNodes(node.right);
    };
    collectNodes(root);

    let targetNode = null;
    // Ensure we pick a valid node to search for
    const availableIndices = allNodes.map((_, i) => i).filter(i => i !== 0 && Math.random() < 0.9); // Exclude root sometimes, but let's just pick randomly
    if (availableIndices.length === 0) {
        targetNode = allNodes[Math.floor(Math.random() * allNodes.length)];
    } else {
        let randomIndex = Math.floor(Math.random() * availableIndices.length);
        targetNode = allNodes[availableIndices[randomIndex]];
    }

    // 1. Determine Search Path
    const path = [];
    let current = root;
    while (current && current !== targetNode) {
        path.push(current);
        if (targetNode.value < current.value) {
            current = current.left;
        } else if (targetNode.value > current.value) {
            current = current.right;
        } else {
             break; // Should not happen if target was picked correctly, but safety break
        }
    }
    if (current === targetNode && path.length > 0) {
         path.push(targetNode);
    } else if (!root) {
         // Fallback for empty tree
         path.length = 0; 
    }

    animationQueue = []; // Clear queue for the search phase
    let steps[] = path;
    if (steps.length === 0 && targetNode !== root) {
        alert("Error determining path.");
        return runCycle();
    }
    
    // Store all nodes in the path, including parent-child links needed for comparison visualization
    for(let i=1; i < steps.length; i++) {
         animationQueue.push({ 
             type: 'search', 
             path: steps.slice(0, i+1), // Path up to and including the current node
             target: steps[i]
        });
    }

    // Start search animation loop
    animateSearchStep();
}


function animateSearchStep() {
    if (!animationQueue.length) {
        // Finished searching, wait briefly then restart cycle
        setTimeout(runCycle, 1500);
        return;
    }

    const stepData = animationQueue.shift();
    
    drawTree(
        stepData.target ? [stepData.target] : [], // Highlight the current comparison target (the newly reached node)
        stepData.path
    );

    // Pause for 800ms at each step
    setTimeout(animateSearchStep, 800);
}


function runCycle() {
    if (isAnimating) return;
    isAnimating = true;
    currentStep = 0;
    animationQueue = [];

    // --- Phase 1: Insertion Setup ---
    const values = Array.from({length: MAX_NODES}, () => Math.floor(Math.random() * (50 - 10 + 1)) + 10);
    values.sort(() => Math.random() - Math.random()); // Shuffle

    // Initialize root
    root = null;
    for (let i = 0; i < values.length; i++) {
        const val = values[i];
        if (!root) {
            root = new Node(val);
        } else {
            insert(val);
        }
        // Add a dummy entry to the queue for visualization control
        animationQueue.push({ type: 'insert', value: val }); 
    }

    // Start insertion animation
    animateInsertionStep();
}


function animate() {
    if (!isAnimating) return;
    requestAnimationFrame(animate);
}

runCycle();
</script></body></html>
```
No usable answer reached the harness (ERR). Counted as a did-not-finish.
No usable answer reached the harness (ERR). Counted as a did-not-finish.
deepseek-r1:32bERRBLANKFORMAT
Show code
```html
<!DOCTYPE html>
<html><canvas id=c width=800 height=600></canvas>
<script>
class Node{
constructor(v,left=null,right=null){this.v=v;this.left=left;this.right=right;x=0;y=0}
draw(c,hl=false){
c.beginPath();c.arc(this.x,this.y,20,0,Math.PI*2);if(hl)c.strokeStyle="#ff4444";else c.strokeStyle="#333";
c.stroke();c.fillStyle="#fff";c.fillText(this.v.toString(),this.x-8,this.y+5);
}
connect(parent,c,hl=false){
c.beginPath();hl?c.strokeStyle="#ff4444":c.strokeStyle="#333";c.moveTo(parent.x,parent.y);c.lineTo(this.x,this.y);c.stroke();
}
}

let canvas=c.getContext("2d");
canvas.font="18px Arial";
let root=null,timer=0;
let nodes=0;
let target=null,searchPath=[];

function layout(n,dx=0,depth=0,left=true){
if(!n)return;
let x=700/2+dx,y=50+(depth*80);
n.x=x;n.y=y;
if(n.left)layout(n.left,(left? -1:1)*300/((depth||1)+2),depth+1,true);
if(n.right)layout(n.right,(left? 1:-1)*300/((depth||1)+2),depth+1,false);
}

function insert(v){
let node=new Node(v);
if(!root){root=node;nodes++;layout(root);return node;}
else{
let current=root;
while(current){
current.connect(node,canvas);
if(v<current.v){
node.x=current.x-300/(current.depth||1);node.y=current.y+80;
if(!current.left)break;
current=current.left;
}
else{
node.x=current.x+300/(current.depth||1);node.y=current.y+80;
if(!current.right)break;
current=current.right;
}
}
nodes++;
return node;
}

function dfs(n,depth=0){
if(!n)return;
layout(n);
dfs(n.left,++depth);
dfs(n.right,--depth);
}

function animateInsertion(v,callback=null){
insert(v);
callback&&callback();
}

function search(v,path=[]){
path.push(root);
while(path[path.length-1].v!=v){
let last=path[path.length-1];
if(v<last.v){
path.push(last.left);continue;
}
else path.push(last.right);
}
return path;
}

function drawTree(hlPath=null){
canvas.clearRect(0,0,800,600);
hlPath&&hlPath.forEach(n=>n.connect(null,canvas,true));
let q=[root];
while(q.length>0){
let n=q.shift();
if(!n)continue;
n.draw(canvas,n.value===target||hlPath?.includes(n));
q.push(n.left);q.push(n.right);
}
}

function animateSearch(path,callback=null){
drawTree(path);
if(path.length<2){
callback&&callback();
return;
}
path.shift();
setTimeout(()=>animateSearch(path,callback),500);
}

function reset(){
root=null;nodes=0;t=0;searchPath=[];target=null;
let values=[...new Set(Math.random().toString(36).slice(-15).split('').map(_=>Math.floor(Math.random()*200)))];
t=values.length;
animateInsertion(values[t-1],function(){if(t>1)animateInsertion(values[--t],arguments.callee);else{target=values[Math.floor(Math.random()*(values.length))];searchPath=search(target);animateSearch(searchPath.slice(),function(){reset();});}});

}

canvas.strokeStyle="#333";drawTree();
reset();

</script>
```
Outside the Brain cluster — same task, same character budget, collected through their own tooling (response times not comparable)
Claude Opus 5frontier referenceOK
Show code
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Binary Search Tree Animation</title>
<style>html,body{margin:0;height:100%;background:#0b1020;overflow:hidden}
#h{position:fixed;left:16px;top:14px;color:#8b9ac4;font:600 13px/1.5 system-ui,sans-serif;letter-spacing:.08em;text-transform:uppercase;pointer-events:none}
#h b{color:#7ee6c8}#h i{font-style:normal;color:#ffd166}canvas{display:block}</style></head><body>
<div id="h">Binary Search Tree &middot; nodes <b id="n">0</b> &middot; <i id="s">building</i></div>
<canvas id="c"></canvas>
<script>
var c=document.getElementById('c'),g=c.getContext('2d'),NE=document.getElementById('n'),SE=document.getElementById('s');
var W=0,H=0,R=18;
function rs(){W=innerWidth;H=innerHeight;var d=devicePixelRatio||1;c.width=W*d;c.height=H*d;c.style.width=W+'px';c.style.height=H+'px';g.setTransform(d,0,0,d,0,0);lay()}
addEventListener('resize',rs);
var root=null,q=[],ns=[],ph='ins',path=[],pi=0,cnt=0,tgt=0,acc=0,last=0,md=0;
function mk(v){return{v:v,l:null,r:null,x:W/2,y:70,tx:W/2,ty:70,s:0,d:0}}
function ins(v){var n=mk(v);if(!root){root=n;return}var p=root;for(;;){if(v<p.v){if(!p.l){p.l=n;break}p=p.l}else{if(!p.r){p.r=n;break}p=p.r}}n.x=p.x;n.y=p.y}
function lay(){ns=[];md=0;var i=0;(function w(n,d){if(!n)return;w(n.l,d+1);n.d=d;if(d>md)md=d;n.i=i++;ns.push(n);w(n.r,d+1)})(root,0);
var m=42,sp=(W-2*m)/Math.max(ns.length,1),vs=Math.min(86,(H-150)/Math.max(md,1));
for(var k=0;k<ns.length;k++){ns[k].tx=m+(ns[k].i+.5)*sp;ns[k].ty=76+ns[k].d*vs}}
function reset(){root=null;path=[];pi=0;cnt=0;ph='ins';var k=15+(Math.random()*6|0),st={},a=[];while(a.length<k){var v=2+(Math.random()*97|0);if(!st[v]){st[v]=1;a.push(v)}}q=a;lay()}
function seek(){var p=root;path=[];while(p){path.push(p);if(p.v===tgt)break;p=tgt<p.v?p.l:p.r}pi=0}
function on(n){return path.indexOf(n)>-1&&path.indexOf(n)<=pi}
function edge(a,b){var hi=on(a)&&on(b);g.beginPath();g.moveTo(a.x,a.y);g.lineTo(b.x,b.y);g.lineWidth=hi?4:2;g.strokeStyle=hi?'#ffd166':'rgba(120,140,190,.42)';g.stroke()}
function draw(){g.fillStyle='#0b1020';g.fillRect(0,0,W,H);
for(var k=0;k<ns.length;k++){var n=ns[k];if(n.l&&n.l.s>.15)edge(n,n.l);if(n.r&&n.r.s>.15)edge(n,n.r)}
for(k=0;k<ns.length;k++){n=ns[k];var r=R*n.s;if(r<.6)continue;var hi=on(n),fin=hi&&n.v===tgt&&pi===path.length-1;
g.beginPath();g.arc(n.x,n.y,r,0,6.2832);
g.fillStyle=fin?'#3ddc97':hi?'#8a6d1e':'#18244';g.fill();
g.lineWidth=hi?3:2;g.strokeStyle=fin?'#b8ffe2':hi?'#ffd166':'#5b74b8';g.stroke();
if(n.s>.72){g.fillStyle=fin?'#04241a':hi?'#fff4d6':'#dbe6ff';g.font='600 13px system-ui,sans-serif';g.textAlign='center';g.textBaseline='middle';g.fillText(n.v,n.x,n.y+.5)}}}
function tick(ts){var dt=Math.min(60,ts-last)||16;last=ts;acc+=dt;
if(ph==='ins'){if(acc>380){acc=0;if(q.length){ins(q.shift());cnt++;lay()}else{ph='pre'}}SE.textContent='inserting'}
else if(ph==='pre'){SE.textContent='choosing target';if(acc>620){acc=0;tgt=ns[Math.random()*ns.length|0].v;seek();ph='find'}}
else if(ph==='find'){SE.textContent='searching '+tgt;if(acc>620){acc=0;if(pi<path.length-1)pi++;else ph='end'}}
else{SE.textContent='found '+tgt;if(acc>1700){acc=0;reset()}}
NE.textContent=cnt;
var e=1-Math.pow(.001,dt/1000);
for(var k=0;k<ns.length;k++){var n=ns[k];n.x+=(n.tx-n.x)*e;n.y+=(n.ty-n.y)*e;n.s+=(1-n.s)*Math.min(1,dt/150)}
draw();requestAnimationFrame(tick)}
rs();reset();requestAnimationFrame(tick);
</script></body></html>
GPT-5.5 (Codex)frontier referenceOKMINIFIED
Show code
<!doctype html><html><head><meta charset=utf-8><title>BST</title><style>html,body{margin:0;height:100%;background:#101418;color:#dfe7ee;font:16px system-ui}canvas{display:block;width:100vw;height:100vh}.hud{position:fixed;left:14px;top:12px;background:#17202aaa;border:1px solid #314150;padding:8px 11px;border-radius:6px}</style></head><body><canvas id=c></canvas><div class=hud>Nodes: <span id=n>0</span></div><script>
const c=document.getElementById("c"),x=c.getContext("2d"),ns=document.getElementById("n");let W,H,D=1,root,nodes,vals,target,path,phase,idx,last,prog,wait;
function rnd(a,b){return a+Math.floor(Math.random()*(b-a+1))}
function resize(){D=devicePixelRatio||1;W=innerWidth;H=innerHeight;c.width=W*D;c.height=H*D;x.setTransform(D,0,0,D,0,0)}
onresize=resize;resize();
function make(){root=null;nodes=[];vals=[];let s=new Set,n=rnd(15,20);while(s.size<n)s.add(rnd(10,99));vals=[...s];target=null;path=[];phase="ins";idx=0;last=0;prog=0;wait=0;ns.textContent=0}
function spot(v){let cx=W/2,cy=74,gap=W*.25,py=null,side=0,cur=root,steps=[];while(cur){steps.push(cur);py=cur;cy=cur.y+74;gap*=.55;if(v<cur.v){cx=cur.x-gap;cur=cur.l;side=-1}else{cx=cur.x+gap;cur=cur.r;side=1}}return{v,x:cx,y:cy,l:null,r:null,p:py,side,steps}}
function add(v){let nd=spot(v);if(!nd.p)root=nd;else if(nd.side<0)nd.p.l=nd;else nd.p.r=nd;nodes.push(nd);ns.textContent=nodes.length}
function route(v){let a=[],cur=root;while(cur){a.push(cur);if(v==cur.v)break;cur=v<cur.v?cur.l:cur.r}return a}
function draw(active,edgeA,edgeB,t){x.clearRect(0,0,W,H);x.lineWidth=3;x.lineCap="round";for(const nd of nodes)if(nd.p){x.strokeStyle="#526271";x.beginPath();x.moveTo(nd.p.x,nd.p.y);x.lineTo(nd.x,nd.y);x.stroke()}if(edgeA&&edgeB){x.strokeStyle="#ffbf47";x.lineWidth=5;x.beginPath();x.moveTo(edgeA.x,edgeA.y);x.lineTo(edgeA.x+(edgeB.x-edgeA.x)*t,edgeA.y+(edgeB.y-edgeA.y)*t);x.stroke()}for(const nd of nodes){let on=active&&active.includes(nd);x.fillStyle=on?"#ffbf47":"#203243";x.strokeStyle=on?"#ffe0a1":"#8fb0c8";x.lineWidth=2;x.beginPath();x.arc(nd.x,nd.y,19,0,7);x.fill();x.stroke();x.fillStyle=on?"#17120a":"#edf6ff";x.font="700 14px system-ui";x.textAlign="center";x.textBaseline="middle";x.fillText(nd.v,nd.x,nd.y)}}
function frame(ts){let dt=Math.min(50,ts-last||16);last=ts;if(phase=="ins"){if(!wait){if(idx<vals.length){add(vals[idx++]);wait=380}else{target=nodes[rnd(0,nodes.length-1)].v;path=route(target);phase="search";idx=0;prog=0;wait=550}}wait-=dt;if(wait<0)wait=0;draw()}else if(phase=="search"){let seen=path.slice(0,idx+1);if(wait){wait-=dt;if(wait<0)wait=0}else if(idx<path.length-1){prog+=dt/520;if(prog>=1){idx++;prog=0;wait=260}}else{wait=900;phase="done"}draw(seen,path[idx],path[idx+1],prog)}else{wait-=dt;draw(path);if(wait<=0)make()}requestAnimationFrame(frame)}
make();requestAnimationFrame(frame);
</script></body></html>
Claude Sonnet 5frontier referenceOK
Show code
<!DOCTYPE html><html><head><meta charset="utf-8"><title>BST Animation</title>
<style>
html,body{margin:0;padding:0;overflow:hidden;background:#0b1020;font-family:sans-serif}
canvas{display:block}
#info{position:fixed;top:10px;left:10px;color:#cbd5e1;font-size:14px;background:rgba(15,23,42,.6);padding:6px 10px;border-radius:6px}
</style></head>
<body>
<div id="info">Nodes: 0</div>
<canvas id="c"></canvas>
<script>
const cv=document.getElementById('c'),ctx=cv.getContext('2d'),info=document.getElementById('info');
function resize(){cv.width=innerWidth;cv.height=innerHeight;}
resize();addEventListener('resize',resize);

let root=null,nodes=[],values=[],insIdx=0,phase='insert',target=null,path=[],pathIdx=0,phaseStart=0;
const INS_MS=550,PAUSE_MS=800,STEP_MS=650,END_MS=1800;

function randSet(){
  const s=new Set();
  const cnt=15+Math.floor(Math.random()*6);
  while(s.size<cnt) s.add(1+Math.floor(Math.random()*98));
  return [...s];
}

function reset(){
  values=randSet();root=null;nodes=[];insIdx=0;phase='insert';target=null;path=[];pathIdx=0;phaseStart=performance.now();
}

function insertVal(v){
  const node={val:v,left:null,right:null,depth:0,x:0,y:0};
  if(!root){root=node;nodes.push(node);return;}
  let cur=root,d=0;
  while(true){
    d++;
    if(v<cur.val){
      if(!cur.left){cur.left=node;node.depth=d;nodes.push(node);return;}
      cur=cur.left;
    } else if(v>cur.val){
      if(!cur.right){cur.right=node;node.depth=d;nodes.push(node);return;}
      cur=cur.right;
    } else return;
  }
}

function layout(){
  const order=[];
  (function trav(n){if(!n)return;trav(n.left);order.push(n);trav(n.right);})(root);
  const w=cv.width-100,total=order.length||1;
  order.forEach((n,i)=>{n.x=50+(i+0.5)*w/total;n.y=60+n.depth*70;});
}

function buildPath(v){
  const p=[];let cur=root;
  while(cur){p.push(cur);if(v===cur.val)break;cur=v<cur.val?cur.left:cur.right;}
  return p;
}

function update(ts){
  if(!phaseStart)phaseStart=ts;
  const dt=ts-phaseStart;
  if(phase==='insert'){
    if(dt>INS_MS||insIdx===0){
      if(insIdx<values.length){insertVal(values[insIdx]);insIdx++;layout();phaseStart=ts;}
      else{phase='wait1';phaseStart=ts;}
    }
  } else if(phase==='wait1'){
    if(dt>PAUSE_MS){
      target=values[Math.floor(Math.random()*values.length)];
      path=buildPath(target);pathIdx=0;phase='search';phaseStart=ts;
    }
  } else if(phase==='search'){
    if(dt>STEP_MS){
      pathIdx++;phaseStart=ts;
      if(pathIdx>=path.length){phase='end';phaseStart=ts;}
    }
  } else if(phase==='end'){
    if(dt>END_MS) reset();
  }
}

function circle(x,y,r,fill,stroke){
  ctx.beginPath();ctx.arc(x,y,r,0,7);ctx.fillStyle=fill;ctx.fill();
  ctx.lineWidth=2;ctx.strokeStyle=stroke;ctx.stroke();
}

function draw(){
  ctx.clearRect(0,0,cv.width,cv.height);
  const visible=(phase==='search'||phase==='end')?path.slice(0,phase==='end'?path.length:Math.max(1,pathIdx+1)):[];
  const visSet=new Set(visible);
  (function edges(n){
    if(!n)return;
    [n.left,n.right].forEach(c=>{
      if(!c)return;
      const hl=visSet.has(n)&&visSet.has(c)&&Math.abs(visible.indexOf(n)-visible.indexOf(c))===1;
      ctx.beginPath();ctx.moveTo(n.x,n.y);ctx.lineTo(c.x,c.y);
      ctx.strokeStyle=hl?'#fb923c':'#334155';ctx.lineWidth=hl?4:2;ctx.stroke();
    });
    edges(n.left);edges(n.right);
  })(root);
  nodes.forEach(n=>{
    const hl=visSet.has(n);
    const isCur=hl&&visible[visible.length-1]===n&&phase==='search';
    circle(n.x,n.y,isCur?22:18,hl?'#f97316':'#1e3a8a',hl?'#fed7aa':'#60a5fa');
    ctx.fillStyle='#fff';ctx.font='13px sans-serif';ctx.textAlign='center';ctx.textBaseline='middle';
    ctx.fillText(n.val,n.x,n.y);
  });
  let status='Inserting...';
  if(phase==='wait1')status='Tree complete';
  if(phase==='search')status='Searching for '+target;
  if(phase==='end')status='Found '+target+' — restarting';
  info.textContent='Nodes: '+nodes.length+' | '+status;
}

function loop(ts){
  update(ts);draw();requestAnimationFrame(loop);
}
reset();requestAnimationFrame(loop);
</script>
</body></html>
Claude Fable 5frontier referenceOK
Show code
<meta charset="utf-8">
<title>BST Animation</title>
<style>
html,body{margin:0;height:100%;background:#0b1020;overflow:hidden}
canvas{display:block}
#hud{position:fixed;top:12px;left:14px;color:#9fd0ff;font:14px/1.4 monospace;pointer-events:none}
</style>
<div id="hud"></div>
<canvas id="c"></canvas>
<script>
const cv=document.getElementById('c'),cx=cv.getContext('2d'),hud=document.getElementById('hud');
let W,H;
function rs(){W=cv.width=innerWidth;H=cv.height=innerHeight}
rs();onresize=rs;
let root,pending,phase,timer,path,pi,count,target,last=0,total=0;
function reset(){
  root=null;count=0;path=[];pi=-1;target=null;timer=0;phase='insert';
  const s=new Set(),n=15+Math.floor(Math.random()*6);
  while(s.size<n)s.add(1+Math.floor(Math.random()*99));
  pending=[...s];total=n;
}
function insert(v){
  const nd={v,l:null,r:null};
  if(!root){root=nd}else{
    let c=root;
    for(;;){
      if(v<c.v){if(c.l)c=c.l;else{c.l=nd;break}}
      else{if(c.r)c=c.r;else{c.r=nd;break}}
    }
  }
  count++;
}
function layout(){
  let i=0,maxd=0;const pos=new Map();
  (function w(n,d){
    if(!n)return;
    if(d>maxd)maxd=d;
    w(n.l,d+1);
    pos.set(n,{x:++i,y:d});
    w(n.r,d+1);
  })(root,0);
  const m=i+1,sy=(H-130)/(maxd||1);
  pos.forEach(p=>{p.x=p.x/m*W;p.y=60+p.y*Math.min(85,sy)});
  return pos;
}
function startSearch(){
  const all=[];
  (function g(n){if(n){g(n.l);all.push(n);g(n.r)}})(root);
  target=all[Math.floor(Math.random()*all.length)].v;
  path=[];
  let c=root;
  while(c){path.push(c);if(c.v===target)break;c=target<c.v?c.l:c.r}
  pi=0;
}
function step(dt){
  timer+=dt;
  if(phase==='insert'){
    if(timer>420){
      timer=0;
      if(pending.length)insert(pending.shift());
      else{phase='search';startSearch()}
    }
  }else if(phase==='search'){
    if(timer>620){
      timer=0;pi++;
      if(pi>=path.length){pi=path.length-1;phase='done'}
    }
  }else if(phase==='done'){
    if(timer>1900)reset();
  }
}
function draw(t){
  cx.clearRect(0,0,W,H);
  if(!root){hud.textContent='Nodes: 0';return}
  const pos=layout();
  (function e(n){
    if(!n)return;
    const p=pos.get(n),ni=path.indexOf(n);
    [n.l,n.r].forEach(ch=>{
      if(!ch)return;
      const q=pos.get(ch),ci=path.indexOf(ch);
      const hot=phase!=='insert'&&ni>-1&&ci===ni+1&&ci<=pi;
      cx.strokeStyle=hot?'#ffd166':'#35476b';
      cx.lineWidth=hot?4:2;
      cx.beginPath();cx.moveTo(p.x,p.y);cx.lineTo(q.x,q.y);cx.stroke();
    });
    e(n.l);e(n.r);
  })(root);
  pos.forEach((p,n)=>{
    const idx=path.indexOf(n);
    const vis=phase!=='insert'&&idx>-1&&idx<=pi;
    const cur=vis&&idx===pi&&phase==='search';
    const found=phase==='done'&&n.v===target;
    let r=17;
    if(cur||found)r=17+2.5*Math.sin(t/110);
    cx.beginPath();cx.arc(p.x,p.y,r,0,7);
    cx.fillStyle=found?'#2ec27e':cur?'#ffd166':vis?'#c9862a':'#1b2b4e';
    cx.fill();
    cx.strokeStyle=vis||found?'#fff':'#5d77ab';
    cx.lineWidth=2;cx.stroke();
    cx.fillStyle=vis||found?'#0b1020':'#d6e6ff';
    cx.font='bold 13px monospace';
    cx.textAlign='center';cx.textBaseline='middle';
    cx.fillText(n.v,p.x,p.y);
  });
  let msg;
  if(phase==='insert')msg='inserting '+count+'/'+total;
  else if(phase==='search')msg='searching for '+target;
  else msg='found '+target+' — restarting';
  hud.textContent='Nodes: '+count+'   '+msg;
}
function tick(t){
  requestAnimationFrame(tick);
  if(!last)last=t;
  const dt=Math.min(100,t-last);
  last=t;
  step(dt);
  draw(t);
}
reset();
requestAnimationFrame(tick);
</script>
Claude Haiku 4.5frontier referenceOKMINIFIED
Show code
<html><head><style>*{margin:0;padding:0}canvas{display:block}</style></head><body><canvas id=c></canvas><div id=i style=position:absolute;top:10px;left:10px;font-family:monospace></div><script>let c=document.getElementById('c'),x=c.getContext('2d'),w=c.width=800,h=c.height=600,r=null,v=[],p=[],q=[],n=0,f=0,s=0,t=0,m=15+Math.random()*6|0,z=0;class K{constructor(a){this.v=a;this.l=this.r=null}}function I(a){let b=r,g;while(b)g=b,b=a<b.v?b.l:b.r;(a<g.v?g.l=new K(a):g.r=new K(a));v.push(a);n++}function B(){r=new K(Math.random()*100|0);v=[r.v];p=[];q=[];s=f=t=z=0;n=1}function L(a,b,c,d){if(!a)return;a.x=b;a.y=c;L(a.l,b-d,c+40,d/2);L(a.r,b+d,c+40,d/2)}function E(a){if(!a)return;if(a.l){x.strokeStyle='#999';x.lineWidth=2;x.beginPath();x.moveTo(a.x,a.y);x.lineTo(a.l.x,a.l.y);x.stroke()}if(a.r){x.strokeStyle='#999';x.lineWidth=2;x.beginPath();x.moveTo(a.x,a.y);x.lineTo(a.r.x,a.r.y);x.stroke()}E(a.l);E(a.r)}function N(a){if(!a)return;let b=p.includes(a);x.fillStyle=b?'#f00':'#0f0';x.beginPath();x.arc(a.x,a.y,12,0,7);x.fill();x.fillStyle='#000';x.font='11px sans-serif';x.textAlign='center';x.textBaseline='middle';x.fillText(a.v,a.x,a.y);N(a.l);N(a.r)}function S(a){q=[];let b=r;while(b&&b.v!==a)q.push(b),b=a<b.v?b.l:b.r;b&&q.push(b)}function D(){x.fillStyle='#fff';x.fillRect(0,0,w,h);L(r,w/2,20,70);E(r);N(r)}function A(){D();document.getElementById('i').innerText='Nodes:'+n;if(s===0){if(t<m){f%20===0&&(I(Math.random()*100|0),t++);f++}else S(v[Math.random()*v.length|0]),s=1,z=0}else if(s===1){z++;p=q.slice(0,Math.floor(z/50)+1);z>q.length*50&&(s=2,p=[],f=0)}else{f++;f>100&&B()}requestAnimationFrame(A)}B();A()</script></body></html>
Results at a glance— every model in this round with score, response time and status.

Who wrote what

ModelBlind scoreLatencyStatus
qwen3:8b harness
mistral-small:24b 43.1 sOK
qwen3:14b 75.4 sOK
qwen3.5:9b 93.8 sOK
llama3.1:8b 48.5 sOK
deepseek-r1:14b 158.6 sOK
gemma4:26b harness
qwen3-coder:30b 36.9 sOK
command-r:35b DNF
qwq:32b DNF
deepseek-r1:32b 199.4 sOK