{"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A navigator's station displays a bubble sextant with a curved graduated frame, viewing telescope, circular bubble chamber, index arm, and adjustment knobs."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n Object.assign(stage.style, {\n width: \"512px\",\n height: \"512px\",\n overflow: \"hidden\",\n position: \"relative\",\n background: \"#111719\"\n });\n\n const polar = (cx, cy, r, deg) => {\n const a = deg * Math.PI / 180;\n return [cx + r * Math.cos(a), cy + r * Math.sin(a)];\n };\n\n let graduations = \"\";\n for (let a = 42; a <= 138; a += 1) {\n const major = a % 10 === 0;\n const medium = a % 5 === 0;\n const r1 = major ? 225 : medium ? 228 : 231;\n const r2 = 239;\n const [x1, y1] = polar(248, 202, r1, a);\n const [x2, y2] = polar(248, 202, r2, a);\n graduations += ``;\n }\n\n let labels = \"\";\n [50, 60, 70, 80, 90, 100, 110, 120, 130].forEach(a => {\n const [x, y] = polar(248, 202, 215, a);\n labels += `${Math.abs(90 - a)}`;\n });\n\n let knurl = \"\";\n for (let i = 0; i < 18; i++) {\n knurl += ``;\n }\n\n stage.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n ${graduations}\n ${labels}\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n ${knurl}\n \n \n\n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n\n \n \n \n NAV. BUBBLE\n No. 2471\n \n\n \n \n \n `;\n}"}], "metadata": {"id": "val-v1-broad-v2-entity-validation-000", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 6399, "code_sha256": "1ce01e11ec28c17f0cda9f589895c846eba0a92aed8e993ff34febb3ef67909d"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A wooden Davis backstaff is shown in profile, with two curved graduated arcs, sliding sight vanes, and a straight central staff."}, {"role": "assistant", "content": "async function render(stage) {\n stage.replaceChildren();\n Object.assign(stage.style, {\n position: \"relative\",\n width: \"512px\",\n height: \"512px\",\n overflow: \"hidden\",\n background: \"#d9d4ca\"\n });\n\n const NS = \"http://www.w3.org/2000/svg\";\n const svg = document.createElementNS(NS, \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 512 512\");\n svg.setAttribute(\"width\", \"512\");\n svg.setAttribute(\"height\", \"512\");\n svg.setAttribute(\"role\", \"img\");\n svg.setAttribute(\"aria-label\", \"Antique wooden Davis backstaff with graduated arcs and sliding sight vanes\");\n\n const point = (cx, cy, r, deg) => {\n const a = deg * Math.PI / 180;\n return [cx + r * Math.cos(a), cy + r * Math.sin(a)];\n };\n\n const polyArc = (cx, cy, r, start, end, steps = 40) => {\n let d = \"\";\n for (let i = 0; i <= steps; i++) {\n const a = start + (end - start) * i / steps;\n const [x, y] = point(cx, cy, r, a);\n d += `${i ? \"L\" : \"M\"}${x.toFixed(2)} ${y.toFixed(2)} `;\n }\n return d;\n };\n\n let bigTicks = \"\";\n for (let deg = 2; deg <= 70; deg += 2) {\n const major = deg % 10 === 0;\n const medium = deg % 5 === 0;\n const inner = 217 - (major ? 10 : medium ? 8 : 5);\n const outer = 217 + 7;\n const [x1, y1] = point(226, 230, inner, deg);\n const [x2, y2] = point(226, 230, outer, deg);\n bigTicks += ``;\n if (major) {\n const [tx, ty] = point(226, 230, 196, deg);\n bigTicks += `${deg}`;\n }\n }\n\n let smallTicks = \"\";\n for (let i = 0; i <= 30; i++) {\n const deg = 180 + i * (40 / 30);\n const major = i % 5 === 0;\n const [x1, y1] = point(226, 230, 145 - (major ? 9 : 5), deg);\n const [x2, y2] = point(226, 230, 152, deg);\n smallTicks += ``;\n if (major) {\n const [tx, ty] = point(226, 230, 128, deg);\n smallTicks += `${i}`;\n }\n }\n\n svg.innerHTML = `\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n\n \n \n \n\n \n \n\n \n \n \n\n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n\n \n ${bigTicks}\n ${smallTicks}\n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n `;\n\n stage.appendChild(svg);\n}"}], "metadata": {"id": "val-v1-broad-v2-entity-validation-002", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 5778, "code_sha256": "50534f595acefaf76d8a9644181ff32e4de9a2faee35263c06ffc8eb1cbf2659"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A brass universal equinoctial ring dial hangs from its suspension loop, with two hinged circular rings, engraved hour numbers, and a sliding pinhole bar."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n Object.assign(stage.style, {\n width: \"512px\",\n height: \"512px\",\n position: \"relative\",\n overflow: \"hidden\",\n background: \"#171612\"\n });\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = 1024;\n canvas.height = 1024;\n canvas.style.width = \"512px\";\n canvas.style.height = \"512px\";\n canvas.style.display = \"block\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(2, 2);\n\n const W = 512, H = 512;\n const TAU = Math.PI * 2;\n let seed = 428193;\n const rnd = () => {\n seed = (seed * 1664525 + 1013904223) >>> 0;\n return seed / 4294967296;\n };\n\n function ellipsePath(cx, cy, rx, ry, rot = 0, a0 = 0, a1 = TAU) {\n ctx.beginPath();\n ctx.ellipse(cx, cy, rx, ry, rot, a0, a1);\n }\n\n function line(x1, y1, x2, y2) {\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n }\n\n function rotatedPoint(cx, cy, x, y, rot) {\n const c = Math.cos(rot), s = Math.sin(rot);\n return {\n x: cx + x * c - y * s,\n y: cy + x * s + y * c\n };\n }\n\n function brassLinear(x1, y1, x2, y2) {\n const g = ctx.createLinearGradient(x1, y1, x2, y2);\n g.addColorStop(0, \"#5b3d13\");\n g.addColorStop(.09, \"#9c7127\");\n g.addColorStop(.22, \"#e0bd65\");\n g.addColorStop(.34, \"#8f621e\");\n g.addColorStop(.52, \"#d7ad4d\");\n g.addColorStop(.68, \"#f0d17b\");\n g.addColorStop(.82, \"#805719\");\n g.addColorStop(1, \"#3f2a0e\");\n return g;\n }\n\n function metalBandEllipse(cx, cy, rx, ry, rot, width) {\n ctx.save();\n ctx.lineCap = \"round\";\n\n ctx.shadowColor = \"rgba(0,0,0,.8)\";\n ctx.shadowBlur = 13;\n ctx.shadowOffsetX = 6;\n ctx.shadowOffsetY = 9;\n ellipsePath(cx, cy, rx, ry, rot);\n ctx.strokeStyle = \"#171006\";\n ctx.lineWidth = width + 5;\n ctx.stroke();\n\n ctx.shadowColor = \"transparent\";\n ellipsePath(cx, cy, rx, ry, rot);\n ctx.strokeStyle = brassLinear(cx - rx, cy, cx + rx, cy);\n ctx.lineWidth = width;\n ctx.stroke();\n\n ellipsePath(cx, cy, rx, ry, rot);\n ctx.strokeStyle = \"rgba(255,230,143,.65)\";\n ctx.lineWidth = 1.5;\n ctx.stroke();\n\n ellipsePath(cx, cy, rx - width * .38, ry - width * .38, rot);\n ctx.strokeStyle = \"rgba(45,24,5,.66)\";\n ctx.lineWidth = 1.2;\n ctx.stroke();\n\n ellipsePath(cx, cy, rx + width * .38, ry + width * .38, rot);\n ctx.strokeStyle = \"rgba(38,22,7,.5)\";\n ctx.lineWidth = 1.3;\n ctx.stroke();\n ctx.restore();\n }\n\n // Background\n let bg = ctx.createRadialGradient(244, 222, 35, 255, 265, 405);\n bg.addColorStop(0, \"#575044\");\n bg.addColorStop(.32, \"#38352f\");\n bg.addColorStop(.72, \"#201f1b\");\n bg.addColorStop(1, \"#0c0e0d\");\n ctx.fillStyle = bg;\n ctx.fillRect(0, 0, W, H);\n\n const vignette = ctx.createRadialGradient(256, 255, 160, 256, 255, 370);\n vignette.addColorStop(0, \"rgba(0,0,0,0)\");\n vignette.addColorStop(.68, \"rgba(0,0,0,.14)\");\n vignette.addColorStop(1, \"rgba(0,0,0,.72)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0, 0, W, H);\n\n // Background grain and aged wall marks\n ctx.save();\n for (let i = 0; i < 2200; i++) {\n const x = rnd() * W, y = rnd() * H;\n const a = .012 + rnd() * .035;\n ctx.fillStyle = rnd() > .55\n ? `rgba(255,244,205,${a})`\n : `rgba(0,0,0,${a * 1.8})`;\n const d = .25 + rnd() * 1.1;\n ctx.fillRect(x, y, d, d);\n }\n ctx.globalAlpha = .08;\n ctx.strokeStyle = \"#b3a47c\";\n ctx.lineWidth = .45;\n for (let i = 0; i < 35; i++) {\n ctx.beginPath();\n const y = rnd() * H;\n ctx.moveTo(0, y);\n ctx.bezierCurveTo(130, y + rnd() * 8 - 4, 350, y + rnd() * 8 - 4, 512, y);\n ctx.stroke();\n }\n ctx.restore();\n\n // Instrument shadow\n ctx.save();\n ctx.translate(13, 17);\n ctx.filter = \"blur(16px)\";\n ctx.globalAlpha = .52;\n ctx.strokeStyle = \"#000\";\n ctx.lineWidth = 25;\n ellipsePath(256, 271, 166, 190, -.10);\n ctx.stroke();\n ctx.filter = \"none\";\n ctx.restore();\n\n // Suspension loop and crown\n ctx.save();\n ctx.shadowColor = \"rgba(0,0,0,.8)\";\n ctx.shadowBlur = 9;\n ctx.shadowOffsetX = 4;\n ctx.shadowOffsetY = 5;\n\n ellipsePath(238, 30, 15, 23, -.13);\n ctx.strokeStyle = \"#3b260b\";\n ctx.lineWidth = 11;\n ctx.stroke();\n ellipsePath(238, 30, 15, 23, -.13);\n ctx.strokeStyle = brassLinear(220, 17, 255, 45);\n ctx.lineWidth = 7;\n ctx.stroke();\n ellipsePath(238, 30, 9.5, 16, -.13);\n ctx.strokeStyle = \"rgba(245,213,119,.55)\";\n ctx.lineWidth = 1;\n ctx.stroke();\n\n ctx.shadowColor = \"transparent\";\n ctx.beginPath();\n ctx.roundRect(229, 47, 19, 28, 5);\n ctx.fillStyle = brassLinear(227, 0, 250, 0);\n ctx.fill();\n ctx.strokeStyle = \"#49300d\";\n ctx.lineWidth = 2;\n ctx.stroke();\n\n ctx.beginPath();\n ctx.moveTo(229, 61);\n ctx.lineTo(217, 78);\n ctx.lineTo(253, 75);\n ctx.lineTo(247, 59);\n ctx.closePath();\n ctx.fillStyle = brassLinear(216, 0, 255, 0);\n ctx.fill();\n ctx.strokeStyle = \"#52350e\";\n ctx.stroke();\n ctx.restore();\n\n const outerRot = -.105;\n metalBandEllipse(256, 269, 166, 190, outerRot, 18);\n\n // Outer meridian graduations and engraved numerals\n ctx.save();\n ctx.lineCap = \"butt\";\n for (let i = 0; i < 72; i++) {\n const t = i / 72 * TAU;\n const major = i % 6 === 0;\n const medium = i % 3 === 0;\n const x1 = Math.cos(t) * (166 - 4);\n const y1 = Math.sin(t) * (190 - 4);\n const x2 = Math.cos(t) * (166 - (major ? 13 : medium ? 9 : 6));\n const y2 = Math.sin(t) * (190 - (major ? 14 : medium ? 10 : 7));\n const p1 = rotatedPoint(256, 269, x1, y1, outerRot);\n const p2 = rotatedPoint(256, 269, x2, y2, outerRot);\n ctx.strokeStyle = major ? \"rgba(42,24,6,.86)\" : \"rgba(55,32,8,.65)\";\n ctx.lineWidth = major ? 1.15 : .65;\n line(p1.x, p1.y, p2.x, p2.y);\n if (major) {\n ctx.strokeStyle = \"rgba(255,224,135,.25)\";\n ctx.lineWidth = .5;\n line(p1.x + .7, p1.y, p2.x + .7, p2.y);\n }\n }\n\n const meridianLabels = [\n [-1.40, \"0\"], [-1.05, \"10\"], [-.70, \"20\"], [-.34, \"30\"],\n [.30, \"40\"], [.66, \"50\"], [1.02, \"60\"], [1.38, \"70\"],\n [1.91, \"80\"], [2.29, \"70\"], [2.68, \"60\"], [3.05, \"50\"],\n [3.45, \"40\"], [3.82, \"30\"], [4.18, \"20\"], [4.55, \"10\"]\n ];\n ctx.font = \"8px Georgia, serif\";\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n for (const [t, txt] of meridianLabels) {\n const p = rotatedPoint(256, 269, Math.cos(t) * 158, Math.sin(t) * 180, outerRot);\n ctx.save();\n ctx.translate(p.x, p.y);\n ctx.rotate(t + Math.PI / 2 + outerRot);\n ctx.fillStyle = \"rgba(43,24,5,.88)\";\n ctx.fillText(txt, 0, 0);\n ctx.fillStyle = \"rgba(255,225,145,.2)\";\n ctx.fillText(txt, .5, .6);\n ctx.restore();\n }\n ctx.restore();\n\n // Patina patches on outer ring\n ctx.save();\n ctx.globalCompositeOperation = \"multiply\";\n for (let i = 0; i < 105; i++) {\n const t = rnd() * TAU;\n const p = rotatedPoint(\n 256, 269,\n Math.cos(t) * (166 + (rnd() - .5) * 10),\n Math.sin(t) * (190 + (rnd() - .5) * 10),\n outerRot\n );\n ctx.fillStyle = rnd() > .6 ? \"rgba(36,73,55,.18)\" : \"rgba(65,35,9,.22)\";\n ctx.beginPath();\n ctx.ellipse(p.x, p.y, .5 + rnd() * 2.2, .25 + rnd(), rnd() * TAU, 0, TAU);\n ctx.fill();\n }\n ctx.restore();\n\n // Equatorial ring, strongly foreshortened\n const eqRot = -.115;\n const eqCx = 257, eqCy = 281, eqRx = 153, eqRy = 55;\n\n ctx.save();\n ctx.shadowColor = \"rgba(0,0,0,.85)\";\n ctx.shadowBlur = 10;\n ctx.shadowOffsetY = 8;\n ellipsePath(eqCx, eqCy, eqRx, eqRy, eqRot);\n ctx.strokeStyle = \"#1d1105\";\n ctx.lineWidth = 28;\n ctx.stroke();\n ctx.restore();\n\n ellipsePath(eqCx, eqCy, eqRx, eqRy, eqRot);\n ctx.strokeStyle = brassLinear(105, 245, 410, 312);\n ctx.lineWidth = 23;\n ctx.stroke();\n\n ellipsePath(eqCx, eqCy, eqRx, eqRy, eqRot);\n ctx.strokeStyle = \"rgba(255,231,151,.72)\";\n ctx.lineWidth = 1.5;\n ctx.stroke();\n\n ellipsePath(eqCx, eqCy, eqRx, eqRy - 10, eqRot);\n ctx.strokeStyle = \"rgba(50,27,5,.78)\";\n ctx.lineWidth = 1.2;\n ctx.stroke();\n ellipsePath(eqCx, eqCy, eqRx, eqRy + 10, eqRot);\n ctx.strokeStyle = \"rgba(48,27,7,.7)\";\n ctx.lineWidth = 1.2;\n ctx.stroke();\n\n // Equatorial hour divisions\n ctx.save();\n for (let i = 0; i < 48; i++) {\n const t = i / 48 * TAU;\n const major = i % 2 === 0;\n const ryi = eqRy - (major ? 11 : 7);\n const p1 = rotatedPoint(eqCx, eqCy, Math.cos(t) * (eqRx - 1), Math.sin(t) * (eqRy - 1), eqRot);\n const p2 = rotatedPoint(eqCx, eqCy, Math.cos(t) * (eqRx - 1), Math.sin(t) * ryi, eqRot);\n ctx.strokeStyle = major ? \"rgba(47,27,7,.92)\" : \"rgba(59,34,9,.65)\";\n ctx.lineWidth = major ? 1 : .55;\n line(p1.x, p1.y, p2.x, p2.y);\n }\n\n // Front-facing hour numbers\n const hours = [\"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"XII\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\"];\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.font = \"bold 9px Georgia, serif\";\n for (let i = 0; i < hours.length; i++) {\n const t = Math.PI - i * Math.PI / 12;\n const p = rotatedPoint(eqCx, eqCy, Math.cos(t) * 131, Math.sin(t) * 44, eqRot);\n ctx.save();\n ctx.translate(p.x, p.y);\n ctx.rotate(eqRot + Math.cos(t) * .04);\n ctx.fillStyle = \"rgba(45,24,5,.95)\";\n ctx.fillText(hours[i], 0, 0);\n ctx.fillStyle = \"rgba(255,232,154,.22)\";\n ctx.fillText(hours[i], .45, .6);\n ctx.restore();\n }\n ctx.restore();\n\n // Side hinges\n const hingeL = rotatedPoint(eqCx, eqCy, -151, 0, eqRot);\n const hingeR = rotatedPoint(eqCx, eqCy, 151, 0, eqRot);\n for (const p of [hingeL, hingeR]) {\n ctx.save();\n ctx.translate(p.x, p.y);\n ctx.rotate(eqRot);\n ctx.shadowColor = \"rgba(0,0,0,.65)\";\n ctx.shadowBlur = 4;\n ctx.shadowOffsetY = 3;\n ctx.beginPath();\n ctx.roundRect(-9, -13, 18, 26, 4);\n ctx.fillStyle = brassLinear(-10 + p.x, p.y, 10 + p.x, p.y);\n ctx.fill();\n ctx.strokeStyle = \"#4b2e09\";\n ctx.lineWidth = 1.8;\n ctx.stroke();\n ctx.shadowColor = \"transparent\";\n ctx.beginPath();\n ctx.arc(0, 0, 5.2, 0, TAU);\n ctx.fillStyle = \"#76501a\";\n ctx.fill();\n ctx.strokeStyle = \"#efcb6d\";\n ctx.lineWidth = 1.2;\n ctx.stroke();\n ctx.beginPath();\n ctx.arc(-1.2, -1.3, 1.2, 0, TAU);\n ctx.fillStyle = \"rgba(255,243,178,.7)\";\n ctx.fill();\n ctx.restore();\n }\n\n // Central declination/pinhole bar\n ctx.save();\n ctx.translate(256, 269);\n ctx.rotate(outerRot);\n\n ctx.shadowColor = \"rgba(0,0,0,.8)\";\n ctx.shadowBlur = 8;\n ctx.shadowOffsetX = 5;\n ctx.shadowOffsetY = 5;\n ctx.beginPath();\n ctx.roundRect(-9.5, -160, 19, 320, 5);\n ctx.fillStyle = \"#352107\";\n ctx.fill();\n\n ctx.shadowColor = \"transparent\";\n ctx.beginPath();\n ctx.roundRect(-7.5, -160, 15, 320, 4);\n ctx.fillStyle = brassLinear(-9, 0, 9, 0);\n ctx.fill();\n ctx.strokeStyle = \"#53350d\";\n ctx.lineWidth = 1.2;\n ctx.stroke();\n\n ctx.fillStyle = \"rgba(255,231,151,.5)\";\n ctx.fillRect(-5.3, -155, 1, 310);\n ctx.fillStyle = \"rgba(50,27,6,.55)\";\n ctx.fillRect(5.2, -155, .8, 310);\n\n // Calendar scale\n ctx.font = \"6px Georgia, serif\";\n ctx.textBaseline = \"middle\";\n ctx.textAlign = \"left\";\n const months = [\"JAN\", \"FEB\", \"MAR\", \"APR\", \"MAY\", \"JUN\", \"JUL\", \"AUG\", \"SEP\", \"OCT\", \"NOV\", \"DEC\"];\n for (let i = 0; i <= 36; i++) {\n const y = -145 + i * (290 / 36);\n const major = i % 3 === 0;\n ctx.strokeStyle = major ? \"rgba(49,27,6,.9)\" : \"rgba(61,34,8,.66)\";\n ctx.lineWidth = major ? .8 : .45;\n line(-6, y, major ? 1.2 : -1.2, y);\n if (major && i < 36) {\n ctx.fillStyle = \"rgba(47,26,5,.9)\";\n ctx.fillText(months[i / 3], 1.5, y);\n }\n }\n\n // Decorative terminals\n for (const y of [-160, 160]) {\n ctx.beginPath();\n ctx.roundRect(-12, y - 7, 24, 14, 5);\n ctx.fillStyle = brassLinear(-12, y, 12, y);\n ctx.fill();\n ctx.strokeStyle = \"#4c2e09\";\n ctx.lineWidth = 1.4;\n ctx.stroke();\n ctx.beginPath();\n ctx.arc(0, y, 3.4, 0, TAU);\n ctx.fillStyle = \"#745019\";\n ctx.fill();\n ctx.strokeStyle = \"#e6c267\";\n ctx.stroke();\n }\n\n // Sliding pinhole carriage\n ctx.shadowColor = \"rgba(0,0,0,.75)\";\n ctx.shadowBlur = 7;\n ctx.shadowOffsetX = 4;\n ctx.shadowOffsetY = 5;\n ctx.beginPath();\n ctx.roundRect(-19, -40, 38, 44, 5);\n ctx.fillStyle = brassLinear(-20, -20, 20, -20);\n ctx.fill();\n ctx.strokeStyle = \"#4c2d08\";\n ctx.lineWidth = 2;\n ctx.stroke();\n\n ctx.shadowColor = \"transparent\";\n ctx.beginPath();\n ctx.roundRect(-14, -35, 28, 34, 3);\n ctx.strokeStyle = \"rgba(255,224,131,.65)\";\n ctx.lineWidth = 1;\n ctx.stroke();\n\n const pg = ctx.createRadialGradient(-1, -19, 1, -1, -19, 13);\n pg.addColorStop(0, \"#050403\");\n pg.addColorStop(.25, \"#211505\");\n pg.addColorStop(.53, \"#b68730\");\n pg.addColorStop(.78, \"#5d3b10\");\n pg.addColorStop(1, \"#d6ad51\");\n ctx.beginPath();\n ctx.arc(-1, -19, 11, 0, TAU);\n ctx.fillStyle = pg;\n ctx.fill();\n ctx.strokeStyle = \"#3c2408\";\n ctx.lineWidth = 1.4;\n ctx.stroke();\n\n ctx.beginPath();\n ctx.arc(-1, -19, 2.4, 0, TAU);\n ctx.fillStyle = \"#030302\";\n ctx.fill();\n ctx.beginPath();\n ctx.arc(-1.8, -19.8, .65, 0, TAU);\n ctx.fillStyle = \"rgba(255,230,154,.65)\";\n ctx.fill();\n\n ctx.font = \"5px Georgia, serif\";\n ctx.textAlign = \"center\";\n ctx.fillStyle = \"rgba(49,27,6,.9)\";\n ctx.fillText(\"SOL\", 0, -5.5);\n ctx.restore();\n\n // Fine scratches and tarnish across brass\n ctx.save();\n ctx.globalCompositeOperation = \"screen\";\n ctx.strokeStyle = \"rgba(255,226,145,.16)\";\n ctx.lineWidth = .45;\n for (let i = 0; i < 125; i++) {\n const t = rnd() * TAU;\n const p = rotatedPoint(\n 256, 269,\n Math.cos(t) * (161 + rnd() * 10),\n Math.sin(t) * (184 + rnd() * 11),\n outerRot\n );\n const len = 2 + rnd() * 8;\n ctx.beginPath();\n ctx.moveTo(p.x, p.y);\n ctx.lineTo(p.x + len * Math.cos(t + 1.5), p.y + len * Math.sin(t + 1.5));\n ctx.stroke();\n }\n ctx.restore();\n\n // Small maker's inscription\n ctx.save();\n ctx.translate(258, 417);\n ctx.rotate(outerRot);\n ctx.textAlign = \"center\";\n ctx.font = \"italic 7px Georgia, serif\";\n ctx.fillStyle = \"rgba(40,23,5,.84)\";\n ctx.fillText(\"LONDINI\", 0, 0);\n ctx.fillStyle = \"rgba(255,226,141,.18)\";\n ctx.fillText(\"LONDINI\", .5, .6);\n ctx.restore();\n\n // Subtle foreground glints\n ctx.save();\n ctx.globalCompositeOperation = \"screen\";\n let glint = ctx.createLinearGradient(116, 115, 400, 410);\n glint.addColorStop(0, \"rgba(255,244,190,0)\");\n glint.addColorStop(.47, \"rgba(255,235,160,.12)\");\n glint.addColorStop(.52, \"rgba(255,250,213,.35)\");\n glint.addColorStop(.57, \"rgba(255,235,160,.08)\");\n glint.addColorStop(1, \"rgba(255,244,190,0)\");\n ctx.strokeStyle = glint;\n ctx.lineWidth = 2;\n ellipsePath(256, 269, 166, 190, outerRot, 3.65, 5.4);\n ctx.stroke();\n ctx.restore();\n}"}], "metadata": {"id": "val-v1-broad-v2-entity-validation-003", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 6439, "code_sha256": "0c3da122941f3bdd18dd7e0722a0a22282f90021bdd8e1d09f0ced30929f059e"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A wooden cross-staff lies beside a sea chart, with a long graduated staff and a sliding perpendicular vane fully visible."}, {"role": "assistant", "content": "async function render(stage) {\n stage.replaceChildren();\n Object.assign(stage.style, {\n position: \"relative\",\n overflow: \"hidden\",\n width: \"512px\",\n height: \"512px\",\n background: \"#6d4528\"\n });\n\n const canvas = document.createElement(\"canvas\");\n const dpr = Math.max(2, window.devicePixelRatio || 1);\n canvas.width = 512 * dpr;\n canvas.height = 512 * dpr;\n Object.assign(canvas.style, {\n width: \"512px\",\n height: \"512px\",\n display: \"block\"\n });\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(dpr, dpr);\n\n let seed = 184729;\n const rnd = () => {\n seed = (seed * 1664525 + 1013904223) >>> 0;\n return seed / 4294967296;\n };\n\n const line = (x1, y1, x2, y2) => {\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n };\n\n const ellipse = (x, y, rx, ry, rot = 0) => {\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, rot, 0, Math.PI * 2);\n };\n\n // Wooden tabletop\n const table = ctx.createLinearGradient(0, 0, 512, 512);\n table.addColorStop(0, \"#8a603c\");\n table.addColorStop(0.45, \"#725035\");\n table.addColorStop(1, \"#56371f\");\n ctx.fillStyle = table;\n ctx.fillRect(0, 0, 512, 512);\n\n const boards = [\n [0, 111], [111, 227], [227, 345], [345, 512]\n ];\n for (const [y0, y1] of boards) {\n const g = ctx.createLinearGradient(0, y0, 0, y1);\n g.addColorStop(0, \"rgba(255,220,164,.055)\");\n g.addColorStop(0.5, \"rgba(60,24,8,.025)\");\n g.addColorStop(1, \"rgba(28,12,5,.13)\");\n ctx.fillStyle = g;\n ctx.fillRect(0, y0, 512, y1 - y0);\n }\n\n ctx.lineWidth = 1.3;\n for (const y of [110, 226, 344]) {\n ctx.strokeStyle = \"rgba(38,20,11,.55)\";\n line(0, y, 512, y + 1);\n ctx.strokeStyle = \"rgba(221,172,107,.13)\";\n line(0, y + 2.2, 512, y + 3);\n }\n\n ctx.lineCap = \"round\";\n for (let i = 0; i < 145; i++) {\n const y = rnd() * 512;\n const x = -30 + rnd() * 520;\n const length = 18 + rnd() * 150;\n ctx.strokeStyle = `rgba(${rnd() > .6 ? 43 : 231},${rnd() > .6 ? 22 : 174},${rnd() > .6 ? 9 : 104},${.018 + rnd() * .06})`;\n ctx.lineWidth = .35 + rnd() * 1.1;\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.bezierCurveTo(\n x + length * .3, y + (rnd() - .5) * 4,\n x + length * .72, y + (rnd() - .5) * 4,\n x + length, y + (rnd() - .5) * 2\n );\n ctx.stroke();\n }\n\n // Knots in the table\n for (const [x, y, sx] of [[70, 74, 1], [442, 48, .75], [124, 333, .85], [408, 480, .8]]) {\n ctx.save();\n ctx.translate(x, y);\n ctx.scale(sx, .45 * sx);\n for (let k = 0; k < 4; k++) {\n ellipse(0, 0, 17 - k * 3.5, 9 - k * 1.5, -.08);\n ctx.strokeStyle = `rgba(49,25,11,${.12 + k * .045})`;\n ctx.lineWidth = 1.2;\n ctx.stroke();\n }\n ctx.restore();\n }\n\n // Sea chart\n ctx.save();\n ctx.translate(359, 271);\n ctx.rotate(0.064);\n\n ctx.shadowColor = \"rgba(24,13,7,.52)\";\n ctx.shadowBlur = 15;\n ctx.shadowOffsetX = 7;\n ctx.shadowOffsetY = 9;\n ctx.beginPath();\n ctx.moveTo(-145, -183);\n ctx.quadraticCurveTo(-8, -189, 143, -177);\n ctx.lineTo(139, 178);\n ctx.quadraticCurveTo(8, 183, -147, 172);\n ctx.closePath();\n ctx.fillStyle = \"#d9c28d\";\n ctx.fill();\n ctx.shadowColor = \"transparent\";\n\n ctx.save();\n ctx.beginPath();\n ctx.moveTo(-145, -183);\n ctx.quadraticCurveTo(-8, -189, 143, -177);\n ctx.lineTo(139, 178);\n ctx.quadraticCurveTo(8, 183, -147, 172);\n ctx.closePath();\n ctx.clip();\n\n const parchment = ctx.createRadialGradient(-30, -30, 30, 0, 0, 260);\n parchment.addColorStop(0, \"#ead9aa\");\n parchment.addColorStop(.67, \"#ddc58e\");\n parchment.addColorStop(1, \"#b8955d\");\n ctx.fillStyle = parchment;\n ctx.fillRect(-155, -195, 310, 390);\n\n // Paper mottling\n for (let i = 0; i < 380; i++) {\n const x = -148 + rnd() * 296;\n const y = -186 + rnd() * 374;\n const r = .3 + rnd() * 2.1;\n ctx.fillStyle = rnd() > .5\n ? `rgba(91,62,28,${.012 + rnd() * .035})`\n : `rgba(255,246,205,${.015 + rnd() * .04})`;\n ellipse(x, y, r * (1 + rnd()), r, rnd() * Math.PI);\n ctx.fill();\n }\n\n // Border\n ctx.strokeStyle = \"rgba(83,57,27,.52)\";\n ctx.lineWidth = 1;\n ctx.strokeRect(-137, -173, 270, 338);\n ctx.strokeStyle = \"rgba(83,57,27,.28)\";\n ctx.strokeRect(-133, -169, 262, 330);\n\n // Latitude and longitude grid\n ctx.strokeStyle = \"rgba(86,96,78,.25)\";\n ctx.lineWidth = .55;\n for (let x = -120; x <= 120; x += 24) {\n ctx.beginPath();\n ctx.moveTo(x, -169);\n ctx.bezierCurveTo(x - 9, -60, x + 9, 60, x, 165);\n ctx.stroke();\n }\n for (let y = -150; y <= 150; y += 25) {\n ctx.beginPath();\n ctx.moveTo(-133, y);\n ctx.bezierCurveTo(-50, y + 5, 52, y - 5, 129, y);\n ctx.stroke();\n }\n\n // Rhumb lines\n const hubs = [[-53, 36], [70, -57], [61, 96]];\n ctx.lineWidth = .48;\n for (let h = 0; h < hubs.length; h++) {\n const [hx, hy] = hubs[h];\n const colors = [\"rgba(128,63,44,.35)\", \"rgba(47,83,82,.32)\", \"rgba(118,91,34,.3)\"];\n ctx.strokeStyle = colors[h];\n for (let a = 0; a < Math.PI * 2; a += Math.PI / 8) {\n line(hx, hy, hx + Math.cos(a) * 230, hy + Math.sin(a) * 230);\n }\n }\n\n // Coastlines and colored coastal wash\n const coast = (points, fillSide) => {\n ctx.beginPath();\n ctx.moveTo(points[0][0], points[0][1]);\n for (let i = 1; i < points.length; i++) {\n const p = points[i];\n ctx.lineTo(p[0], p[1]);\n }\n if (fillSide === \"left\") {\n ctx.lineTo(-155, points[points.length - 1][1]);\n ctx.lineTo(-155, points[0][1]);\n } else {\n ctx.lineTo(155, points[points.length - 1][1]);\n ctx.lineTo(155, points[0][1]);\n }\n ctx.closePath();\n ctx.fillStyle = \"rgba(150,120,65,.18)\";\n ctx.fill();\n ctx.beginPath();\n ctx.moveTo(points[0][0], points[0][1]);\n for (let i = 1; i < points.length; i++) ctx.lineTo(points[i][0], points[i][1]);\n ctx.strokeStyle = \"rgba(64,64,43,.78)\";\n ctx.lineWidth = 1.15;\n ctx.stroke();\n };\n\n coast([\n [-132,-151],[-109,-145],[-101,-132],[-111,-120],[-95,-108],[-102,-93],\n [-86,-78],[-91,-61],[-77,-47],[-81,-29],[-67,-15],[-72,2],[-59,17],\n [-65,37],[-54,53],[-57,72],[-43,91],[-49,110],[-37,130],[-42,158]\n ], \"left\");\n\n coast([\n [128,-151],[109,-141],[114,-126],[96,-113],[103,-97],[88,-82],\n [94,-67],[78,-53],[83,-37],[67,-24],[76,-7],[61,8],[67,25],\n [52,40],[61,56],[47,72],[54,89],[39,104],[46,122],[31,139],[35,159]\n ], \"right\");\n\n // Islands\n ctx.fillStyle = \"rgba(143,112,60,.20)\";\n ctx.strokeStyle = \"rgba(61,64,43,.72)\";\n ctx.lineWidth = .8;\n for (const [x, y, rx, ry, r] of [\n [-15,-81,7,3,.3], [7,-57,3,7,-.2], [-9,-30,5,2,.4],\n [16,19,8,3,-.15], [-16,76,3,6,.1], [4,105,7,3,.15]\n ]) {\n ellipse(x, y, rx, ry, r);\n ctx.fill();\n ctx.stroke();\n }\n\n // Compass rose\n ctx.save();\n ctx.translate(27, -91);\n ctx.strokeStyle = \"rgba(56,67,60,.75)\";\n ctx.fillStyle = \"rgba(76,88,76,.55)\";\n ctx.lineWidth = .65;\n for (let i = 0; i < 16; i++) {\n ctx.save();\n ctx.rotate(i * Math.PI / 8);\n ctx.beginPath();\n ctx.moveTo(0, 0);\n ctx.lineTo(i % 2 ? 2 : 3.5, -5);\n ctx.lineTo(0, i % 2 ? -18 : -27);\n ctx.lineTo(i % 2 ? -2 : -3.5, -5);\n ctx.closePath();\n if (i % 2 === 0) ctx.fill();\n ctx.stroke();\n ctx.restore();\n }\n ellipse(0, 0, 3, 3);\n ctx.fillStyle = \"#cfb77e\";\n ctx.fill();\n ctx.stroke();\n ctx.font = \"bold 8px Georgia, serif\";\n ctx.fillStyle = \"rgba(55,51,35,.8)\";\n ctx.textAlign = \"center\";\n ctx.fillText(\"N\", 0, -31);\n ctx.restore();\n\n ctx.fillStyle = \"rgba(62,69,61,.6)\";\n ctx.textAlign = \"center\";\n ctx.font = \"italic 12px Georgia, serif\";\n ctx.fillText(\"MARE ATLANTICVM\", 0, 5);\n ctx.font = \"italic 7px Georgia, serif\";\n ctx.fillText(\"Insulae et litora maris\", 1, 18);\n\n ctx.textAlign = \"left\";\n ctx.font = \"6px Georgia, serif\";\n ctx.fillStyle = \"rgba(73,61,39,.65)\";\n ctx.fillText(\"Terra Occidentalis\", -127, -118);\n ctx.fillText(\"Costa Orientalis\", 61, 132);\n\n // Scale cartouche\n ctx.strokeStyle = \"rgba(76,56,31,.62)\";\n ctx.lineWidth = .8;\n ctx.strokeRect(-103, 140, 79, 15);\n for (let i = 0; i < 8; i++) {\n ctx.fillStyle = i % 2\n ? \"rgba(79,59,33,.55)\"\n : \"rgba(230,210,158,.45)\";\n ctx.fillRect(-99 + i * 9, 145, 9, 5);\n }\n ctx.font = \"5px Georgia, serif\";\n ctx.fillStyle = \"rgba(73,54,31,.75)\";\n ctx.fillText(\"Scala leucarum\", -96, 143);\n\n // Darkened aged edges\n const edge = ctx.createLinearGradient(-150, 0, 150, 0);\n edge.addColorStop(0, \"rgba(76,45,17,.22)\");\n edge.addColorStop(.08, \"rgba(76,45,17,0)\");\n edge.addColorStop(.92, \"rgba(76,45,17,0)\");\n edge.addColorStop(1, \"rgba(76,45,17,.23)\");\n ctx.fillStyle = edge;\n ctx.fillRect(-150, -190, 300, 380);\n\n ctx.restore();\n\n // Slight curled lower-right corner\n ctx.beginPath();\n ctx.moveTo(114, 153);\n ctx.quadraticCurveTo(132, 153, 139, 177);\n ctx.quadraticCurveTo(122, 169, 114, 153);\n const curl = ctx.createLinearGradient(115, 152, 139, 178);\n curl.addColorStop(0, \"#ead9aa\");\n curl.addColorStop(1, \"#977442\");\n ctx.fillStyle = curl;\n ctx.fill();\n ctx.strokeStyle = \"rgba(75,50,25,.25)\";\n ctx.stroke();\n ctx.restore();\n\n // Cross-staff\n ctx.save();\n ctx.translate(220, 270);\n ctx.rotate(-0.86);\n\n // Object shadow\n ctx.save();\n ctx.translate(6, 8);\n ctx.shadowColor = \"rgba(21,11,5,.62)\";\n ctx.shadowBlur = 12;\n ctx.fillStyle = \"rgba(35,18,7,.55)\";\n ctx.fillRect(-216, -10, 432, 22);\n ctx.fillRect(-39, -105, 22, 210);\n ctx.restore();\n\n // Main graduated staff\n const beam = ctx.createLinearGradient(0, -11, 0, 12);\n beam.addColorStop(0, \"#6b3b19\");\n beam.addColorStop(.13, \"#bb7a3d\");\n beam.addColorStop(.42, \"#9a5929\");\n beam.addColorStop(.75, \"#70401d\");\n beam.addColorStop(1, \"#41230f\");\n ctx.fillStyle = beam;\n ctx.beginPath();\n ctx.moveTo(-216, -10);\n ctx.lineTo(211, -10);\n ctx.lineTo(217, -5);\n ctx.lineTo(217, 8);\n ctx.lineTo(211, 12);\n ctx.lineTo(-216, 12);\n ctx.closePath();\n ctx.fill();\n\n ctx.strokeStyle = \"rgba(42,20,7,.9)\";\n ctx.lineWidth = 1.2;\n ctx.stroke();\n ctx.strokeStyle = \"rgba(255,200,119,.38)\";\n ctx.lineWidth = .8;\n line(-210, -8.5, 210, -8.5);\n ctx.strokeStyle = \"rgba(38,17,6,.72)\";\n line(-212, 9.5, 212, 9.5);\n\n // Grain along staff\n for (let i = 0; i < 32; i++) {\n const y = -7 + rnd() * 15;\n const x = -205 + rnd() * 370;\n const len = 13 + rnd() * 72;\n ctx.strokeStyle = `rgba(${rnd() > .7 ? 237 : 49},${rnd() > .7 ? 158 : 24},${rnd() > .7 ? 79 : 8},${.04 + rnd() * .11})`;\n ctx.lineWidth = .35 + rnd() * .45;\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.bezierCurveTo(x + len * .35, y + (rnd() - .5) * 2, x + len * .7, y + (rnd() - .5) * 2, x + len, y);\n ctx.stroke();\n }\n\n // Graduation marks and numerals\n ctx.strokeStyle = \"rgba(35,18,8,.88)\";\n ctx.fillStyle = \"rgba(37,18,7,.9)\";\n ctx.textAlign = \"center\";\n ctx.font = \"5px Georgia, serif\";\n for (let x = -195, n = 0; x <= 195; x += 10, n++) {\n const major = n % 5 === 0;\n const medium = n % 5 === 0 || n % 5 === 2;\n ctx.lineWidth = major ? 1 : .65;\n line(x, -9, x, -9 + (major ? 8 : medium ? 5.5 : 3.5));\n if (major && x > -190 && x < 190) ctx.fillText(String(n * 5), x, 5.5);\n }\n\n // End cap\n const cap = ctx.createLinearGradient(207, 0, 219, 0);\n cap.addColorStop(0, \"#6a3a19\");\n cap.addColorStop(1, \"#2e1709\");\n ctx.fillStyle = cap;\n ctx.fillRect(211, -8, 7, 17);\n ctx.strokeStyle = \"rgba(29,14,5,.8)\";\n ctx.strokeRect(211, -8, 7, 17);\n\n // Sliding vane\n const vx = -30;\n const vane = ctx.createLinearGradient(vx - 11, 0, vx + 12, 0);\n vane.addColorStop(0, \"#45230d\");\n vane.addColorStop(.13, \"#754019\");\n vane.addColorStop(.45, \"#b06c31\");\n vane.addColorStop(.73, \"#865022\");\n vane.addColorStop(1, \"#3d200d\");\n ctx.fillStyle = vane;\n ctx.beginPath();\n ctx.moveTo(vx - 11, -105);\n ctx.lineTo(vx + 10, -105);\n ctx.lineTo(vx + 12, 104);\n ctx.lineTo(vx - 10, 104);\n ctx.closePath();\n ctx.fill();\n ctx.strokeStyle = \"rgba(37,18,6,.92)\";\n ctx.lineWidth = 1.2;\n ctx.stroke();\n\n // Vane bevels\n ctx.strokeStyle = \"rgba(255,196,109,.32)\";\n ctx.lineWidth = .8;\n line(vx - 8.5, -101, vx - 8.5, 99);\n ctx.strokeStyle = \"rgba(34,15,5,.55)\";\n line(vx + 8.5, -100, vx + 9.5, 99);\n\n // Vane grain\n for (let i = 0; i < 23; i++) {\n const y = -96 + rnd() * 188;\n ctx.strokeStyle = `rgba(42,19,6,${.05 + rnd() * .13})`;\n ctx.lineWidth = .45;\n line(vx - 7 + rnd() * 4, y, vx + 7 - rnd() * 3, y + (rnd() - .5) * 3);\n }\n\n // Sliding block around intersection\n ctx.shadowColor = \"rgba(20,10,4,.35)\";\n ctx.shadowBlur = 3;\n ctx.shadowOffsetY = 2;\n const block = ctx.createLinearGradient(0, -15, 0, 16);\n block.addColorStop(0, \"#c07c3b\");\n block.addColorStop(.42, \"#89501f\");\n block.addColorStop(1, \"#4d280f\");\n ctx.fillStyle = block;\n ctx.beginPath();\n ctx.roundRect(vx - 15, -15, 30, 30, 3);\n ctx.fill();\n ctx.shadowColor = \"transparent\";\n ctx.strokeStyle = \"rgba(40,19,6,.9)\";\n ctx.lineWidth = 1.25;\n ctx.stroke();\n ctx.strokeStyle = \"rgba(246,182,93,.28)\";\n line(vx - 12, -12, vx + 12, -12);\n\n // Peg in slider\n const peg = ctx.createRadialGradient(vx - 2, -2, 1, vx, 0, 7);\n peg.addColorStop(0, \"#e0a15d\");\n peg.addColorStop(.5, \"#875023\");\n peg.addColorStop(1, \"#371b09\");\n ctx.fillStyle = peg;\n ellipse(vx, 0, 6, 6);\n ctx.fill();\n ctx.strokeStyle = \"rgba(31,14,5,.75)\";\n ctx.stroke();\n\n // Wear and small nicks\n ctx.strokeStyle = \"rgba(232,162,82,.32)\";\n ctx.lineWidth = .7;\n line(-180, 8, -168, 7);\n line(121, -7, 136, -8);\n line(vx - 8, 67, vx + 2, 64);\n ctx.restore();\n\n // Soft ambient vignette\n const vignette = ctx.createRadialGradient(256, 245, 175, 256, 256, 385);\n vignette.addColorStop(0, \"rgba(0,0,0,0)\");\n vignette.addColorStop(.72, \"rgba(22,10,3,.03)\");\n vignette.addColorStop(1, \"rgba(18,8,2,.26)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0, 0, 512, 512);\n\n await new Promise(resolve => requestAnimationFrame(resolve));\n}"}], "metadata": {"id": "val-v1-broad-v2-entity-validation-005", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 6546, "code_sha256": "619d232f9fda267e542b7e8ca39d93d1d560dee287014465573c2675e635a07e"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A migrating island assembled from giant clock hands glides over autumn forests, supporting a marble temple and dozens of fluttering copper banners."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n Object.assign(stage.style, {\n position: \"relative\",\n overflow: \"hidden\",\n width: \"512px\",\n height: \"512px\",\n background: \"#9bb5bd\"\n });\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = 1024;\n canvas.height = 1024;\n canvas.style.width = \"512px\";\n canvas.style.height = \"512px\";\n canvas.setAttribute(\"aria-label\", \"A migrating island built from giant clock hands carrying a marble temple and copper banners above autumn forests\");\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(2, 2);\n\n let seed = 981237;\n const rnd = () => {\n seed = (seed * 1664525 + 1013904223) >>> 0;\n return seed / 4294967296;\n };\n const rr = (a, b) => a + rnd() * (b - a);\n\n const path = (pts, close = true) => {\n ctx.beginPath();\n ctx.moveTo(pts[0][0], pts[0][1]);\n for (let i = 1; i < pts.length; i++) ctx.lineTo(pts[i][0], pts[i][1]);\n if (close) ctx.closePath();\n };\n\n const ellipse = (x, y, rx, ry, fill, stroke, lw = 1) => {\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n if (fill) {\n ctx.fillStyle = fill;\n ctx.fill();\n }\n if (stroke) {\n ctx.lineWidth = lw;\n ctx.strokeStyle = stroke;\n ctx.stroke();\n }\n };\n\n // Sky\n let g = ctx.createLinearGradient(0, 0, 0, 400);\n g.addColorStop(0, \"#698b9c\");\n g.addColorStop(0.38, \"#a9c0c1\");\n g.addColorStop(0.72, \"#d5c9ad\");\n g.addColorStop(1, \"#d6ad79\");\n ctx.fillStyle = g;\n ctx.fillRect(0, 0, 512, 512);\n\n // Soft sun and atmospheric haze\n const sun = ctx.createRadialGradient(401, 105, 2, 401, 105, 95);\n sun.addColorStop(0, \"rgba(255,241,188,.9)\");\n sun.addColorStop(.22, \"rgba(252,220,152,.38)\");\n sun.addColorStop(1, \"rgba(255,220,160,0)\");\n ctx.fillStyle = sun;\n ctx.fillRect(300, 3, 205, 205);\n ellipse(401, 106, 22, 22, \"rgba(255,231,171,.48)\");\n\n // Wispy clouds\n ctx.save();\n ctx.globalAlpha = .22;\n for (let i = 0; i < 20; i++) {\n const x = rr(-40, 500), y = rr(35, 215), w = rr(35, 105);\n const cg = ctx.createLinearGradient(x, y, x, y + 14);\n cg.addColorStop(0, \"rgba(255,255,244,.8)\");\n cg.addColorStop(1, \"rgba(215,219,208,0)\");\n ctx.fillStyle = cg;\n ctx.beginPath();\n ctx.ellipse(x, y, w, rr(2, 7), rr(-.08, .08), 0, Math.PI * 2);\n ctx.fill();\n }\n ctx.restore();\n\n // Distant birds\n ctx.strokeStyle = \"rgba(55,61,57,.55)\";\n ctx.lineWidth = 1;\n for (let i = 0; i < 14; i++) {\n const x = 35 + i * 8 + rr(-5, 5);\n const y = 104 + Math.sin(i * .7) * 11 + rr(-2, 2);\n ctx.beginPath();\n ctx.moveTo(x - 4, y + 1);\n ctx.quadraticCurveTo(x - 2, y - 2, x, y);\n ctx.quadraticCurveTo(x + 2, y - 3, x + 5, y - 1);\n ctx.stroke();\n }\n\n // Far hills\n const hills = [\n { y: 327, color: \"#65766c\", alpha: .28, amp: 25 },\n { y: 353, color: \"#5e6957\", alpha: .43, amp: 35 },\n { y: 385, color: \"#594f3e\", alpha: .65, amp: 26 }\n ];\n hills.forEach((h, n) => {\n ctx.save();\n ctx.globalAlpha = h.alpha;\n ctx.fillStyle = h.color;\n ctx.beginPath();\n ctx.moveTo(0, 512);\n ctx.lineTo(0, h.y);\n for (let x = 0; x <= 512; x += 12) {\n const yy = h.y - Math.sin(x * .015 + n) * h.amp * .4 - rr(0, h.amp);\n ctx.lineTo(x, yy);\n }\n ctx.lineTo(512, 512);\n ctx.closePath();\n ctx.fill();\n ctx.restore();\n });\n\n // Autumn forest layers\n function drawTree(x, base, scale, color, dark) {\n ctx.fillStyle = dark;\n ctx.fillRect(x - scale * .06, base - scale * .72, scale * .12, scale * .72);\n ctx.fillStyle = color;\n const crowns = [\n [x, base - scale * .86, scale * .34],\n [x - scale * .21, base - scale * .65, scale * .27],\n [x + scale * .22, base - scale * .64, scale * .3],\n [x - scale * .07, base - scale * .43, scale * .32],\n [x + scale * .11, base - scale * .98, scale * .22]\n ];\n crowns.forEach(c => {\n ctx.beginPath();\n ctx.arc(c[0], c[1], c[2], 0, Math.PI * 2);\n ctx.fill();\n });\n }\n\n const palettes = [\n [\"#8e6432\", \"#9b793e\", \"#735330\", \"#a46c31\"],\n [\"#a85625\", \"#c2762f\", \"#835a27\", \"#b14c25\"],\n [\"#7d3520\", \"#a14321\", \"#d07a28\", \"#6d4825\"]\n ];\n for (let layer = 0; layer < 3; layer++) {\n const base = 435 + layer * 35;\n const count = 44 + layer * 12;\n for (let i = 0; i < count; i++) {\n const x = rr(-20, 532);\n const s = rr(18, 39) * (1 + layer * .23);\n drawTree(\n x,\n base + rr(-9, 10),\n s,\n palettes[layer][Math.floor(rnd() * palettes[layer].length)],\n layer === 2 ? \"#493424\" : \"#5b4930\"\n );\n }\n }\n\n // Mist over canopy\n g = ctx.createLinearGradient(0, 380, 0, 485);\n g.addColorStop(0, \"rgba(222,211,184,.28)\");\n g.addColorStop(.5, \"rgba(221,190,150,.08)\");\n g.addColorStop(1, \"rgba(61,39,24,0)\");\n ctx.fillStyle = g;\n ctx.fillRect(0, 360, 512, 135);\n\n // Floating island shadow\n ctx.save();\n ctx.filter = \"blur(11px)\";\n ellipse(258, 406, 150, 19, \"rgba(39,32,25,.28)\");\n ctx.restore();\n\n // Long clock hands forming the flying structure\n function clockHand(points, fillA = \"#3c3329\", fillB = \"#9a7140\") {\n ctx.save();\n ctx.shadowColor = \"rgba(17,15,13,.45)\";\n ctx.shadowBlur = 8;\n ctx.shadowOffsetY = 7;\n path(points);\n g = ctx.createLinearGradient(0, 242, 0, 350);\n g.addColorStop(0, fillB);\n g.addColorStop(.48, fillA);\n g.addColorStop(1, \"#1f1d1a\");\n ctx.fillStyle = g;\n ctx.fill();\n ctx.strokeStyle = \"#211c17\";\n ctx.lineWidth = 2;\n ctx.stroke();\n ctx.restore();\n }\n\n clockHand([[244,276],[48,326],[39,338],[236,305],[257,294]], \"#44372a\", \"#ac814b\");\n clockHand([[273,277],[472,240],[488,247],[281,307],[254,298]], \"#3b3229\", \"#957146\");\n clockHand([[255,286],[318,400],[311,425],[244,307]], \"#2c2823\", \"#81613b\");\n clockHand([[248,285],[165,206],[158,195],[260,270]], \"#42372b\", \"#a17a48\");\n\n // Hand cutouts/rivets\n [[76,329],[108,320],[143,312],[184,302],[360,282],[403,267],[447,254],[298,364],[308,395]].forEach(p => {\n ellipse(p[0], p[1], 3.5, 2.3, \"#201d19\", \"#b18853\", .7);\n });\n\n // Clockwork island body\n ctx.save();\n ctx.shadowColor = \"rgba(12,12,10,.5)\";\n ctx.shadowBlur = 14;\n ctx.shadowOffsetY = 9;\n path([[100,271],[133,251],[196,239],[273,236],[356,244],[409,265],[397,304],[357,337],[286,362],[218,352],[148,321],[111,295]]);\n g = ctx.createLinearGradient(0, 240, 0, 366);\n g.addColorStop(0, \"#a27645\");\n g.addColorStop(.16, \"#574534\");\n g.addColorStop(.6, \"#292722\");\n g.addColorStop(1, \"#151817\");\n ctx.fillStyle = g;\n ctx.fill();\n ctx.strokeStyle = \"#201b17\";\n ctx.lineWidth = 3;\n ctx.stroke();\n ctx.restore();\n\n // Rocky/mechanical underside facets\n const facets = [\n [[121,284],[172,298],[153,326],[113,295],\"#493a2d\"],\n [[172,298],[219,304],[218,351],[153,326],\"#252420\"],\n [[219,304],[276,308],[286,361],[218,351],\"#343027\"],\n [[276,308],[337,296],[356,337],[286,361],\"#1f211e\"],\n [[337,296],[402,279],[397,304],[356,337],\"#443529\"]\n ];\n facets.forEach(f => {\n path(f.slice(0,4));\n ctx.fillStyle = f[4];\n ctx.fill();\n ctx.strokeStyle = \"rgba(173,130,75,.35)\";\n ctx.lineWidth = 1;\n ctx.stroke();\n });\n\n // Hanging gears\n function gear(x, y, r, teeth) {\n ctx.save();\n ctx.translate(x, y);\n ctx.fillStyle = \"#2c2822\";\n ctx.strokeStyle = \"#a07743\";\n ctx.lineWidth = 2;\n ctx.beginPath();\n for (let i = 0; i < teeth * 2; i++) {\n const a = i * Math.PI / teeth;\n const rad = i % 2 ? r * .82 : r;\n const px = Math.cos(a) * rad, py = Math.sin(a) * rad;\n i ? ctx.lineTo(px, py) : ctx.moveTo(px, py);\n }\n ctx.closePath();\n ctx.fill();\n ctx.stroke();\n ellipse(0, 0, r * .56, r * .56, \"#171817\", \"#725638\", 1.4);\n ellipse(0, 0, r * .16, r * .16, \"#a17843\", \"#231d18\", 1);\n ctx.restore();\n }\n gear(169, 322, 22, 12);\n gear(348, 311, 27, 14);\n gear(231, 344, 16, 10);\n gear(302, 337, 13, 9);\n\n // Top clock face platform\n ellipse(256, 266, 158, 43, \"#312d26\", \"#b78a4e\", 4);\n ellipse(256, 260, 148, 34, \"#857054\", \"#29251f\", 2);\n ellipse(256, 257, 137, 29, \"#b2a17f\", \"#5d4931\", 2);\n\n // Clock face radial lines and numerals-like marks\n ctx.save();\n ctx.translate(256, 257);\n for (let i = 0; i < 24; i++) {\n const a = i * Math.PI * 2 / 24;\n ctx.strokeStyle = i % 2 ? \"#695438\" : \"#40382d\";\n ctx.lineWidth = i % 3 ? 1 : 2.2;\n ctx.beginPath();\n ctx.moveTo(Math.cos(a) * 112, Math.sin(a) * 23);\n ctx.lineTo(Math.cos(a) * 132, Math.sin(a) * 28);\n ctx.stroke();\n }\n ctx.restore();\n ellipse(256, 261, 10, 6, \"#392f25\", \"#d0a969\", 2);\n\n // Temple foundation\n ctx.shadowColor = \"rgba(25,20,16,.3)\";\n ctx.shadowBlur = 5;\n ctx.shadowOffsetY = 3;\n const marble = ctx.createLinearGradient(0, 0, 340, 0);\n marble.addColorStop(0, \"#9e9b8e\");\n marble.addColorStop(.25, \"#e5dfcd\");\n marble.addColorStop(.56, \"#b8b5a8\");\n marble.addColorStop(.82, \"#f0ead7\");\n marble.addColorStop(1, \"#898b82\");\n ctx.fillStyle = marble;\n ctx.strokeStyle = \"#77776e\";\n ctx.lineWidth = 1;\n ctx.fillRect(168, 238, 176, 13);\n ctx.strokeRect(168, 238, 176, 13);\n ctx.fillRect(177, 227, 158, 11);\n ctx.strokeRect(177, 227, 158, 11);\n ctx.shadowColor = \"transparent\";\n\n // Temple inner darkness\n ctx.fillStyle = \"#343630\";\n ctx.fillRect(193, 160, 126, 68);\n for (let i = 0; i < 5; i++) {\n const x = 207 + i * 25;\n ctx.fillStyle = i % 2 ? \"#454740\" : \"#292d2a\";\n ctx.fillRect(x, 174, 11, 54);\n }\n\n // Columns\n function column(x, y, h, w) {\n const cg = ctx.createLinearGradient(x, 0, x + w, 0);\n cg.addColorStop(0, \"#888a83\");\n cg.addColorStop(.18, \"#ddd9ca\");\n cg.addColorStop(.46, \"#f2ecdc\");\n cg.addColorStop(.72, \"#aaa99e\");\n cg.addColorStop(1, \"#73776f\");\n ctx.fillStyle = cg;\n ctx.fillRect(x, y, w, h);\n ctx.strokeStyle = \"rgba(91,91,83,.65)\";\n ctx.lineWidth = .7;\n ctx.strokeRect(x, y, w, h);\n for (let j = 1; j < 4; j++) {\n ctx.strokeStyle = \"rgba(112,111,102,.28)\";\n ctx.beginPath();\n ctx.moveTo(x + j * w / 4, y + 2);\n ctx.lineTo(x + j * w / 4, y + h - 2);\n ctx.stroke();\n }\n ctx.fillStyle = marble;\n ctx.fillRect(x - 3, y - 5, w + 6, 6);\n ctx.fillRect(x - 4, y + h - 2, w + 8, 6);\n }\n [184,207,230,253,276,299,322].forEach(x => column(x, 164, 65, 12));\n\n // Entablature\n ctx.fillStyle = marble;\n ctx.fillRect(176, 151, 167, 14);\n ctx.strokeStyle = \"#70736d\";\n ctx.strokeRect(176, 151, 167, 14);\n ctx.fillRect(183, 143, 153, 9);\n ctx.strokeRect(183, 143, 153, 9);\n\n // Pediment\n path([[177,143],[259,100],[342,143]]);\n ctx.fillStyle = marble;\n ctx.fill();\n ctx.strokeStyle = \"#6d706b\";\n ctx.lineWidth = 2;\n ctx.stroke();\n path([[194,139],[259,108],[325,139]]);\n ctx.fillStyle = \"#787970\";\n ctx.fill();\n path([[206,136],[259,113],[312,136]]);\n ctx.fillStyle = \"#b7b2a3\";\n ctx.fill();\n\n // Pediment relief\n ellipse(259, 126, 8, 6, \"#8a867b\");\n ctx.strokeStyle = \"#77756e\";\n ctx.lineWidth = 1.2;\n for (let i = 0; i < 6; i++) {\n const x = 223 + i * 14;\n ctx.beginPath();\n ctx.moveTo(x, 137);\n ctx.lineTo(x + 6, 123 + Math.abs(3 - i) * 3);\n ctx.stroke();\n }\n\n // Roof cap and statue\n ctx.fillStyle = \"#d9d3c2\";\n ctx.fillRect(173, 140, 172, 5);\n ellipse(259, 98, 4, 4, \"#c7c0ae\", \"#67665f\");\n ctx.fillStyle = \"#aaa89c\";\n ctx.fillRect(257, 99, 4, 12);\n path([[251,110],[259,101],[267,110]]);\n ctx.fill();\n\n // Marble weathering\n ctx.save();\n ctx.globalAlpha = .22;\n ctx.strokeStyle = \"#666c68\";\n ctx.lineWidth = .7;\n for (let i = 0; i < 30; i++) {\n const x = rr(180, 338), y = rr(145, 240);\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.lineTo(x + rr(-5, 8), y + rr(2, 12));\n ctx.stroke();\n }\n ctx.restore();\n\n // Copper banner poles and fluttering banners\n function banner(x, y, dir, size, phase) {\n ctx.strokeStyle = \"#4c3827\";\n ctx.lineWidth = 1.5;\n ctx.beginPath();\n ctx.moveTo(x, y + 38);\n ctx.lineTo(x, y);\n ctx.stroke();\n ellipse(x, y - 2, 2, 2, \"#d49a54\", \"#523a27\");\n\n const len = size;\n ctx.beginPath();\n ctx.moveTo(x + dir, y + 4);\n ctx.bezierCurveTo(\n x + dir * len * .3, y + phase,\n x + dir * len * .67, y + 4 - phase,\n x + dir * len, y + 8\n );\n ctx.lineTo(x + dir * len * .82, y + 15);\n ctx.bezierCurveTo(\n x + dir * len * .55, y + 11 + phase,\n x + dir * len * .25, y + 17 - phase,\n x + dir, y + 13\n );\n ctx.closePath();\n const bg = ctx.createLinearGradient(x, y, x + dir * len, y + 15);\n bg.addColorStop(0, \"#7c321d\");\n bg.addColorStop(.42, \"#cf7133\");\n bg.addColorStop(.72, \"#9b4323\");\n bg.addColorStop(1, \"#e69a4d\");\n ctx.fillStyle = bg;\n ctx.fill();\n ctx.strokeStyle = \"#6a2c1d\";\n ctx.lineWidth = .6;\n ctx.stroke();\n ctx.strokeStyle = \"rgba(255,194,102,.55)\";\n ctx.beginPath();\n ctx.moveTo(x + dir * 4, y + 7);\n ctx.bezierCurveTo(x + dir * len * .35, y + phase + 3, x + dir * len * .65, y + 7 - phase, x + dir * len * .86, y + 10);\n ctx.stroke();\n }\n\n // Temple roof banners\n [\n [181,123,-1,26,3],[205,112,-1,24,-2],[230,101,1,26,3],\n [286,102,1,28,-3],[311,113,1,25,3],[337,126,1,30,-2]\n ].forEach(b => banner(...b));\n\n // Platform perimeter banners, dozens\n const bannerData = [];\n for (let i = 0; i < 9; i++) bannerData.push([118 + i * 18, 240 + Math.sin(i * .5) * 7, i < 3 ? -1 : 1, rr(16, 28), rr(-4, 4)]);\n for (let i = 0; i < 9; i++) bannerData.push([278 + i * 15, 239 + Math.sin(i * .65) * 8, 1, rr(17, 30), rr(-4, 4)]);\n bannerData.forEach(b => banner(...b));\n\n // Foreground cables, pendulum and hanging ornaments\n ctx.strokeStyle = \"#2b2924\";\n ctx.lineWidth = 1.2;\n [[196,291,188,373],[323,294,334,380],[270,311,270,398]].forEach(c => {\n ctx.beginPath();\n ctx.moveTo(c[0], c[1]);\n ctx.quadraticCurveTo((c[0] + c[2]) / 2 + 5, (c[1] + c[3]) / 2, c[2], c[3]);\n ctx.stroke();\n });\n ellipse(188, 376, 6, 9, \"#8c6538\", \"#27231f\", 1.5);\n ellipse(334, 384, 8, 12, \"#62482e\", \"#211f1b\", 1.5);\n ellipse(270, 405, 10, 14, \"#a8793d\", \"#25211c\", 2);\n ellipse(270, 405, 4, 7, \"#d9a558\");\n\n // Highlights and airborne leaves\n ctx.save();\n for (let i = 0; i < 35; i++) {\n const x = rr(35, 480), y = rr(190, 410);\n if (x > 105 && x < 410 && y > 225 && y < 350) continue;\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rr(0, Math.PI));\n ctx.fillStyle = [\"#b86026\", \"#d68a35\", \"#7d3c23\", \"#cb9b48\"][Math.floor(rnd() * 4)];\n ctx.globalAlpha = rr(.45, .9);\n ctx.beginPath();\n ctx.ellipse(0, 0, rr(1.4, 3.2), rr(.5, 1.2), 0, 0, Math.PI * 2);\n ctx.fill();\n ctx.restore();\n }\n ctx.restore();\n\n // Overall cinematic vignette and warm light\n const light = ctx.createLinearGradient(0, 0, 512, 512);\n light.addColorStop(0, \"rgba(75,106,123,.12)\");\n light.addColorStop(.5, \"rgba(255,225,171,0)\");\n light.addColorStop(1, \"rgba(124,58,26,.14)\");\n ctx.fillStyle = light;\n ctx.fillRect(0, 0, 512, 512);\n\n const vignette = ctx.createRadialGradient(256, 240, 160, 256, 250, 390);\n vignette.addColorStop(.45, \"rgba(0,0,0,0)\");\n vignette.addColorStop(1, \"rgba(20,24,25,.42)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0, 0, 512, 512);\n\n // Fine grain\n ctx.save();\n ctx.globalAlpha = .035;\n for (let i = 0; i < 7500; i++) {\n const v = rnd() > .5 ? 255 : 0;\n ctx.fillStyle = `rgb(${v},${v},${v})`;\n ctx.fillRect(rnd() * 512, rnd() * 512, .5, .5);\n }\n ctx.restore();\n\n await new Promise(resolve => requestAnimationFrame(resolve));\n}"}], "metadata": {"id": "val-v1-broad-v2-imagination-validation-006", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 7383, "code_sha256": "117185ad1df4835b6d9c41291868615483dcc4cdf8b2eed5c576979a42e99ef5"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A slender sky island shaped like a mechanical seahorse drifts above the ocean, with a spiral village wrapped around its ticking central shaft."}, {"role": "assistant", "content": "async function render(stage) {\n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = 1024;\n canvas.style.cssText = \"width:100%;height:100%;display:block\";\n stage.replaceChildren(canvas);\n\n const c = canvas.getContext(\"2d\");\n const W = 1024, H = 1024;\n let seed = 24731;\n const rnd = () => ((seed = (seed * 1664525 + 1013904223) >>> 0) / 4294967296);\n const lerp = (a, b, t) => a + (b - a) * t;\n\n function ellipse(x, y, rx, ry, fill, stroke, lw = 1) {\n c.beginPath();\n c.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n if (fill) { c.fillStyle = fill; c.fill(); }\n if (stroke) { c.strokeStyle = stroke; c.lineWidth = lw; c.stroke(); }\n }\n function line(points, stroke, lw = 1, close = false, fill = null) {\n c.beginPath();\n c.moveTo(points[0][0], points[0][1]);\n for (let i = 1; i < points.length; i++) c.lineTo(points[i][0], points[i][1]);\n if (close) c.closePath();\n if (fill) { c.fillStyle = fill; c.fill(); }\n if (stroke) { c.strokeStyle = stroke; c.lineWidth = lw; c.stroke(); }\n }\n function cloud(x, y, s, alpha) {\n c.save();\n c.globalAlpha = alpha;\n const g = c.createRadialGradient(x, y, 8, x, y, 115 * s);\n g.addColorStop(0, \"rgba(255,255,255,.95)\");\n g.addColorStop(.55, \"rgba(248,247,229,.62)\");\n g.addColorStop(1, \"rgba(255,255,255,0)\");\n c.fillStyle = g;\n for (let i = 0; i < 13; i++) {\n const a = rnd() * Math.PI * 2;\n const d = rnd() * 65 * s;\n ellipse(x + Math.cos(a) * d, y + Math.sin(a) * d * .33,\n (38 + rnd() * 60) * s, (18 + rnd() * 26) * s, g);\n }\n c.restore();\n }\n\n // Sky\n let sky = c.createLinearGradient(0, 0, 0, 760);\n sky.addColorStop(0, \"#326a91\");\n sky.addColorStop(.28, \"#78adc5\");\n sky.addColorStop(.62, \"#d4d8c7\");\n sky.addColorStop(1, \"#f1d6a4\");\n c.fillStyle = sky;\n c.fillRect(0, 0, W, H);\n\n // Sun and atmospheric glow\n let sun = c.createRadialGradient(795, 190, 0, 795, 190, 280);\n sun.addColorStop(0, \"rgba(255,250,207,.96)\");\n sun.addColorStop(.13, \"rgba(255,226,147,.48)\");\n sun.addColorStop(1, \"rgba(255,225,164,0)\");\n c.fillStyle = sun;\n c.fillRect(500, 0, 524, 530);\n ellipse(794, 190, 43, 43, \"rgba(255,247,207,.84)\");\n\n c.save();\n c.globalCompositeOperation = \"screen\";\n c.globalAlpha = .12;\n for (let i = 0; i < 6; i++) {\n line([[790, 185], [450 - i * 50, 725], [540 - i * 35, 725]], null, 0, true, \"#fff8d1\");\n }\n c.restore();\n\n cloud(120, 240, 1.05, .26);\n cloud(878, 386, .85, .26);\n cloud(250, 535, .62, .20);\n cloud(675, 500, .65, .18);\n\n // Distant horizon and ocean\n c.fillStyle = \"rgba(154,179,174,.45)\";\n c.fillRect(0, 690, W, 18);\n let sea = c.createLinearGradient(0, 690, 0, H);\n sea.addColorStop(0, \"#7fa7a9\");\n sea.addColorStop(.25, \"#467e8d\");\n sea.addColorStop(1, \"#173f55\");\n c.fillStyle = sea;\n c.fillRect(0, 700, W, 324);\n\n for (let i = 0; i < 420; i++) {\n const y = 705 + rnd() * 319;\n const perspective = (y - 700) / 324;\n const x = rnd() * W;\n const len = 3 + rnd() * (8 + 38 * perspective);\n c.globalAlpha = .08 + rnd() * .2;\n c.strokeStyle = rnd() > .35 ? \"#d6e2d6\" : \"#173d52\";\n c.lineWidth = .6 + perspective * 2;\n c.beginPath();\n c.moveTo(x, y);\n c.lineTo(x + len, y + (rnd() - .5) * 2);\n c.stroke();\n }\n c.globalAlpha = 1;\n\n // Island's immense cast shadow on ocean\n c.save();\n c.filter = \"blur(18px)\";\n ellipse(525, 880, 205, 35, \"rgba(8,24,31,.35)\");\n c.restore();\n\n // Hanging mist below island\n c.save();\n c.filter = \"blur(11px)\";\n for (let i = 0; i < 23; i++) {\n const x = 390 + rnd() * 275, y = 664 + rnd() * 125;\n ellipse(x, y, 35 + rnd() * 70, 8 + rnd() * 18, \"rgba(238,242,226,.13)\");\n }\n c.restore();\n\n // Seahorse silhouette: tail, body, neck, head\n c.save();\n c.shadowColor = \"rgba(19,29,27,.45)\";\n c.shadowBlur = 30;\n c.shadowOffsetY = 22;\n\n const bodyGrad = c.createLinearGradient(350, 200, 690, 650);\n bodyGrad.addColorStop(0, \"#7b7156\");\n bodyGrad.addColorStop(.28, \"#4c5145\");\n bodyGrad.addColorStop(.65, \"#272f2c\");\n bodyGrad.addColorStop(1, \"#111d1f\");\n\n c.beginPath();\n c.moveTo(540, 214);\n c.bezierCurveTo(502, 254, 477, 312, 482, 380);\n c.bezierCurveTo(488, 453, 449, 519, 426, 579);\n c.bezierCurveTo(404, 636, 428, 693, 493, 718);\n c.bezierCurveTo(560, 744, 636, 708, 644, 647);\n c.bezierCurveTo(652, 589, 605, 558, 568, 579);\n c.bezierCurveTo(539, 596, 542, 632, 568, 641);\n c.bezierCurveTo(590, 649, 608, 627, 595, 609);\n c.bezierCurveTo(621, 625, 620, 665, 592, 685);\n c.bezierCurveTo(549, 715, 486, 689, 478, 644);\n c.bezierCurveTo(469, 593, 531, 542, 558, 487);\n c.bezierCurveTo(593, 417, 579, 340, 608, 283);\n c.bezierCurveTo(625, 249, 600, 218, 540, 214);\n c.closePath();\n c.fillStyle = bodyGrad;\n c.fill();\n c.restore();\n\n // Head, crown, snout\n let headGrad = c.createLinearGradient(505, 110, 810, 300);\n headGrad.addColorStop(0, \"#8d815e\");\n headGrad.addColorStop(.42, \"#4c5549\");\n headGrad.addColorStop(1, \"#202b2b\");\n c.beginPath();\n c.moveTo(514, 238);\n c.bezierCurveTo(486, 207, 500, 148, 548, 120);\n c.bezierCurveTo(590, 95, 647, 115, 673, 143);\n c.bezierCurveTo(703, 176, 733, 179, 806, 184);\n c.bezierCurveTo(845, 187, 867, 203, 848, 220);\n c.bezierCurveTo(813, 249, 742, 225, 691, 232);\n c.bezierCurveTo(654, 237, 644, 274, 605, 283);\n c.bezierCurveTo(565, 292, 534, 270, 514, 238);\n c.closePath();\n c.fillStyle = headGrad;\n c.fill();\n\n // Crown fins / spines\n const spines = [\n [[526,152],[486,103],[544,124]],\n [[556,125],[538,63],[581,117]],\n [[594,118],[606,54],[622,126]],\n [[631,128],[677,81],[656,148]]\n ];\n for (const p of spines) {\n line(p, \"#202c2c\", 3, true, \"#6e694f\");\n line([p[0], p[1]], \"rgba(221,190,116,.4)\", 2);\n }\n\n // Snout plates\n line([[665,175],[800,188],[845,205],[798,213],[682,209]], \"#171f20\", 5, true, \"#4b5449\");\n line([[703,183],[700,211]], \"#a58c5e\", 3);\n line([[749,187],[746,214]], \"#a58c5e\", 3);\n line([[801,192],[795,214]], \"#a58c5e\", 3);\n ellipse(834, 205, 8, 5, \"#101819\", \"#aa8d55\", 2);\n\n // Eye assembly\n ellipse(619, 174, 31, 31, \"#25302d\", \"#b69759\", 6);\n ellipse(619, 174, 18, 18, \"#d7a84d\", \"#121b1b\", 4);\n ellipse(622, 171, 7, 9, \"#071414\");\n ellipse(617, 166, 3, 3, \"#fff6c5\");\n for (let i = 0; i < 12; i++) {\n const a = i * Math.PI / 6;\n line([[619 + Math.cos(a)*33,174 + Math.sin(a)*33],\n [619 + Math.cos(a)*39,174 + Math.sin(a)*39]], \"#b39459\", 4);\n }\n\n // Body riveted ribs\n c.save();\n c.globalAlpha = .8;\n for (let i = 0; i < 11; i++) {\n const y = 282 + i * 31;\n const x = 531 + Math.sin(i * .72) * 16;\n c.strokeStyle = i % 2 ? \"#141e1f\" : \"#91815c\";\n c.lineWidth = 6;\n c.beginPath();\n c.arc(x, y, 66 - i * 1.8, -.25, Math.PI * .88);\n c.stroke();\n ellipse(x + 61, y + 18, 4, 4, \"#c3a66a\");\n }\n c.restore();\n\n // Central ticking shaft\n let shaft = c.createLinearGradient(480, 0, 590, 0);\n shaft.addColorStop(0, \"#1b2828\");\n shaft.addColorStop(.22, \"#8f794b\");\n shaft.addColorStop(.47, \"#d0b271\");\n shaft.addColorStop(.58, \"#594727\");\n shaft.addColorStop(1, \"#182222\");\n c.fillStyle = shaft;\n c.fillRect(514, 232, 54, 365);\n c.strokeStyle = \"#101819\";\n c.lineWidth = 7;\n c.strokeRect(514, 232, 54, 365);\n for (let y = 249; y < 590; y += 25) {\n c.fillStyle = y % 50 ? \"#9f7d3f\" : \"#d3b570\";\n c.fillRect(520, y, 42, 5);\n ellipse(524, y + 2, 3, 3, \"#241e16\");\n ellipse(558, y + 2, 3, 3, \"#241e16\");\n }\n\n // Gears\n function gear(x, y, r, teeth, color, angle = 0) {\n c.save();\n c.translate(x, y); c.rotate(angle);\n c.beginPath();\n for (let i = 0; i < teeth * 2; i++) {\n const a = i * Math.PI / teeth;\n const rr = i % 2 ? r * .79 : r;\n const px = Math.cos(a) * rr, py = Math.sin(a) * rr;\n i ? c.lineTo(px, py) : c.moveTo(px, py);\n }\n c.closePath();\n c.fillStyle = color; c.fill();\n c.strokeStyle = \"#151b1a\"; c.lineWidth = 5; c.stroke();\n ellipse(0, 0, r * .46, r * .46, \"#2c3430\", \"#bc9959\", 4);\n ellipse(0, 0, r * .14, r * .14, \"#c5a461\", \"#171d1c\", 3);\n c.restore();\n }\n gear(500, 328, 44, 13, \"#907543\", .1);\n gear(577, 374, 34, 11, \"#b28c48\", .3);\n gear(496, 434, 30, 10, \"#745e37\", .5);\n gear(582, 499, 46, 14, \"#9f8046\", .15);\n\n // Clock face\n ellipse(539, 278, 46, 46, \"#2a3430\", \"#d0ad67\", 7);\n ellipse(539, 278, 35, 35, \"#d5c79e\", \"#594a31\", 3);\n for (let i = 0; i < 12; i++) {\n const a = i * Math.PI / 6 - Math.PI / 2;\n line([[539 + Math.cos(a)*27,278 + Math.sin(a)*27],\n [539 + Math.cos(a)*32,278 + Math.sin(a)*32]], \"#463b2c\", 3);\n }\n line([[539,278],[539,253]], \"#2d2922\", 4);\n line([[539,278],[557,287]], \"#2d2922\", 4);\n ellipse(539,278,5,5,\"#a67d35\");\n\n // Spiral terraces\n const terraces = [\n {x:526,y:245,rx:122,ry:30,a:-.12},\n {x:525,y:324,rx:157,ry:39,a:.07},\n {x:520,y:411,rx:139,ry:35,a:-.1},\n {x:522,y:499,rx:119,ry:31,a:.08},\n {x:518,y:574,rx:93,ry:25,a:-.06}\n ];\n for (const t of terraces) {\n c.save(); c.translate(t.x,t.y); c.rotate(t.a);\n c.beginPath();\n c.ellipse(0, 10, t.rx, t.ry, 0, Math.PI, Math.PI*2);\n c.lineTo(t.rx-8, 25);\n c.ellipse(0, 20, t.rx-8, t.ry*.66, 0, 0, Math.PI);\n c.closePath();\n let tg = c.createLinearGradient(0,-25,0,35);\n tg.addColorStop(0,\"#98906b\");\n tg.addColorStop(.4,\"#59604e\");\n tg.addColorStop(1,\"#202c29\");\n c.fillStyle=tg;c.fill();\n c.strokeStyle=\"#18211f\";c.lineWidth=6;c.stroke();\n c.beginPath();c.ellipse(0,0,t.rx,t.ry,0,Math.PI,Math.PI*2);\n c.strokeStyle=\"#c0a66d\";c.lineWidth=5;c.stroke();\n c.restore();\n }\n\n // Spiral rail wrapping shaft\n c.save();\n c.strokeStyle=\"#d0ad68\"; c.lineWidth=6;\n c.shadowColor=\"#151a19\"; c.shadowBlur=3; c.shadowOffsetY=3;\n c.beginPath();\n for (let i=0;i<=130;i++) {\n const t=i/130, y=226+t*373, a=t*Math.PI*9.2;\n const x=540+Math.cos(a)*(75-20*t);\n const yy=y+Math.sin(a)*15;\n i?c.lineTo(x,yy):c.moveTo(x,yy);\n }\n c.stroke(); c.restore();\n\n // Tiny village houses\n function house(x,y,s,wall,roof,flip=0) {\n c.save(); c.translate(x,y); c.scale(s,s);\n c.fillStyle=\"rgba(11,17,16,.28)\";\n c.beginPath(); c.ellipse(4,11,18,5,0,0,Math.PI*2); c.fill();\n c.fillStyle=wall;\n c.fillRect(-12,-17,24,27);\n c.strokeStyle=\"#252b26\";c.lineWidth=2;c.strokeRect(-12,-17,24,27);\n c.beginPath();\n c.moveTo(-17,-16);c.lineTo(flip?3:-3,-33);c.lineTo(17,-16);c.closePath();\n c.fillStyle=roof;c.fill();c.stroke();\n c.fillStyle=\"#ffd879\";\n c.fillRect(-7,-10,6,7);c.fillRect(4,-10,6,7);\n c.fillStyle=\"#403224\";c.fillRect(-3,0,7,10);\n c.fillStyle=\"#604b34\";c.fillRect(7,-30,4,12);\n c.restore();\n }\n const homes = [\n [420,225,.72,\"#aa946b\",\"#4d493b\",0],[470,212,.82,\"#c0a36e\",\"#633e31\",1],\n [585,216,.8,\"#9a8560\",\"#384840\",0],[635,235,.62,\"#c0a66e\",\"#56402f\",1],\n [386,301,.92,\"#9e8057\",\"#4e4237\",0],[448,291,.72,\"#c5aa75\",\"#66503a\",1],\n [608,294,.9,\"#a98c62\",\"#3c4944\",0],[671,321,.7,\"#bca273\",\"#5c3f34\",1],\n [399,389,.74,\"#a88f67\",\"#4b4b3f\",1],[458,378,.86,\"#c2a46a\",\"#684536\",0],\n [608,392,.74,\"#af9569\",\"#394844\",1],[646,420,.64,\"#c4a96f\",\"#5d4634\",0],\n [425,481,.72,\"#ae9468\",\"#4a4c41\",0],[476,468,.78,\"#c6aa72\",\"#694b37\",1],\n [596,484,.76,\"#9e845d\",\"#384640\",0],[612,553,.62,\"#b49a6d\",\"#554336\",1],\n [451,551,.62,\"#bca16e\",\"#424b43\",0]\n ];\n homes.forEach(h=>house(...h));\n\n // Towers and windmill\n c.fillStyle=\"#746b50\"; c.fillRect(359,276,19,50);\n line([[353,277],[369,251],[384,277]],\"#2b302b\",3,true,\"#554638\");\n ellipse(369,250,4,4,\"#d8b66f\");\n c.strokeStyle=\"#d1bd85\";c.lineWidth=3;\n c.beginPath();c.moveTo(369,250);c.lineTo(369,219);c.stroke();\n for(let i=0;i<4;i++){\n c.save();c.translate(369,232);c.rotate(i*Math.PI/2+.25);\n line([[0,0],[8,-25],[13,-24],[5,0]],\"#443d30\",2,true,\"#c8b27b\");\n c.restore();\n }\n\n // Vegetation tufts\n for(let i=0;i<95;i++){\n const tier=terraces[Math.floor(rnd()*terraces.length)];\n const a=Math.PI+rnd()*Math.PI;\n const x=tier.x+Math.cos(a)*tier.rx*(.52+rnd()*.43);\n const y=tier.y+Math.sin(a)*tier.ry+rnd()*6;\n const s=.5+rnd()*1.2;\n c.strokeStyle=rnd()>.4?\"#526b4b\":\"#7c7b4a\";\n c.lineWidth=1.5*s;\n c.beginPath();c.moveTo(x,y);\n c.quadraticCurveTo(x+(rnd()-.5)*8,y-8*s,x+(rnd()-.5)*10,y-15*s);\n c.stroke();\n }\n\n // Hanging roots, cables, waterfalls\n for(let i=0;i<18;i++){\n const x=430+rnd()*190, y=584+rnd()*43, len=22+rnd()*110;\n c.strokeStyle=rnd()>.3?\"rgba(33,41,34,.8)\":\"rgba(153,133,79,.65)\";\n c.lineWidth=1+rnd()*3;\n c.beginPath();c.moveTo(x,y);\n c.bezierCurveTo(x-12+rnd()*24,y+len*.3,x+18-rnd()*36,y+len*.65,x+(rnd()-.5)*30,y+len);\n c.stroke();\n }\n const falls=[[405,317,2],[653,338,1.5],[424,510,1.3]];\n falls.forEach(([x,y,w])=>{\n let fg=c.createLinearGradient(x,y,x+15,y+180);\n fg.addColorStop(0,\"rgba(197,231,225,.75)\");\n fg.addColorStop(1,\"rgba(210,237,233,0)\");\n c.strokeStyle=fg;c.lineWidth=w*4;\n c.beginPath();c.moveTo(x,y);\n c.bezierCurveTo(x-7,y+55,x+10,y+110,x-2,y+185);c.stroke();\n });\n\n // Tail rings and highlights\n c.strokeStyle=\"#a88b54\";c.lineWidth=5;\n for(let i=0;i<7;i++){\n const a=-.2+i*.24;\n c.beginPath();c.arc(548,638,53+i*3,a,a+.12);c.stroke();\n }\n\n // Birds for scale\n c.strokeStyle=\"rgba(35,48,46,.7)\";c.lineWidth=2.5;\n [[180,395,1],[840,500,.7],[232,170,.55],[740,365,.45]].forEach(([x,y,s])=>{\n c.beginPath();c.moveTo(x-12*s,y);c.quadraticCurveTo(x-5*s,y-8*s,x,y);\n c.quadraticCurveTo(x+6*s,y-8*s,x+13*s,y);c.stroke();\n });\n\n // Fine metallic highlights and rivets\n for(let i=0;i<80;i++){\n const y=238+rnd()*375;\n const x=495+rnd()*100;\n if(rnd()>.55) ellipse(x,y,1.6,1.6,\"rgba(232,196,119,.65)\");\n }\n\n // Foreground atmospheric grading\n let vignette=c.createRadialGradient(520,430,280,520,430,720);\n vignette.addColorStop(0,\"rgba(0,0,0,0)\");\n vignette.addColorStop(.72,\"rgba(8,23,29,.05)\");\n vignette.addColorStop(1,\"rgba(5,17,24,.38)\");\n c.fillStyle=vignette;c.fillRect(0,0,W,H);\n\n // Warm edge light\n c.save();\n c.globalCompositeOperation=\"screen\";\n c.strokeStyle=\"rgba(255,220,139,.25)\";\n c.lineWidth=4;\n c.beginPath();\n c.moveTo(548,119);\n c.bezierCurveTo(630,91,666,153,702,177);\n c.bezierCurveTo(743,184,802,181,843,200);\n c.stroke();\n c.restore();\n}"}], "metadata": {"id": "val-v1-broad-v2-imagination-validation-007", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 7453, "code_sha256": "b2daca319bcda60192707786383c715a82c82366e71da88a950de222aede9182"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "Cyanotype botanical study presenting four seaweed specimens in parallel rows, each with distinct branching fronds and translucent pale margins."}, {"role": "assistant", "content": "async function render(stage) {\n const NS = \"http://www.w3.org/2000/svg\";\n stage.replaceChildren();\n Object.assign(stage.style, {\n width: \"512px\",\n height: \"512px\",\n overflow: \"hidden\",\n background: \"#073d73\"\n });\n\n let seed = 1947;\n const rnd = () => {\n seed = (seed * 1664525 + 1013904223) >>> 0;\n return seed / 4294967296;\n };\n const n = (a, b) => a + (b - a) * rnd();\n\n const svg = document.createElementNS(NS, \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 512 512\");\n svg.setAttribute(\"width\", \"512\");\n svg.setAttribute(\"height\", \"512\");\n svg.setAttribute(\"aria-label\", \"Cyanotype botanical study of four seaweed specimens\");\n stage.appendChild(svg);\n\n svg.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n `;\n\n const clouds = svg.querySelector(\"#clouds\");\n for (let i = 0; i < 20; i++) {\n const e = document.createElementNS(NS, \"ellipse\");\n e.setAttribute(\"cx\", n(-30, 542));\n e.setAttribute(\"cy\", n(-20, 532));\n e.setAttribute(\"rx\", n(25, 105));\n e.setAttribute(\"ry\", n(4, 18));\n e.setAttribute(\"fill\", rnd() > .5 ? \"#50a0bd\" : \"#001f50\");\n e.setAttribute(\"opacity\", n(.06, .19));\n e.setAttribute(\"filter\", \"url(#softEdge)\");\n clouds.appendChild(e);\n }\n\n const specimens = svg.querySelector(\"#specimens\");\n const surface = svg.querySelector(\"#surface\");\n\n function pathEl(d, attrs = {}, parent = specimens) {\n const p = document.createElementNS(NS, \"path\");\n p.setAttribute(\"d\", d);\n for (const [k, v] of Object.entries(attrs)) p.setAttribute(k, v);\n parent.appendChild(p);\n return p;\n }\n\n function layeredStroke(d, width, opacity = .72, parent = specimens) {\n pathEl(d, {\n fill: \"none\", stroke: \"#bce6df\", \"stroke-width\": width + 5,\n \"stroke-linecap\": \"round\", \"stroke-linejoin\": \"round\",\n opacity: opacity * .19, filter: \"url(#softEdge)\"\n }, parent);\n pathEl(d, {\n fill: \"none\", stroke: \"#dff3e5\", \"stroke-width\": width + 1.6,\n \"stroke-linecap\": \"round\", \"stroke-linejoin\": \"round\",\n opacity: opacity * .58\n }, parent);\n pathEl(d, {\n fill: \"none\", stroke: \"#8bc9d2\", \"stroke-width\": Math.max(.5, width - .5),\n \"stroke-linecap\": \"round\", \"stroke-linejoin\": \"round\",\n opacity\n }, parent);\n pathEl(d, {\n fill: \"none\", stroke: \"#eef7e9\", \"stroke-width\": Math.max(.35, width * .2),\n \"stroke-linecap\": \"round\", opacity: opacity * .72\n }, parent);\n }\n\n function curve(x1, y1, x2, y2, bend = 0) {\n const dx = x2 - x1, dy = y2 - y1;\n return `M${x1.toFixed(1)},${y1.toFixed(1)} C${(x1 + dx * .31).toFixed(1)},${(y1 + dy * .31 + bend).toFixed(1)} ${(x1 + dx * .69).toFixed(1)},${(y1 + dy * .69 - bend).toFixed(1)} ${x2.toFixed(1)},${y2.toFixed(1)}`;\n }\n\n // Row one: long, finely pinnate feather weed.\n {\n const y = 76;\n const main = `M28,83 C105,70 176,81 252,74 C331,66 400,73 484,58`;\n layeredStroke(main, 3.5, .82);\n\n for (let x = 48, i = 0; x < 472; x += n(12, 18), i++) {\n const baseY = y + Math.sin(x * .045) * 4 - (x - 250) * .035;\n const side = i % 2 ? 1 : -1;\n const len = n(20, 43) * (0.72 + Math.sin((x - 30) / 450 * Math.PI) * .35);\n const tx = x + n(8, 19);\n const ty = baseY + side * len;\n const d = curve(x, baseY, tx, ty, side * n(-4, 5));\n layeredStroke(d, n(1.05, 1.8), n(.58, .86));\n\n const count = Math.floor(n(3, 6));\n for (let j = 1; j <= count; j++) {\n const t = j / (count + 1);\n const bx = x + (tx - x) * t;\n const by = baseY + (ty - baseY) * t;\n const smallSide = j % 2 ? -side : side;\n const sl = n(5, 11);\n layeredStroke(\n curve(bx, by, bx + n(3, 8), by + smallSide * sl, smallSide * 1.5),\n .55, n(.4, .68)\n );\n }\n }\n pathEl(\"M27,83 C17,84 13,88 9,93\", {\n fill: \"none\", stroke: \"#d8eee2\", \"stroke-width\": \"4\",\n \"stroke-linecap\": \"round\", opacity: \".62\"\n });\n }\n\n // Row two: broad forked ribbons with translucent, curled margins.\n {\n const branches = [\n \"M31,199 C91,191 145,205 205,192 C269,179 334,194 390,178 C430,167 458,168 487,156\",\n \"M110,196 C127,178 139,157 148,135 C153,123 163,118 176,113\",\n \"M151,196 C171,211 186,224 207,230 C224,235 237,232 251,223\",\n \"M229,189 C243,166 255,148 277,134 C290,126 303,121 319,118\",\n \"M286,188 C307,207 330,219 355,223 C374,226 389,222 406,212\",\n \"M366,183 C383,158 398,141 421,132 C435,126 449,126 464,128\"\n ];\n for (const d of branches) layeredStroke(d, n(5.5, 8.2), .7);\n\n const blades = [\n \"M54,196 C78,185 98,181 119,187 C100,192 79,203 55,205 Z\",\n \"M132,183 C137,159 145,136 164,119 C161,143 154,168 143,190 Z\",\n \"M178,202 C198,211 222,220 244,221 C226,234 200,226 174,211 Z\",\n \"M247,185 C258,159 279,137 307,123 C293,147 275,173 257,190 Z\",\n \"M306,194 C330,204 356,214 391,213 C368,229 335,219 301,203 Z\",\n \"M380,176 C399,147 425,132 457,131 C430,143 410,161 393,183 Z\",\n \"M427,169 C447,157 466,153 487,156 C471,169 450,177 430,178 Z\"\n ];\n for (const d of blades) {\n pathEl(d, {\n fill: \"#b8e0dc\", opacity: n(.28, .46),\n stroke: \"#e8f5e8\", \"stroke-width\": n(1.5, 2.6),\n \"stroke-linejoin\": \"round\", filter: \"url(#mottle)\"\n });\n pathEl(d, {\n fill: \"none\", stroke: \"#eff7e8\", \"stroke-width\": \"5\",\n opacity: \".13\", filter: \"url(#softEdge)\"\n });\n }\n for (const [x, y, r] of [[104,190,5], [204,192,4], [331,188,5.5], [395,176,4.5]]) {\n const e = document.createElementNS(NS, \"ellipse\");\n e.setAttribute(\"cx\", x); e.setAttribute(\"cy\", y);\n e.setAttribute(\"rx\", r * 1.5); e.setAttribute(\"ry\", r);\n e.setAttribute(\"fill\", \"#cce9df\"); e.setAttribute(\"opacity\", \".5\");\n e.setAttribute(\"stroke\", \"#edf7e8\"); e.setAttribute(\"stroke-width\", \"1.4\");\n specimens.appendChild(e);\n }\n }\n\n // Row three: delicate repeatedly forked filamentous specimen.\n {\n layeredStroke(\"M25,321 C105,314 173,320 250,309 C325,299 402,306 486,292\", 2.7, .78);\n\n function twig(x, y, angle, len, depth, width) {\n if (depth < 0 || len < 3) return;\n const x2 = x + Math.cos(angle) * len;\n const y2 = y + Math.sin(angle) * len;\n layeredStroke(curve(x, y, x2, y2, n(-2.5, 2.5)), width, .48 + depth * .07);\n if (depth) {\n const split = n(.54, .74);\n const bx = x + (x2 - x) * split;\n const by = y + (y2 - y) * split;\n twig(bx, by, angle + n(.34, .68), len * n(.48, .68), depth - 1, width * .68);\n twig(x2, y2, angle - n(.25, .59), len * n(.45, .64), depth - 1, width * .64);\n if (rnd() > .48) twig(bx, by, angle - n(.38, .62), len * .45, depth - 1, width * .58);\n }\n }\n\n for (let x = 43, i = 0; x < 480; x += n(20, 30), i++) {\n const y = 318 - (x - 40) * .061 + Math.sin(x * .04) * 3;\n const ang = i % 2 ? n(.75, 1.16) : n(-1.15, -.72);\n twig(x, y, ang, n(18, 33), 3, n(.75, 1.2));\n }\n }\n\n // Row four: fern-like flattened specimen, dense tapering pinnae.\n {\n const y = 430;\n layeredStroke(\"M24,448 C101,440 176,433 251,427 C331,420 404,408 489,390\", 4.3, .84);\n\n for (let x = 44, i = 0; x < 480; x += n(10, 14), i++) {\n const baseY = 447 - (x - 24) * .126 + Math.sin(x * .025) * 2.2;\n const side = i % 2 ? -1 : 1;\n const envelope = Math.sin((x - 25) / 465 * Math.PI);\n const len = n(13, 27) + envelope * n(14, 27);\n const lean = n(8, 19);\n const tx = x + lean;\n const ty = baseY + side * len;\n layeredStroke(curve(x, baseY, tx, ty, side * n(-2, 4)), n(1.25, 2.1), .72);\n\n const leafCount = Math.floor(n(3, 6));\n for (let j = 1; j <= leafCount; j++) {\n const t = j / (leafCount + 1);\n const bx = x + (tx - x) * t;\n const by = baseY + (ty - baseY) * t;\n const l = n(4.5, 9) * (1 - t * .35);\n const flip = j % 2 ? 1 : -1;\n const ex = bx + l;\n const ey = by + flip * side * l * .48;\n const d = `M${bx},${by} Q${(bx + ex) / 2},${by + flip * side * l} ${ex},${ey}`;\n layeredStroke(d, .65, .58);\n }\n }\n\n // Holdfast and root-like attachment.\n layeredStroke(\"M25,448 C18,451 15,457 10,463 M25,448 C17,446 12,447 6,449 M25,448 C19,454 20,461 18,468\", 1.6, .67);\n }\n\n // Fine exposure specks and scratches in the blue paper.\n for (let i = 0; i < 170; i++) {\n const c = document.createElementNS(NS, \"circle\");\n c.setAttribute(\"cx\", n(4, 508));\n c.setAttribute(\"cy\", n(4, 508));\n c.setAttribute(\"r\", n(.15, .8));\n c.setAttribute(\"fill\", rnd() > .25 ? \"#9bcbd2\" : \"#001e4a\");\n c.setAttribute(\"opacity\", n(.035, .18));\n surface.appendChild(c);\n }\n for (let i = 0; i < 15; i++) {\n pathEl(\n `M${n(0, 512)},${n(0, 512)} l${n(-12, 15)},${n(-1, 1)}`,\n {\n fill: \"none\", stroke: \"#b9d9d7\", \"stroke-width\": n(.25, .65),\n opacity: n(.04, .12), \"stroke-linecap\": \"round\"\n },\n surface\n );\n }\n\n await new Promise(requestAnimationFrame);\n}"}], "metadata": {"id": "val-v1-broad-v2-style-validation-003", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 5274, "code_sha256": "e49e5de667f79b2771559a9079c533fb320f6a9019afd16f07b519725970f709"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "Cyanotype botanical study of three iris stems rising vertically, each with a ruffled flower, sword-shaped leaves, and sharply defined pale contours."}, {"role": "assistant", "content": "async function render(stage) {\n stage.replaceChildren();\n Object.assign(stage.style, {\n width: \"512px\",\n height: \"512px\",\n overflow: \"hidden\",\n background: \"#063f72\"\n });\n\n const ns = \"http://www.w3.org/2000/svg\";\n const svg = document.createElementNS(ns, \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 512 512\");\n svg.setAttribute(\"width\", \"512\");\n svg.setAttribute(\"height\", \"512\");\n svg.setAttribute(\"role\", \"img\");\n svg.setAttribute(\"aria-label\", \"Cyanotype botanical study of three flowering iris stems\");\n\n let grain = \"\";\n let seed = 38177;\n const rand = () => {\n seed = (seed * 16807) % 2147483647;\n return (seed - 1) / 2147483646;\n };\n for (let i = 0; i < 330; i++) {\n const x = (rand() * 512).toFixed(1);\n const y = (rand() * 512).toFixed(1);\n const r = (0.18 + rand() * 0.8).toFixed(2);\n const o = (0.025 + rand() * 0.09).toFixed(3);\n grain += ``;\n }\n\n svg.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n ${grain}\n\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n\n \n \n \n `;\n\n stage.appendChild(svg);\n}"}], "metadata": {"id": "val-v1-broad-v2-style-validation-007", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 7486, "code_sha256": "1e9943a4c80f0bb80e6d8abd6ded740944b77b1e5d7edfa23a2565d78856583e"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "Cyanotype botanical study featuring a dandelion rosette with jagged leaves, one round seed head, and several drifting parachute seeds."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n Object.assign(stage.style, {\n position: \"relative\",\n overflow: \"hidden\",\n width: \"512px\",\n height: \"512px\",\n background: \"#063c72\"\n });\n\n const dpr = 2;\n const canvas = document.createElement(\"canvas\");\n canvas.width = 512 * dpr;\n canvas.height = 512 * dpr;\n Object.assign(canvas.style, {\n width: \"512px\",\n height: \"512px\",\n display: \"block\"\n });\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\", { alpha: false });\n const W = canvas.width, H = canvas.height;\n\n let seed = 193741;\n const rnd = () => {\n seed = (seed * 1664525 + 1013904223) >>> 0;\n return seed / 4294967296;\n };\n\n // Granular, uneven Prussian-blue sensitized paper.\n const image = ctx.createImageData(W, H);\n const data = image.data;\n for (let y = 0; y < H; y++) {\n const ly = y / dpr;\n for (let x = 0; x < W; x++) {\n const lx = x / dpr;\n const dx = (lx - 256) / 360;\n const dy = (ly - 250) / 360;\n const vignette = Math.min(1, Math.sqrt(dx * dx + dy * dy));\n const cloud =\n 5 * Math.sin(lx * 0.018 + Math.sin(ly * 0.012)) +\n 3 * Math.sin(ly * 0.031 - lx * 0.007) +\n 2 * Math.sin((lx + ly) * 0.053);\n const grain = (rnd() + rnd() + rnd() - 1.5) * 7;\n const edge = 13 * Math.pow(vignette, 2.2);\n const i = (y * W + x) * 4;\n data[i] = Math.max(2, 7 + cloud * 0.12 + grain * 0.18 - edge * 0.28);\n data[i + 1] = Math.max(23, 61 + cloud * 0.58 + grain * 0.7 - edge);\n data[i + 2] = Math.max(48, 112 + cloud + grain - edge * 1.45);\n data[i + 3] = 255;\n }\n }\n ctx.putImageData(image, 0, 0);\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n\n // Broad paper mottling.\n ctx.save();\n ctx.globalCompositeOperation = \"screen\";\n for (let i = 0; i < 40; i++) {\n const x = rnd() * 512, y = rnd() * 512;\n const r = 25 + rnd() * 100;\n const g = ctx.createRadialGradient(x, y, 0, x, y, r);\n g.addColorStop(0, `rgba(25,130,168,${0.008 + rnd() * 0.018})`);\n g.addColorStop(1, \"rgba(10,90,140,0)\");\n ctx.fillStyle = g;\n ctx.beginPath();\n ctx.arc(x, y, r, 0, Math.PI * 2);\n ctx.fill();\n }\n ctx.restore();\n\n // Slightly imperfect coated-paper perimeter.\n ctx.save();\n const edgeGrad = ctx.createLinearGradient(0, 0, 18, 0);\n edgeGrad.addColorStop(0, \"rgba(1,24,58,.32)\");\n edgeGrad.addColorStop(1, \"rgba(1,24,58,0)\");\n ctx.fillStyle = edgeGrad;\n ctx.fillRect(0, 0, 22, 512);\n ctx.translate(512, 0);\n ctx.scale(-1, 1);\n ctx.fillRect(0, 0, 18, 512);\n ctx.restore();\n\n const exposed = \"#d8f3ec\";\n const pale = \"#bde9e5\";\n const blueShadow = \"#196c9d\";\n\n function bezier(p0, p1, p2, p3, t) {\n const u = 1 - t;\n return {\n x: u * u * u * p0.x + 3 * u * u * t * p1.x + 3 * u * t * t * p2.x + t * t * t * p3.x,\n y: u * u * u * p0.y + 3 * u * u * t * p1.y + 3 * u * t * t * p2.y + t * t * t * p3.y\n };\n }\n\n function leaf(base, tip, bend, maxWidth, opacity, phase) {\n const p0 = base;\n const p1 = {\n x: base.x + (tip.x - base.x) * 0.24 + bend.x,\n y: base.y + (tip.y - base.y) * 0.24 + bend.y\n };\n const p2 = {\n x: base.x + (tip.x - base.x) * 0.72 + bend.x * 0.62,\n y: base.y + (tip.y - base.y) * 0.72 + bend.y * 0.62\n };\n const p3 = tip;\n const n = 30;\n const centers = [];\n const left = [], right = [];\n\n for (let i = 0; i <= n; i++) {\n const t = i / n;\n const c = bezier(p0, p1, p2, p3, t);\n const t0 = Math.max(0, t - 0.005), t1 = Math.min(1, t + 0.005);\n const a = bezier(p0, p1, p2, p3, t0);\n const b = bezier(p0, p1, p2, p3, t1);\n const len = Math.hypot(b.x - a.x, b.y - a.y) || 1;\n const nx = -(b.y - a.y) / len, ny = (b.x - a.x) / len;\n\n const envelope = Math.pow(Math.sin(Math.PI * t), 0.7);\n const tooth = i === 0 || i === n\n ? 0\n : ((i + phase) % 4 === 0 ? 1.16 :\n (i + phase) % 4 === 2 ? 0.72 : 0.34);\n const basal = t < 0.14 ? t / 0.14 : 1;\n const width = maxWidth * envelope * tooth * basal *\n (0.95 + 0.08 * Math.sin(i * 2.31 + phase));\n centers.push(c);\n left.push({ x: c.x + nx * width, y: c.y + ny * width });\n right.push({ x: c.x - nx * width * 0.92, y: c.y - ny * width * 0.92 });\n }\n\n const path = new Path2D();\n path.moveTo(left[0].x, left[0].y);\n for (let i = 1; i <= n; i++) path.lineTo(left[i].x, left[i].y);\n for (let i = n; i >= 0; i--) path.lineTo(right[i].x, right[i].y);\n path.closePath();\n\n ctx.save();\n ctx.globalCompositeOperation = \"screen\";\n ctx.shadowColor = \"rgba(144,230,232,.28)\";\n ctx.shadowBlur = 7;\n ctx.fillStyle = `rgba(197,239,233,${opacity})`;\n ctx.fill(path);\n ctx.shadowBlur = 0;\n\n ctx.clip(path);\n const grad = ctx.createLinearGradient(base.x, base.y, tip.x, tip.y);\n grad.addColorStop(0, \"rgba(239,255,248,.28)\");\n grad.addColorStop(.48, \"rgba(186,230,227,.12)\");\n grad.addColorStop(1, \"rgba(244,255,249,.42)\");\n ctx.fillStyle = grad;\n ctx.fillRect(0, 250, 512, 230);\n\n // Cyanotype's incomplete contact patches.\n ctx.globalCompositeOperation = \"source-over\";\n for (let j = 0; j < 8; j++) {\n const t = 0.18 + rnd() * 0.7;\n const c = bezier(p0, p1, p2, p3, t);\n ctx.fillStyle = `rgba(13,83,129,${0.025 + rnd() * 0.045})`;\n ctx.beginPath();\n ctx.ellipse(c.x + (rnd() - .5) * maxWidth, c.y + (rnd() - .5) * maxWidth,\n 3 + rnd() * 9, 1.5 + rnd() * 4, rnd() * Math.PI, 0, Math.PI * 2);\n ctx.fill();\n }\n ctx.restore();\n\n // Midrib and branching veins.\n ctx.save();\n ctx.globalCompositeOperation = \"screen\";\n ctx.strokeStyle = \"rgba(234,255,248,.58)\";\n ctx.lineCap = \"round\";\n ctx.lineWidth = 1.15;\n ctx.beginPath();\n ctx.moveTo(centers[0].x, centers[0].y);\n for (let i = 1; i <= n; i++) ctx.lineTo(centers[i].x, centers[i].y);\n ctx.stroke();\n\n ctx.strokeStyle = \"rgba(229,252,246,.28)\";\n ctx.lineWidth = .65;\n for (let i = 5; i < n - 3; i += 3) {\n const c = centers[i];\n ctx.beginPath();\n ctx.moveTo(c.x, c.y);\n ctx.lineTo(left[i].x, left[i].y);\n ctx.moveTo(c.x, c.y);\n ctx.lineTo(right[i].x, right[i].y);\n ctx.stroke();\n }\n ctx.restore();\n }\n\n // Leaves at the back of the rosette.\n leaf({x:253,y:444}, {x:73,y:454}, {x:-15,y:-28}, 18, .78, 0);\n leaf({x:257,y:441}, {x:89,y:403}, {x:-10,y:-45}, 22, .84, 1);\n leaf({x:258,y:440}, {x:117,y:347}, {x:-10,y:-38}, 21, .82, 2);\n leaf({x:259,y:441}, {x:190,y:303}, {x:-17,y:-27}, 20, .87, 0);\n leaf({x:259,y:441}, {x:238,y:321}, {x:-15,y:-14}, 17, .72, 3);\n leaf({x:260,y:442}, {x:295,y:326}, {x:11,y:-20}, 18, .77, 1);\n leaf({x:260,y:443}, {x:373,y:349}, {x:17,y:-27}, 23, .86, 2);\n leaf({x:260,y:445}, {x:440,y:390}, {x:18,y:-35}, 22, .82, 0);\n leaf({x:259,y:447}, {x:459,y:451}, {x:15,y:-15}, 18, .75, 3);\n leaf({x:256,y:445}, {x:185,y:478}, {x:-7,y:5}, 16, .67, 2);\n leaf({x:260,y:445}, {x:343,y:481}, {x:10,y:4}, 17, .66, 1);\n\n // Crown at the center of the rosette.\n ctx.save();\n ctx.globalCompositeOperation = \"screen\";\n ctx.fillStyle = \"rgba(224,249,241,.82)\";\n ctx.shadowColor = \"rgba(185,244,241,.3)\";\n ctx.shadowBlur = 5;\n ctx.beginPath();\n ctx.ellipse(259, 442, 15, 9, -.1, 0, Math.PI * 2);\n ctx.fill();\n ctx.restore();\n\n // Hollow, slightly curved dandelion stalk.\n const stem = new Path2D();\n stem.moveTo(261, 440);\n stem.bezierCurveTo(268, 347, 297, 245, 331, 158);\n\n ctx.save();\n ctx.lineCap = \"round\";\n ctx.strokeStyle = \"rgba(70,174,190,.2)\";\n ctx.lineWidth = 9;\n ctx.stroke(stem);\n ctx.globalCompositeOperation = \"screen\";\n ctx.shadowColor = \"rgba(195,247,241,.35)\";\n ctx.shadowBlur = 5;\n ctx.strokeStyle = \"rgba(211,244,237,.88)\";\n ctx.lineWidth = 4.2;\n ctx.stroke(stem);\n ctx.shadowBlur = 0;\n ctx.strokeStyle = \"rgba(247,255,248,.42)\";\n ctx.lineWidth = 1;\n ctx.stroke(stem);\n ctx.restore();\n\n // Seed head: a dense radial structure with fine pappus filaments.\n const hx = 333, hy = 150;\n ctx.save();\n ctx.globalCompositeOperation = \"screen\";\n ctx.shadowColor = \"rgba(191,247,245,.42)\";\n ctx.shadowBlur = 4;\n ctx.lineCap = \"round\";\n\n for (let i = 0; i < 132; i++) {\n const a = i * Math.PI * 2 / 132 + (rnd() - .5) * .035;\n const inner = 4 + rnd() * 8;\n const radius = 43 + rnd() * 13;\n const curve = (rnd() - .5) * 5;\n const x0 = hx + Math.cos(a) * inner;\n const y0 = hy + Math.sin(a) * inner;\n const x1 = hx + Math.cos(a) * radius;\n const y1 = hy + Math.sin(a) * radius;\n const mx = (x0 + x1) / 2 - Math.sin(a) * curve;\n const my = (y0 + y1) / 2 + Math.cos(a) * curve;\n\n ctx.strokeStyle = `rgba(221,250,245,${0.20 + rnd() * .35})`;\n ctx.lineWidth = .45 + rnd() * .5;\n ctx.beginPath();\n ctx.moveTo(x0, y0);\n ctx.quadraticCurveTo(mx, my, x1, y1);\n ctx.stroke();\n\n if (i % 2 === 0) {\n ctx.fillStyle = `rgba(237,255,249,${.25 + rnd() * .38})`;\n ctx.beginPath();\n ctx.arc(x1, y1, .45 + rnd() * .7, 0, Math.PI * 2);\n ctx.fill();\n }\n }\n\n // Tangled outer pappus hairs.\n ctx.shadowBlur = 0;\n for (let i = 0; i < 90; i++) {\n const a = rnd() * Math.PI * 2;\n const r = 40 + rnd() * 13;\n const x = hx + Math.cos(a) * r;\n const y = hy + Math.sin(a) * r;\n const spread = .09 + rnd() * .08;\n ctx.strokeStyle = `rgba(229,253,248,${.13 + rnd() * .2})`;\n ctx.lineWidth = .5;\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.lineTo(x + Math.cos(a + spread) * (5 + rnd() * 5),\n y + Math.sin(a + spread) * (5 + rnd() * 5));\n ctx.moveTo(x, y);\n ctx.lineTo(x + Math.cos(a - spread) * (5 + rnd() * 5),\n y + Math.sin(a - spread) * (5 + rnd() * 5));\n ctx.stroke();\n }\n\n const core = ctx.createRadialGradient(hx, hy, 0, hx, hy, 14);\n core.addColorStop(0, \"rgba(238,255,247,.84)\");\n core.addColorStop(.45, \"rgba(189,232,226,.54)\");\n core.addColorStop(1, \"rgba(172,225,224,0)\");\n ctx.fillStyle = core;\n ctx.beginPath();\n ctx.arc(hx, hy, 15, 0, Math.PI * 2);\n ctx.fill();\n ctx.restore();\n\n function floatingSeed(x, y, scale, angle, opacity = 1) {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(angle);\n ctx.scale(scale, scale);\n ctx.globalCompositeOperation = \"screen\";\n ctx.lineCap = \"round\";\n ctx.strokeStyle = `rgba(224,252,247,${.58 * opacity})`;\n ctx.fillStyle = `rgba(222,248,241,${.74 * opacity})`;\n\n // Achene.\n ctx.beginPath();\n ctx.moveTo(-1.5, 18);\n ctx.quadraticCurveTo(0, 25, 1.5, 18);\n ctx.lineTo(.65, 14);\n ctx.quadraticCurveTo(0, 12.5, -.65, 14);\n ctx.closePath();\n ctx.fill();\n\n // Beak.\n ctx.lineWidth = .7;\n ctx.beginPath();\n ctx.moveTo(0, 14);\n ctx.quadraticCurveTo(1, 4, 0, -4);\n ctx.stroke();\n\n // Parachute spokes.\n const count = 18;\n for (let i = 0; i < count; i++) {\n const a = Math.PI + (i / (count - 1) - .5) * 2.35;\n const len = 9 + rnd() * 4;\n ctx.strokeStyle = `rgba(230,255,249,${(.26 + rnd() * .4) * opacity})`;\n ctx.lineWidth = .42;\n ctx.beginPath();\n ctx.moveTo(0, -4);\n ctx.quadraticCurveTo(Math.cos(a) * len * .48, -5 + Math.sin(a) * len * .45,\n Math.cos(a) * len, -4 + Math.sin(a) * len);\n ctx.stroke();\n }\n ctx.fillStyle = `rgba(243,255,251,${.6 * opacity})`;\n ctx.beginPath();\n ctx.arc(0, -4, 1, 0, Math.PI * 2);\n ctx.fill();\n ctx.restore();\n }\n\n floatingSeed(186, 87, 1.08, -.38, .9);\n floatingSeed(242, 46, .78, .18, .72);\n floatingSeed(116, 159, .92, -.8, .84);\n floatingSeed(421, 77, .83, .6, .78);\n floatingSeed(438, 208, 1.03, .44, .91);\n floatingSeed(389, 261, .72, -.28, .65);\n floatingSeed(151, 242, .67, -.98, .62);\n floatingSeed(283, 96, .58, .15, .53);\n\n // A few detached, nearly invisible filaments around the head.\n ctx.save();\n ctx.globalCompositeOperation = \"screen\";\n ctx.strokeStyle = \"rgba(225,252,247,.25)\";\n ctx.lineWidth = .55;\n for (let i = 0; i < 14; i++) {\n const x = 270 + rnd() * 145, y = 88 + rnd() * 130;\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.quadraticCurveTo(x + (rnd() - .5) * 12, y + 5,\n x + (rnd() - .5) * 16, y + 12 + rnd() * 10);\n ctx.stroke();\n }\n ctx.restore();\n\n // Dust, pinholes, and processing marks.\n ctx.save();\n ctx.globalCompositeOperation = \"screen\";\n for (let i = 0; i < 170; i++) {\n const x = rnd() * 512, y = rnd() * 512;\n const r = rnd() < .94 ? .15 + rnd() * .55 : 1 + rnd() * 2;\n ctx.fillStyle = `rgba(176,228,230,${.025 + rnd() * .08})`;\n ctx.beginPath();\n ctx.arc(x, y, r, 0, Math.PI * 2);\n ctx.fill();\n }\n ctx.restore();\n\n ctx.save();\n ctx.strokeStyle = \"rgba(1,31,68,.28)\";\n ctx.lineWidth = 1;\n ctx.strokeRect(.5, .5, 511, 511);\n ctx.restore();\n}"}], "metadata": {"id": "val-v1-broad-v2-style-validation-008", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 5716, "code_sha256": "09e74ce306529424c67526ac443ffa9aff8eb483c5a1c63e5785cdbba9498689"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A compact teal book-drop cabinet stands beneath a round wall clock, its front label clearly printed with \"Drop Books Here\"."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n Object.assign(stage.style, {\n width: \"512px\",\n height: \"512px\",\n overflow: \"hidden\",\n position: \"relative\",\n background: \"#d8d5cc\"\n });\n\n stage.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 12\n 3\n 6\n 9\n \n \n \n \n \n \n \n \n \n\n \n \n\n \n \n \n \n \n\n \n \n \n \n\n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n Drop Books\n Here\n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n `;\n}"}], "metadata": {"id": "val-v1-broad-v2-text_rendering-validation-000", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 4485, "code_sha256": "e8c4d3f3a4bd1ae6a182a045ba5f68530cb619868a3c8024d19faf7612fa7c3d"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A white laminate return counter near a library entrance features a red-edged label beside the opening that reads \"Return Items Here\"."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n Object.assign(stage.style, {\n position: \"relative\",\n overflow: \"hidden\",\n width: \"512px\",\n height: \"512px\",\n background: \"#d8d6d0\"\n });\n\n const svgNS = \"http://www.w3.org/2000/svg\";\n const svg = document.createElementNS(svgNS, \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 512 512\");\n svg.setAttribute(\"width\", \"512\");\n svg.setAttribute(\"height\", \"512\");\n svg.setAttribute(\"aria-label\", \"A white library return counter with a Return Items Here label\");\n svg.style.display = \"block\";\n\n svg.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n\n \n \n\n \n \n \n \n \n \n \n Return\n Items\n Here\n \n\n \n \n \n \n\n \n \n \n \n `;\n\n stage.appendChild(svg);\n}"}], "metadata": {"id": "val-v1-broad-v2-text_rendering-validation-001", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 4692, "code_sha256": "0a0a406983b7508ce7cd028caed83e3ed70278591eebac1505d4fb6d5c2dae54"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A black metal return slot embedded in a pale wood circulation desk has a small brass plate engraved \"Book Return\"."}, {"role": "assistant", "content": "async function render(stage) {\n stage.replaceChildren();\n Object.assign(stage.style, {\n width: \"512px\",\n height: \"512px\",\n position: \"relative\",\n overflow: \"hidden\",\n background: \"#d8c7a8\"\n });\n\n const canvas = document.createElement(\"canvas\");\n const scale = 2;\n canvas.width = 512 * scale;\n canvas.height = 512 * scale;\n Object.assign(canvas.style, {\n width: \"512px\",\n height: \"512px\",\n display: \"block\"\n });\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(scale, scale);\n\n function roundedRect(x, y, w, h, r) {\n const rr = Math.min(r, w / 2, h / 2);\n ctx.beginPath();\n ctx.moveTo(x + rr, y);\n ctx.lineTo(x + w - rr, y);\n ctx.quadraticCurveTo(x + w, y, x + w, y + rr);\n ctx.lineTo(x + w, y + h - rr);\n ctx.quadraticCurveTo(x + w, y + h, x + w - rr, y + h);\n ctx.lineTo(x + rr, y + h);\n ctx.quadraticCurveTo(x, y + h, x, y + h - rr);\n ctx.lineTo(x, y + rr);\n ctx.quadraticCurveTo(x, y, x + rr, y);\n ctx.closePath();\n }\n\n function mulberry32(seed) {\n return function () {\n let t = seed += 0x6D2B79F5;\n t = Math.imul(t ^ t >>> 15, t | 1);\n t ^= t + Math.imul(t ^ t >>> 7, t | 61);\n return ((t ^ t >>> 14) >>> 0) / 4294967296;\n };\n }\n\n const random = mulberry32(934712);\n\n // Pale oak desk face.\n let wood = ctx.createLinearGradient(0, 0, 512, 512);\n wood.addColorStop(0, \"#e5d7bb\");\n wood.addColorStop(0.38, \"#dcccac\");\n wood.addColorStop(0.7, \"#e1d1b2\");\n wood.addColorStop(1, \"#cdbb99\");\n ctx.fillStyle = wood;\n ctx.fillRect(0, 0, 512, 512);\n\n // Countertop and its front edge.\n let top = ctx.createLinearGradient(0, 0, 0, 76);\n top.addColorStop(0, \"#eee4d0\");\n top.addColorStop(0.78, \"#dac8a8\");\n top.addColorStop(1, \"#bba787\");\n ctx.fillStyle = top;\n ctx.fillRect(0, 0, 512, 76);\n\n ctx.fillStyle = \"rgba(75,55,34,.20)\";\n ctx.fillRect(0, 75, 512, 3);\n ctx.fillStyle = \"rgba(255,255,255,.35)\";\n ctx.fillRect(0, 78, 512, 1);\n\n // Fine oak fibers.\n ctx.lineCap = \"round\";\n for (let i = 0; i < 180; i++) {\n const y = random() * 512;\n const x = random() * 500 - 20;\n const len = 25 + random() * 150;\n const amp = 0.4 + random() * 2.6;\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.bezierCurveTo(\n x + len * .27, y + (random() - .5) * amp,\n x + len * .66, y + (random() - .5) * amp,\n x + len, y + (random() - .5) * amp\n );\n ctx.strokeStyle = random() > .45\n ? `rgba(112,82,46,${.018 + random() * .038})`\n : `rgba(255,250,229,${.025 + random() * .05})`;\n ctx.lineWidth = .3 + random() * .8;\n ctx.stroke();\n }\n\n // Broader irregular grain.\n for (let i = 0; i < 26; i++) {\n let y = 85 + random() * 410;\n let x = -40 + random() * 100;\n ctx.beginPath();\n ctx.moveTo(x, y);\n for (let j = 1; j <= 6; j++) {\n const nx = x + j * 100;\n const ny = y + Math.sin(j * 1.4 + i) * (1 + random() * 3);\n ctx.quadraticCurveTo(nx - 45, ny + (random() - .5) * 4, nx, ny);\n }\n ctx.strokeStyle = `rgba(112,79,40,${.018 + random() * .028})`;\n ctx.lineWidth = 1 + random() * 2.2;\n ctx.stroke();\n }\n\n // A few subtle wood pores.\n for (let i = 0; i < 70; i++) {\n const x = random() * 512;\n const y = 82 + random() * 425;\n ctx.beginPath();\n ctx.ellipse(x, y, 1 + random() * 4, .18 + random() * .35, 0, 0, Math.PI * 2);\n ctx.fillStyle = `rgba(73,50,25,${.025 + random() * .045})`;\n ctx.fill();\n }\n\n // Shadow around the return-slot assembly.\n ctx.save();\n ctx.shadowColor = \"rgba(43,29,15,.48)\";\n ctx.shadowBlur = 17;\n ctx.shadowOffsetY = 8;\n roundedRect(101, 135, 310, 156, 7);\n ctx.fillStyle = \"rgba(24,20,16,.55)\";\n ctx.fill();\n ctx.restore();\n\n // Outer black metal bezel.\n let bezel = ctx.createLinearGradient(100, 135, 411, 291);\n bezel.addColorStop(0, \"#3c3d3b\");\n bezel.addColorStop(.16, \"#171918\");\n bezel.addColorStop(.55, \"#252624\");\n bezel.addColorStop(.86, \"#101211\");\n bezel.addColorStop(1, \"#363735\");\n roundedRect(102, 135, 308, 151, 7);\n ctx.fillStyle = bezel;\n ctx.fill();\n\n // Thin highlighted outer edge.\n roundedRect(102.5, 135.5, 307, 150, 6.5);\n ctx.strokeStyle = \"rgba(255,255,245,.18)\";\n ctx.lineWidth = 1;\n ctx.stroke();\n\n roundedRect(106, 139, 300, 143, 4);\n ctx.strokeStyle = \"rgba(0,0,0,.75)\";\n ctx.lineWidth = 2;\n ctx.stroke();\n\n // Subtle brushed texture on bezel.\n ctx.save();\n roundedRect(103, 136, 306, 149, 6);\n ctx.clip();\n for (let i = 0; i < 160; i++) {\n const y = 136 + random() * 149;\n const x = 104 + random() * 304;\n ctx.fillStyle = random() > .5\n ? `rgba(255,255,255,${random() * .025})`\n : `rgba(0,0,0,${random() * .055})`;\n ctx.fillRect(x, y, 10 + random() * 75, .25 + random() * .45);\n }\n ctx.restore();\n\n // Recess around the opening.\n ctx.save();\n ctx.shadowColor = \"rgba(0,0,0,.9)\";\n ctx.shadowBlur = 9;\n ctx.shadowOffsetY = 3;\n roundedRect(124, 162, 264, 92, 4);\n ctx.fillStyle = \"#080909\";\n ctx.fill();\n ctx.restore();\n\n let innerLip = ctx.createLinearGradient(0, 159, 0, 258);\n innerLip.addColorStop(0, \"#3d3f3c\");\n innerLip.addColorStop(.09, \"#111312\");\n innerLip.addColorStop(.86, \"#090a09\");\n innerLip.addColorStop(1, \"#454541\");\n roundedRect(121, 159, 270, 99, 4);\n ctx.fillStyle = innerLip;\n ctx.fill();\n\n roundedRect(127, 166, 258, 83, 2);\n let depth = ctx.createLinearGradient(0, 166, 0, 249);\n depth.addColorStop(0, \"#020303\");\n depth.addColorStop(.38, \"#090a09\");\n depth.addColorStop(.78, \"#10100f\");\n depth.addColorStop(1, \"#020202\");\n ctx.fillStyle = depth;\n ctx.fill();\n\n // Interior planes and nearly invisible depth.\n ctx.beginPath();\n ctx.moveTo(127, 166);\n ctx.lineTo(385, 166);\n ctx.lineTo(375, 181);\n ctx.lineTo(137, 181);\n ctx.closePath();\n ctx.fillStyle = \"rgba(53,55,52,.28)\";\n ctx.fill();\n\n ctx.beginPath();\n ctx.moveTo(127, 249);\n ctx.lineTo(385, 249);\n ctx.lineTo(375, 237);\n ctx.lineTo(137, 237);\n ctx.closePath();\n let lowerLip = ctx.createLinearGradient(0, 237, 0, 249);\n lowerLip.addColorStop(0, \"#080908\");\n lowerLip.addColorStop(1, \"#353633\");\n ctx.fillStyle = lowerLip;\n ctx.fill();\n\n ctx.fillStyle = \"rgba(255,255,255,.16)\";\n ctx.fillRect(132, 247, 248, 1);\n ctx.fillStyle = \"rgba(0,0,0,.8)\";\n ctx.fillRect(132, 249, 248, 2);\n\n // Bezel mounting screws.\n function screw(x, y) {\n const g = ctx.createRadialGradient(x - 1, y - 1, .3, x, y, 5);\n g.addColorStop(0, \"#777872\");\n g.addColorStop(.4, \"#323431\");\n g.addColorStop(1, \"#090a09\");\n ctx.beginPath();\n ctx.arc(x, y, 4.4, 0, Math.PI * 2);\n ctx.fillStyle = g;\n ctx.fill();\n ctx.beginPath();\n ctx.moveTo(x - 2.3, y + .7);\n ctx.lineTo(x + 2.3, y - .7);\n ctx.strokeStyle = \"rgba(0,0,0,.9)\";\n ctx.lineWidth = 1;\n ctx.stroke();\n ctx.beginPath();\n ctx.moveTo(x - 2.1, y - .2);\n ctx.lineTo(x + 1.9, y - 1.3);\n ctx.strokeStyle = \"rgba(255,255,255,.2)\";\n ctx.lineWidth = .5;\n ctx.stroke();\n }\n screw(113, 147);\n screw(399, 147);\n screw(113, 274);\n screw(399, 274);\n\n // Brass label plate shadow.\n ctx.save();\n ctx.shadowColor = \"rgba(55,35,13,.45)\";\n ctx.shadowBlur = 8;\n ctx.shadowOffsetY = 4;\n roundedRect(177, 322, 158, 45, 2.5);\n ctx.fillStyle = \"#8d682a\";\n ctx.fill();\n ctx.restore();\n\n // Brass plate.\n let brass = ctx.createLinearGradient(177, 322, 335, 367);\n brass.addColorStop(0, \"#896222\");\n brass.addColorStop(.12, \"#d8b866\");\n brass.addColorStop(.35, \"#ae8537\");\n brass.addColorStop(.58, \"#e2c775\");\n brass.addColorStop(.82, \"#9a7028\");\n brass.addColorStop(1, \"#d1a94f\");\n roundedRect(177, 320, 158, 45, 2.5);\n ctx.fillStyle = brass;\n ctx.fill();\n\n roundedRect(178, 321, 156, 43, 2);\n ctx.strokeStyle = \"rgba(255,244,177,.7)\";\n ctx.lineWidth = .8;\n ctx.stroke();\n\n roundedRect(180, 323, 152, 39, 1);\n ctx.strokeStyle = \"rgba(75,45,10,.45)\";\n ctx.lineWidth = .7;\n ctx.stroke();\n\n // Fine horizontal scratches in brass.\n ctx.save();\n roundedRect(178, 321, 156, 43, 2);\n ctx.clip();\n for (let i = 0; i < 45; i++) {\n const y = 322 + random() * 41;\n const x = 181 + random() * 145;\n ctx.fillStyle = random() > .45\n ? `rgba(255,247,180,${.04 + random() * .1})`\n : `rgba(78,48,9,${.03 + random() * .08})`;\n ctx.fillRect(x, y, 6 + random() * 65, .25);\n }\n ctx.restore();\n\n // Brass screw heads.\n function brassScrew(x, y) {\n const g = ctx.createRadialGradient(x - 1, y - 1, 0, x, y, 3.4);\n g.addColorStop(0, \"#f6db82\");\n g.addColorStop(.5, \"#aa7c29\");\n g.addColorStop(1, \"#5c3b10\");\n ctx.beginPath();\n ctx.arc(x, y, 3.1, 0, Math.PI * 2);\n ctx.fillStyle = g;\n ctx.fill();\n ctx.beginPath();\n ctx.moveTo(x - 1.8, y);\n ctx.lineTo(x + 1.8, y);\n ctx.strokeStyle = \"rgba(65,38,8,.8)\";\n ctx.lineWidth = .65;\n ctx.stroke();\n }\n brassScrew(187, 342.5);\n brassScrew(325, 342.5);\n\n // Engraved text: dark cut with a faint lower highlight.\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.font = '600 18px Georgia, \"Times New Roman\", serif';\n ctx.fillStyle = \"rgba(255,236,154,.42)\";\n ctx.fillText(\"Book Return\", 256, 344.2);\n ctx.fillStyle = \"#3d2810\";\n ctx.fillText(\"Book Return\", 256, 342.9);\n\n // Mild photographic noise.\n const noiseCanvas = document.createElement(\"canvas\");\n noiseCanvas.width = 512;\n noiseCanvas.height = 512;\n const nctx = noiseCanvas.getContext(\"2d\");\n const image = nctx.createImageData(512, 512);\n for (let i = 0; i < image.data.length; i += 4) {\n const v = random() * 255;\n image.data[i] = v;\n image.data[i + 1] = v;\n image.data[i + 2] = v;\n image.data[i + 3] = 7;\n }\n nctx.putImageData(image, 0, 0);\n ctx.save();\n ctx.globalCompositeOperation = \"soft-light\";\n ctx.globalAlpha = .45;\n ctx.drawImage(noiseCanvas, 0, 0);\n ctx.restore();\n\n // Gentle edge falloff.\n const vignette = ctx.createRadialGradient(256, 246, 120, 256, 256, 370);\n vignette.addColorStop(0, \"rgba(0,0,0,0)\");\n vignette.addColorStop(.72, \"rgba(40,25,10,.025)\");\n vignette.addColorStop(1, \"rgba(26,17,8,.18)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0, 0, 512, 512);\n}"}], "metadata": {"id": "val-v1-broad-v2-text_rendering-validation-003", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 4585, "code_sha256": "39445609efd41485e4ce2c681c317d788896e6f26beb9f565126e91c1eaf4c27"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A cream-colored library return box beside a staircase carries a simple black vinyl label reading \"Deposit Books Here\"."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n\n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n Deposit Books\n Here\n \n\n \n \n \n \n \n \n\n \n \n \n\n \n \n \n `;\n\n Object.assign(stage.style, {\n width: \"512px\",\n height: \"512px\",\n overflow: \"hidden\",\n background: \"#ddd6c6\"\n });\n}"}], "metadata": {"id": "val-v1-broad-v2-text_rendering-validation-007", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 4352, "code_sha256": "2a91cecae7588c3c955ddd256bbb222c67b32b3adc4d7c2703bf9be53d7e6317"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A blue rolling return bin parked near an information desk has a laminated silver card marked \"Returned Books\"."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n Object.assign(stage.style, {\n position: \"relative\",\n overflow: \"hidden\",\n width: \"512px\",\n height: \"512px\",\n background: \"#d5d7d5\"\n });\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = 1024;\n canvas.height = 1024;\n Object.assign(canvas.style, {\n width: \"512px\",\n height: \"512px\",\n display: \"block\"\n });\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(2, 2);\n\n const W = 512, H = 512;\n\n function rr(x, y, w, h, r) {\n r = Math.min(r, w / 2, h / 2);\n ctx.beginPath();\n ctx.moveTo(x + r, y);\n ctx.lineTo(x + w - r, y);\n ctx.quadraticCurveTo(x + w, y, x + w, y + r);\n ctx.lineTo(x + w, y + h - r);\n ctx.quadraticCurveTo(x + w, y + h, x + w - r, y + h);\n ctx.lineTo(x + r, y + h);\n ctx.quadraticCurveTo(x, y + h, x, y + h - r);\n ctx.lineTo(x, y + r);\n ctx.quadraticCurveTo(x, y, x + r, y);\n ctx.closePath();\n }\n\n function poly(points) {\n ctx.beginPath();\n ctx.moveTo(points[0][0], points[0][1]);\n for (let i = 1; i < points.length; i++) ctx.lineTo(points[i][0], points[i][1]);\n ctx.closePath();\n }\n\n function line(x1, y1, x2, y2, color, width = 1) {\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.strokeStyle = color;\n ctx.lineWidth = width;\n ctx.stroke();\n }\n\n // Back wall\n let g = ctx.createLinearGradient(0, 0, 0, 330);\n g.addColorStop(0, \"#eef0ed\");\n g.addColorStop(0.58, \"#dfe3e0\");\n g.addColorStop(1, \"#c8cecb\");\n ctx.fillStyle = g;\n ctx.fillRect(0, 0, W, 340);\n\n // Ceiling strip and fluorescent lights\n ctx.fillStyle = \"#f8f8f4\";\n ctx.fillRect(0, 0, W, 25);\n ctx.fillStyle = \"rgba(255,255,246,.95)\";\n ctx.shadowColor = \"rgba(255,255,255,.8)\";\n ctx.shadowBlur = 12;\n ctx.fillRect(49, 6, 151, 7);\n ctx.fillRect(323, 6, 118, 7);\n ctx.shadowBlur = 0;\n\n // Distant glass doorway / windows\n g = ctx.createLinearGradient(0, 48, 0, 260);\n g.addColorStop(0, \"#c9d8dd\");\n g.addColorStop(1, \"#9facad\");\n ctx.fillStyle = g;\n ctx.fillRect(21, 52, 185, 210);\n ctx.fillStyle = \"#edf1ef\";\n ctx.fillRect(26, 57, 5, 205);\n ctx.fillRect(102, 57, 6, 205);\n ctx.fillRect(198, 57, 6, 205);\n ctx.fillRect(21, 127, 185, 5);\n ctx.fillStyle = \"rgba(234,246,247,.38)\";\n ctx.fillRect(32, 59, 69, 66);\n ctx.fillRect(109, 59, 87, 66);\n\n // Diffuse shapes behind glass\n ctx.fillStyle = \"rgba(87,110,104,.2)\";\n ctx.fillRect(40, 146, 48, 83);\n ctx.fillRect(120, 153, 60, 76);\n ctx.fillStyle = \"rgba(255,255,255,.22)\";\n poly([[32,61],[76,61],[151,125],[109,125]]);\n ctx.fill();\n\n // Information wall sign\n ctx.save();\n ctx.shadowColor = \"rgba(0,0,0,.18)\";\n ctx.shadowBlur = 4;\n ctx.shadowOffsetY = 2;\n rr(300, 51, 172, 44, 3);\n ctx.fillStyle = \"#f4f2e9\";\n ctx.fill();\n ctx.restore();\n ctx.strokeStyle = \"#b5b8b5\";\n ctx.lineWidth = 1;\n rr(300, 51, 172, 44, 3);\n ctx.stroke();\n ctx.fillStyle = \"#3c5965\";\n ctx.font = \"600 17px Arial, sans-serif\";\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.fillText(\"INFORMATION\", 386, 73);\n ctx.fillStyle = \"#62808a\";\n ctx.beginPath();\n ctx.arc(319, 73, 11, 0, Math.PI * 2);\n ctx.fill();\n ctx.fillStyle = \"#fff\";\n ctx.font = \"bold 16px Georgia\";\n ctx.fillText(\"i\", 319, 72);\n\n // Background bookcase\n ctx.fillStyle = \"#8a735b\";\n ctx.fillRect(221, 104, 70, 161);\n ctx.fillStyle = \"#473e35\";\n ctx.fillRect(227, 111, 58, 144);\n for (let y = 145; y < 255; y += 36) {\n ctx.fillStyle = \"#927a60\";\n ctx.fillRect(225, y, 62, 5);\n }\n const bookColors = [\"#8e4441\", \"#506f7a\", \"#c39b55\", \"#627458\", \"#aa7660\", \"#5d6881\"];\n let seed = 7;\n function rand() {\n seed = (seed * 9301 + 49297) % 233280;\n return seed / 233280;\n }\n for (let shelf = 0; shelf < 4; shelf++) {\n let bx = 230;\n const by = 143 + shelf * 36;\n while (bx < 282) {\n const bw = 3 + rand() * 5;\n const bh = 19 + rand() * 10;\n ctx.fillStyle = bookColors[Math.floor(rand() * bookColors.length)];\n ctx.fillRect(bx, by - bh, bw, bh);\n bx += bw + 1.5;\n }\n }\n\n // Baseboard\n ctx.fillStyle = \"#9fa5a2\";\n ctx.fillRect(0, 263, W, 9);\n ctx.fillStyle = \"#ecedeb\";\n ctx.fillRect(0, 263, W, 2);\n\n // Floor\n g = ctx.createLinearGradient(0, 270, 0, H);\n g.addColorStop(0, \"#c6c5bd\");\n g.addColorStop(1, \"#8e908b\");\n ctx.fillStyle = g;\n ctx.fillRect(0, 272, W, H - 272);\n\n // Floor tile seams\n ctx.strokeStyle = \"rgba(87,91,88,.18)\";\n ctx.lineWidth = 1;\n for (let y = 307; y < 512; y += 45) line(0, y, 512, y + 9, \"rgba(80,83,80,.15)\");\n line(89, 272, 35, 512, \"rgba(80,83,80,.15)\");\n line(246, 272, 237, 512, \"rgba(80,83,80,.15)\");\n line(402, 272, 456, 512, \"rgba(80,83,80,.15)\");\n\n // Information counter in the right background\n ctx.save();\n ctx.shadowColor = \"rgba(20,25,25,.22)\";\n ctx.shadowBlur = 12;\n ctx.shadowOffsetY = 7;\n poly([[340,182],[512,177],[512,364],[346,369]]);\n ctx.fillStyle = \"#766653\";\n ctx.fill();\n ctx.restore();\n\n // Counter front panels\n g = ctx.createLinearGradient(345, 210, 512, 360);\n g.addColorStop(0, \"#a68a69\");\n g.addColorStop(0.55, \"#92775b\");\n g.addColorStop(1, \"#715e4a\");\n poly([[345,207],[512,204],[512,363],[347,368]]);\n ctx.fillStyle = g;\n ctx.fill();\n line(402, 207, 403, 366, \"rgba(72,52,38,.4)\");\n line(465, 205, 466, 364, \"rgba(72,52,38,.4)\");\n line(348, 329, 512, 325, \"rgba(61,49,38,.34)\");\n\n // Countertop\n ctx.save();\n ctx.shadowColor = \"rgba(0,0,0,.25)\";\n ctx.shadowBlur = 7;\n ctx.shadowOffsetY = 4;\n poly([[328,184],[498,178],[512,190],[512,211],[342,216],[328,205]]);\n g = ctx.createLinearGradient(330, 180, 330, 217);\n g.addColorStop(0, \"#ede6da\");\n g.addColorStop(0.35, \"#c9bbaa\");\n g.addColorStop(1, \"#8c7e70\");\n ctx.fillStyle = g;\n ctx.fill();\n ctx.restore();\n line(342, 211, 512, 206, \"rgba(255,255,255,.35)\");\n\n // Desk monitor\n ctx.save();\n ctx.shadowColor = \"rgba(0,0,0,.22)\";\n ctx.shadowBlur = 5;\n rr(408, 117, 64, 55, 4);\n ctx.fillStyle = \"#3b4143\";\n ctx.fill();\n rr(413, 122, 54, 43, 2);\n g = ctx.createLinearGradient(413, 122, 467, 165);\n g.addColorStop(0, \"#c8dadd\");\n g.addColorStop(1, \"#6f8589\");\n ctx.fillStyle = g;\n ctx.fill();\n ctx.restore();\n ctx.fillStyle = \"#4d5050\";\n ctx.fillRect(437, 171, 7, 17);\n ctx.fillRect(424, 187, 33, 4);\n ctx.fillStyle = \"rgba(255,255,255,.28)\";\n poly([[416,125],[434,125],[463,160],[454,160]]);\n ctx.fill();\n\n // Desk lamp / small items\n ctx.fillStyle = \"#dedbd1\";\n rr(368, 171, 30, 12, 2);\n ctx.fill();\n ctx.fillStyle = \"#63767c\";\n ctx.fillRect(375, 159, 16, 13);\n ctx.fillStyle = \"#f0cf73\";\n ctx.fillRect(378, 161, 10, 7);\n\n // Broad bin floor shadow\n ctx.save();\n ctx.filter = \"blur(9px)\";\n ctx.fillStyle = \"rgba(20,26,28,.32)\";\n ctx.beginPath();\n ctx.ellipse(229, 442, 154, 28, -0.02, 0, Math.PI * 2);\n ctx.fill();\n ctx.restore();\n\n // Rear wheels\n function wheel(cx, cy, scale = 1) {\n ctx.save();\n ctx.translate(cx, cy);\n ctx.scale(scale, scale);\n ctx.fillStyle = \"#263036\";\n ctx.beginPath();\n ctx.ellipse(0, 0, 17, 21, 0, 0, Math.PI * 2);\n ctx.fill();\n ctx.fillStyle = \"#101619\";\n ctx.beginPath();\n ctx.ellipse(0, 2, 10, 14, 0, 0, Math.PI * 2);\n ctx.fill();\n ctx.fillStyle = \"#758087\";\n ctx.beginPath();\n ctx.arc(0, 1, 4, 0, Math.PI * 2);\n ctx.fill();\n ctx.restore();\n }\n ctx.fillStyle = \"#29373e\";\n ctx.fillRect(122, 409, 11, 22);\n ctx.fillRect(327, 408, 10, 22);\n wheel(126, 435, .8);\n wheel(329, 435, .8);\n\n // Main blue bin body, slightly tapered\n ctx.save();\n ctx.shadowColor = \"rgba(0,0,0,.3)\";\n ctx.shadowBlur = 7;\n ctx.shadowOffsetX = 3;\n ctx.shadowOffsetY = 5;\n poly([[101,204],[355,204],[340,418],[119,418]]);\n g = ctx.createLinearGradient(95, 210, 356, 412);\n g.addColorStop(0, \"#1f78ae\");\n g.addColorStop(0.22, \"#176a9e\");\n g.addColorStop(0.66, \"#115986\");\n g.addColorStop(1, \"#0a3e62\");\n ctx.fillStyle = g;\n ctx.fill();\n ctx.restore();\n\n // Left side volume\n poly([[101,204],[125,215],[136,414],[119,418]]);\n g = ctx.createLinearGradient(100, 200, 136, 410);\n g.addColorStop(0, \"#3690bf\");\n g.addColorStop(1, \"#0d4e74\");\n ctx.fillStyle = g;\n ctx.fill();\n\n // Right edge\n poly([[347,211],[355,204],[340,418],[329,414]]);\n ctx.fillStyle = \"#083c60\";\n ctx.fill();\n\n // Bin top sloping assembly\n ctx.save();\n ctx.shadowColor = \"rgba(0,0,0,.35)\";\n ctx.shadowBlur = 5;\n ctx.shadowOffsetY = 4;\n poly([[102,203],[143,150],[337,149],[356,204],[338,220],[120,220]]);\n g = ctx.createLinearGradient(180, 143, 265, 224);\n g.addColorStop(0, \"#318cbc\");\n g.addColorStop(0.48, \"#1473aa\");\n g.addColorStop(1, \"#0b4e79\");\n ctx.fillStyle = g;\n ctx.fill();\n ctx.restore();\n\n // Top highlights and molded rim\n line(144, 151, 337, 150, \"rgba(160,222,246,.65)\", 2);\n line(121, 217, 339, 217, \"rgba(3,39,61,.65)\", 5);\n line(123, 213, 341, 213, \"rgba(92,176,211,.5)\", 2);\n\n // Return slot\n ctx.save();\n poly([[151,166],[320,166],[335,195],[132,195]]);\n g = ctx.createLinearGradient(0, 166, 0, 198);\n g.addColorStop(0, \"#082f47\");\n g.addColorStop(1, \"#061a26\");\n ctx.fillStyle = g;\n ctx.fill();\n ctx.restore();\n line(151, 166, 320, 166, \"rgba(149,214,238,.45)\", 2);\n poly([[142,173],[317,173],[326,189],[137,189]]);\n ctx.fillStyle = \"#071d29\";\n ctx.fill();\n\n // A visible returned book just inside slot\n poly([[182,169],[269,169],[279,180],[174,180]]);\n ctx.fillStyle = \"#913f39\";\n ctx.fill();\n line(184, 171, 267, 171, \"rgba(255,203,172,.5)\", 1);\n ctx.fillStyle = \"#d7c6a2\";\n poly([[272,169],[277,171],[283,179],[278,180]]);\n ctx.fill();\n\n // Front panel inset seams\n ctx.strokeStyle = \"rgba(2,42,68,.55)\";\n ctx.lineWidth = 2;\n rr(132, 235, 196, 159, 8);\n ctx.stroke();\n ctx.strokeStyle = \"rgba(105,184,218,.18)\";\n ctx.lineWidth = 1;\n rr(135, 238, 190, 153, 7);\n ctx.stroke();\n\n // Molded vertical reflections\n g = ctx.createLinearGradient(124, 0, 181, 0);\n g.addColorStop(0, \"rgba(255,255,255,.03)\");\n g.addColorStop(.5, \"rgba(255,255,255,.16)\");\n g.addColorStop(1, \"rgba(255,255,255,0)\");\n ctx.fillStyle = g;\n poly([[126,223],[183,223],[175,404],[137,407]]);\n ctx.fill();\n g = ctx.createLinearGradient(278, 0, 331, 0);\n g.addColorStop(0, \"rgba(255,255,255,0)\");\n g.addColorStop(.6, \"rgba(126,204,235,.1)\");\n g.addColorStop(1, \"rgba(255,255,255,0)\");\n ctx.fillStyle = g;\n poly([[274,224],[328,222],[319,404],[281,404]]);\n ctx.fill();\n\n // Laminated silver card shadow\n ctx.save();\n ctx.shadowColor = \"rgba(0,0,0,.38)\";\n ctx.shadowBlur = 6;\n ctx.shadowOffsetY = 4;\n rr(162, 252, 140, 67, 4);\n ctx.fillStyle = \"#c7cccd\";\n ctx.fill();\n ctx.restore();\n\n // Metallic / laminated card\n rr(159, 249, 140, 67, 4);\n g = ctx.createLinearGradient(159, 249, 299, 316);\n g.addColorStop(0, \"#8f989b\");\n g.addColorStop(.16, \"#eef1f0\");\n g.addColorStop(.42, \"#bbc2c3\");\n g.addColorStop(.66, \"#f5f5f2\");\n g.addColorStop(1, \"#9ca4a5\");\n ctx.fillStyle = g;\n ctx.fill();\n ctx.strokeStyle = \"#687174\";\n ctx.lineWidth = 1.2;\n rr(159, 249, 140, 67, 4);\n ctx.stroke();\n\n // Inner card border\n rr(164, 254, 130, 57, 2);\n ctx.strokeStyle = \"rgba(70,78,80,.55)\";\n ctx.lineWidth = 1;\n ctx.stroke();\n line(165, 255, 293, 255, \"rgba(255,255,255,.85)\", 1);\n\n // Laminate glare\n ctx.save();\n rr(159, 249, 140, 67, 4);\n ctx.clip();\n poly([[172,248],[211,248],[253,316],[216,316]]);\n ctx.fillStyle = \"rgba(255,255,255,.28)\";\n ctx.fill();\n poly([[273,248],[288,248],[299,267],[299,288]]);\n ctx.fillStyle = \"rgba(255,255,255,.2)\";\n ctx.fill();\n ctx.restore();\n\n // Card fasteners\n for (const [x, y] of [[166,256],[292,256],[166,309],[292,309]]) {\n ctx.fillStyle = \"#747d7e\";\n ctx.beginPath();\n ctx.arc(x, y, 1.5, 0, Math.PI * 2);\n ctx.fill();\n ctx.fillStyle = \"rgba(255,255,255,.65)\";\n ctx.beginPath();\n ctx.arc(x - .4, y - .5, .45, 0, Math.PI * 2);\n ctx.fill();\n }\n\n // Card text\n ctx.fillStyle = \"#18282e\";\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.font = \"bold 17px Arial, Helvetica, sans-serif\";\n ctx.fillText(\"Returned Books\", 229, 283);\n ctx.font = \"9px Arial, Helvetica, sans-serif\";\n ctx.fillStyle = \"#465459\";\n ctx.fillText(\"LIBRARY MATERIALS\", 229, 301);\n\n // Bottom bumper\n poly([[117,400],[341,400],[340,419],[119,419]]);\n g = ctx.createLinearGradient(0, 400, 0, 420);\n g.addColorStop(0, \"#174e6c\");\n g.addColorStop(.4, \"#092f48\");\n g.addColorStop(1, \"#071f2e\");\n ctx.fillStyle = g;\n ctx.fill();\n line(122, 402, 336, 402, \"rgba(82,153,182,.35)\");\n\n // Front caster brackets and wheels\n function caster(x, y) {\n ctx.fillStyle = \"#6e777a\";\n poly([[x - 7,y - 13],[x + 8,y - 13],[x + 6,y + 3],[x - 5,y + 3]]);\n ctx.fill();\n ctx.fillStyle = \"#31393c\";\n ctx.fillRect(x - 4, y - 2, 8, 10);\n wheel(x, y + 13, .72);\n ctx.fillStyle = \"#a2aaab\";\n ctx.beginPath();\n ctx.arc(x, y - 9, 2.2, 0, Math.PI * 2);\n ctx.fill();\n }\n caster(151, 419);\n caster(309, 419);\n\n // Scuffs and realistic wear\n ctx.strokeStyle = \"rgba(197,229,237,.18)\";\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.moveTo(145, 350);\n ctx.quadraticCurveTo(168, 345, 184, 353);\n ctx.stroke();\n ctx.beginPath();\n ctx.moveTo(274, 368);\n ctx.lineTo(307, 363);\n ctx.stroke();\n ctx.strokeStyle = \"rgba(0,27,43,.25)\";\n ctx.beginPath();\n ctx.moveTo(196, 391);\n ctx.lineTo(238, 394);\n ctx.stroke();\n\n // Fine photographic grain\n const image = ctx.getImageData(0, 0, W * 2, H * 2);\n const d = image.data;\n let nseed = 12345;\n for (let i = 0; i < d.length; i += 4) {\n nseed = (nseed * 16807) % 2147483647;\n const noise = ((nseed / 2147483647) - .5) * 3.2;\n d[i] = Math.max(0, Math.min(255, d[i] + noise));\n d[i + 1] = Math.max(0, Math.min(255, d[i + 1] + noise));\n d[i + 2] = Math.max(0, Math.min(255, d[i + 2] + noise));\n }\n ctx.putImageData(image, 0, 0);\n\n await new Promise(resolve => requestAnimationFrame(resolve));\n}"}], "metadata": {"id": "val-v1-broad-v2-text_rendering-validation-009", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 6928, "code_sha256": "147c9642cf39c3dd3c488fefad30acc01b0235ef2dba2f6216b8b42c2c43fd2c"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A plant shows a tight white center, surrounded by large green leaves."}, {"role": "assistant", "content": "async function render(stage) {\n const uid = `plant_${Math.random().toString(36).slice(2)}`;\n let seed = 48271;\n const rand = () => {\n seed = (seed * 16807) % 2147483647;\n return (seed - 1) / 2147483646;\n };\n\n stage.innerHTML = \"\";\n Object.assign(stage.style, {\n width: \"512px\",\n height: \"512px\",\n overflow: \"hidden\",\n position: \"relative\",\n background: \"#172318\"\n });\n\n const smoothPath = points => {\n let d = `M ${points[0][0].toFixed(1)} ${points[0][1].toFixed(1)}`;\n for (let i = 1; i < points.length - 1; i++) {\n const mx = (points[i][0] + points[i + 1][0]) / 2;\n const my = (points[i][1] + points[i + 1][1]) / 2;\n d += ` Q ${points[i][0].toFixed(1)} ${points[i][1].toFixed(1)} ${mx.toFixed(1)} ${my.toFixed(1)}`;\n }\n const last = points[points.length - 1];\n d += ` Q ${last[0].toFixed(1)} ${last[1].toFixed(1)} ${points[0][0].toFixed(1)} ${points[0][1].toFixed(1)} Z`;\n return d;\n };\n\n const makeLeaf = (o, index) => {\n const {\n angle, length, width, start = 8, gradient, opacity = 1,\n wave = 0.08, vein = \"#adc47d\", veinOpacity = .42,\n texture = .12, bend = 0\n } = o;\n\n const top = [];\n const bottom = [];\n const n = 13;\n for (let i = 0; i <= n; i++) {\n const t = i / n;\n const x = start + t * length;\n const body = Math.pow(Math.sin(Math.PI * t), .72);\n const taper = 0.84 + .16 * (1 - t);\n const ripple = 1 + wave * Math.sin(i * 3.45 + index * 1.73);\n const centerCurve = bend * Math.sin(Math.PI * t);\n const edge = width * body * taper * ripple;\n const pointNoise = (rand() - .5) * width * .025;\n top.push([x, centerCurve - edge + pointNoise]);\n bottom.push([x, centerCurve + edge - pointNoise]);\n }\n const points = [...top, ...bottom.reverse()];\n const d = smoothPath(points);\n const clip = `${uid}_clip_${index}`;\n\n let veins = `\n \n `;\n\n for (let i = 2; i <= 10; i++) {\n const t = i / 12;\n const x = start + length * t;\n const body = Math.pow(Math.sin(Math.PI * t), .72);\n const w = width * body * .84;\n const yy = bend * Math.sin(Math.PI * t);\n const dir = i % 2 ? -1 : 1;\n veins += `\n \n \n `;\n }\n\n return `\n \n \n \n \n \n \n \n ${veins}\n \n \n `;\n };\n\n let outerLeaves = \"\";\n const outerCount = 19;\n for (let i = 0; i < outerCount; i++) {\n const a = -98 + i * (360 / outerCount) + (rand() - .5) * 10;\n outerLeaves += makeLeaf({\n angle: a,\n length: 194 + rand() * 54,\n width: 48 + rand() * 20,\n start: 11 + rand() * 8,\n gradient: `${uid}_outer${i % 3}`,\n wave: .075 + rand() * .055,\n bend: (rand() - .5) * 22,\n vein: i % 3 === 0 ? \"#a8c66f\" : \"#789d55\",\n veinOpacity: .34 + rand() * .16,\n texture: .13 + rand() * .08\n }, i);\n }\n\n let middleLeaves = \"\";\n const middleCount = 17;\n for (let i = 0; i < middleCount; i++) {\n const a = -84 + i * (360 / middleCount) + (rand() - .5) * 11;\n middleLeaves += makeLeaf({\n angle: a,\n length: 129 + rand() * 48,\n width: 39 + rand() * 17,\n start: 7 + rand() * 9,\n gradient: `${uid}_mid${i % 3}`,\n wave: .06 + rand() * .055,\n bend: (rand() - .5) * 17,\n vein: \"#bed38b\",\n veinOpacity: .38 + rand() * .15,\n texture: .11 + rand() * .07\n }, 40 + i);\n }\n\n let innerLeaves = \"\";\n const innerCount = 15;\n for (let i = 0; i < innerCount; i++) {\n const a = -90 + i * (360 / innerCount) + (rand() - .5) * 13;\n innerLeaves += makeLeaf({\n angle: a,\n length: 73 + rand() * 34,\n width: 25 + rand() * 12,\n start: 2 + rand() * 7,\n gradient: `${uid}_inner${i % 3}`,\n wave: .045 + rand() * .04,\n bend: (rand() - .5) * 12,\n vein: \"#f0f0c9\",\n veinOpacity: .46,\n texture: .08\n }, 80 + i);\n }\n\n let core = \"\";\n for (let ring = 0; ring < 3; ring++) {\n const count = 11 - ring * 2;\n const radius = 29 - ring * 9;\n const length = 43 - ring * 10;\n for (let i = 0; i < count; i++) {\n const angle = i * 360 / count + ring * 19 + (rand() - .5) * 12;\n const pale = [\"#faf9e5\", \"#f1f2d5\", \"#fffdf0\", \"#e6e9c8\"][i % 4];\n core += `\n \n \n \n \n \n `;\n }\n }\n\n const svg = `\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n ${outerLeaves}\n ${middleLeaves}\n ${innerLeaves}\n \n ${core}\n \n \n \n \n \n \n \n \n \n \n `;\n\n stage.innerHTML = svg;\n}"}], "metadata": {"id": "val-v1-coco-train2017-000000071429-720051", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 4925, "code_sha256": "40c9f50ff28c1702cb69339be943f3a7045cfc8be6b2dd2d3796de70e580aa71"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A person gets ready to mount their bicycle."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n Object.assign(stage.style, {\n width: \"512px\",\n height: \"512px\",\n overflow: \"hidden\",\n position: \"relative\",\n background: \"#dbe5e3\"\n });\n\n const ns = \"http://www.w3.org/2000/svg\";\n const svg = document.createElementNS(ns, \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 512 512\");\n svg.setAttribute(\"width\", \"512\");\n svg.setAttribute(\"height\", \"512\");\n svg.setAttribute(\"role\", \"img\");\n svg.setAttribute(\"aria-label\", \"A cyclist preparing to mount a bicycle on a park path\");\n svg.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n `;\n stage.appendChild(svg);\n await new Promise(resolve => requestAnimationFrame(resolve));\n}"}], "metadata": {"id": "val-v1-coco-train2017-000000073437-684644", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 7271, "code_sha256": "0d1bf9584693ac1ee8f303ce99ac4e6da961021e30ed9f0a230be34cab5570f9"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "Many different clocks hang together on a wall."}, {"role": "assistant", "content": "async function render(stage) {\n stage.replaceChildren();\n Object.assign(stage.style, {\n position: \"relative\",\n width: \"512px\",\n height: \"512px\",\n overflow: \"hidden\",\n background: \"#bbb1a1\"\n });\n\n const canvas = document.createElement(\"canvas\");\n const dpr = 2;\n canvas.width = 512 * dpr;\n canvas.height = 512 * dpr;\n Object.assign(canvas.style, { width: \"512px\", height: \"512px\", display: \"block\" });\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(dpr, dpr);\n ctx.lineCap = \"round\";\n ctx.lineJoin = \"round\";\n\n let seed = 839175;\n const rnd = () => {\n seed = (seed * 1664525 + 1013904223) >>> 0;\n return seed / 4294967296;\n };\n\n function rr(x, y, w, h, r) {\n const q = Math.min(r, w / 2, h / 2);\n ctx.beginPath();\n ctx.moveTo(x + q, y);\n ctx.arcTo(x + w, y, x + w, y + h, q);\n ctx.arcTo(x + w, y + h, x, y + h, q);\n ctx.arcTo(x, y + h, x, y, q);\n ctx.arcTo(x, y, x + w, y, q);\n ctx.closePath();\n }\n\n function shadow(blur = 11, x = 3, y = 6, color = \"rgba(40,26,16,.38)\") {\n ctx.shadowColor = color;\n ctx.shadowBlur = blur;\n ctx.shadowOffsetX = x;\n ctx.shadowOffsetY = y;\n }\n\n function noShadow() {\n ctx.shadowColor = \"transparent\";\n ctx.shadowBlur = 0;\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n }\n\n // A softly mottled plaster wall.\n const wall = ctx.createLinearGradient(0, 0, 512, 512);\n wall.addColorStop(0, \"#d8d0c1\");\n wall.addColorStop(.48, \"#c9c0b0\");\n wall.addColorStop(1, \"#aea596\");\n ctx.fillStyle = wall;\n ctx.fillRect(0, 0, 512, 512);\n\n for (let i = 0; i < 3200; i++) {\n const x = rnd() * 512, y = rnd() * 512;\n const a = .018 + rnd() * .035;\n ctx.fillStyle = rnd() > .48\n ? `rgba(255,255,245,${a})`\n : `rgba(76,62,48,${a})`;\n ctx.fillRect(x, y, .35 + rnd() * 1.5, .35 + rnd() * 1.5);\n }\n for (let i = 0; i < 26; i++) {\n const x = rnd() * 512, y = rnd() * 512, r = 8 + rnd() * 38;\n const g = ctx.createRadialGradient(x, y, 0, x, y, r);\n g.addColorStop(0, `rgba(105,90,71,${.015 + rnd() * .025})`);\n g.addColorStop(1, \"rgba(105,90,71,0)\");\n ctx.fillStyle = g;\n ctx.beginPath();\n ctx.arc(x, y, r, 0, Math.PI * 2);\n ctx.fill();\n }\n\n // Upper molding and lower diffuse shade anchor the wall spatially.\n ctx.fillStyle = \"rgba(88,70,51,.16)\";\n ctx.fillRect(0, 18, 512, 2);\n ctx.fillStyle = \"rgba(255,255,255,.22)\";\n ctx.fillRect(0, 20, 512, 1);\n const lowerShade = ctx.createLinearGradient(0, 420, 0, 512);\n lowerShade.addColorStop(0, \"rgba(52,38,27,0)\");\n lowerShade.addColorStop(1, \"rgba(52,38,27,.16)\");\n ctx.fillStyle = lowerShade;\n ctx.fillRect(0, 410, 512, 102);\n\n function hands(cx, cy, r, hour, minute, style = \"black\", second = null) {\n const ma = (minute / 60) * Math.PI * 2 - Math.PI / 2;\n const ha = ((hour % 12 + minute / 60) / 12) * Math.PI * 2 - Math.PI / 2;\n const handColor = style === \"brass\" ? \"#6b5122\" :\n style === \"white\" ? \"#eee9dc\" : \"#26221e\";\n\n ctx.strokeStyle = handColor;\n ctx.fillStyle = handColor;\n ctx.lineWidth = Math.max(1.5, r * .045);\n ctx.beginPath();\n ctx.moveTo(cx - Math.cos(ha) * r * .1, cy - Math.sin(ha) * r * .1);\n ctx.lineTo(cx + Math.cos(ha) * r * .53, cy + Math.sin(ha) * r * .53);\n ctx.stroke();\n\n ctx.lineWidth = Math.max(1, r * .028);\n ctx.beginPath();\n ctx.moveTo(cx - Math.cos(ma) * r * .12, cy - Math.sin(ma) * r * .12);\n ctx.lineTo(cx + Math.cos(ma) * r * .76, cy + Math.sin(ma) * r * .76);\n ctx.stroke();\n\n if (second !== null) {\n const sa = second / 60 * Math.PI * 2 - Math.PI / 2;\n ctx.strokeStyle = \"#a52c20\";\n ctx.lineWidth = Math.max(.7, r * .012);\n ctx.beginPath();\n ctx.moveTo(cx - Math.cos(sa) * r * .17, cy - Math.sin(sa) * r * .17);\n ctx.lineTo(cx + Math.cos(sa) * r * .82, cy + Math.sin(sa) * r * .82);\n ctx.stroke();\n }\n\n const pin = ctx.createRadialGradient(cx - 1, cy - 1, 0, cx, cy, r * .09);\n pin.addColorStop(0, \"#f2d993\");\n pin.addColorStop(.35, style === \"white\" ? \"#ddd\" : \"#6d5428\");\n pin.addColorStop(1, \"#201b16\");\n ctx.fillStyle = pin;\n ctx.beginPath();\n ctx.arc(cx, cy, Math.max(2, r * .055), 0, Math.PI * 2);\n ctx.fill();\n }\n\n function clockFace(cx, cy, r, opts = {}) {\n const {\n rim = \"wood\", face = \"#efe9d8\", numerals = \"arabic\",\n hour = 10, minute = 9, second = 38, label = \"\"\n } = opts;\n\n shadow(r * .17, 3, 6);\n let rg = ctx.createRadialGradient(cx - r * .28, cy - r * .32, r * .08, cx, cy, r * 1.08);\n if (rim === \"brass\") {\n rg.addColorStop(0, \"#ffe49c\"); rg.addColorStop(.28, \"#ad7f2d\");\n rg.addColorStop(.63, \"#e5bd60\"); rg.addColorStop(1, \"#584019\");\n } else if (rim === \"black\") {\n rg.addColorStop(0, \"#686764\"); rg.addColorStop(.25, \"#262725\");\n rg.addColorStop(.72, \"#111210\"); rg.addColorStop(1, \"#45443f\");\n } else if (rim === \"silver\") {\n rg.addColorStop(0, \"#f2f0e9\"); rg.addColorStop(.25, \"#929494\");\n rg.addColorStop(.58, \"#d7d7d1\"); rg.addColorStop(1, \"#555a5b\");\n } else if (rim === \"red\") {\n rg.addColorStop(0, \"#b95f46\"); rg.addColorStop(.5, \"#743527\");\n rg.addColorStop(1, \"#351813\");\n } else {\n rg.addColorStop(0, \"#bc7843\"); rg.addColorStop(.35, \"#6c351a\");\n rg.addColorStop(.72, \"#9a552c\"); rg.addColorStop(1, \"#3a1d12\");\n }\n ctx.fillStyle = rg;\n ctx.beginPath();\n ctx.arc(cx, cy, r, 0, Math.PI * 2);\n ctx.fill();\n noShadow();\n\n ctx.strokeStyle = \"rgba(255,255,255,.28)\";\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.arc(cx - .5, cy - .5, r - 2, Math.PI * 1.08, Math.PI * 1.87);\n ctx.stroke();\n\n const fr = r * .82;\n const fg = ctx.createRadialGradient(cx - fr * .25, cy - fr * .3, 2, cx, cy, fr);\n fg.addColorStop(0, \"#fffdf2\");\n fg.addColorStop(.72, face);\n fg.addColorStop(1, face === \"#222522\" ? \"#121411\" : \"#d0c7b2\");\n ctx.fillStyle = fg;\n ctx.beginPath();\n ctx.arc(cx, cy, fr, 0, Math.PI * 2);\n ctx.fill();\n ctx.strokeStyle = rim === \"brass\" ? \"#725522\" : \"rgba(35,29,23,.55)\";\n ctx.lineWidth = 1;\n ctx.stroke();\n\n const darkFace = face === \"#222522\";\n const ink = darkFace ? \"#eee9dc\" : \"#302c27\";\n for (let i = 0; i < 60; i++) {\n const a = i * Math.PI / 30 - Math.PI / 2;\n const major = i % 5 === 0;\n const ro = fr * .91, ri = fr * (major ? .78 : .86);\n ctx.strokeStyle = ink;\n ctx.globalAlpha = major ? .9 : .48;\n ctx.lineWidth = major ? Math.max(1, r * .018) : .55;\n ctx.beginPath();\n ctx.moveTo(cx + Math.cos(a) * ri, cy + Math.sin(a) * ri);\n ctx.lineTo(cx + Math.cos(a) * ro, cy + Math.sin(a) * ro);\n ctx.stroke();\n }\n ctx.globalAlpha = 1;\n\n if (r > 22 && numerals !== \"none\") {\n ctx.fillStyle = ink;\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n if (numerals === \"roman\") {\n const rom = [\"XII\", \"I\", \"II\", \"III\", \"IV\", \"V\", \"VI\", \"VII\", \"VIII\", \"IX\", \"X\", \"XI\"];\n ctx.font = `${Math.max(7, r * .18)}px Georgia, serif`;\n for (let i = 0; i < 12; i++) {\n const a = i * Math.PI / 6 - Math.PI / 2;\n ctx.fillText(rom[i], cx + Math.cos(a) * fr * .65, cy + Math.sin(a) * fr * .65);\n }\n } else {\n ctx.font = `600 ${Math.max(7, r * .18)}px Arial, sans-serif`;\n for (let i = 1; i <= 12; i++) {\n const a = i * Math.PI / 6 - Math.PI / 2;\n ctx.fillText(String(i), cx + Math.cos(a) * fr * .65, cy + Math.sin(a) * fr * .65);\n }\n }\n }\n\n if (label && r > 30) {\n ctx.fillStyle = darkFace ? \"#cbc6b9\" : \"#706759\";\n ctx.font = `${Math.max(4.5, r * .07)}px Georgia, serif`;\n ctx.textAlign = \"center\";\n ctx.fillText(label, cx, cy + r * .3);\n }\n hands(cx, cy, fr, hour, minute, darkFace ? \"white\" : rim === \"brass\" ? \"brass\" : \"black\", second);\n }\n\n function sunClock(cx, cy, r) {\n shadow(9, 3, 5);\n ctx.save();\n ctx.translate(cx, cy);\n for (let i = 0; i < 24; i++) {\n ctx.rotate(Math.PI / 12);\n const g = ctx.createLinearGradient(r * .74, 0, r * 1.35, 0);\n g.addColorStop(0, \"#5b3e1b\");\n g.addColorStop(.5, \"#d09b43\");\n g.addColorStop(1, \"#6e481d\");\n ctx.fillStyle = g;\n ctx.beginPath();\n ctx.moveTo(r * .68, -2.3);\n ctx.lineTo(r * 1.38, 0);\n ctx.lineTo(r * .68, 2.3);\n ctx.closePath();\n ctx.fill();\n }\n ctx.restore();\n noShadow();\n clockFace(cx, cy, r * .73, {\n rim: \"brass\", face: \"#f3ead4\", numerals: \"roman\", hour: 7, minute: 22, second: 4\n });\n }\n\n function squareClock(x, y, w, h) {\n shadow(12, 4, 7);\n const wood = ctx.createLinearGradient(x, y, x + w, y + h);\n wood.addColorStop(0, \"#a86736\");\n wood.addColorStop(.35, \"#4d2515\");\n wood.addColorStop(.67, \"#8f4d28\");\n wood.addColorStop(1, \"#35180f\");\n ctx.fillStyle = wood;\n rr(x, y, w, h, 6);\n ctx.fill();\n noShadow();\n ctx.strokeStyle = \"#32180f\";\n ctx.lineWidth = 2;\n rr(x + 2, y + 2, w - 4, h - 4, 5);\n ctx.stroke();\n for (let i = 0; i < 8; i++) {\n ctx.strokeStyle = `rgba(32,12,5,${.12 + rnd() * .12})`;\n ctx.lineWidth = .6;\n ctx.beginPath();\n ctx.moveTo(x + 4, y + 5 + i * h / 8);\n ctx.bezierCurveTo(x + w * .35, y + i * h / 8 + rnd() * 7,\n x + w * .65, y + i * h / 8 - rnd() * 5,\n x + w - 4, y + 6 + i * h / 8);\n ctx.stroke();\n }\n clockFace(x + w / 2, y + h / 2, Math.min(w, h) * .39, {\n rim: \"brass\", face: \"#eee2c6\", numerals: \"roman\", hour: 3, minute: 42, second: 17\n });\n }\n\n function pendulumClock(x, y, w, h) {\n shadow(14, 5, 8);\n const wood = ctx.createLinearGradient(x, y, x + w, y);\n wood.addColorStop(0, \"#32170f\");\n wood.addColorStop(.2, \"#89502b\");\n wood.addColorStop(.5, \"#ad7040\");\n wood.addColorStop(.78, \"#67351e\");\n wood.addColorStop(1, \"#2a120c\");\n ctx.fillStyle = wood;\n rr(x, y, w, h, 7);\n ctx.fill();\n noShadow();\n\n ctx.fillStyle = \"#4b2415\";\n ctx.beginPath();\n ctx.moveTo(x - 6, y + 8);\n ctx.lineTo(x + w / 2, y - 13);\n ctx.lineTo(x + w + 6, y + 8);\n ctx.closePath();\n ctx.fill();\n ctx.fillStyle = \"#d1a35b\";\n ctx.beginPath();\n ctx.arc(x + w / 2, y - 5, 4, 0, Math.PI * 2);\n ctx.fill();\n\n clockFace(x + w / 2, y + 37, w * .38, {\n rim: \"brass\", face: \"#eee5d2\", numerals: \"roman\", hour: 1, minute: 51, second: 23\n });\n\n ctx.fillStyle = \"#25130e\";\n rr(x + 10, y + 72, w - 20, h - 82, 5);\n ctx.fill();\n const glass = ctx.createLinearGradient(x + 10, y, x + w - 10, y);\n glass.addColorStop(0, \"rgba(100,133,139,.24)\");\n glass.addColorStop(.4, \"rgba(240,250,242,.09)\");\n glass.addColorStop(.65, \"rgba(255,255,255,.3)\");\n glass.addColorStop(1, \"rgba(60,88,93,.17)\");\n ctx.fillStyle = glass;\n rr(x + 12, y + 74, w - 24, h - 86, 4);\n ctx.fill();\n\n ctx.strokeStyle = \"#a77d38\";\n ctx.lineWidth = 2;\n ctx.beginPath();\n ctx.moveTo(x + w / 2, y + 76);\n ctx.lineTo(x + w / 2 - 5, y + h - 25);\n ctx.stroke();\n const pg = ctx.createRadialGradient(x + w / 2 - 8, y + h - 28, 2, x + w / 2 - 5, y + h - 25, 15);\n pg.addColorStop(0, \"#ffe29a\");\n pg.addColorStop(.45, \"#b48231\");\n pg.addColorStop(1, \"#4a3213\");\n ctx.fillStyle = pg;\n ctx.beginPath();\n ctx.ellipse(x + w / 2 - 5, y + h - 24, 12, 17, -.1, 0, Math.PI * 2);\n ctx.fill();\n }\n\n function ovalClock(cx, cy, rx, ry) {\n shadow(11, 4, 7);\n const g = ctx.createRadialGradient(cx - rx * .3, cy - ry * .3, 2, cx, cy, rx);\n g.addColorStop(0, \"#d78d51\");\n g.addColorStop(.5, \"#6c351f\");\n g.addColorStop(1, \"#2c1510\");\n ctx.fillStyle = g;\n ctx.beginPath();\n ctx.ellipse(cx, cy, rx, ry, 0, 0, Math.PI * 2);\n ctx.fill();\n noShadow();\n\n ctx.fillStyle = \"#eee3cb\";\n ctx.beginPath();\n ctx.ellipse(cx, cy, rx * .78, ry * .8, 0, 0, Math.PI * 2);\n ctx.fill();\n ctx.strokeStyle = \"#6e4c29\";\n ctx.lineWidth = 1.4;\n ctx.stroke();\n\n for (let i = 0; i < 12; i++) {\n const a = i * Math.PI / 6 - Math.PI / 2;\n ctx.fillStyle = \"#382b21\";\n ctx.font = \"8px Georgia\";\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.fillText(i === 0 ? \"XII\" : [\"\", \"I\", \"II\", \"III\", \"IV\", \"V\", \"VI\", \"VII\", \"VIII\", \"IX\", \"X\", \"XI\"][i],\n cx + Math.cos(a) * rx * .55, cy + Math.sin(a) * ry * .57);\n }\n hands(cx, cy, Math.min(rx, ry) * .9, 5, 27, \"black\", 48);\n }\n\n function cuckoo(x, y, w, h) {\n shadow(13, 5, 8);\n ctx.fillStyle = \"#4a2718\";\n ctx.beginPath();\n ctx.moveTo(x - 8, y + 28);\n ctx.lineTo(x + w / 2, y - 14);\n ctx.lineTo(x + w + 8, y + 28);\n ctx.closePath();\n ctx.fill();\n const wood = ctx.createLinearGradient(x, y, x + w, y + h);\n wood.addColorStop(0, \"#8a5330\");\n wood.addColorStop(.55, \"#4e2818\");\n wood.addColorStop(1, \"#2b150e\");\n ctx.fillStyle = wood;\n rr(x, y + 23, w, h - 23, 3);\n ctx.fill();\n noShadow();\n\n ctx.strokeStyle = \"#bd8250\";\n ctx.lineWidth = 2;\n for (let i = 0; i < 4; i++) {\n ctx.beginPath();\n ctx.moveTo(x + 4 + i * 12, y + 18 + i * 2);\n ctx.lineTo(x + w / 2, y - 7);\n ctx.stroke();\n }\n ctx.fillStyle = \"#17100d\";\n rr(x + w / 2 - 10, y + 13, 20, 15, 2);\n ctx.fill();\n ctx.fillStyle = \"#b17b48\";\n ctx.beginPath();\n ctx.arc(x + w / 2, y + 22, 4, Math.PI, 0);\n ctx.fill();\n\n clockFace(x + w / 2, y + 55, w * .31, {\n rim: \"wood\", face: \"#e9dfc9\", numerals: \"roman\", hour: 11, minute: 4, second: null\n });\n\n ctx.strokeStyle = \"#342115\";\n ctx.lineWidth = 1.4;\n ctx.beginPath();\n ctx.moveTo(x + 14, y + h - 4);\n ctx.lineTo(x + 8, y + h + 36);\n ctx.moveTo(x + w - 14, y + h - 4);\n ctx.lineTo(x + w - 5, y + h + 44);\n ctx.stroke();\n\n ctx.fillStyle = \"#52351c\";\n ctx.beginPath();\n ctx.moveTo(x + 8, y + h + 27);\n ctx.lineTo(x + 2, y + h + 49);\n ctx.lineTo(x + 14, y + h + 49);\n ctx.closePath();\n ctx.fill();\n ctx.beginPath();\n ctx.moveTo(x + w - 5, y + h + 35);\n ctx.lineTo(x + w - 11, y + h + 57);\n ctx.lineTo(x + w + 1, y + h + 57);\n ctx.closePath();\n ctx.fill();\n }\n\n function digital(x, y, w, h) {\n shadow(10, 3, 6);\n const g = ctx.createLinearGradient(x, y, x, y + h);\n g.addColorStop(0, \"#595a58\");\n g.addColorStop(.3, \"#242624\");\n g.addColorStop(1, \"#111210\");\n ctx.fillStyle = g;\n rr(x, y, w, h, 7);\n ctx.fill();\n noShadow();\n ctx.fillStyle = \"#080d0a\";\n rr(x + 7, y + 7, w - 14, h - 14, 3);\n ctx.fill();\n ctx.shadowColor = \"rgba(95,255,112,.5)\";\n ctx.shadowBlur = 5;\n ctx.fillStyle = \"#8fe98b\";\n ctx.font = \"18px monospace\";\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.fillText(\"8:24\", x + w / 2, y + h / 2 + 1);\n noShadow();\n }\n\n // Back row and smaller pieces.\n sunClock(78, 78, 34);\n clockFace(169, 65, 28, {\n rim: \"silver\", face: \"#f3f2eb\", numerals: \"none\", hour: 2, minute: 17, second: 43\n });\n clockFace(257, 68, 38, {\n rim: \"black\", face: \"#f4f0e2\", numerals: \"arabic\", hour: 10, minute: 10, second: 31, label: \"STANDARD\"\n });\n clockFace(337, 62, 25, {\n rim: \"red\", face: \"#f2dec8\", numerals: \"none\", hour: 6, minute: 47, second: 8\n });\n pendulumClock(397, 50, 66, 151);\n\n squareClock(27, 139, 92, 101);\n clockFace(158, 153, 31, {\n rim: \"brass\", face: \"#222522\", numerals: \"arabic\", hour: 8, minute: 36, second: 11\n });\n clockFace(339, 155, 29, {\n rim: \"silver\", face: \"#f0eee4\", numerals: \"none\", hour: 12, minute: 23, second: 52\n });\n clockFace(453, 238, 39, {\n rim: \"black\", face: \"#eceadc\", numerals: \"arabic\", hour: 4, minute: 39, second: 15\n });\n\n clockFace(257, 226, 70, {\n rim: \"brass\", face: \"#efe5cf\", numerals: \"roman\", hour: 10, minute: 8, second: 36, label: \"WESTMINSTER\"\n });\n\n clockFace(139, 264, 29, {\n rim: \"black\", face: \"#f3eee1\", numerals: \"arabic\", hour: 1, minute: 33, second: 20\n });\n digital(335, 231, 72, 39);\n\n // Foreground lower gallery.\n ovalClock(78, 342, 47, 61);\n clockFace(169, 350, 34, {\n rim: \"silver\", face: \"#f5f3eb\", numerals: \"none\", hour: 9, minute: 13, second: 57\n });\n pendulumClock(221, 322, 70, 163);\n cuckoo(368, 302, 75, 129);\n\n clockFace(116, 444, 34, {\n rim: \"red\", face: \"#eddfcb\", numerals: \"arabic\", hour: 2, minute: 52, second: 6\n });\n clockFace(334, 442, 31, {\n rim: \"brass\", face: \"#222522\", numerals: \"none\", hour: 7, minute: 19, second: 40\n });\n clockFace(474, 440, 25, {\n rim: \"silver\", face: \"#f3f1e8\", numerals: \"none\", hour: 5, minute: 44, second: 25\n });\n\n // Tiny hanging nails visible above a few frames.\n const nails = [[169, 34], [337, 33], [139, 229], [334, 405], [473, 408]];\n nails.forEach(([x, y]) => {\n ctx.strokeStyle = \"rgba(56,45,35,.48)\";\n ctx.lineWidth = .7;\n ctx.beginPath();\n ctx.moveTo(x, y + 3);\n ctx.lineTo(x, y + 10);\n ctx.stroke();\n ctx.fillStyle = \"#766c61\";\n ctx.beginPath();\n ctx.arc(x, y + 2, 1.4, 0, Math.PI * 2);\n ctx.fill();\n });\n\n // Subtle room-light glaze and vignette.\n const light = ctx.createRadialGradient(118, 64, 10, 180, 170, 480);\n light.addColorStop(0, \"rgba(255,247,220,.17)\");\n light.addColorStop(.55, \"rgba(255,255,255,0)\");\n light.addColorStop(1, \"rgba(41,29,20,.19)\");\n ctx.fillStyle = light;\n ctx.fillRect(0, 0, 512, 512);\n}"}], "metadata": {"id": "val-v1-coco-train2017-000000231320-177887", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 7572, "code_sha256": "1f001d28e59102b456da5daa82cefc7ecf034195986cf8b6eedc80d78c443c58"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A stop sign that is not at the top of the pole."}, {"role": "assistant", "content": "async function render(stage) {\n const canvas = document.createElement(\"canvas\");\n const dpr = Math.max(2, window.devicePixelRatio || 1);\n canvas.width = 512 * dpr;\n canvas.height = 512 * dpr;\n canvas.style.width = \"512px\";\n canvas.style.height = \"512px\";\n canvas.style.display = \"block\";\n stage.style.position = \"relative\";\n stage.style.overflow = \"hidden\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(dpr, dpr);\n\n let seed = 18473;\n const random = () => {\n seed = (seed * 1664525 + 1013904223) >>> 0;\n return seed / 4294967296;\n };\n\n const polygon = (cx, cy, radius, rotation = Math.PI / 8) => {\n ctx.beginPath();\n for (let i = 0; i < 8; i++) {\n const a = rotation + i * Math.PI / 4;\n const x = cx + Math.cos(a) * radius;\n const y = cy + Math.sin(a) * radius;\n i ? ctx.lineTo(x, y) : ctx.moveTo(x, y);\n }\n ctx.closePath();\n };\n\n // Sky\n const sky = ctx.createLinearGradient(0, 0, 0, 330);\n sky.addColorStop(0, \"#87b9dc\");\n sky.addColorStop(0.55, \"#c7deeb\");\n sky.addColorStop(1, \"#e9e5d5\");\n ctx.fillStyle = sky;\n ctx.fillRect(0, 0, 512, 512);\n\n // Soft clouds\n ctx.save();\n ctx.globalAlpha = 0.28;\n ctx.filter = \"blur(9px)\";\n for (let i = 0; i < 18; i++) {\n const x = random() * 560 - 25;\n const y = 28 + random() * 175;\n const rx = 24 + random() * 58;\n const ry = 7 + random() * 16;\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n ctx.fillStyle = random() > 0.25 ? \"#ffffff\" : \"#d7e3e8\";\n ctx.fill();\n }\n ctx.restore();\n\n // Distant tree line\n ctx.save();\n ctx.filter = \"blur(2px)\";\n const treeBase = ctx.createLinearGradient(0, 218, 0, 372);\n treeBase.addColorStop(0, \"#526f4d\");\n treeBase.addColorStop(1, \"#233c2b\");\n ctx.fillStyle = treeBase;\n ctx.beginPath();\n ctx.moveTo(0, 350);\n ctx.lineTo(0, 268);\n for (let x = 0; x <= 512; x += 7) {\n const y = 250 - random() * 62 - Math.sin(x * 0.035) * 13;\n ctx.lineTo(x, y);\n }\n ctx.lineTo(512, 350);\n ctx.closePath();\n ctx.fill();\n\n for (let i = 0; i < 120; i++) {\n const x = random() * 512;\n const y = 237 + random() * 104;\n const r = 7 + random() * 25;\n ctx.fillStyle = `rgba(${28 + random() * 40},${61 + random() * 49},${29 + random() * 34},${0.18 + random() * 0.28})`;\n ctx.beginPath();\n ctx.arc(x, y, r, 0, Math.PI * 2);\n ctx.fill();\n }\n ctx.restore();\n\n // Distant houses\n ctx.save();\n ctx.globalAlpha = 0.72;\n ctx.fillStyle = \"#d2c8b5\";\n ctx.fillRect(28, 302, 116, 54);\n ctx.fillStyle = \"#745e50\";\n ctx.beginPath();\n ctx.moveTo(15, 306);\n ctx.lineTo(84, 266);\n ctx.lineTo(153, 306);\n ctx.closePath();\n ctx.fill();\n ctx.fillStyle = \"#718498\";\n ctx.fillRect(46, 316, 25, 26);\n ctx.fillRect(103, 316, 24, 26);\n\n ctx.fillStyle = \"#c5bca8\";\n ctx.fillRect(395, 294, 106, 62);\n ctx.fillStyle = \"#68594c\";\n ctx.beginPath();\n ctx.moveTo(382, 299);\n ctx.lineTo(446, 263);\n ctx.lineTo(511, 299);\n ctx.closePath();\n ctx.fill();\n ctx.fillStyle = \"#70808a\";\n ctx.fillRect(411, 310, 27, 29);\n ctx.fillRect(464, 310, 24, 29);\n ctx.restore();\n\n // Verge and road\n const grass = ctx.createLinearGradient(0, 340, 0, 512);\n grass.addColorStop(0, \"#668353\");\n grass.addColorStop(0.65, \"#779052\");\n grass.addColorStop(1, \"#667742\");\n ctx.fillStyle = grass;\n ctx.fillRect(0, 344, 512, 168);\n\n ctx.fillStyle = \"#8c8e89\";\n ctx.beginPath();\n ctx.moveTo(0, 402);\n ctx.lineTo(512, 367);\n ctx.lineTo(512, 512);\n ctx.lineTo(0, 512);\n ctx.closePath();\n ctx.fill();\n\n const roadShade = ctx.createLinearGradient(0, 391, 0, 512);\n roadShade.addColorStop(0, \"rgba(255,255,255,.10)\");\n roadShade.addColorStop(1, \"rgba(30,34,35,.18)\");\n ctx.fillStyle = roadShade;\n ctx.fillRect(0, 385, 512, 127);\n\n ctx.strokeStyle = \"rgba(238,224,170,.7)\";\n ctx.lineWidth = 3;\n ctx.beginPath();\n ctx.moveTo(0, 425);\n ctx.lineTo(512, 389);\n ctx.stroke();\n\n // Road and grass texture\n for (let i = 0; i < 900; i++) {\n const x = random() * 512;\n const y = 345 + random() * 167;\n if (y > 399 - x * 0.068) {\n const v = random() > 0.5 ? 255 : 25;\n ctx.fillStyle = `rgba(${v},${v},${v},${0.015 + random() * 0.035})`;\n ctx.fillRect(x, y, 0.6 + random() * 1.2, 0.6 + random() * 1.2);\n } else {\n ctx.strokeStyle = `rgba(${45 + random() * 55},${70 + random() * 55},${28 + random() * 28},.28)`;\n ctx.lineWidth = 0.5;\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.lineTo(x - 1 + random() * 2, y - 2 - random() * 5);\n ctx.stroke();\n }\n }\n\n // Pole ground shadow\n ctx.save();\n ctx.filter = \"blur(7px)\";\n ctx.fillStyle = \"rgba(23,28,24,.28)\";\n ctx.beginPath();\n ctx.ellipse(283, 486, 49, 9, -0.08, 0, Math.PI * 2);\n ctx.fill();\n ctx.restore();\n\n // Long galvanized pole, intentionally extending far above the sign\n ctx.save();\n ctx.shadowColor = \"rgba(0,0,0,.24)\";\n ctx.shadowBlur = 5;\n ctx.shadowOffsetX = 3;\n ctx.shadowOffsetY = 3;\n const pole = ctx.createLinearGradient(267, 0, 289, 0);\n pole.addColorStop(0, \"#70797b\");\n pole.addColorStop(0.14, \"#b9c0bd\");\n pole.addColorStop(0.38, \"#e1e2dc\");\n pole.addColorStop(0.62, \"#9ca5a3\");\n pole.addColorStop(0.83, \"#d1d4cf\");\n pole.addColorStop(1, \"#60696b\");\n ctx.fillStyle = pole;\n ctx.beginPath();\n ctx.moveTo(269, 26);\n ctx.lineTo(287, 26);\n ctx.lineTo(285, 500);\n ctx.lineTo(270, 500);\n ctx.closePath();\n ctx.fill();\n ctx.restore();\n\n // Pole top cap\n ctx.fillStyle = \"#747d7e\";\n ctx.beginPath();\n ctx.roundRect(268, 22, 20, 7, 2);\n ctx.fill();\n ctx.strokeStyle = \"rgba(255,255,255,.55)\";\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.moveTo(270, 24);\n ctx.lineTo(286, 24);\n ctx.stroke();\n\n // Perforations visible above and below sign\n for (let y = 40; y < 492; y += 18) {\n if (y > 151 && y < 331) continue;\n ctx.fillStyle = \"rgba(43,49,49,.72)\";\n ctx.beginPath();\n ctx.ellipse(278, y, 2.4, 3.5, 0, 0, Math.PI * 2);\n ctx.fill();\n ctx.fillStyle = \"rgba(255,255,255,.25)\";\n ctx.beginPath();\n ctx.arc(277.2, y - 1.1, 0.75, 0, Math.PI * 2);\n ctx.fill();\n }\n\n // Sign shadow\n ctx.save();\n ctx.translate(278, 244);\n ctx.rotate(-0.012);\n ctx.shadowColor = \"rgba(0,0,0,.38)\";\n ctx.shadowBlur = 10;\n ctx.shadowOffsetX = 6;\n ctx.shadowOffsetY = 8;\n polygon(0, 0, 91);\n ctx.fillStyle = \"#585b58\";\n ctx.fill();\n ctx.restore();\n\n // Sign assembly\n ctx.save();\n ctx.translate(278, 244);\n ctx.rotate(-0.012);\n\n polygon(0, 0, 90);\n const rim = ctx.createLinearGradient(-90, -80, 90, 80);\n rim.addColorStop(0, \"#dadbd6\");\n rim.addColorStop(0.35, \"#929997\");\n rim.addColorStop(0.62, \"#ecece5\");\n rim.addColorStop(1, \"#6c7372\");\n ctx.fillStyle = rim;\n ctx.fill();\n\n polygon(0, 0, 87);\n const red = ctx.createRadialGradient(-23, -30, 8, 0, 0, 112);\n red.addColorStop(0, \"#e22328\");\n red.addColorStop(0.58, \"#c90f18\");\n red.addColorStop(1, \"#a80811\");\n ctx.fillStyle = red;\n ctx.fill();\n\n polygon(0, 0, 78);\n ctx.strokeStyle = \"#f5f2e8\";\n ctx.lineWidth = 5.5;\n ctx.lineJoin = \"miter\";\n ctx.stroke();\n\n // Subtle reflective sheen\n ctx.save();\n polygon(0, 0, 84);\n ctx.clip();\n const shine = ctx.createLinearGradient(-75, -75, 60, 65);\n shine.addColorStop(0, \"rgba(255,255,255,.16)\");\n shine.addColorStop(0.34, \"rgba(255,255,255,.025)\");\n shine.addColorStop(0.65, \"rgba(0,0,0,.035)\");\n shine.addColorStop(1, \"rgba(255,255,255,.06)\");\n ctx.fillStyle = shine;\n ctx.fillRect(-100, -100, 200, 200);\n\n for (let i = 0; i < 190; i++) {\n const x = random() * 156 - 78;\n const y = random() * 156 - 78;\n if (Math.abs(x) + Math.abs(y) * 0.43 < 96) {\n ctx.fillStyle = random() > 0.4\n ? `rgba(255,255,255,${0.015 + random() * 0.05})`\n : `rgba(68,0,0,${0.018 + random() * 0.04})`;\n ctx.fillRect(x, y, 0.5 + random() * 1.1, 0.5 + random() * 1.1);\n }\n }\n ctx.restore();\n\n // STOP lettering\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.font = \"900 54px Arial Black, Arial, sans-serif\";\n ctx.lineWidth = 1;\n ctx.strokeStyle = \"rgba(110,0,0,.15)\";\n ctx.strokeText(\"STOP\", 1, 3);\n ctx.fillStyle = \"#fffdf5\";\n ctx.fillText(\"STOP\", 0, 1);\n\n // Mounting bolts\n const bolts = [[0, -67], [0, 67]];\n for (const [x, y] of bolts) {\n const b = ctx.createRadialGradient(x - 1.2, y - 1.4, 0, x, y, 4.3);\n b.addColorStop(0, \"#f4f5ef\");\n b.addColorStop(0.45, \"#aab0ac\");\n b.addColorStop(1, \"#4e5555\");\n ctx.fillStyle = b;\n ctx.beginPath();\n ctx.arc(x, y, 4.1, 0, Math.PI * 2);\n ctx.fill();\n ctx.strokeStyle = \"rgba(45,48,47,.65)\";\n ctx.lineWidth = 0.8;\n ctx.beginPath();\n ctx.moveTo(x - 2.2, y);\n ctx.lineTo(x + 2.2, y);\n ctx.stroke();\n }\n ctx.restore();\n\n // Foreground grass around pole base\n for (let i = 0; i < 55; i++) {\n const x = 254 + random() * 48;\n const y = 483 + random() * 22;\n ctx.strokeStyle = `rgba(${38 + random() * 45},${62 + random() * 48},${25 + random() * 25},${0.35 + random() * 0.4})`;\n ctx.lineWidth = 0.7 + random();\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.quadraticCurveTo(x + random() * 5 - 2.5, y - 8, x + random() * 7 - 3.5, y - 12 - random() * 10);\n ctx.stroke();\n }\n\n // Gentle photographic vignette\n const vignette = ctx.createRadialGradient(256, 242, 170, 256, 256, 390);\n vignette.addColorStop(0, \"rgba(0,0,0,0)\");\n vignette.addColorStop(0.74, \"rgba(0,0,0,.015)\");\n vignette.addColorStop(1, \"rgba(17,25,25,.19)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0, 0, 512, 512);\n}"}], "metadata": {"id": "val-v1-coco-train2017-000000367754-47757", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 4318, "code_sha256": "f2656b0cfb8e08f39c8a7492eb299127dba21c534dc73510f8b90c9cfa61045b"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A bed has a blue cover and is near a stone wall."}, {"role": "assistant", "content": "async function render(stage) {\n stage.replaceChildren();\n Object.assign(stage.style, {\n position: \"relative\",\n overflow: \"hidden\",\n background: \"#171b1d\"\n });\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = 1024;\n canvas.height = 1024;\n Object.assign(canvas.style, {\n width: \"100%\",\n height: \"100%\",\n display: \"block\"\n });\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n const W = canvas.width, H = canvas.height;\n\n let seed = 184729;\n const rnd = () => {\n seed = (seed * 1664525 + 1013904223) >>> 0;\n return seed / 4294967296;\n };\n const path = (pts, close = true) => {\n ctx.beginPath();\n ctx.moveTo(pts[0][0], pts[0][1]);\n for (let i = 1; i < pts.length; i++) ctx.lineTo(pts[i][0], pts[i][1]);\n if (close) ctx.closePath();\n };\n const fillPoly = (pts, fill, stroke, width = 1) => {\n path(pts);\n ctx.fillStyle = fill;\n ctx.fill();\n if (stroke) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = width;\n ctx.stroke();\n }\n };\n const ellipse = (x, y, rx, ry, fill) => {\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n ctx.fillStyle = fill;\n ctx.fill();\n };\n\n // Stone wall foundation\n const wallGrad = ctx.createLinearGradient(0, 0, 0, 720);\n wallGrad.addColorStop(0, \"#6e706b\");\n wallGrad.addColorStop(0.45, \"#777771\");\n wallGrad.addColorStop(1, \"#555956\");\n ctx.fillStyle = wallGrad;\n ctx.fillRect(0, 0, W, 710);\n\n // Irregular masonry\n const rowHeights = [105, 112, 96, 116, 105, 112, 95];\n let yy = -20;\n for (let row = 0; yy < 710; row++) {\n const rh = rowHeights[row % rowHeights.length];\n let x = row % 2 ? -85 : -20;\n while (x < W) {\n const sw = 125 + rnd() * 125;\n const inset = 5;\n const top = yy + inset + rnd() * 4;\n const bottom = yy + rh - inset - rnd() * 4;\n const pts = [\n [x + inset + rnd() * 8, top + rnd() * 5],\n [x + sw - inset - rnd() * 7, top],\n [x + sw - rnd() * 4, bottom - rnd() * 6],\n [x + 10 + rnd() * 6, bottom]\n ];\n\n const base = 92 + Math.floor(rnd() * 42);\n const warm = rnd() > 0.72;\n const grad = ctx.createLinearGradient(x, top, x + sw, bottom);\n if (warm) {\n grad.addColorStop(0, `rgb(${base + 16},${base + 10},${base})`);\n grad.addColorStop(0.55, `rgb(${base + 4},${base + 1},${base - 5})`);\n grad.addColorStop(1, `rgb(${base - 12},${base - 12},${base - 15})`);\n } else {\n grad.addColorStop(0, `rgb(${base + 10},${base + 12},${base + 10})`);\n grad.addColorStop(0.6, `rgb(${base},${base + 1},${base - 1})`);\n grad.addColorStop(1, `rgb(${base - 14},${base - 12},${base - 13})`);\n }\n\n ctx.save();\n path(pts);\n ctx.shadowColor = \"rgba(12,16,16,.55)\";\n ctx.shadowBlur = 3;\n ctx.shadowOffsetY = 4;\n ctx.fillStyle = grad;\n ctx.fill();\n ctx.restore();\n\n path(pts);\n ctx.strokeStyle = \"rgba(31,34,33,.6)\";\n ctx.lineWidth = 4;\n ctx.stroke();\n\n ctx.save();\n path(pts);\n ctx.clip();\n for (let i = 0; i < 14; i++) {\n const px = x + rnd() * sw;\n const py = top + rnd() * (bottom - top);\n const r = 1 + rnd() * 7;\n ellipse(px, py, r, r * 0.45, rnd() > 0.5\n ? `rgba(255,255,245,${0.025 + rnd() * 0.05})`\n : `rgba(20,24,23,${0.03 + rnd() * 0.07})`);\n }\n // Fine stone fissures\n if (rnd() > 0.55) {\n ctx.beginPath();\n let cx = x + sw * (0.25 + rnd() * 0.5);\n let cy = top + rnd() * 20;\n ctx.moveTo(cx, cy);\n for (let n = 0; n < 3; n++) {\n cx += (rnd() - 0.5) * 28;\n cy += 10 + rnd() * 18;\n ctx.lineTo(cx, cy);\n }\n ctx.strokeStyle = \"rgba(30,32,31,.19)\";\n ctx.lineWidth = 1.5;\n ctx.stroke();\n }\n ctx.restore();\n x += sw - 2;\n }\n yy += rh - 2;\n }\n\n // Soft light falling across wall\n const wallLight = ctx.createRadialGradient(220, 95, 20, 230, 150, 640);\n wallLight.addColorStop(0, \"rgba(255,244,214,.26)\");\n wallLight.addColorStop(0.55, \"rgba(255,238,203,.08)\");\n wallLight.addColorStop(1, \"rgba(0,0,0,0)\");\n ctx.fillStyle = wallLight;\n ctx.fillRect(0, 0, W, 720);\n\n // Wall/floor seam and floor\n const floorGrad = ctx.createLinearGradient(0, 650, 0, H);\n floorGrad.addColorStop(0, \"#3d3933\");\n floorGrad.addColorStop(1, \"#211f1d\");\n ctx.fillStyle = floorGrad;\n ctx.fillRect(0, 690, W, 334);\n\n ctx.fillStyle = \"rgba(11,12,12,.45)\";\n ctx.fillRect(0, 686, W, 13);\n ctx.fillStyle = \"rgba(179,157,125,.12)\";\n ctx.fillRect(0, 699, W, 3);\n\n // Wooden floorboards in perspective\n ctx.save();\n ctx.strokeStyle = \"rgba(7,8,8,.34)\";\n ctx.lineWidth = 3;\n const vanishX = 515, vanishY = 690;\n [-650, -400, -180, 40, 245, 445, 645, 845, 1060, 1280, 1510].forEach(x => {\n ctx.beginPath();\n ctx.moveTo(vanishX + (x - vanishX) * 0.04, vanishY);\n ctx.lineTo(x, H);\n ctx.stroke();\n });\n for (let y = 746; y < H; y += 67) {\n ctx.beginPath();\n ctx.moveTo(0, y);\n ctx.lineTo(W, y + (y - 690) * 0.025);\n ctx.stroke();\n }\n for (let i = 0; i < 80; i++) {\n ctx.beginPath();\n const x = rnd() * W, y = 700 + rnd() * 324;\n ctx.moveTo(x, y);\n ctx.lineTo(x + 30 + rnd() * 100, y + (rnd() - .5) * 4);\n ctx.strokeStyle = `rgba(186,159,118,${.018 + rnd() * .035})`;\n ctx.lineWidth = 1;\n ctx.stroke();\n }\n ctx.restore();\n\n // Bed cast shadow\n ctx.save();\n ctx.filter = \"blur(24px)\";\n fillPoly([\n [115, 625], [650, 550], [1000, 792], [930, 930], [250, 940], [75, 790]\n ], \"rgba(0,0,0,.62)\");\n ctx.restore();\n\n // Headboard\n ctx.save();\n ctx.shadowColor = \"rgba(0,0,0,.55)\";\n ctx.shadowBlur = 16;\n ctx.shadowOffsetX = 8;\n ctx.shadowOffsetY = 8;\n const headGrad = ctx.createLinearGradient(110, 355, 645, 635);\n headGrad.addColorStop(0, \"#302b27\");\n headGrad.addColorStop(.45, \"#201e1c\");\n headGrad.addColorStop(1, \"#121313\");\n fillPoly([[110, 380], [585, 329], [647, 635], [147, 702]], headGrad, \"#151515\", 6);\n ctx.restore();\n\n // Headboard panels\n for (let i = 0; i < 5; i++) {\n const ax = 133 + i * 93;\n ctx.beginPath();\n ctx.moveTo(ax, 403 - i * 10);\n ctx.lineTo(ax + 77, 395 - i * 10);\n ctx.lineTo(ax + 95, 620 - i * 3);\n ctx.lineTo(ax + 11, 632 - i * 3);\n ctx.closePath();\n const pg = ctx.createLinearGradient(ax, 400, ax + 90, 630);\n pg.addColorStop(0, \"#3b3530\");\n pg.addColorStop(.55, \"#282421\");\n pg.addColorStop(1, \"#171716\");\n ctx.fillStyle = pg;\n ctx.fill();\n ctx.strokeStyle = \"rgba(5,5,5,.48)\";\n ctx.lineWidth = 4;\n ctx.stroke();\n ctx.beginPath();\n ctx.moveTo(ax + 8, 412 - i * 10);\n ctx.lineTo(ax + 72, 405 - i * 10);\n ctx.strokeStyle = \"rgba(255,234,200,.08)\";\n ctx.lineWidth = 2;\n ctx.stroke();\n }\n\n // Bed frame under mattress\n const frameGrad = ctx.createLinearGradient(0, 690, 0, 915);\n frameGrad.addColorStop(0, \"#372f29\");\n frameGrad.addColorStop(.25, \"#29231f\");\n frameGrad.addColorStop(1, \"#151514\");\n fillPoly([[145, 645], [623, 573], [947, 760], [950, 844], [281, 948], [145, 773]],\n frameGrad, \"#141313\", 5);\n\n // Side rail highlight\n fillPoly([[278, 834], [949, 747], [950, 792], [283, 894]],\n \"#241f1c\", \"rgba(7,7,7,.6)\", 3);\n ctx.beginPath();\n ctx.moveTo(286, 842);\n ctx.lineTo(940, 759);\n ctx.strokeStyle = \"rgba(225,190,146,.13)\";\n ctx.lineWidth = 3;\n ctx.stroke();\n\n // Legs\n fillPoly([[194, 814], [245, 819], [241, 954], [204, 969]], \"#171615\");\n fillPoly([[884, 806], [929, 798], [922, 913], [890, 920]], \"#111212\");\n\n // Mattress base\n ctx.save();\n ctx.shadowColor = \"rgba(0,0,0,.36)\";\n ctx.shadowBlur = 11;\n ctx.shadowOffsetY = 10;\n const mattressSide = ctx.createLinearGradient(0, 660, 0, 820);\n mattressSide.addColorStop(0, \"#d8d5ca\");\n mattressSide.addColorStop(.45, \"#aaa99f\");\n mattressSide.addColorStop(1, \"#74766f\");\n fillPoly([[145, 579], [605, 515], [943, 701], [930, 773], [277, 865], [145, 704]],\n mattressSide, \"#676963\", 3);\n ctx.restore();\n\n // Mattress seam\n ctx.beginPath();\n ctx.moveTo(277, 838);\n ctx.lineTo(929, 748);\n ctx.strokeStyle = \"rgba(66,67,63,.55)\";\n ctx.lineWidth = 4;\n ctx.stroke();\n ctx.beginPath();\n ctx.moveTo(286, 829);\n ctx.lineTo(924, 741);\n ctx.strokeStyle = \"rgba(255,255,244,.45)\";\n ctx.lineWidth = 2;\n ctx.stroke();\n\n // Lower white sheet peeking out\n const sheetGrad = ctx.createLinearGradient(0, 570, 0, 800);\n sheetGrad.addColorStop(0, \"#f1f0e8\");\n sheetGrad.addColorStop(1, \"#bfc3be\");\n ctx.beginPath();\n ctx.moveTo(154, 569);\n ctx.bezierCurveTo(300, 536, 476, 521, 614, 511);\n ctx.lineTo(937, 691);\n ctx.bezierCurveTo(785, 709, 608, 728, 455, 752);\n ctx.bezierCurveTo(340, 771, 264, 790, 180, 757);\n ctx.closePath();\n ctx.fillStyle = sheetGrad;\n ctx.fill();\n\n // Main blue duvet\n ctx.save();\n ctx.shadowColor = \"rgba(5,15,24,.42)\";\n ctx.shadowBlur = 14;\n ctx.shadowOffsetY = 8;\n const duvet = ctx.createLinearGradient(130, 480, 870, 870);\n duvet.addColorStop(0, \"#376e99\");\n duvet.addColorStop(.25, \"#245b86\");\n duvet.addColorStop(.57, \"#17496f\");\n duvet.addColorStop(.82, \"#113b5c\");\n duvet.addColorStop(1, \"#092a43\");\n ctx.beginPath();\n ctx.moveTo(165, 553);\n ctx.bezierCurveTo(270, 518, 405, 496, 537, 495);\n ctx.bezierCurveTo(574, 496, 604, 503, 631, 519);\n ctx.bezierCurveTo(726, 570, 817, 627, 918, 683);\n ctx.bezierCurveTo(942, 696, 948, 718, 934, 741);\n ctx.bezierCurveTo(894, 784, 876, 823, 858, 873);\n ctx.bezierCurveTo(799, 868, 734, 873, 669, 884);\n ctx.bezierCurveTo(545, 904, 424, 929, 294, 921);\n ctx.bezierCurveTo(259, 918, 235, 903, 229, 880);\n ctx.bezierCurveTo(219, 840, 214, 801, 191, 758);\n ctx.bezierCurveTo(169, 715, 137, 680, 137, 630);\n ctx.bezierCurveTo(138, 594, 144, 569, 165, 553);\n ctx.closePath();\n ctx.fillStyle = duvet;\n ctx.fill();\n ctx.restore();\n\n // Fold shadows and highlights\n const folds = [\n { p: [198, 566, 270, 646, 249, 777, 294, 910], dark: .28, w: 32 },\n { p: [304, 531, 365, 620, 354, 763, 393, 909], dark: .24, w: 40 },\n { p: [436, 511, 472, 619, 472, 752, 505, 891], dark: .28, w: 38 },\n { p: [559, 512, 583, 614, 600, 748, 622, 888], dark: .25, w: 44 },\n { p: [650, 544, 693, 641, 723, 752, 743, 868], dark: .32, w: 42 },\n { p: [750, 598, 792, 663, 839, 739, 847, 844], dark: .25, w: 34 }\n ];\n for (const f of folds) {\n ctx.beginPath();\n ctx.moveTo(f.p[0], f.p[1]);\n ctx.bezierCurveTo(...f.p.slice(2));\n ctx.strokeStyle = `rgba(4,24,40,${f.dark})`;\n ctx.lineWidth = f.w;\n ctx.lineCap = \"round\";\n ctx.stroke();\n\n ctx.beginPath();\n ctx.moveTo(f.p[0] - 8, f.p[1] - 4);\n ctx.bezierCurveTo(\n f.p[2] - 10, f.p[3] - 8,\n f.p[4] - 11, f.p[5] - 8,\n f.p[6] - 13, f.p[7] - 7\n );\n ctx.strokeStyle = \"rgba(134,196,228,.12)\";\n ctx.lineWidth = Math.max(5, f.w * .22);\n ctx.stroke();\n }\n\n // Horizontal rumples\n for (let i = 0; i < 9; i++) {\n const y = 630 + i * 29;\n const x = 245 + rnd() * 300;\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.bezierCurveTo(x + 35, y - 10, x + 75, y + 14, x + 125 + rnd() * 80, y - 3);\n ctx.strokeStyle = `rgba(136,197,228,${.055 + rnd() * .055})`;\n ctx.lineWidth = 3 + rnd() * 4;\n ctx.lineCap = \"round\";\n ctx.stroke();\n }\n\n // Folded top edge of duvet\n const cuff = ctx.createLinearGradient(0, 475, 0, 610);\n cuff.addColorStop(0, \"#4b82a9\");\n cuff.addColorStop(.48, \"#316c98\");\n cuff.addColorStop(1, \"#184b72\");\n ctx.beginPath();\n ctx.moveTo(158, 542);\n ctx.bezierCurveTo(289, 510, 431, 487, 545, 490);\n ctx.bezierCurveTo(589, 491, 616, 506, 650, 529);\n ctx.lineTo(619, 590);\n ctx.bezierCurveTo(558, 555, 481, 551, 399, 562);\n ctx.bezierCurveTo(306, 574, 238, 596, 170, 607);\n ctx.bezierCurveTo(147, 588, 145, 562, 158, 542);\n ctx.closePath();\n ctx.fillStyle = cuff;\n ctx.fill();\n ctx.strokeStyle = \"rgba(7,37,57,.42)\";\n ctx.lineWidth = 3;\n ctx.stroke();\n\n // Pillows\n function pillow(points, c1, c2) {\n ctx.save();\n ctx.shadowColor = \"rgba(3,16,25,.55)\";\n ctx.shadowBlur = 15;\n ctx.shadowOffsetY = 9;\n const g = ctx.createLinearGradient(points[0][0], points[0][1], points[2][0], points[2][1]);\n g.addColorStop(0, c1);\n g.addColorStop(.55, c2);\n g.addColorStop(1, \"#173f5d\");\n ctx.beginPath();\n ctx.moveTo(...points[0]);\n ctx.bezierCurveTo(...points[1], ...points[2], ...points[3]);\n ctx.bezierCurveTo(...points[4], ...points[5], ...points[6]);\n ctx.bezierCurveTo(...points[7], ...points[8], ...points[9]);\n ctx.bezierCurveTo(...points[10], ...points[11], ...points[0]);\n ctx.closePath();\n ctx.fillStyle = g;\n ctx.fill();\n ctx.restore();\n ctx.strokeStyle = \"rgba(165,208,227,.18)\";\n ctx.lineWidth = 3;\n ctx.stroke();\n }\n\n pillow([\n [173, 482],\n [183, 443], [215, 416], [267, 411],\n [326, 406], [374, 430], [385, 477],\n [388, 508], [355, 534], [285, 543],\n [221, 551], [176, 529]\n ], \"#5b8eac\", \"#316b91\");\n\n pillow([\n [359, 443],\n [377, 403], [417, 380], [478, 380],\n [536, 378], [582, 405], [595, 449],\n [603, 481], [569, 511], [499, 519],\n [429, 526], [373, 499]\n ], \"#4f84a6\", \"#285e85\");\n\n // Pillow creases\n ctx.strokeStyle = \"rgba(9,43,64,.3)\";\n ctx.lineWidth = 7;\n ctx.lineCap = \"round\";\n [[210,474,277,454,352,480], [402,449,476,424,568,459]].forEach(a => {\n ctx.beginPath();\n ctx.moveTo(a[0], a[1]);\n ctx.quadraticCurveTo(a[2], a[3], a[4], a[5]);\n ctx.stroke();\n });\n\n // Duvet front edge stitching\n ctx.beginPath();\n ctx.moveTo(294, 903);\n ctx.bezierCurveTo(450, 911, 656, 855, 847, 854);\n ctx.strokeStyle = \"rgba(116,180,214,.23)\";\n ctx.lineWidth = 3;\n ctx.setLineDash([10, 8]);\n ctx.stroke();\n ctx.setLineDash([]);\n\n // Ambient occlusion near wall and vignette\n const bottomShade = ctx.createLinearGradient(0, 650, 0, 1024);\n bottomShade.addColorStop(0, \"rgba(0,0,0,0)\");\n bottomShade.addColorStop(1, \"rgba(0,0,0,.20)\");\n ctx.fillStyle = bottomShade;\n ctx.fillRect(0, 600, W, 424);\n\n const vignette = ctx.createRadialGradient(485, 440, 260, 512, 500, 750);\n vignette.addColorStop(0, \"rgba(0,0,0,0)\");\n vignette.addColorStop(.72, \"rgba(0,0,0,.06)\");\n vignette.addColorStop(1, \"rgba(0,0,0,.47)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0, 0, W, H);\n\n // Fine photographic grain\n const grain = document.createElement(\"canvas\");\n grain.width = 256;\n grain.height = 256;\n const gctx = grain.getContext(\"2d\");\n const img = gctx.createImageData(256, 256);\n for (let i = 0; i < img.data.length; i += 4) {\n const v = Math.floor(rnd() * 256);\n img.data[i] = v;\n img.data[i + 1] = v;\n img.data[i + 2] = v;\n img.data[i + 3] = 12;\n }\n gctx.putImageData(img, 0, 0);\n ctx.save();\n ctx.globalCompositeOperation = \"soft-light\";\n ctx.globalAlpha = .25;\n ctx.fillStyle = ctx.createPattern(grain, \"repeat\");\n ctx.fillRect(0, 0, W, H);\n ctx.restore();\n}"}], "metadata": {"id": "val-v1-coco-train2017-000000526675-272821", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 7118, "code_sha256": "a4e8f38f5c255ab07326f4283864a120a03a9f1fcb9650bb7ae2660b3271d2b1"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "four navy deer to the left of six yellow hawks"}, {"role": "assistant", "content": "async function render(stage) {\n stage.replaceChildren();\n Object.assign(stage.style, {\n width: \"512px\",\n height: \"512px\",\n position: \"relative\",\n overflow: \"hidden\",\n background: \"#faf8f0\"\n });\n\n const svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 512 512\");\n svg.setAttribute(\"width\", \"512\");\n svg.setAttribute(\"height\", \"512\");\n svg.setAttribute(\"role\", \"img\");\n svg.setAttribute(\"aria-label\", \"Four navy deer to the left of six yellow hawks\");\n\n svg.innerHTML = `\n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n\n \n \n\n \n \n \n\n \n \n \n \n\n \n \n \n\n \n \n \n\n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n\n \n \n\n \n \n\n \n \n\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n\n \n \n\n \n \n `;\n\n stage.appendChild(svg);\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-0010", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 3627, "code_sha256": "e6b65847667a323a5e4565b2661a52d4cf822262a8182d63010f42b33a66b77b"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "three pink chairs and three gray horses"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n\n \n \n \n\n \n \n \n\n \n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n `;\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-0276", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 4167, "code_sha256": "a640a2a98d93a8e2ad9847e5461d99f3f63ce3a8164a4aaeafda540f1b1727f6"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "six red flamingos to the right of seven white sheep"}, {"role": "assistant", "content": "async function render(stage) {\n stage.replaceChildren();\n Object.assign(stage.style, {\n position: \"relative\",\n overflow: \"hidden\",\n background: \"#dbe8e9\"\n });\n\n const sheep = (x, y, s, dir = 1) => `\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n `;\n\n const flamingo = (x, y, s, dir = 1, hue = \"#d9273f\") => {\n const neckEndX = 22 * dir;\n const beakTip = 43 * dir;\n return `\n \n \n \n \n \n \n\n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n `;\n };\n\n const svg = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n\n \n \n\n \n \n \n \n \n \n \n\n \n \n\n \n \n \n \n \n \n \n \n\n \n ${sheep(47, 246, .64, 1)}\n ${sheep(112, 230, .67, -1)}\n ${sheep(183, 248, .63, 1)}\n ${sheep(45, 323, .82, 1)}\n ${sheep(122, 307, .84, -1)}\n ${sheep(201, 337, .79, 1)}\n ${sheep(248, 282, .67, -1)}\n\n \n ${flamingo(326, 259, .70, 1, \"#d82842\")}\n ${flamingo(394, 254, .68, -1, \"#c9223d\")}\n ${flamingo(468, 273, .63, -1, \"#d42c43\")}\n ${flamingo(337, 367, .88, 1, \"#dc263f\")}\n ${flamingo(414, 359, .81, -1, \"#ce1f39\")}\n ${flamingo(476, 389, .70, -1, \"#d92a43\")}\n\n \n \n \n\n \n \n `;\n\n stage.innerHTML = svg;\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-0729", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 4662, "code_sha256": "de9ec83b71ef7f10561dc085dbc045e308b84f473ae982e8d68f22031dbb7a77"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "two sheep in front of a checkered swan"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n Object.assign(stage.style, {\n width: \"512px\",\n height: \"512px\",\n overflow: \"hidden\",\n position: \"relative\",\n background: \"#b8c8cf\"\n });\n\n const NS = \"http://www.w3.org/2000/svg\";\n const svg = document.createElementNS(NS, \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 512 512\");\n svg.setAttribute(\"width\", \"100%\");\n svg.setAttribute(\"height\", \"100%\");\n svg.setAttribute(\"role\", \"img\");\n svg.setAttribute(\"aria-label\", \"Two sheep standing in front of a black and white checkered swan\");\n svg.style.display = \"block\";\n\n const wool = (cx, cy, rx, ry, seed, tone) => {\n const blobs = [];\n const rand = n => {\n const x = Math.sin(seed++ * 91.731 + n * 17.17) * 43758.5453;\n return x - Math.floor(x);\n };\n for (let i = 0; i < 54; i++) {\n const a = rand(i) * Math.PI * 2;\n const r = Math.sqrt(rand(i + 2));\n const x = cx + Math.cos(a) * rx * r;\n const y = cy + Math.sin(a) * ry * r;\n const size = 9 + rand(i + 7) * 13;\n const fill = i % 5 === 0 ? tone.shadow : i % 3 === 0 ? tone.mid : tone.light;\n blobs.push(\n ``\n );\n }\n return blobs.join(\"\");\n };\n\n svg.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n ${wool(148, 346, 82, 59, 21, {\n light: \"#e9e5d2\", mid: \"#d6d1ba\", shadow: \"#bbb7a4\", stroke: \"#a7a28f\"\n })}\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n ${wool(352, 352, 82, 60, 66, {\n light: \"#f1edda\", mid: \"#ddd7c2\", shadow: \"#c3bdab\", stroke: \"#aaa493\"\n })}\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n `;\n\n stage.appendChild(svg);\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-1844", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 6854, "code_sha256": "123a865f0d997c6e881f63ddd437b065e95cc100704948d51a11154db74abf6d"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "six wooden ties in front of seven forks"}, {"role": "assistant", "content": "async function render(stage) {\n const W = 512;\n const H = 512;\n const SCALE = 2;\n\n stage.replaceChildren();\n Object.assign(stage.style, {\n position: \"relative\",\n width: `${W}px`,\n height: `${H}px`,\n overflow: \"hidden\",\n background: \"#9a6742\"\n });\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = W * SCALE;\n canvas.height = H * SCALE;\n canvas.style.width = `${W}px`;\n canvas.style.height = `${H}px`;\n canvas.style.display = \"block\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(SCALE, SCALE);\n\n const rand = (() => {\n let seed = 841927;\n return () => {\n seed = (seed * 1664525 + 1013904223) >>> 0;\n return seed / 4294967296;\n };\n })();\n\n function roundedRectPath(x, y, w, h, r) {\n const p = new Path2D();\n p.moveTo(x + r, y);\n p.lineTo(x + w - r, y);\n p.quadraticCurveTo(x + w, y, x + w, y + r);\n p.lineTo(x + w, y + h - r);\n p.quadraticCurveTo(x + w, y + h, x + w - r, y + h);\n p.lineTo(x + r, y + h);\n p.quadraticCurveTo(x, y + h, x, y + h - r);\n p.lineTo(x, y + r);\n p.quadraticCurveTo(x, y, x + r, y);\n p.closePath();\n return p;\n }\n\n // Warm wooden tabletop.\n const bg = ctx.createLinearGradient(0, 0, 0, H);\n bg.addColorStop(0, \"#b9855e\");\n bg.addColorStop(0.48, \"#a8704a\");\n bg.addColorStop(1, \"#845435\");\n ctx.fillStyle = bg;\n ctx.fillRect(0, 0, W, H);\n\n // Broad tabletop boards and seams.\n ctx.save();\n ctx.globalAlpha = 0.23;\n ctx.fillStyle = \"#5d3825\";\n ctx.fillRect(0, 165, W, 2);\n ctx.fillRect(0, 350, W, 2);\n ctx.fillStyle = \"#d6a57b\";\n ctx.fillRect(0, 168, W, 1);\n ctx.fillRect(0, 353, W, 1);\n ctx.restore();\n\n // Fine horizontal grain.\n ctx.save();\n for (let i = 0; i < 125; i++) {\n const y = rand() * H;\n const x = rand() * 460 - 20;\n const len = 35 + rand() * 180;\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.bezierCurveTo(\n x + len * 0.3, y + (rand() - 0.5) * 3,\n x + len * 0.7, y + (rand() - 0.5) * 3,\n x + len, y + (rand() - 0.5) * 1.5\n );\n ctx.strokeStyle = rand() > 0.48\n ? `rgba(70,38,21,${0.025 + rand() * 0.055})`\n : `rgba(255,223,183,${0.02 + rand() * 0.045})`;\n ctx.lineWidth = 0.4 + rand() * 1.1;\n ctx.stroke();\n }\n ctx.restore();\n\n // Soft central light.\n const light = ctx.createRadialGradient(250, 180, 20, 250, 220, 390);\n light.addColorStop(0, \"rgba(255,235,205,.16)\");\n light.addColorStop(0.62, \"rgba(255,230,195,.04)\");\n light.addColorStop(1, \"rgba(35,18,10,.20)\");\n ctx.fillStyle = light;\n ctx.fillRect(0, 0, W, H);\n\n function forkPath() {\n const p = new Path2D();\n\n // Four tines.\n [-14.5, -5.5, 3.5, 12.5].forEach(x => {\n p.moveTo(x + 2.25, 0);\n p.quadraticCurveTo(x + 4.5, 0, x + 4.5, 2.5);\n p.lineTo(x + 4.5, 46);\n p.lineTo(x, 46);\n p.lineTo(x, 2.5);\n p.quadraticCurveTo(x, 0, x + 2.25, 0);\n p.closePath();\n });\n\n // Shoulder and neck.\n p.moveTo(-14.5, 40);\n p.lineTo(17, 40);\n p.bezierCurveTo(16.7, 55, 11, 62, 5.2, 70);\n p.bezierCurveTo(4.1, 77, 4.3, 93, 4.8, 112);\n p.lineTo(-4.8, 112);\n p.bezierCurveTo(-4.3, 93, -4.1, 77, -5.2, 70);\n p.bezierCurveTo(-11, 62, -14.2, 54, -14.5, 40);\n p.closePath();\n\n // Long handle.\n p.moveTo(-4.8, 105);\n p.bezierCurveTo(-5.4, 143, -6.2, 192, -7.4, 250);\n p.bezierCurveTo(-7.7, 266, -5, 276, 0, 278);\n p.bezierCurveTo(5, 276, 7.7, 266, 7.4, 250);\n p.bezierCurveTo(6.2, 192, 5.4, 143, 4.8, 105);\n p.closePath();\n return p;\n }\n\n const fork = forkPath();\n\n function drawFork(x, y, angle, scale = 1) {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(angle);\n ctx.scale(scale, scale);\n\n // Cast shadow.\n ctx.save();\n ctx.translate(4, 6);\n ctx.filter = \"blur(4px)\";\n ctx.fillStyle = \"rgba(37,22,14,.34)\";\n ctx.fill(fork);\n ctx.restore();\n\n const metal = ctx.createLinearGradient(-18, 0, 18, 0);\n metal.addColorStop(0, \"#62666a\");\n metal.addColorStop(0.12, \"#b9bec0\");\n metal.addColorStop(0.28, \"#f7f8f5\");\n metal.addColorStop(0.43, \"#a8adb0\");\n metal.addColorStop(0.62, \"#f2f4f2\");\n metal.addColorStop(0.82, \"#868b8e\");\n metal.addColorStop(1, \"#d9dcda\");\n ctx.fillStyle = metal;\n ctx.fill(fork);\n\n ctx.strokeStyle = \"rgba(52,57,60,.8)\";\n ctx.lineWidth = 0.65;\n ctx.stroke(fork);\n\n // Cool central reflection.\n ctx.beginPath();\n ctx.moveTo(-1.7, 73);\n ctx.bezierCurveTo(-1.1, 123, -2.2, 204, -2.8, 258);\n ctx.strokeStyle = \"rgba(255,255,255,.56)\";\n ctx.lineWidth = 1.15;\n ctx.stroke();\n\n // Dark polished edge.\n ctx.beginPath();\n ctx.moveTo(5.1, 73);\n ctx.bezierCurveTo(5.7, 132, 6.1, 215, 5, 258);\n ctx.strokeStyle = \"rgba(36,43,47,.29)\";\n ctx.lineWidth = 0.9;\n ctx.stroke();\n\n // Highlights on tines.\n [-14.5, -5.5, 3.5, 12.5].forEach(tx => {\n ctx.beginPath();\n ctx.moveTo(tx + 1.1, 3);\n ctx.lineTo(tx + 1.1, 38);\n ctx.strokeStyle = \"rgba(255,255,255,.58)\";\n ctx.lineWidth = 0.65;\n ctx.stroke();\n });\n\n ctx.restore();\n }\n\n // Seven forks in the rear.\n const forks = [\n [48, 64, -0.055, 0.96],\n [116, 48, 0.038, 1.02],\n [184, 58, -0.018, 0.99],\n [255, 43, 0.015, 1.04],\n [326, 56, -0.026, 1.00],\n [397, 48, 0.045, 1.03],\n [466, 63, -0.048, 0.96]\n ];\n forks.forEach(f => drawFork(...f));\n\n function tieBodyPath(length, width) {\n const p = new Path2D();\n p.moveTo(-7.5, 32);\n p.lineTo(7.5, 32);\n p.bezierCurveTo(8.7, 69, 13, 113, width * 0.77, length - 37);\n p.lineTo(0, length);\n p.lineTo(-width * 0.77, length - 37);\n p.bezierCurveTo(-13, 113, -8.7, 69, -7.5, 32);\n p.closePath();\n return p;\n }\n\n function knotPath() {\n const p = new Path2D();\n p.moveTo(-15, 0);\n p.quadraticCurveTo(0, -5, 15, 0);\n p.lineTo(11, 27);\n p.lineTo(0, 38);\n p.lineTo(-11, 27);\n p.closePath();\n return p;\n }\n\n function drawWoodTexture(path, length, width, palette, seedOffset) {\n ctx.save();\n ctx.clip(path);\n\n const base = ctx.createLinearGradient(-width, 0, width, 0);\n base.addColorStop(0, palette.dark);\n base.addColorStop(0.18, palette.mid);\n base.addColorStop(0.48, palette.light);\n base.addColorStop(0.72, palette.mid);\n base.addColorStop(1, palette.dark);\n ctx.fillStyle = base;\n ctx.fillRect(-width - 5, -8, width * 2 + 10, length + 20);\n\n // Long natural grain.\n for (let i = 0; i < 24; i++) {\n const sx = -width + rand() * width * 2;\n const phase = rand() * Math.PI * 2 + seedOffset;\n ctx.beginPath();\n ctx.moveTo(sx, -5);\n for (let yy = -5; yy <= length + 5; yy += 13) {\n const bend = Math.sin(yy * (0.025 + rand() * 0.004) + phase) *\n (1.1 + rand() * 1.8);\n ctx.lineTo(sx + bend, yy);\n }\n ctx.strokeStyle = rand() > 0.38\n ? `rgba(63,29,11,${0.10 + rand() * 0.16})`\n : `rgba(255,219,151,${0.08 + rand() * 0.13})`;\n ctx.lineWidth = 0.35 + rand() * 1.15;\n ctx.stroke();\n }\n\n // A few wooden knots.\n const knotCount = 2 + Math.floor(rand() * 2);\n for (let i = 0; i < knotCount; i++) {\n const ky = 65 + rand() * (length - 115);\n const kx = (rand() - 0.5) * width * 0.75;\n ctx.save();\n ctx.translate(kx, ky);\n ctx.scale(1, 1.8 + rand());\n for (let r = 7; r > 1; r -= 1.8) {\n ctx.beginPath();\n ctx.ellipse(0, 0, r, r * 0.42, 0, 0, Math.PI * 2);\n ctx.strokeStyle = `rgba(67,28,10,${0.045 + (7 - r) * 0.022})`;\n ctx.lineWidth = 0.7;\n ctx.stroke();\n }\n ctx.restore();\n }\n\n // Subtle varnish reflection.\n const gloss = ctx.createLinearGradient(-width, 0, width, 0);\n gloss.addColorStop(0, \"rgba(255,255,255,0)\");\n gloss.addColorStop(0.37, \"rgba(255,238,197,.04)\");\n gloss.addColorStop(0.48, \"rgba(255,245,215,.19)\");\n gloss.addColorStop(0.57, \"rgba(255,255,255,.03)\");\n gloss.addColorStop(1, \"rgba(255,255,255,0)\");\n ctx.fillStyle = gloss;\n ctx.fillRect(-width, -5, width * 2, length + 10);\n ctx.restore();\n }\n\n const palettes = [\n { dark: \"#633516\", mid: \"#9c5b27\", light: \"#ca8847\" },\n { dark: \"#71431f\", mid: \"#aa6a31\", light: \"#d29a59\" },\n { dark: \"#4f2a18\", mid: \"#89502d\", light: \"#b97946\" },\n { dark: \"#75451d\", mid: \"#b16b2d\", light: \"#d89647\" },\n { dark: \"#58301a\", mid: \"#92562f\", light: \"#c0824d\" },\n { dark: \"#6a3917\", mid: \"#a65f26\", light: \"#d08a40\" }\n ];\n\n function drawTie(x, y, angle, length, width, palette, index) {\n const body = tieBodyPath(length, width);\n const knot = knotPath();\n\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(angle);\n\n // Full object shadow, visibly above the fork handles.\n ctx.save();\n ctx.translate(5, 7);\n ctx.filter = \"blur(5px)\";\n ctx.fillStyle = \"rgba(31,16,8,.43)\";\n ctx.fill(body);\n ctx.fill(knot);\n ctx.restore();\n\n drawWoodTexture(body, length, width, palette, index * 1.47);\n ctx.strokeStyle = \"rgba(49,23,8,.68)\";\n ctx.lineWidth = 1.15;\n ctx.stroke(body);\n\n drawWoodTexture(knot, 43, 18, palette, index * 2.13);\n ctx.strokeStyle = \"rgba(49,23,8,.72)\";\n ctx.lineWidth = 1.15;\n ctx.stroke(knot);\n\n // Beveled wooden edges.\n ctx.beginPath();\n ctx.moveTo(-7.5, 35);\n ctx.bezierCurveTo(-9, 80, -15, 150, -width * 0.77, length - 37);\n ctx.lineTo(0, length);\n ctx.strokeStyle = \"rgba(48,20,7,.34)\";\n ctx.lineWidth = 2;\n ctx.stroke();\n\n ctx.beginPath();\n ctx.moveTo(7.2, 35);\n ctx.bezierCurveTo(9, 80, 14, 149, width * 0.77, length - 38);\n ctx.strokeStyle = \"rgba(255,218,155,.28)\";\n ctx.lineWidth = 1.15;\n ctx.stroke();\n\n // Join below knot.\n ctx.beginPath();\n ctx.moveTo(-7.2, 35);\n ctx.quadraticCurveTo(0, 39, 7.2, 35);\n ctx.strokeStyle = \"rgba(55,24,8,.48)\";\n ctx.lineWidth = 1;\n ctx.stroke();\n\n // Varnish glint on knot.\n ctx.beginPath();\n ctx.moveTo(-9, 3);\n ctx.quadraticCurveTo(0, 0, 8, 3);\n ctx.strokeStyle = \"rgba(255,231,185,.34)\";\n ctx.lineWidth = 1;\n ctx.stroke();\n\n ctx.restore();\n }\n\n // Six wooden neckties in the foreground.\n const ties = [\n [49, 221, -0.055, 247, 28],\n [132, 213, 0.027, 259, 30],\n [214, 224, -0.018, 246, 28],\n [297, 211, 0.022, 263, 30],\n [379, 222, -0.032, 247, 28],\n [460, 216, 0.052, 253, 29]\n ];\n ties.forEach((t, i) => drawTie(...t, palettes[i], i));\n\n // Foreground contact shadows beneath pointed ends.\n ctx.save();\n ctx.filter = \"blur(7px)\";\n ties.forEach(([x, y, angle, length], i) => {\n const endX = x - Math.sin(angle) * length;\n const endY = y + Math.cos(angle) * length;\n ctx.beginPath();\n ctx.ellipse(endX + 4, Math.min(490, endY + 5), 22, 4.5, 0, 0, Math.PI * 2);\n ctx.fillStyle = `rgba(29,14,7,${0.15 + i * 0.006})`;\n ctx.fill();\n });\n ctx.restore();\n\n // Gentle vignette.\n const vignette = ctx.createRadialGradient(256, 240, 185, 256, 250, 390);\n vignette.addColorStop(0, \"rgba(20,10,5,0)\");\n vignette.addColorStop(0.72, \"rgba(20,10,5,.035)\");\n vignette.addColorStop(1, \"rgba(20,10,5,.28)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0, 0, W, H);\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-1922", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 5065, "code_sha256": "2373893a60fdd39a423c17d98f0fad6c524f3e2e646926e5a4d1cc7d28d7cb6d"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "two stone keyboards on top of a wooden cookie on six plastic forks"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n Object.assign(stage.style, {\n position: \"relative\",\n width: \"512px\",\n height: \"512px\",\n overflow: \"hidden\",\n background: \"#292823\"\n });\n\n const canvas = document.createElement(\"canvas\");\n const dpr = 2;\n canvas.width = 512 * dpr;\n canvas.height = 512 * dpr;\n canvas.style.width = \"512px\";\n canvas.style.height = \"512px\";\n canvas.setAttribute(\"aria-label\", \"Two stone keyboards resting on a wooden tree slice supported by six plastic forks\");\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(dpr, dpr);\n ctx.lineCap = \"round\";\n ctx.lineJoin = \"round\";\n\n let seed = 9173621;\n const rnd = () => {\n seed = (seed * 1664525 + 1013904223) >>> 0;\n return seed / 4294967296;\n };\n\n const poly = (pts, fill, stroke, lw = 1) => {\n ctx.beginPath();\n pts.forEach((p, i) => i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]));\n ctx.closePath();\n if (fill) {\n ctx.fillStyle = fill;\n ctx.fill();\n }\n if (stroke) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = lw;\n ctx.stroke();\n }\n };\n\n const roundedRect = (x, y, w, h, r) => {\n const rr = Math.min(r, w / 2, h / 2);\n ctx.beginPath();\n ctx.moveTo(x + rr, y);\n ctx.lineTo(x + w - rr, y);\n ctx.quadraticCurveTo(x + w, y, x + w, y + rr);\n ctx.lineTo(x + w, y + h - rr);\n ctx.quadraticCurveTo(x + w, y + h, x + w - rr, y + h);\n ctx.lineTo(x + rr, y + h);\n ctx.quadraticCurveTo(x, y + h, x, y + h - rr);\n ctx.lineTo(x, y + rr);\n ctx.quadraticCurveTo(x, y, x + rr, y);\n ctx.closePath();\n };\n\n // Background wall and tabletop.\n const bg = ctx.createRadialGradient(255, 205, 30, 255, 250, 430);\n bg.addColorStop(0, \"#77756b\");\n bg.addColorStop(0.45, \"#504f48\");\n bg.addColorStop(1, \"#23231f\");\n ctx.fillStyle = bg;\n ctx.fillRect(0, 0, 512, 512);\n\n const table = ctx.createLinearGradient(0, 330, 0, 512);\n table.addColorStop(0, \"rgba(55,48,40,.15)\");\n table.addColorStop(1, \"rgba(24,22,19,.72)\");\n ctx.fillStyle = table;\n ctx.fillRect(0, 315, 512, 197);\n\n for (let i = 0; i < 900; i++) {\n const x = rnd() * 512;\n const y = rnd() * 512;\n const a = 0.012 + rnd() * 0.025;\n ctx.fillStyle = rnd() > .48 ? `rgba(255,255,245,${a})` : `rgba(0,0,0,${a})`;\n ctx.fillRect(x, y, rnd() * 1.5 + .25, rnd() * 1.5 + .25);\n }\n\n // Ground shadow.\n ctx.save();\n ctx.filter = \"blur(18px)\";\n ctx.fillStyle = \"rgba(0,0,0,.58)\";\n ctx.beginPath();\n ctx.ellipse(257, 390, 211, 59, 0, 0, Math.PI * 2);\n ctx.fill();\n ctx.restore();\n\n function drawFork(angle, tint) {\n ctx.save();\n ctx.translate(256, 293);\n ctx.rotate(angle);\n\n ctx.shadowColor = \"rgba(0,0,0,.52)\";\n ctx.shadowBlur = 8;\n ctx.shadowOffsetY = 6;\n\n const plastic = ctx.createLinearGradient(75, -10, 238, 12);\n plastic.addColorStop(0, \"rgba(183,190,188,.74)\");\n plastic.addColorStop(.35, tint);\n plastic.addColorStop(.72, \"rgba(244,246,237,.87)\");\n plastic.addColorStop(1, \"rgba(166,174,171,.72)\");\n\n // Handle and fork shoulders.\n ctx.fillStyle = plastic;\n roundedRect(45, -6.5, 143, 13, 6.5);\n ctx.fill();\n\n ctx.beginPath();\n ctx.moveTo(170, -6.5);\n ctx.bezierCurveTo(184, -7, 190, -14, 202, -15);\n ctx.lineTo(202, 15);\n ctx.bezierCurveTo(190, 14, 184, 7, 170, 6.5);\n ctx.closePath();\n ctx.fill();\n\n // Four tines.\n const tineYs = [-12, -4, 4, 12];\n tineYs.forEach((yy, i) => {\n ctx.strokeStyle = plastic;\n ctx.lineWidth = 5.2;\n ctx.beginPath();\n ctx.moveTo(196, yy * .82);\n ctx.quadraticCurveTo(216, yy, 243 - Math.abs(i - 1.5) * 2, yy);\n ctx.stroke();\n\n ctx.strokeStyle = \"rgba(255,255,255,.46)\";\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.moveTo(200, yy * .82 - 1.2);\n ctx.lineTo(238, yy - 1.2);\n ctx.stroke();\n });\n\n ctx.shadowColor = \"transparent\";\n ctx.strokeStyle = \"rgba(255,255,255,.55)\";\n ctx.lineWidth = 1.3;\n ctx.beginPath();\n ctx.moveTo(57, -2.6);\n ctx.quadraticCurveTo(117, -5.5, 175, -2.7);\n ctx.stroke();\n\n ctx.strokeStyle = \"rgba(52,62,61,.32)\";\n ctx.lineWidth = .8;\n ctx.beginPath();\n ctx.moveTo(60, 4);\n ctx.quadraticCurveTo(124, 6.4, 174, 3.5);\n ctx.stroke();\n\n ctx.restore();\n }\n\n [\n [-2.98, \"rgba(217,222,214,.82)\"],\n [-2.43, \"rgba(224,226,215,.82)\"],\n [-1.87, \"rgba(202,211,211,.82)\"],\n [-1.24, \"rgba(235,232,218,.82)\"],\n [-0.58, \"rgba(215,222,220,.82)\"],\n [0.03, \"rgba(232,231,220,.82)\"]\n ].forEach(v => drawFork(v[0], v[1]));\n\n // Wooden slice side.\n const sideTop = [];\n const sideBottom = [];\n for (let i = 0; i <= 48; i++) {\n const t = Math.PI * 2 * i / 48;\n const wobble = 1 + Math.sin(t * 7 + .7) * .018 + Math.sin(t * 13) * .012;\n sideTop.push([256 + Math.cos(t) * 164 * wobble, 291 + Math.sin(t) * 99 * wobble]);\n sideBottom.push([256 + Math.cos(t) * 164 * wobble, 314 + Math.sin(t) * 99 * wobble]);\n }\n\n ctx.save();\n ctx.shadowColor = \"rgba(0,0,0,.62)\";\n ctx.shadowBlur = 14;\n ctx.shadowOffsetY = 11;\n const sideGrad = ctx.createLinearGradient(0, 274, 0, 406);\n sideGrad.addColorStop(0, \"#70452a\");\n sideGrad.addColorStop(.38, \"#52301f\");\n sideGrad.addColorStop(1, \"#281a13\");\n ctx.beginPath();\n ctx.moveTo(sideTop[0][0], sideTop[0][1]);\n for (let i = 1; i < sideTop.length; i++) ctx.lineTo(...sideTop[i]);\n for (let i = sideBottom.length - 1; i >= 0; i--) ctx.lineTo(...sideBottom[i]);\n ctx.closePath();\n ctx.fillStyle = sideGrad;\n ctx.fill();\n ctx.restore();\n\n // Bark ridges on visible front edge.\n ctx.save();\n ctx.beginPath();\n ctx.rect(70, 286, 375, 132);\n ctx.clip();\n for (let i = 0; i < 42; i++) {\n const x = 94 + i * 8.2 + (rnd() - .5) * 5;\n const y = 325 + Math.pow((x - 256) / 163, 2) * 58;\n ctx.strokeStyle = i % 3 === 0 ? \"rgba(18,10,7,.48)\" : \"rgba(188,112,58,.22)\";\n ctx.lineWidth = .8 + rnd() * 2.4;\n ctx.beginPath();\n ctx.moveTo(x, y - 13 - rnd() * 8);\n ctx.bezierCurveTo(x - 5, y - 2, x + 4, y + 8, x + (rnd() - .5) * 6, y + 24);\n ctx.stroke();\n }\n ctx.restore();\n\n // Top face.\n const topPts = [];\n for (let i = 0; i < 72; i++) {\n const t = Math.PI * 2 * i / 72;\n const wobble = 1 + Math.sin(t * 7 + .7) * .018 + Math.sin(t * 13) * .012;\n topPts.push([256 + Math.cos(t) * 164 * wobble, 285 + Math.sin(t) * 99 * wobble]);\n }\n const wood = ctx.createRadialGradient(233, 261, 15, 256, 286, 171);\n wood.addColorStop(0, \"#c69458\");\n wood.addColorStop(.38, \"#ac7440\");\n wood.addColorStop(.76, \"#8d572f\");\n wood.addColorStop(.94, \"#724126\");\n wood.addColorStop(1, \"#45291d\");\n poly(topPts, wood, \"#3c2519\", 3);\n\n ctx.save();\n ctx.beginPath();\n topPts.forEach((p, i) => i ? ctx.lineTo(...p) : ctx.moveTo(...p));\n ctx.closePath();\n ctx.clip();\n\n // Growth rings.\n for (let i = 1; i <= 9; i++) {\n const rx = 18 + i * 15.3;\n const ry = 10 + i * 8.6;\n ctx.strokeStyle = i % 2\n ? \"rgba(83,43,20,.25)\"\n : \"rgba(243,187,111,.18)\";\n ctx.lineWidth = 1.1 + (i % 3) * .45;\n ctx.beginPath();\n for (let j = 0; j <= 100; j++) {\n const t = Math.PI * 2 * j / 100;\n const rr = 1 + Math.sin(t * 5 + i) * .035 + Math.sin(t * 11) * .012;\n const x = 242 + Math.cos(t) * rx * rr;\n const y = 281 + Math.sin(t) * ry * rr;\n j ? ctx.lineTo(x, y) : ctx.moveTo(x, y);\n }\n ctx.stroke();\n }\n\n // Radial cracks.\n [\n [135, 280, 188, 282, 216, 273],\n [339, 222, 316, 253, 296, 272],\n [368, 330, 328, 310, 300, 300],\n [180, 357, 207, 322, 223, 303],\n [273, 190, 267, 232, 255, 267]\n ].forEach((p, idx) => {\n ctx.strokeStyle = \"rgba(52,27,15,.53)\";\n ctx.lineWidth = idx % 2 ? 1.2 : 1.8;\n ctx.beginPath();\n ctx.moveTo(p[0], p[1]);\n ctx.lineTo(p[2], p[3]);\n ctx.lineTo(p[4], p[5]);\n ctx.stroke();\n ctx.strokeStyle = \"rgba(242,178,98,.18)\";\n ctx.lineWidth = .7;\n ctx.beginPath();\n ctx.moveTo(p[0] + 2, p[1] - 1);\n ctx.lineTo(p[2] + 2, p[3] - 1);\n ctx.stroke();\n });\n\n for (let i = 0; i < 500; i++) {\n const x = 90 + rnd() * 335;\n const y = 185 + rnd() * 201;\n if (Math.pow((x - 256) / 164, 2) + Math.pow((y - 285) / 99, 2) < 1) {\n ctx.fillStyle = rnd() > .5\n ? `rgba(63,31,15,${.025 + rnd() * .08})`\n : `rgba(255,205,128,${.018 + rnd() * .055})`;\n ctx.fillRect(x, y, .5 + rnd() * 1.4, .5 + rnd() * 1.1);\n }\n }\n ctx.restore();\n\n function drawKeyboard(cx, cy, w, h, rotation, shade, rows) {\n ctx.save();\n ctx.translate(cx, cy);\n ctx.rotate(rotation);\n\n const topY = -h / 2;\n const bottomY = h / 2;\n const topHalf = w / 2;\n const lowerHalf = w * .465;\n\n ctx.shadowColor = \"rgba(0,0,0,.58)\";\n ctx.shadowBlur = 13;\n ctx.shadowOffsetX = 4;\n ctx.shadowOffsetY = 10;\n\n // Thick stone sides.\n const sideGradient = ctx.createLinearGradient(0, topY, 0, bottomY + 14);\n sideGradient.addColorStop(0, shade.sideLight);\n sideGradient.addColorStop(1, shade.sideDark);\n poly([\n [-lowerHalf, bottomY],\n [lowerHalf, bottomY],\n [lowerHalf - 3, bottomY + 13],\n [-lowerHalf + 4, bottomY + 14]\n ], sideGradient, \"rgba(35,36,34,.75)\", 1.2);\n poly([\n [topHalf, topY],\n [lowerHalf, bottomY],\n [lowerHalf - 3, bottomY + 13],\n [topHalf - 4, topY + 10]\n ], shade.sideDark, \"rgba(30,31,30,.55)\", 1);\n\n ctx.shadowColor = \"transparent\";\n\n const slab = ctx.createLinearGradient(-w / 2, topY, w / 2, bottomY);\n slab.addColorStop(0, shade.light);\n slab.addColorStop(.43, shade.mid);\n slab.addColorStop(1, shade.dark);\n poly([\n [-topHalf, topY],\n [topHalf, topY],\n [lowerHalf, bottomY],\n [-lowerHalf, bottomY]\n ], slab, \"rgba(31,33,32,.85)\", 1.5);\n\n // Chipped rim.\n ctx.strokeStyle = \"rgba(232,233,220,.25)\";\n ctx.lineWidth = 1.2;\n ctx.beginPath();\n ctx.moveTo(-topHalf + 7, topY + 3);\n ctx.lineTo(topHalf - 13, topY + 3);\n ctx.stroke();\n\n const marginX = 10;\n const marginTop = 10;\n const marginBottom = 10;\n const gap = 3;\n const rowH = (h - marginTop - marginBottom - gap * (rows.length - 1)) / rows.length;\n\n rows.forEach((weights, ri) => {\n const y = topY + marginTop + ri * (rowH + gap);\n const perspective = (y - topY) / h;\n const availableHalf = topHalf + (lowerHalf - topHalf) * perspective;\n const left = -availableHalf + marginX;\n const right = availableHalf - marginX;\n const totalWeight = weights.reduce((a, b) => a + b, 0);\n const usable = right - left - gap * (weights.length - 1);\n let x = left;\n\n weights.forEach((weight, ki) => {\n const kw = usable * weight / totalWeight;\n const keyGrad = ctx.createLinearGradient(x, y, x + kw, y + rowH);\n keyGrad.addColorStop(0, shade.keyLight);\n keyGrad.addColorStop(.48, shade.key);\n keyGrad.addColorStop(1, shade.keyDark);\n\n ctx.shadowColor = \"rgba(12,13,12,.58)\";\n ctx.shadowBlur = 2.5;\n ctx.shadowOffsetY = 2;\n roundedRect(x, y, kw, rowH, 1.8);\n ctx.fillStyle = keyGrad;\n ctx.fill();\n ctx.strokeStyle = \"rgba(34,35,33,.75)\";\n ctx.lineWidth = .65;\n ctx.stroke();\n ctx.shadowColor = \"transparent\";\n\n // Engraved key marks.\n if (kw > 8 && rowH > 6) {\n ctx.strokeStyle = \"rgba(44,46,43,.58)\";\n ctx.lineWidth = .65;\n ctx.beginPath();\n const mx = x + kw * .5;\n const my = y + rowH * .48;\n if ((ri + ki) % 3 === 0) {\n ctx.moveTo(mx - 1.8, my);\n ctx.lineTo(mx + 1.8, my);\n ctx.moveTo(mx, my - 1.5);\n ctx.lineTo(mx, my + 1.5);\n } else if ((ri + ki) % 3 === 1) {\n ctx.arc(mx, my, 1.15, 0, Math.PI * 2);\n } else {\n ctx.moveTo(mx - 1.5, my + 1);\n ctx.lineTo(mx, my - 1.2);\n ctx.lineTo(mx + 1.5, my + 1);\n }\n ctx.stroke();\n }\n\n // Random stone pits.\n if (rnd() > .64) {\n ctx.fillStyle = \"rgba(28,30,28,.25)\";\n ctx.beginPath();\n ctx.arc(x + 2 + rnd() * Math.max(1, kw - 4), y + 2 + rnd() * Math.max(1, rowH - 4), .45 + rnd() * .45, 0, Math.PI * 2);\n ctx.fill();\n }\n\n x += kw + gap;\n });\n });\n\n // Mineral flecks and hairline fractures.\n for (let i = 0; i < 44; i++) {\n const yy = topY + rnd() * h;\n const p = (yy - topY) / h;\n const hh = topHalf + (lowerHalf - topHalf) * p;\n const xx = (rnd() * 2 - 1) * hh;\n ctx.fillStyle = rnd() > .45 ? \"rgba(245,245,229,.16)\" : \"rgba(22,24,22,.19)\";\n ctx.fillRect(xx, yy, .4 + rnd(), .4 + rnd());\n }\n\n ctx.strokeStyle = \"rgba(38,39,37,.31)\";\n ctx.lineWidth = .65;\n ctx.beginPath();\n ctx.moveTo(-w * .31, topY + 4);\n ctx.lineTo(-w * .25, topY + 12);\n ctx.lineTo(-w * .28, topY + 18);\n ctx.stroke();\n\n ctx.restore();\n }\n\n const rearRows = [\n Array(13).fill(1),\n [1.35, ...Array(11).fill(1), 1.35],\n [1.6, ...Array(10).fill(1), 1.7],\n [2.1, ...Array(8).fill(1), 2.2],\n [1.3, 1.2, 1.2, 5.7, 1.2, 1.2, 1.4]\n ];\n\n const frontRows = [\n Array(12).fill(1),\n [1.4, ...Array(10).fill(1), 1.4],\n [1.7, ...Array(9).fill(1), 1.8],\n [2.1, ...Array(8).fill(1), 2.25],\n [1.3, 1.2, 1.2, 5.1, 1.2, 1.2, 1.5]\n ];\n\n drawKeyboard(218, 219, 217, 101, -0.13, {\n light: \"#9a9b91\",\n mid: \"#72756f\",\n dark: \"#4c504d\",\n sideLight: \"#626660\",\n sideDark: \"#303330\",\n keyLight: \"#a9aa9f\",\n key: \"#777a74\",\n keyDark: \"#555954\"\n }, rearRows);\n\n drawKeyboard(292, 291, 220, 102, 0.105, {\n light: \"#8e9088\",\n mid: \"#676a66\",\n dark: \"#444845\",\n sideLight: \"#5b5e59\",\n sideDark: \"#292c2a\",\n keyLight: \"#a0a198\",\n key: \"#71736e\",\n keyDark: \"#4c504c\"\n }, frontRows);\n\n // Subtle foreground vignette and highlight.\n const vignette = ctx.createRadialGradient(256, 250, 180, 256, 260, 370);\n vignette.addColorStop(0, \"rgba(0,0,0,0)\");\n vignette.addColorStop(.7, \"rgba(0,0,0,.08)\");\n vignette.addColorStop(1, \"rgba(0,0,0,.48)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0, 0, 512, 512);\n\n ctx.save();\n ctx.globalCompositeOperation = \"screen\";\n const glow = ctx.createRadialGradient(190, 125, 0, 190, 125, 250);\n glow.addColorStop(0, \"rgba(255,247,216,.10)\");\n glow.addColorStop(1, \"rgba(255,247,216,0)\");\n ctx.fillStyle = glow;\n ctx.fillRect(0, 0, 512, 400);\n ctx.restore();\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-2154", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 6347, "code_sha256": "7152e9d84f9f5b30748f9b610a7d30ffa916137cfb2322e73f526086df108cd1"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "six limes on seven glass hawks playing with a silver zebra"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n `;\n stage.style.margin = \"0\";\n stage.style.padding = \"0\";\n stage.style.overflow = \"hidden\";\n stage.style.background = \"#17384a\";\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-2229", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 7037, "code_sha256": "ef59e1791e20f6b73fcbdc34eeee0064a824371434f39a6fb36671693c464033"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "three wooden frogs on top of five checkered toys on top of a lavender melon"}, {"role": "assistant", "content": "async function render(stage) {\n stage.replaceChildren();\n Object.assign(stage.style, {\n position: \"relative\",\n overflow: \"hidden\",\n width: \"512px\",\n height: \"512px\",\n background: \"#f4f0ec\"\n });\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = 1024;\n canvas.height = 1024;\n Object.assign(canvas.style, {\n width: \"512px\",\n height: \"512px\",\n display: \"block\"\n });\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(2, 2);\n ctx.lineCap = \"round\";\n ctx.lineJoin = \"round\";\n\n let seed = 73119;\n const rnd = () => {\n seed = (seed * 1664525 + 1013904223) >>> 0;\n return seed / 4294967296;\n };\n\n const ellipse = (x, y, rx, ry, fill, stroke, lw = 1) => {\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n if (fill) {\n ctx.fillStyle = fill;\n ctx.fill();\n }\n if (stroke) {\n ctx.lineWidth = lw;\n ctx.strokeStyle = stroke;\n ctx.stroke();\n }\n };\n\n const pathPoly = pts => {\n ctx.beginPath();\n ctx.moveTo(pts[0][0], pts[0][1]);\n for (let i = 1; i < pts.length; i++) ctx.lineTo(pts[i][0], pts[i][1]);\n ctx.closePath();\n };\n\n const bg = ctx.createRadialGradient(256, 250, 20, 256, 250, 370);\n bg.addColorStop(0, \"#fffdf9\");\n bg.addColorStop(0.72, \"#f4f0eb\");\n bg.addColorStop(1, \"#e8e2dd\");\n ctx.fillStyle = bg;\n ctx.fillRect(0, 0, 512, 512);\n\n const floor = ctx.createLinearGradient(0, 350, 0, 512);\n floor.addColorStop(0, \"rgba(246,242,237,0)\");\n floor.addColorStop(1, \"#ded7d1\");\n ctx.fillStyle = floor;\n ctx.fillRect(0, 340, 512, 172);\n\n ctx.save();\n ctx.filter = \"blur(13px)\";\n ellipse(257, 468, 190, 24, \"rgba(75,55,62,.28)\");\n ctx.restore();\n ellipse(257, 466, 154, 12, \"rgba(76,56,65,.12)\");\n\n function melon() {\n ctx.save();\n\n const body = ctx.createRadialGradient(226, 385, 12, 260, 419, 185);\n body.addColorStop(0, \"#d8c9f4\");\n body.addColorStop(0.35, \"#af98d9\");\n body.addColorStop(0.72, \"#8267ae\");\n body.addColorStop(1, \"#5c467d\");\n\n ctx.beginPath();\n ctx.moveTo(82, 423);\n ctx.bezierCurveTo(91, 376, 149, 350, 248, 350);\n ctx.bezierCurveTo(351, 348, 421, 376, 430, 420);\n ctx.bezierCurveTo(436, 458, 368, 480, 260, 482);\n ctx.bezierCurveTo(151, 482, 78, 461, 82, 423);\n ctx.closePath();\n ctx.fillStyle = body;\n ctx.fill();\n ctx.lineWidth = 2;\n ctx.strokeStyle = \"#715793\";\n ctx.stroke();\n ctx.clip();\n\n const ribXs = [112, 154, 199, 256, 313, 360, 402];\n ribXs.forEach((x, i) => {\n ctx.beginPath();\n ctx.moveTo(252, 350);\n const bottom = 478 - Math.abs(i - 3) * 2;\n ctx.bezierCurveTo(\n 242 + (x - 256) * 0.15,\n 377,\n x,\n 420,\n x + (x - 256) * 0.15,\n bottom\n );\n ctx.strokeStyle = i === 3 ? \"rgba(75,49,106,.48)\" : \"rgba(79,55,112,.36)\";\n ctx.lineWidth = 2.1;\n ctx.stroke();\n\n ctx.beginPath();\n ctx.moveTo(255, 352);\n ctx.bezierCurveTo(250 + (x - 256) * 0.13, 378, x + 5, 416, x + 5, bottom - 3);\n ctx.strokeStyle = \"rgba(232,220,255,.22)\";\n ctx.lineWidth = 1.2;\n ctx.stroke();\n });\n\n for (let i = 0; i < 210; i++) {\n const x = 91 + rnd() * 330;\n const y = 357 + rnd() * 119;\n const dx = (x - 256) / 175;\n const dy = (y - 420) / 68;\n if (dx * dx + dy * dy < 1.02) {\n ctx.beginPath();\n ctx.moveTo(x - 3, y + rnd() * 2);\n ctx.quadraticCurveTo(x, y - 2 - rnd() * 2, x + 3 + rnd() * 2, y);\n ctx.strokeStyle = rnd() > 0.5\n ? \"rgba(237,226,255,.17)\"\n : \"rgba(60,42,87,.14)\";\n ctx.lineWidth = 0.7 + rnd() * 0.7;\n ctx.stroke();\n }\n }\n\n const shine = ctx.createRadialGradient(180, 377, 2, 180, 377, 80);\n shine.addColorStop(0, \"rgba(255,255,255,.36)\");\n shine.addColorStop(1, \"rgba(255,255,255,0)\");\n ctx.fillStyle = shine;\n ctx.fillRect(95, 350, 175, 95);\n ctx.restore();\n\n ellipse(256, 357, 27, 8, \"rgba(70,48,95,.34)\");\n ellipse(256, 355, 18, 5, \"rgba(226,214,246,.24)\");\n }\n\n melon();\n\n function roundedBlockPath(w, h, r) {\n ctx.beginPath();\n ctx.moveTo(-w / 2 + r, -h / 2);\n ctx.lineTo(w / 2 - r, -h / 2);\n ctx.quadraticCurveTo(w / 2, -h / 2, w / 2, -h / 2 + r);\n ctx.lineTo(w / 2, h / 2 - r);\n ctx.quadraticCurveTo(w / 2, h / 2, w / 2 - r, h / 2);\n ctx.lineTo(-w / 2 + r, h / 2);\n ctx.quadraticCurveTo(-w / 2, h / 2, -w / 2, h / 2 - r);\n ctx.lineTo(-w / 2, -h / 2 + r);\n ctx.quadraticCurveTo(-w / 2, -h / 2, -w / 2 + r, -h / 2);\n ctx.closePath();\n }\n\n function block(x, y, w, h, rot, colors, offset = 0) {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rot);\n\n ctx.save();\n ctx.filter = \"blur(6px)\";\n ctx.fillStyle = \"rgba(54,40,48,.25)\";\n roundedBlockPath(w + 2, h + 2, 12);\n ctx.translate(2, 6);\n ctx.fill();\n ctx.restore();\n\n roundedBlockPath(w, h, 11);\n ctx.save();\n ctx.clip();\n\n const n = 4;\n const cw = w / n;\n const ch = h / n;\n for (let row = -1; row <= n; row++) {\n for (let col = -1; col <= n; col++) {\n const dark = (row + col + offset) % 2 === 0;\n const gx = -w / 2 + col * cw;\n const gy = -h / 2 + row * ch;\n const g = ctx.createLinearGradient(gx, gy, gx + cw, gy + ch);\n if (dark) {\n g.addColorStop(0, colors[0]);\n g.addColorStop(1, colors[1]);\n } else {\n g.addColorStop(0, colors[2]);\n g.addColorStop(1, colors[3]);\n }\n ctx.fillStyle = g;\n ctx.fillRect(gx, gy, cw + 0.8, ch + 0.8);\n }\n }\n\n const gloss = ctx.createLinearGradient(0, -h / 2, 0, h / 2);\n gloss.addColorStop(0, \"rgba(255,255,255,.32)\");\n gloss.addColorStop(0.3, \"rgba(255,255,255,.04)\");\n gloss.addColorStop(1, \"rgba(40,25,40,.20)\");\n ctx.fillStyle = gloss;\n ctx.fillRect(-w / 2, -h / 2, w, h);\n\n for (let i = 0; i < 18; i++) {\n ctx.fillStyle = `rgba(255,255,255,${0.02 + rnd() * 0.04})`;\n ellipse(-w / 2 + rnd() * w, -h / 2 + rnd() * h, 0.6, 0.6, ctx.fillStyle);\n }\n ctx.restore();\n\n roundedBlockPath(w, h, 11);\n ctx.strokeStyle = \"rgba(62,44,57,.52)\";\n ctx.lineWidth = 1.7;\n ctx.stroke();\n\n ctx.beginPath();\n ctx.moveTo(-w / 2 + 10, -h / 2 + 4);\n ctx.quadraticCurveTo(0, -h / 2 - 1, w / 2 - 10, -h / 2 + 4);\n ctx.strokeStyle = \"rgba(255,255,255,.46)\";\n ctx.lineWidth = 1.5;\n ctx.stroke();\n\n ctx.restore();\n }\n\n const purple = [\"#594369\", \"#33283d\", \"#eee3d0\", \"#cdbfa9\"];\n const plum = [\"#703e59\", \"#40283c\", \"#f1d9bd\", \"#c8b095\"];\n const sage = [\"#5c6c58\", \"#34463c\", \"#e9ddc7\", \"#c2b59c\"];\n const blue = [\"#506476\", \"#30404f\", \"#efe0c8\", \"#cbbba2\"];\n\n block(166, 336, 91, 75, -0.10, plum, 0);\n block(254, 332, 91, 78, 0.025, sage, 1);\n block(344, 337, 91, 74, 0.09, purple, 0);\n block(209, 270, 88, 72, -0.035, blue, 1);\n block(300, 270, 88, 72, 0.045, plum, 0);\n\n function woodGradient(x, y, r, light = \"#c78a45\", mid = \"#945b29\", dark = \"#59331c\") {\n const g = ctx.createRadialGradient(x - r * 0.35, y - r * 0.45, 1, x, y, r * 1.4);\n g.addColorStop(0, \"#e0ad68\");\n g.addColorStop(0.37, light);\n g.addColorStop(0.72, mid);\n g.addColorStop(1, dark);\n return g;\n }\n\n function frog(x, y, s, turn = 0, tone = 0) {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(turn);\n ctx.scale(s, s);\n\n const edge = tone ? \"#4a2a17\" : \"#58331c\";\n const wood = tone\n ? woodGradient(0, 0, 40, \"#b77737\", \"#7f471f\", \"#432615\")\n : woodGradient(0, 0, 40);\n\n ctx.save();\n ctx.filter = \"blur(4px)\";\n ellipse(1, 25, 31, 7, \"rgba(40,27,20,.3)\");\n ctx.restore();\n\n // Rear folded legs\n ctx.beginPath();\n ctx.moveTo(-9, 5);\n ctx.bezierCurveTo(-24, 5, -37, 14, -35, 24);\n ctx.bezierCurveTo(-31, 31, -16, 27, -8, 19);\n ctx.closePath();\n ctx.fillStyle = wood;\n ctx.fill();\n ctx.strokeStyle = edge;\n ctx.lineWidth = 1.5;\n ctx.stroke();\n\n ctx.beginPath();\n ctx.moveTo(9, 5);\n ctx.bezierCurveTo(24, 5, 37, 14, 35, 24);\n ctx.bezierCurveTo(31, 31, 16, 27, 8, 19);\n ctx.closePath();\n ctx.fillStyle = wood;\n ctx.fill();\n ctx.stroke();\n\n // Toes\n for (const side of [-1, 1]) {\n for (let i = 0; i < 3; i++) {\n ctx.beginPath();\n const sx = side * (17 + i * 6);\n ctx.moveTo(side * 10, 20);\n ctx.quadraticCurveTo(sx, 25, sx + side * 5, 25 - i * 0.7);\n ctx.strokeStyle = \"#68401f\";\n ctx.lineWidth = 3.2;\n ctx.stroke();\n ellipse(sx + side * 5, 25 - i * 0.7, 2.2, 1.7, \"#b87837\", edge, 0.7);\n }\n }\n\n // Body\n ctx.beginPath();\n ctx.ellipse(0, 6, 20, 24, 0, 0, Math.PI * 2);\n ctx.fillStyle = wood;\n ctx.fill();\n ctx.strokeStyle = edge;\n ctx.lineWidth = 1.6;\n ctx.stroke();\n\n // Head\n ctx.beginPath();\n ctx.moveTo(-22, -10);\n ctx.bezierCurveTo(-20, -26, -11, -32, 0, -31);\n ctx.bezierCurveTo(12, -32, 21, -25, 22, -9);\n ctx.bezierCurveTo(21, 2, 12, 7, 0, 8);\n ctx.bezierCurveTo(-13, 7, -21, 1, -22, -10);\n ctx.closePath();\n ctx.fillStyle = wood;\n ctx.fill();\n ctx.strokeStyle = edge;\n ctx.stroke();\n\n // Eye bulbs\n ellipse(-13, -25, 8.7, 9.5, wood, edge, 1.3);\n ellipse(13, -25, 8.7, 9.5, wood, edge, 1.3);\n ellipse(-13, -26, 4.6, 5.5, \"#201912\", \"#4c2f1b\", 1);\n ellipse(13, -26, 4.6, 5.5, \"#201912\", \"#4c2f1b\", 1);\n ellipse(-14.5, -28, 1.4, 1.8, \"rgba(255,244,208,.85)\");\n ellipse(11.5, -28, 1.4, 1.8, \"rgba(255,244,208,.85)\");\n\n // Face\n ellipse(-7, -11, 1.15, 0.8, \"#4e2a18\");\n ellipse(7, -11, 1.15, 0.8, \"#4e2a18\");\n ctx.beginPath();\n ctx.moveTo(-10, -5);\n ctx.quadraticCurveTo(0, 1, 10, -5);\n ctx.strokeStyle = \"#4a2918\";\n ctx.lineWidth = 1.4;\n ctx.stroke();\n\n // Front arms\n for (const side of [-1, 1]) {\n ctx.beginPath();\n ctx.moveTo(side * 11, 2);\n ctx.bezierCurveTo(side * 14, 11, side * 10, 17, side * 8, 23);\n ctx.strokeStyle = \"#77451f\";\n ctx.lineWidth = 6;\n ctx.stroke();\n for (let t = -1; t <= 1; t++) {\n ctx.beginPath();\n ctx.moveTo(side * 8, 22);\n ctx.lineTo(side * (8 + t * 2.4), 27);\n ctx.strokeStyle = \"#71411f\";\n ctx.lineWidth = 1.7;\n ctx.stroke();\n }\n }\n\n // Wood grain\n ctx.globalAlpha = 0.34;\n for (let i = 0; i < 10; i++) {\n const yy = -15 + i * 4.2 + rnd() * 2;\n ctx.beginPath();\n ctx.moveTo(-14 + rnd() * 4, yy);\n ctx.bezierCurveTo(-5, yy - 3, 4, yy + 3, 14 - rnd() * 4, yy);\n ctx.strokeStyle = i % 2 ? \"#f0b768\" : \"#5c321a\";\n ctx.lineWidth = 0.65;\n ctx.stroke();\n }\n ctx.globalAlpha = 1;\n\n const sheen = ctx.createRadialGradient(-8, -18, 0, -8, -18, 27);\n sheen.addColorStop(0, \"rgba(255,225,166,.25)\");\n sheen.addColorStop(1, \"rgba(255,225,166,0)\");\n ctx.fillStyle = sheen;\n ellipse(-5, -9, 25, 31, sheen);\n\n ctx.restore();\n }\n\n frog(178, 225, 0.78, -0.11, 1);\n frog(257, 222, 0.89, 0.015, 0);\n frog(337, 226, 0.77, 0.12, 1);\n\n // Fine atmospheric highlights and contact shading\n ctx.save();\n ctx.globalCompositeOperation = \"screen\";\n const halo = ctx.createRadialGradient(250, 178, 10, 250, 178, 180);\n halo.addColorStop(0, \"rgba(255,255,255,.12)\");\n halo.addColorStop(1, \"rgba(255,255,255,0)\");\n ctx.fillStyle = halo;\n ctx.fillRect(60, 40, 390, 310);\n ctx.restore();\n\n ctx.save();\n ctx.globalAlpha = 0.1;\n for (let i = 0; i < 500; i++) {\n const x = rnd() * 512;\n const y = rnd() * 512;\n ctx.fillStyle = rnd() > 0.5 ? \"#fff\" : \"#6f5964\";\n ctx.fillRect(x, y, 0.45, 0.45);\n }\n ctx.restore();\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-2428", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 5458, "code_sha256": "b7460a4e6415bdc0c657dc0db3475b76411238549f1b2372f596e9cbe5007256"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "six striped kiwis under a plastic ostrich to the right of two stone refrigerators"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n Object.assign(stage.style, {\n width: \"512px\",\n height: \"512px\",\n overflow: \"hidden\",\n position: \"relative\",\n background: \"#d9d7ce\"\n });\n\n const ns = \"http://www.w3.org/2000/svg\";\n const svg = document.createElementNS(ns, \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 512 512\");\n svg.setAttribute(\"width\", \"100%\");\n svg.setAttribute(\"height\", \"100%\");\n svg.setAttribute(\"role\", \"img\");\n svg.setAttribute(\"aria-label\", \"Six striped kiwi birds beneath a glossy plastic ostrich beside two stone refrigerators\");\n svg.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \n \n \n\n \n \n\n \n \n\n \n \n \n \n \n `;\n\n stage.appendChild(svg);\n\n const kiwiData = [\n { x: 245, y: 349, s: .82, flip: 1 },\n { x: 317, y: 343, s: .88, flip: -1 },\n { x: 400, y: 351, s: .8, flip: 1 },\n { x: 260, y: 411, s: .95, flip: -1 },\n { x: 349, y: 405, s: 1.0, flip: 1 },\n { x: 431, y: 414, s: .9, flip: -1 }\n ];\n\n const kiwiLayer = svg.querySelector(\"#kiwis\");\n\n kiwiData.forEach((k, i) => {\n const g = document.createElementNS(ns, \"g\");\n const directionTransform = k.flip === 1 ? \"\" : \"scale(-1 1)\";\n g.setAttribute(\"transform\", `translate(${k.x} ${k.y}) scale(${k.s})`);\n\n g.innerHTML = `\n \n \n \n \n \n\n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n\n \n \n \n \n `;\n kiwiLayer.appendChild(g);\n });\n\n await new Promise(resolve => requestAnimationFrame(resolve));\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-2436", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 7108, "code_sha256": "2411bef8e4f70afcedef6927149db1a3e6c4866558da725d3cf8093a66384c20"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "four airplanes under six wooden microwaves under seven striped couches"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n Object.assign(stage.style, {\n width: \"512px\",\n height: \"512px\",\n position: \"relative\",\n overflow: \"hidden\",\n background: \"#d8c9b5\"\n });\n\n const svgNS = \"http://www.w3.org/2000/svg\";\n const svg = document.createElementNS(svgNS, \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 512 512\");\n svg.setAttribute(\"width\", \"512\");\n svg.setAttribute(\"height\", \"512\");\n svg.setAttribute(\"aria-label\", \"Four airplanes beneath six wooden microwaves beneath seven striped couches\");\n svg.style.display = \"block\";\n\n svg.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n 12:00\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n\n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n\n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n `;\n\n stage.appendChild(svg);\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-2460", "teacher": "gpt-5.6-sol", "sft_sequence_tokens": 5801, "code_sha256": "3e3128c8ffdf064a991ca1886269cda5e2c55c36b6d10d424b7f06fea9e991ee"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "Two sisters braid each other's hair beside a candle-lined windowsill, relaxed faces reflected in the glass above a darkened street."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;overflow:hidden;position:relative;background:#17131a;\";\n const canvas = document.createElement(\"canvas\");\n canvas.width = 1024;\n canvas.height = 1024;\n canvas.style.cssText = \"width:512px;height:512px;display:block;\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(2, 2);\n\n const W = 512, H = 512;\n const rnd = (() => {\n let s = 87421;\n return () => ((s = (s * 1664525 + 1013904223) >>> 0) / 4294967296);\n })();\n\n const path = (d, fill, stroke, lw = 1) => {\n ctx.beginPath();\n d();\n if (fill) {\n ctx.fillStyle = fill;\n ctx.fill();\n }\n if (stroke) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = lw;\n ctx.stroke();\n }\n };\n\n const ellipse = (x, y, rx, ry, fill, stroke, lw = 1) => {\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n if (fill) {\n ctx.fillStyle = fill;\n ctx.fill();\n }\n if (stroke) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = lw;\n ctx.stroke();\n }\n };\n\n function candle(x, y, h, color, flame = true) {\n const glow = ctx.createRadialGradient(x, y - h - 8, 1, x, y - h - 8, 38);\n glow.addColorStop(0, \"rgba(255,191,88,.23)\");\n glow.addColorStop(0.35, \"rgba(255,151,62,.08)\");\n glow.addColorStop(1, \"rgba(255,130,50,0)\");\n ctx.fillStyle = glow;\n ctx.fillRect(x - 42, y - h - 50, 84, 90);\n\n const wax = ctx.createLinearGradient(x - 6, y - h, x + 9, y);\n wax.addColorStop(0, \"#f2ddba\");\n wax.addColorStop(.45, color);\n wax.addColorStop(1, \"#9f735c\");\n path(() => {\n ctx.moveTo(x - 7, y);\n ctx.lineTo(x - 6, y - h + 3);\n ctx.quadraticCurveTo(x, y - h - 1, x + 7, y - h + 3);\n ctx.lineTo(x + 7, y);\n ctx.closePath();\n }, wax, \"rgba(88,52,42,.45)\", .7);\n ctx.fillStyle = \"rgba(72,40,33,.25)\";\n ctx.fillRect(x - 5, y - h + 6, 10, 2);\n if (flame) {\n path(() => {\n ctx.moveTo(x, y - h - 2);\n ctx.bezierCurveTo(x - 7, y - h - 11, x - 3, y - h - 20, x + 1, y - h - 25);\n ctx.bezierCurveTo(x + 8, y - h - 15, x + 6, y - h - 7, x, y - h - 2);\n }, \"#ffc968\");\n ellipse(x + 1, y - h - 11, 2.1, 5.3, \"#fff3bb\");\n }\n }\n\n // Room wall\n let wall = ctx.createLinearGradient(0, 0, 512, 512);\n wall.addColorStop(0, \"#393039\");\n wall.addColorStop(.48, \"#211b25\");\n wall.addColorStop(1, \"#14151e\");\n ctx.fillStyle = wall;\n ctx.fillRect(0, 0, W, H);\n\n // faint plaster texture\n for (let i = 0; i < 1600; i++) {\n const a = rnd() * .06;\n ctx.fillStyle = `rgba(238,182,139,${a})`;\n ctx.fillRect(rnd() * W, rnd() * H, rnd() * 1.5, rnd() * 1.5);\n }\n\n // window frame and dark glass\n ctx.fillStyle = \"#0b101a\";\n ctx.fillRect(33, 35, 446, 293);\n const glass = ctx.createLinearGradient(0, 35, 0, 328);\n glass.addColorStop(0, \"#172638\");\n glass.addColorStop(.5, \"#111b29\");\n glass.addColorStop(1, \"#070c14\");\n ctx.fillStyle = glass;\n ctx.fillRect(42, 44, 428, 275);\n\n // night sky haze\n let haze = ctx.createRadialGradient(297, 101, 12, 297, 101, 235);\n haze.addColorStop(0, \"rgba(69,101,135,.25)\");\n haze.addColorStop(.65, \"rgba(29,47,68,.07)\");\n haze.addColorStop(1, \"rgba(4,8,13,0)\");\n ctx.fillStyle = haze;\n ctx.fillRect(42, 44, 428, 275);\n\n // far buildings\n const buildings = [\n [44, 183, 52, 136], [97, 146, 42, 173], [143, 203, 33, 116],\n [180, 166, 62, 153], [247, 190, 45, 129], [297, 143, 70, 176],\n [371, 181, 42, 138], [416, 157, 51, 162]\n ];\n buildings.forEach((b, bi) => {\n ctx.fillStyle = bi % 2 ? \"#101723\" : \"#0b111b\";\n ctx.fillRect(...b);\n for (let yy = b[1] + 14; yy < 309; yy += 18) {\n for (let xx = b[0] + 10; xx < b[0] + b[2] - 5; xx += 14) {\n if (rnd() > .57) {\n ctx.fillStyle = rnd() > .65 ? \"rgba(210,156,78,.32)\" : \"rgba(93,126,153,.2)\";\n ctx.fillRect(xx, yy, 4, 6);\n }\n }\n }\n });\n\n // wet street highlights\n ctx.fillStyle = \"rgba(86,117,148,.14)\";\n ctx.fillRect(42, 294, 428, 25);\n for (let i = 0; i < 27; i++) {\n const x = 48 + rnd() * 414;\n ctx.fillStyle = `rgba(231,160,77,${.05 + rnd() * .15})`;\n ctx.fillRect(x, 302 + rnd() * 13, 4 + rnd() * 18, 1);\n }\n\n // window mullions\n ctx.fillStyle = \"#342f35\";\n ctx.fillRect(248, 39, 9, 282);\n ctx.fillRect(38, 151, 436, 7);\n ctx.fillStyle = \"rgba(158,117,99,.22)\";\n ctx.fillRect(41, 41, 430, 4);\n ctx.fillStyle = \"#4b3b39\";\n ctx.fillRect(28, 28, 456, 11);\n ctx.fillRect(28, 28, 11, 306);\n ctx.fillRect(473, 28, 11, 306);\n\n // reflections in glass\n ctx.save();\n ctx.globalAlpha = .18;\n const refl = ctx.createLinearGradient(0, 70, 0, 280);\n refl.addColorStop(0, \"#dca98b\");\n refl.addColorStop(1, \"#5b343e\");\n // left reflected face\n ellipse(169, 151, 41, 57, refl);\n path(() => {\n ctx.moveTo(127, 152); ctx.bezierCurveTo(121, 109, 148, 88, 176, 93);\n ctx.bezierCurveTo(210, 99, 214, 128, 205, 161);\n ctx.bezierCurveTo(185, 137, 151, 138, 127, 152);\n }, \"#2b1d27\");\n // right reflected face\n ellipse(340, 145, 39, 55, refl);\n path(() => {\n ctx.moveTo(305, 153); ctx.bezierCurveTo(300, 105, 322, 86, 355, 93);\n ctx.bezierCurveTo(380, 99, 388, 125, 379, 163);\n ctx.bezierCurveTo(354, 138, 328, 138, 305, 153);\n }, \"#332029\");\n ctx.strokeStyle = \"rgba(255,212,181,.8)\";\n ctx.lineWidth = 1;\n ctx.beginPath(); ctx.arc(176, 152, 19, .2, 2.3); ctx.stroke();\n ctx.beginPath(); ctx.arc(343, 148, 18, .2, 2.4); ctx.stroke();\n ctx.restore();\n\n // sill\n ctx.fillStyle = \"#291e22\";\n ctx.fillRect(19, 319, 477, 15);\n ctx.fillStyle = \"#735041\";\n ctx.fillRect(19, 326, 477, 8);\n ctx.fillStyle = \"#17151c\";\n ctx.fillRect(0, 334, 512, 18);\n ctx.fillStyle = \"rgba(249,173,103,.24)\";\n ctx.fillRect(31, 320, 440, 2);\n\n candle(78, 320, 28, \"#d9c6aa\");\n candle(117, 320, 20, \"#b98775\");\n candle(397, 320, 34, \"#e3ccb4\");\n candle(437, 320, 23, \"#c7947b\");\n candle(277, 320, 14, \"#d6bfa7\");\n\n // background cushions\n ellipse(254, 464, 260, 109, \"#382936\");\n ellipse(91, 466, 121, 72, \"#2a2430\");\n ellipse(429, 462, 119, 68, \"#2a2330\");\n\n // bodies / sweaters\n path(() => {\n ctx.moveTo(38, 512); ctx.lineTo(48, 414);\n ctx.bezierCurveTo(62, 378, 113, 362, 158, 385);\n ctx.bezierCurveTo(188, 402, 197, 458, 202, 512);\n ctx.closePath();\n }, \"#9a5d5f\");\n path(() => {\n ctx.moveTo(278, 512); ctx.bezierCurveTo(276, 449, 284, 397, 329, 378);\n ctx.bezierCurveTo(380, 356, 448, 381, 474, 425);\n ctx.lineTo(492, 512); ctx.closePath();\n }, \"#596a83\");\n\n // sweater folds\n ctx.strokeStyle = \"rgba(255,190,154,.13)\";\n ctx.lineWidth = 2;\n [[70,432,96,506],[115,407,133,493],[333,403,315,500],[400,400,441,498],[449,430,466,501]].forEach(l=>{\n ctx.beginPath(); ctx.moveTo(l[0],l[1]); ctx.quadraticCurveTo(l[2],(l[1]+l[3])/2,l[2],l[3]);ctx.stroke();\n });\n\n // left neck\n path(() => {\n ctx.moveTo(127, 324); ctx.lineTo(129, 371); ctx.bezierCurveTo(137, 386, 159, 388, 171, 370);\n ctx.lineTo(168, 322); ctx.closePath();\n }, \"#b97768\");\n // left hair behind\n path(() => {\n ctx.moveTo(89, 253);\n ctx.bezierCurveTo(81, 202, 108, 170, 151, 172);\n ctx.bezierCurveTo(197, 173, 211, 214, 196, 270);\n ctx.bezierCurveTo(189, 310, 184, 365, 167, 392);\n ctx.lineTo(129, 380);\n ctx.bezierCurveTo(127, 337, 101, 321, 89, 253);\n }, \"#291c26\");\n\n // left face\n const skinL = ctx.createLinearGradient(112, 210, 188, 336);\n skinL.addColorStop(0, \"#d59a7e\"); skinL.addColorStop(.6, \"#c98470\"); skinL.addColorStop(1, \"#9b5c5c\");\n path(() => {\n ctx.moveTo(111, 224);\n ctx.bezierCurveTo(117, 192, 153, 184, 178, 203);\n ctx.bezierCurveTo(194, 216, 190, 241, 185, 258);\n ctx.bezierCurveTo(181, 276, 174, 303, 158, 318);\n ctx.bezierCurveTo(143, 327, 121, 310, 113, 286);\n ctx.bezierCurveTo(106, 264, 104, 243, 111, 224);\n }, skinL);\n\n // left hair fringe\n path(() => {\n ctx.moveTo(104, 239);\n ctx.bezierCurveTo(101, 194, 131, 174, 160, 181);\n ctx.bezierCurveTo(190, 186, 200, 214, 188, 239);\n ctx.bezierCurveTo(174, 219, 156, 205, 129, 215);\n ctx.bezierCurveTo(122, 226, 117, 239, 104, 239);\n }, \"#34202a\");\n ctx.strokeStyle = \"rgba(121,77,67,.55)\";\n ctx.lineWidth = 2;\n for(let i=0;i<8;i++){\n ctx.beginPath();\n ctx.moveTo(112+i*8, 203+rnd()*8);\n ctx.quadraticCurveTo(130+i*5, 218, 151+i*3, 235+rnd()*8);\n ctx.stroke();\n }\n\n // left face details\n ctx.strokeStyle = \"#593c41\"; ctx.lineWidth = 1.3;\n ctx.beginPath(); ctx.moveTo(142,247); ctx.quadraticCurveTo(148,250,154,247);ctx.stroke();\n ctx.beginPath(); ctx.moveTo(169,247); ctx.quadraticCurveTo(175,250,181,247);ctx.stroke();\n ellipse(149, 248, 1.5, 1.2, \"#382b31\");\n ellipse(175, 248, 1.5, 1.2, \"#382b31\");\n ctx.beginPath(); ctx.moveTo(158,254);ctx.quadraticCurveTo(155,269,160,270);ctx.stroke();\n ctx.strokeStyle=\"#874f59\";ctx.lineWidth=1.5;\n ctx.beginPath();ctx.moveTo(151,285);ctx.quadraticCurveTo(159,289,168,285);ctx.stroke();\n ellipse(125,270,8,13,\"rgba(194,98,97,.16)\");\n ellipse(177,271,8,12,\"rgba(194,98,97,.17)\");\n\n // right neck\n path(() => {\n ctx.moveTo(346, 315); ctx.lineTo(343, 370); ctx.bezierCurveTo(353,384,379,384,389,368);\n ctx.lineTo(385,309); ctx.closePath();\n }, \"#c78a72\");\n\n // right hair behind / long fall\n path(() => {\n ctx.moveTo(310, 258);\n ctx.bezierCurveTo(298, 205, 322, 169, 366, 172);\n ctx.bezierCurveTo(412, 174, 432, 212, 419, 264);\n ctx.bezierCurveTo(411, 300, 426, 336, 421, 395);\n ctx.bezierCurveTo(407, 404, 393, 398, 387, 382);\n ctx.bezierCurveTo(389, 330, 373, 302, 352, 283);\n ctx.closePath();\n }, \"#4a2a25\");\n\n // right face\n const skinR = ctx.createLinearGradient(324, 201, 397, 326);\n skinR.addColorStop(0, \"#e0a889\"); skinR.addColorStop(.7, \"#c7826d\"); skinR.addColorStop(1, \"#9f615b\");\n path(() => {\n ctx.moveTo(326, 219);\n ctx.bezierCurveTo(340, 190, 373, 188, 394, 210);\n ctx.bezierCurveTo(409, 226, 401, 259, 395, 280);\n ctx.bezierCurveTo(390, 302, 380, 319, 362, 323);\n ctx.bezierCurveTo(340, 322, 325, 302, 319, 277);\n ctx.bezierCurveTo(315, 253, 316, 234, 326, 219);\n }, skinR);\n\n // right hair cap\n path(() => {\n ctx.moveTo(319,239);\n ctx.bezierCurveTo(312,205, 332,178, 366,180);\n ctx.bezierCurveTo(402,181,416,210,401,243);\n ctx.bezierCurveTo(390,221,373,211,349,216);\n ctx.bezierCurveTo(339,225,332,236,319,239);\n }, \"#4a2a25\");\n ctx.strokeStyle=\"rgba(169,104,73,.35)\";\n ctx.lineWidth=2;\n for(let i=0;i<7;i++){\n ctx.beginPath();ctx.moveTo(329+i*8,201);ctx.quadraticCurveTo(345+i*5,215,364+i*2,234);ctx.stroke();\n }\n\n // right relaxed face\n ctx.strokeStyle=\"#62403f\";ctx.lineWidth=1.3;\n ctx.beginPath();ctx.moveTo(341,250);ctx.quadraticCurveTo(347,253,353,250);ctx.stroke();\n ctx.beginPath();ctx.moveTo(369,250);ctx.quadraticCurveTo(375,253,381,250);ctx.stroke();\n ellipse(347,251,1.4,1.1,\"#392a2d\");ellipse(375,251,1.4,1.1,\"#392a2d\");\n ctx.beginPath();ctx.moveTo(361,257);ctx.quadraticCurveTo(358,269,363,271);ctx.stroke();\n ctx.strokeStyle=\"#914e59\";ctx.lineWidth=1.4;\n ctx.beginPath();ctx.moveTo(353,286);ctx.quadraticCurveTo(362,290,371,285);ctx.stroke();\n ellipse(336,272,9,13,\"rgba(207,104,97,.16)\");\n ellipse(386,272,8,12,\"rgba(207,104,97,.16)\");\n\n // left arm reaching toward braid\n path(() => {\n ctx.moveTo(118,390);\n ctx.bezierCurveTo(143,382, 166,375, 194,356);\n ctx.bezierCurveTo(216,341, 233,323, 261,307);\n ctx.lineTo(274,323);\n ctx.bezierCurveTo(244,347,220,365,197,381);\n ctx.bezierCurveTo(166,405,145,417,129,423);\n ctx.closePath();\n }, \"#bf796b\", \"rgba(83,45,48,.45)\", .8);\n\n // right arm, hand holding braid\n path(() => {\n ctx.moveTo(391,389);\n ctx.bezierCurveTo(370,375,352,360,331,340);\n ctx.bezierCurveTo(311,321,294,306,276,295);\n ctx.lineTo(265,313);\n ctx.bezierCurveTo(285,331,303,349,323,369);\n ctx.bezierCurveTo(346,392,361,411,374,424);\n ctx.closePath();\n }, \"#c58771\", \"rgba(83,45,48,.38)\", .8);\n\n // hands over braid\n ellipse(265,315,11,8,\"#d99a7d\",\"rgba(88,48,47,.5)\",.6);\n ellipse(274,302,10,7,\"#d99a7d\",\"rgba(88,48,47,.5)\",.6);\n ellipse(272,323,10,6,\"#ca836f\");\n ctx.strokeStyle=\"rgba(102,53,51,.55)\";ctx.lineWidth=.7;\n for(let i=0;i<3;i++){ctx.beginPath();ctx.moveTo(258+i*5,312);ctx.lineTo(269+i*5,317);ctx.stroke();}\n\n // braid woven between sisters\n const braid = [\n [290,286],[281,297],[291,309],[278,321],[287,333],[273,345],\n [281,357],[267,370],[274,382],[260,395],[266,407]\n ];\n ctx.strokeStyle=\"#3b2425\";ctx.lineCap=\"round\";ctx.lineWidth=13;\n ctx.beginPath();ctx.moveTo(295,279);\n braid.forEach(p=>ctx.lineTo(p[0],p[1]));ctx.stroke();\n braid.forEach((p,i)=>{\n ellipse(p[0],p[1],8,10,i%2?\"#684033\":\"#52302c\",\"rgba(30,17,21,.55)\",.7);\n ctx.strokeStyle=\"rgba(196,119,75,.38)\";ctx.lineWidth=1;\n ctx.beginPath();ctx.arc(p[0]-1,p[1]-1,5,-2.5,.5);ctx.stroke();\n });\n ctx.fillStyle=\"#a96f58\";\n ctx.fillRect(260,407,11,4);\n\n // foreground soft candle light\n const warm = ctx.createRadialGradient(254,324,10,254,324,240);\n warm.addColorStop(0,\"rgba(255,181,99,.13)\");\n warm.addColorStop(.55,\"rgba(236,132,76,.035)\");\n warm.addColorStop(1,\"rgba(0,0,0,0)\");\n ctx.fillStyle=warm;ctx.fillRect(0,180,512,332);\n\n // subtle vignette\n const vig=ctx.createRadialGradient(256,250,170,256,250,380);\n vig.addColorStop(.55,\"rgba(0,0,0,0)\");\n vig.addColorStop(1,\"rgba(4,2,9,.5)\");\n ctx.fillStyle=vig;ctx.fillRect(0,0,512,512);\n}"}], "metadata": {"id": "val-v1-broad-v2-affection-validation-000", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 7162, "code_sha256": "5064212309eb87f6943df928e3cf21d45dc229a2c767c39df28ca63fcb47c38c"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "An older woman and her neighbor sit quietly on the stairwell, wrapped in shawls and sharing tea beside an emergency lantern."}, {"role": "assistant", "content": "async function render(stage) {\n const W = 512, H = 512, dpr = Math.min(2, window.devicePixelRatio || 1);\n stage.innerHTML = \"\";\n stage.style.position = \"relative\";\n stage.style.overflow = \"hidden\";\n stage.style.background = \"#171719\";\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = W * dpr;\n canvas.height = H * dpr;\n canvas.style.width = W + \"px\";\n canvas.style.height = H + \"px\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(dpr, dpr);\n ctx.imageSmoothingEnabled = true;\n ctx.imageSmoothingQuality = \"high\";\n\n let seed = 21933;\n const rand = () => ((seed = (seed * 1664525 + 1013904223) >>> 0) / 4294967296);\n const clamp = (v, a, b) => Math.max(a, Math.min(b, v));\n\n function poly(points, fill, stroke, lw = 1) {\n ctx.beginPath();\n points.forEach(([x, y], i) => i ? ctx.lineTo(x, y) : ctx.moveTo(x, y));\n ctx.closePath();\n if (fill) { ctx.fillStyle = fill; ctx.fill(); }\n if (stroke) { ctx.strokeStyle = stroke; ctx.lineWidth = lw; ctx.stroke(); }\n }\n function ellipse(x, y, rx, ry, fill, stroke, lw = 1) {\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n if (fill) { ctx.fillStyle = fill; ctx.fill(); }\n if (stroke) { ctx.strokeStyle = stroke; ctx.lineWidth = lw; ctx.stroke(); }\n }\n function path(points, color, width, alpha = 1) {\n ctx.save();\n ctx.globalAlpha = alpha;\n ctx.strokeStyle = color;\n ctx.lineWidth = width;\n ctx.lineCap = \"round\";\n ctx.lineJoin = \"round\";\n ctx.beginPath();\n points.forEach(([x, y], i) => i ? ctx.lineTo(x, y) : ctx.moveTo(x, y));\n ctx.stroke();\n ctx.restore();\n }\n function grad(x0, y0, x1, y1, stops) {\n const g = ctx.createLinearGradient(x0, y0, x1, y1);\n stops.forEach(s => g.addColorStop(s[0], s[1]));\n return g;\n }\n\n // Deep stairwell atmosphere\n ctx.fillStyle = \"#17171a\";\n ctx.fillRect(0, 0, W, H);\n\n ctx.fillStyle = grad(0, 0, 0, 320, [\n [0, \"#343238\"], [0.45, \"#27262b\"], [1, \"#1c1b1f\"]\n ]);\n ctx.fillRect(0, 0, W, 322);\n\n // Worn plaster walls\n poly([[0, 0], [123, 0], [139, 232], [0, 282]], \"#29282c\");\n poly([[397, 0], [512, 0], [512, 282], [375, 231]], \"#25252a\");\n ctx.fillStyle = \"rgba(225,215,194,.045)\";\n for (let i = 0; i < 105; i++) {\n const x = rand() * W, y = rand() * 300;\n const r = rand() * 2 + .3;\n ctx.fillRect(x, y, r, r * (1 + rand() * 4));\n }\n\n // Door / lower hall behind\n poly([[169, 20], [342, 20], [371, 229], [145, 229]], \"#202125\");\n poly([[177, 28], [335, 28], [355, 221], [157, 221]], \"#29292d\");\n ctx.fillStyle = \"#19191b\";\n ctx.fillRect(238, 64, 72, 128);\n ctx.strokeStyle = \"rgba(180,177,165,.22)\";\n ctx.lineWidth = 2;\n ctx.strokeRect(238, 64, 72, 128);\n ctx.fillStyle = \"rgba(183,165,120,.3)\";\n ellipse(299, 126, 3, 3, \"#82724e\");\n\n // High window, dim blue moonlight\n ctx.fillStyle = \"#171d25\";\n ctx.fillRect(38, 28, 78, 117);\n ctx.fillStyle = grad(38, 28, 116, 145, [\n [0, \"#596778\"], [1, \"#202b38\"]\n ]);\n ctx.fillRect(43, 33, 68, 107);\n ctx.strokeStyle = \"rgba(207,218,220,.42)\";\n ctx.lineWidth = 3;\n ctx.strokeRect(39, 29, 76, 115);\n path([[77, 31], [77, 142]], \"rgba(200,210,210,.38)\", 2);\n path([[41, 85], [113, 85]], \"rgba(200,210,210,.28)\", 2);\n for (let i = 0; i < 13; i++) {\n path([[43 + rand() * 67, 35 + rand() * 96], [43 + rand() * 67, 35 + rand() * 96]], \"rgba(235,240,240,.18)\", 1);\n }\n\n // Railings\n path([[3, 115], [159, 198], [420, 204], [511, 152]], \"#101115\", 7);\n path([[4, 110], [159, 190], [420, 196], [511, 145]], \"#57575b\", 3);\n for (let i = 0; i < 7; i++) {\n const x = 26 + i * 50;\n path([[x, 126 + i * 14], [x - 3, 245 + i * 3]], \"#16171a\", 7);\n path([[x - 1, 127 + i * 14], [x - 4, 244 + i * 3]], \"#626064\", 2);\n }\n\n // Stair geometry and landings\n ctx.fillStyle = \"#202023\";\n poly([[0, 275], [512, 262], [512, 512], [0, 512]], \"#202023\");\n const stairYs = [267, 295, 329, 370, 420, 477];\n for (let i = 0; i < stairYs.length; i++) {\n const y = stairYs[i];\n const next = i < stairYs.length - 1 ? stairYs[i + 1] : 512;\n ctx.fillStyle = i % 2 ? \"#353337\" : \"#3b393d\";\n poly([[0, y], [512, y - 12], [512, next - 11], [0, next]], ctx.fillStyle);\n path([[0, y + 1], [512, y - 11]], \"rgba(12,12,14,.62)\", 5);\n path([[0, y - 2], [512, y - 14]], \"rgba(165,154,143,.12)\", 1);\n }\n for (let i = 0; i < 250; i++) {\n const x = rand() * W, y = 260 + rand() * 252;\n ctx.fillStyle = rand() > .5 ? \"rgba(224,210,190,.055)\" : \"rgba(0,0,0,.09)\";\n ctx.fillRect(x, y, rand() * 4 + 1, .5 + rand());\n }\n\n // Soft lantern illumination\n const glow = ctx.createRadialGradient(317, 344, 7, 317, 344, 180);\n glow.addColorStop(0, \"rgba(255,213,121,.38)\");\n glow.addColorStop(.25, \"rgba(240,180,83,.18)\");\n glow.addColorStop(1, \"rgba(226,154,61,0)\");\n ctx.fillStyle = glow;\n ctx.fillRect(125, 190, 387, 322);\n\n // Seated woman on left: shadow\n ellipse(166, 426, 96, 18, \"rgba(0,0,0,.54)\");\n // legs beneath shawl\n poly([[111, 388], [189, 390], [230, 460], [136, 467], [93, 435]], \"#262126\");\n poly([[151, 426], [220, 444], [235, 466], [177, 468]], \"#343137\");\n ellipse(133, 466, 32, 9, \"#17161a\");\n ellipse(218, 468, 30, 8, \"#18171a\");\n\n // left shawl body\n const leftShawl = grad(86, 286, 218, 443, [\n [0, \"#625258\"], [.42, \"#4c3d46\"], [1, \"#2a252d\"]\n ]);\n poly([[105, 310], [137, 278], [173, 289], [202, 342], [224, 407], [191, 436], [117, 427], [82, 392], [91, 343]], leftShawl);\n poly([[112, 322], [92, 389], [120, 420], [133, 335]], \"rgba(180,147,143,.2)\");\n path([[111, 322], [106, 385], [127, 421]], \"rgba(226,187,170,.22)\", 2);\n path([[148, 294], [132, 357], [148, 421]], \"rgba(16,12,17,.33)\", 3);\n path([[165, 301], [191, 389], [181, 427]], \"rgba(216,181,171,.13)\", 2);\n path([[96, 352], [177, 369], [210, 405]], \"rgba(232,190,169,.12)\", 2);\n for (let i = 0; i < 16; i++) {\n path([[95 + rand() * 103, 314 + rand() * 95], [102 + rand() * 107, 320 + rand() * 95]], \"rgba(232,201,185,.075)\", .8);\n }\n\n // left neck and face\n ctx.save();\n ctx.translate(145, 271);\n ctx.rotate(-.12);\n ellipse(0, 15, 19, 25, \"#9b7161\");\n ctx.fillStyle = \"#a77b69\";\n ctx.beginPath();\n ctx.moveTo(-17, 7); ctx.quadraticCurveTo(-13, -18, 3, -20);\n ctx.quadraticCurveTo(20, -17, 20, 7); ctx.quadraticCurveTo(17, 26, 1, 30);\n ctx.quadraticCurveTo(-13, 28, -17, 7); ctx.fill();\n // hair / head scarf\n ctx.fillStyle = \"#b7ada2\";\n ctx.beginPath();\n ctx.moveTo(-20, 3); ctx.quadraticCurveTo(-18, -23, 2, -27);\n ctx.quadraticCurveTo(23, -23, 24, 1); ctx.lineTo(17, 8);\n ctx.quadraticCurveTo(13, -12, 2, -14); ctx.quadraticCurveTo(-11, -10, -15, 7); ctx.closePath(); ctx.fill();\n path([[-15, -2], [-11, -17], [-1, -22], [11, -14]], \"rgba(255,255,245,.35)\", 1);\n // facial character\n path([[3, 2], [12, 3]], \"#513f3b\", 1.1);\n ellipse(8, 2, 1.4, 1, \"#30282a\");\n path([[10, 8], [14, 10], [9, 12]], \"rgba(91,55,50,.7)\", 1);\n path([[0, 18], [10, 18]], \"rgba(96,49,50,.75)\", 1);\n path([[-4, 5], [-1, 18]], \"rgba(92,53,48,.35)\", .8);\n ctx.restore();\n\n // right woman shadow and body\n ellipse(410, 427, 101, 19, \"rgba(0,0,0,.58)\");\n poly([[365, 393], [440, 386], [484, 445], [473, 472], [391, 469], [348, 436]], \"#26272d\");\n ellipse(390, 468, 31, 8, \"#18181b\");\n ellipse(467, 470, 28, 8, \"#18181b\");\n\n const rightShawl = grad(345, 286, 478, 441, [\n [0, \"#576169\"], [.45, \"#44515a\"], [1, \"#292f37\"]\n ]);\n poly([[360, 312], [391, 281], [430, 290], [457, 335], [483, 397], [463, 436], [389, 433], [344, 407], [338, 355]], rightShawl);\n poly([[393, 298], [376, 375], [392, 428]], \"rgba(210,225,224,.18)\");\n poly([[425, 295], [449, 363], [456, 426]], \"rgba(5,13,18,.34)\");\n path([[350, 341], [424, 363], [470, 408]], \"rgba(190,207,209,.17)\", 2);\n path([[360, 317], [348, 387], [377, 422]], \"rgba(220,229,224,.15)\", 1.5);\n for (let i = 0; i < 17; i++) {\n path([[348 + rand() * 118, 320 + rand() * 96], [350 + rand() * 117, 324 + rand() * 100]], \"rgba(223,230,222,.07)\", .8);\n }\n\n // right face\n ctx.save();\n ctx.translate(402, 270);\n ctx.rotate(.11);\n ellipse(0, 16, 18, 25, \"#896658\");\n ctx.fillStyle = \"#997160\";\n ctx.beginPath();\n ctx.moveTo(-16, 4); ctx.quadraticCurveTo(-14, -18, 1, -20);\n ctx.quadraticCurveTo(18, -17, 19, 5); ctx.quadraticCurveTo(16, 26, 0, 29);\n ctx.quadraticCurveTo(-13, 25, -16, 4); ctx.fill();\n // dark gray hair and wool hood\n ctx.fillStyle = \"#6d686a\";\n ctx.beginPath();\n ctx.moveTo(-21, 6); ctx.quadraticCurveTo(-19, -24, 1, -28);\n ctx.quadraticCurveTo(24, -24, 25, 5); ctx.lineTo(17, 10);\n ctx.quadraticCurveTo(14, -11, 1, -15); ctx.quadraticCurveTo(-12, -10, -16, 9); ctx.closePath(); ctx.fill();\n path([[-15, -5], [-8, -21], [4, -23], [16, -13]], \"rgba(230,228,216,.28)\", 1.3);\n path([[1, 2], [10, 2]], \"#443735\", 1.2);\n ellipse(7, 2, 1.3, .9, \"#29242a\");\n path([[9, 7], [13, 10], [8, 12]], \"rgba(73,45,42,.75)\", 1);\n path([[-1, 18], [9, 19]], \"rgba(91,46,48,.72)\", 1);\n ctx.restore();\n\n // Arms reaching toward tea\n poly([[163, 365], [184, 370], [225, 391], [217, 404], [179, 390], [154, 380]], \"#624d4c\");\n poly([[412, 365], [396, 374], [357, 394], [365, 406], [407, 389], [429, 377]], \"#73574e\");\n ellipse(223, 398, 9, 7, \"#aa806d\");\n ellipse(361, 401, 9, 7, \"#a77d69\");\n path([[218, 395], [223, 400], [229, 398]], \"rgba(67,43,40,.7)\", .7);\n path([[355, 398], [362, 402], [368, 398]], \"rgba(67,43,40,.7)\", .7);\n\n // Tea tray\n ellipse(291, 413, 69, 13, \"#17171a\");\n ellipse(291, 408, 61, 12, \"#665445\");\n ellipse(291, 406, 56, 8, \"#a4865f\");\n ellipse(291, 405, 50, 6, \"#55453d\");\n\n // cups\n function cup(x, y) {\n ctx.fillStyle = \"#d7c7ad\";\n poly([[x - 9, y], [x + 9, y], [x + 7, y + 15], [x - 6, y + 15]], \"#d1c0a5\");\n ellipse(x, y, 9, 3.5, \"#e5d4b4\");\n ellipse(x, y, 6.5, 2.2, \"#513326\");\n ctx.strokeStyle = \"#cdbb9b\";\n ctx.lineWidth = 2;\n ctx.beginPath(); ctx.arc(x + 9, y + 7, 5, -1.3, 1.3); ctx.stroke();\n path([[x - 5, y + 4], [x + 4, y + 4]], \"rgba(255,255,255,.25)\", 1);\n }\n cup(269, 397);\n cup(318, 400);\n\n // steam\n for (const [x, y] of [[269, 392], [318, 395]]) {\n ctx.save();\n ctx.strokeStyle = \"rgba(238,232,214,.28)\";\n ctx.lineWidth = 1.2;\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.bezierCurveTo(x - 7, y - 12, x + 7, y - 17, x - 1, y - 30);\n ctx.stroke();\n ctx.restore();\n }\n\n // Lantern body, foreground\n ellipse(324, 384, 34, 9, \"rgba(0,0,0,.38)\");\n ctx.fillStyle = \"#2e3435\";\n poly([[303, 335], [343, 335], [350, 376], [298, 376]], \"#4c4a42\");\n ctx.fillStyle = \"#262a29\";\n poly([[300, 330], [346, 330], [342, 339], [304, 339]], \"#252827\");\n ctx.strokeStyle = \"#a58a56\";\n ctx.lineWidth = 3;\n ctx.beginPath();\n ctx.arc(323, 332, 18, Math.PI, 0);\n ctx.stroke();\n\n const lanternGlow = ctx.createRadialGradient(323, 355, 2, 323, 355, 30);\n lanternGlow.addColorStop(0, \"#fff6c6\");\n lanternGlow.addColorStop(.25, \"#ffe38c\");\n lanternGlow.addColorStop(.7, \"#de9e41\");\n lanternGlow.addColorStop(1, \"#80512d\");\n ctx.fillStyle = lanternGlow;\n ctx.fillRect(307, 341, 32, 29);\n ctx.strokeStyle = \"#25292a\";\n ctx.lineWidth = 3;\n ctx.strokeRect(306, 339, 35, 35);\n path([[306, 350], [341, 350]], \"rgba(36,37,34,.7)\", 2);\n path([[306, 365], [341, 365]], \"rgba(36,37,34,.7)\", 2);\n ctx.fillStyle = \"#232728\";\n poly([[298, 375], [349, 375], [343, 383], [303, 383]], \"#282d2d\");\n\n // warm highlights from lamp\n ctx.save();\n ctx.globalCompositeOperation = \"screen\";\n ctx.fillStyle = \"rgba(255,197,102,.13)\";\n ellipse(270, 404, 44, 12, \"rgba(255,197,102,.16)\");\n ellipse(186, 389, 24, 30, \"rgba(255,197,102,.05)\");\n ellipse(406, 391, 26, 32, \"rgba(255,197,102,.05)\");\n ctx.restore();\n\n // Fine vignette\n const vignette = ctx.createRadialGradient(256, 270, 190, 256, 270, 420);\n vignette.addColorStop(.58, \"rgba(0,0,0,0)\");\n vignette.addColorStop(1, \"rgba(0,0,0,.65)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0, 0, W, H);\n\n // subtle film grain\n ctx.save();\n ctx.globalAlpha = .1;\n for (let i = 0; i < 3800; i++) {\n const x = rand() * W, y = rand() * H;\n ctx.fillStyle = rand() > .5 ? \"#fff\" : \"#000\";\n ctx.fillRect(x, y, 1, 1);\n }\n ctx.restore();\n}"}], "metadata": {"id": "val-v1-broad-v2-affection-validation-003", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 6657, "code_sha256": "7f49771169061d0d54d7d3f70895679a16be3e0bce9b6dc13e2d3df04a83dc1c"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A parent and child sit inside an open refrigerator doorway, laughing softly as they share fruit beneath a nearby lantern's glow."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;overflow:hidden;position:relative;background:#10151a;\";\n \n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = 1024;\n canvas.style.cssText = \"width:512px;height:512px;display:block;\";\n stage.appendChild(canvas);\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(2, 2);\n\n const W = 512, H = 512;\n const rnd = (() => {\n let s = 472019;\n return () => ((s = (s * 16807) % 2147483647) / 2147483647);\n })();\n\n function rect(x, y, w, h, fill, r = 0) {\n ctx.beginPath();\n if (r) {\n ctx.roundRect(x, y, w, h, r);\n } else ctx.rect(x, y, w, h);\n ctx.fillStyle = fill;\n ctx.fill();\n }\n function path(points, fill, stroke, width = 1) {\n ctx.beginPath();\n points.forEach((p, i) => {\n if (i === 0) ctx.moveTo(p[0], p[1]);\n else if (p.length === 2) ctx.lineTo(p[0], p[1]);\n else ctx.bezierCurveTo(...p);\n });\n if (fill) {\n ctx.fillStyle = fill;\n ctx.fill();\n }\n if (stroke) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = width;\n ctx.stroke();\n }\n }\n function ellipse(x, y, rx, ry, fill) {\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n ctx.fillStyle = fill;\n ctx.fill();\n }\n function line(x1, y1, x2, y2, col, width) {\n ctx.beginPath();\n ctx.moveTo(x1, y1); ctx.lineTo(x2, y2);\n ctx.strokeStyle = col; ctx.lineWidth = width; ctx.stroke();\n }\n function gradient(x1, y1, x2, y2, stops) {\n const g = ctx.createLinearGradient(x1, y1, x2, y2);\n stops.forEach(s => g.addColorStop(s[0], s[1]));\n return g;\n }\n\n // dim kitchen behind refrigerator\n rect(0, 0, W, H, gradient(0, 0, 512, 512, [\n [0, \"#071016\"], [0.45, \"#131d22\"], [1, \"#05090c\"]\n ]));\n rect(8, 40, 73, 430, gradient(0, 0, 70, 0, [[0, \"#05090c\"], [1, \"#253238\"]]));\n rect(16, 58, 54, 12, \"#38464a\", 2);\n rect(19, 76, 50, 2, \"#10171b\");\n rect(1, 463, 511, 49, gradient(0, 0, 0, 512, [[0, \"#202a2e\"], [1, \"#070b0d\"]]));\n for (let i = 0; i < 30; i++) {\n const x = rnd() * 512, y = 440 + rnd() * 72;\n line(x, y, x + 30 + rnd() * 90, y + 4 + rnd() * 10, \"rgba(123,139,137,.12)\", .5);\n }\n\n // refrigerator outer shell\n ctx.shadowColor = \"rgba(0,0,0,.7)\";\n ctx.shadowBlur = 22;\n rect(76, 22, 351, 451, \"#c9d6d5\", 12);\n ctx.shadowBlur = 0;\n rect(81, 27, 339, 442, gradient(80, 0, 420, 0, [\n [0, \"#e5efed\"], [.18, \"#f9ffff\"], [.58, \"#b9cbcd\"], [1, \"#7f999d\"]\n ]), 9);\n rect(91, 41, 312, 413, \"#52696d\", 5);\n \n // glowing fridge interior\n rect(98, 49, 299, 396, gradient(0, 49, 0, 445, [\n [0, \"#d9f0f2\"], [.25, \"#94b8c1\"], [.70, \"#4d737b\"], [1, \"#223e45\"]\n ]), 3);\n rect(105, 58, 285, 375, gradient(0, 40, 0, 430, [\n [0, \"#d7f4f4\"], [.17, \"#9fc6cd\"], [.53, \"#5e848a\"], [1, \"#2c4b52\"]\n ]), 2);\n\n // ceiling inside fridge\n path([[105,58],[390,58],[373,87],[123,87]], gradient(0, 55, 0, 92, [\n [0,\"#efffff\"], [1,\"#abcbd0\"]\n ]));\n rect(136, 65, 135, 8, \"#efffff\", 4);\n ctx.shadowColor = \"#c2f5f6\"; ctx.shadowBlur = 18;\n rect(147, 67, 110, 3, \"#ffffff\", 2);\n ctx.shadowBlur = 0;\n\n // refrigerator wall details\n rect(108, 94, 8, 306, \"rgba(220,247,246,.35)\");\n rect(377, 90, 8, 318, \"rgba(22,54,62,.38)\");\n line(116, 140, 379, 140, \"rgba(226,250,248,.28)\", 2);\n line(114, 342, 381, 342, \"rgba(15,41,47,.58)\", 4);\n line(114, 347, 381, 347, \"rgba(203,236,233,.42)\", 1);\n\n // rear shelf objects\n rect(123, 108, 40, 24, \"rgba(100,145,151,.55)\", 2);\n ellipse(143, 109, 17, 5, \"#c5e4e3\");\n rect(303, 103, 49, 29, \"rgba(124,170,174,.65)\", 2);\n ellipse(327, 103, 24, 5, \"#d1ecea\");\n rect(324, 115, 6, 11, \"#6b9ba0\");\n \n // bottom shelf\n path([[105,407],[391,407],[407,454],[84,454]], gradient(0, 404, 0, 456, [\n [0,\"#b8d2d1\"], [.16,\"#e6f4ef\"], [1,\"#65898b\"]\n ]));\n line(89, 448, 404, 448, \"rgba(255,255,255,.65)\", 2);\n\n // open refrigerator door, right side\n ctx.save();\n ctx.translate(418, 16);\n path([[0,12],[79,0],[96,448],[4,462]], gradient(0,0,100,0, [\n [0,\"#d9e5e2\"], [.45,\"#8fa9ab\"], [1,\"#4b666c\"]\n ]));\n path([[10,34],[65,26],[77,415],[14,426]], \"#aec3c1\");\n path([[18,51],[61,46],[64,159],[21,165]], gradient(0,40,0,165, [\n [0,\"#d8e9e7\"],[1,\"#719397\"]\n ]));\n path([[22,181],[66,177],[69,281],[26,287]], \"#88a8aa\");\n path([[27,304],[72,300],[75,401],[31,407]], \"#7d9da0\");\n line(4, 35, 13, 430, \"#effaf5\", 3);\n ctx.restore();\n\n // lantern halo\n const halo = ctx.createRadialGradient(436, 108, 4, 436, 108, 115);\n halo.addColorStop(0, \"rgba(255,211,115,.52)\");\n halo.addColorStop(.32, \"rgba(255,180,65,.18)\");\n halo.addColorStop(1, \"rgba(255,168,63,0)\");\n ctx.fillStyle = halo;\n ctx.fillRect(320, 0, 192, 240);\n\n // hanging lantern cord and lantern\n line(438, 0, 438, 45, \"#212729\", 2);\n ellipse(438, 43, 7, 4, \"#2a2c29\");\n path([[429,48],[447,48],[454,59],[451,101],[425,101],[422,59]], \"#2b302c\");\n path([[427,60],[449,60],[447,96],[429,96]], gradient(0,60,0,98, [\n [0,\"#ffe5a0\"],[.4,\"#ffc55b\"],[1,\"#dd772d\"]\n ]));\n rect(424, 57, 29, 4, \"#48473b\", 2);\n rect(425, 97, 27, 5, \"#403d32\", 2);\n line(432, 60, 431, 97, \"#5d5036\", 2);\n line(444, 60, 445, 97, \"#5d5036\", 2);\n ellipse(438, 101, 13, 3, \"#242921\");\n\n // warm spill over figures\n const warm = ctx.createRadialGradient(397, 145, 10, 317, 264, 220);\n warm.addColorStop(0, \"rgba(255,183,83,.25)\");\n warm.addColorStop(1, \"rgba(255,166,63,0)\");\n ctx.fillStyle = warm;\n ctx.fillRect(110, 80, 300, 360);\n\n // Parent legs behind\n path([[160,351],[216,339],[262,382],[243,419],[188,404]], \"#304f5a\");\n path([[224,370],[287,387],[314,422],[291,439],[240,409]], \"#263f4b\");\n path([[184,400],[231,404],[222,426],[176,422]], \"#a97852\");\n path([[285,419],[318,423],[319,438],[276,438]], \"#9e704e\");\n\n // parent torso sweater\n path([[151,252],[196,234],[239,254],[261,335],[229,370],[165,353],[141,303]], gradient(140,230,262,365, [\n [0,\"#b0593d\"], [.55,\"#86392f\"], [1,\"#4c2830\"]\n ]));\n path([[161,260],[184,251],[202,348],[176,351]], \"rgba(225,121,73,.34)\");\n path([[227,261],[244,281],[251,325]], null, \"rgba(48,24,28,.55)\", 3);\n\n // parent neck\n path([[181,226],[210,223],[213,249],[192,260],[178,246]], \"#b77451\");\n ellipse(195, 235, 14, 12, \"rgba(247,171,113,.24)\");\n\n // parent hair back\n ellipse(178, 196, 35, 43, \"#312229\");\n path([[158,184],[165,153],[204,147],[228,170],[223,211],[209,233],[165,223]], \"#2a2024\");\n // parent face\n path([[169,166],[193,153],[216,166],[217,196],[205,221],[185,225],[168,207]], gradient(160,150,218,225, [\n [0,\"#d59268\"], [.7,\"#b96e50\"], [1,\"#8e4c3e\"]\n ]));\n // hair fringe\n path([[161,178],[166,154],[195,147],[216,163],[205,175],[190,165],[181,181],[172,173]], \"#2b2024\");\n // ear\n ellipse(215, 193, 6, 8, \"#aa6048\");\n // laughing eyes\n ctx.lineCap = \"round\";\n path([[177,190],[182,193],[187,190]], null, \"#3d2929\", 1.8);\n path([[198,189],[203,192],[208,189]], null, \"#3d2929\", 1.8);\n // parent open laugh\n ctx.beginPath();\n ctx.moveTo(184, 202); ctx.quadraticCurveTo(193, 213, 204, 201);\n ctx.quadraticCurveTo(196, 223, 185, 204);\n ctx.fillStyle = \"#542b31\"; ctx.fill();\n path([[188,205],[199,205]], null, \"#fff0df\", 1.5);\n // cheek glow\n ellipse(176, 199, 7, 4, \"rgba(235,126,101,.35)\");\n ellipse(208, 199, 6, 4, \"rgba(235,126,101,.3)\");\n\n // Parent arm reaching around child\n path([[224,267],[243,275],[261,314],[279,331],[269,342],[249,326],[227,292]], \"#b96d50\");\n ellipse(275, 334, 10, 7, \"#c77a58\");\n\n // child legs\n path([[277,371],[333,367],[355,400],[337,424],[296,403]], \"#d8a638\");\n path([[326,372],[366,381],[384,417],[360,430],[326,401]], \"#c88c28\");\n path([[298,402],[340,417],[333,433],[289,427]], \"#f2d8ba\");\n path([[359,416],[392,421],[390,435],[350,432]], \"#f0d4b5\");\n\n // child shirt\n path([[265,281],[299,267],[340,284],[354,360],[327,383],[274,371],[254,323]], gradient(255,271,355,378, [\n [0,\"#f2c84d\"], [.5,\"#d99231\"], [1,\"#a75630\"]\n ]));\n path([[273,287],[286,278],[299,370],[281,368]], \"rgba(255,232,124,.3)\");\n path([[329,290],[341,354]], null, \"rgba(105,55,38,.35)\", 2);\n\n // child neck\n path([[290,252],[318,249],[320,279],[300,286],[288,271]], \"#c98259\");\n\n // child hair back\n ellipse(299, 221, 37, 44, \"#4b3024\");\n path([[267,225],[271,187],[295,170],[327,181],[340,212],[331,253],[305,270],[276,252]], \"#4b3024\");\n // child face\n path([[274,197],[294,181],[321,190],[330,216],[323,244],[306,261],[283,250],[272,225]], gradient(270,180,330,262, [\n [0,\"#e5a174\"], [.7,\"#c57a55\"], [1,\"#9f573e\"]\n ]));\n // curls/fringe\n path([[270,207],[272,189],[290,174],[316,181],[330,199],[318,202],[310,193],[301,203],[289,191],[280,212]], \"#422b23\");\n ellipse(275, 206, 10, 13, \"#432b23\");\n ellipse(325, 205, 9, 14, \"#432b23\");\n // child happy eyes\n path([[283,220],[289,223],[295,219]], null, \"#4b2d29\", 2);\n path([[307,219],[313,222],[319,218]], null, \"#4b2d29\", 2);\n // child laugh mouth\n ctx.beginPath();\n ctx.moveTo(291, 232);\n ctx.quadraticCurveTo(303, 243, 316, 231);\n ctx.quadraticCurveTo(305, 252, 291, 232);\n ctx.fillStyle = \"#5c2b2d\"; ctx.fill();\n path([[295,235],[311,235]], null, \"#fff3de\", 2);\n ellipse(283, 229, 7, 4, \"rgba(243,128,102,.35)\");\n ellipse(319, 229, 7, 4, \"rgba(243,128,102,.35)\");\n\n // child arm holding fruit\n path([[332,294],[349,300],[338,330],[319,344],[310,335],[324,317]], \"#ce8159\");\n ellipse(314, 338, 10, 7, \"#d78b60\");\n\n // fruit bowl in foreground\n ctx.shadowColor = \"rgba(0,0,0,.38)\";\n ctx.shadowBlur = 8;\n ellipse(254, 373, 57, 14, \"#183e48\");\n ctx.shadowBlur = 0;\n path([[202,366],[307,366],[293,405],[221,409]], gradient(0,365,0,410, [\n [0,\"#e9eee2\"],[.25,\"#aac8c5\"],[1,\"#47747a\"]\n ]));\n ellipse(254, 367, 53, 12, \"#d8eee6\");\n ellipse(254, 368, 46, 9, \"#426c70\");\n\n // fruit\n ellipse(225, 359, 12, 10, \"#e94d35\");\n ellipse(245, 355, 11, 11, \"#f19b2e\");\n ellipse(264, 356, 12, 10, \"#d94731\");\n ellipse(281, 359, 12, 10, \"#f3b52e\");\n ellipse(238, 366, 11, 8, \"#74a949\");\n ellipse(270, 367, 11, 8, \"#8abe48\");\n ellipse(220, 354, 3, 3, \"#ffe07d\");\n ellipse(260, 351, 3, 3, \"#ffd77b\");\n line(226, 350, 229, 345, \"#4d7139\", 1.5);\n line(267, 349, 270, 344, \"#4d7139\", 1.5);\n\n // foreground fridge lip\n rect(87, 449, 318, 10, gradient(0,0,0,10, [[0,\"#eff9f3\"],[1,\"#718e91\"]]), 2);\n rect(102, 459, 284, 7, \"#557378\", 2);\n\n // subtle grain\n for (let i = 0; i < 1700; i++) {\n const x = rnd() * W, y = rnd() * H;\n ctx.fillStyle = rnd() > .5 ? \"rgba(255,255,255,.018)\" : \"rgba(0,0,0,.022)\";\n ctx.fillRect(x, y, 1, 1);\n }\n\n // vignette\n const vig = ctx.createRadialGradient(256, 245, 190, 256, 255, 390);\n vig.addColorStop(.55, \"rgba(0,0,0,0)\");\n vig.addColorStop(1, \"rgba(0,0,0,.56)\");\n ctx.fillStyle = vig;\n ctx.fillRect(0, 0, W, H);\n}"}], "metadata": {"id": "val-v1-broad-v2-affection-validation-004", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 6446, "code_sha256": "87ec4cb7d720e14df19bb96851d43f16a6e5f02df6befb3829f42e5a3eebf863"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A young couple slow-dances barefoot in a dim kitchen, illuminated by clustered candles while the microwave display stays black."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"position:relative;width:512px;height:512px;overflow:hidden;background:#120f0e;\";\n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = 1024;\n canvas.style.cssText = \"width:512px;height:512px;display:block;\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(2, 2);\n\n const W = 512, H = 512;\n const lerp = (a, b, t) => a + (b - a) * t;\n\n function poly(points, fill, stroke, lw = 1) {\n ctx.beginPath();\n points.forEach((p, i) => i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]));\n ctx.closePath();\n if (fill) ctx.fillStyle = fill, ctx.fill();\n if (stroke) ctx.strokeStyle = stroke, ctx.lineWidth = lw, ctx.stroke();\n }\n\n function roundRect(x, y, w, h, r, fill, stroke) {\n ctx.beginPath();\n ctx.roundRect(x, y, w, h, r);\n if (fill) ctx.fillStyle = fill, ctx.fill();\n if (stroke) ctx.strokeStyle = stroke, ctx.stroke();\n }\n\n function ellipse(x, y, rx, ry, fill) {\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n ctx.fillStyle = fill;\n ctx.fill();\n }\n\n function candle(x, y, h, w, wax) {\n ctx.save();\n const flame = ctx.createRadialGradient(x, y - h - 10, 1, x, y - h - 10, 35);\n flame.addColorStop(0, \"rgba(255,241,175,.92)\");\n flame.addColorStop(.15, \"rgba(255,177,59,.65)\");\n flame.addColorStop(1, \"rgba(255,136,32,0)\");\n ctx.fillStyle = flame;\n ctx.beginPath();\n ctx.arc(x, y - h - 10, 35, 0, Math.PI * 2);\n ctx.fill();\n\n ctx.fillStyle = wax;\n roundRect(x - w / 2, y - h, w, h, 2, wax);\n ctx.fillStyle = \"rgba(255,216,145,.34)\";\n ctx.fillRect(x - w / 2 + 2, y - h + 3, 2, h - 5);\n ctx.fillStyle = \"rgba(57,30,17,.9)\";\n ctx.fillRect(x - 1, y - h - 4, 2, 6);\n const fg = ctx.createLinearGradient(x, y - h - 16, x, y - h - 3);\n fg.addColorStop(0, \"#fff9bc\");\n fg.addColorStop(.4, \"#ffc14e\");\n fg.addColorStop(1, \"#e66f22\");\n ctx.fillStyle = fg;\n ctx.beginPath();\n ctx.moveTo(x, y - h - 18);\n ctx.bezierCurveTo(x - 6, y - h - 11, x - 4, y - h - 5, x, y - h - 3);\n ctx.bezierCurveTo(x + 5, y - h - 8, x + 5, y - h - 13, x, y - h - 18);\n ctx.fill();\n ctx.restore();\n }\n\n // dark kitchen walls\n const bg = ctx.createLinearGradient(0, 0, 0, H);\n bg.addColorStop(0, \"#171516\");\n bg.addColorStop(.48, \"#24201d\");\n bg.addColorStop(1, \"#120e0d\");\n ctx.fillStyle = bg;\n ctx.fillRect(0, 0, W, H);\n\n // upper cabinets\n ctx.fillStyle = \"#252020\";\n ctx.fillRect(0, 20, 157, 127);\n ctx.fillRect(355, 21, 157, 126);\n ctx.fillStyle = \"#0b0b0c\";\n ctx.fillRect(159, 20, 194, 116);\n ctx.strokeStyle = \"rgba(111,84,61,.24)\";\n ctx.lineWidth = 2;\n ctx.strokeRect(4, 21, 151, 126);\n ctx.strokeRect(357, 22, 151, 125);\n ctx.strokeRect(164, 26, 184, 104);\n\n // microwave black display / appliance\n roundRect(174, 43, 164, 70, 5, \"#151415\", \"#5d564e\");\n roundRect(182, 50, 111, 47, 2, \"#030405\", \"#25282a\");\n ctx.fillStyle = \"rgba(24,27,30,.65)\";\n ctx.fillRect(186, 54, 103, 4);\n roundRect(301, 51, 27, 45, 2, \"#252323\", \"#4a433e\");\n for (let i = 0; i < 9; i++) {\n ctx.fillStyle = \"#36302b\";\n ctx.fillRect(306 + (i % 3) * 6, 58 + Math.floor(i / 3) * 8, 3, 3);\n }\n\n // backsplash\n ctx.fillStyle = \"#403830\";\n ctx.fillRect(0, 148, 512, 102);\n ctx.strokeStyle = \"rgba(200,164,117,.12)\";\n ctx.lineWidth = 1;\n for (let y = 151; y < 249; y += 24) {\n ctx.beginPath(); ctx.moveTo(0, y); ctx.lineTo(512, y); ctx.stroke();\n }\n for (let x = -18; x < 512; x += 54) {\n ctx.beginPath(); ctx.moveTo(x, 148); ctx.lineTo(x, 250); ctx.stroke();\n }\n\n // countertop\n const counter = ctx.createLinearGradient(0, 245, 0, 304);\n counter.addColorStop(0, \"#6a5140\");\n counter.addColorStop(.15, \"#241b18\");\n counter.addColorStop(1, \"#151111\");\n ctx.fillStyle = counter;\n ctx.fillRect(0, 246, 512, 65);\n ctx.fillStyle = \"#130e0d\";\n ctx.fillRect(0, 300, 512, 11);\n ctx.fillStyle = \"#2a201d\";\n ctx.fillRect(0, 311, 512, 101);\n\n // kitchen objects\n ctx.fillStyle = \"#151414\";\n roundRect(28, 198, 63, 46, 4, \"#242021\");\n ctx.fillStyle = \"#4c3f35\";\n ctx.fillRect(37, 203, 44, 28);\n ctx.fillStyle = \"#100f0e\";\n ctx.fillRect(41, 206, 36, 22);\n ctx.fillStyle = \"#80624d\";\n ctx.fillRect(99, 209, 33, 4);\n ctx.fillRect(113, 189, 4, 25);\n\n // sink at right\n ctx.fillStyle = \"#171717\";\n ctx.beginPath();\n ctx.ellipse(405, 268, 61, 18, 0, 0, Math.PI * 2);\n ctx.fill();\n ctx.fillStyle = \"#312a29\";\n ctx.beginPath();\n ctx.ellipse(405, 264, 51, 12, 0, 0, Math.PI * 2);\n ctx.fill();\n ctx.strokeStyle = \"#87705c\";\n ctx.lineWidth = 4;\n ctx.beginPath();\n ctx.moveTo(412, 247);\n ctx.lineTo(412, 225);\n ctx.bezierCurveTo(412, 210, 439, 210, 439, 226);\n ctx.lineTo(439, 235);\n ctx.stroke();\n\n // warm candle illumination pools\n const glow = ctx.createRadialGradient(112, 255, 10, 112, 255, 270);\n glow.addColorStop(0, \"rgba(255,178,75,.38)\");\n glow.addColorStop(.32, \"rgba(241,135,55,.16)\");\n glow.addColorStop(1, \"rgba(241,120,30,0)\");\n ctx.fillStyle = glow;\n ctx.fillRect(0, 70, 430, 442);\n\n const floor = ctx.createLinearGradient(0, 382, 0, 512);\n floor.addColorStop(0, \"#231816\");\n floor.addColorStop(1, \"#0c0909\");\n ctx.fillStyle = floor;\n ctx.fillRect(0, 382, 512, 130);\n ctx.strokeStyle = \"rgba(138,87,53,.18)\";\n ctx.lineWidth = 1;\n for (let i = -160; i < 620; i += 72) {\n ctx.beginPath();\n ctx.moveTo(i, 512);\n ctx.lineTo(256 + (i - 256) * .36, 383);\n ctx.stroke();\n }\n for (let y = 410; y < 510; y += 35) {\n ctx.beginPath(); ctx.moveTo(0, y); ctx.lineTo(512, y); ctx.stroke();\n }\n\n // dancing shadows\n ctx.save();\n ctx.filter = \"blur(11px)\";\n ellipse(253, 469, 125, 25, \"rgba(0,0,0,.56)\");\n ellipse(217, 424, 86, 56, \"rgba(0,0,0,.27)\");\n ctx.restore();\n\n // man's rear arm\n ctx.strokeStyle = \"#8f5e43\";\n ctx.lineWidth = 18;\n ctx.lineCap = \"round\";\n ctx.beginPath();\n ctx.moveTo(269, 252);\n ctx.bezierCurveTo(309, 268, 329, 289, 343, 314);\n ctx.stroke();\n ellipse(345, 317, 11, 8, \"#9e694a\");\n\n // man's legs in dark trousers\n poly([[229,357],[274,356],[282,415],[276,471],[254,471],[250,416],[238,385],[229,453],[205,454],[207,405]], \"#1b1b20\");\n ctx.fillStyle = \"rgba(111,91,77,.26)\";\n ctx.fillRect(255, 365, 4, 84);\n\n // man's bare feet\n ellipse(260, 475, 23, 9, \"#a96e4d\");\n ellipse(207, 457, 23, 8, \"#a36b4d\");\n ctx.fillStyle = \"#d39164\";\n ctx.fillRect(246, 449, 17, 23);\n ctx.fillRect(207, 434, 15, 22);\n\n // man's torso / shirt\n const shirt = ctx.createLinearGradient(211, 233, 290, 362);\n shirt.addColorStop(0, \"#443a37\");\n shirt.addColorStop(.6, \"#27282a\");\n shirt.addColorStop(1, \"#161719\");\n poly([[221,239],[252,224],[279,245],[290,307],[275,365],[225,360],[208,309]], shirt);\n ctx.fillStyle = \"rgba(229,166,96,.12)\";\n ctx.beginPath();\n ctx.moveTo(247, 239); ctx.lineTo(255, 353); ctx.lineTo(262, 348); ctx.lineTo(257, 236); ctx.fill();\n\n // man neck\n poly([[238,214],[260,211],[264,240],[248,252],[237,237]], \"#9f6749\");\n ctx.fillStyle = \"#d49262\";\n ctx.fillRect(242, 216, 14, 22);\n\n // man head\n ellipse(249, 190, 25, 31, \"#a76b4d\");\n ctx.fillStyle = \"#d28b5d\";\n ctx.beginPath();\n ctx.ellipse(243, 190, 17, 25, -.16, 0, Math.PI*2); ctx.fill();\n // man's hair\n ctx.fillStyle = \"#211514\";\n ctx.beginPath();\n ctx.ellipse(247, 176, 24, 17, -.18, Math.PI, Math.PI * 2);\n ctx.lineTo(267, 188); ctx.lineTo(264, 177); ctx.fill();\n ctx.fillStyle = \"#36201a\";\n ctx.beginPath();\n ctx.arc(242, 180, 15, 3.3, 5.8); ctx.fill();\n // face detail\n ctx.strokeStyle = \"rgba(65,35,27,.75)\";\n ctx.lineWidth = 1.3;\n ctx.beginPath(); ctx.moveTo(253, 193); ctx.lineTo(258, 193); ctx.stroke();\n ctx.beginPath(); ctx.moveTo(252, 205); ctx.quadraticCurveTo(258, 209, 263, 204); ctx.stroke();\n\n // woman's legs behind / dress shadow\n poly([[286,348],[319,354],[326,411],[339,463],[320,467],[300,414],[288,385],[281,457],[260,457],[263,398]], \"#5b3936\");\n ctx.fillStyle = \"#cc8762\";\n ctx.fillRect(320, 442, 15, 22);\n ctx.fillRect(263, 436, 14, 22);\n ellipse(330, 466, 22, 8, \"#c8825e\");\n ellipse(262, 459, 20, 7, \"#be7957\");\n\n // woman's dress\n const dress = ctx.createLinearGradient(271, 240, 333, 401);\n dress.addColorStop(0, \"#8d5149\");\n dress.addColorStop(.52, \"#593334\");\n dress.addColorStop(1, \"#2b1b21\");\n poly([[273,247],[299,236],[321,259],[325,310],[350,383],[320,402],[284,390],[268,328]], dress);\n ctx.fillStyle = \"rgba(249,156,102,.18)\";\n ctx.beginPath();\n ctx.moveTo(285,255); ctx.quadraticCurveTo(295,322,299,382); ctx.lineTo(307,390); ctx.lineTo(302,254); ctx.fill();\n\n // woman's near arm around man\n ctx.strokeStyle = \"#ca8865\";\n ctx.lineWidth = 15;\n ctx.lineCap = \"round\";\n ctx.beginPath();\n ctx.moveTo(288,265);\n ctx.bezierCurveTo(276,276, 267,280, 253,275);\n ctx.bezierCurveTo(241,269, 230,261, 222,255);\n ctx.stroke();\n ellipse(220, 254, 8, 7, \"#d3936d\");\n\n // woman's neck / head\n poly([[286,221],[304,218],[307,246],[295,255],[284,240]], \"#d18b67\");\n ellipse(294, 197, 24, 31, \"#d68f69\");\n ctx.fillStyle = \"#e5a477\";\n ctx.beginPath(); ctx.ellipse(299, 199, 17, 24, .14, 0, Math.PI * 2); ctx.fill();\n // long hair\n const hair = ctx.createLinearGradient(271, 166, 317, 252);\n hair.addColorStop(0, \"#2b1815\");\n hair.addColorStop(1, \"#100d0d\");\n ctx.fillStyle = hair;\n ctx.beginPath();\n ctx.ellipse(292, 183, 27, 24, .15, 0, Math.PI * 2);\n ctx.bezierCurveTo(319, 190, 318, 217, 310, 245);\n ctx.lineTo(302, 239);\n ctx.bezierCurveTo(307, 211, 301, 195, 279, 193);\n ctx.fill();\n ctx.fillStyle = \"#48251d\";\n ctx.beginPath();\n ctx.arc(291, 177, 19, 3.2, 6.1); ctx.fill();\n // face profile and eye\n ctx.fillStyle = \"#663d30\";\n ellipse(305, 197, 1.7, 1.3, \"#4b2923\");\n ctx.strokeStyle = \"rgba(102,50,40,.85)\";\n ctx.lineWidth = 1.2;\n ctx.beginPath(); ctx.moveTo(308, 210); ctx.quadraticCurveTo(304, 214, 299, 211); ctx.stroke();\n\n // hands clasped close to bodies\n ellipse(273, 286, 10, 7, \"#c98762\");\n ellipse(278, 282, 8, 6, \"#a96d50\");\n\n // candle cluster foreground left\n ctx.save();\n ctx.globalAlpha = .95;\n candle(74, 301, 37, 10, \"#e9d6b0\");\n candle(92, 302, 52, 13, \"#f0d4aa\");\n candle(108, 304, 28, 9, \"#d7c5aa\");\n candle(126, 303, 44, 11, \"#f1ddbb\");\n candle(144, 304, 24, 8, \"#dfc29e\");\n ctx.restore();\n\n // counter reflections\n ctx.save();\n ctx.globalCompositeOperation = \"screen\";\n ctx.fillStyle = \"rgba(255,162,55,.16)\";\n ctx.beginPath();\n ctx.ellipse(110, 311, 77, 9, 0, 0, Math.PI*2);\n ctx.fill();\n ctx.restore();\n\n // fine atmospheric grain\n const image = ctx.getImageData(0, 0, 1024, 1024);\n const d = image.data;\n for (let i = 0; i < d.length; i += 4) {\n const n = (Math.random() - .5) * 7;\n d[i] += n; d[i + 1] += n; d[i + 2] += n;\n }\n ctx.putImageData(image, 0, 0);\n\n // vignette\n const vignette = ctx.createRadialGradient(256, 270, 180, 256, 270, 395);\n vignette.addColorStop(.45, \"rgba(0,0,0,0)\");\n vignette.addColorStop(1, \"rgba(0,0,0,.68)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0, 0, W, H);\n}"}], "metadata": {"id": "val-v1-broad-v2-affection-validation-007", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 5566, "code_sha256": "0defadad2f5d7e559cc6d02c03b4402da0a905d49dd64939c6c1e082c321d87f"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A husband gently drapes a blanket around his husband's shoulders as they sit before dark windows with three candles glowing on the sill."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;overflow:hidden;position:relative;background:#14151b;\";\n\n const svgNS = \"http://www.w3.org/2000/svg\";\n const svg = document.createElementNS(svgNS, \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 512 512\");\n svg.setAttribute(\"width\", \"512\");\n svg.setAttribute(\"height\", \"512\");\n svg.style.display = \"block\";\n\n svg.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n `;\n\n stage.appendChild(svg);\n}"}], "metadata": {"id": "val-v1-broad-v2-affection-validation-008", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 6336, "code_sha256": "8e0fc5a5645dbd3b965696ae283671a03b497e1c57f09ac2a5d3ccaf12565baa"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A long refracting telescope points through an open observatory dome, with a brass objective tube, focusing knobs, equatorial mount, and counterweight."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n const canvas = document.createElement(\"canvas\");\n canvas.width = 1024;\n canvas.height = 1024;\n canvas.style.width = \"512px\";\n canvas.style.height = \"512px\";\n canvas.style.display = \"block\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(2, 2);\n\n const W = 512, H = 512;\n const rnd = (a, b) => a + Math.random() * (b - a);\n\n function path(points, close = true) {\n ctx.beginPath();\n points.forEach((p, i) => i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]));\n if (close) ctx.closePath();\n }\n\n function metalRect(x, y, w, h, colors, r = 0) {\n const g = ctx.createLinearGradient(x, y, x, y + h);\n colors.forEach(([s, c]) => g.addColorStop(s, c));\n ctx.fillStyle = g;\n if (r) {\n ctx.beginPath();\n ctx.roundRect(x, y, w, h, r);\n ctx.fill();\n } else ctx.fillRect(x, y, w, h);\n }\n\n // Deep evening sky seen through the dome\n const sky = ctx.createLinearGradient(0, 0, 0, 310);\n sky.addColorStop(0, \"#07101d\");\n sky.addColorStop(.48, \"#102744\");\n sky.addColorStop(1, \"#4b5868\");\n ctx.fillStyle = sky;\n ctx.fillRect(0, 0, W, H);\n\n // faint clouds\n for (let i = 0; i < 18; i++) {\n const x = rnd(-60, 500), y = rnd(35, 270);\n const g = ctx.createRadialGradient(x, y, 0, x, y, rnd(32, 85));\n g.addColorStop(0, \"rgba(148,174,194,.12)\");\n g.addColorStop(1, \"rgba(148,174,194,0)\");\n ctx.fillStyle = g;\n ctx.fillRect(x - 100, y - 80, 200, 160);\n }\n\n // stars\n for (let i = 0; i < 78; i++) {\n const x = rnd(14, 497), y = rnd(8, 244), r = rnd(.25, 1.05);\n ctx.fillStyle = `rgba(220,235,255,${rnd(.32, .9)})`;\n ctx.beginPath();\n ctx.arc(x, y, r, 0, Math.PI * 2);\n ctx.fill();\n }\n\n // Observatory dome inner shell\n ctx.fillStyle = \"#17191d\";\n ctx.beginPath();\n ctx.arc(256, 330, 321, Math.PI, 0);\n ctx.lineTo(512, 410);\n ctx.lineTo(0, 410);\n ctx.closePath();\n ctx.fill();\n\n // Dome opening, arched\n ctx.save();\n ctx.beginPath();\n ctx.arc(255, 327, 266, Math.PI * 1.12, Math.PI * 1.88, true);\n ctx.lineTo(429, 62);\n ctx.lineTo(470, 89);\n ctx.arc(255, 327, 266, Math.PI * 1.88, Math.PI * 1.12, false);\n ctx.closePath();\n ctx.clip();\n\n const opening = ctx.createLinearGradient(0, 0, 0, 320);\n opening.addColorStop(0, \"rgba(7,17,31,.92)\");\n opening.addColorStop(.62, \"rgba(22,52,78,.75)\");\n opening.addColorStop(1, \"rgba(106,117,122,.65)\");\n ctx.fillStyle = opening;\n ctx.fillRect(0, 0, 512, 350);\n ctx.restore();\n\n // dome ribs\n ctx.save();\n ctx.strokeStyle = \"rgba(101,106,111,.27)\";\n ctx.lineWidth = 5;\n for (let i = -3; i <= 3; i++) {\n ctx.beginPath();\n ctx.arc(256 + i * 75, 338, 289, Math.PI * 1.05, Math.PI * 1.94);\n ctx.stroke();\n }\n ctx.restore();\n\n // dark dome edge and shutter rails\n ctx.strokeStyle = \"#08090b\";\n ctx.lineWidth = 18;\n ctx.beginPath();\n ctx.arc(256, 326, 286, Math.PI * 1.08, Math.PI * 1.92);\n ctx.stroke();\n ctx.strokeStyle = \"#515359\";\n ctx.lineWidth = 3;\n ctx.beginPath();\n ctx.arc(256, 326, 279, Math.PI * 1.08, Math.PI * 1.92);\n ctx.stroke();\n\n // floor / lower observatory\n const floor = ctx.createLinearGradient(0, 367, 0, 512);\n floor.addColorStop(0, \"#353433\");\n floor.addColorStop(1, \"#111113\");\n ctx.fillStyle = floor;\n ctx.fillRect(0, 368, 512, 144);\n ctx.fillStyle = \"rgba(205,181,126,.09)\";\n ctx.beginPath();\n ctx.ellipse(261, 447, 252, 74, 0, 0, Math.PI * 2);\n ctx.fill();\n\n // telescope group aligned toward upper right\n ctx.save();\n ctx.translate(235, 272);\n ctx.rotate(-0.69);\n\n // rear body / focuser\n metalRect(-102, -29, 50, 58, [\n [0, \"#11191c\"], [.18, \"#4d5655\"], [.42, \"#0d1113\"], [.68, \"#505755\"], [1, \"#121517\"]\n ], 4);\n ctx.strokeStyle = \"#06090a\";\n ctx.lineWidth = 3;\n ctx.strokeRect(-101, -28, 49, 56);\n\n // eyepiece assembly\n metalRect(-140, -18, 42, 36, [\n [0, \"#101416\"], [.2, \"#707879\"], [.48, \"#252a2b\"], [.77, \"#080b0c\"], [1, \"#464b4b\"]\n ], 4);\n metalRect(-165, -13, 27, 26, [\n [0, \"#090b0c\"], [.35, \"#34393b\"], [.6, \"#08090a\"], [1, \"#24292b\"]\n ], 7);\n ctx.fillStyle = \"#050707\";\n ctx.beginPath();\n ctx.ellipse(-165, 0, 7, 13, 0, 0, Math.PI * 2);\n ctx.fill();\n\n // main brass tube\n const tubeG = ctx.createLinearGradient(0, -36, 0, 36);\n tubeG.addColorStop(0, \"#3a220b\");\n tubeG.addColorStop(.12, \"#96702d\");\n tubeG.addColorStop(.27, \"#e2bd65\");\n tubeG.addColorStop(.42, \"#795017\");\n tubeG.addColorStop(.57, \"#c69a3d\");\n tubeG.addColorStop(.76, \"#4e300c\");\n tubeG.addColorStop(.9, \"#b5882d\");\n tubeG.addColorStop(1, \"#422708\");\n ctx.fillStyle = tubeG;\n ctx.fillRect(-61, -31, 253, 62);\n\n // tube reflections\n ctx.fillStyle = \"rgba(255,235,165,.34)\";\n ctx.fillRect(-51, -23, 226, 7);\n ctx.fillStyle = \"rgba(39,18,4,.42)\";\n ctx.fillRect(-57, 20, 238, 8);\n\n // seam rings\n metalRect(-59, -37, 12, 74, [[0, \"#261606\"], [.24, \"#d4a64a\"], [.48, \"#55330c\"], [.72, \"#e0b755\"], [1, \"#301b06\"]]);\n metalRect(127, -35, 11, 70, [[0, \"#231506\"], [.22, \"#c89838\"], [.48, \"#4d2d08\"], [.72, \"#dfb45a\"], [1, \"#332008\"]]);\n metalRect(167, -39, 24, 78, [[0, \"#271806\"], [.18, \"#90601b\"], [.43, \"#dfb95b\"], [.7, \"#58350b\"], [1, \"#1c1004\"]]);\n\n // objective rim\n metalRect(185, -47, 24, 94, [[0, \"#1d1308\"], [.14, \"#9e762f\"], [.38, \"#e6c26b\"], [.57, \"#603b0e\"], [.83, \"#b58631\"], [1, \"#201306\"]], 3);\n ctx.fillStyle = \"#11191d\";\n ctx.beginPath();\n ctx.ellipse(209, 0, 8, 39, 0, 0, Math.PI * 2);\n ctx.fill();\n const lens = ctx.createLinearGradient(202, -35, 217, 35);\n lens.addColorStop(0, \"#a6d7df\");\n lens.addColorStop(.18, \"#2e758b\");\n lens.addColorStop(.57, \"#071921\");\n lens.addColorStop(.8, \"#4692a4\");\n lens.addColorStop(1, \"#071116\");\n ctx.fillStyle = lens;\n ctx.beginPath();\n ctx.ellipse(209, 0, 5.6, 33, 0, 0, Math.PI * 2);\n ctx.fill();\n ctx.fillStyle = \"rgba(230,255,255,.6)\";\n ctx.beginPath();\n ctx.ellipse(207, -15, 1.2, 10, -.2, 0, Math.PI * 2);\n ctx.fill();\n\n // brass focusing rack and knobs\n ctx.fillStyle = \"#211507\";\n ctx.fillRect(-79, 27, 56, 11);\n metalRect(-66, 35, 22, 14, [[0, \"#48300e\"], [.4, \"#d7aa47\"], [.7, \"#60400f\"], [1, \"#241505\"]], 3);\n ctx.fillStyle = \"#151616\";\n ctx.beginPath();\n ctx.arc(-56, 48, 15, 0, Math.PI * 2);\n ctx.fill();\n ctx.strokeStyle = \"#a77b2d\";\n ctx.lineWidth = 3;\n ctx.stroke();\n ctx.fillStyle = \"#4f5654\";\n ctx.beginPath();\n ctx.arc(-56, 48, 7, 0, Math.PI * 2);\n ctx.fill();\n\n ctx.restore();\n\n // telescope mounting cradle and pivot\n ctx.save();\n ctx.translate(235, 272);\n ctx.rotate(-0.69);\n ctx.strokeStyle = \"#272522\";\n ctx.lineWidth = 16;\n ctx.beginPath();\n ctx.moveTo(-4, 32);\n ctx.lineTo(33, 34);\n ctx.stroke();\n ctx.strokeStyle = \"#8e692d\";\n ctx.lineWidth = 5;\n ctx.beginPath();\n ctx.moveTo(-3, 32);\n ctx.lineTo(34, 34);\n ctx.stroke();\n ctx.restore();\n\n // equatorial mount head\n metalRect(213, 282, 57, 29, [[0, \"#15181a\"], [.25, \"#69706d\"], [.52, \"#242829\"], [.78, \"#8d8a74\"], [1, \"#17191a\"]], 6);\n ctx.fillStyle = \"#23272a\";\n ctx.beginPath();\n ctx.arc(243, 293, 23, 0, Math.PI * 2);\n ctx.fill();\n ctx.strokeStyle = \"#9b8d6c\";\n ctx.lineWidth = 3;\n ctx.stroke();\n ctx.fillStyle = \"#3c423f\";\n ctx.beginPath();\n ctx.arc(243, 293, 11, 0, Math.PI * 2);\n ctx.fill();\n\n // polar axis slant\n ctx.save();\n ctx.translate(242, 302);\n ctx.rotate(.42);\n metalRect(-11, -11, 80, 22, [[0, \"#151719\"], [.24, \"#7a7d75\"], [.5, \"#252a2b\"], [.75, \"#a19a81\"], [1, \"#1b1b1b\"]], 4);\n ctx.fillStyle = \"#202223\";\n ctx.beginPath();\n ctx.arc(68, 0, 16, 0, Math.PI * 2);\n ctx.fill();\n ctx.strokeStyle = \"#aaa076\";\n ctx.lineWidth = 3;\n ctx.stroke();\n ctx.restore();\n\n // declination shaft / counterweight\n ctx.save();\n ctx.translate(254, 310);\n ctx.rotate(.22);\n metalRect(-7, -4, 7, 112, [[0, \"#151718\"], [.4, \"#a29a7c\"], [.63, \"#313535\"], [1, \"#111314\"]], 2);\n metalRect(-26, 93, 44, 31, [[0, \"#17191b\"], [.18, \"#646863\"], [.43, \"#1d2021\"], [.7, \"#777565\"], [1, \"#131516\"]], 8);\n ctx.strokeStyle = \"#aea073\";\n ctx.lineWidth = 2;\n ctx.strokeRect(-24, 95, 40, 27);\n ctx.restore();\n\n // slow-motion controls\n ctx.strokeStyle = \"#303536\";\n ctx.lineWidth = 5;\n ctx.beginPath();\n ctx.moveTo(217, 302);\n ctx.lineTo(178, 326);\n ctx.stroke();\n ctx.fillStyle = \"#1c2021\";\n ctx.beginPath();\n ctx.arc(175, 328, 13, 0, Math.PI * 2);\n ctx.fill();\n ctx.strokeStyle = \"#aa945c\";\n ctx.lineWidth = 2;\n ctx.stroke();\n\n // pier\n ctx.fillStyle = \"#252829\";\n path([[225, 314], [272, 314], [287, 416], [208, 416]]);\n ctx.fill();\n const pierG = ctx.createLinearGradient(207, 0, 288, 0);\n pierG.addColorStop(0, \"#141617\");\n pierG.addColorStop(.28, \"#62645e\");\n pierG.addColorStop(.5, \"#303434\");\n pierG.addColorStop(.72, \"#767369\");\n pierG.addColorStop(1, \"#17191a\");\n ctx.fillStyle = pierG;\n path([[225, 319], [271, 319], [282, 412], [213, 412]]);\n ctx.fill();\n\n // pier flange and legs\n metalRect(197, 408, 101, 17, [[0, \"#121415\"], [.26, \"#666860\"], [.49, \"#292d2d\"], [.75, \"#777467\"], [1, \"#151617\"]], 3);\n ctx.fillStyle = \"#1b1d1d\";\n path([[216, 422], [235, 422], [186, 485], [171, 485]]);\n ctx.fill();\n path([[260, 422], [280, 422], [338, 484], [322, 484]]);\n ctx.fill();\n path([[236, 422], [255, 422], [255, 493], [237, 493]]);\n ctx.fill();\n ctx.strokeStyle = \"#757367\";\n ctx.lineWidth = 2;\n ctx.beginPath();\n ctx.moveTo(217, 425); ctx.lineTo(177, 482);\n ctx.moveTo(279, 425); ctx.lineTo(331, 481);\n ctx.moveTo(246, 425); ctx.lineTo(246, 489);\n ctx.stroke();\n\n // foreground shadows\n const shade = ctx.createLinearGradient(0, 420, 0, 512);\n shade.addColorStop(0, \"rgba(0,0,0,0)\");\n shade.addColorStop(1, \"rgba(0,0,0,.5)\");\n ctx.fillStyle = shade;\n ctx.fillRect(0, 410, 512, 102);\n\n // subtle vignette\n const vig = ctx.createRadialGradient(256, 242, 175, 256, 242, 410);\n vig.addColorStop(.58, \"rgba(0,0,0,0)\");\n vig.addColorStop(1, \"rgba(0,0,0,.48)\");\n ctx.fillStyle = vig;\n ctx.fillRect(0, 0, 512, 512);\n}"}], "metadata": {"id": "val-v1-broad-v2-entity-validation-001", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 4934, "code_sha256": "633a3452e6c9b4b9f7f2183a13ae73c0aa765023d25feb2997ce17bde43b8780"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A brass nocturnal instrument is displayed against dark velvet, showing two rotating engraved disks, a central pivot, pointer arm, and hanging loop."}, {"role": "assistant", "content": "async function render(stage) {\n const size = 512;\n const dpr = Math.min(window.devicePixelRatio || 1, 2);\n stage.innerHTML = \"\";\n stage.style.cssText = \"position:relative;overflow:hidden;width:512px;height:512px;background:#090d13;\";\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = size * dpr;\n canvas.height = size * dpr;\n canvas.style.cssText = \"width:512px;height:512px;display:block;\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(dpr, dpr);\n\n const W = 512, H = 512;\n let seed = 71392;\n const rand = () => {\n seed = (seed * 1664525 + 1013904223) >>> 0;\n return seed / 4294967296;\n };\n\n function radial(x, y, r, stops) {\n const g = ctx.createRadialGradient(x - r * .25, y - r * .32, r * .04, x, y, r);\n stops.forEach(s => g.addColorStop(s[0], s[1]));\n return g;\n }\n\n function brassDisk(x, y, r, rotation, inner) {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rotation);\n\n ctx.beginPath();\n ctx.arc(0, 0, r, 0, Math.PI * 2);\n ctx.fillStyle = \"rgba(0,0,0,.45)\";\n ctx.shadowColor = \"#000\";\n ctx.shadowBlur = 18;\n ctx.shadowOffsetY = 12;\n ctx.fill();\n ctx.shadowBlur = 0;\n ctx.shadowOffsetY = 0;\n\n ctx.beginPath();\n ctx.arc(0, 0, r, 0, Math.PI * 2);\n ctx.fillStyle = radial(0, 0, r, [\n [0, \"#d5ab57\"], [.19, \"#b67d2c\"], [.49, \"#dfbd69\"],\n [.72, \"#7e4b18\"], [.87, \"#c8983d\"], [1, \"#42260e\"]\n ]);\n ctx.fill();\n\n ctx.save();\n ctx.clip();\n for (let i = 0; i < 340; i++) {\n const a = rand() * Math.PI * 2;\n const rr = Math.sqrt(rand()) * r;\n const l = 1 + rand() * 12;\n ctx.strokeStyle = rand() > .48 ? \"rgba(255,233,157,.09)\" : \"rgba(48,23,5,.09)\";\n ctx.lineWidth = rand() * .75 + .15;\n ctx.beginPath();\n ctx.moveTo(Math.cos(a) * rr, Math.sin(a) * rr);\n ctx.lineTo(Math.cos(a + .03) * (rr + l), Math.sin(a + .03) * (rr + l));\n ctx.stroke();\n }\n ctx.restore();\n\n ctx.strokeStyle = \"#40250d\";\n ctx.lineWidth = 3;\n ctx.beginPath();\n ctx.arc(0, 0, r - 1.5, 0, Math.PI * 2);\n ctx.stroke();\n ctx.strokeStyle = \"rgba(250,210,112,.55)\";\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.arc(0, 0, r - 5, 0, Math.PI * 2);\n ctx.stroke();\n\n const rings = inner ? [r * .83, r * .67, r * .48] : [r * .82, r * .61, r * .42];\n rings.forEach((rr, j) => {\n ctx.strokeStyle = j === 1 ? \"rgba(64,35,9,.72)\" : \"rgba(252,211,112,.48)\";\n ctx.lineWidth = j === 1 ? 1.15 : .7;\n ctx.beginPath();\n ctx.arc(0, 0, rr, 0, Math.PI * 2);\n ctx.stroke();\n });\n\n for (let i = 0; i < 72; i++) {\n const a = i * Math.PI * 2 / 72;\n const major = i % 6 === 0;\n const rr = r * .84;\n const len = major ? 11 : i % 3 === 0 ? 7 : 4;\n ctx.strokeStyle = \"rgba(58,32,8,.88)\";\n ctx.lineWidth = major ? 1.25 : .72;\n ctx.beginPath();\n ctx.moveTo(Math.cos(a) * (rr - len), Math.sin(a) * (rr - len));\n ctx.lineTo(Math.cos(a) * (rr + 1), Math.sin(a) * (rr + 1));\n ctx.stroke();\n }\n\n ctx.fillStyle = \"rgba(54,29,6,.86)\";\n ctx.font = `italic ${Math.round(r * .105)}px Georgia, serif`;\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n for (let i = 0; i < 12; i++) {\n const a = i * Math.PI * 2 / 12 - Math.PI / 2;\n const tr = r * .735;\n ctx.save();\n ctx.translate(Math.cos(a) * tr, Math.sin(a) * tr);\n ctx.rotate(a + Math.PI / 2);\n ctx.fillText([\"I\",\"II\",\"III\",\"IV\",\"V\",\"VI\",\"VII\",\"VIII\",\"IX\",\"X\",\"XI\",\"XII\"][i], 0, 0);\n ctx.restore();\n }\n\n ctx.strokeStyle = \"rgba(82,42,7,.72)\";\n ctx.lineWidth = .7;\n for (let i = 0; i < 24; i++) {\n const a = i * Math.PI * 2 / 24;\n ctx.beginPath();\n ctx.arc(Math.cos(a) * r * .55, Math.sin(a) * r * .55, 1.15, 0, Math.PI * 2);\n ctx.stroke();\n }\n\n ctx.restore();\n }\n\n // Velvet background\n const bg = ctx.createRadialGradient(242, 225, 25, 260, 254, 400);\n bg.addColorStop(0, \"#25313a\");\n bg.addColorStop(.38, \"#111a24\");\n bg.addColorStop(1, \"#05080d\");\n ctx.fillStyle = bg;\n ctx.fillRect(0, 0, W, H);\n\n for (let i = 0; i < 8500; i++) {\n const x = rand() * W, y = rand() * H;\n const wave = Math.sin(x * .035 + y * .012) * .5 + .5;\n const a = rand() * .085 * wave;\n ctx.fillStyle = rand() > .5 ? `rgba(101,135,151,${a})` : `rgba(0,0,0,${a})`;\n ctx.fillRect(x, y, rand() * 2.3 + .2, rand() * 1.4 + .2);\n }\n for (let y = 10; y < H; y += 7) {\n ctx.strokeStyle = `rgba(85,105,119,${.015 + rand() * .025})`;\n ctx.lineWidth = rand() * 1.6 + .25;\n ctx.beginPath();\n ctx.moveTo(0, y + Math.sin(y) * 2);\n ctx.bezierCurveTo(140, y - 9, 365, y + 12, 512, y - 3);\n ctx.stroke();\n }\n\n // Hanging loop\n ctx.save();\n ctx.translate(256, 83);\n ctx.rotate(-.06);\n ctx.strokeStyle = \"#321b08\";\n ctx.lineWidth = 14;\n ctx.beginPath();\n ctx.arc(0, 3, 28, Math.PI * .1, Math.PI * .9, true);\n ctx.stroke();\n ctx.strokeStyle = \"#bd8330\";\n ctx.lineWidth = 8;\n ctx.beginPath();\n ctx.arc(0, 3, 28, Math.PI * .1, Math.PI * .9, true);\n ctx.stroke();\n ctx.strokeStyle = \"rgba(255,220,126,.65)\";\n ctx.lineWidth = 1.5;\n ctx.beginPath();\n ctx.arc(-1, 1, 24, Math.PI * .17, Math.PI * .83, true);\n ctx.stroke();\n ctx.restore();\n\n // Neck\n ctx.fillStyle = \"#5b3511\";\n ctx.beginPath();\n ctx.moveTo(239, 101); ctx.lineTo(273, 101); ctx.lineTo(280, 145); ctx.lineTo(233, 145);\n ctx.closePath(); ctx.fill();\n ctx.fillStyle = \"#b67a2d\";\n ctx.beginPath();\n ctx.moveTo(244, 102); ctx.lineTo(268, 102); ctx.lineTo(272, 143); ctx.lineTo(239, 143);\n ctx.closePath(); ctx.fill();\n ctx.strokeStyle = \"rgba(247,203,106,.55)\";\n ctx.lineWidth = 1;\n ctx.stroke();\n\n // Back and front rotating disks\n brassDisk(257, 278, 171, -.115, false);\n brassDisk(257, 278, 132, .34, true);\n\n // crescent-like open visual panel\n ctx.save();\n ctx.translate(257, 278);\n ctx.rotate(.34);\n ctx.strokeStyle = \"rgba(62,33,7,.9)\";\n ctx.lineWidth = 3;\n ctx.beginPath();\n ctx.arc(0, 0, 96, -.94, .68);\n ctx.stroke();\n ctx.strokeStyle = \"rgba(246,203,105,.48)\";\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.arc(0, 0, 91, -.91, .65);\n ctx.stroke();\n ctx.restore();\n\n // Inscription\n ctx.save();\n ctx.translate(257, 278);\n ctx.rotate(-.11);\n ctx.fillStyle = \"rgba(68,36,7,.78)\";\n ctx.font = \"12px Georgia, serif\";\n ctx.textAlign = \"center\";\n ctx.fillText(\"NOCTURNAL \u00b7 STELLAR HOROLOGIUM\", 0, 121);\n ctx.font = \"9px Georgia, serif\";\n ctx.fillText(\"LONDON \u2022 ASTRONOMICAL OBSERVATION\", 0, 137);\n ctx.restore();\n\n // Pointer arm toward upper right\n ctx.save();\n ctx.translate(257, 278);\n ctx.rotate(-.81);\n ctx.shadowColor = \"#000\";\n ctx.shadowBlur = 6;\n ctx.shadowOffsetY = 4;\n ctx.fillStyle = \"#5c350f\";\n ctx.beginPath();\n ctx.moveTo(-7, 6);\n ctx.lineTo(-5, -6);\n ctx.lineTo(151, -4);\n ctx.lineTo(172, 0);\n ctx.lineTo(151, 5);\n ctx.closePath();\n ctx.fill();\n ctx.shadowBlur = 0;\n const arm = ctx.createLinearGradient(0, -6, 0, 7);\n arm.addColorStop(0, \"#f0c66c\");\n arm.addColorStop(.36, \"#a96e24\");\n arm.addColorStop(.72, \"#714015\");\n arm.addColorStop(1, \"#d39a40\");\n ctx.fillStyle = arm;\n ctx.beginPath();\n ctx.moveTo(-4, 4);\n ctx.lineTo(-3, -4);\n ctx.lineTo(153, -3);\n ctx.lineTo(168, 0);\n ctx.lineTo(153, 3);\n ctx.closePath();\n ctx.fill();\n ctx.strokeStyle = \"rgba(69,36,6,.85)\";\n ctx.lineWidth = 1;\n ctx.stroke();\n\n ctx.fillStyle = \"#c28c35\";\n ctx.beginPath();\n ctx.moveTo(165, 0); ctx.lineTo(179, -7); ctx.lineTo(176, 0); ctx.lineTo(179, 7);\n ctx.closePath(); ctx.fill();\n ctx.strokeStyle = \"#4c290a\";\n ctx.stroke();\n ctx.restore();\n\n // Central boss\n ctx.save();\n ctx.translate(257, 278);\n ctx.beginPath();\n ctx.arc(0, 0, 23, 0, Math.PI * 2);\n ctx.fillStyle = \"#4b2a0b\";\n ctx.fill();\n ctx.beginPath();\n ctx.arc(0, 0, 19, 0, Math.PI * 2);\n ctx.fillStyle = radial(0, 0, 19, [[0, \"#f1ce7c\"], [.3, \"#bd8230\"], [.76, \"#714014\"], [1, \"#321b07\"]]);\n ctx.fill();\n ctx.strokeStyle = \"rgba(255,222,132,.7)\";\n ctx.lineWidth = 1;\n ctx.beginPath(); ctx.arc(0, 0, 15.5, 0, Math.PI * 2); ctx.stroke();\n ctx.beginPath();\n ctx.arc(-3, -4, 5.5, 0, Math.PI * 2);\n ctx.fillStyle = \"#f6d987\";\n ctx.fill();\n ctx.beginPath();\n ctx.arc(-4, -5, 2.2, 0, Math.PI * 2);\n ctx.fillStyle = \"rgba(255,249,201,.85)\";\n ctx.fill();\n ctx.restore();\n\n // Edge screw accents\n [[257,109],[407,278],[257,447],[108,278]].forEach(([x,y]) => {\n ctx.beginPath();\n ctx.arc(x, y, 5.5, 0, Math.PI * 2);\n ctx.fillStyle = \"#6e4115\";\n ctx.fill();\n ctx.beginPath();\n ctx.arc(x-1, y-1, 3.4, 0, Math.PI*2);\n ctx.fillStyle = \"#c28a34\";\n ctx.fill();\n ctx.strokeStyle = \"#4b290b\";\n ctx.lineWidth = 1;\n ctx.beginPath(); ctx.moveTo(x-2.5,y+1.7); ctx.lineTo(x+2.5,y-1.7); ctx.stroke();\n });\n\n // Vignette\n const vignette = ctx.createRadialGradient(256, 250, 190, 256, 256, 385);\n vignette.addColorStop(0, \"rgba(0,0,0,0)\");\n vignette.addColorStop(.72, \"rgba(0,0,0,.06)\");\n vignette.addColorStop(1, \"rgba(0,0,0,.58)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0, 0, W, H);\n}"}], "metadata": {"id": "val-v1-broad-v2-entity-validation-007", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 4006, "code_sha256": "cb539ec4511cedce6730094733860ea1d3f5661d3663e7d43b847389874ea5ec"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A moss-covered mechanical island flies past a crescent moon, its stone castle encircled by turning clock rings and dangling brass counterweights."}, {"role": "assistant", "content": "async function render(stage) {\n const canvas = document.createElement(\"canvas\");\n const dpr = Math.min(devicePixelRatio || 1, 2);\n canvas.width = canvas.height = 512 * dpr;\n canvas.style.cssText = \"width:512px;height:512px;display:block;overflow:hidden;\";\n stage.appendChild(canvas);\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(dpr, dpr);\n\n const rnd = (() => {\n let s = 918273;\n return () => ((s = (s * 1664525 + 1013904223) >>> 0) / 4294967296);\n })();\n\n const stars = Array.from({ length: 150 }, () => ({\n x: rnd() * 512, y: rnd() * 270, r: rnd() * 1.25 + .15,\n a: rnd() * .65 + .18, tw: rnd() * 7\n }));\n const mossDots = Array.from({ length: 120 }, () => ({\n x: 135 + rnd() * 250, y: 218 + rnd() * 80, r: .5 + rnd() * 2.4\n }));\n const stoneDots = Array.from({ length: 130 }, () => ({\n x: 150 + rnd() * 220, y: 146 + rnd() * 140, r: rnd() * 1.4 + .35\n }));\n\n function ellipse(x, y, rx, ry, fill, stroke, width = 1) {\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n if (fill) { ctx.fillStyle = fill; ctx.fill(); }\n if (stroke) { ctx.lineWidth = width; ctx.strokeStyle = stroke; ctx.stroke(); }\n }\n\n function path(points, fill, stroke, width = 1) {\n ctx.beginPath();\n points.forEach((p, i) => i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]));\n ctx.closePath();\n if (fill) { ctx.fillStyle = fill; ctx.fill(); }\n if (stroke) { ctx.strokeStyle = stroke; ctx.lineWidth = width; ctx.stroke(); }\n }\n\n function tower(x, y, w, h, roofH, shade = 0) {\n const wall = ctx.createLinearGradient(x, y, x + w, y);\n wall.addColorStop(0, `hsl(201, 14%, ${37 - shade}%)`);\n wall.addColorStop(.45, `hsl(203, 12%, ${48 - shade}%)`);\n wall.addColorStop(1, `hsl(208, 15%, ${27 - shade}%)`);\n ctx.fillStyle = wall;\n ctx.fillRect(x, y, w, h);\n\n ctx.fillStyle = \"rgba(15,25,30,.55)\";\n for (let yy = y + 8; yy < y + h; yy += 10) {\n for (let xx = x + 4 + ((yy / 10) % 2) * 4; xx < x + w - 2; xx += 12) {\n ctx.fillRect(xx, yy, 7, 1);\n }\n }\n\n ctx.fillStyle = \"#17242a\";\n for (let i = 0; i < 3; i++) {\n const wx = x + 7 + i * ((w - 14) / 2);\n ctx.beginPath();\n ctx.arc(wx + 3, y + h * .47, 3, Math.PI, 0);\n ctx.lineTo(wx + 6, y + h * .63);\n ctx.lineTo(wx, y + h * .63);\n ctx.fill();\n ctx.fillStyle = \"#d29b4d\";\n ctx.fillRect(wx + 2, y + h * .51, 1.2, 3);\n ctx.fillStyle = \"#17242a\";\n }\n\n path([[x - 4, y + 3], [x + w / 2, y - roofH], [x + w + 4, y + 3]], \"#283b42\", \"#0e1b23\", 1.5);\n path([[x - 1, y + 1], [x + w / 2, y - roofH + 4], [x + w + 1, y + 1]], \"rgba(92,122,120,.38)\");\n ctx.fillStyle = \"#98a68c\";\n ctx.fillRect(x - 2, y + h - 2, w + 4, 4);\n }\n\n function drawRing(cx, cy, rx, ry, a, front) {\n ctx.save();\n ctx.translate(cx, cy);\n ctx.rotate(a);\n ctx.scale(1, ry / rx);\n ctx.beginPath();\n ctx.arc(0, 0, rx, front ? 0 : Math.PI, front ? Math.PI : Math.PI * 2);\n ctx.strokeStyle = \"rgba(42,24,13,.9)\";\n ctx.lineWidth = 9;\n ctx.stroke();\n ctx.beginPath();\n ctx.arc(0, 0, rx, front ? 0 : Math.PI, front ? Math.PI : Math.PI * 2);\n const brass = ctx.createLinearGradient(-rx, 0, rx, 0);\n brass.addColorStop(0, \"#4d2b13\");\n brass.addColorStop(.22, \"#c2872e\");\n brass.addColorStop(.5, \"#f0c664\");\n brass.addColorStop(.77, \"#87501c\");\n brass.addColorStop(1, \"#26190f\");\n ctx.strokeStyle = brass;\n ctx.lineWidth = 5;\n ctx.stroke();\n\n for (let i = 0; i < 24; i++) {\n const q = i * Math.PI * 2 / 24;\n const x1 = Math.cos(q) * (rx - 5), y1 = Math.sin(q) * (rx - 5);\n const x2 = Math.cos(q) * (rx + (i % 3 === 0 ? 6 : 2)), y2 = Math.sin(q) * (rx + (i % 3 === 0 ? 6 : 2));\n if ((front && q > 0 && q < Math.PI) || (!front && (q < 0 || q > Math.PI))) {\n ctx.beginPath();\n ctx.moveTo(x1, y1); ctx.lineTo(x2, y2);\n ctx.strokeStyle = \"#e0b454\";\n ctx.lineWidth = i % 3 === 0 ? 1.4 : .7;\n ctx.stroke();\n }\n }\n ctx.restore();\n }\n\n function chain(x1, y1, x2, y2) {\n const n = Math.max(2, Math.floor(Math.abs(y2 - y1) / 7));\n ctx.strokeStyle = \"#4a321b\";\n ctx.lineWidth = 2.2;\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n for (let i = 1; i <= n; i++) {\n const t = i / n;\n const x = x1 + (x2 - x1) * t + Math.sin(t * Math.PI * 7) * 2;\n const y = y1 + (y2 - y1) * t;\n ctx.lineTo(x, y);\n }\n ctx.stroke();\n ctx.strokeStyle = \"#ba8135\";\n ctx.lineWidth = .6;\n ctx.stroke();\n }\n\n function frame(t) {\n ctx.clearRect(0, 0, 512, 512);\n\n const sky = ctx.createLinearGradient(0, 0, 0, 512);\n sky.addColorStop(0, \"#061229\");\n sky.addColorStop(.48, \"#13294c\");\n sky.addColorStop(1, \"#4a3853\");\n ctx.fillStyle = sky;\n ctx.fillRect(0, 0, 512, 512);\n\n const haze = ctx.createRadialGradient(300, 180, 10, 300, 220, 360);\n haze.addColorStop(0, \"rgba(96,132,170,.16)\");\n haze.addColorStop(1, \"rgba(11,16,38,0)\");\n ctx.fillStyle = haze;\n ctx.fillRect(0, 0, 512, 512);\n\n stars.forEach(s => {\n const alpha = s.a * (.72 + .28 * Math.sin(t * .001 * s.tw + s.x));\n ctx.fillStyle = `rgba(223,237,255,${alpha})`;\n ellipse(s.x, s.y, s.r, s.r, ctx.fillStyle);\n });\n\n ctx.save();\n ctx.shadowColor = \"#c7d9e7\";\n ctx.shadowBlur = 24;\n ellipse(410, 96, 64, 64, \"#dce5dc\");\n ctx.restore();\n ctx.save();\n ctx.globalCompositeOperation = \"destination-out\";\n ellipse(434, 76, 62, 62, \"#000\");\n ctx.restore();\n ctx.fillStyle = \"rgba(178,195,194,.22)\";\n ellipse(390, 113, 11, 5, ctx.fillStyle);\n ellipse(406, 75, 8, 4, ctx.fillStyle);\n\n for (let i = 0; i < 6; i++) {\n ctx.fillStyle = `rgba(121,148,172,${.025 + i * .005})`;\n ellipse(80 + i * 94, 320 + Math.sin(t / 10000 + i) * 12, 110, 24, ctx.fillStyle);\n }\n\n const floatX = Math.sin(t * .00022) * 12;\n const floatY = Math.sin(t * .00048) * 5;\n ctx.save();\n ctx.translate(floatX, floatY);\n\n drawRing(256, 239, 155, 55, -.16 + t * .00006, false);\n drawRing(256, 226, 122, 89, .34 - t * .00009, false);\n\n chain(132, 242, 111, 354);\n chain(375, 234, 397, 337);\n chain(333, 268, 347, 373);\n\n ellipse(110, 365, 14, 19, \"#3b2515\", \"#d09942\", 1.4);\n ellipse(110, 360, 9, 10, \"#8a5922\");\n ellipse(397, 349, 13, 18, \"#3b2515\", \"#d09942\", 1.4);\n ellipse(397, 345, 8, 9, \"#9a6629\");\n ellipse(347, 386, 16, 20, \"#302016\", \"#d09942\", 1.5);\n ellipse(347, 381, 10, 9, \"#80501e\");\n\n const rock = ctx.createLinearGradient(0, 260, 0, 424);\n rock.addColorStop(0, \"#67766b\");\n rock.addColorStop(.25, \"#45554f\");\n rock.addColorStop(1, \"#1b2831\");\n path([[111,273],[142,258],[193,266],[224,282],[277,276],[329,263],[391,280],[378,319],[348,343],[323,386],[291,421],[262,447],[232,416],[210,377],[170,354],[134,325]], rock, \"#18242a\", 2);\n\n ctx.fillStyle = \"rgba(6,15,20,.48)\";\n path([[145,302],[195,315],[232,365],[253,430],[218,381],[180,351]], ctx.fillStyle);\n path([[285,300],[348,296],[320,370],[268,431],[283,355]], ctx.fillStyle);\n path([[211,282],[253,300],[237,358],[190,327]], \"rgba(143,157,143,.12)\");\n\n for (let i = 0; i < 34; i++) {\n const x = 145 + rnd() * 220, y = 296 + rnd() * 104;\n ctx.strokeStyle = \"rgba(152,168,154,.15)\";\n ctx.lineWidth = rnd() * 1.5 + .4;\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.lineTo(x - 8 + rnd() * 16, y + 10 + rnd() * 19);\n ctx.stroke();\n }\n\n ctx.fillStyle = \"#415c38\";\n path([[113,274],[143,258],[186,264],[210,278],[240,273],[276,279],[323,264],[362,269],[391,280],[367,293],[329,287],[292,296],[253,289],[213,296],[183,281],[141,286]], ctx.fillStyle);\n mossDots.forEach(m => {\n ctx.fillStyle = `rgba(${55 + Math.floor(rnd()*22)},${93 + Math.floor(rnd()*42)},${41 + Math.floor(rnd()*18)},.8)`;\n ellipse(m.x, m.y, m.r, m.r * .65, ctx.fillStyle);\n });\n\n tower(207, 174, 34, 99, 25, 0);\n tower(277, 164, 38, 108, 29, 3);\n tower(170, 200, 31, 72, 21, 5);\n tower(323, 204, 28, 67, 20, 8);\n\n ctx.fillStyle = \"#53656a\";\n ctx.fillRect(196, 218, 140, 54);\n ctx.fillStyle = \"rgba(16,27,33,.5)\";\n for (let yy = 226; yy < 270; yy += 11) {\n ctx.fillRect(198, yy, 135, 1);\n for (let xx = 205 + ((yy / 11) % 2) * 10; xx < 329; xx += 27) ctx.fillRect(xx, yy, 1, 8);\n }\n ctx.fillStyle = \"#1d2a2d\";\n ctx.beginPath();\n ctx.arc(264, 267, 15, Math.PI, 0);\n ctx.lineTo(279, 272); ctx.lineTo(249, 272); ctx.fill();\n ctx.fillStyle = \"#bd8b39\";\n ctx.fillRect(262, 254, 3, 17);\n\n stoneDots.forEach(s => {\n ctx.fillStyle = \"rgba(182,193,176,.18)\";\n ellipse(s.x, s.y, s.r, s.r * .55, ctx.fillStyle);\n });\n\n ctx.fillStyle = \"#54733c\";\n for (let i = 0; i < 25; i++) {\n const x = 171 + i * 7 + Math.sin(i) * 3;\n ellipse(x, 270 + Math.sin(i * 1.9) * 3, 4 + rnd() * 4, 2 + rnd() * 2, \"#526f39\");\n }\n\n drawRing(256, 239, 155, 55, -.16 + t * .00006, true);\n drawRing(256, 226, 122, 89, .34 - t * .00009, true);\n\n ctx.restore();\n\n const vignette = ctx.createRadialGradient(256, 245, 170, 256, 256, 400);\n vignette.addColorStop(.55, \"rgba(0,0,0,0)\");\n vignette.addColorStop(1, \"rgba(0,0,8,.55)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0, 0, 512, 512);\n\n requestAnimationFrame(frame);\n }\n requestAnimationFrame(frame);\n}"}], "metadata": {"id": "val-v1-broad-v2-imagination-validation-000", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 4547, "code_sha256": "9a9ae24c80283d0e3ac0bfaa09e6b848b970e9edd2d34bf202afab709a6c0794"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A vast flying island of iron gears passes over a desert canyon, with a glass greenhouse above and articulated insect legs folded underneath."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"position:relative;overflow:hidden;width:512px;height:512px;background:#d99a5d;\";\n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = 1024;\n canvas.style.cssText = \"width:512px;height:512px;display:block;\";\n stage.appendChild(canvas);\n\n const c = canvas.getContext(\"2d\");\n c.scale(2, 2);\n\n let seed = 92391;\n const rnd = () => ((seed = (seed * 1664525 + 1013904223) >>> 0) / 4294967296);\n const lerp = (a, b, t) => a + (b - a) * t;\n\n function path(points, close = true) {\n c.beginPath();\n points.forEach((p, i) => i ? c.lineTo(p[0], p[1]) : c.moveTo(p[0], p[1]));\n if (close) c.closePath();\n }\n function poly(points, fill, stroke, width = 1) {\n path(points);\n if (fill) { c.fillStyle = fill; c.fill(); }\n if (stroke) { c.strokeStyle = stroke; c.lineWidth = width; c.stroke(); }\n }\n function line(points, color, width = 1) {\n path(points, false);\n c.strokeStyle = color;\n c.lineWidth = width;\n c.lineJoin = \"round\";\n c.lineCap = \"round\";\n c.stroke();\n }\n function circle(x, y, r, fill, stroke, width = 1) {\n c.beginPath(); c.arc(x, y, r, 0, Math.PI * 2);\n if (fill) { c.fillStyle = fill; c.fill(); }\n if (stroke) { c.strokeStyle = stroke; c.lineWidth = width; c.stroke(); }\n }\n function gear(x, y, r, teeth, color, inner = \"#271d19\", rot = 0) {\n const pts = [];\n for (let i = 0; i < teeth * 4; i++) {\n const a = rot + i / (teeth * 4) * Math.PI * 2;\n const p = i % 4;\n const rr = p === 0 || p === 1 ? r : r * .82;\n pts.push([x + Math.cos(a) * rr, y + Math.sin(a) * rr]);\n }\n path(pts);\n c.fillStyle = color;\n c.fill();\n c.strokeStyle = \"#1b1819\";\n c.lineWidth = 1.4;\n c.stroke();\n circle(x, y, r * .58, \"#43322a\", \"#1c1918\", 1.2);\n circle(x, y, r * .25, inner, \"#8d6946\", 1);\n for (let i = 0; i < teeth; i++) {\n const a = rot + i / teeth * Math.PI * 2;\n line([[x + Math.cos(a) * r * .3, y + Math.sin(a) * r * .3],\n [x + Math.cos(a) * r * .55, y + Math.sin(a) * r * .55]], \"#9c7048\", 1);\n }\n circle(x - r * .11, y - r * .12, r * .055, \"#c69a62\");\n }\n\n // Sky\n let sky = c.createLinearGradient(0, 0, 0, 512);\n sky.addColorStop(0, \"#7aa7bd\");\n sky.addColorStop(.34, \"#d6b58d\");\n sky.addColorStop(.65, \"#e29a5d\");\n sky.addColorStop(1, \"#b85938\");\n c.fillStyle = sky;\n c.fillRect(0, 0, 512, 512);\n\n // Atmospheric cloud veils\n for (let i = 0; i < 26; i++) {\n const x = rnd() * 560 - 30, y = 28 + rnd() * 210;\n const rx = 35 + rnd() * 120, ry = 4 + rnd() * 13;\n c.save();\n c.globalAlpha = .035 + rnd() * .06;\n c.fillStyle = i % 2 ? \"#fff1cb\" : \"#835d59\";\n c.beginPath();\n c.ellipse(x, y, rx, ry, -.06 + rnd() * .12, 0, Math.PI * 2);\n c.fill();\n c.restore();\n }\n\n // distant mesas\n c.save();\n c.globalAlpha = .4;\n poly([[0,254],[24,246],[54,248],[78,224],[103,226],[114,254],[141,257],[141,320],[0,320]], \"#9f704f\");\n poly([[358,241],[383,231],[413,233],[430,214],[469,218],[492,235],[512,236],[512,319],[355,318]], \"#9b6547\");\n for (let i = 0; i < 20; i++) {\n const x = rnd() * 512, y = 245 + rnd() * 50;\n line([[x,y],[x + 4 + rnd()*12,y + 10+rnd()*23]], \"#775147\", .7);\n }\n c.restore();\n\n // canyon background\n poly([[0,289],[42,278],[84,299],[117,292],[156,319],[180,340],[203,349],[219,391],[239,422],[0,512]], \"#824630\");\n poly([[512,274],[471,279],[444,296],[412,291],[386,322],[349,341],[328,367],[305,390],[283,429],[273,512],[512,512]], \"#713b2d\");\n\n // canyon striations\n for (let i = 0; i < 80; i++) {\n const left = rnd() < .5;\n const x = left ? rnd()*225 : 290+rnd()*222;\n const y = 295 + rnd()*215;\n const dx = left ? -8-rnd()*36 : 8+rnd()*32;\n c.globalAlpha = .15 + rnd()*.22;\n line([[x,y],[x+dx,y+18+rnd()*53],[x+dx*.7,y+44+rnd()*42]], rnd()<.5 ? \"#e1a06b\" : \"#3e2727\", .6+rnd()*1.5);\n }\n c.globalAlpha = 1;\n\n // canyon floor haze\n let haze = c.createLinearGradient(0, 400, 0, 512);\n haze.addColorStop(0, \"rgba(234,159,91,.05)\");\n haze.addColorStop(1, \"rgba(97,39,31,.6)\");\n c.fillStyle = haze; c.fillRect(0, 372, 512, 140);\n\n // island shadow in mist\n c.save();\n c.globalAlpha = .16;\n c.filter = \"blur(10px)\";\n c.beginPath(); c.ellipse(270, 359, 150, 22, -.14, 0, Math.PI*2);\n c.fillStyle=\"#432725\"; c.fill();\n c.restore();\n\n // legs behind island\n function limb(points, w, highlight) {\n line(points, \"#1c1b1c\", w + 4);\n line(points, \"#4a3b32\", w);\n line(points, highlight || \"#9a704d\", Math.max(1, w * .22));\n }\n // articulated folded insect legs\n const legs = [\n [[169,282],[134,323],[115,375],[83,405],[65,433]],\n [[202,299],[174,348],[159,399],[136,427],[115,459]],\n [[264,307],[251,355],[261,398],[242,440],[230,474]],\n [[311,299],[338,337],[349,385],[379,412],[397,449]],\n [[348,278],[386,311],[405,351],[440,374],[468,405]]\n ];\n legs.forEach((p, i) => {\n limb(p, 8 - (i===2?1:0));\n for (let j=1;j{\n const g=c.createLinearGradient(p[0][0],p[0][1],p[2][0],p[2][1]);\n g.addColorStop(0,i%2?\"rgba(190,232,225,.48)\":\"rgba(105,159,164,.58)\");\n g.addColorStop(1,\"rgba(45,92,98,.45)\");\n poly(p,g,\"#26383a\",1);\n });\n\n // greenhouse frame\n line([[188,202],[204,177],[229,163],[266,157],[302,162],[329,180],[341,204]], \"#253133\", 2.1);\n line([[227,207],[229,163]], \"#263334\", 2);\n line([[265,211],[266,157]], \"#263334\", 2.2);\n line([[307,209],[302,162]], \"#263334\", 2);\n line([[204,177],[219,208]], \"#263334\", 1.5);\n line([[329,180],[314,209]], \"#263334\", 1.5);\n c.save();\n c.globalAlpha=.8;\n line([[210,182],[225,169]], \"#e4f7dd\", 1);\n line([[238,169],[258,160]], \"#e4f7dd\", 1.1);\n line([[276,162],[294,166]], \"#e4f7dd\", 1);\n c.restore();\n\n // plants inside greenhouse\n c.save();\n c.globalAlpha=.75;\n for(let i=0;i<18;i++){\n const x=218+rnd()*92, base=204+rnd()*5, h=8+rnd()*24;\n line([[x,base],[x-4+rnd()*8,base-h]], \"#314f38\", 1.2);\n circle(x-4+rnd()*8,base-h,2+rnd()*2,\"#536d42\");\n }\n c.restore();\n\n // antenna and chimney\n poly([[316,174],[319,143],[326,144],[330,176]], \"#44342c\", \"#1a1819\", 1);\n line([[322,144],[325,124]], \"#292527\", 1.5);\n circle(325,121,2.5,\"#bd8551\",\"#201b1b\",1);\n c.save();\n c.globalAlpha=.25;\n c.fillStyle=\"#eee0c4\";\n c.beginPath(); c.ellipse(335,116,13,7,-.5,0,Math.PI*2); c.fill();\n c.beginPath(); c.ellipse(343,101,19,10,-.8,0,Math.PI*2); c.fill();\n c.restore();\n\n // foreground drifting sand sparkles\n c.save();\n for(let i=0;i<150;i++){\n const x=rnd()*512,y=260+rnd()*252;\n c.globalAlpha=.05+rnd()*.16;\n c.fillStyle=\"#ffd18b\";\n c.fillRect(x,y,1+rnd()*2,.5+rnd()*1);\n }\n c.restore();\n\n // vignette\n const v=c.createRadialGradient(256,240,160,256,250,390);\n v.addColorStop(.56,\"rgba(0,0,0,0)\");\n v.addColorStop(1,\"rgba(35,18,24,.42)\");\n c.fillStyle=v;\n c.fillRect(0,0,512,512);\n}"}], "metadata": {"id": "val-v1-broad-v2-imagination-validation-001", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 5349, "code_sha256": "0c7a78f338895742032874ee0feadeeba42535421b9e43f9bbc76fd8b07f97fd"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A flying island built from interlocking wooden cogs crosses a rainy sky, carrying a terraced rice village beneath a patchwork umbrella canopy."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;overflow:hidden;position:relative;background:#607484;\";\n const canvas = document.createElement(\"canvas\");\n const dpr = Math.max(1, devicePixelRatio || 1);\n canvas.width = 512 * dpr;\n canvas.height = 512 * dpr;\n canvas.style.cssText = \"width:512px;height:512px;display:block;\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(dpr, dpr);\n ctx.lineJoin = \"round\";\n ctx.lineCap = \"round\";\n\n let seed = 195733;\n const rand = () => (seed = (seed * 1664525 + 1013904223) >>> 0) / 4294967296;\n const lerp = (a, b, t) => a + (b - a) * t;\n const poly = (pts, fill, stroke, lw = 1) => {\n ctx.beginPath();\n pts.forEach((p, i) => i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]));\n ctx.closePath();\n if (fill) { ctx.fillStyle = fill; ctx.fill(); }\n if (stroke) { ctx.strokeStyle = stroke; ctx.lineWidth = lw; ctx.stroke(); }\n };\n const line = (a, b, color, w = 1) => {\n ctx.beginPath(); ctx.moveTo(a[0], a[1]); ctx.lineTo(b[0], b[1]);\n ctx.strokeStyle = color; ctx.lineWidth = w; ctx.stroke();\n };\n const ellipse = (x, y, rx, ry, fill, stroke, lw = 1) => {\n ctx.beginPath(); ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n if (fill) { ctx.fillStyle = fill; ctx.fill(); }\n if (stroke) { ctx.strokeStyle = stroke; ctx.lineWidth = lw; ctx.stroke(); }\n };\n\n // Atmospheric sky\n const sky = ctx.createLinearGradient(0, 0, 0, 512);\n sky.addColorStop(0, \"#30485a\");\n sky.addColorStop(.36, \"#728899\");\n sky.addColorStop(.72, \"#9aa8aa\");\n sky.addColorStop(1, \"#536978\");\n ctx.fillStyle = sky;\n ctx.fillRect(0, 0, 512, 512);\n\n function cloud(x, y, sx, sy, alpha) {\n ctx.save();\n ctx.globalAlpha = alpha;\n const g = ctx.createRadialGradient(x, y, 5, x, y, sx);\n g.addColorStop(0, \"#c6d0d0\");\n g.addColorStop(.7, \"#9daeb4\");\n g.addColorStop(1, \"rgba(112,132,143,0)\");\n ctx.fillStyle = g;\n ctx.beginPath();\n ctx.ellipse(x - sx * .25, y, sx * .82, sy * .58, -.08, 0, Math.PI * 2);\n ctx.ellipse(x + sx * .3, y + 2, sx * .7, sy * .5, .12, 0, Math.PI * 2);\n ctx.fill();\n ctx.restore();\n }\n cloud(50, 81, 105, 34, .42);\n cloud(383, 72, 150, 43, .36);\n cloud(251, 169, 178, 37, .22);\n cloud(115, 321, 132, 48, .18);\n cloud(444, 335, 126, 45, .21);\n\n // Far storm cloud strips\n for (let i = 0; i < 10; i++) {\n const y = 21 + i * 36 + rand() * 14;\n ctx.fillStyle = `rgba(30,52,65,${.025 + rand() * .04})`;\n ctx.beginPath();\n ctx.moveTo(-20, y);\n for (let x = -20; x < 550; x += 35) ctx.quadraticCurveTo(x + 18, y - 9 + rand() * 14, x + 35, y + rand() * 8);\n ctx.lineTo(530, y + 25); ctx.lineTo(-20, y + 25); ctx.fill();\n }\n\n // distant rain mist\n const mist = ctx.createLinearGradient(0, 190, 0, 365);\n mist.addColorStop(0, \"rgba(232,243,239,0)\");\n mist.addColorStop(.55, \"rgba(221,233,228,.20)\");\n mist.addColorStop(1, \"rgba(183,205,204,0)\");\n ctx.fillStyle = mist;\n ctx.fillRect(0, 130, 512, 245);\n\n // Rain behind island\n for (let i = 0; i < 230; i++) {\n const x = rand() * 530 - 10;\n const y = rand() * 512;\n const len = 7 + rand() * 17;\n const a = .12 + rand() * .25;\n line([x, y], [x - 4 - rand() * 2, y + len], `rgba(225,242,244,${a})`, .45 + rand() * .65);\n }\n\n // Umbrella canopy poles behind\n const poleCols = [\"#38494a\", \"#4e5b50\", \"#314644\"];\n [[126,201,193],[198,183,206],[273,180,197],[348,192,192],[414,213,174],[75,224,169]].forEach((p, i) => {\n line([p[0], p[1] - 15], [p[0] + 8, p[2] + 12], \"rgba(31,42,39,.6)\", 2);\n line([p[0] + 1, p[1] - 14], [p[0] + 9, p[2] + 12], poleCols[i % 3], 1);\n });\n\n function umbrella(cx, cy, r, colors) {\n ctx.save();\n ctx.translate(cx, cy);\n ctx.shadowColor = \"rgba(18,31,29,.45)\";\n ctx.shadowBlur = 8;\n ctx.shadowOffsetY = 4;\n const n = 8;\n for (let i = 0; i < n; i++) {\n const a1 = -Math.PI + i * Math.PI / n;\n const a2 = -Math.PI + (i + 1) * Math.PI / n;\n ctx.beginPath();\n ctx.moveTo(0, 1);\n ctx.lineTo(Math.cos(a1) * r, Math.sin(a1) * r * .48);\n ctx.quadraticCurveTo(Math.cos((a1+a2)/2)*r*1.05, Math.sin((a1+a2)/2)*r*.48 - 7,\n Math.cos(a2) * r, Math.sin(a2) * r * .48);\n ctx.closePath();\n ctx.fillStyle = colors[i % colors.length];\n ctx.fill();\n ctx.strokeStyle = \"rgba(45,49,37,.38)\";\n ctx.lineWidth = 1;\n ctx.stroke();\n }\n ctx.shadowColor = \"transparent\";\n ctx.beginPath();\n ctx.moveTo(-r, 0);\n ctx.quadraticCurveTo(-r*.6, 12, -r*.28, 3);\n ctx.quadraticCurveTo(0, 12, r*.25, 3);\n ctx.quadraticCurveTo(r*.58, 12, r, 0);\n ctx.lineTo(0, 1);\n ctx.closePath();\n ctx.fillStyle = \"rgba(36,57,49,.42)\";\n ctx.fill();\n ellipse(0, 1, 4, 3, \"#d0a969\", \"#584633\", .8);\n ctx.restore();\n }\n\n umbrella(73, 139, 65, [\"#c7563d\",\"#dda344\",\"#507d7b\",\"#e1bd64\",\"#7c566c\",\"#73945d\"]);\n umbrella(161, 102, 82, [\"#567f88\",\"#bd5551\",\"#d7b05d\",\"#76975e\",\"#b76e4e\",\"#416b78\"]);\n umbrella(263, 104, 92, [\"#c04f43\",\"#d4a647\",\"#668c6f\",\"#4d7987\",\"#c57055\",\"#dfbd6a\"]);\n umbrella(370, 126, 82, [\"#58817a\",\"#c45348\",\"#ddae51\",\"#876773\",\"#6f965f\",\"#b9644d\"]);\n umbrella(454, 164, 65, [\"#c56044\",\"#d8af57\",\"#4e7f80\",\"#7da06b\",\"#b8735a\",\"#e0bf6c\"]);\n umbrella(15, 194, 51, [\"#617c76\",\"#d08b43\",\"#a9504a\",\"#d5b45d\",\"#4e7478\",\"#a55d55\"]);\n\n // Floating island dark silhouette\n ctx.save();\n ctx.shadowColor = \"rgba(12,23,24,.55)\";\n ctx.shadowBlur = 15;\n ctx.shadowOffsetY = 13;\n const island = [\n [35,245],[61,228],[102,219],[145,220],[181,211],[222,219],[263,209],[310,217],\n [355,210],[398,220],[446,216],[478,233],[463,260],[444,271],[434,303],\n [405,327],[389,365],[355,384],[326,417],[285,433],[247,426],[218,401],\n [185,391],[158,362],[120,353],[92,324],[74,292],[48,275]\n ];\n poly(island, \"#473b2c\", \"#28322e\", 2);\n ctx.restore();\n\n // Earthen rocky underside\n const earth = ctx.createLinearGradient(0, 240, 0, 424);\n earth.addColorStop(0, \"#76533a\");\n earth.addColorStop(.42, \"#5d4232\");\n earth.addColorStop(1, \"#2c3030\");\n poly(island, earth, \"#34403a\", 1.4);\n\n // Rock facets\n const facets = [\n [[47,266],[91,271],[74,291],[92,323],[56,290]],\n [[92,267],[137,258],[127,302],[154,343],[102,316]],\n [[145,256],[196,258],[180,302],[203,376],[153,345]],\n [[202,250],[253,248],[244,300],[265,405],[208,374]],\n [[258,251],[311,248],[303,307],[322,413],[274,420]],\n [[318,249],[366,245],[357,302],[372,376],[329,409]],\n [[374,249],[430,239],[412,296],[389,359],[369,330]],\n [[431,239],[469,239],[445,276],[410,304]]\n ];\n facets.forEach((p, i) => poly(p, [\"#674932\",\"#573d2e\",\"#765439\",\"#49392f\"][i % 4], \"rgba(31,34,30,.38)\", .7));\n for (let i = 0; i < 45; i++) {\n const x = 50 + rand() * 415, y = 265 + rand() * 125;\n if (y > 270 + Math.abs(x - 256) * .18) {\n line([x, y], [x - 3 - rand()*5, y + 7 + rand()*12], \"rgba(190,146,99,.18)\", .7);\n }\n }\n\n // Cogs\n function cog(cx, cy, r, teeth, color, rot) {\n ctx.save();\n ctx.translate(cx, cy);\n ctx.rotate(rot);\n ctx.shadowColor = \"rgba(10,18,17,.45)\";\n ctx.shadowBlur = 5;\n ctx.shadowOffsetY = 3;\n const pts = [];\n for (let i = 0; i < teeth * 4; i++) {\n const phase = i % 4;\n const rr = phase === 1 || phase === 2 ? r * 1.16 : r;\n const a = i / (teeth * 4) * Math.PI * 2;\n pts.push([Math.cos(a)*rr, Math.sin(a)*rr]);\n }\n poly(pts, color, \"#30251e\", 2);\n ctx.shadowColor = \"transparent\";\n ctx.beginPath();\n ctx.arc(0,0,r*.72,0,Math.PI*2);\n ctx.fillStyle = \"rgba(96,57,30,.36)\";\n ctx.fill();\n ctx.strokeStyle = \"#8e633a\"; ctx.lineWidth = 1.5; ctx.stroke();\n for(let i=0;i wave - 13) {\n ctx.strokeStyle = rand() > .5 ? \"rgba(180,194,100,.45)\" : \"rgba(38,89,47,.65)\";\n ctx.lineWidth = .65;\n ctx.beginPath(); ctx.moveTo(x,y); ctx.lineTo(x+rand()*3-1.5,y-3-rand()*5); ctx.stroke();\n }\n }\n\n // Rice terraces\n const terraces = [\n {p:[[78,244],[152,237],[180,243],[164,252],[94,255]], c:\"#98a84d\"},\n {p:[[168,237],[244,230],[274,239],[252,248],[185,249]], c:\"#719943\"},\n {p:[[268,234],[344,231],[372,241],[344,250],[286,248]], c:\"#94a946\"},\n {p:[[354,238],[431,232],[453,241],[425,251],[374,251]], c:\"#739647\"},\n {p:[[105,257],[186,253],[211,260],[187,267],[124,266]], c:\"#668d43\"},\n {p:[[225,255],[311,251],[338,258],[308,267],[244,267]], c:\"#85a843\"}\n ];\n terraces.forEach(t => {\n poly(t.p, t.c, \"#385c37\", 1);\n const minx = Math.min(...t.p.map(q=>q[0])), maxx = Math.max(...t.p.map(q=>q[0]));\n const y = (t.p[0][1]+t.p[3][1])/2;\n for(let x=minx+7;x {\n let s = 349817;\n return () => ((s = (s * 1664525 + 1013904223) >>> 0) / 4294967296);\n })();\n\n function path(points, close = true) {\n ctx.beginPath();\n points.forEach((p, i) => i ? ctx.lineTo(...p) : ctx.moveTo(...p));\n if (close) ctx.closePath();\n }\n function ellipse(x, y, rx, ry, fill, alpha = 1) {\n ctx.save(); ctx.globalAlpha = alpha;\n ctx.fillStyle = fill; ctx.beginPath(); ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2); ctx.fill();\n ctx.restore();\n }\n function line(x1, y1, x2, y2, color, width, alpha = 1) {\n ctx.save(); ctx.globalAlpha = alpha; ctx.strokeStyle = color; ctx.lineWidth = width;\n ctx.beginPath(); ctx.moveTo(x1, y1); ctx.lineTo(x2, y2); ctx.stroke(); ctx.restore();\n }\n function cloud(x, y, s, a = 1) {\n ctx.save();\n ctx.globalAlpha = a;\n ctx.filter = \"blur(1px)\";\n const g = ctx.createRadialGradient(x, y - 7*s, 3, x, y, 53*s);\n g.addColorStop(0, \"#ffffff\"); g.addColorStop(.58, \"#f4f8f8\"); g.addColorStop(1, \"#c9dce2\");\n ctx.fillStyle = g;\n ctx.beginPath();\n ctx.arc(x-35*s,y+9*s,24*s,0,Math.PI*2);\n ctx.arc(x-14*s,y-7*s,31*s,0,Math.PI*2);\n ctx.arc(x+18*s,y-12*s,38*s,0,Math.PI*2);\n ctx.arc(x+46*s,y+8*s,25*s,0,Math.PI*2);\n ctx.arc(x+9*s,y+18*s,35*s,0,Math.PI*2);\n ctx.fill();\n ctx.restore();\n }\n function gear(x, y, r, teeth, fill, stroke, rot = 0) {\n ctx.save(); ctx.translate(x,y); ctx.rotate(rot);\n ctx.beginPath();\n for (let i=0; i 285 + Math.sin(x*.03)*20) continue;\n line(x,y,x+8+rng()*16,y+1+rng()*5,\"#8eb5ba\",.5,.12);\n }\n // eye\n ellipse(115,280,8,7,\"#d1d6ca\");\n ellipse(117,280,4,4,\"#162a31\");\n ellipse(118,278.5,1.2,1.2,\"#fff\");\n line(105,271,121,267,\"#163d4a\",2);\n\n // Tail details\n line(430,273,480,249,\"#82a5a7\",1,.4);\n line(435,284,484,323,\"#82a5a7\",1,.4);\n\n // Mechanical plates on whale\n [[195,290,31],[246,278,23],[304,292,36],[361,270,20]].forEach(([x,y,r],i)=>{\n ctx.beginPath();ctx.arc(x,y,r,0,Math.PI*2);\n ctx.fillStyle=i%2?\"#87532e\":\"#a66b36\";ctx.globalAlpha=.72;ctx.fill();ctx.globalAlpha=1;\n ctx.strokeStyle=\"#412f2b\";ctx.lineWidth=2;ctx.stroke();\n ctx.beginPath();ctx.arc(x,y,r*.72,0,Math.PI*2);ctx.strokeStyle=\"#d99b54\";ctx.lineWidth=1;ctx.stroke();\n for(let k=0;k<5;k++) ellipse(x+Math.cos(k*1.257)*r*.62,y+Math.sin(k*1.257)*r*.62,2,2,\"#3d2c29\");\n });\n\n // Island earth atop whale\n ctx.beginPath();\n ctx.moveTo(132,242); ctx.bezierCurveTo(147,213,181,196,227,193);\n ctx.bezierCurveTo(291,177,359,193,391,224);\n ctx.lineTo(369,259); ctx.bezierCurveTo(311,278,211,275,153,255); ctx.closePath();\n const soil=ctx.createLinearGradient(0,195,0,270);\n soil.addColorStop(0,\"#668643\");soil.addColorStop(.4,\"#4b6c39\");soil.addColorStop(1,\"#4e382b\");\n ctx.fillStyle=soil;ctx.fill();ctx.strokeStyle=\"#354a30\";ctx.lineWidth=2;ctx.stroke();\n for(let i=0;i<60;i++){\n let x=146+rng()*230,y=204+rng()*51;\n ellipse(x,y,1+rng()*2,1,\"#9abd57\",.55);\n }\n ctx.beginPath();ctx.moveTo(153,253);ctx.bezierCurveTo(220,270,312,273,369,257);\n ctx.strokeStyle=\"#9a643c\";ctx.lineWidth=5;ctx.stroke();\n\n // village houses\n function house(x,y,s,wall,roof) {\n ctx.fillStyle=wall; ctx.fillRect(x,y,s*23,s*20);\n ctx.strokeStyle=\"#51392b\";ctx.lineWidth=1.4;ctx.strokeRect(x,y,s*23,s*20);\n path([[x-3*s,y],[x+s*11.5,y-s*12],[x+s*26,y]],true);\n ctx.fillStyle=roof;ctx.fill();ctx.strokeStyle=\"#503529\";ctx.stroke();\n ctx.fillStyle=\"#f5d87b\";ctx.fillRect(x+s*4,y+s*7,s*5,s*6);\n ctx.fillRect(x+s*15,y+s*7,s*5,s*6);\n ctx.fillStyle=\"#543a2d\";ctx.fillRect(x+s*10,y+s*11,s*4,s*9);\n }\n house(181,211,.72,\"#d4b77d\",\"#9b4937\");\n house(275,210,.72,\"#d9b878\",\"#884131\");\n house(325,220,.58,\"#b8c48e\",\"#76503a\");\n house(157,225,.55,\"#e1c381\",\"#9a4838\");\n\n // lighthouse\n ctx.save();\n ctx.translate(243,197);\n ctx.beginPath();ctx.moveTo(-13,24);ctx.lineTo(-9,-18);ctx.lineTo(9,-18);ctx.lineTo(13,24);ctx.closePath();\n const tower=ctx.createLinearGradient(-13,0,13,0);\n tower.addColorStop(0,\"#d7c9a9\");tower.addColorStop(.45,\"#f8e7bd\");tower.addColorStop(1,\"#ad977d\");\n ctx.fillStyle=tower;ctx.fill();ctx.strokeStyle=\"#4d3a30\";ctx.lineWidth=1.5;ctx.stroke();\n ctx.fillStyle=\"#b54934\";ctx.fillRect(-11,-4,22,6);ctx.fillRect(-12,12,24,5);\n ctx.fillStyle=\"#52382f\";ctx.fillRect(-4,14,8,10);\n ctx.fillStyle=\"#754436\";ctx.fillRect(-14,-23,28,6);\n ctx.fillStyle=\"#d7e9c8\";ctx.fillRect(-10,-31,20,9);\n for(let i=0;i<4;i++) line(-8+i*5,-31,-8+i*5,-22,\"#5c4838\",1);\n path([[-15,-32],[0,-43],[15,-32]],true);ctx.fillStyle=\"#7d4033\";ctx.fill();ctx.stroke();\n ctx.restore();\n\n // bronze vents\n [[305,237],[345,241],[365,232]].forEach(([x,y],i)=>{\n ctx.fillStyle=\"#86502c\";ctx.fillRect(x-7,y-14,14,17);\n ctx.fillStyle=\"#d09346\";ctx.fillRect(x-5,y-16,10,4);\n ctx.strokeStyle=\"#3f3028\";ctx.lineWidth=1.4;ctx.strokeRect(x-7,y-14,14,17);\n for(let j=0;j<3;j++) line(x-5,y-10+j*4,x+5,y-10+j*4,\"#4a342b\",1);\n ctx.save();ctx.globalAlpha=.2;ctx.fillStyle=\"#f4e8c4\";ctx.beginPath();ctx.arc(x+3,y-27,8+i*2,0,Math.PI*2);ctx.fill();ctx.restore();\n });\n\n // Gear birds\n function bird(x,y,s,rot) {\n ctx.save();ctx.translate(x,y);ctx.rotate(rot);\n gear(0,0,s,8,\"#bd7836\",\"#56372a\",0);\n ctx.beginPath();ctx.moveTo(-s*.4,0);ctx.quadraticCurveTo(-s*2,-s*1.1,-s*2.45,-s*.2);\n ctx.quadraticCurveTo(-s*1.45,-s*.25,-s*.55,s*.3);ctx.fillStyle=\"#93572f\";ctx.fill();ctx.strokeStyle=\"#503229\";ctx.stroke();\n ctx.beginPath();ctx.moveTo(s*.3,0);ctx.quadraticCurveTo(s*1.8,-s*1,s*2.3,-s*.1);\n ctx.quadraticCurveTo(s*1.5,-s*.15,s*.55,s*.3);ctx.fillStyle=\"#b96d35\";ctx.fill();ctx.stroke();\n ctx.restore();\n }\n bird(402,175,7,-.24); bird(443,142,5,.35); bird(372,129,5,-.28); bird(462,199,4,.25);\n gear(128,195,10,10,\"#b77637\",\"#4a3028\",.2);\n gear(153,181,7,8,\"#d09242\",\"#503229\",-.15);\n\n // foreground mist\n ctx.save();ctx.globalAlpha=.35;ctx.filter=\"blur(7px)\";\n ellipse(238,454,220,35,\"#f6fbf5\");ellipse(466,390,95,27,\"#eef7f3\");ctx.restore();\n\n // frame-like subtle vignette\n const vignette=ctx.createRadialGradient(256,248,170,256,256,380);\n vignette.addColorStop(.68,\"rgba(0,0,0,0)\");\n vignette.addColorStop(1,\"rgba(23,53,64,.28)\");\n ctx.fillStyle=vignette;ctx.fillRect(0,0,W,H);\n}"}], "metadata": {"id": "val-v1-broad-v2-imagination-validation-004", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 4468, "code_sha256": "972176289902b4d92763d666e9b0f6c10711a3a5420f249df0815be1ecae31d4"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A cracked porcelain island floats through golden clouds, revealing intricate clockwork inside while tiny blue-roofed houses cling to its moving plates."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;position:relative;overflow:hidden;background:#dca44e;\";\n\n const c = document.createElement(\"canvas\");\n const dpr = Math.max(1, window.devicePixelRatio || 1);\n c.width = 512 * dpr;\n c.height = 512 * dpr;\n c.style.cssText = \"width:512px;height:512px;display:block;\";\n stage.appendChild(c);\n\n const ctx = c.getContext(\"2d\");\n ctx.scale(dpr, dpr);\n\n const W = 512, H = 512;\n const rng = (() => {\n let s = 824771;\n return () => ((s = (s * 16807) % 2147483647) / 2147483647);\n })();\n\n function path(points, close = true) {\n ctx.beginPath();\n points.forEach((p, i) => i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]));\n if (close) ctx.closePath();\n }\n\n function cloud(x, y, sx, sy, alpha, blur = 0) {\n ctx.save();\n ctx.globalAlpha = alpha;\n ctx.filter = blur ? `blur(${blur}px)` : \"none\";\n const g = ctx.createRadialGradient(x, y, 3, x, y, sx);\n g.addColorStop(0, \"#fff8da\");\n g.addColorStop(.58, \"#f5d690\");\n g.addColorStop(1, \"rgba(225,161,71,0)\");\n ctx.fillStyle = g;\n ctx.beginPath();\n ctx.ellipse(x, y, sx, sy, 0, 0, Math.PI * 2);\n ctx.fill();\n ctx.restore();\n }\n\n const sky = ctx.createLinearGradient(0, 0, 0, H);\n sky.addColorStop(0, \"#b76d21\");\n sky.addColorStop(.26, \"#eeae43\");\n sky.addColorStop(.58, \"#f8cc70\");\n sky.addColorStop(1, \"#a9551e\");\n ctx.fillStyle = sky;\n ctx.fillRect(0, 0, W, H);\n\n for (let i = 0; i < 85; i++) {\n const x = rng() * W;\n const y = rng() * H;\n const r = 1 + rng() * 3;\n ctx.fillStyle = `rgba(255,238,176,${.08 + rng() * .18})`;\n ctx.beginPath();\n ctx.arc(x, y, r, 0, Math.PI * 2);\n ctx.fill();\n }\n\n cloud(74, 55, 125, 49, .54, 12);\n cloud(243, 22, 158, 60, .45, 16);\n cloud(460, 91, 150, 70, .55, 13);\n cloud(25, 187, 100, 54, .65, 9);\n cloud(427, 213, 126, 61, .52, 12);\n cloud(90, 425, 154, 65, .53, 15);\n cloud(370, 448, 192, 75, .6, 17);\n cloud(270, 319, 230, 44, .21, 18);\n\n ctx.save();\n ctx.globalAlpha = .38;\n ctx.filter = \"blur(20px)\";\n ctx.fillStyle = \"#6a321a\";\n ctx.beginPath();\n ctx.ellipse(265, 405, 181, 38, -.05, 0, Math.PI * 2);\n ctx.fill();\n ctx.restore();\n\n // Falling porcelain fragments\n const fragments = [\n [[71,325],[89,316],[95,329],[79,343]], [[415,323],[432,314],[440,333],[422,342]],\n [[111,399],[124,390],[132,403],[118,416]], [[386,402],[401,390],[410,403],[394,417]],\n [[54,272],[66,264],[72,276],[59,286]], [[452,258],[466,252],[470,267],[456,276]]\n ];\n fragments.forEach((f, i) => {\n ctx.save();\n ctx.shadowColor = \"#63321f\";\n ctx.shadowBlur = 8;\n ctx.shadowOffsetY = 5;\n path(f);\n ctx.fillStyle = i % 2 ? \"#f6e7bd\" : \"#d9bd83\";\n ctx.fill();\n ctx.shadowColor = \"transparent\";\n ctx.strokeStyle = \"#88664b\";\n ctx.lineWidth = 1;\n ctx.stroke();\n ctx.restore();\n });\n\n // Island lower earthen underside\n const underside = [[98,258],[122,313],[160,353],[214,384],[268,398],[316,385],[362,352],[401,304],[422,248],[393,265],[358,282],[302,291],[244,287],[187,278],[139,258]];\n ctx.save();\n ctx.shadowColor = \"rgba(69,30,14,.65)\";\n ctx.shadowBlur = 19;\n ctx.shadowOffsetY = 17;\n path(underside);\n const ug = ctx.createLinearGradient(0, 245, 0, 407);\n ug.addColorStop(0, \"#8a4d2d\");\n ug.addColorStop(.35, \"#6b3422\");\n ug.addColorStop(.78, \"#3f201b\");\n ug.addColorStop(1, \"#24151a\");\n ctx.fillStyle = ug;\n ctx.fill();\n ctx.restore();\n\n for (let i = 0; i < 90; i++) {\n const x = 115 + rng() * 284;\n const y = 276 + rng() * 105;\n if (Math.abs(x - 260) / 170 + Math.abs(y - 325) / 83 > 1.1) continue;\n ctx.strokeStyle = `rgba(231,150,79,${.07 + rng() * .15})`;\n ctx.lineWidth = .5 + rng();\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.lineTo(x + (rng() - .5) * 15, y + 8 + rng() * 24);\n ctx.stroke();\n }\n\n // Main porcelain surface\n const island = [[82,226],[103,189],[143,166],[190,151],[231,132],[278,128],[316,142],[353,151],[394,177],[427,213],[430,249],[407,270],[367,286],[329,290],[293,285],[260,294],[223,286],[190,280],[154,276],[118,261],[92,246]];\n ctx.save();\n ctx.shadowColor = \"rgba(67,31,15,.55)\";\n ctx.shadowBlur = 11;\n ctx.shadowOffsetY = 8;\n path(island);\n const pg = ctx.createLinearGradient(135, 120, 350, 298);\n pg.addColorStop(0, \"#fff8dc\");\n pg.addColorStop(.3, \"#f9edc9\");\n pg.addColorStop(.68, \"#ddc895\");\n pg.addColorStop(1, \"#a77a52\");\n ctx.fillStyle = pg;\n ctx.fill();\n ctx.restore();\n\n ctx.save();\n path(island);\n ctx.clip();\n for (let i = 0; i < 55; i++) {\n const x = 90 + rng() * 335, y = 135 + rng() * 150;\n ctx.fillStyle = `rgba(130,96,60,${rng() * .07})`;\n ctx.beginPath();\n ctx.ellipse(x, y, 2 + rng() * 7, .5 + rng() * 2, rng() * 3, 0, Math.PI * 2);\n ctx.fill();\n }\n ctx.restore();\n\n // Exposed mechanism cavity\n ctx.save();\n ctx.shadowColor = \"#604125\";\n ctx.shadowBlur = 8;\n ctx.shadowOffsetY = 4;\n ctx.beginPath();\n ctx.ellipse(267, 228, 95, 70, -.12, 0, Math.PI * 2);\n ctx.fillStyle = \"#543927\";\n ctx.fill();\n ctx.restore();\n\n ctx.save();\n ctx.beginPath();\n ctx.ellipse(267, 228, 89, 64, -.12, 0, Math.PI * 2);\n ctx.clip();\n const cavity = ctx.createRadialGradient(251, 206, 5, 270, 230, 114);\n cavity.addColorStop(0, \"#d29b43\");\n cavity.addColorStop(.18, \"#6e3b21\");\n cavity.addColorStop(.75, \"#281d1b\");\n cavity.addColorStop(1, \"#120f12\");\n ctx.fillStyle = cavity;\n ctx.fillRect(164, 151, 205, 150);\n\n function gear(x, y, r, teeth, col, inner) {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate((x + y) * .021);\n ctx.beginPath();\n for (let i = 0; i < teeth * 2; i++) {\n const a = i * Math.PI / teeth;\n const rr = i % 2 ? r * .79 : r;\n ctx.lineTo(Math.cos(a) * rr, Math.sin(a) * rr);\n }\n ctx.closePath();\n const g = ctx.createRadialGradient(-r*.2, -r*.25, 2, 0, 0, r);\n g.addColorStop(0, \"#ffd36f\");\n g.addColorStop(.35, col);\n g.addColorStop(.77, \"#75421c\");\n g.addColorStop(1, \"#291a17\");\n ctx.fillStyle = g;\n ctx.fill();\n ctx.strokeStyle = \"rgba(35,21,15,.9)\";\n ctx.lineWidth = 2;\n ctx.stroke();\n ctx.beginPath();\n ctx.arc(0, 0, r * .48, 0, Math.PI * 2);\n ctx.fillStyle = inner || \"#3b2920\";\n ctx.fill();\n ctx.stroke();\n ctx.beginPath();\n ctx.arc(0, 0, r * .17, 0, Math.PI * 2);\n ctx.fillStyle = \"#d4a457\";\n ctx.fill();\n ctx.restore();\n }\n\n gear(226, 224, 44, 14, \"#c8822e\");\n gear(302, 204, 31, 12, \"#af6828\");\n gear(304, 256, 42, 15, \"#b9792a\");\n gear(235, 274, 25, 10, \"#d29d42\");\n gear(340, 232, 18, 9, \"#976027\");\n\n ctx.strokeStyle = \"#c9974f\";\n ctx.lineWidth = 4;\n ctx.beginPath();\n ctx.moveTo(175, 244); ctx.bezierCurveTo(194, 234, 189, 199, 209, 186);\n ctx.moveTo(323, 275); ctx.bezierCurveTo(350, 271, 349, 255, 367, 248);\n ctx.stroke();\n\n ctx.strokeStyle = \"rgba(255,220,129,.52)\";\n ctx.lineWidth = 1;\n for (let i = 0; i < 13; i++) {\n ctx.beginPath();\n ctx.arc(267, 228, 52 + i * 5, -.8, .4);\n ctx.stroke();\n }\n ctx.restore();\n\n // Cavity porcelain rim\n ctx.save();\n ctx.beginPath();\n ctx.ellipse(267, 228, 95, 70, -.12, 0, Math.PI * 2);\n ctx.strokeStyle = \"#8c6446\";\n ctx.lineWidth = 7;\n ctx.stroke();\n ctx.strokeStyle = \"#fff5d2\";\n ctx.lineWidth = 3;\n ctx.stroke();\n ctx.restore();\n\n // Cracks\n const cracks = [\n [[174,167],[181,187],[174,203],[187,216],[185,237]],\n [[174,203],[158,209],[146,228],[128,231]],\n [[332,151],[326,175],[339,189],[332,204]],\n [[326,175],[307,180],[298,194]],\n [[116,217],[137,225],[151,244],[151,271]],\n [[379,189],[366,206],[378,221],[369,241]],\n [[213,278],[208,260],[217,244],[207,230]],\n [[300,282],[292,267],[302,247]]\n ];\n ctx.lineCap = \"round\";\n cracks.forEach((line) => {\n ctx.beginPath();\n line.forEach((p, i) => i ? ctx.lineTo(...p) : ctx.moveTo(...p));\n ctx.strokeStyle = \"#6a4d40\";\n ctx.lineWidth = 2.1;\n ctx.stroke();\n ctx.strokeStyle = \"rgba(255,249,221,.6)\";\n ctx.lineWidth = .65;\n ctx.stroke();\n });\n\n // Tiny houses\n function house(x, y, s) {\n ctx.save();\n ctx.translate(x, y);\n ctx.shadowColor = \"rgba(63,33,18,.5)\";\n ctx.shadowBlur = 5;\n ctx.shadowOffsetY = 3;\n\n ctx.fillStyle = \"#e9dfbd\";\n ctx.fillRect(-s*.44, -s*.02, s*.88, s*.67);\n ctx.fillStyle = \"#b99e76\";\n ctx.fillRect(-s*.36, s*.07, s*.16, s*.55);\n ctx.fillStyle = \"#8caec8\";\n ctx.fillRect(s*.11, s*.14, s*.16, s*.18);\n ctx.fillRect(s*.11, s*.4, s*.16, s*.15);\n\n ctx.beginPath();\n ctx.moveTo(-s*.58, 0);\n ctx.lineTo(0, -s*.58);\n ctx.lineTo(s*.58, 0);\n ctx.closePath();\n const rg = ctx.createLinearGradient(0, -s*.6, 0, .1*s);\n rg.addColorStop(0, \"#5c9fd1\");\n rg.addColorStop(1, \"#174f8b\");\n ctx.fillStyle = rg;\n ctx.fill();\n ctx.strokeStyle = \"#153f70\";\n ctx.lineWidth = 1.2;\n ctx.stroke();\n\n ctx.fillStyle = \"#eee6c8\";\n ctx.fillRect(s*.15, -s*.51, s*.12, s*.22);\n ctx.restore();\n }\n\n house(145, 193, 26);\n house(351, 181, 24);\n house(391, 220, 19);\n house(126, 238, 19);\n house(190, 159, 17);\n\n // fine porcelain contour\n path(island);\n ctx.strokeStyle = \"#795b42\";\n ctx.lineWidth = 2;\n ctx.stroke();\n ctx.strokeStyle = \"rgba(255,250,223,.85)\";\n ctx.lineWidth = 1;\n ctx.stroke();\n\n // warm foreground haze\n ctx.save();\n ctx.globalAlpha = .22;\n ctx.filter = \"blur(15px)\";\n cloud(258, 491, 280, 53, .7, 0);\n ctx.restore();\n\n const vignette = ctx.createRadialGradient(256, 240, 180, 256, 256, 420);\n vignette.addColorStop(.63, \"rgba(0,0,0,0)\");\n vignette.addColorStop(1, \"rgba(68,24,10,.37)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0, 0, W, H);\n}"}], "metadata": {"id": "val-v1-broad-v2-imagination-validation-005", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 4753, "code_sha256": "c61d9ac38b1dcdd805fe2c82ac49739d7c4212bb2ebfd21553dd80d45ddeee9b"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A circular clockwork island migrates beneath an aurora, propelled by six glowing turbines around its rim and crowned with a frozen observatory."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"position:relative;overflow:hidden;background:#030817;\";\n const canvas = document.createElement(\"canvas\");\n canvas.style.cssText = \"width:100%;height:100%;display:block;\";\n stage.appendChild(canvas);\n\n const dpr = Math.min(devicePixelRatio || 1, 2);\n canvas.width = canvas.height = 512 * dpr;\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(dpr, dpr);\n\n const W = 512, H = 512;\n const rnd = (() => {\n let s = 849217;\n return () => ((s = (s * 1664525 + 1013904223) >>> 0) / 4294967296);\n })();\n\n const stars = Array.from({ length: 155 }, () => ({\n x: rnd() * W,\n y: rnd() * 285,\n r: rnd() * 1.5 + 0.15,\n a: rnd() * 0.75 + 0.15,\n p: rnd() * Math.PI * 2\n }));\n\n const flakes = Array.from({ length: 60 }, () => ({\n x: rnd() * W,\n y: rnd() * H,\n s: rnd() * 1.8 + 0.3,\n d: rnd() * 0.5 + 0.2,\n p: rnd() * Math.PI * 2\n }));\n\n function pathEllipse(cx, cy, rx, ry) {\n ctx.beginPath();\n ctx.ellipse(cx, cy, rx, ry, 0, 0, Math.PI * 2);\n }\n\n function glow(x, y, r, color, alpha = 1) {\n const g = ctx.createRadialGradient(x, y, 0, x, y, r);\n g.addColorStop(0, color.replace(\")\", `,${alpha})`).replace(\"rgb\", \"rgba\"));\n g.addColorStop(0.25, color.replace(\")\", `,${alpha * 0.45})`).replace(\"rgb\", \"rgba\"));\n g.addColorStop(1, color.replace(\")\", \",0)\").replace(\"rgb\", \"rgba\"));\n ctx.fillStyle = g;\n ctx.fillRect(x - r, y - r, r * 2, r * 2);\n }\n\n function gear(x, y, r, teeth, angle, fill, stroke) {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(angle);\n ctx.beginPath();\n for (let i = 0; i < teeth * 2; i++) {\n const a = i * Math.PI / teeth;\n const rr = i % 2 ? r * 0.83 : r;\n const px = Math.cos(a) * rr, py = Math.sin(a) * rr * 0.52;\n i ? ctx.lineTo(px, py) : ctx.moveTo(px, py);\n }\n ctx.closePath();\n ctx.fillStyle = fill;\n ctx.fill();\n ctx.strokeStyle = stroke;\n ctx.lineWidth = 1.2;\n ctx.stroke();\n\n ctx.beginPath();\n ctx.ellipse(0, 0, r * 0.45, r * 0.23, 0, 0, Math.PI * 2);\n ctx.fillStyle = \"#122537\";\n ctx.fill();\n ctx.strokeStyle = \"#6d93a2\";\n ctx.stroke();\n ctx.beginPath();\n ctx.ellipse(0, 0, r * 0.15, r * 0.08, 0, 0, Math.PI * 2);\n ctx.fillStyle = \"#9bcbd4\";\n ctx.fill();\n ctx.restore();\n }\n\n function turbine(x, y, scale, phase, t) {\n ctx.save();\n ctx.translate(x, y);\n ctx.scale(scale, scale);\n\n ctx.filter = \"blur(13px)\";\n const g = ctx.createRadialGradient(0, 0, 1, 0, 0, 34);\n g.addColorStop(0, \"rgba(212,255,255,.95)\");\n g.addColorStop(.22, \"rgba(76,237,255,.75)\");\n g.addColorStop(.55, \"rgba(44,111,255,.25)\");\n g.addColorStop(1, \"rgba(44,111,255,0)\");\n ctx.fillStyle = g;\n ctx.beginPath();\n ctx.arc(0, 0, 35, 0, Math.PI * 2);\n ctx.fill();\n ctx.filter = \"none\";\n\n ctx.beginPath();\n ctx.arc(0, 0, 19, 0, Math.PI * 2);\n const ring = ctx.createRadialGradient(-5, -7, 2, 0, 0, 22);\n ring.addColorStop(0, \"#a3e5ec\");\n ring.addColorStop(.3, \"#365d73\");\n ring.addColorStop(.7, \"#101c2c\");\n ring.addColorStop(1, \"#80c8dc\");\n ctx.fillStyle = ring;\n ctx.fill();\n ctx.strokeStyle = \"#c6f4f5\";\n ctx.lineWidth = 1.2;\n ctx.stroke();\n\n ctx.save();\n ctx.rotate(phase + t * 0.005);\n for (let i = 0; i < 5; i++) {\n ctx.rotate(Math.PI * 2 / 5);\n ctx.beginPath();\n ctx.moveTo(2, -2);\n ctx.quadraticCurveTo(23, -11, 19, -2);\n ctx.quadraticCurveTo(12, 7, 2, 3);\n ctx.closePath();\n const blade = ctx.createLinearGradient(0, 0, 21, 0);\n blade.addColorStop(0, \"#d1ffff\");\n blade.addColorStop(.35, \"#3ddaf5\");\n blade.addColorStop(1, \"#164a83\");\n ctx.fillStyle = blade;\n ctx.fill();\n ctx.strokeStyle = \"rgba(215,255,255,.8)\";\n ctx.lineWidth = .5;\n ctx.stroke();\n }\n ctx.restore();\n\n ctx.beginPath();\n ctx.arc(0, 0, 7, 0, Math.PI * 2);\n ctx.fillStyle = \"#e1ffff\";\n ctx.fill();\n ctx.beginPath();\n ctx.arc(-2, -2, 2.5, 0, Math.PI * 2);\n ctx.fillStyle = \"#fff\";\n ctx.fill();\n ctx.restore();\n }\n\n function drawAurora(t) {\n ctx.save();\n ctx.globalCompositeOperation = \"screen\";\n for (let band = 0; band < 4; band++) {\n const yy = 59 + band * 21;\n ctx.filter = \"blur(13px)\";\n const grad = ctx.createLinearGradient(0, yy - 40, 0, yy + 85);\n const hue = band % 2 ? \"91,255,194\" : \"71,180,255\";\n grad.addColorStop(0, `rgba(${hue},0)`);\n grad.addColorStop(.35, `rgba(${hue},.16)`);\n grad.addColorStop(.62, `rgba(167,104,255,.12)`);\n grad.addColorStop(1, `rgba(${hue},0)`);\n ctx.fillStyle = grad;\n ctx.beginPath();\n ctx.moveTo(-30, yy);\n for (let x = -30; x <= 550; x += 20) {\n const wave = Math.sin(x * .021 + t * .00038 + band * 1.7) * 23\n + Math.sin(x * .056 - t * .0002 + band) * 9;\n ctx.lineTo(x, yy + wave);\n }\n for (let x = 550; x >= -30; x -= 20) {\n const wave = Math.sin(x * .019 + t * .00037 + band * 1.7) * 23\n + Math.sin(x * .055 - t * .0002 + band) * 9;\n ctx.lineTo(x, yy + 58 + wave * .35);\n }\n ctx.closePath();\n ctx.fill();\n }\n ctx.restore();\n ctx.filter = \"none\";\n }\n\n function drawObservatory(t) {\n ctx.save();\n\n ctx.filter = \"blur(18px)\";\n ctx.fillStyle = \"rgba(116,232,255,.20)\";\n ctx.beginPath();\n ctx.ellipse(257, 207, 96, 54, 0, 0, Math.PI * 2);\n ctx.fill();\n ctx.filter = \"none\";\n\n ctx.beginPath();\n ctx.moveTo(202, 258);\n ctx.lineTo(216, 211);\n ctx.lineTo(296, 211);\n ctx.lineTo(315, 258);\n ctx.closePath();\n const tower = ctx.createLinearGradient(0, 205, 0, 260);\n tower.addColorStop(0, \"#bcf5f8\");\n tower.addColorStop(.35, \"#578ca4\");\n tower.addColorStop(1, \"#172b46\");\n ctx.fillStyle = tower;\n ctx.fill();\n ctx.strokeStyle = \"#d8ffff\";\n ctx.lineWidth = 1;\n ctx.stroke();\n\n for (let x = 220; x < 302; x += 16) {\n ctx.beginPath();\n ctx.moveTo(x, 216);\n ctx.lineTo(x - 3, 253);\n ctx.strokeStyle = \"rgba(215,255,255,.52)\";\n ctx.stroke();\n }\n\n ctx.beginPath();\n ctx.ellipse(256, 212, 52, 14, 0, 0, Math.PI * 2);\n ctx.fillStyle = \"#18334e\";\n ctx.fill();\n ctx.strokeStyle = \"#c9ffff\";\n ctx.stroke();\n\n ctx.save();\n ctx.beginPath();\n ctx.ellipse(256, 213, 46, 42, 0, Math.PI, Math.PI * 2);\n ctx.closePath();\n const dome = ctx.createRadialGradient(242, 189, 4, 257, 215, 61);\n dome.addColorStop(0, \"#e5ffff\");\n dome.addColorStop(.23, \"#92e8f2\");\n dome.addColorStop(.58, \"#3f7da0\");\n dome.addColorStop(1, \"#152946\");\n ctx.fillStyle = dome;\n ctx.fill();\n ctx.strokeStyle = \"#dcffff\";\n ctx.lineWidth = 1.4;\n ctx.stroke();\n\n ctx.clip();\n for (let i = -3; i < 5; i++) {\n ctx.beginPath();\n ctx.moveTo(207 + i * 16, 220);\n ctx.lineTo(246 + i * 17, 166);\n ctx.strokeStyle = \"rgba(230,255,255,.58)\";\n ctx.lineWidth = 1;\n ctx.stroke();\n }\n ctx.restore();\n\n ctx.beginPath();\n ctx.moveTo(256, 170);\n ctx.lineTo(256, 147);\n ctx.strokeStyle = \"#bffcff\";\n ctx.lineWidth = 2;\n ctx.stroke();\n ctx.beginPath();\n ctx.moveTo(250, 153);\n ctx.lineTo(256, 143);\n ctx.lineTo(262, 153);\n ctx.closePath();\n ctx.fillStyle = \"#dfffff\";\n ctx.fill();\n\n ctx.filter = \"blur(6px)\";\n ctx.fillStyle = \"rgba(155,252,255,.8)\";\n ctx.beginPath();\n ctx.arc(256, 144, 5 + Math.sin(t * .003) * 1.5, 0, Math.PI * 2);\n ctx.fill();\n ctx.filter = \"none\";\n ctx.restore();\n }\n\n function drawIsland(t) {\n ctx.save();\n\n ctx.filter = \"blur(18px)\";\n ctx.fillStyle = \"rgba(36,105,174,.22)\";\n ctx.beginPath();\n ctx.ellipse(258, 404, 180, 38, 0, 0, Math.PI * 2);\n ctx.fill();\n ctx.filter = \"none\";\n\n ctx.beginPath();\n ctx.moveTo(87, 326);\n ctx.bezierCurveTo(97, 385, 149, 428, 256, 438);\n ctx.bezierCurveTo(360, 430, 417, 386, 427, 326);\n ctx.lineTo(87, 326);\n ctx.closePath();\n const underside = ctx.createLinearGradient(0, 320, 0, 447);\n underside.addColorStop(0, \"#425b67\");\n underside.addColorStop(.27, \"#1d3442\");\n underside.addColorStop(1, \"#071423\");\n ctx.fillStyle = underside;\n ctx.fill();\n ctx.strokeStyle = \"#7097a0\";\n ctx.lineWidth = 1.3;\n ctx.stroke();\n\n for (let i = 0; i < 18; i++) {\n const x = 102 + i * 18;\n const depth = 20 + Math.sin(i * 1.7) * 12;\n ctx.beginPath();\n ctx.moveTo(x, 351);\n ctx.lineTo(x + 8, 351);\n ctx.lineTo(x + 3, 351 + depth);\n ctx.strokeStyle = \"rgba(112,175,183,.25)\";\n ctx.lineWidth = 1;\n ctx.stroke();\n }\n\n pathEllipse(256, 323, 172, 88);\n const top = ctx.createRadialGradient(222, 284, 18, 256, 326, 184);\n top.addColorStop(0, \"#7598a0\");\n top.addColorStop(.36, \"#385965\");\n top.addColorStop(.74, \"#1b3442\");\n top.addColorStop(1, \"#0b1b2a\");\n ctx.fillStyle = top;\n ctx.fill();\n ctx.strokeStyle = \"#b2e6e4\";\n ctx.lineWidth = 2;\n ctx.stroke();\n\n ctx.save();\n pathEllipse(256, 323, 164, 81);\n ctx.clip();\n\n const ice = ctx.createLinearGradient(0, 238, 0, 390);\n ice.addColorStop(0, \"rgba(211,255,255,.40)\");\n ice.addColorStop(.5, \"rgba(128,215,225,.06)\");\n ice.addColorStop(1, \"rgba(21,63,78,.16)\");\n ctx.fillStyle = ice;\n ctx.fillRect(80, 230, 360, 168);\n\n for (let i = 0; i < 38; i++) {\n const x = 91 + rnd() * 330;\n const y = 263 + rnd() * 115;\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.lineTo(x + 16 + rnd() * 38, y + (rnd() - .5) * 18);\n ctx.strokeStyle = `rgba(184,249,247,${.08 + rnd() * .2})`;\n ctx.lineWidth = rnd() * 1.2 + .25;\n ctx.stroke();\n }\n\n gear(171, 335, 42, 14, .15 + t * .0001, \"#294958\", \"#93c6c8\");\n gear(326, 334, 47, 16, -.2 - t * .00008, \"#213d4d\", \"#9bcdd0\");\n gear(251, 355, 34, 12, .25 + t * .00013, \"#34596a\", \"#b5ebea\");\n gear(214, 290, 20, 11, 0, \"#294959\", \"#8fc2c9\");\n gear(293, 287, 18, 10, 0, \"#335969\", \"#9bd9dd\");\n\n ctx.beginPath();\n ctx.ellipse(256, 323, 112, 53, 0, 0, Math.PI * 2);\n ctx.strokeStyle = \"rgba(186,244,239,.52)\";\n ctx.lineWidth = 2;\n ctx.stroke();\n ctx.beginPath();\n ctx.ellipse(256, 323, 72, 33, 0, 0, Math.PI * 2);\n ctx.strokeStyle = \"rgba(56,136,155,.75)\";\n ctx.lineWidth = 3;\n ctx.stroke();\n\n for (let a = 0; a < Math.PI * 2; a += Math.PI / 8) {\n const x1 = 256 + Math.cos(a) * 75, y1 = 323 + Math.sin(a) * 34;\n const x2 = 256 + Math.cos(a) * 110, y2 = 323 + Math.sin(a) * 52;\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.strokeStyle = \"#7fc5cc\";\n ctx.lineWidth = 2;\n ctx.stroke();\n }\n ctx.restore();\n ctx.restore();\n }\n\n function frame(t) {\n ctx.clearRect(0, 0, W, H);\n\n const sky = ctx.createLinearGradient(0, 0, 0, H);\n sky.addColorStop(0, \"#020515\");\n sky.addColorStop(.52, \"#07142a\");\n sky.addColorStop(1, \"#0d2435\");\n ctx.fillStyle = sky;\n ctx.fillRect(0, 0, W, H);\n\n const horizonGlow = ctx.createRadialGradient(259, 270, 10, 256, 273, 300);\n horizonGlow.addColorStop(0, \"rgba(33,112,168,.24)\");\n horizonGlow.addColorStop(.55, \"rgba(9,42,85,.11)\");\n horizonGlow.addColorStop(1, \"rgba(0,0,0,0)\");\n ctx.fillStyle = horizonGlow;\n ctx.fillRect(0, 0, W, H);\n\n drawAurora(t);\n\n for (const s of stars) {\n const pulse = .72 + Math.sin(t * .0015 + s.p) * .28;\n ctx.fillStyle = `rgba(210,244,255,${s.a * pulse})`;\n ctx.beginPath();\n ctx.arc(s.x, s.y, s.r, 0, Math.PI * 2);\n ctx.fill();\n }\n\n drawIsland(t);\n\n const turbines = [\n [99, 304, .9, .2],\n [142, 366, .88, 1.1],\n [220, 399, .86, 2.2],\n [306, 398, .86, .5],\n [381, 366, .88, 1.6],\n [414, 304, .9, 2.7]\n ];\n for (const q of turbines) turbine(q[0], q[1], q[2], q[3], t);\n\n drawObservatory(t);\n\n for (const f of flakes) {\n const x = (f.x + Math.sin(t * .0004 + f.p) * 8) % 520;\n const y = (f.y + t * .018 * f.d) % 520;\n ctx.fillStyle = `rgba(222,253,255,${.2 + f.s * .16})`;\n ctx.beginPath();\n ctx.arc(x, y, f.s * .45, 0, Math.PI * 2);\n ctx.fill();\n }\n\n const vignette = ctx.createRadialGradient(256, 258, 180, 256, 258, 410);\n vignette.addColorStop(.55, \"rgba(0,0,0,0)\");\n vignette.addColorStop(1, \"rgba(0,4,17,.72)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0, 0, W, H);\n\n requestAnimationFrame(frame);\n }\n\n requestAnimationFrame(frame);\n}"}], "metadata": {"id": "val-v1-broad-v2-imagination-validation-009", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 5519, "code_sha256": "3e6db726981fa347a33e43de9f725d8091217c27b31f245b7ebb8db23cc87c2d"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "Inside a small community bakery at sunrise, warm pendant lamps glow above a flour-dusted wooden counter. A baker in a blue apron slides golden loaves from a brick oven while an assistant arranges croissants in a glass display case. Three customers wait near the tiled entrance: an older man holding a canvas bag, a cyclist in a yellow rain jacket, and a parent beside a child in striped boots. Steam rises from two ceramic mugs on a round caf\u00e9 table. Through the front window, pale pink dawn light illuminates parked bicycles, damp pavement, and flower boxes. Chalkboard menus, wicker bread baskets, and a wall clock showing 6:20 are clearly visible."}, {"role": "assistant", "content": "async function render(stage) {\n const W = 512, H = 512, S = 2;\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;overflow:hidden;position:relative;background:#e9c5ac\";\n const c = document.createElement(\"canvas\");\n c.width = W * S; c.height = H * S;\n c.style.cssText = \"width:512px;height:512px;display:block\";\n stage.appendChild(c);\n const x = c.getContext(\"2d\");\n x.scale(S, S);\n x.lineJoin = \"round\"; x.lineCap = \"round\";\n\n const rect = (a,b,d,e,fill,stroke) => { x.beginPath(); x.rect(a,b,d,e); if(fill){x.fillStyle=fill;x.fill()} if(stroke){x.strokeStyle=stroke;x.stroke()} };\n const line = (a,b,d,e,col,w=1) => { x.beginPath();x.moveTo(a,b);x.lineTo(d,e);x.strokeStyle=col;x.lineWidth=w;x.stroke(); };\n const ellipse = (a,b,rx,ry,fill,stroke) => { x.beginPath();x.ellipse(a,b,rx,ry,0,0,Math.PI*2);if(fill){x.fillStyle=fill;x.fill()}if(stroke){x.strokeStyle=stroke;x.stroke()} };\n const poly = (p, fill, stroke) => { x.beginPath();x.moveTo(p[0][0],p[0][1]);for(let i=1;i { const g=x.createLinearGradient(a,b,d,e);stops.forEach(v=>g.addColorStop(v[0],v[1]));return g; };\n const txt = (t,a,b,font,color,align=\"left\") => { x.font=font;x.fillStyle=color;x.textAlign=align;x.fillText(t,a,b); };\n\n // dawn ceiling and walls\n rect(0,0,512,512,grad(0,0,0,512,[[0,\"#f8d9bb\"],[.34,\"#e9ae88\"],[1,\"#9c5939\"]]));\n rect(0,0,512,58,\"#f6d7b5\");\n line(0,57,512,57,\"#ca8761\",2);\n\n // front window dawn scene\n rect(315,40,187,198,\"#cf9277\",\"#6f4435\");\n rect(321,46,175,184,grad(0,46,0,230,[[0,\"#fbd6d2\"],[.48,\"#efd0d4\"],[1,\"#a5b8be\"]]));\n // dawn cloud strokes\n x.globalAlpha=.48;\n ellipse(370,77,42,8,\"#fff3ed\"); ellipse(446,93,54,10,\"#fff4ef\"); ellipse(340,112,32,6,\"#dcaec1\");\n x.globalAlpha=1;\n // buildings outside\n rect(322,130,45,62,\"#a28b8b\"); rect(371,116,53,77,\"#c3a0a0\"); rect(428,139,67,55,\"#927a78\");\n for(let i=0;i<6;i++) rect(327+i*8,143,4,9,\"#e9c3b7\");\n for(let i=0;i<5;i++) rect(379+i*9,128,4,10,\"#f4d5c8\");\n // wet pavement\n poly([[321,191],[496,190],[496,230],[321,230]],\"#71858a\");\n for(let i=0;i<12;i++) line(324+i*15,204+(i%3)*5,335+i*15,203+(i%3)*5,\"#b1c0bd\",1);\n // bicycles outside\n const bike=(bx,by,sc) => {\n x.lineWidth=1.4*sc;x.strokeStyle=\"#38464d\";\n ellipse(bx,by,11*sc,11*sc,null,\"#38464d\");ellipse(bx+28*sc,by,11*sc,11*sc,null,\"#38464d\");\n line(bx,by,bx+10*sc,by-18*sc,\"#38464d\",1.5*sc);line(bx+10*sc,by-18*sc,bx+20*sc,by,\"#38464d\",1.5*sc);\n line(bx+10*sc,by-18*sc,bx+28*sc,by,\"#38464d\",1.5*sc);line(bx+10*sc,by-18*sc,bx+5*sc,by-23*sc,\"#38464d\",1.5*sc);\n line(bx+20*sc,by,bx+22*sc,by-20*sc,\"#38464d\",1.5*sc); line(bx+18*sc,by-21*sc,bx+27*sc,by-21*sc,\"#38464d\",1.5*sc);\n };\n bike(345,207,.8); bike(447,213,.9);\n // flower boxes\n rect(327,183,49,10,\"#644737\",\"#493127\");rect(432,180,52,11,\"#654638\",\"#493127\");\n for(let i=0;i<10;i++){ellipse(333+i*4,181-(i%3)*3,4,4,i%2?\"#e07578\":\"#f5c56b\");ellipse(438+i*4,178-(i%2)*3,4,4,i%2?\"#d96778\":\"#f4b465\")}\n // mullions\n line(405,42,405,232,\"#714436\",5);line(320,136,498,136,\"#714436\",4);\n // window shine\n x.globalAlpha=.25;poly([[326,49],[342,49],[390,229],[378,229]],\"#fff\");x.globalAlpha=1;\n\n // left exposed brick oven wall\n rect(0,57,177,235,\"#b86e4a\");\n for(let yy=65;yy<280;yy+=15) for(let xx=(yy/15%2?0:-12);xx<180;xx+=29) {\n rect(xx,yy,26,13, yy%30?\"#c37c55\":\"#ad613f\",\"#985039\");\n }\n // chalkboard\n rect(14,78,105,85,\"#694635\",\"#3b2d27\");\n rect(18,82,97,77,\"#263a35\");\n txt(\"TODAY'S BREAD\",66,99,\"bold 10px Georgia\",\"#f2e6c4\",\"center\");\n txt(\"SOURDOUGH 4\",26,116,\"8px monospace\",\"#e9e2c4\");\n txt(\"CROISSANT 3\",26,130,\"8px monospace\",\"#e9e2c4\");\n txt(\"CINNAMON 3\",26,144,\"8px monospace\",\"#e9e2c4\");\n // oven\n rect(30,177,145,119,\"#8d4b32\",\"#563326\");\n x.beginPath();x.arc(103,228,53,Math.PI,0);x.lineTo(156,274);x.lineTo(50,274);x.closePath();x.fillStyle=\"#633525\";x.fill();\n x.beginPath();x.arc(103,231,40,Math.PI,0);x.lineTo(143,266);x.lineTo(63,266);x.closePath();x.fillStyle=\"#241b19\";x.fill();\n ellipse(102,260,34,7,\"#e79a38\");\n for(let i=0;i<5;i++) ellipse(76+i*13,257-(i%2)*3,9,5,\"#d98225\");\n rect(45,278,118,14,\"#c17845\",\"#663626\");\n // oven brick highlights\n for(let i=0;i<8;i++) line(37+i*17,188,49+i*17,188,\"#d99564\",2);\n\n // counter base\n poly([[0,300],[512,294],[512,512],[0,512]],grad(0,300,0,512,[[0,\"#75432c\"],[1,\"#3f2926\"]]));\n // wood planks\n for(let i=0;i<10;i++) line(0,330+i*23,512,324+i*23,\"#9f6141\",1);\n for(let i=0;i<15;i++) line(i*38,312,i*38-10,510,\"#4d3029\",1);\n\n // countertop\n poly([[0,279],[512,269],[512,315],[0,331]],grad(0,275,0,331,[[0,\"#d7a269\"],[.35,\"#f0c98d\"],[1,\"#a96139\"]]),\"#633a2c\");\n line(0,301,512,286,\"#fff0c9\",2);\n // flour dust\n x.globalAlpha=.45;\n for(let i=0;i<45;i++) ellipse(20+Math.random()*290,288+Math.random()*20,1+Math.random()*2,.5,\"#fff5d8\");\n x.globalAlpha=1;\n\n // pendant lamps\n const lamp=(lx) => {\n x.globalAlpha=.18;ellipse(lx,92,58,44,\"#ffd47f\");x.globalAlpha=1;\n line(lx,0,lx,48,\"#584039\",2);\n poly([[lx-19,48],[lx+19,48],[lx+12,66],[lx-12,66]],\"#604038\",\"#392c29\");\n ellipse(lx,66,12,4,\"#ffd680\");\n x.globalAlpha=.5;ellipse(lx,71,28,15,\"#ffc560\");x.globalAlpha=1;\n };\n lamp(207);lamp(283);\n\n // rear bread shelves\n rect(186,66,115,116,\"#855139\",\"#543328\");\n rect(191,74,105,31,\"#b87a48\");rect(191,112,105,31,\"#b87a48\");rect(191,150,105,26,\"#b87a48\");\n for(let row=0;row<3;row++) for(let i=0;i<4;i++){\n const bx=203+i*23, by=92+row*38;\n ellipse(bx,by,12,7,row===1?\"#c97827\":\"#d88b37\");\n line(bx-6,by-2,bx+6,by+2,\"#f5c56a\",1);\n }\n\n // glass display case right\n poly([[296,205],[484,195],[484,324],[296,332]],\"rgba(162,214,218,.20)\",\"#5d5149\");\n line(296,245,484,237,\"#716259\",2);line(296,284,484,279,\"#716259\",2);\n line(309,204,309,330,\"#685750\",2);line(472,197,472,325,\"#685750\",2);\n // trays / croissants\n for(let r=0;r<2;r++) for(let i=0;i<5;i++){\n const cx=326+i*28, cy=229+r*39;\n x.beginPath();x.arc(cx,cy,9,Math.PI*.1,Math.PI*.9);x.lineTo(cx+8,cy+4);x.quadraticCurveTo(cx,cy+12,cx-8,cy+4);x.closePath();\n x.fillStyle=\"#d68a31\";x.fill();x.strokeStyle=\"#a55b25\";x.stroke();\n line(cx-5,cy+3,cx-2,cy+7,\"#f5c66c\",1);line(cx+1,cy+2,cx+4,cy+7,\"#f5c66c\",1);\n }\n x.globalAlpha=.22;poly([[302,210],[360,206],[432,320],[378,323]],\"#efffff\");x.globalAlpha=1;\n rect(287,325,204,11,\"#6d4231\");\n\n // baker behind counter, blue apron\n // legs hidden / body\n ellipse(211,191,18,22,\"#d49a78\");\n // hair\n x.beginPath();x.arc(211,183,17,Math.PI,0);x.fillStyle=\"#4a3024\";x.fill();\n ellipse(211,190,13,16,\"#d9a07d\");\n // ear, face features\n ellipse(216,191,1.5,2,\"#493128\");line(206,197,215,197,\"#8c4a3e\",1);\n // white shirt shoulders\n poly([[184,218],[210,207],[238,219],[244,274],[181,278]],\"#ede4d3\",\"#765546\");\n // apron\n poly([[196,216],[225,216],[236,279],[188,280]],\"#315d79\",\"#27465c\");\n line(195,224,227,224,\"#8bb1c2\",1);\n // baker arm holding peel\n poly([[232,223],[242,229],[269,252],[265,258],[235,240]],\"#d79a77\",\"#714836\");\n line(260,251,326,214,\"#6d4731\",4);\n poly([[322,207],[356,197],[365,207],[333,221]],\"#936040\",\"#5c382a\");\n // loaf on peel\n ellipse(344,204,18,9,\"#d98a2d\",\"#9a5426\");\n for(let i=0;i<3;i++) line(333+i*7,200,339+i*7,207,\"#f7ce72\",1.5);\n\n // caf\u00e9 table\n ellipse(175,360,61,14,\"#5e3a2f\",\"#382822\");\n rect(171,359,8,72,\"#52342b\");ellipse(175,434,42,9,\"#493129\");\n // mugs\n const mug=(mx,my,col) => {\n ellipse(mx,my,13,5,\"#f7eee0\",\"#6a4638\");rect(mx-12,my,24,16,col,\"#6a4638\");ellipse(mx,my+16,12,4,col,\"#6a4638\");\n x.beginPath();x.arc(mx+13,my+7,6,-Math.PI/2,Math.PI/2);x.strokeStyle=\"#6a4638\";x.lineWidth=2;x.stroke();\n x.globalAlpha=.42;for(let i=0;i<3;i++){x.beginPath();x.moveTo(mx-4+i*4,my-5);x.bezierCurveTo(mx-9+i*4,my-16,mx+5+i*4,my-18,mx+i*4,my-29);x.strokeStyle=\"#fff2d2\";x.lineWidth=1.5;x.stroke()}x.globalAlpha=1;\n };\n mug(158,345,\"#d6e0d8\");mug(193,342,\"#b25d4a\");\n\n // people near entrance foreground\n // older man canvas bag\n ellipse(62,356,15,18,\"#d8a181\");ellipse(62,341,16,10,\"#bfc2bd\");\n poly([[45,372],[76,370],[83,442],[41,442]],\"#5b675d\",\"#39433d\");\n line(48,382,35,414,\"#d7a07e\",7);line(76,382,91,407,\"#d7a07e\",7);\n poly([[84,400],[104,407],[100,438],[78,434]],\"#d9c4a0\",\"#765f48\");\n x.beginPath();x.arc(91,407,11,Math.PI,0);x.strokeStyle=\"#765f48\";x.lineWidth=2;x.stroke();\n poly([[48,440],[61,440],[58,484],[45,484]],\"#303b39\");poly([[66,440],[78,440],[83,484],[70,484]],\"#303b39\");\n ellipse(50,485,11,4,\"#261f1d\");ellipse(80,485,11,4,\"#261f1d\");\n\n // cyclist in yellow raincoat\n ellipse(117,352,14,18,\"#ca916e\");poly([[103,340],[130,339],[132,347],[103,348]],\"#454746\");\n poly([[94,371],[133,368],[145,442],[87,442]],\"#e4bd25\",\"#9d7b1f\");\n line(103,380,87,410,\"#cc936e\",6);line(131,381,151,410,\"#cc936e\",6);\n line(99,384,128,414,\"#f5db44\",2);line(110,370,110,440,\"#f5db44\",2);\n poly([[96,440],[110,440],[106,484],[93,484]],\"#273941\");poly([[122,440],[136,440],[143,484],[130,484]],\"#273941\");\n ellipse(98,485,11,4,\"#1d2529\");ellipse(140,485,11,4,\"#1d2529\");\n\n // parent and child\n ellipse(390,351,15,18,\"#b9795f\");poly([[374,370],[406,370],[416,449],[366,449]],\"#a64f4d\",\"#71383a\");\n poly([[372,446],[388,446],[387,485],[373,485]],\"#414850\");poly([[397,446],[411,446],[418,485],[403,485]],\"#414850\");\n ellipse(378,486,11,4,\"#2b2927\");ellipse(414,486,11,4,\"#2b2927\");\n // child\n ellipse(444,385,11,13,\"#d79775\");x.beginPath();x.arc(444,378,12,Math.PI,0);x.fillStyle=\"#5b3a2d\";x.fill();\n poly([[430,398],[456,398],[462,448],[427,448]],\"#7d9c91\");\n line(433,411,456,411,\"#d6e3d3\",3);line(431,425,459,425,\"#d6e3d3\",3);\n line(432,405,416,427,\"#d79775\",5);line(456,405,461,425,\"#d79775\",5);\n poly([[431,447],[442,447],[441,482],[431,482]],\"#e2ac55\");poly([[448,447],[458,447],[463,482],[452,482]],\"#e2ac55\");\n for(let yy=454;yy<480;yy+=9){line(431,yy,441,yy,\"#c84d42\",3);line(452,yy,462,yy,\"#c84d42\",3)}\n ellipse(435,484,10,4,\"#70443a\");ellipse(458,484,10,4,\"#70443a\");\n line(409,397,420,415,\"#b9795f\",5);\n\n // clock\n ellipse(270,48,20,20,\"#f4e5cb\",\"#6b493b\");\n for(let i=0;i<12;i++){const a=i*Math.PI/6;line(270+Math.cos(a)*15,48+Math.sin(a)*15,270+Math.cos(a)*17,48+Math.sin(a)*17,\"#6b493b\",1)}\n // 6:20 hands\n line(270,48,277,40,\"#473530\",2);line(270,48,260,48,\"#473530\",2);ellipse(270,48,2,2,\"#473530\");\n txt(\"6:20\",270,75,\"bold 9px sans-serif\",\"#674438\",\"center\");\n\n // foreground warm vignette\n const vg=x.createRadialGradient(256,260,180,256,260,410);\n vg.addColorStop(.72,\"rgba(80,35,20,0)\");vg.addColorStop(1,\"rgba(46,23,20,.22)\");\n rect(0,0,512,512,vg);\n}"}], "metadata": {"id": "val-v1-broad-v2-long_text-validation-001", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 6438, "code_sha256": "87a438ed0bb04fa308894290a0ab243ec01eb0b3ab5a52c1a5140c5ed101368d"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "Morning sun has just reached the front windows of a lively community bakery beside a small park. In the foreground, a baker wearing a mustard apron pipes white icing onto a spiral bun, with five finished buns lined on a blue ceramic plate. A cashier hands change to a gardener carrying pruning shears in a closed leather holster. Nearby, a teenager holds a skateboard under one arm and studies baskets of multigrain bread. A toddler sits securely in a wooden high chair beside a table with jam and toast. The rear wall shows subway tiles, a floury mixing station, hanging utensils, and a wide oven. Outside, dew shines on benches, budding trees, and an empty playground."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;overflow:hidden;position:relative;background:#f6d8a2;\";\n const svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 512 512\");\n svg.setAttribute(\"width\", \"512\");\n svg.setAttribute(\"height\", \"512\");\n svg.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n ${[104,139,174,209,244].map((x,i)=>``).join(\"\")}\n \n\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n `;\n stage.appendChild(svg);\n}"}], "metadata": {"id": "val-v1-broad-v2-long_text-validation-002", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 5922, "code_sha256": "3d65ad376ed8effbd897d0ebf0dc61f1840e2a6262fabfc1c0bd3c634be2659a"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "Before the morning rush, a modest community bakery is already active under soft amber ceiling lights. In the foreground, a baker in a forest-green shirt uses long tongs to place sesame buns into a wicker display basket. An assistant behind him glazes a row of eight raspberry pastries on a stainless workbench. At the register, a crossing guard in a bright vest holds a cloth shopping bag, while a man with a folded stroller chooses a baguette. A seated woman reads a local paper beside a steaming teapot. The front windows reveal lavender dawn clouds, a school gate, and bicycles chained to a railing. Shelves of flour jars, ceramic hens, and neatly stacked trays fill the background."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;overflow:hidden;position:relative;background:#50352d;\";\n\n const svg = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n SCHOOL\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n FLOURRYESALT\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n MORNING RASPBERRY DANISHES\n \n ${[0,1,2,3,4,5,6,7].map(i => {\n let x=194+i*31;\n return `\n \n \n `;\n }).join(\"\")}\n \n \n\n \n \n \n \n \n \n \n \n \n \n LOCAL NEWS\n \n \n \n \n \n\n \n \n \n \n \n $ 8.50\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n ${[[39,440],[65,432],[92,435],[113,444],[52,454],[81,452]].map(([x,y])=>`\n \n \n \n `).join(\"\")}\n \n\n \n \n \n \n `;\n stage.innerHTML = svg;\n}"}], "metadata": {"id": "val-v1-broad-v2-long_text-validation-003", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 6177, "code_sha256": "eb4fd226e8ec63d9f018d3c7373d1047f6fb0f11302d6b7c7c6c579e48ed8451"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "Pale sunrise light fills an airy community bakery with whitewashed walls and a high pressed-tin ceiling. At center, a baker in a sage-green apron shapes small rolls on a butcher-block island, while an assistant pours oats over loaves near the oven. Four neighbors gather along the front counter: a woman holding a bicycle helmet, a bearded man with a market basket, and two children wearing bright backpacks. A glass case contains plum galettes, chocolate twists, and powdered cakes arranged on separate shelves. Potted herbs line the windowsill above a radiator. Beyond the window, a crossing guard stands near a quiet intersection, and long shadows from lampposts stretch across the golden pavement."}, {"role": "assistant", "content": "async function render(stage) {\n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = 1024;\n canvas.style.width = canvas.style.height = \"512px\";\n stage.appendChild(canvas);\n const c = canvas.getContext(\"2d\");\n c.scale(2, 2);\n\n const W = 512, H = 512;\n const rect = (x,y,w,h,fill,stroke) => {\n c.fillStyle = fill; c.fillRect(x,y,w,h);\n if(stroke){ c.strokeStyle=stroke; c.strokeRect(x,y,w,h); }\n };\n const line = (x1,y1,x2,y2,color,w=1) => {\n c.beginPath(); c.moveTo(x1,y1); c.lineTo(x2,y2);\n c.strokeStyle=color; c.lineWidth=w; c.stroke();\n };\n const ellipse = (x,y,rx,ry,fill,stroke) => {\n c.beginPath(); c.ellipse(x,y,rx,ry,0,0,Math.PI*2);\n c.fillStyle=fill; c.fill();\n if(stroke){c.strokeStyle=stroke;c.stroke();}\n };\n const poly = (pts, fill, stroke) => {\n c.beginPath(); c.moveTo(...pts[0]);\n pts.slice(1).forEach(p=>c.lineTo(...p)); c.closePath();\n c.fillStyle=fill; c.fill();\n if(stroke){c.strokeStyle=stroke;c.stroke();}\n };\n const grad = (x1,y1,x2,y2,stops) => {\n const g=c.createLinearGradient(x1,y1,x2,y2);\n stops.forEach(s=>g.addColorStop(s[0],s[1])); return g;\n };\n\n // sunlit exterior behind broad windows\n rect(0,0,W,H,\"#f4f0e6\");\n rect(300,69,190,194,grad(300,69,490,263,[[0,\"#fae6ae\"],[.7,\"#f4c56f\"],[1,\"#d99855\"]]));\n rect(307,146,175,118,\"#dfae62\");\n rect(307,157,175,8,\"#c79756\");\n rect(307,214,175,8,\"#d39b52\");\n line(374,70,374,263,\"#fff4cb\",5);\n line(435,70,435,263,\"#fff4cb\",5);\n line(307,116,483,116,\"#fff4cb\",5);\n // exterior streets, shadows, buildings\n rect(307,165,175,49,\"#f2cf83\");\n rect(307,213,175,51,\"#d9ad66\");\n poly([[307,219],[484,185],[484,199],[307,248]],\"rgba(118,88,63,.28)\");\n poly([[335,264],[355,264],[424,197],[411,195]],\"rgba(97,76,65,.32)\");\n poly([[307,254],[307,264],[378,264],[423,215],[410,214]],\"rgba(105,77,55,.24)\");\n // distant crossing guard\n ellipse(449,174,5,6,\"#8b5543\");\n poly([[444,181],[454,181],[458,205],[442,205]],\"#e45630\");\n rect(442,185,16,5,\"#f5df91\");\n line(446,205,443,217,\"#57483e\",2);\n line(454,205,458,217,\"#57483e\",2);\n line(443,188,436,197,\"#6d4d3d\",2);\n line(456,188,463,196,\"#6d4d3d\",2);\n // window glow\n rect(297,61,200,207,\"rgba(255,255,241,.13)\");\n\n // ceiling\n rect(0,0,512,72,grad(0,0,0,72,[[0,\"#dedad0\"],[1,\"#faf7ee\"]]));\n for(let y=6;y<70;y+=15){\n for(let x=((y/15)%2?8:0);x<512;x+=19){\n c.strokeStyle=\"#c8c5bd\"; c.lineWidth=.55;\n c.beginPath(); c.arc(x+9,y+7,7,0,Math.PI*2); c.stroke();\n c.beginPath(); c.arc(x+9,y+7,3,0,Math.PI*2); c.stroke();\n }\n }\n line(0,72,512,72,\"#c6c1b4\",2);\n // wall\n rect(0,72,300,239,\"#f7f4eb\");\n rect(0,72,300,8,\"#ece8dc\");\n // wall plank imperfections\n for(let y=105;y<305;y+=40) line(0,y,300,y,\"rgba(193,184,169,.22)\");\n // hanging lamps\n line(132,0,132,99,\"#7d7468\",1.5); ellipse(132,104,22,6,\"#b28c59\"); ellipse(132,101,17,5,\"#fff0b4\");\n line(259,0,259,105,\"#7d7468\",1.5); ellipse(259,110,19,6,\"#b28c59\"); ellipse(259,107,14,5,\"#fff0b4\");\n\n // oven rear\n rect(19,112,116,137,\"#dad5c9\",\"#c4bbae\");\n rect(26,125,102,82,\"#827467\");\n rect(31,131,92,69,\"#34312d\");\n ellipse(77,185,35,13,\"#b7783e\");\n rect(24,211,107,8,\"#947b63\");\n ellipse(78,159,22,5,\"#f4b66d\");\n // oven bricks\n for(let y=128;y<205;y+=14) for(let x=30+(y%28?0:9);x<123;x+=22) line(x,y,x+15,y,\"#aa9d8d\",1);\n\n // radiator and sill\n rect(300,263,196,10,\"#d5d0c8\");\n rect(321,274,135,53,\"#dedbd2\");\n for(let x=325;x<455;x+=12){ rect(x,278,7,42,\"#c6c4be\"); line(x,287,x+7,287,\"#eceae3\"); }\n rect(299,252,199,12,\"#d1c6b1\");\n // herbs pots\n for(let x=312;x<489;x+=36){\n poly([[x,251],[x+22,251],[x+19,263],[x+3,263]],\"#aa7652\");\n for(let k=0;k<6;k++){\n let px=x+4+Math.random()*14, py=253-Math.random()*18;\n line(x+11,253,px,py,\"#537250\",1);\n ellipse(px,py,2.5,4,\"#718e58\");\n }\n }\n\n // floor\n rect(0,310,512,202,grad(0,310,0,512,[[0,\"#c99968\"],[1,\"#9e6c48\"]]));\n for(let y=329;y<512;y+=31) line(0,y,512,y,\"rgba(92,58,37,.32)\",1);\n for(let x=-50;x<550;x+=75) line(x,310,x+40,512,\"rgba(99,64,42,.18)\",1);\n poly([[0,355],[197,310],[314,310],[127,512],[0,512]],\"rgba(71,46,31,.13)\");\n\n // back preparation block\n rect(147,214,140,78,\"#9c633e\");\n rect(140,204,155,18,\"#d2a36d\",\"#805034\");\n for(let x=148;x<289;x+=20) line(x,207,x+7,220,\"rgba(99,54,31,.5)\");\n // trays and dough\n rect(221,225,57,18,\"#b1aca0\");\n for(let x=228;x<274;x+=14) ellipse(x,233,6,4,\"#e8c28d\");\n // main baker legs\n poly([[187,278],[208,278],[212,330],[194,330]],\"#4c5550\");\n poly([[213,277],[232,276],[242,330],[224,330]],\"#424b48\");\n ellipse(194,330,13,4,\"#453c36\"); ellipse(239,330,13,4,\"#453c36\");\n // baker torso apron\n ellipse(210,172,17,20,\"#c88966\");\n poly([[193,188],[225,188],[235,265],[184,265]],\"#dce0cf\");\n poly([[195,190],[223,190],[229,264],[188,264]],\"#839b78\");\n line(210,194,210,260,\"#64795f\",1);\n line(194,210,178,241,\"#c88966\",6);\n line(224,211,243,234,\"#c88966\",6);\n ellipse(176,243,7,5,\"#c88966\"); ellipse(245,236,7,5,\"#c88966\");\n // baker hair\n ellipse(210,166,18,17,\"#553e32\");\n ellipse(210,172,14,16,\"#c98b6a\");\n poly([[196,166],[198,152],[219,150],[226,163],[216,159],[207,162]],\"#594236\");\n ellipse(204,173,1.2,1.5,\"#44352e\"); ellipse(216,173,1.2,1.5,\"#44352e\");\n line(207,181,215,181,\"#a96058\",1);\n // dough being shaped\n ellipse(173,246,15,7,\"#edce99\"); ellipse(242,239,12,6,\"#edce99\");\n\n // assistant near oven\n ellipse(105,151,13,15,\"#a86f50\");\n poly([[91,166],[117,166],[124,218],[87,218]],\"#e9d6ab\");\n poly([[94,169],[115,169],[121,221],[89,221]],\"#aa7c55\");\n poly([[99,150],[100,137],[116,139],[120,151],[111,146]],\"#342c29\");\n line(94,180,78,195,\"#a86f50\",5); line(116,180,130,193,\"#a86f50\",5);\n poly([[71,190],[85,192],[82,202],[68,199]],\"#d8d1c5\");\n for(let i=0;i<13;i++) ellipse(70+Math.random()*16,203+Math.random()*13,1.3,1,\"#dec38c\");\n\n // foreground glass case\n rect(14,289,305,126,\"#8d654a\");\n rect(20,296,293,108,\"rgba(211,237,237,.35)\",\"#6d6259\");\n rect(25,301,283,45,\"rgba(246,252,247,.22)\");\n rect(25,351,283,48,\"rgba(246,252,247,.16)\");\n line(20,347,313,347,\"#836f61\",3);\n line(20,403,313,403,\"#644939\",5);\n // shelves pastries\n const galette=(x,y)=>{\n ellipse(x,y,18,7,\"#ba6a55\"); ellipse(x,y-2,14,5,\"#653b4c\");\n for(let a=0;a<6;a++) line(x,y-1,x+Math.cos(a)*13,y-2+Math.sin(a)*4,\"#dfae79\",1);\n };\n galette(54,328);galette(100,327);galette(148,328);\n const twist=(x,y)=>{ for(let i=0;i<3;i++) ellipse(x+i*7,y+(i%2)*2,7,4,\"#6b3926\"); line(x-2,y-2,x+19,y+4,\"#e6a462\",1.5); };\n twist(196,328);twist(244,329);twist(272,328);\n for(let x=52;x<274;x+=43){ ellipse(x,376,14,10,\"#f3ead2\"); ellipse(x,373,11,7,\"#fffaf0\"); for(let i=0;i<8;i++) ellipse(x-8+Math.random()*16,369+Math.random()*8,.8,.8,\"#d7cdbd\");}\n // case highlights\n line(29,303,29,396,\"rgba(255,255,255,.7)\",1); line(30,301,298,301,\"rgba(255,255,255,.65)\",1);\n rect(8,411,318,13,\"#704a37\");\n rect(22,423,15,65,\"#674331\"); rect(292,423,15,65,\"#674331\");\n\n // customers in front, back-to-front\n // woman helmet left\n ellipse(348,309,15,17,\"#b97859\");\n poly([[330,326],[365,326],[374,409],[324,409]],\"#d1a168\");\n poly([[334,330],[350,330],[354,406],[338,406]],\"#efded0\");\n poly([[334,305],[340,294],[358,294],[365,308],[354,300]],\"#5c4034\");\n line(333,340,315,370,\"#b97859\",6);\n // bicycle helmet\n ellipse(312,373,17,12,\"#466b7b\"); line(296,372,327,372,\"#d7e3df\",2); line(300,368,305,379,\"#253e4a\",1);\n // bearded man\n ellipse(410,300,16,18,\"#b98362\");\n poly([[390,320],[428,320],[440,414],[383,414]],\"#587782\");\n poly([[398,318],[422,318],[426,410],[396,410]],\"#31525b\");\n ellipse(410,308,14,13,\"#49382f\");\n ellipse(410,297,15,15,\"#bf8060\");\n poly([[395,294],[398,282],[419,281],[427,295],[417,290]],\"#483630\");\n ellipse(405,300,1.5,1,\"#392a26\"); ellipse(417,300,1.5,1,\"#392a26\");\n // basket\n ellipse(448,380,22,12,\"#a77943\"); rect(426,370,44,12,\"#bd914d\");\n c.beginPath();c.arc(448,373,16,Math.PI,0);c.strokeStyle=\"#8d6238\";c.lineWidth=3;c.stroke();\n for(let x=431;x<468;x+=8) line(x,371,x+3,381,\"#745031\",1);\n // children\n const child=(x, shirt, pack, hair)=>{\n ellipse(x,333,11,13,\"#bd8060\");\n ellipse(x,324,12,10,hair);\n poly([[x-15,345],[x+15,345],[x+19,407],[x-19,407]],shirt);\n rect(x-20,350,8,43,pack);\n line(x-13,351,x-4,383,\"#e3c9a4\",2);\n line(x-12,407,x-13,431,\"#3d4544\",5); line(x+10,407,x+12,431,\"#3d4544\",5);\n ellipse(x-14,433,8,3,\"#403731\"); ellipse(x+14,433,8,3,\"#403731\");\n };\n child(278,\"#f0c051\",\"#e4503f\",\"#533c2f\");\n child(303,\"#6c9bb0\",\"#4b86d0\",\"#8d6044\");\n\n // foreground sunlight\n c.fillStyle=\"rgba(255,232,169,.15)\";\n c.beginPath();c.moveTo(300,72);c.lineTo(470,72);c.lineTo(512,442);c.lineTo(375,412);c.closePath();c.fill();\n\n // vignette\n const vg=c.createRadialGradient(256,250,180,256,250,410);\n vg.addColorStop(.7,\"rgba(70,44,27,0)\"); vg.addColorStop(1,\"rgba(66,43,28,.16)\");\n c.fillStyle=vg;c.fillRect(0,0,512,512);\n}"}], "metadata": {"id": "val-v1-broad-v2-long_text-validation-007", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 5588, "code_sha256": "3aebca1fa490e2787997e371b26cc8f4ebd7ec843201017826ee86d018f283c0"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "Cyanotype botanical study of two ginkgo branches crossing near the center, their fan-shaped leaves rendered as luminous white forms on ultramarine."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;overflow:hidden;position:relative;background:#06348d\";\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = 1024;\n canvas.style.cssText = \"width:512px;height:512px;display:block\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(2, 2);\n\n let seed = 389127;\n const rand = () => {\n seed = (seed * 1664525 + 1013904223) >>> 0;\n return seed / 4294967296;\n };\n const rr = (a, b) => a + (b - a) * rand();\n\n const W = 512, H = 512;\n\n // Cyanotype paper ground\n const bg = ctx.createLinearGradient(0, 0, 512, 512);\n bg.addColorStop(0, \"#032866\");\n bg.addColorStop(.28, \"#06429a\");\n bg.addColorStop(.62, \"#07358a\");\n bg.addColorStop(1, \"#021f5a\");\n ctx.fillStyle = bg;\n ctx.fillRect(0, 0, W, H);\n\n const image = ctx.getImageData(0, 0, 1024, 1024);\n const d = image.data;\n for (let y = 0; y < 1024; y++) {\n for (let x = 0; x < 1024; x++) {\n const i = (y * 1024 + x) * 4;\n const cloud =\n 7 * Math.sin(x * .012 + y * .006) +\n 5 * Math.sin(x * .027 - y * .014) +\n 4 * Math.sin(x * .004 + y * .022);\n const grain = (rand() - .5) * 11 + cloud;\n d[i] = Math.max(0, d[i] + grain * .18);\n d[i + 1] = Math.max(0, d[i + 1] + grain * .46);\n d[i + 2] = Math.max(0, d[i + 2] + grain);\n }\n }\n ctx.putImageData(image, 0, 0);\n\n // faint wash and paper blooms\n ctx.globalCompositeOperation = \"screen\";\n for (let i = 0; i < 18; i++) {\n const x = rr(-40, 550), y = rr(-30, 540), r = rr(35, 120);\n const g = ctx.createRadialGradient(x, y, 2, x, y, r);\n g.addColorStop(0, `rgba(54,132,224,${rr(.025, .07)})`);\n g.addColorStop(1, \"rgba(15,74,164,0)\");\n ctx.fillStyle = g;\n ctx.beginPath();\n ctx.arc(x, y, r, 0, Math.PI * 2);\n ctx.fill();\n }\n ctx.globalCompositeOperation = \"source-over\";\n\n function line(points, width, color, alpha = 1) {\n ctx.save();\n ctx.globalAlpha = alpha;\n ctx.strokeStyle = color;\n ctx.lineWidth = width;\n ctx.lineCap = \"round\";\n ctx.lineJoin = \"round\";\n ctx.beginPath();\n ctx.moveTo(points[0][0], points[0][1]);\n for (let i = 1; i < points.length - 1; i++) {\n const p = points[i], q = points[i + 1];\n ctx.quadraticCurveTo(p[0], p[1], (p[0] + q[0]) / 2, (p[1] + q[1]) / 2);\n }\n const z = points[points.length - 1];\n ctx.lineTo(z[0], z[1]);\n ctx.stroke();\n ctx.restore();\n }\n\n function botanicalBranch(points, w) {\n line(points, w + 3, \"#002363\", .34);\n line(points, w, \"#e4f5f1\", .76);\n line(points, Math.max(1, w * .27), \"#ffffff\", .62);\n\n // subtle broken branch detail\n for (let i = 0; i < points.length - 1; i++) {\n const a = points[i], b = points[i + 1];\n for (let t = .15; t < .95; t += .2) {\n const x = a[0] + (b[0] - a[0]) * t;\n const y = a[1] + (b[1] - a[1]) * t;\n ctx.fillStyle = \"rgba(16,71,143,.32)\";\n ctx.beginPath();\n ctx.ellipse(x, y, w * .16, w * .42, Math.atan2(b[1]-a[1], b[0]-a[0]), 0, Math.PI * 2);\n ctx.fill();\n }\n }\n }\n\n const b1 = [[-18, 475], [104, 384], [229, 291], [340, 184], [535, 43]];\n const b2 = [[-18, 57], [103, 126], [226, 238], [345, 316], [530, 443]];\n botanicalBranch(b1, 5.2);\n botanicalBranch(b2, 4.8);\n\n function petiole(from, to) {\n line([from, to], 3.1, \"#001d55\", .35);\n line([from, to], 1.75, \"#e7f8f5\", .9);\n line([from, to], .55, \"#fff\", .65);\n }\n\n function leaf(baseX, baseY, axis, radius, spread, tone = 1) {\n const path = new Path2D();\n path.moveTo(baseX, baseY);\n\n const n = 46;\n for (let i = 0; i <= n; i++) {\n const u = i / n;\n const a = axis - spread + 2 * spread * u;\n const lobe = Math.sin(u * Math.PI * 6.2) * 2.0 + Math.sin(u * Math.PI * 11.5) * 1.15;\n const centralNotch = Math.exp(-Math.pow((u - .5) / .115, 2)) * radius * .18;\n const shoulder = Math.pow(Math.sin(Math.PI * u), .36);\n const r = radius * (.90 + .10 * shoulder) + lobe - centralNotch;\n const x = baseX + Math.cos(a) * r;\n const y = baseY + Math.sin(a) * r;\n path.lineTo(x, y);\n }\n path.closePath();\n\n ctx.save();\n ctx.shadowColor = \"rgba(150,226,255,.4)\";\n ctx.shadowBlur = 8;\n ctx.fillStyle = `rgba(238,255,249,${.88 * tone})`;\n ctx.fill(path);\n ctx.restore();\n\n ctx.save();\n ctx.clip(path);\n\n const lg = ctx.createLinearGradient(baseX, baseY, baseX + Math.cos(axis) * radius, baseY + Math.sin(axis) * radius);\n lg.addColorStop(0, \"rgba(173,225,234,.5)\");\n lg.addColorStop(.5, \"rgba(255,255,255,.42)\");\n lg.addColorStop(1, \"rgba(242,255,253,.75)\");\n ctx.fillStyle = lg;\n ctx.fillRect(baseX - radius - 8, baseY - radius - 8, radius * 2 + 16, radius * 2 + 16);\n\n // cyanotype mottling inside leaf\n for (let i = 0; i < 26; i++) {\n const x = baseX + Math.cos(rr(axis - spread, axis + spread)) * rr(radius*.15, radius*.95);\n const y = baseY + Math.sin(rr(axis - spread, axis + spread)) * rr(radius*.15, radius*.95);\n ctx.fillStyle = `rgba(27,100,172,${rr(.025,.09)})`;\n ctx.beginPath();\n ctx.arc(x, y, rr(1, 5), 0, Math.PI * 2);\n ctx.fill();\n }\n\n // central vein\n line([[baseX, baseY], [baseX + Math.cos(axis) * radius * .92, baseY + Math.sin(axis) * radius * .92]], 1.05, \"#377caf\", .57);\n\n // radiating veins\n for (let i = 0; i < 19; i++) {\n const u = i / 18;\n const va = axis - spread * .92 + u * spread * 1.84;\n const start = rr(.10, .23) * radius;\n const end = radius * (.77 + .17 * Math.sin(Math.PI * u));\n const sx = baseX + Math.cos(axis) * start;\n const sy = baseY + Math.sin(axis) * start;\n const ex = baseX + Math.cos(va) * end;\n const ey = baseY + Math.sin(va) * end;\n line([[sx, sy], [(sx + ex) * .5 + Math.cos(va + .55) * 2, (sy + ey) * .5 + Math.sin(va + .55) * 2], [ex, ey]], rr(.33,.68), \"#2870a6\", rr(.30,.58));\n }\n ctx.restore();\n\n ctx.strokeStyle = \"rgba(246,255,253,.62)\";\n ctx.lineWidth = .7;\n ctx.stroke(path);\n }\n\n // Branch one foliage\n const leaves = [\n [[91,394],[62,343],-2.18,40,.92],\n [[125,366],[107,306],-1.42,46,.94],\n [[155,338],[177,286],-0.63,43,.88],\n [[195,309],[170,256],-2.05,49,.91],\n [[231,283],[261,225],-0.62,52,.98],\n [[268,251],[249,190],-1.93,45,.91],\n [[306,217],[350,167],-0.62,51,.93],\n [[342,184],[331,122],-1.72,47,.94],\n [[385,151],[435,111],-0.44,47,.91],\n [[427,120],[423,64],-1.67,42,.85],\n\n // Branch two foliage\n [[87,116],[58,72],-2.12,42,.93],\n [[124,141],[123,79],-1.55,48,.94],\n [[159,167],[205,129],-0.47,45,.90],\n [[197,207],[179,148],-1.84,50,.96],\n [[232,239],[279,200],-0.52,54,.98],\n [[271,266],[257,211],-1.85,43,.90],\n [[312,294],[357,253],-0.51,49,.93],\n [[353,322],[342,264],-1.74,46,.93],\n [[397,352],[445,319],-0.42,46,.91],\n [[436,382],[427,327],-1.73,43,.87],\n [[474,410],[509,373],-0.44,41,.87]\n ];\n\n for (const l of leaves) petiole(l[0], l[1]);\n for (const l of leaves) leaf(l[1][0], l[1][1], l[2], l[3], l[4], l[5]);\n\n // exposed-paper speckle\n ctx.fillStyle = \"rgba(170,222,252,.11)\";\n for (let i = 0; i < 1500; i++) {\n const x = rand() * W, y = rand() * H;\n const s = rand() < .94 ? .35 : rr(.7, 1.3);\n ctx.fillRect(x, y, s, s);\n }\n\n // softly vignette\n const vig = ctx.createRadialGradient(255, 248, 215, 256, 256, 410);\n vig.addColorStop(.58, \"rgba(0,0,0,0)\");\n vig.addColorStop(1, \"rgba(0,13,54,.34)\");\n ctx.fillStyle = vig;\n ctx.fillRect(0, 0, W, H);\n}"}], "metadata": {"id": "val-v1-broad-v2-style-validation-001", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 3619, "code_sha256": "cf82529a5e6d10d449eb0ad41de557ce4f99a4d4e8eb246ea3a9e177c6b9de49"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "Cyanotype botanical study depicting a pine branch with dense needle clusters and two open cones, framed by an irregular white contact-print border."}, {"role": "assistant", "content": "async function render(stage) {\n const canvas = document.createElement(\"canvas\");\n const S = 512, DPR = 2;\n canvas.width = S * DPR;\n canvas.height = S * DPR;\n canvas.style.width = \"512px\";\n canvas.style.height = \"512px\";\n canvas.style.display = \"block\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(DPR, DPR);\n\n let seed = 928374;\n const rand = () => {\n seed = (seed * 1664525 + 1013904223) >>> 0;\n return seed / 4294967296;\n };\n const range = (a, b) => a + (b - a) * rand();\n const jitter = n => range(-n, n);\n\n ctx.fillStyle = \"#0b4f74\";\n ctx.fillRect(0, 0, S, S);\n\n const wash = ctx.createRadialGradient(280, 210, 20, 260, 260, 410);\n wash.addColorStop(0, \"rgba(47,135,166,.42)\");\n wash.addColorStop(.46, \"rgba(19,93,132,.17)\");\n wash.addColorStop(1, \"rgba(2,40,65,.27)\");\n ctx.fillStyle = wash;\n ctx.fillRect(0, 0, S, S);\n\n for (let i = 0; i < 26000; i++) {\n const x = rand() * S, y = rand() * S;\n const light = rand() > .52;\n ctx.fillStyle = light\n ? `rgba(168,224,230,${range(.008, .035)})`\n : `rgba(0,18,42,${range(.008, .035)})`;\n ctx.fillRect(x, y, range(.3, 1.8), range(.3, 1.8));\n }\n\n for (let i = 0; i < 24; i++) {\n const x = range(25, 488), y = range(25, 486);\n const r = range(18, 82);\n const g = ctx.createRadialGradient(x, y, 0, x, y, r);\n g.addColorStop(0, `rgba(130,202,215,${range(.015, .045)})`);\n g.addColorStop(1, \"rgba(130,202,215,0)\");\n ctx.fillStyle = g;\n ctx.fillRect(x - r, y - r, r * 2, r * 2);\n }\n\n function strokePath(points, color, width, alpha = 1) {\n ctx.save();\n ctx.globalAlpha = alpha;\n ctx.strokeStyle = color;\n ctx.lineWidth = width;\n ctx.lineCap = \"round\";\n ctx.lineJoin = \"round\";\n ctx.beginPath();\n ctx.moveTo(points[0][0], points[0][1]);\n for (let i = 1; i < points.length - 1; i++) {\n const a = points[i], b = points[i + 1];\n ctx.quadraticCurveTo(a[0], a[1], (a[0] + b[0]) / 2, (a[1] + b[1]) / 2);\n }\n const last = points[points.length - 1];\n ctx.lineTo(last[0], last[1]);\n ctx.stroke();\n ctx.restore();\n }\n\n const spine = [\n [57, 426], [102, 390], [147, 356], [197, 320],\n [247, 281], [299, 238], [348, 195], [400, 146], [461, 93]\n ];\n\n ctx.save();\n ctx.filter = \"blur(5px)\";\n strokePath(spine, \"#b7e1dd\", 10, .11);\n ctx.restore();\n\n strokePath(spine, \"#85c3cb\", 7.2, .70);\n strokePath(spine, \"#d4e9df\", 3.1, .86);\n strokePath(spine, \"#f0f2e2\", .8, .78);\n\n const sideTwigs = [\n [[128, 371], [113, 320], [106, 284]],\n [[172, 337], [159, 282], [154, 245]],\n [[219, 304], [214, 249], [218, 208]],\n [[267, 265], [264, 210], [276, 170]],\n [[318, 221], [318, 172], [334, 132]],\n [[362, 182], [369, 133], [387, 106]]\n ];\n sideTwigs.forEach((p, i) => {\n strokePath(p, \"#c9e5df\", 2.4 - i * .08, .78);\n strokePath(p, \"#f4f2dd\", .6, .65);\n });\n\n function drawNeedle(x, y, angle, length, width, opacity) {\n const ex = x + Math.cos(angle) * length;\n const ey = y + Math.sin(angle) * length;\n const mx = x + Math.cos(angle + jitter(.18)) * length * .47;\n const my = y + Math.sin(angle + jitter(.18)) * length * .47;\n\n ctx.save();\n ctx.globalAlpha = opacity;\n ctx.strokeStyle = rand() > .28 ? \"#e4efe6\" : \"#9ed2d2\";\n ctx.lineCap = \"round\";\n ctx.lineWidth = width;\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.quadraticCurveTo(mx, my, ex, ey);\n ctx.stroke();\n ctx.restore();\n }\n\n function cluster(x, y, baseAngle, size, density) {\n for (let i = 0; i < density; i++) {\n const side = i % 2 === 0 ? 1 : -1;\n const a = baseAngle + side * range(.48, 1.48) + jitter(.18);\n const ox = Math.cos(baseAngle + Math.PI) * range(0, 10) + jitter(2);\n const oy = Math.sin(baseAngle + Math.PI) * range(0, 10) + jitter(2);\n drawNeedle(\n x + ox, y + oy,\n a,\n range(size * .56, size * 1.08),\n range(.45, 1.35),\n range(.36, .88)\n );\n }\n for (let i = 0; i < 8; i++) {\n const a = baseAngle + (i % 2 ? 1 : -1) * range(.8, 1.45);\n drawNeedle(x + jitter(3), y + jitter(3), a, size * range(.46, .72), .45, .36);\n }\n }\n\n const mainAngle = -0.66;\n for (let i = 0; i < 32; i++) {\n const t = i / 31;\n const px = 66 + t * 388;\n const py = 418 - t * 319 + Math.sin(t * 8) * 7;\n cluster(px, py, mainAngle, range(37, 67), Math.floor(range(17, 28)));\n }\n\n sideTwigs.forEach((twig, k) => {\n for (let n = 0; n < 8; n++) {\n const t = n / 7;\n const a = twig[0], b = twig[twig.length - 1];\n const x = a[0] + (b[0] - a[0]) * t;\n const y = a[1] + (b[1] - a[1]) * t;\n cluster(x, y, -1.72 + k * .035, range(28, 48), Math.floor(range(11, 18)));\n }\n });\n\n function cone(cx, cy, angle, scale) {\n ctx.save();\n ctx.translate(cx, cy);\n ctx.rotate(angle);\n ctx.scale(scale, scale);\n\n ctx.save();\n ctx.filter = \"blur(6px)\";\n ctx.fillStyle = \"rgba(213,238,225,.16)\";\n ctx.beginPath();\n ctx.ellipse(3, 12, 30, 55, 0, 0, Math.PI * 2);\n ctx.fill();\n ctx.restore();\n\n ctx.beginPath();\n ctx.moveTo(0, -48);\n ctx.bezierCurveTo(25, -33, 34, -1, 27, 26);\n ctx.bezierCurveTo(21, 48, 6, 58, -7, 54);\n ctx.bezierCurveTo(-28, 46, -36, 18, -29, -8);\n ctx.bezierCurveTo(-23, -30, -10, -43, 0, -48);\n ctx.closePath();\n ctx.fillStyle = \"rgba(210,234,222,.76)\";\n ctx.fill();\n ctx.strokeStyle = \"rgba(247,246,227,.85)\";\n ctx.lineWidth = 1.2;\n ctx.stroke();\n\n for (let row = 0; row < 8; row++) {\n const y = -31 + row * 10;\n const half = 10 + Math.sin((row + 1) / 9 * Math.PI) * 22;\n const count = row < 2 ? 2 : row < 5 ? 3 : 4;\n for (let c = 0; c < count; c++) {\n const x = -half + (c + .5) * (half * 2 / count) + jitter(2);\n const w = range(9, 14);\n const h = range(11, 16);\n ctx.save();\n ctx.translate(x, y + jitter(1.5));\n ctx.rotate(jitter(.18));\n ctx.beginPath();\n ctx.moveTo(0, -h * .7);\n ctx.bezierCurveTo(w, -h * .35, w * .9, h * .35, 0, h);\n ctx.bezierCurveTo(-w * .9, h * .35, -w, -h * .35, 0, -h * .7);\n ctx.closePath();\n ctx.fillStyle = row % 2\n ? \"rgba(19,87,116,.56)\"\n : \"rgba(237,241,223,.85)\";\n ctx.fill();\n ctx.strokeStyle = \"rgba(235,245,229,.6)\";\n ctx.lineWidth = .65;\n ctx.stroke();\n ctx.restore();\n }\n }\n\n ctx.strokeStyle = \"rgba(11,69,97,.55)\";\n ctx.lineWidth = 1.1;\n for (let i = 0; i < 6; i++) {\n ctx.beginPath();\n ctx.moveTo(-18 + i * 7, -28);\n ctx.quadraticCurveTo(-24 + i * 8, 8, -12 + i * 4, 43);\n ctx.stroke();\n }\n ctx.restore();\n }\n\n cone(287, 253, .48, .87);\n cone(376, 163, .48, .78);\n\n strokePath([[272, 245], [255, 230], [241, 218]], \"#e3eee2\", 1.6, .82);\n strokePath([[362, 155], [344, 170], [329, 181]], \"#e3eee2\", 1.5, .82);\n\n for (let i = 0; i < 240; i++) {\n const x = range(25, 486), y = range(25, 486);\n if (rand() > .55) {\n ctx.fillStyle = `rgba(232,247,234,${range(.025, .11)})`;\n ctx.fillRect(x, y, range(.4, 1.3), range(.4, 1.3));\n }\n }\n\n ctx.save();\n ctx.fillStyle = \"#f6f4e8\";\n ctx.beginPath();\n ctx.rect(0, 0, S, S);\n ctx.moveTo(17, 20);\n for (let x = 17; x <= 495; x += 9) ctx.lineTo(x, 18 + jitter(2.2));\n for (let y = 18; y <= 494; y += 9) ctx.lineTo(494 + jitter(2.2), y);\n for (let x = 494; x >= 18; x -= 9) ctx.lineTo(x, 494 + jitter(2.2));\n for (let y = 494; y >= 18; y -= 9) ctx.lineTo(18 + jitter(2.2), y);\n ctx.closePath();\n ctx.fill(\"evenodd\");\n ctx.restore();\n\n ctx.strokeStyle = \"rgba(229,226,210,.75)\";\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.moveTo(17, 20);\n for (let x = 17; x <= 495; x += 13) ctx.lineTo(x, 18 + jitter(1.5));\n for (let y = 18; y <= 494; y += 13) ctx.lineTo(494 + jitter(1.5), y);\n for (let x = 494; x >= 18; x -= 13) ctx.lineTo(x, 494 + jitter(1.5));\n for (let y = 494; y >= 18; y -= 13) ctx.lineTo(18 + jitter(1.5), y);\n ctx.closePath();\n ctx.stroke();\n}"}], "metadata": {"id": "val-v1-broad-v2-style-validation-009", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 3788, "code_sha256": "422761e856a6e43df734a6a362a3f9d8b289e4f0418ff595b17cde97b3f79f86"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A freestanding wooden book-return bin in a quiet library hallway displays a centered cream placard with bold black text reading \"Book Drop\"."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;position:relative;overflow:hidden;background:#d8d0c3;\";\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = 1024;\n canvas.height = 1024;\n canvas.style.cssText = \"width:512px;height:512px;display:block;\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(2, 2);\n\n const W = 512, H = 512;\n\n function rr(x, y, w, h, r) {\n ctx.beginPath();\n ctx.moveTo(x + r, y);\n ctx.arcTo(x + w, y, x + w, y + h, r);\n ctx.arcTo(x + w, y + h, x, y + h, r);\n ctx.arcTo(x, y + h, x, y, r);\n ctx.arcTo(x, y, x + w, y, r);\n ctx.closePath();\n }\n\n function fillGrad(x1, y1, x2, y2, stops) {\n const g = ctx.createLinearGradient(x1, y1, x2, y2);\n stops.forEach(s => g.addColorStop(s[0], s[1]));\n ctx.fillStyle = g;\n return g;\n }\n\n function woodGrain(x, y, w, h, alpha) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(x, y, w, h);\n ctx.clip();\n for (let i = 0; i < 52; i++) {\n const yy = y + Math.random() * h;\n const depth = 0.5 + Math.random() * 1.8;\n ctx.strokeStyle = `rgba(62,30,12,${alpha * (0.22 + Math.random() * .48)})`;\n ctx.lineWidth = depth;\n ctx.beginPath();\n ctx.moveTo(x - 8, yy);\n const segments = 4 + Math.floor(Math.random() * 4);\n for (let j = 1; j <= segments; j++) {\n const px = x + (w + 16) * j / segments;\n ctx.lineTo(px, yy + Math.sin(j * 1.7 + i) * (1 + Math.random() * 2));\n }\n ctx.stroke();\n }\n for (let i = 0; i < 18; i++) {\n const xx = x + Math.random() * w;\n ctx.strokeStyle = `rgba(255,214,144,${alpha * .18})`;\n ctx.lineWidth = .45;\n ctx.beginPath();\n ctx.moveTo(xx, y);\n ctx.lineTo(xx + Math.random() * 5 - 2.5, y + h);\n ctx.stroke();\n }\n ctx.restore();\n }\n\n // Back wall\n fillGrad(0, 0, 0, 322, [\n [0, \"#eee9e0\"], [0.58, \"#ddd6cb\"], [1, \"#cfc6ba\"]\n ]);\n ctx.fillRect(0, 0, W, 334);\n\n // Subtle far wall panels\n ctx.fillStyle = \"rgba(113,98,81,.12)\";\n ctx.fillRect(0, 270, W, 3);\n ctx.fillStyle = \"rgba(255,255,255,.46)\";\n ctx.fillRect(0, 274, W, 2);\n\n // Left doorway / hall depth\n ctx.fillStyle = \"#b6ab9c\";\n ctx.fillRect(0, 37, 80, 239);\n ctx.fillStyle = \"#8b8176\";\n ctx.fillRect(5, 42, 52, 229);\n fillGrad(9, 43, 54, 267, [[0, \"#55504a\"], [1, \"#81776a\"]]);\n ctx.fillRect(9, 43, 45, 228);\n ctx.fillStyle = \"rgba(236,225,202,.28)\";\n ctx.fillRect(55, 38, 8, 239);\n ctx.fillStyle = \"#e0d8ca\";\n ctx.fillRect(64, 0, 8, 277);\n ctx.fillStyle = \"#b9afa2\";\n ctx.fillRect(72, 0, 4, 277);\n\n // Right baseboard and wall feature\n ctx.fillStyle = \"#aaa093\";\n ctx.fillRect(416, 220, 96, 52);\n ctx.fillStyle = \"#d8d1c7\";\n ctx.fillRect(422, 226, 90, 43);\n ctx.strokeStyle = \"rgba(128,116,101,.35)\";\n ctx.strokeRect(422, 226, 90, 43);\n ctx.fillStyle = \"#aaa093\";\n ctx.fillRect(0, 293, W, 20);\n ctx.fillStyle = \"#eee9e1\";\n ctx.fillRect(0, 287, W, 7);\n ctx.fillStyle = \"rgba(100,85,69,.28)\";\n ctx.fillRect(0, 311, W, 3);\n\n // Floor\n fillGrad(0, 313, 0, H, [[0, \"#b8aa98\"], [1, \"#897a6b\"]]);\n ctx.fillRect(0, 313, W, 199);\n\n // Floorboards\n ctx.strokeStyle = \"rgba(92,74,57,.22)\";\n ctx.lineWidth = 1;\n for (let y = 338; y < 512; y += 34) {\n ctx.beginPath();\n ctx.moveTo(0, y);\n ctx.lineTo(512, y + 14);\n ctx.stroke();\n }\n for (let x = -110; x < 620; x += 105) {\n ctx.beginPath();\n ctx.moveTo(x, 313);\n ctx.lineTo(x + 45, 512);\n ctx.stroke();\n }\n\n // Ambient object shadow\n ctx.save();\n ctx.filter = \"blur(10px)\";\n const shadow = ctx.createRadialGradient(260, 455, 10, 260, 455, 155);\n shadow.addColorStop(0, \"rgba(38,27,18,.35)\");\n shadow.addColorStop(1, \"rgba(38,27,18,0)\");\n ctx.fillStyle = shadow;\n ctx.fillRect(90, 413, 350, 87);\n ctx.restore();\n\n // Bin body silhouette\n ctx.save();\n ctx.shadowColor = \"rgba(38,24,13,.35)\";\n ctx.shadowBlur = 8;\n ctx.shadowOffsetX = 3;\n ctx.shadowOffsetY = 7;\n rr(147, 142, 222, 310, 5);\n ctx.fillStyle = \"#60371e\";\n ctx.fill();\n ctx.restore();\n\n // Left side\n fillGrad(147, 143, 182, 450, [[0, \"#744728\"], [.5, \"#4d2916\"], [1, \"#321b10\"]]);\n ctx.fillRect(147, 148, 31, 298);\n woodGrain(148, 148, 30, 298, .55);\n\n // Main cabinet\n fillGrad(178, 143, 365, 450, [\n [0, \"#754424\"], [.12, \"#a66b39\"], [.48, \"#8c522c\"], [.83, \"#6a381e\"], [1, \"#412315\"]\n ]);\n ctx.fillRect(178, 143, 187, 303);\n woodGrain(178, 143, 187, 303, .46);\n\n // Right edge\n fillGrad(354, 145, 370, 450, [[0, \"#482414\"], [.45, \"#71401f\"], [1, \"#31190f\"]]);\n ctx.fillRect(354, 146, 13, 300);\n\n // Top cap\n ctx.save();\n ctx.shadowColor = \"rgba(40,24,13,.3)\";\n ctx.shadowBlur = 3;\n ctx.shadowOffsetY = 2;\n rr(140, 131, 235, 22, 4);\n fillGrad(140, 131, 140, 153, [[0, \"#b17a45\"], [.18, \"#7d4826\"], [.84, \"#5a301a\"], [1, \"#351d10\"]]);\n ctx.fill();\n ctx.restore();\n ctx.fillStyle = \"rgba(255,203,126,.22)\";\n ctx.fillRect(148, 135, 214, 2);\n woodGrain(144, 132, 227, 18, .38);\n\n // Upper mail-slot section\n rr(174, 158, 195, 98, 2);\n fillGrad(174, 158, 174, 256, [[0, \"#874f29\"], [.5, \"#6a371d\"], [1, \"#452313\"]]);\n ctx.fill();\n woodGrain(175, 158, 192, 96, .35);\n\n // Book return slot\n ctx.save();\n ctx.shadowColor = \"rgba(16,9,5,.9)\";\n ctx.shadowBlur = 6;\n rr(193, 184, 157, 35, 5);\n ctx.fillStyle = \"#25150d\";\n ctx.fill();\n ctx.restore();\n rr(196, 187, 151, 27, 4);\n fillGrad(196, 187, 196, 214, [[0, \"#100a07\"], [.55, \"#322015\"], [1, \"#120b08\"]]);\n ctx.fill();\n ctx.fillStyle = \"rgba(207,141,76,.28)\";\n ctx.fillRect(200, 187, 142, 2);\n ctx.fillStyle = \"rgba(0,0,0,.76)\";\n ctx.fillRect(205, 198, 133, 10);\n\n // Divider under slot\n ctx.fillStyle = \"#3d1f11\";\n ctx.fillRect(174, 252, 193, 7);\n ctx.fillStyle = \"rgba(222,145,72,.35)\";\n ctx.fillRect(178, 252, 183, 1);\n\n // Main inset front\n rr(187, 268, 163, 147, 2);\n fillGrad(187, 268, 350, 415, [[0, \"#8f572f\"], [.55, \"#72401f\"], [1, \"#4b2715\"]]);\n ctx.fill();\n woodGrain(188, 269, 161, 145, .28);\n ctx.strokeStyle = \"rgba(48,23,12,.78)\";\n ctx.lineWidth = 3;\n ctx.stroke();\n\n // Placard shadow + mounting\n ctx.save();\n ctx.shadowColor = \"rgba(28,15,8,.46)\";\n ctx.shadowBlur = 5;\n ctx.shadowOffsetY = 3;\n rr(201, 292, 136, 70, 2);\n ctx.fillStyle = \"#d9c99d\";\n ctx.fill();\n ctx.restore();\n\n fillGrad(201, 292, 201, 362, [[0, \"#fff9df\"], [.52, \"#eee4c4\"], [1, \"#cfc096\"]]);\n rr(203, 294, 132, 66, 1);\n ctx.fill();\n ctx.strokeStyle = \"#9d8c68\";\n ctx.lineWidth = 1;\n ctx.stroke();\n\n // placard tiny nail heads\n [[209,300],[329,300],[209,354],[329,354]].forEach(([x,y]) => {\n ctx.beginPath();\n ctx.arc(x,y,1.4,0,Math.PI*2);\n ctx.fillStyle = \"#82765b\";\n ctx.fill();\n ctx.fillStyle = \"rgba(255,255,255,.6)\";\n ctx.beginPath();\n ctx.arc(x-.35,y-.35,.45,0,Math.PI*2);\n ctx.fill();\n });\n\n ctx.fillStyle = \"#171512\";\n ctx.font = \"bold 24px Georgia, 'Times New Roman', serif\";\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.fillText(\"Book Drop\", 269, 327);\n\n // Bottom rail\n fillGrad(145, 417, 145, 453, [[0, \"#87502a\"], [.35, \"#5b2f19\"], [1, \"#331b10\"]]);\n ctx.fillRect(145, 417, 224, 32);\n woodGrain(147, 419, 220, 28, .45);\n ctx.fillStyle = \"rgba(222,146,78,.21)\";\n ctx.fillRect(151, 420, 210, 2);\n\n // Feet\n ctx.fillStyle = \"#321a0f\";\n rr(153, 445, 33, 20, 3); ctx.fill();\n rr(329, 445, 33, 20, 3); ctx.fill();\n ctx.fillStyle = \"#5c341d\";\n ctx.fillRect(156, 446, 27, 11);\n ctx.fillRect(332, 446, 27, 11);\n\n // side seam highlights\n ctx.fillStyle = \"rgba(239,165,91,.16)\";\n ctx.fillRect(180, 161, 2, 250);\n ctx.fillStyle = \"rgba(25,11,5,.45)\";\n ctx.fillRect(349, 158, 4, 257);\n\n // Fine dust / warm lighting\n const light = ctx.createRadialGradient(262, 180, 40, 262, 180, 370);\n light.addColorStop(0, \"rgba(255,235,195,.13)\");\n light.addColorStop(1, \"rgba(83,57,36,.08)\");\n ctx.fillStyle = light;\n ctx.fillRect(0, 0, W, H);\n}"}], "metadata": {"id": "val-v1-broad-v2-text_rendering-validation-002", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 4066, "code_sha256": "6441485a678bb2eafae1c287f2d999c6c6afc6f831672186bdc8c7469079aad7"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A lady, dressed in black, is snowshoeing on a sunny day in the mountains."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n `;\n stage.style.width = \"512px\";\n stage.style.height = \"512px\";\n stage.style.overflow = \"hidden\";\n}"}], "metadata": {"id": "val-v1-coco-train2017-000000172989-45784", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 4541, "code_sha256": "f9660cff69fe5ba47b791ba3016858f273b7bcb81216ea9905288e465ad72ab8"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "a couple of parked motor cycles sit in front of a store"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = `\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n MOTO\n SERVICE & REPAIRS\n\n \n \n \n \n \n \n \n\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n
`;\n}"}], "metadata": {"id": "val-v1-coco-train2017-000000183835-688387", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 5397, "code_sha256": "9dbe88e6bd461551ac306d57f1662eee309975158d562916a7bc4f177fa5fcdc"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A man urinating all over the middle of a street."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"position:relative;width:512px;height:512px;overflow:hidden;background:#0b1015;\";\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = 1024;\n canvas.style.cssText = \"width:512px;height:512px;display:block;\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(2, 2);\n\n const W = 512, H = 512;\n const rnd = (a, b) => a + Math.random() * (b - a);\n\n // Night sky / distant city glow\n let sky = ctx.createLinearGradient(0, 0, 0, 260);\n sky.addColorStop(0, \"#071019\");\n sky.addColorStop(.52, \"#172635\");\n sky.addColorStop(1, \"#33404a\");\n ctx.fillStyle = sky;\n ctx.fillRect(0, 0, W, 285);\n\n // Hazy glow\n const haze = ctx.createRadialGradient(385, 100, 5, 385, 100, 225);\n haze.addColorStop(0, \"rgba(238,166,75,.19)\");\n haze.addColorStop(.45, \"rgba(148,122,92,.09)\");\n haze.addColorStop(1, \"rgba(0,0,0,0)\");\n ctx.fillStyle = haze;\n ctx.fillRect(0, 0, W, 310);\n\n // Distant buildings\n const buildings = [\n [0, 120, 55, 147], [49, 145, 50, 122], [94, 105, 55, 164],\n [143, 135, 73, 130], [211, 96, 67, 168], [274, 144, 43, 123],\n [313, 113, 63, 152], [372, 143, 58, 127], [426, 94, 86, 176]\n ];\n buildings.forEach(([x, y, w, h], i) => {\n ctx.fillStyle = i % 2 ? \"#111a23\" : \"#0d171f\";\n ctx.fillRect(x, y, w, h);\n ctx.fillStyle = \"rgba(255,192,96,.28)\";\n for (let wy = y + 13; wy < y + h - 8; wy += 17) {\n for (let wx = x + 9; wx < x + w - 5; wx += 15) {\n if (Math.random() > .52) ctx.fillRect(wx, wy, rnd(3, 6), rnd(4, 8));\n }\n }\n });\n\n // Sidewalk and street perspective\n ctx.fillStyle = \"#586069\";\n ctx.beginPath();\n ctx.moveTo(0, 257); ctx.lineTo(512, 252); ctx.lineTo(512, 311); ctx.lineTo(0, 330);\n ctx.closePath(); ctx.fill();\n\n ctx.fillStyle = \"#1b2228\";\n ctx.beginPath();\n ctx.moveTo(0, 326); ctx.lineTo(512, 306); ctx.lineTo(512, 512); ctx.lineTo(0, 512);\n ctx.closePath(); ctx.fill();\n\n // Road wet gradient\n let road = ctx.createLinearGradient(0, 290, 0, 512);\n road.addColorStop(0, \"#3e484d\");\n road.addColorStop(.28, \"#222a2f\");\n road.addColorStop(1, \"#101619\");\n ctx.fillStyle = road;\n ctx.beginPath();\n ctx.moveTo(0, 315); ctx.lineTo(512, 300); ctx.lineTo(512, 512); ctx.lineTo(0, 512);\n ctx.closePath(); ctx.fill();\n\n // Curb\n ctx.strokeStyle = \"#899095\";\n ctx.lineWidth = 4;\n ctx.beginPath(); ctx.moveTo(0, 322); ctx.lineTo(512, 303); ctx.stroke();\n ctx.strokeStyle = \"#242b30\";\n ctx.lineWidth = 8;\n ctx.beginPath(); ctx.moveTo(0, 331); ctx.lineTo(512, 311); ctx.stroke();\n\n // Road markings perspective\n ctx.fillStyle = \"rgba(226,184,77,.56)\";\n [[56, 420, 29, 5], [116, 397, 22, 4], [159, 381, 16, 3], [191, 369, 10, 2]].forEach(a => {\n ctx.save();\n ctx.rotate(-.035);\n ctx.fillRect(...a);\n ctx.restore();\n });\n\n // Wet reflection streaks\n for (let i = 0; i < 90; i++) {\n const y = rnd(320, 510), x = rnd(0, 512);\n const alpha = rnd(.02, .12);\n const len = (y - 280) * rnd(.08, .3);\n ctx.strokeStyle = `rgba(${rnd(120,220)},${rnd(140,190)},${rnd(160,210)},${alpha})`;\n ctx.lineWidth = rnd(.4, 2);\n ctx.beginPath();\n ctx.moveTo(x, y); ctx.lineTo(x + len, y + rnd(-1, 1)); ctx.stroke();\n }\n\n // Street lamp pole\n ctx.fillStyle = \"#151b1e\";\n ctx.fillRect(429, 30, 9, 279);\n ctx.fillStyle = \"#263036\";\n ctx.fillRect(436, 30, 3, 279);\n ctx.beginPath();\n ctx.moveTo(411, 34); ctx.lineTo(450, 34); ctx.lineTo(450, 43); ctx.lineTo(411, 43); ctx.closePath();\n ctx.fillStyle = \"#151a1d\"; ctx.fill();\n const lamp = ctx.createRadialGradient(429, 49, 2, 429, 49, 90);\n lamp.addColorStop(0, \"rgba(255,221,144,.9)\");\n lamp.addColorStop(.12, \"rgba(255,192,89,.38)\");\n lamp.addColorStop(1, \"rgba(255,177,75,0)\");\n ctx.fillStyle = lamp; ctx.fillRect(339, -40, 180, 185);\n ctx.fillStyle = \"#ffe2a2\";\n ctx.fillRect(417, 43, 24, 7);\n\n // Faint parked cars\n ctx.fillStyle = \"#172127\";\n ctx.beginPath();\n ctx.moveTo(17, 273); ctx.lineTo(29, 257); ctx.lineTo(70, 254); ctx.lineTo(91, 270); ctx.lineTo(91, 284); ctx.lineTo(15, 286); ctx.closePath(); ctx.fill();\n ctx.fillStyle = \"#5b6a70\";\n ctx.fillRect(33, 260, 30, 8);\n ctx.fillStyle = \"#090c0e\";\n ctx.beginPath(); ctx.arc(31, 285, 7, 0, Math.PI*2); ctx.arc(74, 283, 7, 0, Math.PI*2); ctx.fill();\n\n // Man shadow\n const shadow = ctx.createRadialGradient(264, 463, 5, 264, 463, 108);\n shadow.addColorStop(0, \"rgba(0,0,0,.62)\");\n shadow.addColorStop(1, \"rgba(0,0,0,0)\");\n ctx.fillStyle = shadow;\n ctx.save(); ctx.scale(1, .34); ctx.fillRect(145, 1210, 240, 180); ctx.restore();\n\n // Man, viewed from behind / side, clothed\n // rear leg\n ctx.fillStyle = \"#172331\";\n ctx.beginPath();\n ctx.moveTo(237, 365); ctx.lineTo(270, 366); ctx.lineTo(273, 435); ctx.lineTo(266, 462);\n ctx.lineTo(245, 462); ctx.lineTo(248, 424); ctx.closePath(); ctx.fill();\n\n // forward leg\n ctx.fillStyle = \"#213244\";\n ctx.beginPath();\n ctx.moveTo(269, 363); ctx.lineTo(294, 369); ctx.lineTo(311, 429); ctx.lineTo(329, 461);\n ctx.lineTo(306, 466); ctx.lineTo(285, 434); ctx.lineTo(265, 392); ctx.closePath(); ctx.fill();\n\n // jean highlights\n ctx.strokeStyle = \"rgba(106,137,161,.3)\";\n ctx.lineWidth = 2;\n ctx.beginPath(); ctx.moveTo(254, 379); ctx.lineTo(258, 436); ctx.moveTo(286, 382); ctx.lineTo(303, 427); ctx.stroke();\n\n // shoes\n ctx.fillStyle = \"#0a0d0f\";\n ctx.beginPath(); ctx.ellipse(256, 463, 23, 7, -.08, 0, Math.PI*2); ctx.fill();\n ctx.beginPath(); ctx.ellipse(319, 465, 25, 7, -.05, 0, Math.PI*2); ctx.fill();\n ctx.fillStyle = \"#4b5359\";\n ctx.fillRect(241, 459, 24, 2); ctx.fillRect(306, 461, 25, 2);\n\n // torso jacket\n ctx.fillStyle = \"#26333a\";\n ctx.beginPath();\n ctx.moveTo(229, 257); ctx.quadraticCurveTo(249, 245, 273, 248);\n ctx.quadraticCurveTo(293, 252, 302, 274);\n ctx.lineTo(297, 353); ctx.quadraticCurveTo(286, 374, 254, 371);\n ctx.lineTo(232, 357); ctx.lineTo(224, 285); ctx.closePath(); ctx.fill();\n\n ctx.fillStyle = \"#33424a\";\n ctx.beginPath();\n ctx.moveTo(234, 263); ctx.quadraticCurveTo(249, 253, 261, 255);\n ctx.lineTo(260, 361); ctx.lineTo(240, 353); ctx.closePath(); ctx.fill();\n\n // bent arm, discreetly in front\n ctx.fillStyle = \"#253139\";\n ctx.beginPath();\n ctx.moveTo(288, 273); ctx.quadraticCurveTo(309, 284, 305, 313);\n ctx.lineTo(293, 342); ctx.lineTo(278, 335); ctx.lineTo(287, 306);\n ctx.lineTo(273, 290); ctx.closePath(); ctx.fill();\n ctx.fillStyle = \"#a06f55\";\n ctx.beginPath();\n ctx.ellipse(288, 340, 10, 13, .35, 0, Math.PI * 2); ctx.fill();\n\n // head and neck\n ctx.fillStyle = \"#8d604a\";\n ctx.fillRect(248, 231, 21, 25);\n ctx.fillStyle = \"#b97b5b\";\n ctx.beginPath();\n ctx.ellipse(258, 218, 23, 29, -.08, 0, Math.PI * 2); ctx.fill();\n\n // hair\n ctx.fillStyle = \"#171414\";\n ctx.beginPath();\n ctx.arc(258, 214, 24, Math.PI*.92, Math.PI*2.02); ctx.fill();\n ctx.fillRect(238, 210, 9, 20);\n ctx.fillStyle = \"#2a2020\";\n ctx.beginPath();\n ctx.arc(253, 197, 17, Math.PI, Math.PI*2); ctx.fill();\n\n // Urine stream shown from obscured clothing area to pavement, no explicit anatomy\n ctx.save();\n ctx.strokeStyle = \"rgba(218,191,91,.6)\";\n ctx.lineWidth = 2.2;\n ctx.lineCap = \"round\";\n ctx.beginPath();\n ctx.moveTo(291, 344);\n ctx.bezierCurveTo(307, 365, 315, 384, 322, 410);\n ctx.stroke();\n ctx.strokeStyle = \"rgba(255,225,130,.26)\";\n ctx.lineWidth = 5;\n ctx.beginPath();\n ctx.moveTo(291, 345);\n ctx.bezierCurveTo(307, 367, 315, 386, 322, 411);\n ctx.stroke();\n ctx.restore();\n\n // Splash and wet patch\n const puddle = ctx.createRadialGradient(323, 413, 2, 323, 413, 38);\n puddle.addColorStop(0, \"rgba(179,157,81,.42)\");\n puddle.addColorStop(.3, \"rgba(100,107,81,.25)\");\n puddle.addColorStop(1, \"rgba(20,27,28,0)\");\n ctx.fillStyle = puddle;\n ctx.beginPath(); ctx.ellipse(323, 414, 40, 11, -.1, 0, Math.PI*2); ctx.fill();\n\n for (let i = 0; i < 18; i++) {\n ctx.fillStyle = `rgba(230,208,124,${rnd(.18,.55)})`;\n ctx.beginPath();\n ctx.arc(322 + rnd(-17, 18), 413 + rnd(-6, 6), rnd(.5, 1.8), 0, Math.PI * 2);\n ctx.fill();\n }\n\n // Foreground grime\n for (let i = 0; i < 60; i++) {\n ctx.fillStyle = `rgba(0,0,0,${rnd(.04,.16)})`;\n ctx.beginPath();\n ctx.arc(rnd(0,512), rnd(420,512), rnd(.4,2), 0, Math.PI*2);\n ctx.fill();\n }\n\n // subtle cinematic vignette\n const vignette = ctx.createRadialGradient(256, 265, 170, 256, 265, 390);\n vignette.addColorStop(.5, \"rgba(0,0,0,0)\");\n vignette.addColorStop(1, \"rgba(0,0,0,.58)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0, 0, W, H);\n}"}], "metadata": {"id": "val-v1-coco-train2017-000000210424-384196", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 4099, "code_sha256": "c5ebfb1f49055fac36eb8d9cf9d91dc58b033b363c22235ee85ea8e19c521fcb"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A beautiful young lady leading a horse with a child riding it through a forest."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = 1024;\n canvas.style.width = \"512px\";\n canvas.style.height = \"512px\";\n canvas.style.display = \"block\";\n stage.appendChild(canvas);\n\n const c = canvas.getContext(\"2d\");\n c.scale(2, 2);\n\n const W = 512, H = 512;\n const rand = (() => {\n let s = 728319;\n return () => (s = (s * 1664525 + 1013904223) >>> 0) / 4294967296;\n })();\n\n function path(points, fill, stroke, width = 1) {\n c.beginPath();\n points.forEach((p, i) => i ? c.lineTo(p[0], p[1]) : c.moveTo(p[0], p[1]));\n c.closePath();\n if (fill) { c.fillStyle = fill; c.fill(); }\n if (stroke) { c.strokeStyle = stroke; c.lineWidth = width; c.stroke(); }\n }\n function ellipse(x, y, rx, ry, fill, rot = 0) {\n c.save();\n c.translate(x, y);\n c.rotate(rot);\n c.beginPath();\n c.ellipse(0, 0, rx, ry, 0, 0, Math.PI * 2);\n c.fillStyle = fill;\n c.fill();\n c.restore();\n }\n function line(x1, y1, x2, y2, color, width, alpha = 1) {\n c.save();\n c.globalAlpha = alpha;\n c.strokeStyle = color;\n c.lineWidth = width;\n c.lineCap = \"round\";\n c.beginPath();\n c.moveTo(x1, y1);\n c.lineTo(x2, y2);\n c.stroke();\n c.restore();\n }\n\n // Atmospheric forest background\n let sky = c.createLinearGradient(0, 0, 0, H);\n sky.addColorStop(0, \"#b8d4c6\");\n sky.addColorStop(.45, \"#729a75\");\n sky.addColorStop(1, \"#314e32\");\n c.fillStyle = sky;\n c.fillRect(0, 0, W, H);\n\n // Distant glowing woodland\n const glow = c.createRadialGradient(266, 145, 5, 266, 145, 245);\n glow.addColorStop(0, \"rgba(255,239,170,.82)\");\n glow.addColorStop(.36, \"rgba(208,221,143,.36)\");\n glow.addColorStop(1, \"rgba(43,78,52,0)\");\n c.fillStyle = glow;\n c.fillRect(0, 0, W, H);\n\n // Far tree trunks\n for (let i = 0; i < 34; i++) {\n const x = rand() * W;\n const top = -30 + rand() * 115;\n const base = 300 + rand() * 110;\n const w = 2 + rand() * 8;\n c.fillStyle = `rgba(${50 + rand()*35|0},${69 + rand()*35|0},${45 + rand()*22|0},${.25 + rand()*.27})`;\n c.beginPath();\n c.moveTo(x - w / 2, top);\n c.lineTo(x + w / 2, top);\n c.lineTo(x + w * 1.5, base);\n c.lineTo(x - w * 1.6, base);\n c.fill();\n }\n\n // Soft distant leaves\n for (let i = 0; i < 780; i++) {\n const x = rand() * W, y = rand() * 310;\n const r = 3 + rand() * 14;\n const colors = [\"#315c38\", \"#477443\", \"#638448\", \"#78954e\", \"#244c36\", \"#9cac5b\"];\n ellipse(x, y, r * (0.55 + rand()*.4), r * .55, colors[(rand()*colors.length)|0], rand()*3.14);\n }\n\n // Large framing trees\n const trunkGrad = c.createLinearGradient(0, 0, 112, 0);\n trunkGrad.addColorStop(0, \"#17281d\");\n trunkGrad.addColorStop(.43, \"#473a29\");\n trunkGrad.addColorStop(1, \"#1b281d\");\n c.fillStyle = trunkGrad;\n path([[0,0],[70,0],[67,76],[91,158],[76,248],[92,363],[57,512],[0,512]], trunkGrad);\n c.fillStyle = \"#26321f\";\n path([[512,0],[450,0],[457,102],[425,183],[438,278],[412,386],[434,512],[512,512]], \"#26321f\");\n\n // Branches\n line(37, 65, 198, 1, \"#283422\", 15);\n line(30, 150, 159, 80, \"#26341f\", 11);\n line(481, 82, 364, 20, \"#25321f\", 13);\n line(468, 158, 355, 91, \"#25321f\", 10);\n\n // Foreground canopy\n for (let i = 0; i < 245; i++) {\n const side = rand() < .5 ? 1 : -1;\n const x = side === 1 ? rand()*168 : 342 + rand()*170;\n const y = rand()*185;\n const r = 7 + rand()*20;\n const cols = [\"#183d27\",\"#285831\",\"#356b35\",\"#476f36\",\"#617a3d\",\"#1d482b\"];\n ellipse(x, y, r, r*.58, cols[(rand()*cols.length)|0], rand()*Math.PI);\n }\n\n // Path / forest floor\n c.fillStyle = \"#53603d\";\n path([[142,512],[392,512],[349,413],[315,352],[253,327],[188,349],[157,410]], \"#6b7447\");\n c.fillStyle = \"rgba(238,205,125,.23)\";\n path([[205,512],[336,512],[310,412],[279,365],[250,350],[219,372],[192,430]], \"rgba(239,206,124,.28)\");\n\n for (let i = 0; i < 550; i++) {\n const x = rand() * W, y = 295 + rand() * 217;\n const cols = [\"#31472b\",\"#455a31\",\"#6d713a\",\"#8a7940\",\"#a08043\",\"#263b28\"];\n ellipse(x, y, 1+rand()*4, .7+rand()*2, cols[(rand()*cols.length)|0], rand()*3.2);\n }\n\n // Midground shrubs\n for (let i=0;i<170;i++) {\n const x = rand()*W, y = 285 + rand()*105;\n const r = 5+rand()*13;\n ellipse(x,y,r,r*.48, [\"#234728\",\"#315b2d\",\"#557039\",\"#748044\"][(rand()*4)|0], rand()*3);\n }\n\n // Horse shadow\n ellipse(277, 430, 126, 20, \"rgba(24,27,16,.28)\");\n\n // Horse rear legs behind\n path([[296,362],[313,365],[319,421],[313,460],[303,460],[303,423],[294,385]], \"#5b3824\");\n path([[337,351],[351,354],[360,414],[355,459],[344,459],[344,411],[332,374]], \"#492b20\");\n ellipse(307, 462, 13, 4, \"#1c1a16\");\n ellipse(350, 461, 14, 4, \"#1c1a16\");\n\n // Horse body\n const body = c.createLinearGradient(190, 310, 372, 400);\n body.addColorStop(0, \"#9b6540\");\n body.addColorStop(.46, \"#794527\");\n body.addColorStop(1, \"#482b21\");\n c.fillStyle = body;\n path([[192,347],[205,318],[249,300],[310,304],[347,324],[365,354],[349,383],[300,397],[240,391],[202,374]], body);\n ellipse(277, 347, 72, 43, body, .03);\n ellipse(235, 332, 39, 27, \"rgba(196,132,80,.32)\", -.35);\n ellipse(324, 366, 29, 18, \"rgba(49,24,18,.24)\", .25);\n\n // Neck\n const neck = c.createLinearGradient(180, 220, 257, 355);\n neck.addColorStop(0, \"#633a27\");\n neck.addColorStop(.4, \"#a86a41\");\n neck.addColorStop(1, \"#603622\");\n path([[199,346],[192,316],[201,276],[216,234],[245,235],[252,274],[250,306],[270,336],[246,358]], neck);\n\n // Mane\n path([[210,241],[218,218],[229,229],[233,248],[240,266],[239,297],[247,329],[235,331],[224,293],[217,271],[207,254]], \"#241c18\");\n for (let i=0;i<14;i++) line(213+i*1.7, 245+i*3.8, 202+i*2, 263+i*4.3, \"#171615\", 2);\n\n // Head and muzzle\n path([[209,240],[192,223],[191,198],[205,181],[226,185],[241,205],[234,232],[221,250]], \"#8b5737\");\n path([[194,201],[184,190],[188,180],[201,192]], \"#432d22\");\n path([[218,189],[224,174],[234,178],[229,199]], \"#4c3023\");\n ellipse(198, 218, 16, 11, \"#c28b62\", -.28);\n ellipse(193, 216, 2.5, 2.5, \"#161512\");\n ellipse(215, 199, 3.1, 3.1, \"#15130f\");\n ellipse(216, 198, 1, 1, \"#fff4d5\");\n\n // Bridle\n line(196, 201, 225, 208, \"#271d17\", 2);\n line(197, 217, 223, 235, \"#251b15\", 2);\n line(224, 207, 226, 235, \"#251b15\", 2);\n line(195, 223, 169, 280, \"#38251c\", 1.4);\n line(199, 224, 173, 282, \"rgba(234,193,122,.7)\", .55);\n\n // Front legs\n path([[219,370],[237,373],[233,421],[228,463],[216,463],[215,424]], \"#754426\");\n path([[262,380],[278,379],[279,423],[273,460],[262,460],[262,418]], \"#603722\");\n ellipse(222, 464, 14, 4, \"#1b1915\");\n ellipse(269, 461, 14, 4, \"#1b1915\");\n line(218, 415, 232, 416, \"rgba(232,179,113,.42)\", 1);\n line(262, 415, 277, 415, \"rgba(224,171,106,.42)\", 1);\n\n // Saddle blanket\n path([[245,295],[301,293],[325,315],[306,341],[252,334],[232,315]], \"#8f2632\");\n path([[246,298],[298,297],[315,315],[303,333],[254,328],[239,314]], \"#b78344\");\n path([[251,299],[296,299],[308,314],[299,326],[258,323],[245,313]], \"#4d3023\");\n line(250, 314, 306, 316, \"#d6af60\", 1.5);\n\n // Child legs behind rider\n path([[277,320],[291,321],[299,361],[315,379],[308,385],[287,366],[273,336]], \"#344660\");\n path([[259,320],[272,322],[267,354],[251,379],[243,375],[250,348]], \"#344660\");\n ellipse(311, 383, 12, 5, \"#38271d\", -.1);\n ellipse(247, 378, 11, 5, \"#38271d\", .2);\n\n // Child torso\n path([[248,255],[278,252],[289,278],[281,321],[252,321],[239,284]], \"#d7a840\");\n path([[252,258],[273,256],[280,278],[275,298],[254,297],[245,278]], \"#f0c852\");\n line(256, 279, 278, 280, \"#8e5a2c\", 1);\n line(261, 300, 262, 318, \"#aa7334\", 2);\n\n // Child arms holding saddle\n line(245, 275, 232, 304, \"#d39869\", 8);\n line(232, 303, 245, 310, \"#d39869\", 6);\n line(279, 275, 291, 299, \"#d39869\", 7);\n\n // Child head\n ellipse(263, 236, 16, 20, \"#d99e73\");\n ellipse(258, 238, 12, 16, \"rgba(244,188,139,.35)\");\n // hair\n path([[248,238],[248,221],[257,212],[274,215],[280,230],[274,241],[270,226],[254,225],[252,244]], \"#39251d\");\n ellipse(257, 237, 1.6, 1.4, \"#2d211c\");\n ellipse(269, 237, 1.6, 1.4, \"#2d211c\");\n line(260, 248, 267, 249, \"#a65f5b\", 1);\n\n // Woman behind / left leading horse\n // legs\n path([[147,349],[162,349],[166,420],[161,459],[149,459],[150,411]], \"#31536b\");\n path([[164,350],[180,349],[187,416],[191,459],[179,459],[174,416]], \"#27465c\");\n ellipse(155, 462, 15, 5, \"#473022\");\n ellipse(186, 462, 15, 5, \"#473022\");\n\n // flowing dress\n const dress = c.createLinearGradient(132, 252, 193, 397);\n dress.addColorStop(0, \"#e3d7c6\");\n dress.addColorStop(.35, \"#c39081\");\n dress.addColorStop(1, \"#875b5b\");\n path([[143,271],[169,261],[184,287],[180,334],[200,386],[180,399],[158,380],[137,399],[123,389],[137,336],[130,301]], dress);\n path([[148,286],[161,278],[158,374],[145,388]], \"rgba(255,237,214,.33)\");\n line(170, 292, 168, 375, \"rgba(104,55,55,.42)\", 2);\n\n // Woman arm toward lead\n path([[169,278],[179,283],[185,304],[174,321],[169,316],[174,302]], \"#d8a07d\");\n line(177, 300, 185, 305, \"#d8a07d\", 7);\n line(183, 306, 195, 289, \"#d8a07d\", 5);\n // reins held\n line(194, 289, 205, 245, \"#513529\", 1.25);\n line(194, 290, 198, 225, \"#513529\", 1.25);\n\n // woman torso\n path([[139,235],[165,231],[177,264],[168,290],[141,287],[130,260]], \"#e9d9ca\");\n path([[142,239],[162,237],[167,257],[161,273],[143,271],[136,255]], \"#dcb0a0\");\n path([[141,274],[169,274],[168,286],[140,286]], \"#844d55\");\n\n // woman neck and head\n path([[147,232],[148,215],[161,214],[164,235],[158,244],[151,242]], \"#dca27c\");\n ellipse(154, 199, 18, 23, \"#e2a780\");\n ellipse(150, 203, 11, 17, \"rgba(255,216,181,.3)\");\n // hair\n path([[136,207],[134,188],[143,174],[159,172],[173,184],[172,207],[165,219],[163,195],[152,184],[143,195],[144,215]], \"#4a2c20\");\n path([[143,179],[153,166],[169,177],[174,194],[169,198],[160,183]], \"#32221b\");\n line(143, 190, 137, 223, \"#4a2c20\", 5);\n ellipse(149, 199, 1.7, 1.5, \"#302019\");\n ellipse(161, 199, 1.7, 1.5, \"#302019\");\n line(151, 210, 159, 211, \"#a45456\", 1.2);\n\n // foreground grasses\n for (let i=0;i<110;i++) {\n const x = rand()*W, y = 470+rand()*42;\n line(x,y,x+(rand()-.5)*10,y-(5+rand()*22), [\"#294127\",\"#435d2b\",\"#647238\"][(rand()*3)|0], .6+rand()*1.1, .8);\n }\n\n // Sun flecks\n for (let i=0;i<65;i++) {\n const x = 60+rand()*390, y=20+rand()*285;\n const r=1+rand()*4;\n ellipse(x,y,r,r,\"rgba(255,239,171,.22)\");\n }\n\n // subtle vignette\n const vig = c.createRadialGradient(256,250,190,256,250,400);\n vig.addColorStop(.58,\"rgba(0,0,0,0)\");\n vig.addColorStop(1,\"rgba(10,22,12,.34)\");\n c.fillStyle=vig;\n c.fillRect(0,0,W,H);\n}"}], "metadata": {"id": "val-v1-coco-train2017-000000230597-64329", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 6334, "code_sha256": "f541865a90291713378519e26c38a54631345bbdc563421e1c4bc56f4fd76245"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "Boy with red water bottle sitting on bench under tree with a valley in the back ground."}, {"role": "assistant", "content": "async function render(stage) {\n const canvas = document.createElement(\"canvas\");\n canvas.width = 512;\n canvas.height = 512;\n canvas.style.width = \"512px\";\n canvas.style.height = \"512px\";\n canvas.style.display = \"block\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n const W = 512, H = 512;\n\n function grad(x0, y0, x1, y1, stops) {\n const g = ctx.createLinearGradient(x0, y0, x1, y1);\n stops.forEach(s => g.addColorStop(s[0], s[1]));\n return g;\n }\n function ellipse(x, y, rx, ry, fill) {\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n ctx.fillStyle = fill;\n ctx.fill();\n }\n function path(points, fill, stroke, width = 1) {\n ctx.beginPath();\n points.forEach((p, i) => i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]));\n ctx.closePath();\n if (fill) { ctx.fillStyle = fill; ctx.fill(); }\n if (stroke) { ctx.strokeStyle = stroke; ctx.lineWidth = width; ctx.stroke(); }\n }\n\n // Sky\n ctx.fillStyle = grad(0, 0, 0, 300, [\n [0, \"#91c8e8\"], [0.45, \"#c7e4ee\"], [1, \"#f5dfb9\"]\n ]);\n ctx.fillRect(0, 0, W, H);\n\n // Clouds\n ctx.globalAlpha = 0.42;\n [[\"#fff\", 330, 74, 65, 12], [\"#fff\", 395, 91, 92, 13], [\"#fff\", 175, 93, 75, 10]].forEach(c => {\n ellipse(c[1], c[2], c[3], c[4], c[0]);\n ellipse(c[1] - 28, c[2] + 4, c[3] * .45, c[4] * 1.1, c[0]);\n ellipse(c[1] + 32, c[2] + 1, c[3] * .38, c[4] * 1.2, c[0]);\n });\n ctx.globalAlpha = 1;\n\n // Distant mountains\n path([[0,215],[47,176],[89,207],[142,145],[199,202],[257,164],[303,209],[355,135],[425,197],[477,159],[512,186],[512,302],[0,302]],\n grad(0, 145, 0, 290, [[0,\"#718d91\"],[1,\"#9baa93\"]]));\n path([[0,238],[66,201],[116,231],[178,181],[243,239],[308,192],[371,234],[439,179],[512,224],[512,307],[0,307]],\n grad(0, 180, 0, 310, [[0,\"#8fa98e\"],[1,\"#c0bd8c\"]]));\n\n // Valley layers\n ctx.fillStyle = \"#789b65\";\n ctx.beginPath();\n ctx.moveTo(0,255);\n for (let x=0;x<=512;x+=16) ctx.lineTo(x, 246 + Math.sin(x*.055)*10 + Math.sin(x*.14)*4);\n ctx.lineTo(512,365); ctx.lineTo(0,365); ctx.fill();\n\n ctx.fillStyle = \"#a7b765\";\n ctx.beginPath();\n ctx.moveTo(0,286);\n for (let x=0;x<=512;x+=12) ctx.lineTo(x, 276 + Math.sin(x*.04+2)*15 + Math.sin(x*.13)*4);\n ctx.lineTo(512,361);ctx.lineTo(0,361);ctx.fill();\n\n // winding pale road\n ctx.strokeStyle = \"#d4c589\";\n ctx.lineWidth = 11;\n ctx.lineCap = \"round\";\n ctx.beginPath();\n ctx.moveTo(430,283);\n ctx.bezierCurveTo(360,300, 327,304, 365,324);\n ctx.bezierCurveTo(398,343, 303,351, 259,387);\n ctx.stroke();\n ctx.strokeStyle = \"#ece0aa\";\n ctx.lineWidth = 4;\n ctx.stroke();\n\n // Meadow\n ctx.fillStyle = grad(0, 305, 0, 512, [[0,\"#6e974a\"],[1,\"#31552b\"]]);\n ctx.fillRect(0, 304, W, H);\n for (let i=0;i<450;i++) {\n const x = Math.random()*512, y=300+Math.random()*212;\n const h=2+Math.random()*8;\n ctx.strokeStyle = Math.random()>.55 ? \"#91ad53\" : \"#426f35\";\n ctx.lineWidth = .55+Math.random();\n ctx.beginPath();ctx.moveTo(x,y);ctx.lineTo(x+(Math.random()-.5)*3,y-h);ctx.stroke();\n }\n\n // Tree shadow\n ctx.save();\n ctx.globalAlpha=.23;\n ctx.fillStyle=\"#193a22\";\n ctx.beginPath();\n ctx.ellipse(152,442,166,43,-.18,0,Math.PI*2);\n ctx.fill();\n ctx.restore();\n\n // Tree trunk and branches\n ctx.strokeStyle=\"#583925\";\n ctx.lineCap=\"round\";\n ctx.lineJoin=\"round\";\n ctx.lineWidth=27;\n ctx.beginPath();\n ctx.moveTo(73,512);\n ctx.bezierCurveTo(72,450, 82,381, 73,302);\n ctx.bezierCurveTo(68,240, 91,177, 116,126);\n ctx.stroke();\n ctx.strokeStyle=\"#70472b\";\n ctx.lineWidth=10;\n ctx.beginPath();\n ctx.moveTo(79,506);ctx.bezierCurveTo(92,406,79,330,96,262);\n ctx.bezierCurveTo(108,211,134,165,151,129);\n ctx.moveTo(82,330);ctx.bezierCurveTo(123,276,146,249,180,225);\n ctx.moveTo(91,273);ctx.bezierCurveTo(53,221,46,172,43,135);\n ctx.moveTo(103,211);ctx.bezierCurveTo(154,194,183,162,204,127);\n ctx.stroke();\n ctx.strokeStyle=\"#3f2a1d\";\n ctx.lineWidth=4;\n ctx.beginPath();\n ctx.moveTo(70,496);ctx.bezierCurveTo(62,420,84,364,76,301);\n ctx.moveTo(86,480);ctx.bezierCurveTo(101,396,89,319,106,264);\n ctx.stroke();\n\n // leafy canopy clusters\n const leaves = [\n [35,104,54],[81,75,66],[133,72,67],[187,88,65],[238,115,54],\n [22,155,61],[77,137,70],[139,132,70],[197,147,61],[247,164,46],\n [43,205,54],[108,190,62],[171,190,58]\n ];\n leaves.forEach((l, i) => {\n const g=ctx.createRadialGradient(l[0]-12,l[1]-16,4,l[0],l[1],l[2]);\n g.addColorStop(0, i%2 ? \"#79a64b\":\"#91b854\");\n g.addColorStop(.55, \"#487d3a\");\n g.addColorStop(1, \"#28542e\");\n ellipse(l[0],l[1],l[2],l[2]*.72,g);\n });\n for(let i=0;i<115;i++){\n const x=5+Math.random()*254, y=32+Math.random()*193;\n if ((x-126)*(x-126)/18000+(y-130)*(y-130)/10000<1.3) {\n ellipse(x,y,2+Math.random()*4,2+Math.random()*3,Math.random()>.5?\"#8dad48\":\"#346b34\");\n }\n }\n\n // Bench behind boy\n ctx.fillStyle=\"#35251c\";\n ctx.fillRect(151,342,237,10);\n ctx.fillStyle=\"#a56b38\";\n ctx.fillRect(143,326,250,18);\n ctx.fillStyle=\"#c18448\";\n ctx.fillRect(146,323,246,7);\n ctx.fillStyle=\"#6a4028\";\n ctx.fillRect(165,341,7,91);\n ctx.fillRect(360,340,7,90);\n ctx.fillStyle=\"#4b3021\";\n ctx.fillRect(155,420,24,7);\n ctx.fillRect(349,420,25,7);\n ctx.strokeStyle=\"#774628\";\n ctx.lineWidth=2;\n for(let x=158;x<385;x+=38){ctx.beginPath();ctx.moveTo(x,327);ctx.lineTo(x,342);ctx.stroke();}\n\n // Boy legs, seated\n // far leg\n path([[262,393],[303,397],[333,449],[321,458],[292,420],[260,414]], \"#31465b\", \"#1d2d3a\", 1.5);\n // near thigh\n path([[222,377],[274,383],[292,419],[251,432],[218,406]], \"#405a70\", \"#233648\", 1.5);\n // lower near leg\n path([[252,424],[277,418],[286,470],[269,475],[246,439]], \"#324a61\", \"#1e3041\", 1.5);\n // shoes\n path([[265,468],[289,468],[303,480],[300,486],[262,485],[258,479]], \"#e6e4d7\", \"#35404a\", 1);\n path([[317,450],[337,450],[354,462],[350,468],[314,466],[309,459]], \"#e2e3d9\", \"#35404a\", 1);\n ctx.fillStyle=\"#5d777e\";ctx.fillRect(265,475,27,3);ctx.fillRect(318,457,25,3);\n\n // shirt torso\n path([[207,283],[251,277],[278,307],[269,379],[223,388],[194,353]], \"#e0a935\", \"#6f5021\", 1.5);\n ctx.fillStyle=\"#efc24c\";\n path([[213,286],[245,282],[253,372],[225,377],[204,347]], \"#efbf42\");\n ctx.fillStyle=\"#ca8d28\";\n ctx.fillRect(219,330,44,4);\n\n // neck\n path([[224,261],[243,259],[246,286],[227,289]], \"#b8754d\", \"#6e432e\", 1);\n\n // arm toward bottle\n path([[258,302],[275,309],[286,350],[276,359],[258,329]], \"#bd7a50\", \"#714630\", 1);\n path([[277,350],[287,349],[289,366],[280,370]], \"#bd7a50\", \"#714630\", 1);\n\n // other arm\n path([[204,300],[216,306],[222,348],[210,359],[196,318]], \"#c48256\", \"#704732\", 1);\n\n // head\n ellipse(232,236,31,37,\"#c88558\");\n ctx.strokeStyle=\"#6f452f\";ctx.lineWidth=1;\n ctx.beginPath();ctx.ellipse(232,236,31,37,0,0,Math.PI*2);ctx.stroke();\n\n // ear and facial detail\n ellipse(262,239,6,9,\"#ba744d\");\n ctx.fillStyle=\"#4a3028\";\n ellipse(244,236,2,2,\"#342721\");\n ctx.strokeStyle=\"#70412d\";ctx.lineWidth=1.2;\n ctx.beginPath();ctx.arc(243,251,7,.1,1.6);ctx.stroke();\n\n // hair\n ctx.fillStyle=\"#422c21\";\n ctx.beginPath();\n ctx.arc(230,222,31,Math.PI,Math.PI*2);\n ctx.lineTo(259,232);ctx.bezierCurveTo(249,221,248,213,239,207);\n ctx.bezierCurveTo(221,198,203,213,202,229);\n ctx.lineTo(209,232);ctx.lineTo(211,219);ctx.lineTo(217,228);ctx.lineTo(223,215);ctx.lineTo(231,226);ctx.lineTo(239,213);ctx.lineTo(247,228);\n ctx.fill();\n\n // red water bottle\n ctx.save();\n ctx.translate(284,355);\n ctx.rotate(.12);\n ctx.fillStyle=\"#9b2020\";\n ctx.fillRect(-4,-21,15,6);\n ctx.fillStyle=\"#d9302d\";\n ctx.beginPath();\n ctx.roundRect(-8,-17,22,48,6);\n ctx.fill();\n ctx.fillStyle=\"#f04a42\";\n ctx.fillRect(-4,-13,5,36);\n ctx.fillStyle=\"#a81d20\";\n ctx.fillRect(-6,-25,19,5);\n ctx.fillStyle=\"#eeeeeb\";\n ctx.fillRect(-4,1,14,10);\n ctx.fillStyle=\"#c82927\";\n ctx.font=\"bold 7px sans-serif\";\n ctx.fillText(\"H2O\",-3,9);\n ctx.restore();\n\n // foreground flowers\n for(let i=0;i<36;i++){\n const x=Math.random()*512, y=450+Math.random()*62;\n ctx.strokeStyle=\"#315d2e\";ctx.lineWidth=1;\n ctx.beginPath();ctx.moveTo(x,y+8);ctx.lineTo(x+Math.random()*4-2,y-4);ctx.stroke();\n if(Math.random()>.45){\n ellipse(x,y-5,2.5,2.5,Math.random()>.5?\"#f0ce46\":\"#e8e5d5\");\n ellipse(x-3,y-4,2,2,\"#f4db62\");\n ellipse(x+3,y-4,2,2,\"#f4db62\");\n }\n }\n\n // warm sunlight\n ctx.fillStyle = grad(0,0,512,512, [[0,\"rgba(255,236,165,.12)\"],[.5,\"rgba(255,255,255,0)\"],[1,\"rgba(255,188,85,.08)\"]]);\n ctx.fillRect(0,0,W,H);\n}"}], "metadata": {"id": "val-v1-coco-train2017-000000239436-30262", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 4501, "code_sha256": "1af82b067bcf143d2b5972b604efefd71c35f47dfff6d52b42e9ecf06604fe53"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A wooden bench with cushions beside a built in bookcase."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;overflow:hidden;position:relative;background:#d8cfbd;\";\n\n const svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 512 512\");\n svg.setAttribute(\"width\", \"512\");\n svg.setAttribute(\"height\", \"512\");\n svg.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n\n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n `;\n stage.appendChild(svg);\n}"}], "metadata": {"id": "val-v1-coco-train2017-000000274134-742188", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 6141, "code_sha256": "8f1f9f172c24e7c1242fa277473d20f070cce919716f5119610f83496a783ea4"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "two people are sitting on two different elephants"}, {"role": "assistant", "content": "async function render(stage) {\n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = 1024;\n canvas.style.width = canvas.style.height = \"512px\";\n canvas.style.display = \"block\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(2, 2);\n\n const W = 512, H = 512;\n const rnd = (a, b) => a + Math.random() * (b - a);\n\n function path(points, fill, stroke, lw = 1) {\n ctx.beginPath();\n points.forEach((p, i) => i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]));\n ctx.closePath();\n if (fill) ctx.fillStyle = fill, ctx.fill();\n if (stroke) ctx.strokeStyle = stroke, ctx.lineWidth = lw, ctx.stroke();\n }\n\n function ellipse(x, y, rx, ry, fill, stroke, lw = 1) {\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n if (fill) ctx.fillStyle = fill, ctx.fill();\n if (stroke) ctx.strokeStyle = stroke, ctx.lineWidth = lw, ctx.stroke();\n }\n\n // sky\n const sky = ctx.createLinearGradient(0, 0, 0, 320);\n sky.addColorStop(0, \"#8ebbd0\");\n sky.addColorStop(.52, \"#d7d6bd\");\n sky.addColorStop(1, \"#e8c784\");\n ctx.fillStyle = sky;\n ctx.fillRect(0, 0, W, H);\n\n // soft clouds\n ctx.globalAlpha = .19;\n for (let i = 0; i < 22; i++) {\n ellipse(rnd(-20, 530), rnd(30, 160), rnd(20, 64), rnd(5, 16), \"#fff8df\");\n }\n ctx.globalAlpha = 1;\n\n // distant acacia haze\n ctx.fillStyle = \"#7f8362\";\n ctx.globalAlpha = .42;\n for (let i = 0; i < 15; i++) {\n const x = i * 40 + rnd(-8, 8), y = rnd(228, 268);\n ctx.fillRect(x - 1, y - 28, 3, 30);\n ellipse(x, y - 31, rnd(18, 37), rnd(7, 13), \"#6b7657\");\n }\n ctx.globalAlpha = 1;\n\n // horizon grass\n const land = ctx.createLinearGradient(0, 250, 0, 512);\n land.addColorStop(0, \"#b6a765\");\n land.addColorStop(.38, \"#ae914e\");\n land.addColorStop(1, \"#806330\");\n ctx.fillStyle = land;\n ctx.fillRect(0, 264, W, 248);\n\n // grass texture\n for (let i = 0; i < 1800; i++) {\n const y = rnd(267, 512);\n const x = rnd(0, W);\n const len = rnd(1, 8) * ((y - 260) / 250);\n ctx.strokeStyle = Math.random() < .55 ? \"rgba(91,76,35,.26)\" : \"rgba(211,183,96,.28)\";\n ctx.lineWidth = rnd(.25, 1);\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.lineTo(x + rnd(-2, 2), y - len);\n ctx.stroke();\n }\n\n // shadows beneath elephants\n ellipse(164, 430, 123, 24, \"rgba(54,43,25,.27)\");\n ellipse(379, 440, 126, 24, \"rgba(54,43,25,.28)\");\n\n function elephant(x, y, s, flip) {\n ctx.save();\n ctx.translate(x, y);\n ctx.scale(flip * s, s);\n\n // far legs\n path([[-60,50],[-41,48],[-43,126],[-58,128],[-65,116]], \"#77716a\", \"#56534f\", 1);\n path([[32,50],[55,48],[59,123],[45,127],[35,115]], \"#746f68\", \"#56534f\", 1);\n\n // body\n const bodyGrad = ctx.createLinearGradient(-75, -42, 70, 110);\n bodyGrad.addColorStop(0, \"#a19b90\");\n bodyGrad.addColorStop(.48, \"#89857d\");\n bodyGrad.addColorStop(1, \"#686760\");\n ellipse(-1, 23, 79, 63, bodyGrad, \"#55544f\", 1.2);\n\n // shoulder/head\n ellipse(67, 14, 39, 47, \"#89867e\", \"#55534e\", 1.1);\n\n // ear\n const earGrad = ctx.createRadialGradient(73, 11, 3, 73, 13, 38);\n earGrad.addColorStop(0, \"#aaa397\");\n earGrad.addColorStop(1, \"#77746e\");\n ellipse(71, 16, 31, 36, earGrad, \"#5c5a55\", 1);\n\n // front legs\n path([[23,58],[45,57],[47,129],[31,131],[23,117]], \"#817d75\", \"#56534f\", 1);\n path([[-20,60],[3,62],[1,131],[-16,132],[-23,115]], \"#8d8980\", \"#56534f\", 1);\n\n // feet\n ellipse(-8, 130, 15, 5, \"#575650\");\n ellipse(39, 130, 16, 5, \"#56554f\");\n ellipse(-51, 127, 14, 5, \"#575650\");\n ellipse(52, 126, 13, 5, \"#54534e\");\n\n // trunk\n ctx.beginPath();\n ctx.moveTo(91, 24);\n ctx.bezierCurveTo(106, 47, 103, 76, 96, 100);\n ctx.bezierCurveTo(92, 115, 99, 122, 105, 116);\n ctx.bezierCurveTo(99, 132, 84, 126, 84, 111);\n ctx.bezierCurveTo(85, 76, 83, 49, 76, 34);\n ctx.closePath();\n ctx.fillStyle = \"#7d7a73\";\n ctx.fill();\n ctx.strokeStyle = \"#55534e\";\n ctx.lineWidth = 1;\n ctx.stroke();\n\n // tusks\n ctx.fillStyle = \"#e8dfbe\";\n path([[89,47],[108,66],[94,60]], \"#e8dfbe\", \"#bab08f\", .7);\n path([[77,48],[91,69],[81,62]], \"#e8dfbe\", \"#bab08f\", .7);\n\n // eye\n ellipse(85, -1, 2.2, 2.2, \"#242522\");\n ellipse(85.7, -1.6, .6, .6, \"#f3ebd1\");\n\n // tail\n ctx.strokeStyle = \"#5a5751\";\n ctx.lineWidth = 2;\n ctx.beginPath();\n ctx.moveTo(-75, 33);\n ctx.quadraticCurveTo(-94, 76, -86, 94);\n ctx.stroke();\n ellipse(-86, 96, 4, 7, \"#4e4d48\");\n\n // skin wrinkles\n ctx.strokeStyle = \"rgba(65,63,59,.30)\";\n ctx.lineWidth = .65;\n for (let i = 0; i < 17; i++) {\n const yy = rnd(-22, 69);\n ctx.beginPath();\n ctx.moveTo(rnd(-58, 24), yy);\n ctx.quadraticCurveTo(rnd(-10, 58), yy + rnd(-3, 4), rnd(26, 75), yy + rnd(-2, 5));\n ctx.stroke();\n }\n\n // blanket\n path([[-42,-30],[33,-33],[49,15],[-48,17]], \"#a9462f\", \"#58362a\", 1.4);\n path([[-36,-25],[28,-28],[40,9],[-40,11]], \"#d99d42\", null);\n ctx.strokeStyle = \"#f3d87a\";\n ctx.lineWidth = 2;\n ctx.strokeRect(-33, -22, 66, 29);\n for (let i = -24; i < 30; i += 15) {\n ctx.beginPath();\n ctx.moveTo(i, -22); ctx.lineTo(i + 9, 7);\n ctx.stroke();\n }\n\n ctx.restore();\n }\n\n // elephants\n elephant(155, 331, 1.05, 1);\n elephant(364, 340, .96, -1);\n\n function rider(x, y, s, shirt, skin, facing) {\n ctx.save();\n ctx.translate(x, y);\n ctx.scale(s * facing, s);\n\n // legs behind\n path([[-7,43],[7,44],[28,79],[19,83],[-2,59]], \"#354353\", \"#26303a\", 1);\n path([[8,44],[18,45],[2,76],[-8,73],[-2,54]], \"#354353\", \"#26303a\", 1);\n // shoes\n ellipse(23, 81, 9, 3, \"#332c27\");\n ellipse(-7, 75, 8, 3, \"#332c27\");\n\n // torso\n path([[-17,4],[17,4],[22,45],[-15,47],[-22,25]], shirt, \"#4c4036\", 1);\n // scarf collar\n path([[-11,5],[10,4],[5,15],[-8,14]], \"#e3d4ad\", \"#806d54\", .5);\n\n // arm holding rope\n path([[15,12],[22,15],[32,42],[27,45],[15,27]], skin, \"#6d4b35\", .8);\n path([[-16,14],[-22,20],[-10,41],[-4,38],[-8,22]], skin, \"#6d4b35\", .8);\n\n // neck & head\n path([[-5,6],[6,6],[7,-5],[-4,-5]], skin, \"#684631\", .6);\n ellipse(1, -18, 13, 16, skin, \"#55392c\", .8);\n\n // hair / hat\n ctx.fillStyle = \"#433128\";\n ctx.beginPath();\n ctx.arc(0, -22, 13, Math.PI, 0);\n ctx.lineTo(12, -18);\n ctx.lineTo(-12, -18);\n ctx.closePath();\n ctx.fill();\n\n // face\n ellipse(5 * facing, -18, 1.3, 1.4, \"#251c18\");\n ctx.strokeStyle = \"rgba(57,31,24,.75)\";\n ctx.lineWidth = .7;\n ctx.beginPath();\n ctx.moveTo(3, -9); ctx.quadraticCurveTo(7, -7, 10, -9); ctx.stroke();\n\n // reins\n ctx.strokeStyle = \"#5a3925\";\n ctx.lineWidth = 1.2;\n ctx.beginPath();\n ctx.moveTo(29, 42);\n ctx.quadraticCurveTo(48, 51, 54, 66);\n ctx.stroke();\n ctx.restore();\n }\n\n rider(151, 273, 1.05, \"#d8c8a6\", \"#8d6046\", 1);\n rider(369, 289, .95, \"#526a75\", \"#6e4937\", -1);\n\n // foreground grass blades\n for (let i = 0; i < 170; i++) {\n const x = rnd(0, W), y = rnd(456, 512);\n ctx.strokeStyle = Math.random() < .5 ? \"#605124\" : \"#9f813a\";\n ctx.lineWidth = rnd(.5, 1.4);\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.quadraticCurveTo(x + rnd(-5, 5), y - rnd(7, 21), x + rnd(-7, 7), y - rnd(13, 30));\n ctx.stroke();\n }\n\n // warm cinematic overlay\n const vignette = ctx.createRadialGradient(256, 240, 180, 256, 255, 410);\n vignette.addColorStop(0, \"rgba(255,215,140,0)\");\n vignette.addColorStop(1, \"rgba(48,31,15,.22)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0, 0, W, H);\n}"}], "metadata": {"id": "val-v1-coco-train2017-000000297488-251603", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 3676, "code_sha256": "26dfce1e9c3db7a107e0501138020a3edfd793d3906c4b459c5eb04020be9ae9"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A man doing a trick on his skate board."}, {"role": "assistant", "content": "async function render(stage) {\n const canvas = document.createElement(\"canvas\");\n canvas.width = 1024;\n canvas.height = 1024;\n canvas.style.width = \"512px\";\n canvas.style.height = \"512px\";\n canvas.style.display = \"block\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(2, 2);\n\n const W = 512, H = 512;\n const rnd = (() => {\n let s = 928371;\n return () => ((s = (s * 1664525 + 1013904223) >>> 0) / 4294967296);\n })();\n\n function path(points, fill, stroke, lw = 1) {\n ctx.beginPath();\n points.forEach((p, i) => i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]));\n ctx.closePath();\n if (fill) {\n ctx.fillStyle = fill;\n ctx.fill();\n }\n if (stroke) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = lw;\n ctx.stroke();\n }\n }\n\n function line(points, stroke, lw = 1, cap = \"round\") {\n ctx.beginPath();\n points.forEach((p, i) => i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]));\n ctx.strokeStyle = stroke;\n ctx.lineWidth = lw;\n ctx.lineCap = cap;\n ctx.lineJoin = \"round\";\n ctx.stroke();\n }\n\n function ellipse(x, y, rx, ry, fill, rotation = 0) {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rotation);\n ctx.beginPath();\n ctx.ellipse(0, 0, rx, ry, 0, 0, Math.PI * 2);\n ctx.fillStyle = fill;\n ctx.fill();\n ctx.restore();\n }\n\n function gradient(x0, y0, x1, y1, stops) {\n const g = ctx.createLinearGradient(x0, y0, x1, y1);\n stops.forEach(s => g.addColorStop(s[0], s[1]));\n return g;\n }\n\n // sky\n ctx.fillStyle = gradient(0, 0, 0, 286, [\n [0, \"#7195ad\"], [0.42, \"#b4c5cb\"], [1, \"#e4ded2\"]\n ]);\n ctx.fillRect(0, 0, W, 300);\n\n // pale clouds\n for (let i = 0; i < 22; i++) {\n const x = rnd() * 520 - 20;\n const y = 22 + rnd() * 140;\n const r = 18 + rnd() * 52;\n ellipse(x, y, r, r * .18, `rgba(245,247,241,${0.035 + rnd() * .05})`);\n }\n\n // skyline distant\n ctx.fillStyle = \"#87979a\";\n const buildings = [\n [0,200,38,72],[31,182,29,91],[57,210,46,61],[100,167,31,103],\n [128,192,48,78],[174,151,39,121],[210,202,25,70],[232,177,58,95],\n [285,194,37,78],[320,143,42,128],[359,180,52,91],[408,159,30,111],\n [437,198,46,72],[479,177,35,93]\n ];\n buildings.forEach(([x,y,w,h]) => {\n ctx.fillStyle = `rgba(79,94,98,${.34 + rnd() * .18})`;\n ctx.fillRect(x, y, w, h);\n ctx.fillStyle = \"rgba(218,224,214,.20)\";\n for (let yy = y + 10; yy < y + h - 6; yy += 13) {\n for (let xx = x + 6; xx < x + w - 4; xx += 10) {\n if (rnd() > .24) ctx.fillRect(xx, yy, 4, 5);\n }\n }\n });\n\n // trees and fence\n ctx.fillStyle = \"#657c6c\";\n for (let i = 0; i < 16; i++) {\n const x = i * 36 + rnd() * 16;\n ellipse(x, 258 + rnd() * 9, 25 + rnd() * 14, 28 + rnd() * 15, `rgba(53,82,60,${.54 + rnd()*.17})`);\n }\n ctx.fillStyle = \"rgba(48,57,55,.55)\";\n ctx.fillRect(0, 271, 512, 4);\n for (let x = 7; x < 512; x += 18) {\n ctx.fillRect(x, 255, 2, 30);\n line([[x,255],[x+9,247],[x+18,255]], \"rgba(53,62,59,.38)\", 1);\n }\n\n // concrete plaza\n ctx.fillStyle = gradient(0, 281, 0, 512, [\n [0, \"#b7b2a7\"], [1, \"#777873\"]\n ]);\n ctx.fillRect(0, 278, 512, 234);\n\n // ramp and terrain\n path([[0,315],[110,302],[175,318],[175,344],[0,364]], \"#a7a59e\");\n path([[0,315],[110,302],[175,318]], \"rgba(220,217,204,.45)\");\n line([[0,364],[175,344]], \"rgba(67,70,66,.45)\", 2);\n path([[358,310],[512,287],[512,408],[413,391]], \"#999992\");\n path([[358,310],[512,287],[512,301],[369,325]], \"rgba(213,209,197,.48)\");\n line([[358,310],[512,287]], \"rgba(75,76,70,.45)\", 2);\n\n // concrete seams\n line([[0,401],[512,364]], \"rgba(78,80,76,.26)\", 1);\n line([[22,512],[156,352]], \"rgba(85,85,79,.24)\", 1);\n line([[354,512],[312,373]], \"rgba(75,78,73,.18)\", 1);\n line([[437,512],[401,357]], \"rgba(75,78,73,.15)\", 1);\n\n // ground texture\n for (let i = 0; i < 680; i++) {\n const x = rnd() * 512, y = 283 + rnd() * 229;\n const a = .025 + rnd() * .055;\n ctx.fillStyle = `rgba(45,48,44,${a})`;\n ctx.fillRect(x, y, .4 + rnd() * 1.3, .4 + rnd() * 1.2);\n }\n\n // airborne shadow\n ellipse(276, 419, 113, 19, \"rgba(29,30,27,.24)\", -.07);\n ellipse(275, 417, 72, 10, \"rgba(25,26,24,.22)\", -.07);\n\n // subtle board motion blur\n line([[184,333],[358,285]], \"rgba(45,43,39,.11)\", 3);\n line([[194,341],[364,294]], \"rgba(45,43,39,.08)\", 2);\n\n // skateboard underside, rotated kickflip pose\n ctx.save();\n ctx.translate(278, 315);\n ctx.rotate(-0.245);\n ctx.shadowColor = \"rgba(24,23,20,.35)\";\n ctx.shadowBlur = 8;\n ctx.shadowOffsetY = 5;\n const deck = gradient(-90, 0, 90, 0, [\n [0, \"#232526\"], [.12, \"#d4c8aa\"], [.18, \"#313437\"], [.7, \"#1d2023\"], [.9, \"#c7b895\"], [1, \"#26282a\"]\n ]);\n path([[-93,-5],[-85,-11],[-50,-13],[54,-12],[86,-7],[94,0],[85,6],[48,9],[-56,11],[-86,8]], deck, \"#131515\", 1.5);\n ctx.shadowColor = \"transparent\";\n line([[-75,2],[77,-2]], \"rgba(217,209,177,.45)\", 1);\n ctx.fillStyle = \"#b84b36\";\n ctx.fillRect(-30, -10, 48, 3);\n ctx.fillStyle = \"rgba(238,200,91,.75)\";\n ctx.fillRect(19, -9, 25, 3);\n\n // trucks\n ctx.fillStyle = \"#a2a5a2\";\n ctx.fillRect(-52, 6, 20, 4);\n ctx.fillRect(41, 3, 20, 4);\n line([[-42,7],[-50,16]], \"#686c69\", 3);\n line([[51,5],[58,14]], \"#686c69\", 3);\n ellipse(-53, 17, 7, 5, \"#d5d2c2\");\n ellipse(-33, 13, 7, 5, \"#d5d2c2\");\n ellipse(55, 15, 7, 5, \"#d5d2c2\");\n ellipse(72, 10, 7, 5, \"#d5d2c2\");\n ctx.restore();\n\n // body shadowy rear leg: hip -> bent knee -> rear foot\n path([[267,228],[285,234],[306,279],[297,294],[278,280],[257,247]], \"#4b4e4c\", \"#303231\", 1);\n path([[301,277],[313,280],[349,300],[347,312],[334,313],[295,294]], \"#454846\", \"#2d302e\", 1);\n // rear shoe\n path([[337,302],[356,305],[365,313],[360,320],[341,318],[331,311]], \"#202322\", \"#111312\", 1);\n line([[340,311],[358,314]], \"#dedbd0\", 1.4);\n\n // torso, shirt folds\n path([[231,152],[252,142],[279,154],[291,196],[278,236],[251,244],[228,221],[220,179]], \"#252b2c\", \"#182022\", 1.2);\n path([[232,155],[244,160],[238,215],[250,237],[228,221],[220,180]], \"#1c2224\");\n path([[271,156],[283,176],[277,224],[263,239],[267,192]], \"#30383a\");\n line([[238,174],[267,190],[278,212]], \"rgba(136,145,140,.26)\", 1);\n line([[233,208],[265,220]], \"rgba(9,13,15,.38)\", 1.3);\n\n // front arm thrown outward\n path([[228,162],[219,164],[194,201],[185,226],[194,231],[208,211],[239,181]], \"#b47555\", \"#623b2d\", 1);\n path([[187,224],[179,238],[181,247],[188,247],[195,232]], \"#b77a58\", \"#633d2e\", .8);\n // fingers\n line([[181,244],[173,251]], \"#8a5740\", 1.4);\n line([[184,246],[179,254]], \"#8a5740\", 1.3);\n line([[188,246],[185,254]], \"#8a5740\", 1.2);\n\n // farther arm\n path([[277,160],[286,165],[307,188],[326,197],[325,207],[310,204],[280,184]], \"#9d6046\", \"#58362b\", 1);\n path([[323,196],[337,200],[343,207],[338,214],[326,208]], \"#ad6c4f\", \"#59392c\", .8);\n line([[337,205],[348,209]], \"#764936\", 1);\n line([[336,209],[345,215]], \"#764936\", 1);\n\n // pants / front raised leg\n path([[250,231],[272,231],[263,267],[240,292],[225,285],[234,254]], \"#59615e\", \"#303635\", 1.1);\n path([[239,288],[253,296],[285,281],[302,266],[313,273],[301,291],[260,315],[237,307],[222,294]], \"#535b59\", \"#303534\", 1.1);\n // jeans shading\n path([[252,236],[263,239],[251,274],[238,288],[232,282]], \"rgba(155,163,154,.28)\");\n line([[236,294],[251,301],[278,289]], \"rgba(22,28,28,.52)\", 1.3);\n line([[259,239],[251,265]], \"rgba(191,193,181,.24)\", 1);\n\n // front sneaker near deck\n path([[281,280],[300,269],[315,275],[318,284],[303,292],[282,295],[274,289]], \"#252827\", \"#111514\", 1);\n path([[281,286],[301,282],[314,279]], \"#ddd8c9\", 2);\n line([[292,277],[300,285]], \"rgba(225,221,209,.75)\", 1);\n line([[299,273],[306,281]], \"rgba(225,221,209,.65)\", 1);\n\n // neck\n path([[246,147],[262,145],[265,159],[254,167],[244,159]], \"#a9664a\", \"#623c2e\", .8);\n\n // head\n ellipse(250, 128, 19, 23, \"#b87354\", -.18);\n // jaw and ear\n ellipse(268, 132, 4.4, 6.4, \"#aa684c\", -.12);\n path([[239,134],[243,148],[253,151],[263,143],[266,128],[259,111],[244,111],[234,119]], \"#b97454\");\n // face shadows\n path([[254,116],[265,126],[261,139],[255,142],[257,129]], \"rgba(88,48,37,.30)\");\n ellipse(257, 127, 1.6, 1.1, \"#2a2521\");\n line([[257,140],[262,140]], \"rgba(93,45,34,.75)\", 1);\n\n // hair and cap\n path([[234,121],[237,109],[248,102],[262,105],[270,116],[263,119],[252,113],[241,119]], \"#171b1b\");\n path([[231,113],[244,101],[261,103],[269,112],[264,118],[246,112],[235,120]], \"#293236\", \"#182022\", 1);\n path([[230,113],[208,116],[207,120],[237,120]], \"#252e31\", \"#172023\", 1);\n\n // shirt collar\n path([[243,151],[253,159],[261,151],[265,156],[254,168],[241,158]], \"#151b1c\");\n\n // foreground specks\n for (let i = 0; i < 50; i++) {\n const x = rnd() * 512, y = 400 + rnd() * 112;\n ctx.fillStyle = `rgba(233,226,209,${.04 + rnd()*.08})`;\n ctx.fillRect(x, y, 1 + rnd() * 2, .5 + rnd());\n }\n\n // vignette\n const v = ctx.createRadialGradient(255, 245, 180, 255, 255, 410);\n v.addColorStop(0, \"rgba(0,0,0,0)\");\n v.addColorStop(1, \"rgba(18,25,27,.22)\");\n ctx.fillStyle = v;\n ctx.fillRect(0, 0, 512, 512);\n}"}], "metadata": {"id": "val-v1-coco-train2017-000000346011-649200", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 5310, "code_sha256": "4b08385800975c0b71be01a72580f0e42cd62e56ba474d74c9c878bf8dbc1778"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A plate of food consisting of meat, potatoes and broccoli with a knife and fork next to it."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n const canvas = document.createElement(\"canvas\");\n const dpr = Math.max(1, window.devicePixelRatio || 1);\n canvas.width = canvas.height = 512 * dpr;\n canvas.style.width = canvas.style.height = \"512px\";\n canvas.style.display = \"block\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(dpr, dpr);\n\n let seed = 73491;\n const rnd = () => {\n seed = (seed * 1664525 + 1013904223) >>> 0;\n return seed / 4294967296;\n };\n\n const ellipse = (x, y, rx, ry, fill, stroke, lw = 1) => {\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n if (fill) {\n ctx.fillStyle = fill;\n ctx.fill();\n }\n if (stroke) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = lw;\n ctx.stroke();\n }\n };\n\n const path = (points, fill, stroke, lw = 1) => {\n ctx.beginPath();\n ctx.moveTo(points[0][0], points[0][1]);\n for (let i = 1; i < points.length; i++) ctx.lineTo(points[i][0], points[i][1]);\n ctx.closePath();\n if (fill) {\n ctx.fillStyle = fill;\n ctx.fill();\n }\n if (stroke) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = lw;\n ctx.stroke();\n }\n };\n\n const bg = ctx.createLinearGradient(0, 0, 512, 512);\n bg.addColorStop(0, \"#34383a\");\n bg.addColorStop(0.45, \"#24282a\");\n bg.addColorStop(1, \"#171a1c\");\n ctx.fillStyle = bg;\n ctx.fillRect(0, 0, 512, 512);\n\n for (let i = 0; i < 1600; i++) {\n const a = rnd() * 0.09;\n ctx.fillStyle = rnd() > 0.5 ? `rgba(255,255,255,${a})` : `rgba(0,0,0,${a})`;\n ctx.fillRect(rnd() * 512, rnd() * 512, rnd() * 2 + 0.3, 0.45);\n }\n\n ctx.strokeStyle = \"rgba(255,255,255,.035)\";\n ctx.lineWidth = 1;\n for (let y = 22; y < 512; y += 30) {\n ctx.beginPath();\n ctx.moveTo(0, y + rnd() * 3);\n ctx.lineTo(512, y - 4 + rnd() * 6);\n ctx.stroke();\n }\n\n ctx.save();\n ctx.translate(91, 293);\n ctx.rotate(-0.1);\n ctx.shadowColor = \"rgba(0,0,0,.65)\";\n ctx.shadowBlur = 12;\n ctx.shadowOffsetY = 8;\n let metal = ctx.createLinearGradient(-20, 0, 28, 0);\n metal.addColorStop(0, \"#5e676b\");\n metal.addColorStop(0.18, \"#dce1df\");\n metal.addColorStop(0.42, \"#7d898c\");\n metal.addColorStop(0.62, \"#f5f6f0\");\n metal.addColorStop(1, \"#596367\");\n ctx.fillStyle = metal;\n ctx.beginPath();\n ctx.roundRect(-8, -3, 17, 185, 8);\n ctx.fill();\n ctx.shadowColor = \"transparent\";\n\n ctx.fillStyle = metal;\n ctx.beginPath();\n ctx.moveTo(-23, -51);\n ctx.quadraticCurveTo(-20, -78, -9, -83);\n ctx.lineTo(11, -83);\n ctx.quadraticCurveTo(24, -77, 25, -53);\n ctx.lineTo(21, -9);\n ctx.quadraticCurveTo(18, 3, 4, 4);\n ctx.lineTo(-7, 3);\n ctx.quadraticCurveTo(-20, 2, -22, -10);\n ctx.closePath();\n ctx.fill();\n\n ctx.fillStyle = \"#2e373a\";\n for (const x of [-13, -5, 4, 13]) {\n ctx.beginPath();\n ctx.roundRect(x, -80, 4, 52, 2);\n ctx.fill();\n }\n ctx.fillStyle = \"rgba(255,255,255,.37)\";\n ctx.fillRect(-4, 12, 2, 143);\n ctx.restore();\n\n ctx.save();\n ctx.translate(423, 292);\n ctx.rotate(0.11);\n ctx.shadowColor = \"rgba(0,0,0,.65)\";\n ctx.shadowBlur = 12;\n ctx.shadowOffsetY = 8;\n let knife = ctx.createLinearGradient(-21, 0, 25, 0);\n knife.addColorStop(0, \"#596367\");\n knife.addColorStop(.2, \"#e8edec\");\n knife.addColorStop(.48, \"#8e989b\");\n knife.addColorStop(.68, \"#f8f8f4\");\n knife.addColorStop(1, \"#626b6e\");\n ctx.fillStyle = knife;\n ctx.beginPath();\n ctx.roundRect(-7, -2, 15, 183, 7);\n ctx.fill();\n ctx.beginPath();\n ctx.moveTo(-9, -7);\n ctx.lineTo(-19, -79);\n ctx.quadraticCurveTo(-11, -89, 6, -82);\n ctx.lineTo(17, -20);\n ctx.quadraticCurveTo(19, -7, 7, 0);\n ctx.closePath();\n ctx.fill();\n ctx.shadowColor = \"transparent\";\n ctx.strokeStyle = \"rgba(45,55,58,.55)\";\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.moveTo(-9, -7);\n ctx.lineTo(-19, -79);\n ctx.stroke();\n ctx.fillStyle = \"rgba(255,255,255,.42)\";\n ctx.fillRect(-2, 13, 2, 142);\n ctx.restore();\n\n ctx.shadowColor = \"rgba(0,0,0,.7)\";\n ctx.shadowBlur = 22;\n ctx.shadowOffsetY = 13;\n ellipse(256, 285, 177, 157, \"rgba(0,0,0,.7)\");\n ctx.shadowColor = \"transparent\";\n\n let rim = ctx.createRadialGradient(235, 245, 38, 255, 280, 194);\n rim.addColorStop(0, \"#fcfcf8\");\n rim.addColorStop(.72, \"#f1f0e9\");\n rim.addColorStop(.9, \"#d6d5cf\");\n rim.addColorStop(1, \"#a9aaa7\");\n ellipse(256, 270, 181, 164, rim, \"#e8e7df\", 1);\n\n ellipse(256, 270, 159, 142, \"#f9f8f2\", \"rgba(178,177,169,.58)\", 1.4);\n ellipse(256, 270, 151, 134, \"#f7f6ef\", \"rgba(255,255,255,.8)\", 1);\n\n const broccoli = (x, y, s) => {\n ctx.save();\n ctx.translate(x, y);\n ctx.scale(s, s);\n ctx.strokeStyle = \"#4c6828\";\n ctx.lineWidth = 8;\n ctx.lineCap = \"round\";\n ctx.beginPath();\n ctx.moveTo(0, 15);\n ctx.lineTo(-4, 36);\n ctx.moveTo(-2, 25);\n ctx.lineTo(-18, 8);\n ctx.moveTo(-1, 22);\n ctx.lineTo(18, 4);\n ctx.stroke();\n\n const florets = [\n [-18, -7, 13], [-4, -17, 15], [13, -13, 15], [24, -2, 12],\n [-29, 4, 12], [-15, 9, 15], [2, 3, 17], [16, 10, 14], [-2, 18, 13]\n ];\n for (const [fx, fy, r] of florets) {\n const g = ctx.createRadialGradient(fx - 4, fy - 5, 2, fx, fy, r);\n g.addColorStop(0, \"#a8bd43\");\n g.addColorStop(.33, \"#668b2e\");\n g.addColorStop(1, \"#294d22\");\n ellipse(fx, fy, r, r * .82, g, \"#345523\", 1);\n ctx.fillStyle = \"rgba(209,222,99,.24)\";\n for (let i = 0; i < 6; i++) {\n ellipse(fx - r * .45 + rnd() * r * .9, fy - r * .4 + rnd() * r * .7, 1.4, 1.4, \"rgba(201,220,86,.32)\");\n }\n }\n ctx.restore();\n };\n\n broccoli(329, 184, 1.03);\n broccoli(365, 212, .92);\n broccoli(317, 225, .83);\n\n const potato = (x, y, rx, ry, rot) => {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rot);\n ctx.shadowColor = \"rgba(77,47,13,.25)\";\n ctx.shadowBlur = 5;\n ctx.shadowOffsetY = 3;\n const p = ctx.createRadialGradient(-rx * .24, -ry * .35, 3, 0, 0, rx);\n p.addColorStop(0, \"#fff2a9\");\n p.addColorStop(.5, \"#e5bb55\");\n p.addColorStop(1, \"#a46a20\");\n ellipse(0, 0, rx, ry, p, \"#99601c\", 1);\n ctx.shadowColor = \"transparent\";\n ctx.strokeStyle = \"rgba(255,241,157,.72)\";\n ctx.lineWidth = 2;\n ctx.beginPath();\n ctx.arc(-4, -2, Math.min(rx, ry) * .55, 3.7, 5.8);\n ctx.stroke();\n for (let i = 0; i < 8; i++) {\n ellipse((rnd() - .5) * rx * 1.1, (rnd() - .5) * ry * 1.05, 1.2, .9, \"rgba(115,69,19,.38)\");\n }\n ctx.restore();\n };\n\n potato(181, 192, 32, 23, -.24);\n potato(221, 179, 30, 22, .19);\n potato(251, 200, 31, 23, -.13);\n potato(203, 223, 33, 24, .13);\n potato(252, 233, 30, 22, -.26);\n potato(165, 237, 26, 20, -.1);\n\n ctx.save();\n ctx.translate(253, 302);\n ctx.rotate(-.08);\n ctx.shadowColor = \"rgba(56,22,7,.45)\";\n ctx.shadowBlur = 10;\n ctx.shadowOffsetY = 6;\n const meat = ctx.createRadialGradient(-25, -28, 10, 0, 0, 104);\n meat.addColorStop(0, \"#a84c20\");\n meat.addColorStop(.37, \"#733017\");\n meat.addColorStop(.76, \"#4a1c0d\");\n meat.addColorStop(1, \"#28140b\");\n ctx.beginPath();\n ctx.moveTo(-107, -13);\n ctx.bezierCurveTo(-99, -61, -55, -82, -10, -74);\n ctx.bezierCurveTo(31, -91, 94, -61, 104, -18);\n ctx.bezierCurveTo(109, 17, 80, 62, 35, 74);\n ctx.bezierCurveTo(-3, 87, -65, 68, -94, 35);\n ctx.bezierCurveTo(-111, 15, -111, 1, -107, -13);\n ctx.closePath();\n ctx.fillStyle = meat;\n ctx.fill();\n ctx.shadowColor = \"transparent\";\n ctx.strokeStyle = \"#35150b\";\n ctx.lineWidth = 3;\n ctx.stroke();\n\n ctx.save();\n ctx.clip();\n for (let i = 0; i < 20; i++) {\n const x = -93 + i * 10 + rnd() * 8;\n ctx.strokeStyle = i % 3 === 0 ? \"rgba(236,133,56,.38)\" : \"rgba(31,10,4,.46)\";\n ctx.lineWidth = 3 + rnd() * 2;\n ctx.beginPath();\n ctx.moveTo(x, -63);\n ctx.bezierCurveTo(x - 17, -28, x + 13, 9, x - 3, 64);\n ctx.stroke();\n }\n for (let i = 0; i < 36; i++) {\n ellipse(-88 + rnd() * 176, -63 + rnd() * 129, 1 + rnd() * 2.2, 1 + rnd() * 1.4,\n rnd() > .45 ? \"rgba(246,156,70,.38)\" : \"rgba(41,13,6,.5)\");\n }\n\n ctx.strokeStyle = \"rgba(255,188,91,.48)\";\n ctx.lineWidth = 3;\n ctx.beginPath();\n ctx.moveTo(-75, -30);\n ctx.bezierCurveTo(-38, -47, 29, -49, 76, -27);\n ctx.moveTo(-81, 6);\n ctx.bezierCurveTo(-42, -10, 31, -8, 91, 13);\n ctx.moveTo(-55, 39);\n ctx.bezierCurveTo(-14, 27, 35, 31, 65, 45);\n ctx.stroke();\n ctx.restore();\n\n const shine = ctx.createLinearGradient(-70, -55, 44, 55);\n shine.addColorStop(0, \"rgba(255,189,95,.34)\");\n shine.addColorStop(.35, \"rgba(255,180,77,.06)\");\n shine.addColorStop(1, \"rgba(0,0,0,0)\");\n ctx.fillStyle = shine;\n ctx.beginPath();\n ctx.ellipse(-18, -25, 66, 34, -.25, 0, Math.PI * 2);\n ctx.fill();\n ctx.restore();\n\n ctx.fillStyle = \"rgba(255,255,255,.34)\";\n ellipse(181, 122, 32, 8, \"rgba(255,255,255,.23)\");\n ellipse(236, 115, 48, 7, \"rgba(255,255,255,.18)\");\n}"}], "metadata": {"id": "val-v1-coco-train2017-000000367896-480758", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 4284, "code_sha256": "47ce170ed6dfe52734a7b321842d4f5f717560cbf5064ade988c498f93aa58c2"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "three teal mushrooms"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = `\n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n\n \n `;\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-0007", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 5095, "code_sha256": "ba31259a1bac77393df9595d5661f6369e1dfb8736a24f5d8c156b4bc7febdcf"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "two yellow candles and three black ostriches"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.position = \"relative\";\n stage.style.overflow = \"hidden\";\n stage.style.background = \"#151310\";\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = 512;\n canvas.style.width = canvas.style.height = \"512px\";\n canvas.style.display = \"block\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n const W = 512, H = 512;\n\n function rnd(seed) {\n let x = Math.sin(seed * 999.91) * 43758.5453;\n return x - Math.floor(x);\n }\n function ellipse(x, y, rx, ry, fill, rot = 0) {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rot);\n ctx.beginPath();\n ctx.ellipse(0, 0, rx, ry, 0, 0, Math.PI * 2);\n ctx.fillStyle = fill;\n ctx.fill();\n ctx.restore();\n }\n function path(points, fill, stroke, lw = 1) {\n ctx.beginPath();\n points.forEach((p, i) => i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]));\n ctx.closePath();\n if (fill) {\n ctx.fillStyle = fill;\n ctx.fill();\n }\n if (stroke) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = lw;\n ctx.stroke();\n }\n }\n function glow(x, y, radius, color) {\n const g = ctx.createRadialGradient(x, y, 1, x, y, radius);\n g.addColorStop(0, color);\n g.addColorStop(0.3, color.replace(\"0.9\", \"0.25\"));\n g.addColorStop(1, \"rgba(0,0,0,0)\");\n ctx.fillStyle = g;\n ctx.fillRect(x - radius, y - radius, radius * 2, radius * 2);\n }\n\n // atmospheric background\n let bg = ctx.createLinearGradient(0, 0, 0, H);\n bg.addColorStop(0, \"#0b0c0d\");\n bg.addColorStop(0.48, \"#25201a\");\n bg.addColorStop(1, \"#090909\");\n ctx.fillStyle = bg;\n ctx.fillRect(0, 0, W, H);\n\n for (let i = 0; i < 90; i++) {\n const x = rnd(i + 10) * W, y = rnd(i + 80) * H;\n const r = 10 + rnd(i + 120) * 45;\n glow(x, y, r, `rgba(92,69,41,${0.018 + rnd(i) * .03})`);\n }\n\n // warm floor\n let floor = ctx.createLinearGradient(0, 360, 0, 512);\n floor.addColorStop(0, \"rgba(50,36,23,.1)\");\n floor.addColorStop(1, \"rgba(7,7,7,.9)\");\n ctx.fillStyle = floor;\n ctx.fillRect(0, 350, W, 162);\n\n function ostrich(cx, baseY, scale, direction, index) {\n ctx.save();\n ctx.translate(cx, baseY);\n ctx.scale(scale, scale);\n\n // legs, behind body\n ctx.strokeStyle = \"#342a23\";\n ctx.lineCap = \"round\";\n ctx.lineWidth = 5.5;\n ctx.beginPath();\n ctx.moveTo(-13, -97); ctx.bezierCurveTo(-18, -48, -20, -22, -24, 3);\n ctx.moveTo(14, -99); ctx.bezierCurveTo(19, -48, 18, -21, 25, 3);\n ctx.stroke();\n ctx.strokeStyle = \"#171312\";\n ctx.lineWidth = 3;\n ctx.beginPath();\n ctx.moveTo(-24, 2); ctx.lineTo(-39, 6); ctx.moveTo(25, 2); ctx.lineTo(40, 5);\n ctx.stroke();\n\n // distant feather halo\n for (let i = 0; i < 65; i++) {\n const a = (i / 65) * Math.PI * 2;\n const rr = 34 + rnd(i + index * 37) * 18;\n const ex = Math.cos(a) * rr;\n const ey = -88 + Math.sin(a) * (34 + rnd(i + 2) * 14);\n ctx.strokeStyle = `rgba(${20 + Math.floor(rnd(i+4)*16)},${19 + Math.floor(rnd(i+8)*12)},${18 + Math.floor(rnd(i+11)*10)},.75)`;\n ctx.lineWidth = 1.5 + rnd(i + 3) * 2;\n ctx.beginPath();\n ctx.moveTo(Math.cos(a) * 20, -88 + Math.sin(a) * 16);\n ctx.quadraticCurveTo(Math.cos(a) * rr * .8, -88 + Math.sin(a) * 30, ex, ey);\n ctx.stroke();\n }\n\n // body\n let body = ctx.createRadialGradient(-12, -108, 5, 0, -82, 64);\n body.addColorStop(0, \"#4a433d\");\n body.addColorStop(.22, \"#211f1d\");\n body.addColorStop(.66, \"#0c0c0d\");\n body.addColorStop(1, \"#030304\");\n ellipse(0, -85, 53, 46, body, -0.05);\n\n // individual matte black feathers\n for (let i = 0; i < 115; i++) {\n let a = rnd(i * 7 + index * 70) * Math.PI * 2;\n let rr = Math.sqrt(rnd(i * 3 + 5)) * 48;\n let x = Math.cos(a) * rr * .98;\n let y = -85 + Math.sin(a) * rr * .72;\n let len = 8 + rnd(i + 88) * 19;\n ctx.strokeStyle = `rgba(${24 + Math.floor(rnd(i+1)*27)},${23 + Math.floor(rnd(i+2)*25)},${22 + Math.floor(rnd(i+3)*23)},${.24 + rnd(i+9)*.32})`;\n ctx.lineWidth = .7 + rnd(i + 30) * 1.7;\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.quadraticCurveTo(x + Math.cos(a) * len * .3, y + Math.sin(a) * len * .45, x + Math.cos(a) * len, y + Math.sin(a) * len);\n ctx.stroke();\n }\n\n // neck\n ctx.save();\n ctx.rotate(direction * 0.025);\n let neck = ctx.createLinearGradient(-12, -230, 18, -110);\n neck.addColorStop(0, \"#61584c\");\n neck.addColorStop(.25, \"#302b27\");\n neck.addColorStop(.7, \"#171616\");\n neck.addColorStop(1, \"#0b0b0b\");\n ctx.strokeStyle = neck;\n ctx.lineWidth = 18;\n ctx.lineCap = \"round\";\n ctx.beginPath();\n ctx.moveTo(0, -116);\n ctx.bezierCurveTo(-4 * direction, -144, 5 * direction, -174, 2 * direction, -203);\n ctx.stroke();\n ctx.strokeStyle = \"rgba(186,159,119,.2)\";\n ctx.lineWidth = 2.2;\n ctx.beginPath();\n ctx.moveTo(-5, -119); ctx.bezierCurveTo(-8 * direction, -151, -1 * direction, -179, -4 * direction, -204);\n ctx.stroke();\n\n // head\n ellipse(2 * direction, -217, 15, 19, \"#201e1b\", direction * .15);\n ellipse(-1 * direction, -220, 9, 13, \"#433d34\", direction * .12);\n // beak\n path([\n [10 * direction, -221],\n [28 * direction, -217],\n [31 * direction, -211],\n [10 * direction, -211]\n ], \"#82775d\", \"#261f19\", 1);\n // eye\n ellipse(7 * direction, -224, 3.2, 3.2, \"#0a0806\");\n ellipse(6.1 * direction, -225.2, 1, 1, \"#e4b454\");\n // head feathers\n for (let i = 0; i < 10; i++) {\n ctx.strokeStyle = \"#181716\";\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.moveTo(-5 * direction, -228);\n ctx.lineTo((-10 - i * 2) * direction, -235 - rnd(i) * 9);\n ctx.stroke();\n }\n ctx.restore();\n ctx.restore();\n }\n\n // back to front birds\n ostrich(110, 365, .72, 1, 1);\n ostrich(391, 370, .78, -1, 2);\n ostrich(258, 391, 1.02, 1, 3);\n\n // pooled candle illumination\n glow(178, 388, 135, \"rgba(255,166,36,0.23)\");\n glow(328, 398, 150, \"rgba(255,158,30,0.22)\");\n\n function candle(x, bottom, width, height, seed) {\n // shadow\n ctx.save();\n ctx.filter = \"blur(8px)\";\n ellipse(x + 15, bottom + 2, width * 1.25, 8, \"rgba(0,0,0,.55)\");\n ctx.restore();\n\n // candle body\n const top = bottom - height;\n let wax = ctx.createLinearGradient(x - width / 2, 0, x + width / 2, 0);\n wax.addColorStop(0, \"#99620d\");\n wax.addColorStop(.17, \"#e5a71e\");\n wax.addColorStop(.5, \"#ffd65a\");\n wax.addColorStop(.75, \"#e7a51b\");\n wax.addColorStop(1, \"#875207\");\n ctx.fillStyle = wax;\n ctx.beginPath();\n ctx.moveTo(x - width / 2, top + 5);\n ctx.lineTo(x + width / 2, top + 5);\n ctx.lineTo(x + width / 2 - 2, bottom);\n ctx.quadraticCurveTo(x, bottom + 4, x - width / 2 + 2, bottom);\n ctx.closePath();\n ctx.fill();\n\n // wax ridges\n for (let i = 0; i < 12; i++) {\n let yy = top + 15 + rnd(seed + i) * (height - 25);\n ctx.strokeStyle = `rgba(112,61,5,${.09 + rnd(i)*.13})`;\n ctx.lineWidth = 1 + rnd(i + 9) * 2;\n ctx.beginPath();\n ctx.moveTo(x - width / 2 + 3, yy);\n ctx.bezierCurveTo(x - width * .2, yy + 2, x + width * .15, yy - 2, x + width / 2 - 3, yy + 1);\n ctx.stroke();\n }\n\n // top wax rim\n ellipse(x, top + 5, width / 2, 6, \"#f5be37\");\n ellipse(x, top + 5, width / 2 - 5, 3.7, \"#9e620d\");\n ellipse(x - 2, top + 4, width / 2 - 8, 2.2, \"#4c2b0b\");\n\n // melted drip\n ctx.fillStyle = \"#e9aa1b\";\n ctx.beginPath();\n ctx.moveTo(x + width * .23, top + 5);\n ctx.bezierCurveTo(x + width * .28, top + 15, x + width * .2, top + 28, x + width * .09, top + 25);\n ctx.lineTo(x + width * .07, top + 7);\n ctx.fill();\n\n // wick\n ctx.strokeStyle = \"#251609\";\n ctx.lineWidth = 2;\n ctx.beginPath();\n ctx.moveTo(x, top + 4); ctx.quadraticCurveTo(x + 2, top - 5, x + 1, top - 9);\n ctx.stroke();\n\n // flame glow\n glow(x, top - 21, 47, \"rgba(255,172,42,0.48)\");\n let flame = ctx.createRadialGradient(x - 1, top - 19, 1, x, top - 19, 14);\n flame.addColorStop(0, \"#fff8bf\");\n flame.addColorStop(.22, \"#ffe676\");\n flame.addColorStop(.58, \"#ffae16\");\n flame.addColorStop(1, \"rgba(255,117,5,0)\");\n ctx.fillStyle = flame;\n ctx.beginPath();\n ctx.moveTo(x, top - 42);\n ctx.bezierCurveTo(x - 12, top - 27, x - 8, top - 14, x, top - 8);\n ctx.bezierCurveTo(x + 10, top - 18, x + 10, top - 30, x, top - 42);\n ctx.fill();\n ellipse(x, top - 20, 3.5, 8, \"#fff6a4\");\n }\n\n candle(170, 475, 58, 164, 41);\n candle(332, 478, 65, 126, 73);\n\n // foreground dark edge\n let vignette = ctx.createRadialGradient(256, 260, 180, 256, 256, 400);\n vignette.addColorStop(.55, \"rgba(0,0,0,0)\");\n vignette.addColorStop(1, \"rgba(0,0,0,.5)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0, 0, W, H);\n\n // subtle film grain\n const img = ctx.getImageData(0, 0, W, H);\n for (let i = 0; i < img.data.length; i += 4) {\n const n = (Math.random() - .5) * 5;\n img.data[i] += n;\n img.data[i + 1] += n;\n img.data[i + 2] += n;\n }\n ctx.putImageData(img, 0, 0);\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-0079", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 3929, "code_sha256": "d40f1703b6e849ed10d8e95be90be556f67d76f27a982b973ae153072afe7bf0"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "a pink bus to the left of a gold snowboard"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;overflow:hidden;position:relative;background:#e9e5dd;\";\n \n const canvas = document.createElement(\"canvas\");\n const dpr = Math.min(window.devicePixelRatio || 1, 2);\n canvas.width = 512 * dpr;\n canvas.height = 512 * dpr;\n canvas.style.cssText = \"width:512px;height:512px;display:block;\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(dpr, dpr);\n\n const W = 512, H = 512;\n const rr = (x, y, w, h, r) => {\n ctx.beginPath();\n ctx.moveTo(x + r, y);\n ctx.arcTo(x + w, y, x + w, y + h, r);\n ctx.arcTo(x + w, y + h, x, y + h, r);\n ctx.arcTo(x, y + h, x, y, r);\n ctx.arcTo(x, y, x + w, y, r);\n ctx.closePath();\n };\n\n // Background\n const bg = ctx.createLinearGradient(0, 0, 0, H);\n bg.addColorStop(0, \"#faf9f5\");\n bg.addColorStop(.62, \"#e9e4dc\");\n bg.addColorStop(.63, \"#d4cec5\");\n bg.addColorStop(1, \"#b7aea4\");\n ctx.fillStyle = bg;\n ctx.fillRect(0, 0, W, H);\n\n // Soft wall texture\n for (let i = 0; i < 850; i++) {\n const x = Math.random() * W, y = Math.random() * 330;\n ctx.fillStyle = `rgba(105,92,76,${Math.random() * .025})`;\n ctx.fillRect(x, y, Math.random() * 2, Math.random() * 2);\n }\n\n // Horizon / floor\n ctx.fillStyle = \"rgba(130,119,108,.12)\";\n ctx.fillRect(0, 331, W, 2);\n const floor = ctx.createLinearGradient(0, 330, 0, H);\n floor.addColorStop(0, \"rgba(255,255,255,.18)\");\n floor.addColorStop(1, \"rgba(104,94,84,.15)\");\n ctx.fillStyle = floor;\n ctx.fillRect(0, 332, W, 180);\n\n // Ground shadows\n ctx.save();\n ctx.filter = \"blur(14px)\";\n ctx.fillStyle = \"rgba(45,33,31,.23)\";\n ctx.beginPath();\n ctx.ellipse(161, 399, 142, 20, -.05, 0, Math.PI * 2);\n ctx.fill();\n ctx.beginPath();\n ctx.ellipse(390, 443, 48, 13, -.17, 0, Math.PI * 2);\n ctx.fill();\n ctx.restore();\n\n // BUS main silhouette\n ctx.save();\n ctx.translate(27, 0);\n\n // Bus body outer dark edge\n ctx.shadowColor = \"rgba(67,25,42,.33)\";\n ctx.shadowBlur = 8;\n ctx.shadowOffsetY = 5;\n rr(9, 177, 278, 191, 25);\n ctx.fillStyle = \"#8c294f\";\n ctx.fill();\n ctx.shadowColor = \"transparent\";\n\n // body paint\n const busPaint = ctx.createLinearGradient(0, 175, 0, 371);\n busPaint.addColorStop(0, \"#ff89ad\");\n busPaint.addColorStop(.32, \"#ef638f\");\n busPaint.addColorStop(.72, \"#dc416e\");\n busPaint.addColorStop(1, \"#a92954\");\n rr(12, 174, 273, 190, 23);\n ctx.fillStyle = busPaint;\n ctx.fill();\n\n // Roof shine\n ctx.beginPath();\n ctx.moveTo(33, 175);\n ctx.lineTo(259, 175);\n ctx.quadraticCurveTo(278, 177, 283, 199);\n ctx.lineTo(283, 211);\n ctx.lineTo(18, 211);\n ctx.lineTo(18, 196);\n ctx.quadraticCurveTo(20, 180, 33, 175);\n ctx.fillStyle = \"rgba(255,230,239,.55)\";\n ctx.fill();\n\n // upper window housing\n rr(24, 204, 249, 83, 10);\n ctx.fillStyle = \"#7c294a\";\n ctx.fill();\n\n // Windows\n const windows = [\n [30, 210, 49, 68, 5],\n [85, 210, 48, 68, 4],\n [139, 210, 48, 68, 4],\n [193, 210, 37, 68, 4],\n [236, 210, 31, 68, 4]\n ];\n windows.forEach(([x,y,w,h,r], idx) => {\n rr(x, y, w, h, r);\n const glass = ctx.createLinearGradient(x, y, x + w, y + h);\n glass.addColorStop(0, \"#daf2f4\");\n glass.addColorStop(.28, \"#739aaf\");\n glass.addColorStop(.6, \"#264c65\");\n glass.addColorStop(1, \"#183649\");\n ctx.fillStyle = glass;\n ctx.fill();\n ctx.save();\n rr(x+2, y+2, w-4, h-4, Math.max(2,r-1));\n ctx.clip();\n ctx.fillStyle = \"rgba(255,255,255,.32)\";\n ctx.beginPath();\n ctx.moveTo(x - 5, y + 15);\n ctx.lineTo(x + w + 5, y + 2);\n ctx.lineTo(x + w + 5, y + 15);\n ctx.lineTo(x - 5, y + 28);\n ctx.fill();\n ctx.fillStyle = \"rgba(215,245,246,.11)\";\n ctx.fillRect(x + 6, y + 34, w - 12, 28);\n ctx.restore();\n ctx.strokeStyle = \"rgba(255,210,224,.35)\";\n ctx.lineWidth = 1;\n rr(x, y, w, h, r);\n ctx.stroke();\n });\n\n // Front windscreen distinction and mirror\n ctx.fillStyle = \"rgba(245,143,178,.7)\";\n ctx.fillRect(230, 204, 5, 82);\n ctx.strokeStyle = \"#86284e\";\n ctx.lineWidth = 3;\n ctx.beginPath();\n ctx.moveTo(281, 232);\n ctx.lineTo(298, 226);\n ctx.lineTo(299, 243);\n ctx.lineTo(284, 246);\n ctx.stroke();\n rr(296, 222, 12, 20, 4);\n ctx.fillStyle = \"#f575a1\";\n ctx.fill();\n ctx.fillStyle = \"#294658\";\n rr(298, 224, 8, 13, 2);\n ctx.fill();\n\n // Main lower panel\n const lower = ctx.createLinearGradient(0, 286, 0, 361);\n lower.addColorStop(0, \"#f26994\");\n lower.addColorStop(.75, \"#db3c6a\");\n lower.addColorStop(1, \"#ad2752\");\n rr(16, 286, 267, 76, 8);\n ctx.fillStyle = lower;\n ctx.fill();\n\n // Cream belt\n ctx.fillStyle = \"#f8ccbd\";\n ctx.fillRect(17, 290, 266, 13);\n ctx.fillStyle = \"#fff0dd\";\n ctx.fillRect(18, 291, 265, 4);\n\n // Decorative lines\n ctx.strokeStyle = \"rgba(124,25,62,.5)\";\n ctx.lineWidth = 2;\n ctx.beginPath();\n ctx.moveTo(18, 332);\n ctx.lineTo(282, 332);\n ctx.stroke();\n\n // Headlamp and grille\n rr(266, 307, 15, 17, 4);\n ctx.fillStyle = \"#fff6bb\";\n ctx.fill();\n ctx.fillStyle = \"rgba(255,255,255,.7)\";\n ctx.beginPath();\n ctx.arc(272, 312, 4, 0, Math.PI*2);\n ctx.fill();\n\n for (let y = 339; y < 354; y += 4) {\n ctx.strokeStyle = \"#832344\";\n ctx.lineWidth = 2;\n ctx.beginPath();\n ctx.moveTo(242, y);\n ctx.lineTo(275, y);\n ctx.stroke();\n }\n\n // Bus logo\n ctx.fillStyle = \"#fff1dc\";\n ctx.font = \"700 15px Arial, sans-serif\";\n ctx.letterSpacing = \"1px\";\n ctx.fillText(\"CITYLINE\", 84, 323);\n ctx.font = \"11px Arial, sans-serif\";\n ctx.fillStyle = \"rgba(255,232,222,.8)\";\n ctx.fillText(\"METRO COACH\", 103, 340);\n\n // bumpers\n rr(9, 354, 278, 14, 5);\n ctx.fillStyle = \"#78233f\";\n ctx.fill();\n ctx.fillStyle = \"rgba(255,183,201,.5)\";\n ctx.fillRect(22, 355, 231, 3);\n\n // Wheels\n [[69,363],[227,363]].forEach(([x,y]) => {\n ctx.save();\n ctx.shadowColor = \"rgba(25,14,20,.45)\";\n ctx.shadowBlur = 5;\n ctx.beginPath();\n ctx.arc(x, y, 28, 0, Math.PI*2);\n ctx.fillStyle = \"#412837\";\n ctx.fill();\n ctx.restore();\n ctx.beginPath();\n ctx.arc(x, y, 23, 0, Math.PI*2);\n ctx.fillStyle = \"#202831\";\n ctx.fill();\n ctx.beginPath();\n ctx.arc(x, y, 15, 0, Math.PI*2);\n ctx.fillStyle = \"#8f9ba2\";\n ctx.fill();\n ctx.beginPath();\n ctx.arc(x, y, 9, 0, Math.PI*2);\n ctx.fillStyle = \"#525e69\";\n ctx.fill();\n ctx.beginPath();\n ctx.arc(x, y, 4, 0, Math.PI*2);\n ctx.fillStyle = \"#dbe2df\";\n ctx.fill();\n });\n\n // Door seam\n ctx.strokeStyle = \"rgba(117,29,57,.7)\";\n ctx.lineWidth = 2;\n ctx.beginPath();\n ctx.moveTo(192, 286);\n ctx.lineTo(192, 360);\n ctx.stroke();\n ctx.fillStyle = \"#ffd0d6\";\n rr(198, 310, 13, 4, 2);\n ctx.fill();\n\n ctx.restore();\n\n // SNOWBOARD shadow and board\n ctx.save();\n ctx.translate(389, 267);\n ctx.rotate(0.145);\n\n // Board outer edge, long curved capsule-like silhouette\n ctx.shadowColor = \"rgba(52,39,25,.4)\";\n ctx.shadowBlur = 9;\n ctx.shadowOffsetY = 6;\n ctx.beginPath();\n ctx.moveTo(-24, -185);\n ctx.bezierCurveTo(-44, -171, -43, -136, -38, -89);\n ctx.bezierCurveTo(-32, -30, -32, 77, -24, 164);\n ctx.bezierCurveTo(-21, 194, -10, 204, 2, 205);\n ctx.bezierCurveTo(16, 205, 28, 190, 28, 167);\n ctx.bezierCurveTo(26, 81, 25, -35, 20, -105);\n ctx.bezierCurveTo(17, -149, 4, -182, -12, -188);\n ctx.bezierCurveTo(-17, -190, -21, -188, -24, -185);\n ctx.closePath();\n ctx.fillStyle = \"#765111\";\n ctx.fill();\n ctx.shadowColor = \"transparent\";\n\n // gold face\n ctx.beginPath();\n ctx.moveTo(-19, -181);\n ctx.bezierCurveTo(-36, -164, -35, -129, -31, -88);\n ctx.bezierCurveTo(-25, -22, -25, 79, -18, 163);\n ctx.bezierCurveTo(-16, 186, -8, 197, 1, 198);\n ctx.bezierCurveTo(11, 198, 20, 184, 20, 165);\n ctx.bezierCurveTo(18, 76, 17, -37, 13, -103);\n ctx.bezierCurveTo(11, -145, 0, -176, -13, -182);\n ctx.bezierCurveTo(-15, -183, -17, -183, -19, -181);\n ctx.closePath();\n const gold = ctx.createLinearGradient(-32, 0, 24, 0);\n gold.addColorStop(0, \"#80540b\");\n gold.addColorStop(.14, \"#d29b24\");\n gold.addColorStop(.32, \"#ffdc63\");\n gold.addColorStop(.48, \"#a96d10\");\n gold.addColorStop(.67, \"#f6c949\");\n gold.addColorStop(.84, \"#8b590c\");\n gold.addColorStop(1, \"#edbd3e\");\n ctx.fillStyle = gold;\n ctx.fill();\n\n // Board subtle graphic stripes\n ctx.save();\n ctx.clip();\n ctx.globalAlpha = .3;\n ctx.fillStyle = \"#fff3a6\";\n for (let y = -125; y < 180; y += 31) {\n ctx.beginPath();\n ctx.moveTo(-38, y);\n ctx.lineTo(26, y - 20);\n ctx.lineTo(27, y - 11);\n ctx.lineTo(-36, y + 10);\n ctx.fill();\n }\n ctx.globalAlpha = .22;\n ctx.fillStyle = \"#5b3500\";\n ctx.beginPath();\n ctx.moveTo(-18,-175);\n ctx.lineTo(12,-130);\n ctx.lineTo(-15,18);\n ctx.lineTo(18,118);\n ctx.lineTo(-5,196);\n ctx.lineTo(-14,196);\n ctx.lineTo(-7,109);\n ctx.lineTo(-25,13);\n ctx.lineTo(-2,-127);\n ctx.closePath();\n ctx.fill();\n ctx.restore();\n\n // board edge highlight\n ctx.strokeStyle = \"rgba(255,238,139,.72)\";\n ctx.lineWidth = 1.5;\n ctx.beginPath();\n ctx.moveTo(-17,-178);\n ctx.bezierCurveTo(-31,-155,-29,-105,-25,-69);\n ctx.bezierCurveTo(-20,9,-21,99,-14,165);\n ctx.bezierCurveTo(-12,185,-6,193,0,194);\n ctx.stroke();\n\n // bindings\n [[-2,-45], [0,74]].forEach(([x,y]) => {\n ctx.save();\n ctx.translate(x,y);\n ctx.rotate(-0.08);\n ctx.fillStyle = \"#22282b\";\n rr(-19,-16,37,31,6);\n ctx.fill();\n ctx.fillStyle = \"#3e484a\";\n rr(-15,-12,29,23,4);\n ctx.fill();\n ctx.strokeStyle = \"#c6a446\";\n ctx.lineWidth = 2;\n ctx.beginPath();\n ctx.moveTo(-13,-7);\n ctx.quadraticCurveTo(0,-18,13,-7);\n ctx.stroke();\n ctx.fillStyle = \"#171d20\";\n rr(-12,4,24,10,3);\n ctx.fill();\n ctx.restore();\n });\n\n // small mounting screws\n ctx.fillStyle = \"#f6dc84\";\n [[-4,-68],[0,-23],[-2,48],[2,98]].forEach(([x,y]) => {\n ctx.beginPath();\n ctx.arc(x,y,2.2,0,Math.PI*2);\n ctx.fill();\n });\n\n ctx.restore();\n\n // foreground tiny floor sheen\n ctx.fillStyle = \"rgba(255,255,255,.14)\";\n ctx.beginPath();\n ctx.ellipse(261, 470, 230, 19, 0, 0, Math.PI*2);\n ctx.fill();\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-0294", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 4713, "code_sha256": "568f772fdbcccc7ad6ef2ece0da12ab71058292a940d5928ae867ec5295d6e9c"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "a maroon violin and a purple elephant"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = '';\n stage.style.margin = '0';\n stage.style.overflow = 'hidden';\n stage.style.position = 'relative';\n stage.style.background = '#17111d';\n\n const svgNS = 'http://www.w3.org/2000/svg';\n const svg = document.createElementNS(svgNS, 'svg');\n svg.setAttribute('viewBox', '0 0 512 512');\n svg.setAttribute('width', '512');\n svg.setAttribute('height', '512');\n svg.style.display = 'block';\n\n svg.innerHTML = `\n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n\n \n \n\n \n \n\n \n \n \n\n \n \n\n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n\n \n \n\n \n \n\n \n \n \n \n \n \n \n \n\n \n \n\n \n \n\n \n \n \n\n \n \n \n \n\n \n \n \n\n \n \n\n \n \n \n \n \n\n \n \n\n \n \n\n \n \n \n \n \n `;\n\n stage.appendChild(svg);\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-0651", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 6713, "code_sha256": "153cc75542c740da5d4e28ffc0e5c662a46a3850cadb1910f8ba3194c72150eb"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "three cyan apples"}, {"role": "assistant", "content": "async function render(stage) {\n const canvas = document.createElement(\"canvas\");\n const size = 512;\n const scale = 2;\n canvas.width = size * scale;\n canvas.height = size * scale;\n canvas.style.width = size + \"px\";\n canvas.style.height = size + \"px\";\n canvas.style.display = \"block\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(scale, scale);\n\n const W = 512, H = 512;\n\n function pathApple(ctx, x, y, s) {\n ctx.beginPath();\n ctx.moveTo(x, y - 52 * s);\n ctx.bezierCurveTo(x - 26 * s, y - 83 * s, x - 73 * s, y - 77 * s, x - 88 * s, y - 38 * s);\n ctx.bezierCurveTo(x - 107 * s, y + 13 * s, x - 76 * s, y + 83 * s, x - 12 * s, y + 92 * s);\n ctx.bezierCurveTo(x + 43 * s, y + 101 * s, x + 95 * s, y + 59 * s, x + 91 * s, y + 7 * s);\n ctx.bezierCurveTo(x + 88 * s, y - 40 * s, x + 52 * s, y - 80 * s, x + 18 * s, y - 60 * s);\n ctx.bezierCurveTo(x + 6 * s, y - 53 * s, x - 4 * s, y - 53 * s, x, y - 52 * s);\n ctx.closePath();\n }\n\n function shadow(x, y, rx, ry, alpha) {\n ctx.save();\n ctx.filter = \"blur(13px)\";\n const g = ctx.createRadialGradient(x, y, 3, x, y, rx);\n g.addColorStop(0, `rgba(0,0,0,${alpha})`);\n g.addColorStop(1, \"rgba(0,0,0,0)\");\n ctx.fillStyle = g;\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n ctx.fill();\n ctx.restore();\n }\n\n function leaf(x, y, angle, s) {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(angle);\n const lg = ctx.createLinearGradient(-4 * s, -3 * s, 28 * s, 11 * s);\n lg.addColorStop(0, \"#1e7772\");\n lg.addColorStop(.45, \"#49d4c5\");\n lg.addColorStop(1, \"#083d42\");\n ctx.fillStyle = lg;\n ctx.beginPath();\n ctx.moveTo(0, 0);\n ctx.bezierCurveTo(11 * s, -15 * s, 34 * s, -14 * s, 43 * s, -1 * s);\n ctx.bezierCurveTo(30 * s, 15 * s, 10 * s, 14 * s, 0, 0);\n ctx.fill();\n ctx.strokeStyle = \"rgba(175,255,245,.48)\";\n ctx.lineWidth = 1.1 * s;\n ctx.beginPath();\n ctx.moveTo(2 * s, 0);\n ctx.quadraticCurveTo(18 * s, 0, 38 * s, -2 * s);\n ctx.stroke();\n ctx.restore();\n }\n\n function apple(x, y, s, lightX, lightY) {\n shadow(x + 3 * s, y + 84 * s, 75 * s, 18 * s, .38);\n\n ctx.save();\n pathApple(ctx, x, y, s);\n ctx.clip();\n\n const base = ctx.createRadialGradient(\n x + lightX * s, y + lightY * s, 5 * s,\n x + 2 * s, y + 14 * s, 106 * s\n );\n base.addColorStop(0, \"#b9ffff\");\n base.addColorStop(.12, \"#67f4f1\");\n base.addColorStop(.39, \"#1bc7d2\");\n base.addColorStop(.72, \"#07889c\");\n base.addColorStop(1, \"#034a62\");\n ctx.fillStyle = base;\n ctx.fillRect(x - 120 * s, y - 110 * s, 240 * s, 230 * s);\n\n const leftGlow = ctx.createRadialGradient(\n x - 42 * s, y - 35 * s, 0,\n x - 35 * s, y - 24 * s, 70 * s\n );\n leftGlow.addColorStop(0, \"rgba(188,255,255,.72)\");\n leftGlow.addColorStop(.22, \"rgba(96,247,246,.26)\");\n leftGlow.addColorStop(1, \"rgba(20,179,202,0)\");\n ctx.fillStyle = leftGlow;\n ctx.fillRect(x - 115 * s, y - 110 * s, 180 * s, 170 * s);\n\n const lowerShade = ctx.createLinearGradient(x, y + 25 * s, x, y + 95 * s);\n lowerShade.addColorStop(0, \"rgba(0,44,75,0)\");\n lowerShade.addColorStop(1, \"rgba(0,33,60,.54)\");\n ctx.fillStyle = lowerShade;\n ctx.fillRect(x - 110 * s, y + 14 * s, 220 * s, 100 * s);\n\n ctx.globalCompositeOperation = \"screen\";\n const sheen = ctx.createLinearGradient(x - 72 * s, y - 72 * s, x + 24 * s, y + 68 * s);\n sheen.addColorStop(0, \"rgba(220,255,255,.53)\");\n sheen.addColorStop(.19, \"rgba(162,255,255,.14)\");\n sheen.addColorStop(.48, \"rgba(92,240,249,0)\");\n ctx.fillStyle = sheen;\n ctx.beginPath();\n ctx.ellipse(x - 33 * s, y - 21 * s, 26 * s, 53 * s, -.55, 0, Math.PI * 2);\n ctx.fill();\n\n ctx.globalCompositeOperation = \"source-over\";\n for (let i = 0; i < 160; i++) {\n const a = Math.random() * Math.PI * 2;\n const r = Math.sqrt(Math.random()) * 82 * s;\n const px = x + Math.cos(a) * r;\n const py = y + Math.sin(a) * r * .9;\n const dx = (px - x) / (92 * s);\n const dy = (py - y) / (92 * s);\n if (dx * dx + dy * dy < 1) {\n ctx.fillStyle = Math.random() > .52\n ? \"rgba(197,255,255,.035)\"\n : \"rgba(0,53,79,.035)\";\n ctx.fillRect(px, py, Math.random() * 1.5 + .3, Math.random() * 1.5 + .3);\n }\n }\n\n ctx.restore();\n\n ctx.save();\n pathApple(ctx, x, y, s);\n ctx.strokeStyle = \"rgba(160,255,255,.38)\";\n ctx.lineWidth = 1.25 * s;\n ctx.stroke();\n ctx.restore();\n\n ctx.save();\n ctx.translate(x, y - 58 * s);\n ctx.rotate(-.14);\n ctx.strokeStyle = \"#3b3630\";\n ctx.lineWidth = 5 * s;\n ctx.lineCap = \"round\";\n ctx.beginPath();\n ctx.moveTo(0, 4 * s);\n ctx.bezierCurveTo(-1 * s, -11 * s, 5 * s, -21 * s, 13 * s, -27 * s);\n ctx.stroke();\n ctx.strokeStyle = \"rgba(153,116,72,.75)\";\n ctx.lineWidth = 1.2 * s;\n ctx.beginPath();\n ctx.moveTo(1 * s, 2 * s);\n ctx.quadraticCurveTo(5 * s, -12 * s, 12 * s, -24 * s);\n ctx.stroke();\n ctx.restore();\n\n leaf(x + 9 * s, y - 80 * s, -.42, .72 * s);\n\n ctx.save();\n ctx.fillStyle = \"rgba(0,42,55,.34)\";\n ctx.beginPath();\n ctx.ellipse(x, y - 54 * s, 16 * s, 6 * s, 0, 0, Math.PI * 2);\n ctx.fill();\n ctx.restore();\n\n ctx.save();\n ctx.filter = \"blur(1.3px)\";\n ctx.fillStyle = \"rgba(241,255,255,.72)\";\n ctx.beginPath();\n ctx.ellipse(x - 43 * s, y - 34 * s, 9 * s, 18 * s, -.48, 0, Math.PI * 2);\n ctx.fill();\n ctx.fillStyle = \"rgba(224,255,255,.34)\";\n ctx.beginPath();\n ctx.ellipse(x - 22 * s, y - 57 * s, 4 * s, 8 * s, -.55, 0, Math.PI * 2);\n ctx.fill();\n ctx.restore();\n }\n\n const bg = ctx.createRadialGradient(258, 205, 35, 256, 265, 390);\n bg.addColorStop(0, \"#294755\");\n bg.addColorStop(.48, \"#172d39\");\n bg.addColorStop(1, \"#08151d\");\n ctx.fillStyle = bg;\n ctx.fillRect(0, 0, W, H);\n\n ctx.fillStyle = \"rgba(129,226,229,.045)\";\n for (let i = 0; i < 20; i++) {\n const x = 25 + Math.random() * 462;\n const y = 22 + Math.random() * 370;\n const r = 10 + Math.random() * 60;\n const g = ctx.createRadialGradient(x, y, 0, x, y, r);\n g.addColorStop(0, \"rgba(105,239,241,.06)\");\n g.addColorStop(1, \"rgba(105,239,241,0)\");\n ctx.fillStyle = g;\n ctx.beginPath();\n ctx.arc(x, y, r, 0, Math.PI * 2);\n ctx.fill();\n }\n\n apple(151, 265, .79, -45, -40);\n apple(352, 263, .80, -42, -40);\n apple(254, 310, 1.06, -50, -50);\n\n ctx.save();\n const vignette = ctx.createRadialGradient(256, 240, 175, 256, 256, 410);\n vignette.addColorStop(.6, \"rgba(0,0,0,0)\");\n vignette.addColorStop(1, \"rgba(0,0,0,.47)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0, 0, W, H);\n ctx.restore();\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-1086", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 3103, "code_sha256": "0f2aa86899400836d5314dee07f5d40f74e637bcdcaaca59e71793405c10fa5c"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "four navy hawks to the left of seven black dolphins"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;overflow:hidden;position:relative;background:#eef3f5;\";\n\n const svgNS = \"http://www.w3.org/2000/svg\";\n const svg = document.createElementNS(svgNS, \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 512 512\");\n svg.setAttribute(\"width\", \"512\");\n svg.setAttribute(\"height\", \"512\");\n svg.style.display = \"block\";\n\n svg.innerHTML = `\n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n `;\n\n stage.appendChild(svg);\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-1099", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 2693, "code_sha256": "5631eed51efb9ff7d0db84db48b954bd8444ed25a9988d01d8e002c9e1c12f52"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "seven checkered otters chasing a hedgehog to the left of five bears"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;overflow:hidden;position:relative;background:#dff1fa\";\n const ns = \"http://www.w3.org/2000/svg\";\n const svg = document.createElementNS(ns, \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 512 512\");\n svg.setAttribute(\"width\", \"512\");\n svg.setAttribute(\"height\", \"512\");\n svg.setAttribute(\"xmlns\", ns);\n\n const otters = [\n [42, 250, .62, -5], [91, 232, .68, 4], [141, 253, .63, -4],\n [72, 315, .64, 5], [126, 326, .68, -2], [182, 302, .67, 3],\n [218, 339, .62, -5]\n ];\n\n const bears = [\n [365, 250, .68, \"#8d5c37\"], [420, 243, .75, \"#754429\"],\n [471, 267, .62, \"#a87348\"], [392, 333, .72, \"#9c633c\"],\n [452, 345, .68, \"#71452e\"]\n ];\n\n function otter(x, y, s, tilt) {\n return `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n `;\n }\n\n function hedgehog() {\n let spines = \"\";\n const pts = [\n [0,-55], [15,-52], [29,-44], [40,-32], [46,-17], [46,0],\n [40,16], [26,28], [9,35], [-10,34], [-25,28], [-39,15],\n [-45,0],[-41,-18],[-30,-36],[-16,-49]\n ];\n for (let i = 0; i < pts.length; i++) {\n const a = (i / pts.length) * Math.PI * 2 - Math.PI / 2;\n const x = Math.cos(a) * 47, y = Math.sin(a) * 47;\n const x2 = Math.cos(a + .12) * 34, y2 = Math.sin(a + .12) * 34;\n const x3 = Math.cos(a - .12) * 34, y3 = Math.sin(a - .12) * 34;\n spines += ``;\n }\n return `\n \n \n \n ${spines}\n \n \n \n \n \n \n \n `;\n }\n\n function bear(x, y, s, color) {\n return `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n `;\n }\n\n svg.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ${otters.map(o => otter(...o)).join(\"\")}\n ${hedgehog()}\n ${bears.map(b => bear(...b)).join(\"\")}\n \n \n \n \n `;\n stage.appendChild(svg);\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-1120", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 4042, "code_sha256": "5bb883df4979dbb22660d0096ab1e08ff91af48477382ad958349e063c41e8c5"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "six sparkling frisbees and three glass cars"}, {"role": "assistant", "content": "async function render(stage) {\n const W = 512, H = 512, dpr = Math.min(devicePixelRatio || 1, 2);\n stage.innerHTML = \"\";\n stage.style.cssText = \"position:relative;overflow:hidden;background:#060b18;\";\n const canvas = document.createElement(\"canvas\");\n canvas.width = W * dpr;\n canvas.height = H * dpr;\n canvas.style.cssText = \"width:512px;height:512px;display:block;\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(dpr, dpr);\n\n let seed = 84521;\n const rand = () => ((seed = (seed * 1664525 + 1013904223) >>> 0) / 4294967296);\n const lerp = (a, b, t) => a + (b - a) * t;\n\n function glow(x, y, r, color, alpha = 1) {\n const g = ctx.createRadialGradient(x, y, 0, x, y, r);\n g.addColorStop(0, color.replace(\"ALPHA\", alpha));\n g.addColorStop(.35, color.replace(\"ALPHA\", alpha * .35));\n g.addColorStop(1, color.replace(\"ALPHA\", 0));\n ctx.fillStyle = g;\n ctx.beginPath();\n ctx.arc(x, y, r, 0, Math.PI * 2);\n ctx.fill();\n }\n\n const bg = ctx.createLinearGradient(0, 0, 0, H);\n bg.addColorStop(0, \"#071529\");\n bg.addColorStop(.42, \"#101838\");\n bg.addColorStop(1, \"#040711\");\n ctx.fillStyle = bg;\n ctx.fillRect(0, 0, W, H);\n\n for (let i = 0; i < 80; i++) {\n const x = rand() * W, y = rand() * 330;\n const r = rand() * 1.3 + .15;\n ctx.fillStyle = `rgba(${180 + rand() * 75},${210 + rand() * 45},255,${.1 + rand() * .45})`;\n ctx.beginPath();\n ctx.arc(x, y, r, 0, Math.PI * 2);\n ctx.fill();\n }\n\n glow(256, 235, 230, \"rgba(63,98,255,ALPHA)\", .18);\n glow(256, 446, 190, \"rgba(0,215,255,ALPHA)\", .11);\n\n function sparkle(x, y, size, hue) {\n ctx.save();\n ctx.translate(x, y);\n ctx.globalCompositeOperation = \"lighter\";\n ctx.strokeStyle = `hsla(${hue},100%,88%,.92)`;\n ctx.lineWidth = Math.max(.55, size * .1);\n ctx.beginPath();\n ctx.moveTo(-size, 0); ctx.lineTo(size, 0);\n ctx.moveTo(0, -size); ctx.lineTo(0, size);\n ctx.stroke();\n ctx.strokeStyle = `hsla(${hue},100%,95%,.55)`;\n ctx.lineWidth *= .6;\n ctx.beginPath();\n ctx.moveTo(-size * .55, -size * .55); ctx.lineTo(size * .55, size * .55);\n ctx.moveTo(size * .55, -size * .55); ctx.lineTo(-size * .55, size * .55);\n ctx.stroke();\n ctx.restore();\n }\n\n function frisbee(x, y, rx, ry, hue, rot) {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rot);\n\n ctx.save();\n ctx.filter = \"blur(12px)\";\n ctx.fillStyle = `hsla(${hue},95%,68%,.25)`;\n ctx.beginPath();\n ctx.ellipse(4, 9, rx * 1.08, ry * .9, 0, 0, Math.PI * 2);\n ctx.fill();\n ctx.restore();\n\n let g = ctx.createRadialGradient(-rx * .25, -ry * .48, 1, 0, 0, rx);\n g.addColorStop(0, \"rgba(245,255,255,.98)\");\n g.addColorStop(.14, `hsla(${hue},100%,85%,.96)`);\n g.addColorStop(.45, `hsla(${hue},82%,48%,.95)`);\n g.addColorStop(.72, `hsla(${hue + 20},92%,31%,.96)`);\n g.addColorStop(1, \"rgba(8,17,50,.98)\");\n ctx.fillStyle = g;\n ctx.beginPath();\n ctx.ellipse(0, 0, rx, ry, 0, 0, Math.PI * 2);\n ctx.fill();\n\n ctx.strokeStyle = `hsla(${hue},100%,85%,.9)`;\n ctx.lineWidth = 1.4;\n ctx.beginPath();\n ctx.ellipse(0, 0, rx * .93, ry * .83, 0, .15, Math.PI * .92);\n ctx.stroke();\n\n ctx.strokeStyle = \"rgba(210,255,255,.42)\";\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.ellipse(-1, -1, rx * .63, ry * .48, 0, Math.PI * .92, Math.PI * 1.92);\n ctx.stroke();\n\n const inner = ctx.createRadialGradient(-rx * .2, -ry * .35, 1, 0, 0, rx * .6);\n inner.addColorStop(0, \"rgba(220,255,255,.65)\");\n inner.addColorStop(.45, `hsla(${hue + 10},90%,70%,.24)`);\n inner.addColorStop(1, \"rgba(0,0,30,0)\");\n ctx.fillStyle = inner;\n ctx.beginPath();\n ctx.ellipse(0, -1, rx * .59, ry * .44, 0, 0, Math.PI * 2);\n ctx.fill();\n\n ctx.globalCompositeOperation = \"screen\";\n for (let i = 0; i < 13; i++) {\n const a = rand() * Math.PI * 2;\n const rr = Math.sqrt(rand()) * .87;\n const px = Math.cos(a) * rx * rr;\n const py = Math.sin(a) * ry * rr;\n const s = .5 + rand() * 1.7;\n ctx.fillStyle = `rgba(255,255,255,${.36 + rand() * .64})`;\n ctx.beginPath();\n ctx.arc(px, py, s, 0, Math.PI * 2);\n ctx.fill();\n if (rand() > .72) sparkle(px, py, 2 + rand() * 2.5, hue);\n }\n ctx.restore();\n\n for (let i = 0; i < 3; i++) {\n const a = rand() * Math.PI * 2;\n sparkle(x + Math.cos(a) * rx * 1.08, y + Math.sin(a) * ry * 1.12, 2 + rand() * 3, hue);\n }\n }\n\n frisbee(92, 116, 47, 17, 185, -.22);\n frisbee(226, 83, 43, 16, 290, .12);\n frisbee(382, 119, 49, 18, 43, -.15);\n frisbee(145, 217, 51, 18, 323, .16);\n frisbee(276, 179, 48, 17, 193, -.2);\n frisbee(418, 216, 44, 16, 275, .19);\n\n function polygon(points, fill, stroke, width = 1) {\n ctx.beginPath();\n ctx.moveTo(points[0][0], points[0][1]);\n for (let i = 1; i < points.length; i++) ctx.lineTo(points[i][0], points[i][1]);\n ctx.closePath();\n if (fill) {\n ctx.fillStyle = fill;\n ctx.fill();\n }\n if (stroke) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = width;\n ctx.stroke();\n }\n }\n\n function car(cx, cy, scale, hue) {\n ctx.save();\n ctx.translate(cx, cy);\n ctx.scale(scale, scale);\n\n ctx.save();\n ctx.filter = \"blur(13px)\";\n const sh = ctx.createRadialGradient(0, 20, 5, 0, 20, 68);\n sh.addColorStop(0, \"rgba(0,0,0,.8)\");\n sh.addColorStop(1, \"rgba(0,0,0,0)\");\n ctx.fillStyle = sh;\n ctx.beginPath();\n ctx.ellipse(0, 19, 67, 13, 0, 0, Math.PI * 2);\n ctx.fill();\n ctx.restore();\n\n const body = ctx.createLinearGradient(0, -39, 0, 27);\n body.addColorStop(0, `hsla(${hue},82%,89%,.62)`);\n body.addColorStop(.32, `hsla(${hue},98%,62%,.28)`);\n body.addColorStop(.62, \"rgba(194,244,255,.18)\");\n body.addColorStop(1, `hsla(${hue},90%,50%,.48)`);\n polygon(\n [[-65,8],[-57,-13],[-29,-32],[25,-35],[51,-17],[65,1],[59,18],[37,25],[-46,24],[-63,16]],\n body,\n `hsla(${hue},100%,85%,.88)`,\n 1.25\n );\n\n const roof = ctx.createLinearGradient(-30, -33, 34, -8);\n roof.addColorStop(0, \"rgba(221,255,255,.74)\");\n roof.addColorStop(.45, `hsla(${hue},94%,70%,.30)`);\n roof.addColorStop(1, \"rgba(22,39,89,.63)\");\n polygon([[-29,-31],[22,-34],[43,-16],[-47,-13]], roof, \"rgba(208,255,255,.78)\", 1);\n\n polygon([[-24,-29],[-3,-30],[-4,-14],[-39,-14]], \"rgba(8,38,81,.58)\", \"rgba(199,255,255,.55)\", .7);\n polygon([[-1,-30],[20,-31],[37,-16],[-1,-14]], \"rgba(11,42,94,.60)\", \"rgba(199,255,255,.55)\", .7);\n\n const side = ctx.createLinearGradient(-55, 0, 55, 15);\n side.addColorStop(0, \"rgba(69,227,255,.1)\");\n side.addColorStop(.5, \"rgba(238,255,255,.42)\");\n side.addColorStop(1, `hsla(${hue},100%,65%,.2)`);\n polygon([[-62,1],[-45,-12],[-4,-14],[38,-15],[60,0],[56,14],[30,19],[-49,18]], side, \"rgba(197,252,255,.55)\", .8);\n\n ctx.strokeStyle = \"rgba(239,255,255,.88)\";\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.moveTo(-59, 1); ctx.quadraticCurveTo(-9, 7, 59, 0);\n ctx.stroke();\n\n ctx.fillStyle = \"rgba(191,251,255,.82)\";\n ctx.fillRect(-62, 4, 10, 3);\n ctx.fillStyle = `hsla(${hue},100%,73%,.95)`;\n ctx.fillRect(51, 4, 8, 3);\n\n for (const x of [-39, 38]) {\n ctx.fillStyle = \"rgba(5,10,27,.9)\";\n ctx.beginPath();\n ctx.ellipse(x, 17, 12, 7, 0, 0, Math.PI * 2);\n ctx.fill();\n const wh = ctx.createRadialGradient(x - 3, 14, 1, x, 17, 9);\n wh.addColorStop(0, \"rgba(223,255,255,.95)\");\n wh.addColorStop(.3, `hsla(${hue},100%,68%,.85)`);\n wh.addColorStop(.75, \"rgba(15,35,91,.9)\");\n wh.addColorStop(1, \"rgba(0,0,0,.95)\");\n ctx.fillStyle = wh;\n ctx.beginPath();\n ctx.arc(x, 17, 6.5, 0, Math.PI * 2);\n ctx.fill();\n }\n\n ctx.globalCompositeOperation = \"screen\";\n ctx.fillStyle = \"rgba(255,255,255,.65)\";\n ctx.fillRect(-19, -9, 30, .8);\n ctx.fillRect(-48, 11, 24, .7);\n ctx.restore();\n }\n\n car(109, 390, .78, 196);\n car(258, 401, 1.04, 294);\n car(417, 391, .78, 38);\n\n ctx.globalCompositeOperation = \"lighter\";\n for (let i = 0; i < 35; i++) {\n const x = rand() * W;\n const y = 265 + rand() * 180;\n const a = .12 + rand() * .48;\n ctx.fillStyle = `rgba(167,239,255,${a})`;\n ctx.beginPath();\n ctx.arc(x, y, rand() * 1.2 + .2, 0, Math.PI * 2);\n ctx.fill();\n }\n sparkle(102, 352, 5, 190);\n sparkle(286, 340, 4, 294);\n sparkle(433, 350, 5, 42);\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-1210", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 3894, "code_sha256": "df02addc80fc11fade165234a11df539590ecf9ccf4abf026cd7b2d480532a6b"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "a cup on a sparkling zebra under a chair"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;position:relative;overflow:hidden;background:#d8c9b5;\";\n \n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = 512;\n canvas.style.cssText = \"display:block;width:512px;height:512px;\";\n stage.appendChild(canvas);\n const ctx = canvas.getContext(\"2d\");\n\n const W = 512, H = 512;\n const rnd = (a, b) => a + Math.random() * (b - a);\n\n function path(points, close = true) {\n ctx.beginPath();\n points.forEach((p, i) => i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]));\n if (close) ctx.closePath();\n }\n function ellipse(x, y, rx, ry, fill, stroke, lw = 1) {\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n if (fill) { ctx.fillStyle = fill; ctx.fill(); }\n if (stroke) { ctx.strokeStyle = stroke; ctx.lineWidth = lw; ctx.stroke(); }\n }\n function shine(x, y, r, alpha = 1) {\n ctx.save();\n ctx.translate(x, y);\n ctx.globalAlpha = alpha;\n const g = ctx.createRadialGradient(0, 0, 0, 0, 0, r);\n g.addColorStop(0, \"#fff\");\n g.addColorStop(.2, \"#fff\");\n g.addColorStop(1, \"rgba(255,255,255,0)\");\n ctx.fillStyle = g;\n ctx.beginPath();\n ctx.arc(0, 0, r, 0, Math.PI * 2);\n ctx.fill();\n ctx.fillStyle = \"rgba(255,255,255,.95)\";\n ctx.beginPath();\n ctx.moveTo(-r * .18, 0); ctx.lineTo(0, -r * 1.15); ctx.lineTo(r * .18, 0); ctx.lineTo(0, r * 1.15);\n ctx.fill();\n ctx.restore();\n }\n\n // wall and floor\n const wall = ctx.createLinearGradient(0, 0, 0, 345);\n wall.addColorStop(0, \"#ece3d5\");\n wall.addColorStop(.55, \"#d6c6b1\");\n wall.addColorStop(1, \"#bba58d\");\n ctx.fillStyle = wall;\n ctx.fillRect(0, 0, W, 345);\n\n const floor = ctx.createLinearGradient(0, 337, 0, 512);\n floor.addColorStop(0, \"#98765f\");\n floor.addColorStop(.1, \"#80604c\");\n floor.addColorStop(1, \"#4f382f\");\n ctx.fillStyle = floor;\n ctx.fillRect(0, 337, W, 175);\n\n ctx.fillStyle = \"rgba(50,30,20,.22)\";\n ctx.fillRect(0, 337, W, 7);\n\n // faded wallpaper texture\n for (let i = 0; i < 1300; i++) {\n ctx.fillStyle = `rgba(90,65,45,${Math.random() * .035})`;\n ctx.fillRect(rnd(0, W), rnd(0, 338), rnd(.3, 2), rnd(.3, 2));\n }\n for (let y = 365; y < 512; y += 18) {\n ctx.strokeStyle = \"rgba(35,20,13,.15)\";\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.moveTo(0, y + Math.sin(y) * 2);\n ctx.lineTo(W, y - 4);\n ctx.stroke();\n }\n\n // shadow underneath chair and zebra\n const shadow = ctx.createRadialGradient(260, 410, 25, 260, 410, 205);\n shadow.addColorStop(0, \"rgba(27,15,12,.62)\");\n shadow.addColorStop(.5, \"rgba(35,20,15,.31)\");\n shadow.addColorStop(1, \"rgba(35,20,15,0)\");\n ctx.fillStyle = shadow;\n ctx.fillRect(35, 335, 445, 155);\n\n // chair back, softly visible\n ctx.save();\n ctx.fillStyle = \"#6b3e28\";\n ctx.strokeStyle = \"#432518\";\n ctx.lineWidth = 5;\n path([[103, 25], [404, 23], [421, 230], [91, 234]]);\n ctx.fill(); ctx.stroke();\n const backGrad = ctx.createLinearGradient(0, 25, 0, 230);\n backGrad.addColorStop(0, \"rgba(170,101,61,.36)\");\n backGrad.addColorStop(1, \"rgba(46,22,17,.32)\");\n ctx.fillStyle = backGrad;\n path([[112, 35], [395, 33], [406, 219], [104, 222]]);\n ctx.fill();\n for (let i = 0; i < 7; i++) {\n ctx.strokeStyle = \"rgba(255,194,126,.10)\";\n ctx.lineWidth = 2;\n ctx.beginPath();\n ctx.moveTo(125 + i * 42, 40);\n ctx.lineTo(126 + i * 37, 211);\n ctx.stroke();\n }\n ctx.restore();\n\n // rear legs first\n function chairLeg(x1, y1, x2, y2, width) {\n ctx.save();\n ctx.lineCap = \"round\";\n ctx.strokeStyle = \"#422418\";\n ctx.lineWidth = width + 4;\n ctx.beginPath(); ctx.moveTo(x1, y1); ctx.lineTo(x2, y2); ctx.stroke();\n const lg = ctx.createLinearGradient(x1, 0, x2, 0);\n lg.addColorStop(0, \"#a4673d\"); lg.addColorStop(.4, \"#774024\"); lg.addColorStop(1, \"#371d15\");\n ctx.strokeStyle = lg; ctx.lineWidth = width;\n ctx.beginPath(); ctx.moveTo(x1, y1); ctx.lineTo(x2, y2); ctx.stroke();\n ctx.strokeStyle = \"rgba(242,181,110,.34)\"; ctx.lineWidth = 2;\n ctx.beginPath(); ctx.moveTo(x1 - 3, y1 + 5); ctx.lineTo(x2 - 2, y2 - 6); ctx.stroke();\n ctx.restore();\n }\n chairLeg(121, 202, 70, 470, 22);\n chairLeg(395, 202, 447, 470, 22);\n\n // zebra body\n const bodyGrad = ctx.createRadialGradient(272, 319, 30, 270, 340, 180);\n bodyGrad.addColorStop(0, \"#fbf8e9\");\n bodyGrad.addColorStop(.58, \"#dedbd0\");\n bodyGrad.addColorStop(1, \"#aaa79f\");\n ctx.fillStyle = bodyGrad;\n ctx.strokeStyle = \"#383633\";\n ctx.lineWidth = 3;\n ctx.beginPath();\n ctx.moveTo(126, 360);\n ctx.bezierCurveTo(110, 320, 135, 281, 194, 270);\n ctx.bezierCurveTo(253, 250, 350, 261, 385, 301);\n ctx.bezierCurveTo(421, 343, 391, 391, 335, 404);\n ctx.bezierCurveTo(274, 418, 180, 407, 140, 386);\n ctx.bezierCurveTo(127, 379, 123, 370, 126, 360);\n ctx.fill(); ctx.stroke();\n\n // zebra neck and head\n ctx.fillStyle = \"#e9e7dc\";\n ctx.beginPath();\n ctx.moveTo(164, 325);\n ctx.bezierCurveTo(128, 312, 108, 275, 121, 228);\n ctx.bezierCurveTo(128, 203, 145, 190, 160, 199);\n ctx.bezierCurveTo(183, 216, 198, 262, 219, 286);\n ctx.closePath(); ctx.fill(); ctx.stroke();\n\n ctx.beginPath();\n ctx.moveTo(118, 233);\n ctx.bezierCurveTo(95, 225, 79, 204, 88, 181);\n ctx.bezierCurveTo(97, 158, 130, 150, 153, 165);\n ctx.bezierCurveTo(174, 178, 171, 208, 150, 228);\n ctx.bezierCurveTo(140, 238, 126, 238, 118, 233);\n ctx.fill(); ctx.stroke();\n\n // ears and mane\n ctx.fillStyle = \"#d9d4ca\";\n path([[104, 172], [97, 144], [121, 163]]);\n ctx.fill(); ctx.stroke();\n path([[143, 164], [154, 139], [161, 171]]);\n ctx.fill(); ctx.stroke();\n ctx.strokeStyle = \"#252423\";\n ctx.lineWidth = 7;\n for (let i = 0; i < 11; i++) {\n const x = 128 + i * 3.8;\n ctx.beginPath();\n ctx.moveTo(x, 205 + i * 6);\n ctx.lineTo(x - 5, 190 + i * 7);\n ctx.stroke();\n }\n\n // legs beneath\n function zebraLeg(x, y, bendX, footX) {\n ctx.fillStyle = \"#e6e3d8\";\n ctx.strokeStyle = \"#33312e\";\n ctx.lineWidth = 3;\n ctx.beginPath();\n ctx.moveTo(x - 13, y);\n ctx.lineTo(x + 14, y);\n ctx.lineTo(bendX + 11, 430);\n ctx.lineTo(footX + 16, 463);\n ctx.lineTo(footX - 18, 463);\n ctx.lineTo(bendX - 12, 429);\n ctx.closePath();\n ctx.fill(); ctx.stroke();\n ctx.fillStyle = \"#292827\";\n ctx.beginPath();\n ctx.ellipse(footX, 462, 19, 7, 0, 0, Math.PI * 2);\n ctx.fill();\n }\n zebraLeg(224, 379, 218, 207);\n zebraLeg(328, 382, 350, 362);\n\n // zebra stripes clipped to body-ish paths\n ctx.save();\n ctx.beginPath();\n ctx.moveTo(126, 360); ctx.bezierCurveTo(110, 320, 135, 281, 194, 270);\n ctx.bezierCurveTo(253, 250, 350, 261, 385, 301);\n ctx.bezierCurveTo(421, 343, 391, 391, 335, 404);\n ctx.bezierCurveTo(260, 421, 165, 401, 126, 360);\n ctx.clip();\n ctx.strokeStyle = \"#262627\";\n ctx.lineCap = \"round\";\n const stripes = [\n [[150,278],[175,302],[162,340],[150,373]],\n [[183,267],[199,293],[185,330],[177,394]],\n [[219,263],[231,292],[216,335],[212,404]],\n [[255,261],[268,290],[250,341],[251,411]],\n [[292,265],[304,293],[285,346],[291,407]],\n [[327,273],[337,300],[320,348],[333,401]],\n [[360,287],[367,311],[350,350],[364,390]],\n [[386,308],[384,332],[366,365],[378,379]]\n ];\n stripes.forEach((s, i) => {\n ctx.lineWidth = i % 2 ? 13 : 10;\n ctx.beginPath(); ctx.moveTo(...s[0]);\n ctx.bezierCurveTo(...s[1], ...s[2], ...s[3]);\n ctx.stroke();\n });\n ctx.restore();\n\n // neck stripes\n ctx.strokeStyle = \"#272727\";\n ctx.lineCap = \"round\";\n [[126,223,153,236],[120,242,161,256],[124,265,173,278],[133,288,183,299],[145,310,192,319]].forEach((a, i) => {\n ctx.lineWidth = 8 + i;\n ctx.beginPath(); ctx.moveTo(a[0],a[1]); ctx.lineTo(a[2],a[3]); ctx.stroke();\n });\n\n // face stripes, eye, muzzle\n ctx.strokeStyle = \"#252526\";\n ctx.lineWidth = 7;\n [[96,187,122,198],[101,207,130,214],[122,174,135,195],[145,181,154,205]].forEach(a => {\n ctx.beginPath(); ctx.moveTo(a[0],a[1]); ctx.lineTo(a[2],a[3]); ctx.stroke();\n });\n ellipse(126, 187, 5, 6, \"#161515\");\n ellipse(128, 185, 1.5, 2, \"#fff\");\n ellipse(102, 218, 12, 8, \"#bbb8ae\", \"#4a4844\", 1);\n ellipse(98, 217, 2.3, 2, \"#222\");\n ctx.strokeStyle = \"#45413e\"; ctx.lineWidth = 2;\n ctx.beginPath(); ctx.moveTo(107, 226); ctx.quadraticCurveTo(121, 233, 136, 223); ctx.stroke();\n\n // front chair seat over zebra\n ctx.save();\n ctx.shadowColor = \"rgba(0,0,0,.35)\";\n ctx.shadowBlur = 8; ctx.shadowOffsetY = 6;\n const seat = ctx.createLinearGradient(0, 217, 0, 274);\n seat.addColorStop(0, \"#a96840\"); seat.addColorStop(.35, \"#834825\"); seat.addColorStop(1, \"#522a1a\");\n ctx.fillStyle = seat;\n ctx.strokeStyle = \"#3b2016\"; ctx.lineWidth = 5;\n path([[73, 215], [442, 215], [417, 278], [94, 278]]);\n ctx.fill(); ctx.stroke();\n ctx.shadowColor = \"transparent\";\n ctx.fillStyle = \"rgba(255,189,113,.25)\";\n path([[84, 221], [431, 221], [425, 233], [81, 233]]);\n ctx.fill();\n ctx.restore();\n\n // front legs\n chairLeg(104, 266, 82, 497, 25);\n chairLeg(410, 266, 432, 497, 25);\n\n // cup resting on zebra, in visible central gap\n ctx.save();\n ctx.shadowColor = \"rgba(0,0,0,.34)\";\n ctx.shadowBlur = 9; ctx.shadowOffsetY = 7;\n const cup = ctx.createLinearGradient(0, 293, 0, 365);\n cup.addColorStop(0, \"#f8f2dc\");\n cup.addColorStop(.5, \"#d9c9ac\");\n cup.addColorStop(1, \"#a98c6c\");\n ctx.fillStyle = cup;\n ctx.strokeStyle = \"#5b4436\";\n ctx.lineWidth = 2.5;\n ctx.beginPath();\n ctx.moveTo(245, 296);\n ctx.lineTo(315, 296);\n ctx.lineTo(307, 363);\n ctx.quadraticCurveTo(280, 376, 253, 363);\n ctx.closePath();\n ctx.fill(); ctx.stroke();\n ctx.shadowColor = \"transparent\";\n ellipse(280, 296, 35, 10, \"#6e4c35\", \"#594333\", 2);\n ellipse(280, 294, 29, 6, \"#3b261b\");\n ctx.fillStyle = \"rgba(255,255,255,.62)\";\n ctx.beginPath(); ctx.ellipse(260, 323, 6, 23, -.12, 0, Math.PI * 2); ctx.fill();\n ctx.strokeStyle = \"#b69b78\"; ctx.lineWidth = 7;\n ctx.beginPath(); ctx.arc(316, 326, 19, -1.25, 1.25); ctx.stroke();\n ctx.strokeStyle = \"#5b4436\"; ctx.lineWidth = 2;\n ctx.beginPath(); ctx.arc(316, 326, 19, -1.25, 1.25); ctx.stroke();\n ctx.restore();\n\n // magical sparkling zebra highlights\n const sparkles = [\n [174,300,6],[203,353,5],[230,278,4],[248,386,6],[291,274,5],[321,371,6],\n [351,304,5],[372,344,4],[157,360,4],[193,389,5],[137,273,4],[338,283,4],\n [115,252,4],[154,212,3],[220,328,3],[302,350,4]\n ];\n sparkles.forEach(([x,y,r], i) => shine(x, y, r, i % 3 === 0 ? .95 : .7));\n\n // floating tiny dust glints\n for (let i = 0; i < 20; i++) {\n const x = rnd(80, 425), y = rnd(150, 405);\n if (Math.abs(x - 280) < 45 && y > 285 && y < 370) continue;\n shine(x, y, rnd(1.5, 3.2), rnd(.2, .5));\n }\n\n // foreground warm vignette\n const vignette = ctx.createRadialGradient(256, 250, 220, 256, 255, 410);\n vignette.addColorStop(.58, \"rgba(0,0,0,0)\");\n vignette.addColorStop(1, \"rgba(42,22,14,.26)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0, 0, 512, 512);\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-1244", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 5389, "code_sha256": "417bf70a965c49dcfa72856ccbcc20ac2da5262b0216730e03f61b4103e8e584"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "a spotted owl and a striped koala"}, {"role": "assistant", "content": "async function render(stage) {\n const canvas = document.createElement(\"canvas\");\n canvas.width = 1024;\n canvas.height = 1024;\n canvas.style.width = \"512px\";\n canvas.style.height = \"512px\";\n canvas.style.display = \"block\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(2, 2);\n\n const W = 512, H = 512;\n const rand = (a, b) => a + Math.random() * (b - a);\n const ellipse = (x, y, rx, ry, fill, stroke, sw = 1) => {\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n if (fill) ctx.fillStyle = fill, ctx.fill();\n if (stroke) ctx.strokeStyle = stroke, ctx.lineWidth = sw, ctx.stroke();\n };\n const path = (points, fill, stroke, sw = 1) => {\n ctx.beginPath();\n points.forEach((p, i) => i ? ctx.lineTo(...p) : ctx.moveTo(...p));\n ctx.closePath();\n if (fill) ctx.fillStyle = fill, ctx.fill();\n if (stroke) ctx.strokeStyle = stroke, ctx.lineWidth = sw, ctx.stroke();\n };\n\n const sky = ctx.createLinearGradient(0, 0, 0, H);\n sky.addColorStop(0, \"#17282b\");\n sky.addColorStop(.43, \"#4c6455\");\n sky.addColorStop(1, \"#a5a16d\");\n ctx.fillStyle = sky;\n ctx.fillRect(0, 0, W, H);\n\n for (let i = 0; i < 85; i++) {\n const x = rand(-30, 540), y = rand(0, 360), r = rand(7, 34);\n const g = ctx.createRadialGradient(x, y, 0, x, y, r);\n g.addColorStop(0, `rgba(${rand(110,180)},${rand(135,205)},${rand(85,145)},.22)`);\n g.addColorStop(1, \"rgba(40,65,42,0)\");\n ctx.fillStyle = g;\n ctx.beginPath(); ctx.arc(x, y, r, 0, Math.PI * 2); ctx.fill();\n }\n\n ctx.globalAlpha = .7;\n for (let i = 0; i < 36; i++) {\n const x = rand(0, 512), y = rand(15, 370);\n ctx.strokeStyle = i % 2 ? \"#284330\" : \"#587650\";\n ctx.lineWidth = rand(1, 4);\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.quadraticCurveTo(x + rand(-25, 25), y + 60, x + rand(-40, 40), y + rand(100, 240));\n ctx.stroke();\n }\n ctx.globalAlpha = 1;\n\n const branch = ctx.createLinearGradient(0, 0, 512, 0);\n branch.addColorStop(0, \"#30261a\");\n branch.addColorStop(.4, \"#735133\");\n branch.addColorStop(.7, \"#48301e\");\n branch.addColorStop(1, \"#241d16\");\n ctx.strokeStyle = branch;\n ctx.lineCap = \"round\";\n ctx.lineWidth = 35;\n ctx.beginPath();\n ctx.moveTo(-30, 423);\n ctx.bezierCurveTo(105, 386, 196, 437, 318, 410);\n ctx.bezierCurveTo(410, 389, 460, 407, 544, 371);\n ctx.stroke();\n ctx.lineWidth = 8;\n ctx.strokeStyle = \"#917148\";\n ctx.globalAlpha = .55;\n ctx.beginPath();\n ctx.moveTo(-18, 414);\n ctx.bezierCurveTo(112, 385, 211, 426, 323, 402);\n ctx.bezierCurveTo(421, 382, 477, 400, 532, 376);\n ctx.stroke();\n ctx.globalAlpha = 1;\n\n function furStroke(x, y, len, color, width = 1, angle = 0) {\n ctx.strokeStyle = color;\n ctx.lineWidth = width;\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.quadraticCurveTo(x + Math.cos(angle) * len * .3 + rand(-2, 2), y + Math.sin(angle) * len * .25,\n x + Math.cos(angle) * len, y + Math.sin(angle) * len + rand(-2, 2));\n ctx.stroke();\n }\n\n // KOALA BODY\n const koalaBody = ctx.createRadialGradient(150, 276, 25, 152, 310, 138);\n koalaBody.addColorStop(0, \"#b7b6aa\");\n koalaBody.addColorStop(.5, \"#74796f\");\n koalaBody.addColorStop(1, \"#303d38\");\n ellipse(155, 319, 100, 120, koalaBody, \"#26312d\", 2);\n\n // striped belly\n ctx.save();\n ctx.beginPath();\n ctx.ellipse(155, 322, 85, 109, 0, 0, Math.PI * 2);\n ctx.clip();\n for (let y = 230; y < 425; y += 22) {\n ctx.fillStyle = \"rgba(36,43,42,.78)\";\n ctx.beginPath();\n ctx.ellipse(155, y, 91, 9, -.06, 0, Math.PI * 2);\n ctx.fill();\n ctx.fillStyle = \"rgba(202,201,184,.16)\";\n ctx.fillRect(67, y + 9, 178, 5);\n }\n ctx.restore();\n\n // arms\n ellipse(82, 351, 25, 68, \"#58635d\", \"#26332e\", 2);\n ellipse(223, 344, 26, 65, \"#57615a\", \"#26332e\", 2);\n ctx.strokeStyle = \"#29342f\";\n ctx.lineWidth = 4;\n for (const [x, y] of [[76,401],[83,403],[91,401],[216,397],[224,400],[232,396]]) {\n ctx.beginPath(); ctx.moveTo(x, y); ctx.lineTo(x + rand(-4,4), y + 15); ctx.stroke();\n }\n\n // ears behind head\n ellipse(89, 194, 48, 55, \"#4a5650\", \"#24302c\", 3);\n ellipse(217, 194, 48, 55, \"#4a5650\", \"#24302c\", 3);\n ellipse(89, 194, 32, 40, \"#9b9d92\");\n ellipse(217, 194, 32, 40, \"#9b9d92\");\n\n // koala head\n const head = ctx.createRadialGradient(146, 177, 15, 151, 220, 115);\n head.addColorStop(0, \"#d3d1c4\");\n head.addColorStop(.55, \"#899087\");\n head.addColorStop(1, \"#394641\");\n ellipse(153, 224, 92, 91, head, \"#26322d\", 2);\n\n // koala stripe mask face\n ctx.save();\n ctx.beginPath(); ctx.ellipse(153, 224, 91, 90, 0, 0, Math.PI * 2); ctx.clip();\n for (let y = 152; y < 300; y += 24) {\n ctx.fillStyle = \"rgba(35,43,42,.74)\";\n ctx.beginPath();\n ctx.moveTo(55, y);\n ctx.quadraticCurveTo(150, y + 8, 250, y - 2);\n ctx.lineTo(250, y + 10);\n ctx.quadraticCurveTo(150, y + 22, 55, y + 13);\n ctx.fill();\n }\n ctx.restore();\n\n // muzzle and eyes\n ellipse(153, 248, 53, 39, \"rgba(211,208,191,.64)\");\n ellipse(119, 219, 16, 18, \"#e3dfcb\");\n ellipse(187, 219, 16, 18, \"#e3dfcb\");\n ellipse(120, 219, 9, 11, \"#1d241f\");\n ellipse(186, 219, 9, 11, \"#1d241f\");\n ellipse(117, 216, 2.5, 3.5, \"#f8f6df\");\n ellipse(183, 216, 2.5, 3.5, \"#f8f6df\");\n ellipse(153, 239, 19, 24, \"#202723\", \"#101512\", 2);\n ellipse(149, 234, 6, 5, \"rgba(255,255,255,.22)\");\n ctx.strokeStyle = \"#26302a\";\n ctx.lineWidth = 2;\n ctx.beginPath(); ctx.moveTo(153, 262); ctx.quadraticCurveTo(145, 272, 136, 267); ctx.stroke();\n ctx.beginPath(); ctx.moveTo(153, 262); ctx.quadraticCurveTo(163, 272, 172, 267); ctx.stroke();\n\n for (let i = 0; i < 260; i++) {\n const a = rand(0, Math.PI * 2), r = Math.sqrt(Math.random()) * 88;\n const x = 153 + Math.cos(a) * r, y = 224 + Math.sin(a) * r;\n if (y < 300) furStroke(x, y, rand(3, 9), Math.random() > .5 ? \"rgba(230,227,211,.36)\" : \"rgba(38,48,44,.4)\", rand(.4, 1.2), a);\n }\n\n // OWL BODY\n const owlBody = ctx.createRadialGradient(367, 280, 18, 370, 310, 145);\n owlBody.addColorStop(0, \"#a67546\");\n owlBody.addColorStop(.55, \"#765037\");\n owlBody.addColorStop(1, \"#2d2924\");\n path([[293,409],[302,295],[327,238],[370,217],[415,240],[440,300],[449,409]], owlBody, \"#221f1d\", 2);\n\n // wings\n ellipse(321, 337, 40, 99, \"#49372c\", \"#241f1b\", 2);\n ellipse(416, 337, 40, 99, \"#4b382b\", \"#241f1b\", 2);\n\n // owl head silhouette and ears\n path([[304,269],[310,179],[339,203],[371,185],[404,203],[434,176],[438,270],[420,310],[372,326],[322,306]], \"#503b2d\", \"#231e1b\", 3);\n\n // facial disks\n const disk = ctx.createRadialGradient(342, 252, 5, 342, 252, 53);\n disk.addColorStop(0, \"#e4cf9a\");\n disk.addColorStop(.6, \"#b38d5d\");\n disk.addColorStop(1, \"#593c2d\");\n ellipse(342, 253, 47, 52, disk, \"#2f2722\", 2);\n ellipse(399, 253, 47, 52, disk, \"#2f2722\", 2);\n ellipse(342, 252, 26, 29, \"#23221d\");\n ellipse(399, 252, 26, 29, \"#23221d\");\n ellipse(342, 253, 14, 19, \"#b8873d\");\n ellipse(399, 253, 14, 19, \"#b8873d\");\n ellipse(342, 253, 8, 15, \"#090a09\");\n ellipse(399, 253, 8, 15, \"#090a09\");\n ellipse(337, 246, 3, 5, \"#f7edc8\");\n ellipse(394, 246, 3, 5, \"#f7edc8\");\n\n // beak\n path([[370,267],[382,267],[376,293]], \"#d5b36a\", \"#392a1f\", 2);\n path([[370,267],[376,293],[376,270]], \"rgba(88,57,27,.45)\");\n\n // feather detail\n ctx.save();\n ctx.beginPath();\n path([[293,409],[302,295],[327,238],[370,217],[415,240],[440,300],[449,409]], null);\n ctx.clip();\n for (let i = 0; i < 360; i++) {\n const x = rand(298, 445), y = rand(210, 412);\n const tone = Math.random();\n furStroke(x, y, rand(4, 15),\n tone < .32 ? \"rgba(225,190,128,.55)\" : tone < .6 ? \"rgba(42,30,25,.55)\" : \"rgba(163,112,70,.52)\",\n rand(.5, 1.5), rand(.8, 2.4));\n }\n ctx.restore();\n\n // distinctive spotted owl markings\n for (let i = 0; i < 115; i++) {\n const x = rand(306, 438), y = rand(290, 405);\n const limit = Math.abs(x - 371) / 1.35;\n if (y > 281 + limit) {\n ellipse(x, y, rand(2, 4.8), rand(2, 4), \"rgba(231,211,167,.82)\");\n ellipse(x - .5, y - .5, 1, 1, \"rgba(255,244,205,.75)\");\n }\n }\n for (let i = 0; i < 24; i++) {\n const x = rand(306, 432), y = rand(185, 235);\n ellipse(x, y, rand(1.5, 3.5), rand(1.5, 3.2), \"rgba(229,201,147,.6)\");\n }\n\n // talons\n ctx.strokeStyle = \"#c2a267\";\n ctx.lineWidth = 3;\n for (let x of [345, 355, 397, 407]) {\n ctx.beginPath();\n ctx.moveTo(x, 405);\n ctx.quadraticCurveTo(x - 4, 419, x + 4, 424);\n ctx.stroke();\n }\n\n // foreground leaves\n for (let i = 0; i < 20; i++) {\n const x = rand(0, 512), y = rand(420, 515);\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rand(-1.5, 1.5));\n ellipse(0, 0, rand(6, 16), rand(16, 30), i % 2 ? \"#36563a\" : \"#526d3c\");\n ctx.restore();\n }\n\n const vignette = ctx.createRadialGradient(256, 250, 180, 256, 250, 390);\n vignette.addColorStop(.55, \"rgba(0,0,0,0)\");\n vignette.addColorStop(1, \"rgba(6,12,10,.55)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0, 0, W, H);\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-1564", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 4629, "code_sha256": "105d5a887ccc1d0995e49b2b728c257eff02917b333e9fbb5b093e6378f0f7b4"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "five wolves on two teal giraffes"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.margin = \"0\";\n stage.style.overflow = \"hidden\";\n\n const svgNS = \"http://www.w3.org/2000/svg\";\n const svg = document.createElementNS(svgNS, \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 512 512\");\n svg.setAttribute(\"width\", \"512\");\n svg.setAttribute(\"height\", \"512\");\n svg.style.display = \"block\";\n\n svg.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n `;\n\n stage.appendChild(svg);\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-1595", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 4970, "code_sha256": "c3268e91b806c356aed7a24ddc34288558c58dfb0f6a6f2f77a6131507e69036"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "a bowl under seven bananas"}, {"role": "assistant", "content": "async function render(stage) {\n const canvas = document.createElement(\"canvas\");\n const dpr = Math.max(1, window.devicePixelRatio || 1);\n canvas.width = 512 * dpr;\n canvas.height = 512 * dpr;\n canvas.style.width = \"512px\";\n canvas.style.height = \"512px\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(dpr, dpr);\n ctx.lineJoin = \"round\";\n ctx.lineCap = \"round\";\n\n const W = 512, H = 512;\n\n function pathEllipse(x, y, rx, ry) {\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n }\n\n // warm wall background\n const bg = ctx.createLinearGradient(0, 0, 0, H);\n bg.addColorStop(0, \"#eee6d9\");\n bg.addColorStop(.63, \"#e4d5c1\");\n bg.addColorStop(.64, \"#b99876\");\n bg.addColorStop(1, \"#937253\");\n ctx.fillStyle = bg;\n ctx.fillRect(0, 0, W, H);\n\n // soft wall glow\n const glow = ctx.createRadialGradient(250, 135, 10, 260, 210, 330);\n glow.addColorStop(0, \"rgba(255,255,250,.65)\");\n glow.addColorStop(1, \"rgba(255,255,255,0)\");\n ctx.fillStyle = glow;\n ctx.fillRect(0, 0, W, 360);\n\n // table grain\n for (let i = 0; i < 110; i++) {\n const y = 350 + (i * 29 % 160);\n const a = 0.018 + (i % 5) * .008;\n ctx.strokeStyle = `rgba(73,42,24,${a})`;\n ctx.lineWidth = 1 + (i % 3) * .35;\n ctx.beginPath();\n ctx.moveTo(0, y);\n ctx.bezierCurveTo(130, y - 3, 340, y + 4, 512, y - 2);\n ctx.stroke();\n }\n\n // cast shadow\n const shadow = ctx.createRadialGradient(257, 390, 20, 257, 390, 190);\n shadow.addColorStop(0, \"rgba(54,30,17,.34)\");\n shadow.addColorStop(.63, \"rgba(54,30,17,.13)\");\n shadow.addColorStop(1, \"rgba(54,30,17,0)\");\n ctx.fillStyle = shadow;\n ctx.beginPath();\n ctx.ellipse(258, 391, 190, 47, 0, 0, Math.PI * 2);\n ctx.fill();\n\n function pointOnQuad(p0, p1, p2, t) {\n const u = 1 - t;\n return {\n x: u * u * p0.x + 2 * u * t * p1.x + t * t * p2.x,\n y: u * u * p0.y + 2 * u * t * p1.y + t * t * p2.y\n };\n }\n\n function banana(base, control, tip, hue) {\n const pts = [];\n const n = 34;\n for (let i = 0; i <= n; i++) {\n const t = i / n;\n const p = pointOnQuad(base, control, tip, t);\n const dx = 2 * (1 - t) * (control.x - base.x) + 2 * t * (tip.x - control.x);\n const dy = 2 * (1 - t) * (control.y - base.y) + 2 * t * (tip.y - control.y);\n const len = Math.hypot(dx, dy) || 1;\n const width = 5 + 13 * Math.pow(Math.sin(Math.PI * Math.min(.97, t)), .72);\n pts.push({ x: p.x, y: p.y, nx: -dy / len, ny: dx / len, w: width });\n }\n\n function fruitPath(expand = 0) {\n ctx.beginPath();\n for (let i = 0; i <= n; i++) {\n const p = pts[i];\n const w = p.w + expand;\n if (i === 0) ctx.moveTo(p.x + p.nx * w, p.y + p.ny * w);\n else ctx.lineTo(p.x + p.nx * w, p.y + p.ny * w);\n }\n for (let i = n; i >= 0; i--) {\n const p = pts[i];\n const w = p.w + expand;\n ctx.lineTo(p.x - p.nx * w, p.y - p.ny * w);\n }\n ctx.closePath();\n }\n\n // dark contour\n fruitPath(1.6);\n ctx.fillStyle = \"rgba(84,58,16,.58)\";\n ctx.fill();\n\n // fruit body\n fruitPath(0);\n const g = ctx.createLinearGradient(tip.x, tip.y, base.x, base.y);\n g.addColorStop(0, \"#d6a719\");\n g.addColorStop(.16, hue || \"#f4cb32\");\n g.addColorStop(.48, \"#ffe566\");\n g.addColorStop(.76, \"#f3c72a\");\n g.addColorStop(1, \"#c88d15\");\n ctx.fillStyle = g;\n ctx.fill();\n\n // clipped natural shading bands\n ctx.save();\n fruitPath(0);\n ctx.clip();\n\n ctx.strokeStyle = \"rgba(116,74,8,.30)\";\n ctx.lineWidth = 8;\n ctx.beginPath();\n for (let i = 0; i <= n; i++) {\n const p = pts[i];\n const offset = p.w * .52;\n if (!i) ctx.moveTo(p.x - p.nx * offset, p.y - p.ny * offset);\n else ctx.lineTo(p.x - p.nx * offset, p.y - p.ny * offset);\n }\n ctx.stroke();\n\n ctx.strokeStyle = \"rgba(255,255,220,.45)\";\n ctx.lineWidth = 3.2;\n ctx.beginPath();\n for (let i = 3; i < n - 3; i++) {\n const p = pts[i];\n const offset = p.w * .33;\n if (i === 3) ctx.moveTo(p.x + p.nx * offset, p.y + p.ny * offset);\n else ctx.lineTo(p.x + p.nx * offset, p.y + p.ny * offset);\n }\n ctx.stroke();\n\n ctx.strokeStyle = \"rgba(119,88,15,.18)\";\n ctx.lineWidth = 1.2;\n ctx.beginPath();\n for (let i = 2; i < n - 2; i++) {\n const p = pts[i];\n if (i === 2) ctx.moveTo(p.x, p.y);\n else ctx.lineTo(p.x, p.y);\n }\n ctx.stroke();\n ctx.restore();\n\n // brown stem at free tip\n const p = pts[n], prev = pts[n - 1];\n const dx = p.x - prev.x, dy = p.y - prev.y;\n const l = Math.hypot(dx, dy) || 1;\n const ex = p.x + dx / l * 10, ey = p.y + dy / l * 10;\n ctx.strokeStyle = \"#5a401d\";\n ctx.lineWidth = 7;\n ctx.beginPath();\n ctx.moveTo(p.x, p.y);\n ctx.lineTo(ex, ey);\n ctx.stroke();\n ctx.strokeStyle = \"#8b6326\";\n ctx.lineWidth = 3;\n ctx.beginPath();\n ctx.moveTo(p.x, p.y);\n ctx.lineTo(ex, ey);\n ctx.stroke();\n pathEllipse(ex, ey, 4, 3);\n ctx.fillStyle = \"#473219\";\n ctx.fill();\n }\n\n // Seven distinct bananas, fanned from the bowl\n banana({x:246,y:320}, {x:181,y:285}, {x:83,y:224}, \"#efc62b\");\n banana({x:249,y:317}, {x:184,y:244}, {x:124,y:134}, \"#f2c82c\");\n banana({x:252,y:317}, {x:220,y:223}, {x:205,y:82}, \"#f8d33b\");\n banana({x:258,y:318}, {x:278,y:210}, {x:292,y:67}, \"#f3cb2d\");\n banana({x:264,y:319}, {x:339,y:237}, {x:371,y:111}, \"#f7d43d\");\n banana({x:269,y:321}, {x:380,y:281}, {x:438,y:171}, \"#efc228\");\n banana({x:271,y:325}, {x:387,y:329}, {x:451,y:263}, \"#f5cf35\");\n\n // central bunch crown\n const crownGrad = ctx.createRadialGradient(257, 314, 3, 257, 314, 32);\n crownGrad.addColorStop(0, \"#a07119\");\n crownGrad.addColorStop(.65, \"#d5a725\");\n crownGrad.addColorStop(1, \"#765014\");\n pathEllipse(258, 316, 27, 15);\n ctx.fillStyle = crownGrad;\n ctx.fill();\n ctx.strokeStyle = \"rgba(72,46,13,.65)\";\n ctx.lineWidth = 2;\n ctx.stroke();\n\n // bowl interior / rim\n pathEllipse(258, 330, 153, 49);\n ctx.fillStyle = \"#244d64\";\n ctx.fill();\n\n const rim = ctx.createLinearGradient(0, 287, 0, 352);\n rim.addColorStop(0, \"#a9d3df\");\n rim.addColorStop(.25, \"#4b8498\");\n rim.addColorStop(.55, \"#173f57\");\n rim.addColorStop(1, \"#0b2d43\");\n pathEllipse(258, 329, 158, 53);\n ctx.fillStyle = rim;\n ctx.fill();\n\n pathEllipse(258, 328, 143, 40);\n ctx.fillStyle = \"#15384e\";\n ctx.fill();\n\n const inside = ctx.createRadialGradient(245, 313, 15, 258, 337, 156);\n inside.addColorStop(0, \"#6da6b5\");\n inside.addColorStop(.42, \"#254e64\");\n inside.addColorStop(1, \"#102d43\");\n pathEllipse(258, 327, 139, 37);\n ctx.fillStyle = inside;\n ctx.fill();\n\n // bowl body\n ctx.beginPath();\n ctx.moveTo(108, 330);\n ctx.bezierCurveTo(116, 376, 152, 420, 220, 430);\n ctx.bezierCurveTo(280, 440, 354, 422, 398, 372);\n ctx.bezierCurveTo(407, 360, 410, 344, 408, 330);\n ctx.bezierCurveTo(345, 357, 174, 358, 108, 330);\n ctx.closePath();\n const bowl = ctx.createLinearGradient(110, 335, 405, 421);\n bowl.addColorStop(0, \"#1c536a\");\n bowl.addColorStop(.24, \"#42849a\");\n bowl.addColorStop(.5, \"#7db3bf\");\n bowl.addColorStop(.76, \"#286278\");\n bowl.addColorStop(1, \"#123b54\");\n ctx.fillStyle = bowl;\n ctx.fill();\n\n ctx.strokeStyle = \"#12364d\";\n ctx.lineWidth = 3;\n ctx.stroke();\n\n // bowl highlight\n ctx.strokeStyle = \"rgba(224,251,246,.52)\";\n ctx.lineWidth = 4;\n ctx.beginPath();\n ctx.moveTo(142, 350);\n ctx.bezierCurveTo(153, 385, 180, 404, 215, 412);\n ctx.stroke();\n\n ctx.strokeStyle = \"rgba(8,30,44,.55)\";\n ctx.lineWidth = 3;\n ctx.beginPath();\n ctx.moveTo(153, 410);\n ctx.bezierCurveTo(225, 447, 328, 441, 374, 401);\n ctx.stroke();\n\n // foreground rim glint\n ctx.strokeStyle = \"rgba(182,232,236,.76)\";\n ctx.lineWidth = 3;\n ctx.beginPath();\n ctx.ellipse(258, 329, 155, 50, 0, .18 * Math.PI, .80 * Math.PI);\n ctx.stroke();\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-1679", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 3601, "code_sha256": "74c71800bdedda226850f516bb0b262e93f24a47a61bc42e971c0998524b77ce"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "six cyan pandas to the right of six brown bottles on seven refrigerators"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n `;\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-1698", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 3297, "code_sha256": "7a05692193768373daf8f746c1656242e498dd082ad86afd5b8e7cdc33e742e5"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "a panda and a plastic airplane and four beige limes"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n `;\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-1765", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 4507, "code_sha256": "b2ce73afc3b2b972f86f6f0f1b2bd907d97d1d97f4540d55a5770e4a86310e18"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "four bears and a keyboard"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.margin = \"0\";\n stage.style.width = \"512px\";\n stage.style.height = \"512px\";\n stage.style.overflow = \"hidden\";\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = 512;\n canvas.style.width = canvas.style.height = \"512px\";\n canvas.style.display = \"block\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n const W = 512, H = 512;\n\n function rr(x, y, w, h, r) {\n ctx.beginPath();\n ctx.moveTo(x + r, y);\n ctx.arcTo(x + w, y, x + w, y + h, r);\n ctx.arcTo(x + w, y + h, x, y + h, r);\n ctx.arcTo(x, y + h, x, y, r);\n ctx.arcTo(x, y, x + w, y, r);\n ctx.closePath();\n }\n\n function ellipse(x, y, rx, ry, fill) {\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n if (fill) ctx.fill();\n }\n\n function shadow(x, y, rx, ry, alpha = 0.2) {\n const g = ctx.createRadialGradient(x, y, 2, x, y, Math.max(rx, ry));\n g.addColorStop(0, `rgba(20,10,6,${alpha})`);\n g.addColorStop(1, \"rgba(20,10,6,0)\");\n ctx.fillStyle = g;\n ellipse(x, y, rx, ry, true);\n }\n\n // warm wall\n let bg = ctx.createLinearGradient(0, 0, 0, H);\n bg.addColorStop(0, \"#dec8ac\");\n bg.addColorStop(.55, \"#caa67f\");\n bg.addColorStop(.56, \"#8b5c39\");\n bg.addColorStop(1, \"#56321e\");\n ctx.fillStyle = bg;\n ctx.fillRect(0, 0, W, H);\n\n // wall paper grain\n for (let i = 0; i < 1400; i++) {\n const x = Math.random() * W, y = Math.random() * 285;\n ctx.fillStyle = Math.random() < .5 ? \"rgba(255,248,220,.055)\" : \"rgba(89,53,28,.035)\";\n ctx.fillRect(x, y, 1, 1 + Math.random() * 3);\n }\n\n // soft window light\n let glow = ctx.createRadialGradient(110, 85, 8, 110, 85, 230);\n glow.addColorStop(0, \"rgba(255,247,211,.5)\");\n glow.addColorStop(1, \"rgba(255,247,211,0)\");\n ctx.fillStyle = glow;\n ctx.fillRect(0, 0, 340, 310);\n\n // tabletop\n ctx.fillStyle = \"#704429\";\n ctx.fillRect(0, 286, W, 226);\n for (let i = 0; i < 105; i++) {\n const y = 294 + Math.random() * 218;\n ctx.strokeStyle = `rgba(43,22,12,${.09 + Math.random() * .11})`;\n ctx.lineWidth = .4 + Math.random() * 1.1;\n ctx.beginPath();\n ctx.moveTo(0, y);\n ctx.bezierCurveTo(140, y - 10 + Math.random() * 20, 330, y + Math.random() * 13, 512, y - 6 + Math.random() * 15);\n ctx.stroke();\n }\n\n shadow(256, 408, 228, 55, .36);\n\n function furTexture(cx, cy, rx, ry, shade) {\n ctx.save();\n ctx.beginPath();\n ctx.ellipse(cx, cy, rx, ry, 0, 0, Math.PI * 2);\n ctx.clip();\n for (let i = 0; i < 115; i++) {\n const a = Math.random() * Math.PI * 2;\n const r = Math.sqrt(Math.random());\n const x = cx + Math.cos(a) * rx * r;\n const y = cy + Math.sin(a) * ry * r;\n ctx.strokeStyle = Math.random() < .55 ? \"rgba(255,232,185,.15)\" : \"rgba(61,31,13,.16)\";\n ctx.lineWidth = .4 + Math.random() * .9;\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.lineTo(x + (Math.random() - .5) * 4, y - 2 - Math.random() * 3);\n ctx.stroke();\n }\n ctx.restore();\n }\n\n function bear(x, baseY, scale, color, earInner, scarf) {\n const s = scale;\n // body and feet\n shadow(x, baseY + 8 * s, 43 * s, 12 * s, .2);\n let g = ctx.createRadialGradient(x - 12*s, baseY - 45*s, 6*s, x, baseY - 10*s, 57*s);\n g.addColorStop(0, \"#e9ba78\");\n g.addColorStop(.56, color);\n g.addColorStop(1, \"#64391f\");\n ctx.fillStyle = g;\n ellipse(x, baseY - 30*s, 42*s, 53*s, true);\n furTexture(x, baseY - 30*s, 40*s, 50*s);\n\n ctx.fillStyle = \"#6a3c21\";\n ellipse(x - 29*s, baseY + 6*s, 20*s, 12*s, true);\n ellipse(x + 29*s, baseY + 6*s, 20*s, 12*s, true);\n ctx.fillStyle = \"rgba(238,181,111,.5)\";\n ellipse(x - 29*s, baseY + 5*s, 10*s, 5*s, true);\n ellipse(x + 29*s, baseY + 5*s, 10*s, 5*s, true);\n\n // ears\n ctx.fillStyle = \"#704024\";\n ellipse(x - 30*s, baseY - 85*s, 20*s, 21*s, true);\n ellipse(x + 30*s, baseY - 85*s, 20*s, 21*s, true);\n ctx.fillStyle = earInner;\n ellipse(x - 30*s, baseY - 84*s, 11*s, 12*s, true);\n ellipse(x + 30*s, baseY - 84*s, 11*s, 12*s, true);\n\n // head\n g = ctx.createRadialGradient(x - 14*s, baseY - 74*s, 5*s, x, baseY - 65*s, 53*s);\n g.addColorStop(0, \"#f2ca86\");\n g.addColorStop(.55, color);\n g.addColorStop(1, \"#684023\");\n ctx.fillStyle = g;\n ellipse(x, baseY - 63*s, 48*s, 45*s, true);\n furTexture(x, baseY - 63*s, 46*s, 43*s);\n\n // snout\n ctx.fillStyle = \"#dca36c\";\n ellipse(x, baseY - 48*s, 21*s, 15*s, true);\n ctx.fillStyle = \"#332018\";\n ellipse(x, baseY - 56*s, 6*s, 4.6*s, true);\n ctx.strokeStyle = \"#3a2119\";\n ctx.lineWidth = 1.4*s;\n ctx.lineCap = \"round\";\n ctx.beginPath();\n ctx.moveTo(x, baseY - 52*s);\n ctx.lineTo(x, baseY - 46*s);\n ctx.moveTo(x, baseY - 46*s);\n ctx.quadraticCurveTo(x - 6*s, baseY - 42*s, x - 10*s, baseY - 46*s);\n ctx.moveTo(x, baseY - 46*s);\n ctx.quadraticCurveTo(x + 6*s, baseY - 42*s, x + 10*s, baseY - 46*s);\n ctx.stroke();\n\n // eyes\n ctx.fillStyle = \"#1c1511\";\n ellipse(x - 16*s, baseY - 68*s, 4.4*s, 5.8*s, true);\n ellipse(x + 16*s, baseY - 68*s, 4.4*s, 5.8*s, true);\n ctx.fillStyle = \"rgba(255,255,255,.85)\";\n ellipse(x - 17.2*s, baseY - 70*s, 1.25*s, 1.5*s, true);\n ellipse(x + 14.8*s, baseY - 70*s, 1.25*s, 1.5*s, true);\n\n // scarf\n if (scarf) {\n ctx.fillStyle = scarf;\n ctx.beginPath();\n ctx.ellipse(x, baseY - 25*s, 41*s, 11*s, 0, 0, Math.PI * 2);\n ctx.fill();\n ctx.fillRect(x + 18*s, baseY - 22*s, 12*s, 32*s);\n ctx.fillStyle = \"rgba(255,231,188,.2)\";\n ctx.fillRect(x + 21*s, baseY - 20*s, 2*s, 27*s);\n }\n }\n\n bear(75, 343, .74, \"#af7040\", \"#c98a5e\", \"#9a2630\");\n bear(184, 348, .88, \"#c1894f\", \"#d79b69\", \"#34587f\");\n bear(318, 345, .84, \"#9e6037\", \"#ba7954\", \"#d59b27\");\n bear(429, 342, .72, \"#bf7b45\", \"#d99767\", \"#537043\");\n\n // keyboard cable\n ctx.strokeStyle = \"#25272a\";\n ctx.lineWidth = 5;\n ctx.beginPath();\n ctx.moveTo(300, 369);\n ctx.bezierCurveTo(339, 348, 348, 333, 331, 318);\n ctx.bezierCurveTo(314, 304, 350, 303, 367, 315);\n ctx.stroke();\n\n // keyboard shadow\n shadow(258, 456, 231, 42, .45);\n\n // keyboard case in perspective\n ctx.beginPath();\n ctx.moveTo(48, 392);\n ctx.lineTo(465, 392);\n ctx.lineTo(493, 484);\n ctx.quadraticCurveTo(490, 499, 472, 501);\n ctx.lineTo(39, 501);\n ctx.quadraticCurveTo(20, 498, 22, 484);\n ctx.closePath();\n let kg = ctx.createLinearGradient(0, 390, 0, 503);\n kg.addColorStop(0, \"#30353a\");\n kg.addColorStop(.25, \"#171a1e\");\n kg.addColorStop(1, \"#090b0d\");\n ctx.fillStyle = kg;\n ctx.fill();\n ctx.strokeStyle = \"#60676b\";\n ctx.lineWidth = 1.3;\n ctx.stroke();\n\n // keyboard top inset\n ctx.beginPath();\n ctx.moveTo(57, 400);\n ctx.lineTo(456, 400);\n ctx.lineTo(475, 472);\n ctx.lineTo(39, 472);\n ctx.closePath();\n ctx.fillStyle = \"#101316\";\n ctx.fill();\n\n function key(x, y, w, h, label, accent) {\n rr(x, y, w, h, 3);\n let g = ctx.createLinearGradient(x, y, x, y + h);\n g.addColorStop(0, accent || \"#4a5157\");\n g.addColorStop(.2, accent ? accent : \"#30363b\");\n g.addColorStop(1, \"#171b1f\");\n ctx.fillStyle = g;\n ctx.fill();\n ctx.strokeStyle = \"rgba(160,175,180,.28)\";\n ctx.lineWidth = .7;\n ctx.stroke();\n if (label) {\n ctx.fillStyle = \"#e5e6df\";\n ctx.font = `bold ${Math.max(6, h * .34)}px Arial`;\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.fillText(label, x + w / 2, y + h / 2 + .5);\n }\n }\n\n const rows = [\n { y: 405, h: 13, keys: [\"ESC\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"0\",\"-\",\"=\",\"\u232b\"] },\n { y: 421, h: 14, keys: [\"TAB\",\"Q\",\"W\",\"E\",\"R\",\"T\",\"Y\",\"U\",\"I\",\"O\",\"P\",\"[\",\"]\",\"\\\\\"] },\n { y: 438, h: 14, keys: [\"CAPS\",\"A\",\"S\",\"D\",\"F\",\"G\",\"H\",\"J\",\"K\",\"L\",\";\",\"'\",\"ENTER\"] }\n ];\n\n rows.forEach((row, ri) => {\n let x = 51;\n row.keys.forEach((lab, i) => {\n let w = 23;\n if (lab === \"ESC\") w = 27;\n if (lab === \"TAB\") w = 34;\n if (lab === \"CAPS\") w = 39;\n if (lab === \"ENTER\") w = 43;\n if (lab === \"\u232b\") w = 34;\n const accent = lab === \"ESC\" ? \"#7b3635\" : null;\n key(x, row.y, w, row.h, lab, accent);\n x += w + 3;\n });\n });\n\n key(51, 455, 34, 14, \"SHIFT\");\n key(88, 455, 22, 14, \"Z\");\n key(113, 455, 22, 14, \"X\");\n key(138, 455, 22, 14, \"C\");\n key(163, 455, 22, 14, \"V\");\n key(188, 455, 22, 14, \"B\");\n key(213, 455, 22, 14, \"N\");\n key(238, 455, 22, 14, \"M\");\n key(263, 455, 22, 14, \",\");\n key(288, 455, 22, 14, \".\");\n key(313, 455, 30, 14, \"SHIFT\");\n key(346, 455, 26, 14, \"\u2191\");\n key(375, 455, 42, 14, \"SHIFT\");\n key(420, 455, 35, 14, \"FN\", \"#304f65\");\n\n key(51, 472, 32, 15, \"CTRL\");\n key(86, 472, 30, 15, \"ALT\");\n key(119, 472, 145, 15, \"\");\n key(267, 472, 31, 15, \"ALT\");\n key(301, 472, 32, 15, \"\u2190\");\n key(336, 472, 32, 15, \"\u2193\");\n key(371, 472, 32, 15, \"\u2192\");\n key(406, 472, 49, 15, \"CTRL\");\n\n // reflected key lights\n ctx.fillStyle = \"rgba(255,214,145,.10)\";\n ctx.fillRect(60, 494, 391, 2);\n\n // tiny warm dust motes\n for (let i = 0; i < 18; i++) {\n ctx.fillStyle = \"rgba(255,232,171,.25)\";\n ellipse(Math.random() * 512, 20 + Math.random() * 265, .5 + Math.random(), .5 + Math.random(), true);\n }\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-1810", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 4474, "code_sha256": "14738a298db22e8045a697967b903989e1d2d3d3d27983c97d6fd41d14d5a126"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "three gray books"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n `;\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-2073", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 3749, "code_sha256": "74d0097508c1d4e63c7ebf88aff7ff9a7e1056074eaafbb79b653424adaf4ee6"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "five hawks in front of two croissants to the left of three spotted toasters"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n `;\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-2139", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 4832, "code_sha256": "596c54293a81efc2bc08aa8252c4e255f30ddc181556ae5a1c3737af3a2dc1bd"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "four stone clocks on five fish, and two checkered kites"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.margin = \"0\";\n stage.style.overflow = \"hidden\";\n stage.style.width = \"512px\";\n stage.style.height = \"512px\";\n\n const svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n svg.setAttribute(\"width\", \"512\");\n svg.setAttribute(\"height\", \"512\");\n svg.setAttribute(\"viewBox\", \"0 0 512 512\");\n svg.style.display = \"block\";\n svg.style.background = \"#8ec5df\";\n\n svg.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n ${[\n {x:90,y:262,s:0.88,h1:2,h2:10},\n {x:190,y:282,s:0.96,h1:10,h2:2},\n {x:294,y:262,s:1.02,h1:8,h2:1},\n {x:405,y:281,s:0.9,h1:1,h2:8}\n ].map((c, i) => `\n \n \n \n \n \n ${Array.from({length:12}, (_, n) => {\n const a = (n * 30 - 90) * Math.PI / 180;\n const x1 = Math.cos(a) * 18, y1 = 2 + Math.sin(a) * 18;\n const x2 = Math.cos(a) * 21, y2 = 2 + Math.sin(a) * 21;\n return ``;\n }).join(\"\")}\n \n \n \n \n \n `).join(\"\")}\n \n\n \n \n `;\n stage.appendChild(svg);\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-2144", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 4836, "code_sha256": "aea4be8a35a8fc166879f582ba7bb9ddf50a995eb9ce034f812e0da7a8d68bf1"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "six plastic turtles chasing four checkered giraffes, and three spotted bagels"}, {"role": "assistant", "content": "async function render(stage) {\n const canvas = document.createElement(\"canvas\");\n const dpr = Math.max(1, window.devicePixelRatio || 1);\n canvas.width = 512 * dpr;\n canvas.height = 512 * dpr;\n canvas.style.width = \"512px\";\n canvas.style.height = \"512px\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(dpr, dpr);\n ctx.lineJoin = \"round\";\n ctx.lineCap = \"round\";\n\n const W = 512, H = 512;\n\n function rng(seed) {\n let s = seed;\n return () => {\n s = (s * 16807) % 2147483647;\n return (s - 1) / 2147483646;\n };\n }\n const random = rng(42);\n\n function ellipse(x, y, rx, ry, fill, stroke, lw = 1) {\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n if (fill) ctx.fillStyle = fill, ctx.fill();\n if (stroke) ctx.strokeStyle = stroke, ctx.lineWidth = lw, ctx.stroke();\n }\n\n function line(x1, y1, x2, y2, color, width) {\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.strokeStyle = color;\n ctx.lineWidth = width;\n ctx.stroke();\n }\n\n function polygon(points, fill, stroke, lw = 1) {\n ctx.beginPath();\n points.forEach((p, i) => i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]));\n ctx.closePath();\n if (fill) ctx.fillStyle = fill, ctx.fill();\n if (stroke) ctx.strokeStyle = stroke, ctx.lineWidth = lw, ctx.stroke();\n }\n\n // Sky\n const sky = ctx.createLinearGradient(0, 0, 0, 330);\n sky.addColorStop(0, \"#79c8ee\");\n sky.addColorStop(.52, \"#d7eff0\");\n sky.addColorStop(1, \"#f8dfa8\");\n ctx.fillStyle = sky;\n ctx.fillRect(0, 0, W, H);\n\n // Clouds\n function cloud(x, y, s) {\n ctx.save();\n ctx.globalAlpha = .72;\n ellipse(x, y, 30*s, 11*s, \"#ffffff\");\n ellipse(x+25*s, y-7*s, 23*s, 16*s, \"#ffffff\");\n ellipse(x+49*s, y, 31*s, 12*s, \"#ffffff\");\n ellipse(x+18*s, y+5*s, 35*s, 11*s, \"#ffffff\");\n ctx.restore();\n }\n cloud(45, 68, .78);\n cloud(332, 61, 1.1);\n cloud(423, 117, .5);\n\n // Distant hills\n ctx.beginPath();\n ctx.moveTo(0, 242);\n for (let x = 0; x <= 512; x += 12) {\n ctx.lineTo(x, 225 + Math.sin(x * .025) * 14 + Math.sin(x * .061) * 8);\n }\n ctx.lineTo(512, 343);\n ctx.lineTo(0, 343);\n ctx.closePath();\n ctx.fillStyle = \"#719c65\";\n ctx.fill();\n\n ctx.beginPath();\n ctx.moveTo(0, 271);\n for (let x = 0; x <= 512; x += 10) {\n ctx.lineTo(x, 255 + Math.sin(x * .043 + 2) * 11);\n }\n ctx.lineTo(512, 345);\n ctx.lineTo(0, 345);\n ctx.closePath();\n ctx.fillStyle = \"#4f8150\";\n ctx.fill();\n\n // Ground\n const grass = ctx.createLinearGradient(0, 282, 0, 512);\n grass.addColorStop(0, \"#88ae4a\");\n grass.addColorStop(.55, \"#628c38\");\n grass.addColorStop(1, \"#405f2c\");\n ctx.fillStyle = grass;\n ctx.fillRect(0, 280, W, 232);\n\n // Grass texture\n for (let i = 0; i < 450; i++) {\n const x = random() * W;\n const y = 285 + random() * 225;\n const l = 2 + random() * 10;\n ctx.strokeStyle = random() > .55 ? \"rgba(36,81,29,.35)\" : \"rgba(180,205,87,.38)\";\n ctx.lineWidth = .45 + random() * .8;\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.lineTo(x + (random() - .5) * 4, y - l);\n ctx.stroke();\n }\n\n // Warm sunlight\n const glow = ctx.createRadialGradient(455, 110, 10, 455, 110, 290);\n glow.addColorStop(0, \"rgba(255,242,177,.35)\");\n glow.addColorStop(1, \"rgba(255,242,177,0)\");\n ctx.fillStyle = glow;\n ctx.fillRect(0, 0, W, H);\n\n function drawGiraffe(x, y, s, flip) {\n ctx.save();\n ctx.translate(x, y);\n ctx.scale(flip ? -s : s, s);\n\n // Shadow\n ellipse(12, 157, 49, 7, \"rgba(24,41,16,.22)\");\n\n // Legs behind\n const legBack = \"#d7a249\";\n ctx.fillStyle = legBack;\n ctx.strokeStyle = \"#5b3b1f\";\n ctx.lineWidth = 1.7;\n ctx.beginPath();\n ctx.roundRect(-28, 95, 13, 58, 6);\n ctx.roundRect(16, 93, 13, 60, 6);\n ctx.fill(); ctx.stroke();\n ctx.fillStyle = \"#453221\";\n ctx.fillRect(-28, 146, 13, 7);\n ctx.fillRect(16, 146, 13, 7);\n\n // body and neck clipped checker texture\n ctx.save();\n ctx.beginPath();\n ctx.ellipse(-1, 78, 48, 27, -.09, 0, Math.PI*2);\n ctx.moveTo(17, 72);\n ctx.quadraticCurveTo(22, 36, 19, -18);\n ctx.lineTo(40, -18);\n ctx.quadraticCurveTo(42, 36, 34, 78);\n ctx.closePath();\n ctx.clip();\n\n const bodyGrad = ctx.createLinearGradient(-45, 35, 50, 110);\n bodyGrad.addColorStop(0, \"#ffd878\");\n bodyGrad.addColorStop(1, \"#c78935\");\n ctx.fillStyle = bodyGrad;\n ctx.fillRect(-55, -35, 110, 145);\n\n const size = 10;\n for (let yy = -30; yy < 118; yy += size) {\n for (let xx = -55; xx < 60; xx += size) {\n const odd = ((Math.floor((xx+55)/size) + Math.floor((yy+30)/size)) & 1);\n if (odd) {\n ctx.fillStyle = \"rgba(91,58,27,.83)\";\n ctx.fillRect(xx, yy, size, size);\n } else {\n ctx.fillStyle = \"rgba(255,229,132,.32)\";\n ctx.fillRect(xx, yy, size, size);\n }\n }\n }\n ctx.restore();\n\n // Body outline\n ctx.strokeStyle = \"#553a20\";\n ctx.lineWidth = 2;\n ctx.beginPath();\n ctx.ellipse(-1, 78, 48, 27, -.09, 0, Math.PI*2);\n ctx.stroke();\n\n // Neck outline\n ctx.beginPath();\n ctx.moveTo(17, 75);\n ctx.quadraticCurveTo(22, 34, 19, -17);\n ctx.lineTo(40, -17);\n ctx.quadraticCurveTo(43, 34, 34, 78);\n ctx.stroke();\n\n // Front legs\n ctx.fillStyle = \"#d99f43\";\n ctx.strokeStyle = \"#553a20\";\n ctx.beginPath();\n ctx.roundRect(-6, 98, 13, 55, 6);\n ctx.roundRect(31, 94, 13, 59, 6);\n ctx.fill(); ctx.stroke();\n ctx.fillStyle = \"#493321\";\n ctx.fillRect(-6, 146, 13, 7);\n ctx.fillRect(31, 146, 13, 7);\n\n // Head\n const head = ctx.createLinearGradient(19, -43, 57, -2);\n head.addColorStop(0, \"#ffe188\");\n head.addColorStop(1, \"#c98c36\");\n ellipse(34, -27, 20, 15, head, \"#553a20\", 2);\n\n // checker patches on head\n ctx.save();\n ctx.beginPath();\n ctx.ellipse(34, -27, 19, 14, 0, 0, Math.PI*2);\n ctx.clip();\n for (let py = -43; py < -9; py += 8) {\n for (let px = 13; px < 56; px += 8) {\n if (((Math.floor(px/8) + Math.floor(py/8)) & 1) === 0) {\n ctx.fillStyle = \"#6b4421\";\n ctx.fillRect(px, py, 8, 8);\n }\n }\n }\n ctx.restore();\n\n // Ears, ossicones\n polygon([[18,-35],[7,-43],[18,-42]], \"#d2943b\", \"#54381f\", 1.5);\n polygon([[48,-36],[60,-43],[51,-41]], \"#d2943b\", \"#54381f\", 1.5);\n line(25, -39, 23, -53, \"#553a20\", 2.2);\n line(39, -40, 40, -54, \"#553a20\", 2.2);\n ellipse(23, -54, 3.5, 3.5, \"#45301e\");\n ellipse(40, -55, 3.5, 3.5, \"#45301e\");\n\n // face\n ellipse(43, -28, 2.2, 2.6, \"#171414\");\n ellipse(48, -20, 4.2, 2.3, \"#795128\");\n ctx.fillStyle = \"rgba(255,255,255,.8)\";\n ellipse(42.3, -28.7, .65, .7, \"#fff\");\n ctx.restore();\n }\n\n // Four checkered giraffes moving to the right\n drawGiraffe(92, 168, .72, false);\n drawGiraffe(180, 146, .88, false);\n drawGiraffe(290, 161, .78, false);\n drawGiraffe(407, 133, .96, false);\n\n function drawBagel(x, y, s, tilt) {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(tilt);\n ctx.scale(s, s);\n\n ellipse(3, 19, 38, 9, \"rgba(24,37,13,.28)\");\n const outer = ctx.createRadialGradient(-8, -8, 4, 0, 0, 34);\n outer.addColorStop(0, \"#ffd77c\");\n outer.addColorStop(.56, \"#d58a30\");\n outer.addColorStop(1, \"#8b481d\");\n ellipse(0, 0, 31, 24, outer, \"#673719\", 2);\n ellipse(0, 0, 11, 8, \"#68401f\", \"#5a2e15\", 1.5);\n ellipse(-1, -1, 7, 5, \"#c1792c\");\n ctx.save();\n ctx.beginPath();\n ctx.ellipse(0, 0, 27, 20, 0, 0, Math.PI*2);\n ctx.clip();\n const spots = [[-14,-9],[-4,-14],[11,-10],[18,0],[10,12],[-12,10],[-21,2],[1,16]];\n spots.forEach((p, i) => {\n ellipse(p[0], p[1], 2.7 + (i%2), 1.6 + (i%3)*.45, i % 2 ? \"#713b20\" : \"#f1c151\");\n });\n ctx.restore();\n ctx.strokeStyle = \"rgba(255,231,152,.7)\";\n ctx.lineWidth = 1.3;\n ctx.beginPath();\n ctx.arc(-3, -2, 22, 3.65, 5.2);\n ctx.stroke();\n ctx.restore();\n }\n\n // Three spotted bagels\n drawBagel(356, 362, .82, -.18);\n drawBagel(449, 389, .96, .22);\n drawBagel(297, 433, .76, -.34);\n\n function drawTurtle(x, y, s, shellColor, headTurn) {\n ctx.save();\n ctx.translate(x, y);\n ctx.scale(s, s);\n\n // shadow\n ellipse(0, 39, 48, 8, \"rgba(22,42,15,.32)\");\n\n // rear feet and front feet\n const skin = \"#719d63\";\n [[-29,25],[-10,30],[19,29],[36,20]].forEach((p, i) => {\n ctx.save();\n ctx.translate(p[0], p[1]);\n ctx.rotate((i < 2 ? -.35 : .3) + (i === 3 ? .45 : 0));\n ellipse(0, 0, 14, 8, skin, \"#315239\", 1.8);\n line(5, 1, 12, 4, \"#315239\", 1);\n ctx.restore();\n });\n\n // tail\n polygon([[-41,12],[-59,17],[-43,22]], \"#668d59\", \"#315239\", 1.7);\n\n // head and neck\n ctx.save();\n ctx.translate(39, 6);\n ctx.rotate(headTurn);\n ellipse(-5, 4, 16, 12, \"#668e5b\", \"#315239\", 2);\n ellipse(12, 1, 15, 12, \"#7ba76a\", \"#315239\", 2);\n ellipse(19, -2, 2.1, 2.4, \"#131a14\");\n ellipse(19.7, -2.7, .65, .65, \"#fff\");\n line(21, 7, 25, 7, \"#29442f\", 1.3);\n ctx.restore();\n\n // shell\n const shell = ctx.createRadialGradient(-14, -15, 4, 0, 3, 48);\n shell.addColorStop(0, \"#b6e47e\");\n shell.addColorStop(.18, shellColor);\n shell.addColorStop(.74, \"#386b42\");\n shell.addColorStop(1, \"#1f4933\");\n ellipse(-4, 4, 43, 30, shell, \"#254833\", 2.5);\n\n // shell scutes\n ctx.save();\n ctx.beginPath();\n ctx.ellipse(-4, 4, 39, 26, 0, 0, Math.PI*2);\n ctx.clip();\n ctx.strokeStyle = \"rgba(21,61,42,.72)\";\n ctx.lineWidth = 1.6;\n ellipse(-4, 4, 17, 13, null, \"rgba(28,72,45,.85)\", 1.5);\n for (let a = 0; a < 6; a++) {\n const ang = a * Math.PI / 3;\n line(-4 + Math.cos(ang)*17, 4 + Math.sin(ang)*13, -4 + Math.cos(ang)*38, 4 + Math.sin(ang)*23, \"rgba(27,69,44,.72)\", 1.5);\n }\n ctx.restore();\n\n // plastic shine\n ctx.save();\n ctx.globalAlpha = .55;\n ellipse(-18, -8, 14, 6, \"#d7ffc0\");\n ellipse(-27, -2, 6, 3, \"#eaffdb\");\n ctx.restore();\n ctx.restore();\n }\n\n // Six plastic turtles, all racing toward the giraffes\n drawTurtle(56, 390, .72, \"#69a34f\", -.05);\n drawTurtle(134, 430, .82, \"#4f9e66\", .08);\n drawTurtle(214, 375, .67, \"#72aa4f\", -.08);\n drawTurtle(264, 469, .88, \"#4d9a68\", .1);\n drawTurtle(349, 455, .67, \"#75a85a\", -.04);\n drawTurtle(104, 486, .65, \"#55955e\", .06);\n\n // Foreground blades\n for (let i = 0; i < 90; i++) {\n const x = random() * 512;\n const y = 470 + random() * 42;\n ctx.strokeStyle = \"rgba(30,73,25,.65)\";\n ctx.lineWidth = 1 + random();\n ctx.beginPath();\n ctx.moveTo(x, y + 22);\n ctx.quadraticCurveTo(x + (random()-.5)*8, y, x + (random()-.5)*12, y - 10 - random()*17);\n ctx.stroke();\n }\n\n // Fine vignette\n const vignette = ctx.createRadialGradient(256, 240, 170, 256, 240, 410);\n vignette.addColorStop(.6, \"rgba(0,0,0,0)\");\n vignette.addColorStop(1, \"rgba(24,42,20,.28)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0, 0, 512, 512);\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-2162", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 5117, "code_sha256": "1d5d0afdff0d094cbe42dabb0b4b66741f756703bd7270742db398f7c980fb4e"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "a wooden trumpet on a beige motorcycle under a checkered pig"}, {"role": "assistant", "content": "async function render(stage) {\n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = 1024;\n canvas.style.width = \"512px\";\n canvas.style.height = \"512px\";\n canvas.style.display = \"block\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(2, 2);\n ctx.lineJoin = \"round\";\n ctx.lineCap = \"round\";\n\n const W = 512, H = 512;\n const path = (pts, close = true) => {\n ctx.beginPath();\n pts.forEach((p, i) => i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]));\n if (close) ctx.closePath();\n };\n const ellipse = (x, y, rx, ry, fill, stroke, lw = 1) => {\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n if (fill) { ctx.fillStyle = fill; ctx.fill(); }\n if (stroke) { ctx.strokeStyle = stroke; ctx.lineWidth = lw; ctx.stroke(); }\n };\n const line = (a, b, color, width) => {\n ctx.beginPath(); ctx.moveTo(...a); ctx.lineTo(...b);\n ctx.strokeStyle = color; ctx.lineWidth = width; ctx.stroke();\n };\n const grad = (x1,y1,x2,y2,a,b) => {\n const g = ctx.createLinearGradient(x1,y1,x2,y2); g.addColorStop(0,a); g.addColorStop(1,b); return g;\n };\n\n // Warm vintage backdrop\n let bg = ctx.createRadialGradient(255, 230, 30, 255, 230, 470);\n bg.addColorStop(0, \"#efe3c7\");\n bg.addColorStop(.68, \"#d9c69e\");\n bg.addColorStop(1, \"#bfa878\");\n ctx.fillStyle = bg; ctx.fillRect(0,0,W,H);\n ctx.fillStyle = \"rgba(89,60,26,.08)\";\n for(let i=0;i<150;i++){\n const x=(i*83)%512, y=(i*47)%512;\n ctx.fillRect(x,y,1+(i%2),1);\n }\n ctx.fillStyle = \"rgba(255,249,223,.36)\";\n ctx.fillRect(0,0,W,118);\n ctx.fillStyle = \"rgba(99,65,29,.14)\";\n ctx.fillRect(0,399,W,113);\n\n // ground shadows\n ctx.save();\n ctx.filter = \"blur(13px)\";\n ellipse(263, 428, 184, 22, \"rgba(52,33,18,.30)\");\n ellipse(325, 355, 105, 15, \"rgba(51,31,14,.21)\");\n ctx.restore();\n\n // Checkered pig overhead\n ctx.save();\n ctx.translate(7, -8);\n\n // legs behind\n const legFill = grad(0,110,0,224,\"#ead3b6\",\"#b68b65\");\n [[103,142,34,76],[183,146,34,83],[319,143,35,81],[394,132,35,79]].forEach(([x,y,w,h])=>{\n ctx.fillStyle=legFill;\n path([[x,y],[x+w,y],[x+w-3,y+h-13],[x+w-11,y+h],[x+10,y+h],[x+4,y+h-16]]);\n ctx.fill();\n ctx.strokeStyle=\"#755039\";ctx.lineWidth=2;ctx.stroke();\n ellipse(x+w/2,y+h,14,6,\"#68432d\",\"#523320\",1.5);\n });\n\n // tail\n ctx.strokeStyle=\"#8b6042\";ctx.lineWidth=7;\n ctx.beginPath();ctx.moveTo(430,94);ctx.bezierCurveTo(468,72,475,99,451,105);ctx.bezierCurveTo(435,109,449,123,465,112);ctx.stroke();\n\n // pig body\n let pigG=grad(93,46,426,185,\"#f5dfc2\",\"#bd8d65\");\n ctx.fillStyle=pigG;\n ctx.beginPath();\n ctx.moveTo(99,82);\n ctx.bezierCurveTo(104,48,151,33,237,38);\n ctx.bezierCurveTo(321,20,402,39,429,75);\n ctx.bezierCurveTo(453,108,429,150,387,163);\n ctx.bezierCurveTo(310,185,184,178,122,151);\n ctx.bezierCurveTo(91,137,80,106,99,82);\n ctx.fill();ctx.strokeStyle=\"#754d35\";ctx.lineWidth=2.5;ctx.stroke();\n\n // checkered blanket integrated across body\n ctx.save();\n ctx.beginPath();\n ctx.moveTo(116,61);ctx.bezierCurveTo(183,33,341,34,411,65);\n ctx.lineTo(399,134);ctx.bezierCurveTo(314,159,188,151,112,127);ctx.closePath();\n ctx.clip();\n const s=27;\n for(let r=0;r<5;r++) for(let c=0;c<13;c++){\n let x=91+c*s, y=37+r*s;\n ctx.fillStyle=(r+c)%2===0 ? \"#eee4cf\" : \"#293d3a\";\n ctx.fillRect(x,y,s,s);\n ctx.fillStyle=\"rgba(255,255,255,.12)\";\n ctx.fillRect(x+2,y+2,s-4,3);\n }\n ctx.strokeStyle=\"rgba(85,55,32,.42)\";ctx.lineWidth=1;\n for(let x=91;x<450;x+=s){ctx.beginPath();ctx.moveTo(x,34);ctx.lineTo(x,156);ctx.stroke();}\n for(let y=37;y<163;y+=s){ctx.beginPath();ctx.moveTo(85,y);ctx.lineTo(435,y);ctx.stroke();}\n ctx.restore();\n\n // head, ear, snout\n ctx.fillStyle=grad(390,48,468,135,\"#f0d2b3\",\"#b78059\");\n ctx.beginPath();ctx.moveTo(392,64);ctx.bezierCurveTo(444,43,475,67,468,104);ctx.bezierCurveTo(466,139,431,153,400,133);ctx.closePath();ctx.fill();ctx.strokeStyle=\"#744931\";ctx.lineWidth=2;ctx.stroke();\n path([[410,66],[422,31],[441,69]],true);ctx.fillStyle=\"#d49c78\";ctx.fill();ctx.stroke();\n ellipse(452,104,25,18,\"#db9f77\",\"#794d35\",2);\n ellipse(444,105,4,5,\"#69402e\");ellipse(460,105,4,5,\"#69402e\");\n ellipse(433,84,4,5,\"#39271d\");\n // blanket edge\n ctx.strokeStyle=\"#78513a\";ctx.lineWidth=4;\n ctx.beginPath();ctx.moveTo(110,128);ctx.bezierCurveTo(201,158,315,163,398,135);ctx.stroke();\n ctx.restore();\n\n // Motorcycle wheels\n function wheel(x,y,r){\n ellipse(x,y,r,r,\"#232824\",\"#171a17\",3);\n ellipse(x,y,r-7,r-7,\"#b6b1a0\",\"#45443d\",3);\n ellipse(x,y,r-13,r-13,\"#252b29\",\"#101310\",3);\n ellipse(x,y,13,13,\"#d3c9ae\",\"#45443d\",3);\n ellipse(x,y,5,5,\"#4e514a\");\n for(let a=0;a<12;a++){\n let q=a*Math.PI/6;\n line([x+Math.cos(q)*8,y+Math.sin(q)*8],[x+Math.cos(q)*(r-15),y+Math.sin(q)*(r-15)],\"#a69f8d\",1.5);\n }\n ellipse(x,y,r-2,r-2,null,\"rgba(255,236,190,.23)\",1);\n }\n wheel(148,393,55);\n wheel(367,391,57);\n\n // motorcycle frame\n ctx.strokeStyle=\"#5e5a4d\";ctx.lineWidth=8;\n ctx.beginPath();ctx.moveTo(148,391);ctx.lineTo(205,299);ctx.lineTo(281,388);ctx.lineTo(148,391);ctx.moveTo(281,388);ctx.lineTo(350,295);ctx.lineTo(367,391);ctx.stroke();\n ctx.strokeStyle=\"#282e2d\";ctx.lineWidth=4;\n ctx.beginPath();ctx.moveTo(204,299);ctx.lineTo(307,300);ctx.lineTo(350,295);ctx.stroke();\n\n // beige fuel tank\n ctx.fillStyle=grad(216,265,315,337,\"#f4dfad\",\"#a9794c\");\n ctx.beginPath();ctx.moveTo(210,279);ctx.bezierCurveTo(233,253,294,250,320,273);ctx.lineTo(313,319);ctx.bezierCurveTo(282,336,230,326,206,307);ctx.closePath();ctx.fill();\n ctx.strokeStyle=\"#674935\";ctx.lineWidth=3;ctx.stroke();\n ctx.fillStyle=\"rgba(255,248,209,.56)\";\n ctx.beginPath();ctx.moveTo(225,278);ctx.bezierCurveTo(248,264,278,265,290,273);ctx.lineTo(286,280);ctx.bezierCurveTo(257,273,236,278,225,287);ctx.closePath();ctx.fill();\n\n // seat\n ctx.fillStyle=\"#402e25\";\n ctx.beginPath();ctx.moveTo(172,270);ctx.bezierCurveTo(187,254,224,255,244,267);ctx.lineTo(238,280);ctx.lineTo(177,281);ctx.closePath();ctx.fill();\n ctx.strokeStyle=\"#1f1b18\";ctx.lineWidth=2;ctx.stroke();\n line([184,280],[172,322],\"#4b463e\",6);\n line([225,281],[250,335],\"#4b463e\",6);\n\n // engine\n ctx.fillStyle=\"#767467\";ctx.fillRect(239,326,64,46);\n ctx.strokeStyle=\"#353935\";ctx.lineWidth=3;ctx.strokeRect(239,326,64,46);\n for(let y=333;y<369;y+=8) line([242,y],[300,y],\"#d3c7a5\",2);\n ellipse(273,349,16,16,\"#494b43\",\"#242622\",2);\n line([304,353],[350,360],\"#7b7566\",6);\n line([306,367],[354,376],\"#5d5c51\",5);\n\n // fork, bars and headlight\n line([351,294],[376,390],\"#514f45\",8);\n line([360,298],[389,275],\"#4e4a40\",5);\n line([388,275],[408,278],\"#34362f\",5);\n ellipse(356,306,16,16,\"#e6cc84\",\"#554535\",3);\n ellipse(356,306,9,9,\"#fff0b7\");\n line([207,296],[184,266],\"#48473e\",5);\n line([180,265],[156,267],\"#383a34\",5);\n\n // fenders\n ctx.strokeStyle=\"#d7bd88\";ctx.lineWidth=11;\n ctx.beginPath();ctx.arc(148,393,48,Math.PI*1.12,Math.PI*1.89);ctx.stroke();\n ctx.beginPath();ctx.arc(367,391,50,Math.PI*1.1,Math.PI*1.89);ctx.stroke();\n\n // Wooden trumpet balanced diagonally atop motorcycle\n ctx.save();\n ctx.translate(247,235);ctx.rotate(-0.22);\n\n // bell\n let wood=grad(50,0,160,0,\"#6d3518\",\"#d4934a\");\n ctx.fillStyle=wood;\n ctx.beginPath();\n ctx.moveTo(129,8);ctx.bezierCurveTo(158,-10,190,-3,201,22);\n ctx.bezierCurveTo(186,48,151,54,128,35);ctx.closePath();ctx.fill();\n ctx.strokeStyle=\"#492513\";ctx.lineWidth=3;ctx.stroke();\n ellipse(174,22,22,16,\"#3e2113\",\"#5a2e16\",3);\n ellipse(174,22,14,10,\"#24150e\");\n ellipse(171,18,8,4,\"rgba(232,174,93,.35)\");\n\n // long horn tubing\n ctx.strokeStyle=\"#653217\";ctx.lineWidth=18;\n ctx.beginPath();ctx.moveTo(5,12);ctx.lineTo(132,20);ctx.stroke();\n ctx.strokeStyle=\"#bd7838\";ctx.lineWidth=12;\n ctx.beginPath();ctx.moveTo(5,10);ctx.lineTo(132,18);ctx.stroke();\n ctx.strokeStyle=\"rgba(255,204,113,.5)\";ctx.lineWidth=3;\n ctx.beginPath();ctx.moveTo(8,6);ctx.lineTo(128,14);ctx.stroke();\n\n // curved return tube\n ctx.strokeStyle=\"#663117\";ctx.lineWidth=14;\n ctx.beginPath();ctx.moveTo(41,22);ctx.bezierCurveTo(19,53,42,70,69,62);ctx.lineTo(119,45);ctx.stroke();\n ctx.strokeStyle=\"#b66f32\";ctx.lineWidth=8;\n ctx.beginPath();ctx.moveTo(41,21);ctx.bezierCurveTo(21,50,42,62,67,56);ctx.lineTo(119,40);ctx.stroke();\n\n // valves\n [62,84,106].forEach((x,i)=>{\n ctx.fillStyle=\"#9a592b\";ctx.fillRect(x,0,9,29);\n ctx.strokeStyle=\"#482515\";ctx.lineWidth=1.5;ctx.strokeRect(x,0,9,29);\n ellipse(x+4.5,-2,8,4,\"#e4a75a\",\"#583018\",1);\n ellipse(x+4.5,30,6,3,\"#6c3519\");\n });\n // mouthpiece\n ctx.fillStyle=\"#8e522a\";ctx.fillRect(-16,5,22,10);\n ellipse(-17,10,7,6,\"#4d2817\",\"#2d180f\",2);\n ctx.restore();\n\n // foreground dust/light\n ctx.fillStyle=\"rgba(255,242,200,.18)\";\n ctx.fillRect(0,0,512,512);\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-2205", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 4362, "code_sha256": "7e80c5f93b456fbd660f94b9bce9629c5a221ba5caeedbb0fd2d393a39c1adc7"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "a ostrich to the left of six giraffes on four silver peaches"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.margin = \"0\";\n stage.style.overflow = \"hidden\";\n\n const giraffe = (x, base, s, flip = false) => {\n const spots = [\n [0, -102, 4], [5, -88, 3], [-4, -73, 4], [3, -57, 3],\n [-2, -39, 4], [7, -22, 3], [-4, -12, 3],\n [-9, 4, 5], [7, 10, 4], [-4, 22, 4]\n ].map(([sx, sy, r]) =>\n ``\n ).join(\"\");\n\n const maneX = flip ? x + 6 * s : x - 6 * s;\n const faceDir = flip ? -1 : 1;\n\n return `\n \n \n \n ${spots}\n \n \n \n \n \n \n \n \n `;\n };\n\n const peach = (x, y, r) => `\n \n \n \n \n \n \n \n `;\n\n const svg = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n ${peach(205, 425, 35)}\n ${peach(293, 428, 33)}\n ${peach(379, 424, 36)}\n ${peach(457, 430, 31)}\n\n \n ${giraffe(193, 397, .63)}\n ${giraffe(224, 401, .58, true)}\n ${giraffe(276, 402, .62)}\n ${giraffe(311, 405, .56, true)}\n ${giraffe(365, 398, .66)}\n ${giraffe(432, 405, .60, true)}\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n `;\n\n stage.innerHTML = svg;\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-2247", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 4353, "code_sha256": "d530e5fd7d85402eff01a8b8bd5ca506488b092e0cbf29ca934dc4749900b749"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "a dolphin under seven flamingos"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;overflow:hidden;position:relative;\";\n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = 512;\n canvas.style.cssText = \"width:512px;height:512px;display:block;\";\n stage.appendChild(canvas);\n\n const c = canvas.getContext(\"2d\");\n const W = 512, H = 512;\n\n function path(points, fill, stroke, lw = 1) {\n c.beginPath();\n for (let i = 0; i < points.length; i++) {\n const p = points[i];\n if (i === 0) c.moveTo(p[0], p[1]);\n else if (p.length === 2) c.lineTo(p[0], p[1]);\n else c.bezierCurveTo(...p);\n }\n if (fill) c.fillStyle = fill, c.fill();\n if (stroke) c.strokeStyle = stroke, c.lineWidth = lw, c.stroke();\n }\n\n const sky = c.createLinearGradient(0, 0, 0, 220);\n sky.addColorStop(0, \"#73c7df\");\n sky.addColorStop(.48, \"#b8e3dc\");\n sky.addColorStop(.76, \"#f4cfaa\");\n sky.addColorStop(1, \"#ecaf94\");\n c.fillStyle = sky;\n c.fillRect(0, 0, W, 220);\n\n const sun = c.createRadialGradient(401, 70, 4, 401, 70, 58);\n sun.addColorStop(0, \"rgba(255,252,214,.95)\");\n sun.addColorStop(.25, \"rgba(255,238,183,.63)\");\n sun.addColorStop(1, \"rgba(255,229,175,0)\");\n c.fillStyle = sun;\n c.fillRect(330, 5, 160, 145);\n\n // distant mangroves\n c.fillStyle = \"rgba(75,116,113,.40)\";\n for (let i = 0; i < 28; i++) {\n const x = i * 21 + (i % 3) * 5;\n const h = 8 + ((i * 17) % 27);\n c.beginPath();\n c.moveTo(x, 204);\n c.quadraticCurveTo(x + 5, 204 - h, x + 11, 204);\n c.quadraticCurveTo(x + 17, 202 - h * .55, x + 23, 204);\n c.fill();\n }\n\n // water\n const water = c.createLinearGradient(0, 198, 0, 512);\n water.addColorStop(0, \"#55b8c5\");\n water.addColorStop(.16, \"#277f9b\");\n water.addColorStop(.52, \"#14617f\");\n water.addColorStop(1, \"#083d5d\");\n c.fillStyle = water;\n c.fillRect(0, 198, W, 314);\n\n // water surface glints\n for (let i = 0; i < 105; i++) {\n const y = 201 + Math.random() * 305;\n const x = Math.random() * 512;\n const len = 6 + Math.random() * (50 * (1 - (y - 198) / 360));\n const alpha = .05 + Math.random() * .16;\n c.strokeStyle = `rgba(181,244,239,${alpha})`;\n c.lineWidth = Math.random() < .7 ? 1 : 2;\n c.beginPath();\n c.moveTo(x, y);\n c.lineTo(Math.min(512, x + len), y + (Math.random() - .5) * 2);\n c.stroke();\n }\n c.fillStyle = \"rgba(238,190,143,.34)\";\n c.fillRect(0, 198, 512, 5);\n\n // sun reflection\n for (let y = 203; y < 320; y += 8) {\n const spread = 17 + (y - 200) * .42;\n c.strokeStyle = `rgba(255,219,162,${.22 - (y - 203) / 1000})`;\n c.lineWidth = 2;\n c.beginPath();\n c.moveTo(400 - spread * Math.random(), y);\n c.lineTo(400 + spread * Math.random(), y);\n c.stroke();\n }\n\n function flamingo(x, y, s, flip = 1) {\n c.save();\n c.translate(x, y);\n c.scale(s * flip, s);\n\n // blurred reflection and legs\n c.strokeStyle = \"rgba(108,55,71,.32)\";\n c.lineWidth = 1.4;\n c.beginPath();\n c.moveTo(-4, 74); c.lineTo(-7, 130);\n c.moveTo(6, 72); c.lineTo(13, 129);\n c.stroke();\n\n // legs\n c.strokeStyle = \"#7c4d58\";\n c.lineWidth = 2;\n c.beginPath();\n c.moveTo(-6, 49); c.lineTo(-5, 93); c.lineTo(-1, 98); c.lineTo(7, 98);\n c.moveTo(6, 48); c.lineTo(10, 89); c.lineTo(5, 97); c.lineTo(-2, 97);\n c.stroke();\n c.strokeStyle = \"rgba(255,190,193,.8)\";\n c.lineWidth = .8;\n c.beginPath(); c.moveTo(-5, 51); c.lineTo(-5, 91); c.moveTo(6, 50); c.lineTo(10, 88); c.stroke();\n\n // body shadow\n c.fillStyle = \"rgba(120,48,66,.32)\";\n c.beginPath();\n c.ellipse(1, 38, 24, 15, -.12, 0, Math.PI * 2);\n c.fill();\n\n // body\n const body = c.createRadialGradient(-7, 27, 2, 0, 38, 31);\n body.addColorStop(0, \"#ffd2c7\");\n body.addColorStop(.5, \"#f58b91\");\n body.addColorStop(1, \"#c95468\");\n c.fillStyle = body;\n c.beginPath();\n c.ellipse(0, 35, 25, 18, -.1, 0, Math.PI * 2);\n c.fill();\n\n // folded wing\n c.fillStyle = \"#d96372\";\n c.beginPath();\n c.moveTo(-17, 28);\n c.bezierCurveTo(-7, 19, 18, 23, 22, 34);\n c.bezierCurveTo(18, 46, 5, 56, -12, 49);\n c.bezierCurveTo(-2, 45, 7, 39, 10, 30);\n c.bezierCurveTo(0, 33, -8, 34, -17, 28);\n c.fill();\n c.strokeStyle = \"rgba(137,55,69,.30)\";\n c.lineWidth = .8;\n c.beginPath(); c.moveTo(-11, 31); c.quadraticCurveTo(3, 35, 12, 30); c.stroke();\n\n // long S neck\n c.strokeStyle = \"#ed7f88\";\n c.lineCap = \"round\";\n c.lineWidth = 10;\n c.beginPath();\n c.moveTo(-10, 30);\n c.bezierCurveTo(-19, 13, -13, 2, -2, -7);\n c.bezierCurveTo(9, -16, 7, -37, -8, -39);\n c.stroke();\n c.strokeStyle = \"#ffc0b5\";\n c.lineWidth = 3;\n c.beginPath();\n c.moveTo(-13, 29);\n c.bezierCurveTo(-19, 11, -12, 1, -4, -7);\n c.bezierCurveTo(7, -18, 5, -34, -7, -37);\n c.stroke();\n\n // head\n c.fillStyle = \"#f38b90\";\n c.beginPath(); c.ellipse(-10, -40, 8, 7, -.25, 0, Math.PI * 2); c.fill();\n // eye\n c.fillStyle = \"#172333\";\n c.beginPath(); c.arc(-12, -42, 1.35, 0, Math.PI * 2); c.fill();\n // black curved beak and pale tip\n c.fillStyle = \"#1e2530\";\n c.beginPath();\n c.moveTo(-16, -42); c.quadraticCurveTo(-29, -42, -31, -37);\n c.quadraticCurveTo(-25, -34, -17, -37); c.closePath(); c.fill();\n c.fillStyle = \"#e7b7a2\";\n c.beginPath();\n c.moveTo(-29, -37); c.quadraticCurveTo(-32, -36, -31, -34);\n c.quadraticCurveTo(-27, -34, -24, -35); c.closePath(); c.fill();\n\n c.restore();\n }\n\n // Exactly seven flamingos across the shallows\n flamingo(47, 140, .70, 1);\n flamingo(111, 133, .84, -1);\n flamingo(178, 146, .65, 1);\n flamingo(242, 132, .89, -1);\n flamingo(309, 143, .70, 1);\n flamingo(376, 126, .93, -1);\n flamingo(455, 145, .70, 1);\n\n // foreground underwater haze\n const haze = c.createLinearGradient(0, 215, 0, 390);\n haze.addColorStop(0, \"rgba(143,228,222,.16)\");\n haze.addColorStop(1, \"rgba(11,67,93,0)\");\n c.fillStyle = haze;\n c.fillRect(0, 214, 512, 176);\n\n // dolphin shadow\n c.save();\n c.translate(260, 341);\n c.scale(1.18, .85);\n c.fillStyle = \"rgba(3,31,52,.32)\";\n c.beginPath();\n c.ellipse(0, 18, 129, 31, -.04, 0, Math.PI * 2);\n c.fill();\n c.restore();\n\n // dolphin body\n c.save();\n c.translate(257, 321);\n c.rotate(-.08);\n const dolphin = c.createLinearGradient(0, -38, 0, 50);\n dolphin.addColorStop(0, \"#9fc9d3\");\n dolphin.addColorStop(.34, \"#4f879e\");\n dolphin.addColorStop(.72, \"#21566f\");\n dolphin.addColorStop(1, \"#143e59\");\n c.fillStyle = dolphin;\n c.beginPath();\n c.moveTo(-123, 5);\n c.bezierCurveTo(-93, -27, -56, -44, -8, -38);\n c.bezierCurveTo(30, -35, 57, -18, 81, -9);\n c.bezierCurveTo(99, -13, 115, -25, 132, -26);\n c.bezierCurveTo(123, -13, 113, -3, 101, 5);\n c.bezierCurveTo(114, 11, 125, 21, 130, 32);\n c.bezierCurveTo(109, 29, 94, 18, 79, 11);\n c.bezierCurveTo(47, 31, 11, 42, -35, 39);\n c.bezierCurveTo(-73, 36, -106, 24, -123, 5);\n c.fill();\n\n // dorsal fin\n c.fillStyle = \"#27657d\";\n c.beginPath();\n c.moveTo(-3, -33);\n c.bezierCurveTo(4, -66, 20, -76, 35, -78);\n c.bezierCurveTo(25, -51, 21, -32, 25, -19);\n c.closePath(); c.fill();\n\n // lower flipper\n c.fillStyle = \"#205b75\";\n c.beginPath();\n c.moveTo(-4, 28);\n c.bezierCurveTo(15, 42, 22, 57, 17, 70);\n c.bezierCurveTo(0, 61, -15, 49, -27, 33);\n c.closePath(); c.fill();\n\n // far flipper\n c.fillStyle = \"rgba(23,62,82,.82)\";\n c.beginPath();\n c.moveTo(31, 11);\n c.bezierCurveTo(49, 29, 58, 40, 55, 51);\n c.bezierCurveTo(37, 41, 27, 29, 19, 16);\n c.closePath(); c.fill();\n\n // belly\n c.fillStyle = \"rgba(191,221,218,.52)\";\n c.beginPath();\n c.moveTo(-114, 8);\n c.bezierCurveTo(-67, 27, -19, 35, 30, 24);\n c.bezierCurveTo(49, 20, 64, 13, 79, 7);\n c.bezierCurveTo(45, 34, 3, 47, -40, 39);\n c.bezierCurveTo(-79, 34, -104, 22, -114, 8);\n c.fill();\n\n // rostrum / face\n c.fillStyle = \"#79a8b7\";\n c.beginPath();\n c.moveTo(-119, 5);\n c.bezierCurveTo(-141, 2, -153, 7, -163, 16);\n c.bezierCurveTo(-145, 18, -128, 16, -110, 11);\n c.closePath(); c.fill();\n c.fillStyle = \"#d0e4dd\";\n c.beginPath();\n c.moveTo(-158, 16);\n c.bezierCurveTo(-142, 20, -124, 18, -107, 11);\n c.bezierCurveTo(-124, 24, -143, 27, -158, 16);\n c.fill();\n\n // eye and smile\n c.fillStyle = \"#0b2639\";\n c.beginPath(); c.arc(-93, -14, 3.1, 0, Math.PI * 2); c.fill();\n c.fillStyle = \"rgba(244,255,247,.85)\";\n c.beginPath(); c.arc(-94, -15, .8, 0, Math.PI * 2); c.fill();\n c.strokeStyle = \"rgba(8,44,60,.74)\";\n c.lineWidth = 1.6;\n c.beginPath();\n c.moveTo(-151, 16); c.bezierCurveTo(-131, 23, -112, 16, -96, 8); c.stroke();\n\n // body highlight\n c.strokeStyle = \"rgba(222,247,239,.42)\";\n c.lineWidth = 2.2;\n c.beginPath();\n c.moveTo(-78, -28);\n c.bezierCurveTo(-44, -37, 3, -26, 42, -10);\n c.stroke();\n c.restore();\n\n // suspended particles\n for (let i = 0; i < 95; i++) {\n const x = Math.random() * 512, y = 225 + Math.random() * 285;\n const r = Math.random() * 1.4;\n c.fillStyle = `rgba(207,245,234,${.05 + Math.random() * .15})`;\n c.beginPath(); c.arc(x, y, r, 0, Math.PI * 2); c.fill();\n }\n\n // subtle vignette\n const vig = c.createRadialGradient(256, 245, 210, 256, 250, 405);\n vig.addColorStop(.55, \"rgba(0,0,0,0)\");\n vig.addColorStop(1, \"rgba(4,24,42,.30)\");\n c.fillStyle = vig;\n c.fillRect(0, 0, 512, 512);\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-2274", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 4577, "code_sha256": "d1602fd15dc5f4070ffced02d89942a12568fcb84fdb7c963ea9a7509b48d43e"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "two metal pandas, and five green hawks to the right of five metal monkeys"}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;overflow:hidden;position:relative;background:#e8e6df;\";\n\n const svgNS = \"http://www.w3.org/2000/svg\";\n const svg = document.createElementNS(svgNS, \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 512 512\");\n svg.setAttribute(\"width\", \"512\");\n svg.setAttribute(\"height\", \"512\");\n svg.setAttribute(\"xmlns\", svgNS);\n\n svg.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n\n \n \n \n \n \n\n \n \n \n \n \n\n \n `;\n\n stage.appendChild(svg);\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-2410", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 3848, "code_sha256": "771e7d121ae8c34f9912582fe3dfa3d62f506494bc2cd2573340efc8539c4373"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "three oranges to the right of seven checkered hamsters jumping over three sparkling whales"}, {"role": "assistant", "content": "async function render(stage) {\n const canvas = document.createElement(\"canvas\");\n const W = 512, H = 512, dpr = Math.max(1, devicePixelRatio || 1);\n canvas.width = W * dpr;\n canvas.height = H * dpr;\n canvas.style.width = W + \"px\";\n canvas.style.height = H + \"px\";\n stage.appendChild(canvas);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(dpr, dpr);\n ctx.lineJoin = \"round\";\n ctx.lineCap = \"round\";\n\n const rr = (x, y, w, h, r) => {\n ctx.beginPath();\n ctx.roundRect(x, y, w, h, r);\n };\n\n const ellipse = (x, y, rx, ry, fill, stroke, lw = 1) => {\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n if (fill) ctx.fillStyle = fill, ctx.fill();\n if (stroke) ctx.strokeStyle = stroke, ctx.lineWidth = lw, ctx.stroke();\n };\n\n const star = (x, y, r, color = \"#fff8b0\") => {\n ctx.save();\n ctx.translate(x, y);\n ctx.fillStyle = color;\n ctx.shadowColor = color;\n ctx.shadowBlur = 8;\n ctx.beginPath();\n for (let i = 0; i < 8; i++) {\n const a = i * Math.PI / 4;\n const q = i % 2 ? r * 0.22 : r;\n ctx.lineTo(Math.cos(a) * q, Math.sin(a) * q);\n }\n ctx.closePath();\n ctx.fill();\n ctx.restore();\n };\n\n const sky = ctx.createLinearGradient(0, 0, 0, H);\n sky.addColorStop(0, \"#7ed6f4\");\n sky.addColorStop(.55, \"#d9f6f4\");\n sky.addColorStop(.56, \"#5bc2db\");\n sky.addColorStop(1, \"#07588b\");\n ctx.fillStyle = sky;\n ctx.fillRect(0, 0, W, H);\n\n // soft clouds\n ctx.globalAlpha = .55;\n [[\"#f8ffff\", 45, 56, 65], [\"#f8ffff\", 237, 61, 54], [\"#f8ffff\", 359, 40, 72]].forEach(c => {\n ctx.fillStyle = c[0];\n ellipse(c[1], c[2], c[3] * .55, 16, c[0]);\n ellipse(c[1] - 25, c[2] + 4, 25, 13, c[0]);\n ellipse(c[1] + 25, c[2] + 4, 31, 14, c[0]);\n });\n ctx.globalAlpha = 1;\n\n // distant water\n ctx.fillStyle = \"#2b9fca\";\n ctx.fillRect(0, 337, W, 175);\n for (let y = 350; y < 510; y += 18) {\n ctx.strokeStyle = y < 400 ? \"rgba(220,255,255,.35)\" : \"rgba(9,73,126,.25)\";\n ctx.lineWidth = 2;\n for (let x = (y % 3) * 11; x < 520; x += 56) {\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.quadraticCurveTo(x + 15, y - 4, x + 31, y);\n ctx.stroke();\n }\n }\n\n // orange sun glints\n for (const p of [[20,326],[109,351],[197,330],[302,344],[402,329]]) {\n star(p[0], p[1], 4, \"rgba(255,255,225,.9)\");\n }\n\n function whale(x, y, s, flip = 1) {\n ctx.save();\n ctx.translate(x, y);\n ctx.scale(s * flip, s);\n\n // tail\n ctx.fillStyle = \"#174f8b\";\n ctx.strokeStyle = \"#09345f\";\n ctx.lineWidth = 2;\n ctx.beginPath();\n ctx.moveTo(-48, 0);\n ctx.bezierCurveTo(-72, -19, -82, -23, -88, -8);\n ctx.bezierCurveTo(-91, 3, -76, 7, -55, 5);\n ctx.bezierCurveTo(-71, 16, -67, 29, -56, 27);\n ctx.bezierCurveTo(-43, 24, -39, 10, -35, 3);\n ctx.closePath();\n ctx.fill(); ctx.stroke();\n\n // body\n const g = ctx.createLinearGradient(0, -28, 0, 35);\n g.addColorStop(0, \"#438fd1\");\n g.addColorStop(.42, \"#1c609d\");\n g.addColorStop(1, \"#0d3f77\");\n ctx.fillStyle = g;\n ctx.beginPath();\n ctx.moveTo(-53, 2);\n ctx.bezierCurveTo(-37, -34, 28, -42, 58, -13);\n ctx.bezierCurveTo(77, 4, 57, 25, 18, 29);\n ctx.bezierCurveTo(-24, 34, -50, 22, -53, 2);\n ctx.closePath();\n ctx.fill(); ctx.stroke();\n\n // fin\n ctx.fillStyle = \"#164f8b\";\n ctx.beginPath();\n ctx.moveTo(-2, 14);\n ctx.quadraticCurveTo(7, 40, 23, 42);\n ctx.quadraticCurveTo(27, 22, 14, 10);\n ctx.fill(); ctx.stroke();\n\n // underside\n ctx.strokeStyle = \"rgba(190,233,251,.55)\";\n ctx.lineWidth = 2;\n for (let i = 0; i < 5; i++) {\n ctx.beginPath();\n ctx.moveTo(4 + i * 8, 17);\n ctx.quadraticCurveTo(8 + i * 8, 23, 13 + i * 8, 22);\n ctx.stroke();\n }\n\n // eye\n ellipse(42, -8, 3.5, 3.5, \"#071d3d\");\n ellipse(43, -9, 1, 1, \"#fff\");\n ctx.restore();\n\n // sparkling whale accents\n star(x + 8 * s * flip, y - 31 * s, 5 * s, \"#d9fbff\");\n star(x + 33 * s * flip, y + 8 * s, 3.5 * s, \"#dffeff\");\n star(x - 32 * s * flip, y - 16 * s, 3 * s, \"#aef3ff\");\n }\n\n whale(112, 412, .83, 1);\n whale(260, 378, .92, 1);\n whale(390, 438, .78, -1);\n\n function hamster(x, y, s, rot) {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rot);\n ctx.scale(s, s);\n\n // airborne shadow\n ctx.save();\n ctx.rotate(-rot);\n ctx.globalAlpha = .13;\n ellipse(0, 38, 29, 5, \"#104263\");\n ctx.restore();\n\n // ears\n ellipse(-17, -20, 10, 10, \"#d99c6f\", \"#633b34\", 1.4);\n ellipse(14, -20, 10, 10, \"#d99c6f\", \"#633b34\", 1.4);\n ellipse(-17, -20, 5, 5, \"#f7c9a8\");\n ellipse(14, -20, 5, 5, \"#f7c9a8\");\n\n // checker clipped fur body\n ctx.save();\n ctx.beginPath();\n ctx.ellipse(-1, 2, 28, 23, 0, 0, Math.PI * 2);\n ctx.clip();\n\n const fur = ctx.createLinearGradient(0, -24, 0, 26);\n fur.addColorStop(0, \"#f3d79a\");\n fur.addColorStop(1, \"#a8653c\");\n ctx.fillStyle = fur;\n ctx.fillRect(-34, -28, 68, 56);\n\n const colors = [\"#6f4531\", \"#f6dda0\"];\n for (let gy = -25; gy < 28; gy += 9) {\n for (let gx = -31; gx < 32; gx += 9) {\n const even = ((Math.floor((gx + 31) / 9) + Math.floor((gy + 25) / 9)) & 1);\n ctx.fillStyle = colors[even];\n ctx.globalAlpha = .86;\n ctx.fillRect(gx, gy, 8.7, 8.7);\n }\n }\n ctx.restore();\n\n // outline\n ctx.strokeStyle = \"#633b34\";\n ctx.lineWidth = 1.6;\n ctx.beginPath();\n ctx.ellipse(-1, 2, 28, 23, 0, 0, Math.PI * 2);\n ctx.stroke();\n\n // face patch\n ellipse(17, 5, 13, 15, \"rgba(248,217,166,.78)\");\n ellipse(23, 1, 2.7, 3.2, \"#241a1c\");\n ellipse(24, 0, .8, .8, \"#fff\");\n ellipse(29, 9, 3.4, 2.4, \"#e98691\", \"#633b34\", .8);\n\n // whiskers\n ctx.strokeStyle = \"#5b3c35\";\n ctx.lineWidth = .8;\n [-3, 3, 8].forEach(d => {\n ctx.beginPath();\n ctx.moveTo(27, 8);\n ctx.lineTo(42, d + 3);\n ctx.stroke();\n });\n\n // little jumping limbs\n ctx.strokeStyle = \"#774633\";\n ctx.lineWidth = 4.2;\n ctx.beginPath();\n ctx.moveTo(-15, 19); ctx.lineTo(-24, 32); ctx.lineTo(-14, 35);\n ctx.moveTo(8, 22); ctx.lineTo(16, 35); ctx.lineTo(27, 31);\n ctx.stroke();\n\n // tail\n ctx.strokeStyle = \"#d89372\";\n ctx.lineWidth = 2.4;\n ctx.beginPath();\n ctx.moveTo(-28, 9);\n ctx.quadraticCurveTo(-43, 2, -40, -8);\n ctx.stroke();\n\n ctx.restore();\n }\n\n const hamsters = [\n [53, 266, .68, -.25],\n [105, 205, .72, .15],\n [163, 248, .7, -.18],\n [219, 176, .72, .18],\n [277, 238, .68, -.13],\n [329, 187, .72, .13],\n [386, 254, .69, -.2]\n ];\n hamsters.forEach(h => hamster(...h));\n\n // motion arcs\n ctx.strokeStyle = \"rgba(255,255,255,.62)\";\n ctx.lineWidth = 1.5;\n ctx.setLineDash([4, 5]);\n [[48,285,98,223],[151,267,205,194],[266,257,322,204]].forEach(a => {\n ctx.beginPath();\n ctx.arc((a[0]+a[2])/2, a[1]+8, (a[2]-a[0])/2, Math.PI*1.14, Math.PI*1.84);\n ctx.stroke();\n });\n ctx.setLineDash([]);\n\n function orange(x, y, r) {\n ctx.save();\n ctx.translate(x, y);\n ctx.shadowColor = \"rgba(75,46,17,.22)\";\n ctx.shadowBlur = 10;\n ctx.shadowOffsetY = 4;\n const g = ctx.createRadialGradient(-r*.28, -r*.34, r*.05, 0, 0, r);\n g.addColorStop(0, \"#ffd86a\");\n g.addColorStop(.38, \"#ffac19\");\n g.addColorStop(1, \"#db5b08\");\n ellipse(0, 0, r, r, g, \"#a84408\", 1.5);\n ctx.shadowColor = \"transparent\";\n\n ctx.fillStyle = \"rgba(255,231,119,.6)\";\n ellipse(-r*.3, -r*.35, r*.13, r*.08, \"rgba(255,242,163,.74)\");\n ctx.strokeStyle = \"rgba(181,73,6,.35)\";\n ctx.lineWidth = 1;\n for (let a = .35; a < Math.PI * 2; a += .42) {\n ctx.beginPath();\n ctx.arc(0, 0, r*.76, a, a+.08);\n ctx.stroke();\n }\n\n ctx.strokeStyle = \"#49782e\";\n ctx.lineWidth = 3;\n ctx.beginPath();\n ctx.moveTo(0, -r*.83);\n ctx.quadraticCurveTo(0, -r-8, 8, -r-10);\n ctx.stroke();\n ctx.fillStyle = \"#4d9a37\";\n ctx.beginPath();\n ctx.ellipse(10, -r-10, 10, 4, -.42, 0, Math.PI*2);\n ctx.fill();\n ctx.restore();\n }\n\n orange(460, 124, 29);\n orange(458, 260, 31);\n orange(459, 396, 29);\n\n // foreground bubbles\n [[22,420,5],[44,381,3],[171,451,4],[331,461,3],[477,335,4],[423,309,3]].forEach(b => {\n ctx.strokeStyle = \"rgba(225,255,255,.75)\";\n ctx.lineWidth = 1.2;\n ctx.beginPath();\n ctx.arc(b[0], b[1], b[2], 0, Math.PI*2);\n ctx.stroke();\n ctx.fillStyle = \"rgba(255,255,255,.7)\";\n ellipse(b[0]-b[2]*.3, b[1]-b[2]*.35, 1, 1, \"rgba(255,255,255,.9)\");\n });\n}"}], "metadata": {"id": "val-v1-geneval2-synth-v2-2461", "teacher": "gpt-5.6-terra", "sft_sequence_tokens": 4009, "code_sha256": "bd7f6ee715e4ec757230c190cb1266e11eae91e49773c0b7895a0885d23b745b"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "Two women rest forehead to forehead at a candlelit dining table, their untouched mugs beside a silent electric kettle and dark appliances."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.width = \"512px\";\n stage.style.height = \"512px\";\n stage.style.overflow = \"hidden\";\n stage.style.background = \"#171310\";\n\n const svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 512 512\");\n svg.setAttribute(\"width\", \"512\");\n svg.setAttribute(\"height\", \"512\");\n svg.setAttribute(\"preserveAspectRatio\", \"xMidYMid slice\");\n\n svg.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n `;\n\n svg.style.display = \"block\";\n stage.appendChild(svg);\n}"}], "metadata": {"id": "val-v1-broad-v2-affection-validation-001", "teacher": "gpt-5.6-luna", "sft_sequence_tokens": 5229, "code_sha256": "bf279b25202ca3457aea033fb55db674d2c982d7d49d2435e2037f48a2f8a517"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A grandfather and adult granddaughter sit by a cold fireplace, sharing headphones and smiling under the glow of a battery lantern."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.position = \"relative\";\n stage.style.width = \"512px\";\n stage.style.height = \"512px\";\n stage.style.overflow = \"hidden\";\n stage.style.background = \"#151719\";\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = 512;\n canvas.height = 512;\n canvas.style.width = \"512px\";\n canvas.style.height = \"512px\";\n stage.appendChild(canvas);\n const c = canvas.getContext(\"2d\");\n c.imageSmoothingEnabled = true;\n\n const W = 512, H = 512;\n const rng = (() => {\n let s = 17391;\n return () => {\n s = (s * 1664525 + 1013904223) >>> 0;\n return s / 4294967296;\n };\n })();\n\n function rr(x, y, w, h, r, fill, stroke, sw = 1) {\n c.beginPath();\n c.roundRect(x, y, w, h, r);\n if (fill) { c.fillStyle = fill; c.fill(); }\n if (stroke) { c.strokeStyle = stroke; c.lineWidth = sw; c.stroke(); }\n }\n function ellipse(x, y, rx, ry, fill, stroke, sw = 1) {\n c.beginPath();\n c.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n if (fill) { c.fillStyle = fill; c.fill(); }\n if (stroke) { c.strokeStyle = stroke; c.lineWidth = sw; c.stroke(); }\n }\n function line(points, color, width = 1, cap = \"round\") {\n c.beginPath();\n c.moveTo(points[0][0], points[0][1]);\n for (let i = 1; i < points.length; i++) c.lineTo(points[i][0], points[i][1]);\n c.strokeStyle = color;\n c.lineWidth = width;\n c.lineCap = cap;\n c.lineJoin = \"round\";\n c.stroke();\n }\n function poly(points, fill, stroke, sw = 1) {\n c.beginPath();\n c.moveTo(points[0][0], points[0][1]);\n points.slice(1).forEach(p => c.lineTo(p[0], p[1]));\n c.closePath();\n if (fill) { c.fillStyle = fill; c.fill(); }\n if (stroke) { c.strokeStyle = stroke; c.lineWidth = sw; c.stroke(); }\n }\n\n // Dark room\n const bg = c.createLinearGradient(0, 0, 0, 512);\n bg.addColorStop(0, \"#272728\");\n bg.addColorStop(.48, \"#202122\");\n bg.addColorStop(1, \"#111314\");\n c.fillStyle = bg;\n c.fillRect(0, 0, W, H);\n\n // Plaster and wall imperfections\n c.globalAlpha = .16;\n for (let i = 0; i < 250; i++) {\n const x = rng() * 512, y = rng() * 350;\n const r = rng() * 1.5 + .2;\n c.fillStyle = rng() > .5 ? \"#8b8171\" : \"#090a0b\";\n c.fillRect(x, y, r, r);\n }\n c.globalAlpha = 1;\n\n // Wooden floor\n const floor = c.createLinearGradient(0, 365, 0, 512);\n floor.addColorStop(0, \"#40352d\");\n floor.addColorStop(1, \"#211b19\");\n c.fillStyle = floor;\n c.fillRect(0, 365, 512, 147);\n for (let y = 382; y < 512; y += 20) {\n line([[0, y], [512, y + (rng() - .5) * 4]], \"rgba(8,7,7,.42)\", 1);\n }\n for (let i = 0; i < 35; i++) {\n const x = rng() * 512, y = 370 + rng() * 142;\n line([[x, y], [x + 25 + rng() * 45, y + (rng() - .5) * 3]], \"rgba(122,91,66,.16)\", 1);\n }\n\n // Fireplace shadow\n c.save();\n c.shadowColor = \"rgba(0,0,0,.7)\";\n c.shadowBlur = 18;\n c.shadowOffsetY = 5;\n rr(67, 116, 380, 274, 3, \"#252321\");\n c.restore();\n\n // Fireplace stone surround\n const stone = c.createLinearGradient(70, 120, 450, 360);\n stone.addColorStop(0, \"#57524d\");\n stone.addColorStop(.5, \"#423f3d\");\n stone.addColorStop(1, \"#2f2f2e\");\n rr(70, 117, 377, 268, 2, stone, \"#191a1a\", 2);\n\n // stone blocks\n const stones = [\n [73,121,93,43],[169,121,88,43],[260,121,91,43],[354,121,90,43],\n [73,168,61,52],[138,168,98,52],[240,168,76,52],[319,168,125,52],\n [73,224,89,55],[164,224,105,55],[275,224,83,55],[362,224,82,55],\n [73,282,91,48],[169,282,78,48],[251,282,117,48],[370,282,74,48],\n [73,333,63,47],[140,333,105,47],[248,333,91,47],[345,333,99,47]\n ];\n stones.forEach(([x,y,w,h]) => {\n const g = c.createLinearGradient(x,y,x+w,y+h);\n g.addColorStop(0, \"rgba(125,119,110,.17)\");\n g.addColorStop(1, \"rgba(5,6,6,.16)\");\n rr(x, y, w, h, 2, g, \"rgba(14,15,15,.48)\", 1);\n });\n\n // Mantel\n c.save();\n c.shadowColor = \"rgba(0,0,0,.7)\";\n c.shadowBlur = 9;\n c.shadowOffsetY = 4;\n rr(53, 104, 411, 24, 3, \"#4e4944\", \"#1d1d1c\", 2);\n rr(45, 97, 427, 12, 2, \"#766d63\", \"#242321\", 1);\n c.restore();\n line([[57,103],[459,103]], \"rgba(182,166,143,.24)\", 2);\n\n // cold fireplace opening\n const opening = c.createLinearGradient(0, 153, 0, 355);\n opening.addColorStop(0, \"#080b0c\");\n opening.addColorStop(.7, \"#151615\");\n opening.addColorStop(1, \"#302622\");\n rr(124, 151, 259, 211, 3, opening, \"#161717\", 4);\n // soot and inner brick\n line([[128,185],[378,185]], \"rgba(75,69,62,.23)\", 2);\n line([[129,229],[378,229]], \"rgba(78,69,60,.18)\", 2);\n line([[130,276],[377,276]], \"rgba(80,64,55,.2)\", 2);\n // logs and ash\n poly([[167,337],[192,303],[248,322],[293,305],[347,338]], \"#32251f\");\n line([[172,335],[337,335]], \"#171514\", 7);\n line([[190,324],[271,341]], \"#634333\", 5);\n line([[274,329],[325,312]], \"#634333\", 5);\n for (let i=0;i<35;i++) ellipse(145+rng()*210, 341+rng()*13, 1+rng()*2, .7, \"rgba(161,133,107,.3)\");\n\n // warm lantern glow behind subjects\n const glow = c.createRadialGradient(274, 314, 8, 274, 314, 250);\n glow.addColorStop(0, \"rgba(255,190,89,.30)\");\n glow.addColorStop(.28, \"rgba(255,157,57,.13)\");\n glow.addColorStop(1, \"rgba(255,143,42,0)\");\n c.fillStyle = glow;\n c.fillRect(0, 120, 512, 392);\n\n // seating bench\n c.save();\n c.shadowColor = \"rgba(0,0,0,.65)\";\n c.shadowBlur = 10;\n c.shadowOffsetY = 7;\n rr(87, 366, 345, 49, 8, \"#44332c\", \"#171514\", 2);\n c.restore();\n rr(82, 400, 357, 20, 4, \"#2d2522\", \"#171515\", 2);\n line([[98,386],[420,386]], \"rgba(138,98,74,.25)\", 2);\n\n // Grandfather body, left\n poly([[116,382],[121,286],[164,262],[213,276],[244,366],[229,401],[119,401]], \"#39434a\", \"#15191a\", 2);\n // sweater highlights\n line([[130,300],[126,378]], \"rgba(133,145,150,.2)\", 5);\n line([[207,289],[226,365]], \"rgba(8,12,14,.4)\", 7);\n // neck\n rr(157,247,32,37,10, \"#9c7257\", \"#4f382d\", 1);\n // ear\n ellipse(149,210,11,17,\"#a9795d\",\"#513b31\",1);\n // head\n c.save();\n c.shadowColor = \"rgba(0,0,0,.45)\";\n c.shadowBlur = 5;\n ellipse(174,219,43,49,\"#a9795d\",\"#3b2b26\",1.5);\n c.restore();\n // gray hair\n c.beginPath();\n c.moveTo(137,218);\n c.quadraticCurveTo(135,174,174,168);\n c.quadraticCurveTo(213,169,218,207);\n c.lineTo(207,202);\n c.quadraticCurveTo(196,187,184,189);\n c.quadraticCurveTo(163,184,145,207);\n c.closePath();\n c.fillStyle = \"#b5b1a6\"; c.fill();\n line([[145,190],[159,177],[173,187],[188,174],[207,191]], \"rgba(245,240,222,.42)\", 3);\n // face features\n ellipse(158,220,3,2.3,\"#29201e\");\n ellipse(188,220,3,2.3,\"#29201e\");\n line([[164,239],[180,241],[188,237]], \"#603d34\", 1.5);\n line([[160,211],[168,209]], \"#54382f\", 2);\n line([[183,209],[193,211]], \"#54382f\", 2);\n line([[172,221],[169,232],[176,233]], \"rgba(92,55,44,.7)\", 1.5);\n // glasses\n c.strokeStyle = \"#282929\"; c.lineWidth = 2;\n c.strokeRect(151,214,21,14); c.strokeRect(179,214,21,14);\n line([[172,219],[179,219]], \"#282929\", 2);\n // grandpa hand\n ellipse(217,334,16,12,\"#a8785b\",\"#51392d\",1);\n line([[213,333],[225,337]], \"#6b493a\", 1);\n\n // Granddaughter torso and cardigan\n poly([[247,393],[252,284],[292,267],[340,288],[375,397]], \"#754d4d\", \"#251c1d\", 2);\n poly([[252,285],[286,302],[306,397],[260,397]], \"#a27567\");\n line([[290,302],[300,389]], \"rgba(242,186,157,.2)\", 3);\n // neck and face\n rr(286,246,29,34,9,\"#d08d6c\",\"#653f34\",1);\n ellipse(302,213,41,49,\"#d09170\",\"#52382f\",1.5);\n // hair mass\n c.beginPath();\n c.moveTo(266,226);\n c.quadraticCurveTo(262,171,306,166);\n c.quadraticCurveTo(353,165,355,218);\n c.quadraticCurveTo(350,264,329,276);\n c.lineTo(328,237);\n c.quadraticCurveTo(314,252,292,246);\n c.lineTo(279,268);\n c.quadraticCurveTo(264,255,266,226);\n c.closePath();\n c.fillStyle = \"#3b2926\"; c.fill();\n c.beginPath();\n c.moveTo(273,194);\n c.quadraticCurveTo(308,163,345,194);\n c.quadraticCurveTo(318,182,281,219);\n c.closePath();\n c.fillStyle = \"#53322c\"; c.fill();\n // hair strands\n for (let i=0;i<8;i++) line([[278+i*9,184+rng()*8],[267+i*10,222+rng()*12]],\"rgba(173,102,74,.35)\",2);\n // face\n ellipse(287,215,3,2.5,\"#30201f\");\n ellipse(316,215,3,2.5,\"#30201f\");\n line([[281,207],[291,205]], \"#694037\", 2);\n line([[311,205],[321,207]], \"#694037\", 2);\n line([[292,235],[303,240],[315,235]], \"#753d3b\", 2);\n ellipse(279,229,7,4,\"rgba(228,125,116,.22)\");\n ellipse(321,229,7,4,\"rgba(228,125,116,.22)\");\n // arm toward grandpa\n line([[259,301],[234,341],[211,349]], \"#945f5a\", 18);\n ellipse(210,349,10,8,\"#c38365\");\n // other hand near lantern\n ellipse(354,340,12,9,\"#ce8a69\");\n\n // Shared headphones arch\n c.beginPath();\n c.arc(238,226,70,Math.PI*1.08,Math.PI*1.91);\n c.strokeStyle = \"#181a1c\"; c.lineWidth = 7; c.stroke();\n c.beginPath();\n c.arc(238,226,70,Math.PI*1.08,Math.PI*1.91);\n c.strokeStyle = \"#736761\"; c.lineWidth = 2; c.stroke();\n rr(166,213,15,30,6,\"#24282b\",\"#0e1011\",2);\n rr(329,207,16,31,6,\"#24282b\",\"#0e1011\",2);\n ellipse(174,228,7,10,\"#454c4e\");\n ellipse(337,222,7,10,\"#454c4e\");\n // cable\n line([[337,237],[347,277],[342,316],[315,348],[304,365]], \"#121617\", 2);\n line([[337,237],[347,277],[342,316],[315,348],[304,365]], \"rgba(126,132,127,.32)\", .7);\n\n // Lantern foreground\n c.save();\n c.shadowColor = \"rgba(0,0,0,.65)\";\n c.shadowBlur = 13;\n c.shadowOffsetY = 5;\n rr(263,302,57,76,8,\"#282d2d\",\"#111515\",2);\n c.restore();\n // lantern glow glass\n rr(272,317,39,43,4,\"rgba(255,177,76,.82)\",\"#77736a\",2);\n const flame = c.createRadialGradient(291,339,2,291,339,23);\n flame.addColorStop(0,\"#fff6bd\");\n flame.addColorStop(.3,\"#ffd36a\");\n flame.addColorStop(1,\"rgba(255,119,24,.12)\");\n rr(275,320,33,38,3,flame);\n // flame\n c.beginPath();\n c.moveTo(291,351);\n c.quadraticCurveTo(280,343,290,329);\n c.quadraticCurveTo(294,338,298,342);\n c.quadraticCurveTo(302,349,291,351);\n c.fillStyle=\"#fff3b0\"; c.fill();\n // lantern frame\n line([[268,317],[268,361]],\"#555958\",4);\n line([[315,317],[315,361]],\"#555958\",4);\n line([[267,317],[316,317]],\"#5f625e\",4);\n line([[267,361],[316,361]],\"#4b504d\",4);\n rr(260,365,64,10,3,\"#212625\",\"#101313\",2);\n rr(274,292,38,10,4,\"#252a29\",\"#101211\",2);\n c.beginPath();\n c.arc(293,300,25,Math.PI,Math.PI*2);\n c.strokeStyle=\"#383e3b\"; c.lineWidth=3; c.stroke();\n\n // foreground rug/shadows\n const shadow = c.createRadialGradient(260,424,20,260,424,185);\n shadow.addColorStop(0,\"rgba(0,0,0,.38)\");\n shadow.addColorStop(1,\"rgba(0,0,0,0)\");\n c.fillStyle=shadow; c.fillRect(60,375,400,137);\n\n // warm highlights over faces and lantern\n c.globalCompositeOperation = \"screen\";\n const faceGlow = c.createRadialGradient(270,286,15,270,286,130);\n faceGlow.addColorStop(0,\"rgba(255,184,101,.16)\");\n faceGlow.addColorStop(1,\"rgba(255,145,53,0)\");\n c.fillStyle=faceGlow; c.fillRect(100,150,300,300);\n c.globalCompositeOperation = \"source-over\";\n\n // fine grain\n c.globalAlpha = .07;\n for (let i=0;i<1800;i++) {\n const x=rng()*512,y=rng()*512;\n c.fillStyle=rng()>.5?\"#fff\":\"#000\";\n c.fillRect(x,y,1,1);\n }\n c.globalAlpha = 1;\n}"}], "metadata": {"id": "val-v1-broad-v2-affection-validation-005", "teacher": "gpt-5.6-luna", "sft_sequence_tokens": 6004, "code_sha256": "1c3ccc5a9978a078470c9e93163e32e11b2513bab15675e28d0f9537f89e0afa"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A family of four cuddles beneath quilts on a sofa, watching candle shadows ripple across the walls of their dark living room."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = `\n width:512px;height:512px;position:relative;overflow:hidden;\n background:#09090b;\n `;\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = 1024;\n canvas.height = 1024;\n canvas.style.cssText = \"width:512px;height:512px;display:block;\";\n stage.appendChild(canvas);\n const c = canvas.getContext(\"2d\");\n c.scale(2, 2);\n\n const W = 512, H = 512;\n\n function rect(x, y, w, h, fill) {\n c.fillStyle = fill;\n c.fillRect(x, y, w, h);\n }\n function ellipse(x, y, rx, ry, fill, rot = 0) {\n c.save();\n c.translate(x, y);\n c.rotate(rot);\n c.beginPath();\n c.ellipse(0, 0, rx, ry, 0, 0, Math.PI * 2);\n c.fillStyle = fill;\n c.fill();\n c.restore();\n }\n function path(points, fill, stroke = null, sw = 1) {\n c.beginPath();\n c.moveTo(points[0][0], points[0][1]);\n for (let i = 1; i < points.length; i++) c.lineTo(points[i][0], points[i][1]);\n c.closePath();\n c.fillStyle = fill;\n c.fill();\n if (stroke) {\n c.strokeStyle = stroke;\n c.lineWidth = sw;\n c.stroke();\n }\n }\n function line(points, stroke, sw = 1) {\n c.beginPath();\n c.moveTo(points[0][0], points[0][1]);\n for (let i = 1; i < points.length; i++) c.lineTo(points[i][0], points[i][1]);\n c.strokeStyle = stroke;\n c.lineWidth = sw;\n c.lineCap = \"round\";\n c.stroke();\n }\n\n // Room darkness and wall\n let wall = c.createLinearGradient(0, 0, 0, 430);\n wall.addColorStop(0, \"#17161b\");\n wall.addColorStop(.48, \"#242027\");\n wall.addColorStop(1, \"#111014\");\n rect(0, 0, W, H, wall);\n\n // Soft pools of candlelight\n let glow = c.createRadialGradient(405, 301, 5, 405, 301, 260);\n glow.addColorStop(0, \"rgba(255,183,82,.20)\");\n glow.addColorStop(.35, \"rgba(198,117,54,.10)\");\n glow.addColorStop(1, \"rgba(0,0,0,0)\");\n rect(0, 30, W, 390, glow);\n\n let glow2 = c.createRadialGradient(74, 334, 5, 74, 334, 180);\n glow2.addColorStop(0, \"rgba(255,171,67,.16)\");\n glow2.addColorStop(1, \"rgba(0,0,0,0)\");\n rect(0, 100, W, 330, glow2);\n\n // faint wall molding and framed darkness\n rect(0, 386, 512, 5, \"#0b0a0e\");\n line([[14, 78], [154, 78], [154, 224]], \"rgba(255,210,150,.035)\", 2);\n line([[354, 54], [484, 54], [484, 255]], \"rgba(255,210,150,.025)\", 2);\n\n // Rippled candle shadows on wall\n c.save();\n c.filter = \"blur(10px)\";\n path([[25,116],[48,99],[61,123],[55,164],[71,209],[42,241],[18,218],[27,174]], \"rgba(3,3,8,.48)\");\n path([[95,80],[120,104],[110,143],[133,181],[111,221],[87,201],[91,160],[76,127]], \"rgba(3,3,8,.40)\");\n path([[401,67],[424,90],[410,137],[438,174],[425,225],[398,199],[405,154],[383,117]], \"rgba(2,2,7,.48)\");\n path([[457,96],[481,119],[469,171],[492,207],[470,263],[449,231],[459,182],[443,141]], \"rgba(2,2,7,.42)\");\n c.restore();\n\n // wavering finer shadows\n c.save();\n c.globalAlpha = .23;\n line([[45,100],[58,147],[48,188],[62,228]], \"#08070b\", 8);\n line([[107,96],[99,139],[119,181],[105,225]], \"#08070b\", 11);\n line([[416,90],[403,132],[420,170],[408,211]], \"#07060a\", 9);\n line([[470,112],[458,158],[477,199],[460,246]], \"#07060a\", 10);\n c.restore();\n\n // Floor\n let floor = c.createLinearGradient(0, 389, 0, 512);\n floor.addColorStop(0, \"#141116\");\n floor.addColorStop(1, \"#08080b\");\n path([[0,389],[512,389],[512,512],[0,512]], floor);\n for (let i = 0; i < 9; i++) {\n line([[0, 405 + i * 14], [512, 394 + i * 14]], `rgba(124,92,74,${.035 - i*.002})`, 1);\n }\n\n // Candle side table and candle at right\n c.save();\n c.shadowColor = \"rgba(255,146,42,.25)\";\n c.shadowBlur = 18;\n ellipse(441, 393, 55, 10, \"#0a0809\");\n c.restore();\n path([[407,391],[475,391],[470,454],[413,454]], \"#171117\");\n ellipse(441, 391, 35, 7, \"#21171a\");\n rect(429, 358, 23, 35, \"#8f6951\");\n ellipse(440.5, 358, 11.5, 3, \"#c49467\");\n c.save();\n c.shadowColor = \"#f89d3e\";\n c.shadowBlur = 18;\n ellipse(441, 351, 5, 10, \"#ffca68\");\n c.restore();\n path([[441,340],[437,351],[441,357],[446,350]], \"#f7b649\");\n ellipse(441, 356, 3, 2, \"#fff2b0\");\n\n // Sofa silhouette\n c.save();\n c.shadowColor = \"#000\";\n c.shadowBlur = 22;\n path([[47,326],[70,300],[104,292],[397,292],[446,318],[467,362],[467,461],[39,461],[39,364]], \"#100d12\");\n c.restore();\n path([[48,347],[66,316],[110,305],[390,305],[442,326],[457,363],[457,445],[48,445]], \"#30242a\");\n path([[62,333],[100,314],[391,314],[430,335],[444,370],[437,417],[66,417]], \"#3c2d31\");\n // sofa arms\n path([[40,344],[67,329],[83,344],[80,454],[39,454]], \"#241b22\");\n path([[433,335],[464,347],[475,454],[430,454]], \"#21191f\");\n line([[57,405],[457,405]], \"rgba(7,5,9,.45)\", 5);\n\n // Family shadows behind bodies\n c.save();\n c.filter = \"blur(9px)\";\n ellipse(147, 273, 46, 62, \"rgba(4,3,6,.8)\");\n ellipse(218, 260, 48, 67, \"rgba(4,3,6,.82)\");\n ellipse(287, 265, 45, 65, \"rgba(4,3,6,.82)\");\n ellipse(354, 280, 39, 57, \"rgba(4,3,6,.78)\");\n c.restore();\n\n // Bodies / shoulders\n path([[99,342],[110,299],[145,282],[178,289],[204,327],[209,398],[95,398]], \"#514048\");\n path([[178,337],[193,286],[225,270],[257,283],[278,325],[280,403],[174,403]], \"#574249\");\n path([[247,335],[260,294],[287,280],[319,287],[345,328],[345,403],[244,403]], \"#4b3941\");\n path([[319,351],[330,313],[359,302],[389,320],[410,357],[407,411],[317,411]], \"#3c2f36\");\n\n // Heads, lit from candle side\n ellipse(147, 255, 30, 35, \"#8f6251\", -.04);\n ellipse(221, 241, 32, 38, \"#b27c61\", .03);\n ellipse(290, 251, 29, 35, \"#956651\", -.02);\n ellipse(357, 270, 25, 30, \"#b17d62\", .05);\n\n // Hair\n path([[117,252],[120,224],[143,210],[169,220],[180,249],[167,240],[157,245],[144,232],[133,246]], \"#17151b\");\n path([[188,239],[190,207],[216,190],[244,205],[253,238],[241,226],[231,232],[218,215],[203,234]], \"#292026\");\n path([[264,251],[266,223],[287,211],[310,220],[321,249],[306,238],[294,241],[282,228],[274,246]], \"#201921\");\n path([[335,270],[337,246],[355,233],[375,242],[382,271],[370,258],[360,263],[350,250],[345,271]], \"#38282a\");\n\n // Faces and small highlights\n ellipse(137, 258, 3, 2, \"#21171a\");\n ellipse(158, 257, 3, 2, \"#21171a\");\n line([[145,273],[153,275],[160,272]], \"rgba(46,26,28,.8)\", 1.2);\n ellipse(210, 243, 3, 2, \"#24181a\");\n ellipse(230, 243, 3, 2, \"#24181a\");\n line([[215,259],[224,262],[232,258]], \"rgba(59,30,28,.75)\", 1.2);\n ellipse(280, 255, 3, 2, \"#25191b\");\n ellipse(300, 255, 3, 2, \"#25191b\");\n line([[284,269],[292,271],[299,268]], \"rgba(53,29,29,.7)\", 1.1);\n ellipse(349, 273, 2.5, 2, \"#27181a\");\n ellipse(365, 273, 2.5, 2, \"#27181a\");\n\n // Cuddling arms\n line([[173,319],[196,344],[226,351]], \"#a87560\", 9);\n ellipse(228,351,8,6,\"#b17b62\");\n line([[253,320],[276,345],[303,349]], \"#9b6a57\", 8);\n ellipse(305,349,7,5,\"#b17b62\");\n line([[334,341],[350,359],[374,360]], \"#b37d63\", 7);\n ellipse(376,360,7,5,\"#bd866b\");\n\n // Large shared quilts\n let quilt = c.createLinearGradient(0, 345, 0, 447);\n quilt.addColorStop(0, \"#71606a\");\n quilt.addColorStop(.45, \"#594b59\");\n quilt.addColorStop(1, \"#302932\");\n path([[76,352],[115,337],[164,345],[199,334],[242,349],[282,338],[325,350],[361,341],[422,362],[446,399],[438,446],[72,446],[62,403]], quilt);\n\n // Quilt patchwork seams and blocks\n c.save();\n c.globalAlpha = .48;\n const blocks = [\n [78,365,65,37,\"#6c5360\"],[143,355,62,41,\"#473d50\"],[207,362,59,39,\"#755c64\"],\n [267,353,57,43,\"#4a4656\"],[325,362,59,42,\"#765b61\"],[386,373,45,39,\"#504253\"],\n [73,405,68,37,\"#403747\"],[141,398,62,45,\"#725b66\"],[203,401,64,43,\"#4b4052\"],\n [269,400,61,45,\"#694f5d\"],[330,405,66,40,\"#473c4c\"],[396,412,40,31,\"#6a505e\"]\n ];\n for (const [x,y,w,h,col] of blocks) {\n c.fillStyle = col;\n c.fillRect(x,y,w,h);\n c.strokeStyle = \"rgba(21,16,25,.38)\";\n c.lineWidth = 1.2;\n c.strokeRect(x,y,w,h);\n }\n c.restore();\n line([[73,399],[438,410]], \"rgba(185,145,135,.18)\", 1);\n line([[136,352],[145,443]], \"rgba(20,14,23,.35)\", 1);\n line([[264,347],[269,445]], \"rgba(20,14,23,.35)\", 1);\n line([[351,350],[359,444]], \"rgba(20,14,23,.35)\", 1);\n\n // Quilt edge and warm reflected rim light\n line([[69,445],[438,445]], \"rgba(11,8,14,.8)\", 5);\n line([[94,352],[160,346],[202,356]], \"rgba(255,188,128,.12)\", 2);\n\n // Foreground blanket fold\n path([[62,435],[127,428],[178,440],[237,430],[302,443],[373,432],[446,444],[453,478],[58,478]], \"#28232d\");\n line([[93,449],[152,458],[214,447],[276,461],[346,451],[422,461]], \"rgba(119,90,98,.32)\", 3);\n\n // Light dust / grain for cinematic realism\n const img = c.getImageData(0,0,1024,1024);\n const d = img.data;\n for (let i = 0; i < d.length; i += 4) {\n const n = (Math.random() - .5) * 4;\n d[i] += n; d[i+1] += n; d[i+2] += n;\n }\n c.putImageData(img,0,0);\n\n // vignette\n const vignette = c.createRadialGradient(256,280,145,256,280,370);\n vignette.addColorStop(0,\"rgba(0,0,0,0)\");\n vignette.addColorStop(.72,\"rgba(0,0,0,.12)\");\n vignette.addColorStop(1,\"rgba(0,0,0,.62)\");\n rect(0,0,512,512,vignette);\n}"}], "metadata": {"id": "val-v1-broad-v2-affection-validation-009", "teacher": "gpt-5.6-luna", "sft_sequence_tokens": 5281, "code_sha256": "56643b38c0a5ea94c4e5c0095555087fe4ad5867c2028a3ed51c18dbe1edf3cf"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "Through a massive concrete arch occupying both frame edges, a rainy alley descends past three grouped motorcycles toward a small bridge crossing the background."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;overflow:hidden;background:#20262a;\";\n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = 1024;\n canvas.style.width = canvas.style.height = \"512px\";\n stage.appendChild(canvas);\n const c = canvas.getContext(\"2d\");\n c.scale(2, 2);\n const W = 512, H = 512;\n\n const rnd = (() => {\n let s = 918273;\n return () => {\n s = (s * 1664525 + 1013904223) >>> 0;\n return s / 4294967296;\n };\n })();\n\n function path(points, fill, stroke, width = 1) {\n c.beginPath();\n points.forEach((p, i) => i ? c.lineTo(p[0], p[1]) : c.moveTo(p[0], p[1]));\n c.closePath();\n if (fill) { c.fillStyle = fill; c.fill(); }\n if (stroke) { c.strokeStyle = stroke; c.lineWidth = width; c.stroke(); }\n }\n\n function line(x1, y1, x2, y2, color, width = 1) {\n c.beginPath();\n c.moveTo(x1, y1); c.lineTo(x2, y2);\n c.strokeStyle = color; c.lineWidth = width; c.stroke();\n }\n\n function ellipse(x, y, rx, ry, fill, stroke, width = 1) {\n c.beginPath();\n c.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n if (fill) { c.fillStyle = fill; c.fill(); }\n if (stroke) { c.strokeStyle = stroke; c.lineWidth = width; c.stroke(); }\n }\n\n // dim rainy sky\n const sky = c.createLinearGradient(0, 0, 0, 270);\n sky.addColorStop(0, \"#8b9698\");\n sky.addColorStop(.48, \"#657174\");\n sky.addColorStop(1, \"#303b3e\");\n c.fillStyle = sky;\n c.fillRect(0, 0, W, 512);\n\n // hazy distant buildings\n path([[0, 122], [61, 112], [85, 144], [85, 276], [0, 305]], \"#354145\");\n path([[425, 105], [512, 117], [512, 306], [417, 272]], \"#2d383b\");\n path([[0, 158], [54, 144], [67, 263], [0, 293]], \"#4e595a\");\n path([[457, 150], [512, 158], [512, 281], [454, 264]], \"#4a5556\");\n\n // vague windows\n for (let side of [0, 1]) {\n for (let i = 0; i < 17; i++) {\n const x = side ? 461 + rnd() * 40 : 8 + rnd() * 40;\n const y = 145 + rnd() * 110;\n const w = 3 + rnd() * 7;\n c.fillStyle = `rgba(173,183,178,${.08 + rnd() * .11})`;\n c.fillRect(x, y, w, 1.5 + rnd() * 5);\n }\n }\n\n // distant mist\n const mist = c.createLinearGradient(0, 180, 0, 355);\n mist.addColorStop(0, \"rgba(190,200,196,.15)\");\n mist.addColorStop(1, \"rgba(100,113,111,.04)\");\n c.fillStyle = mist; c.fillRect(0, 150, W, 210);\n\n // alley walls leading toward bridge\n path([[0, 253], [157, 270], [216, 310], [0, 420]], \"#303b3c\");\n path([[512, 246], [350, 270], [294, 311], [512, 416]], \"#263234\");\n path([[0, 278], [159, 290], [210, 321], [0, 352]], \"#4a5352\");\n path([[512, 268], [353, 287], [301, 319], [512, 354]], \"#414b4a\");\n\n // wall seams and stains\n for (let i = 0; i < 18; i++) {\n const y = 272 + i * 7 + rnd() * 5;\n line(0, y, 135 + rnd() * 25, y + rnd() * 3, `rgba(10,18,20,${.16 + rnd() * .16})`, .7);\n line(370 - rnd() * 12, y + rnd() * 3, 512, y - rnd() * 2, `rgba(8,14,16,${.14 + rnd() * .14})`, .7);\n }\n\n // ground\n const ground = c.createLinearGradient(0, 280, 0, 512);\n ground.addColorStop(0, \"#344144\");\n ground.addColorStop(.45, \"#202a2c\");\n ground.addColorStop(1, \"#111a1d\");\n c.fillStyle = ground; c.fillRect(0, 275, W, 237);\n\n // perspective paving strips\n for (let i = 0; i < 23; i++) {\n const y = 292 + i * i * 0.43;\n line(0, y, W, y + rnd() * 2, `rgba(126,140,137,${.08 + rnd() * .08})`, .7);\n }\n for (let x = -100; x < 650; x += 35 + rnd() * 30) {\n line(256, 282, x, 512, `rgba(8,15,17,${.22 + rnd() * .16})`, .7);\n }\n\n // puddles and reflections\n for (let i = 0; i < 34; i++) {\n const x = rnd() * 512, y = 326 + rnd() * 178;\n const rx = 5 + rnd() * 28, ry = .7 + rnd() * 3;\n ellipse(x, y, rx, ry, `rgba(123,146,148,${.05 + rnd() * .12})`);\n line(x - rx * .7, y, x + rx * .7, y, \"rgba(190,204,199,.08)\", .5);\n }\n const reflection = c.createLinearGradient(0, 330, 0, 512);\n reflection.addColorStop(0, \"rgba(164,183,180,.1)\");\n reflection.addColorStop(1, \"rgba(30,40,42,0)\");\n c.fillStyle = reflection;\n c.fillRect(205, 334, 120, 178);\n\n // small bridge in distance\n path([[179, 254], [225, 243], [365, 246], [408, 260], [407, 278], [179, 278]], \"#252f31\");\n path([[193, 247], [226, 237], [366, 239], [396, 250], [396, 258], [193, 258]], \"#59635f\");\n line(192, 255, 397, 258, \"#1a2527\", 3);\n for (let x = 205; x < 390; x += 15) line(x, 248, x - 1, 258, \"rgba(24,31,31,.75)\", 1);\n path([[186, 274], [408, 274], [401, 282], [192, 282]], \"#121b1d\");\n path([[220, 279], [234, 279], [228, 336], [213, 336]], \"#202b2c\");\n path([[359, 279], [373, 279], [387, 334], [372, 334]], \"#1d292b\");\n ellipse(268, 285, 67, 4, \"rgba(0,0,0,.25)\");\n\n // massive concrete arch, outer shape with central opening\n c.save();\n c.beginPath();\n c.rect(0, 0, 512, 512);\n c.moveTo(68, 512);\n c.lineTo(68, 153);\n c.bezierCurveTo(68, 62, 143, 10, 256, 10);\n c.bezierCurveTo(369, 10, 444, 62, 444, 153);\n c.lineTo(444, 512);\n c.lineTo(388, 512);\n c.lineTo(388, 158);\n c.bezierCurveTo(388, 99, 335, 57, 256, 57);\n c.bezierCurveTo(177, 57, 124, 99, 124, 158);\n c.lineTo(124, 512);\n c.closePath();\n const concrete = c.createLinearGradient(0, 0, 512, 0);\n concrete.addColorStop(0, \"#4b5554\");\n concrete.addColorStop(.12, \"#69716d\");\n concrete.addColorStop(.27, \"#555e5b\");\n concrete.addColorStop(.5, \"#737975\");\n concrete.addColorStop(.73, \"#535b58\");\n concrete.addColorStop(.9, \"#68706c\");\n concrete.addColorStop(1, \"#404b4b\");\n c.fillStyle = concrete;\n c.fill(\"evenodd\");\n c.restore();\n\n // arch inner underside shadow\n c.beginPath();\n c.moveTo(124, 158);\n c.bezierCurveTo(124, 99, 177, 57, 256, 57);\n c.bezierCurveTo(335, 57, 388, 99, 388, 158);\n c.lineTo(379, 160);\n c.bezierCurveTo(373, 108, 324, 70, 256, 70);\n c.bezierCurveTo(188, 70, 139, 108, 133, 160);\n c.closePath();\n c.fillStyle = \"rgba(24,31,32,.56)\";\n c.fill();\n\n // concrete edges, blocks, weathering\n line(124, 159, 124, 512, \"rgba(20,27,28,.55)\", 2);\n line(388, 159, 388, 512, \"rgba(17,24,25,.58)\", 2);\n for (let i = 0; i < 55; i++) {\n const x = rnd() * 512, y = rnd() * 250;\n if ((x < 68 || x > 444 || (y < 155 && x > 75 && x < 437))) {\n const len = 3 + rnd() * 16;\n line(x, y, x + (rnd() - .5) * 4, y + len, `rgba(28,36,36,${.08 + rnd() * .18})`, .5 + rnd());\n }\n }\n for (let y = 30; y < 510; y += 42 + rnd() * 26) {\n line(3, y, 65, y + rnd() * 2, \"rgba(22,29,30,.16)\", .7);\n line(447, y + rnd() * 3, 509, y, \"rgba(22,29,30,.16)\", .7);\n }\n\n // motorcycles\n function motorcycle(x, base, scale, tilt, color) {\n c.save();\n c.translate(x, base);\n c.rotate(tilt);\n c.scale(scale, scale);\n\n // shadow\n ellipse(0, 4, 42, 4, \"rgba(0,0,0,.46)\");\n\n // wheels\n c.lineWidth = 3;\n ellipse(-20, -29, 10, 18, \"#111719\", \"#070b0c\", 2);\n ellipse(27, -29, 10, 18, \"#111719\", \"#070b0c\", 2);\n ellipse(-20, -29, 4, 12, \"#596462\", \"#1b2425\", 1);\n ellipse(27, -29, 4, 12, \"#596462\", \"#1b2425\", 1);\n line(-20, -42, -20, -16, \"rgba(183,194,188,.45)\", .8);\n line(27, -42, 27, -16, \"rgba(183,194,188,.4)\", .8);\n\n // frame and forks\n line(-20, -29, -3, -51, \"#8a9690\", 2);\n line(-3, -51, 27, -29, \"#586561\", 2);\n line(-3, -51, -20, -29, \"#354143\", 3);\n line(27, -29, 22, -64, \"#a3aaa2\", 2);\n line(22, -64, 28, -72, \"#202a2b\", 2);\n\n // engine\n path([[-10,-40],[6,-44],[14,-35],[9,-26],[-8,-27],[-14,-34]], color, \"#111819\", 1.5);\n ellipse(0, -35, 7, 7, \"#293536\", \"#89918b\", 1);\n line(-8, -31, 9, -31, \"#11191a\", 2);\n\n // rear fender and seat\n path([[-31,-47],[-13,-53],[6,-52],[13,-47],[-12,-46]], \"#151d1e\", \"#6c7771\", 1);\n path([[-19,-54],[-3,-59],[15,-55],[11,-50],[-14,-50]], \"#202a2b\");\n\n // tank\n path([[-10,-57],[4,-67],[20,-64],[23,-55],[11,-49],[-6,-50]], color, \"#101719\", 1.3);\n line(3, -64, 17, -61, \"rgba(204,210,199,.48)\", 1);\n\n // handle bars\n line(22, -72, 35, -78, \"#151d1e\", 2);\n line(35, -78, 42, -75, \"#151d1e\", 2);\n line(21, -72, 18, -77, \"#a0aaa2\", 1);\n\n // headlight and tail lamp\n ellipse(30, -77, 5, 5, \"#d7d7b0\", \"#202829\", 1);\n ellipse(-31, -48, 3, 3, \"#c34932\");\n\n // rain gleam\n line(-15, -61, 8, -58, \"rgba(205,218,208,.55)\", 1);\n c.restore();\n }\n\n motorcycle(206, 432, 1.35, -.025, \"#38474a\");\n motorcycle(268, 443, 1.55, .012, \"#20282a\");\n motorcycle(327, 430, 1.28, .035, \"#4a4540\");\n\n // layered wet reflections below bikes\n for (const [x, y, w] of [[206, 450, 34], [268, 464, 42], [327, 451, 29]]) {\n ellipse(x, y, w, 3, \"rgba(108,133,133,.13)\");\n line(x - w, y + 6, x + w, y + 7, \"rgba(141,163,158,.10)\", 1);\n line(x - w * .6, y + 12, x + w * .5, y + 13, \"rgba(114,141,140,.07)\", 1);\n }\n\n // foreground rain, varied density\n c.lineCap = \"round\";\n for (let i = 0; i < 430; i++) {\n const x = rnd() * 512;\n const y = rnd() * 512;\n const len = 4 + rnd() * 13;\n const alpha = .08 + rnd() * .23;\n line(x, y, x - 1.5 - rnd() * 2, y + len, `rgba(191,207,204,${alpha})`, .35 + rnd() * .65);\n }\n\n // sharp nearby rain streaks\n for (let i = 0; i < 55; i++) {\n const x = rnd() * 512, y = rnd() * 500;\n line(x, y, x - 4, y + 22 + rnd() * 18, \"rgba(207,219,214,.24)\", .8);\n }\n\n // subtle vignette\n const vignette = c.createRadialGradient(256, 275, 125, 256, 280, 370);\n vignette.addColorStop(0, \"rgba(0,0,0,0)\");\n vignette.addColorStop(.72, \"rgba(0,0,0,.08)\");\n vignette.addColorStop(1, \"rgba(0,0,0,.42)\");\n c.fillStyle = vignette;\n c.fillRect(0, 0, 512, 512);\n}"}], "metadata": {"id": "val-v1-broad-v2-composition-validation-001", "teacher": "gpt-5.6-luna", "sft_sequence_tokens": 5217, "code_sha256": "a956c1daeb9cdf4409687b8e3dcb2cfb90c36295247f930b8b5eb9da0bf5d695"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A close foreground arch creates a dark border around a lantern-lit rainy alley; two cats shelter on the left doorstep while water barrels stand opposite."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;overflow:hidden;background:#090b0c;\";\n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = 512;\n canvas.style.cssText = \"display:block;width:512px;height:512px;\";\n stage.appendChild(canvas);\n const ctx = canvas.getContext(\"2d\");\n\n let seed = 918273;\n const rnd = () => {\n seed = (seed * 1664525 + 1013904223) >>> 0;\n return seed / 4294967296;\n };\n const clamp = (v, a, b) => Math.max(a, Math.min(b, v));\n const line = (x1, y1, x2, y2, color, width = 1) => {\n ctx.strokeStyle = color;\n ctx.lineWidth = width;\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n };\n const poly = (pts, fill, stroke, sw = 1) => {\n ctx.beginPath();\n ctx.moveTo(pts[0][0], pts[0][1]);\n for (let i = 1; i < pts.length; i++) ctx.lineTo(pts[i][0], pts[i][1]);\n ctx.closePath();\n if (fill) ctx.fillStyle = fill, ctx.fill();\n if (stroke) ctx.strokeStyle = stroke, ctx.lineWidth = sw, ctx.stroke();\n };\n\n ctx.fillStyle = \"#07090b\";\n ctx.fillRect(0, 0, 512, 512);\n\n // Opening of the heavy foreground arch\n const opening = new Path2D();\n opening.moveTo(43, 474);\n opening.lineTo(43, 190);\n opening.bezierCurveTo(45, 112, 94, 45, 177, 25);\n opening.bezierCurveTo(226, 13, 286, 12, 337, 29);\n opening.bezierCurveTo(424, 57, 469, 119, 469, 200);\n opening.lineTo(469, 474);\n opening.closePath();\n\n ctx.save();\n ctx.clip(opening);\n\n // Atmospheric alley background\n const sky = ctx.createLinearGradient(0, 0, 0, 420);\n sky.addColorStop(0, \"#111820\");\n sky.addColorStop(.45, \"#1a2328\");\n sky.addColorStop(1, \"#344047\");\n ctx.fillStyle = sky;\n ctx.fillRect(0, 0, 512, 512);\n\n // distant mist\n const mist = ctx.createRadialGradient(259, 227, 5, 259, 227, 260);\n mist.addColorStop(0, \"rgba(172,185,174,.30)\");\n mist.addColorStop(.35, \"rgba(120,145,142,.13)\");\n mist.addColorStop(1, \"rgba(30,40,43,0)\");\n ctx.fillStyle = mist;\n ctx.fillRect(0, 0, 512, 450);\n\n // left buildings\n poly([[0, 116], [159, 91], [217, 146], [217, 369], [0, 412]], \"#151c21\");\n poly([[0, 168], [151, 136], [205, 172], [205, 351], [0, 388]], \"#242d31\");\n poly([[0, 192], [105, 170], [105, 388], [0, 410]], \"#303a3d\");\n poly([[105, 170], [205, 176], [205, 351], [105, 388]], \"#1c272b\");\n\n // right buildings\n poly([[512, 108], [353, 88], [300, 143], [300, 370], [512, 409]], \"#12191d\");\n poly([[512, 154], [370, 137], [316, 173], [316, 353], [512, 389]], \"#283135\");\n poly([[512, 192], [405, 176], [405, 388], [512, 408]], \"#354044\");\n poly([[316, 173], [405, 176], [405, 388], [316, 353]], \"#202a2e\");\n\n // masonry blocks\n ctx.globalAlpha = .28;\n for (let side = 0; side < 2; side++) {\n for (let y = 125; y < 340; y += 29 + rnd() * 7) {\n for (let x = side ? 325 : 8; x < (side ? 500 : 195); x += 48 + rnd() * 18) {\n const w = 30 + rnd() * 35;\n line(x, y, x + w, y - rnd() * 2, \"rgba(111,126,126,.35)\", .7);\n }\n }\n }\n ctx.globalAlpha = 1;\n\n // windows and doors\n for (const x of [24, 74, 127, 373, 430, 474]) {\n const y = 170 + rnd() * 28;\n ctx.fillStyle = \"rgba(7,13,15,.8)\";\n ctx.fillRect(x, y, 25, 59);\n ctx.strokeStyle = \"rgba(111,123,119,.35)\";\n ctx.strokeRect(x - 2, y - 2, 29, 63);\n line(x + 12, y, x + 12, y + 59, \"rgba(84,99,98,.32)\");\n }\n ctx.fillStyle = \"#101619\";\n ctx.fillRect(185, 182, 39, 178);\n ctx.fillRect(287, 178, 42, 184);\n\n // far end\n poly([[214, 144], [298, 144], [324, 287], [190, 287]], \"#182226\");\n poly([[239, 166], [275, 166], [285, 261], [226, 261]], \"#090f12\");\n const farGlow = ctx.createRadialGradient(255, 230, 1, 255, 230, 75);\n farGlow.addColorStop(0, \"rgba(218,165,83,.26)\");\n farGlow.addColorStop(1, \"rgba(218,165,83,0)\");\n ctx.fillStyle = farGlow;\n ctx.fillRect(170, 135, 170, 170);\n\n // ground plane\n const ground = ctx.createLinearGradient(0, 267, 0, 512);\n ground.addColorStop(0, \"#334247\");\n ground.addColorStop(.38, \"#263337\");\n ground.addColorStop(1, \"#11191d\");\n poly([[0, 267], [512, 267], [512, 512], [0, 512]], ground);\n\n // perspective paving lines and puddles\n for (let i = 0; i < 18; i++) {\n const y = 276 + Math.pow(i / 18, 1.7) * 242;\n line(0, y, 512, y + rnd() * 3, `rgba(131,153,151,${.08 + rnd() * .1})`, .8);\n }\n for (let i = 0; i < 14; i++) {\n const bx = rnd() * 512;\n line(256 + (bx - 256) * .08, 267, bx, 512, \"rgba(10,17,19,.22)\", 1);\n }\n for (let i = 0; i < 34; i++) {\n const x = rnd() * 512, y = 305 + rnd() * 195;\n ctx.fillStyle = `rgba(128,155,155,${.035 + rnd() * .07})`;\n ctx.beginPath();\n ctx.ellipse(x, y, 8 + rnd() * 25, 1 + rnd() * 3, 0, 0, Math.PI * 2);\n ctx.fill();\n }\n\n // lantern glow, mounted left\n const glow = ctx.createRadialGradient(155, 225, 3, 155, 225, 135);\n glow.addColorStop(0, \"rgba(255,211,116,.54)\");\n glow.addColorStop(.12, \"rgba(245,171,66,.27)\");\n glow.addColorStop(.45, \"rgba(215,120,38,.09)\");\n glow.addColorStop(1, \"rgba(214,108,26,0)\");\n ctx.fillStyle = glow;\n ctx.fillRect(20, 90, 275, 280);\n\n // warm reflection\n ctx.save();\n ctx.globalCompositeOperation = \"screen\";\n const ref = ctx.createLinearGradient(0, 254, 0, 475);\n ref.addColorStop(0, \"rgba(222,143,58,.20)\");\n ref.addColorStop(1, \"rgba(222,143,58,0)\");\n ctx.fillStyle = ref;\n ctx.beginPath();\n ctx.moveTo(143, 257); ctx.lineTo(174, 257); ctx.lineTo(251, 478); ctx.lineTo(92, 478);\n ctx.closePath(); ctx.fill();\n ctx.restore();\n\n // lantern fixture\n line(157, 117, 157, 171, \"#111718\", 5);\n ctx.fillStyle = \"#171a18\";\n ctx.fillRect(137, 164, 39, 9);\n ctx.fillRect(142, 216, 30, 6);\n ctx.beginPath();\n ctx.moveTo(140, 173); ctx.lineTo(174, 173); ctx.lineTo(169, 215); ctx.lineTo(145, 215); ctx.closePath();\n ctx.fillStyle = \"#222622\"; ctx.fill();\n ctx.strokeStyle = \"#090d0d\"; ctx.lineWidth = 3; ctx.stroke();\n ctx.fillStyle = \"#ffc96b\";\n ctx.fillRect(147, 180, 20, 29);\n ctx.fillStyle = \"rgba(255,238,163,.85)\";\n ctx.fillRect(151, 182, 12, 25);\n line(145, 177, 145, 217, \"#0e1211\", 2);\n line(170, 177, 170, 217, \"#0e1211\", 2);\n ctx.fillStyle = \"#141817\";\n ctx.fillRect(134, 168, 47, 5);\n ctx.fillRect(138, 216, 39, 5);\n\n // doorstep left\n poly([[0, 357], [157, 330], [221, 365], [221, 411], [0, 452]], \"#101719\");\n poly([[0, 386], [160, 357], [215, 383], [215, 402], [0, 438]], \"#414a49\");\n line(0, 412, 212, 383, \"rgba(165,171,156,.26)\", 2);\n poly([[0, 440], [216, 398], [245, 418], [245, 453], [0, 500]], \"#10171a\");\n\n // cats silhouettes\n ctx.fillStyle = \"#0b1010\";\n // rear cat\n ctx.beginPath();\n ctx.ellipse(91, 350, 21, 26, -.08, 0, Math.PI * 2);\n ctx.fill();\n ctx.beginPath();\n ctx.moveTo(75, 332); ctx.lineTo(76, 303); ctx.lineTo(86, 313);\n ctx.lineTo(99, 305); ctx.lineTo(107, 334); ctx.closePath(); ctx.fill();\n ctx.beginPath();\n ctx.moveTo(106, 363); ctx.quadraticCurveTo(132, 351, 134, 368);\n ctx.quadraticCurveTo(118, 376, 103, 372); ctx.fill();\n // front cat\n ctx.beginPath();\n ctx.ellipse(130, 373, 27, 31, -.04, 0, Math.PI * 2);\n ctx.fill();\n ctx.beginPath();\n ctx.moveTo(108, 353); ctx.lineTo(111, 320); ctx.lineTo(123, 332);\n ctx.lineTo(143, 324); ctx.lineTo(151, 355); ctx.closePath(); ctx.fill();\n ctx.beginPath();\n ctx.moveTo(148, 392); ctx.quadraticCurveTo(181, 379, 178, 403);\n ctx.quadraticCurveTo(159, 412, 143, 402); ctx.fill();\n\n // cat rim-light and eyes\n line(76, 332, 80, 316, \"rgba(180,158,111,.38)\", 2);\n line(111, 352, 114, 330, \"rgba(205,170,103,.45)\", 2);\n ctx.fillStyle = \"#e2b94b\";\n ctx.beginPath(); ctx.ellipse(87, 332, 2.2, 3, 0, 0, Math.PI * 2); ctx.fill();\n ctx.beginPath(); ctx.ellipse(98, 331, 2.2, 3, 0, 0, Math.PI * 2); ctx.fill();\n ctx.fillStyle = \"#d49b35\";\n ctx.beginPath(); ctx.ellipse(123, 357, 2.5, 3.5, 0, 0, Math.PI * 2); ctx.fill();\n ctx.beginPath(); ctx.ellipse(136, 356, 2.5, 3.5, 0, 0, Math.PI * 2); ctx.fill();\n\n // barrels right\n function barrel(x, y, w, h) {\n ctx.save();\n ctx.fillStyle = \"#303333\";\n ctx.beginPath();\n ctx.moveTo(x + 5, y + 12);\n ctx.quadraticCurveTo(x + w / 2, y - 1, x + w - 5, y + 12);\n ctx.lineTo(x + w - 8, y + h - 10);\n ctx.quadraticCurveTo(x + w / 2, y + h + 3, x + 8, y + h - 10);\n ctx.closePath(); ctx.fill();\n const g = ctx.createLinearGradient(x, 0, x + w, 0);\n g.addColorStop(0, \"#171e1e\"); g.addColorStop(.45, \"#4a4740\"); g.addColorStop(.7, \"#292e2d\"); g.addColorStop(1, \"#121819\");\n ctx.fillStyle = g;\n ctx.beginPath();\n ctx.moveTo(x + 5, y + 12); ctx.quadraticCurveTo(x + w / 2, y - 1, x + w - 5, y + 12);\n ctx.lineTo(x + w - 8, y + h - 10);\n ctx.quadraticCurveTo(x + w / 2, y + h + 3, x + 8, y + h - 10);\n ctx.closePath(); ctx.fill();\n ctx.strokeStyle = \"#111817\"; ctx.lineWidth = 4;\n for (const yy of [y + 18, y + h - 16]) {\n ctx.beginPath(); ctx.ellipse(x + w / 2, yy, w / 2 - 3, 5, 0, 0, Math.PI * 2); ctx.stroke();\n }\n ctx.strokeStyle = \"rgba(143,139,115,.27)\"; ctx.lineWidth = 1;\n ctx.beginPath(); ctx.ellipse(x + w / 2, y + 10, w / 2 - 4, 5, 0, 0, Math.PI * 2); ctx.stroke();\n ctx.restore();\n }\n barrel(372, 315, 63, 91);\n barrel(428, 346, 67, 105);\n barrel(347, 374, 55, 76);\n\n // rain\n ctx.save();\n ctx.lineCap = \"round\";\n for (let i = 0; i < 260; i++) {\n const x = rnd() * 560 - 24;\n const y = rnd() * 470;\n const len = 7 + rnd() * 19;\n const slant = -3 - rnd() * 5;\n const a = .10 + rnd() * .26;\n line(x, y, x + slant, y + len, `rgba(183,205,204,${a})`, .45 + rnd() * .8);\n }\n ctx.restore();\n\n // rain ripples foreground\n for (let i = 0; i < 38; i++) {\n const x = rnd() * 512, y = 380 + rnd() * 125, r = 2 + rnd() * 9;\n ctx.strokeStyle = `rgba(155,181,178,${.10 + rnd() * .13})`;\n ctx.lineWidth = .65;\n ctx.beginPath();\n ctx.ellipse(x, y, r, r * .22, 0, 0, Math.PI * 2);\n ctx.stroke();\n }\n\n ctx.restore();\n\n // Arch stone/wood foreground border\n const edge = ctx.createLinearGradient(0, 0, 512, 0);\n edge.addColorStop(0, \"#080b0c\");\n edge.addColorStop(.12, \"#1a1b1a\");\n edge.addColorStop(.5, \"#0b0d0d\");\n edge.addColorStop(.88, \"#1b1b19\");\n edge.addColorStop(1, \"#060809\");\n\n ctx.fillStyle = edge;\n ctx.fillRect(0, 0, 42, 512);\n ctx.fillRect(470, 0, 42, 512);\n ctx.fillRect(0, 0, 512, 30);\n\n ctx.beginPath();\n ctx.moveTo(0, 0);\n ctx.lineTo(512, 0);\n ctx.lineTo(512, 47);\n ctx.bezierCurveTo(422, 27, 365, 11, 256, 11);\n ctx.bezierCurveTo(145, 11, 81, 32, 0, 57);\n ctx.closePath();\n ctx.fillStyle = \"#080a0b\";\n ctx.fill();\n\n // inner arch edge\n ctx.strokeStyle = \"rgba(74,70,61,.48)\";\n ctx.lineWidth = 5;\n ctx.stroke(opening);\n ctx.strokeStyle = \"rgba(0,0,0,.85)\";\n ctx.lineWidth = 13;\n ctx.stroke(opening);\n\n // heavy vignette\n const vignette = ctx.createRadialGradient(256, 260, 160, 256, 260, 350);\n vignette.addColorStop(0, \"rgba(0,0,0,0)\");\n vignette.addColorStop(.72, \"rgba(0,0,0,.18)\");\n vignette.addColorStop(1, \"rgba(0,0,0,.78)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0, 0, 512, 512);\n\n // subtle wet foreground glints\n for (let i = 0; i < 35; i++) {\n const x = 48 + rnd() * 416, y = 430 + rnd() * 78;\n line(x, y, x + 5 + rnd() * 16, y - 1, `rgba(188,201,191,${.06 + rnd() * .1})`, .6);\n }\n}"}], "metadata": {"id": "val-v1-broad-v2-composition-validation-002", "teacher": "gpt-5.6-luna", "sft_sequence_tokens": 5766, "code_sha256": "97e35079953fa7d7e1f49ef818726a11785ce0ac815cfab27a5bfaba857f4bb0"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "From beneath a dark brick arch, a rain-slick alley narrows toward a glowing doorway, with two bicycles grouped left and three bins lined along the right wall."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;overflow:hidden;background:#090d11;\";\n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = 512;\n canvas.style.cssText = \"display:block;width:100%;height:100%;\";\n stage.appendChild(canvas);\n const c = canvas.getContext(\"2d\");\n const W = 512, H = 512;\n const rnd = (() => {\n let s = 928371;\n return () => (s = (s * 1664525 + 1013904223) >>> 0) / 4294967296;\n })();\n\n function poly(points, fill, stroke, sw = 1) {\n c.beginPath();\n c.moveTo(points[0][0], points[0][1]);\n for (let i = 1; i < points.length; i++) c.lineTo(points[i][0], points[i][1]);\n c.closePath();\n if (fill) { c.fillStyle = fill; c.fill(); }\n if (stroke) { c.strokeStyle = stroke; c.lineWidth = sw; c.stroke(); }\n }\n function line(points, stroke, sw = 1, alpha = 1) {\n c.save();\n c.globalAlpha = alpha;\n c.beginPath();\n c.moveTo(points[0][0], points[0][1]);\n for (let i = 1; i < points.length; i++) c.lineTo(points[i][0], points[i][1]);\n c.strokeStyle = stroke; c.lineWidth = sw; c.stroke();\n c.restore();\n }\n function ellipse(x,y,rx,ry,fill,stroke,sw=1) {\n c.beginPath(); c.ellipse(x,y,rx,ry,0,0,Math.PI*2);\n if(fill){c.fillStyle=fill;c.fill();}\n if(stroke){c.strokeStyle=stroke;c.lineWidth=sw;c.stroke();}\n }\n\n // cold, damp ambient background\n const bg = c.createLinearGradient(0,0,0,H);\n bg.addColorStop(0,\"#080d12\");\n bg.addColorStop(.34,\"#111b21\");\n bg.addColorStop(.68,\"#172229\");\n bg.addColorStop(1,\"#0a1015\");\n c.fillStyle = bg; c.fillRect(0,0,W,H);\n\n // distant mist\n const mist = c.createRadialGradient(274,234,5,274,234,230);\n mist.addColorStop(0,\"rgba(145,193,193,.22)\");\n mist.addColorStop(.35,\"rgba(79,118,124,.10)\");\n mist.addColorStop(1,\"rgba(10,18,23,0)\");\n c.fillStyle = mist; c.fillRect(0,70,W,360);\n\n // alley side walls\n poly([[0,112],[117,171],[205,255],[0,405]], \"#111b20\");\n poly([[512,103],[405,158],[310,253],[512,410]], \"#10191e\");\n // wall light gradients\n let lg = c.createLinearGradient(0,170,190,300);\n lg.addColorStop(0,\"rgba(67,82,82,.22)\"); lg.addColorStop(1,\"rgba(8,14,18,0)\");\n c.fillStyle=lg; c.fillRect(0,120,220,260);\n lg = c.createLinearGradient(512,150,325,280);\n lg.addColorStop(0,\"rgba(75,88,84,.18)\"); lg.addColorStop(1,\"rgba(7,13,17,0)\");\n c.fillStyle=lg; c.fillRect(300,120,212,280);\n\n // uneven wall masonry seams\n for(let side=0;side<2;side++){\n for(let y=145;y<310;y+=22+Math.floor(rnd()*10)){\n const t=(y-145)/170;\n const edge=side?405-95*t:108+96*t;\n const x0=side?edge:0, x1=side?512:edge;\n line([[x0,y],[x1,y+Math.sin(y)*2]],\"rgba(2,7,10,.44)\",1);\n const offset=(Math.floor(y/24)%2)*24;\n for(let x=side?edge+offset:offset;x<(side?512:edge);x+=42+Math.floor(rnd()*18)){\n const yy=y-12+Math.floor(rnd()*8);\n line([[x,yy],[x+(side?-1:1)*2, y+3]],\"rgba(58,72,74,.25)\",1);\n }\n }\n }\n\n // pavement perspective\n poly([[0,355],[202,253],[310,253],[512,358],[512,512],[0,512]],\"#111a1f\");\n const pavement = c.createLinearGradient(0,300,0,512);\n pavement.addColorStop(0,\"rgba(104,130,132,.08)\");\n pavement.addColorStop(.32,\"rgba(58,79,82,.10)\");\n pavement.addColorStop(1,\"rgba(3,8,12,.4)\");\n c.fillStyle=pavement;c.fillRect(0,280,512,232);\n\n // paving perspective seams\n for(let i=0;i<15;i++){\n let y=300+i*i*1.22;\n line([[0,y+Math.sin(i)*3],[512,y+Math.cos(i)*4]],\"rgba(104,123,121,.13)\",1);\n }\n for(let x=22;x<512;x+=45){\n line([[256,258],[x,512]],\"rgba(5,10,13,.38)\",1);\n }\n // wet irregular reflections\n for(let i=0;i<115;i++){\n const x=rnd()*512, y=330+rnd()*176, len=3+rnd()*30;\n line([[x,y],[x+len,y+(rnd()-.5)*2]], `rgba(${70+Math.floor(rnd()*60)},${100+Math.floor(rnd()*55)},${rnd()<.35?100:115},${.05+rnd()*.16})`, 1+rnd()*2);\n }\n\n // doorway glow at end\n poly([[235,218],[299,218],[302,277],[232,277]], \"#070a0b\");\n const doorGlow = c.createRadialGradient(266,231,4,266,236,88);\n doorGlow.addColorStop(0,\"rgba(255,221,137,.95)\");\n doorGlow.addColorStop(.18,\"rgba(255,169,62,.62)\");\n doorGlow.addColorStop(.55,\"rgba(198,102,35,.19)\");\n doorGlow.addColorStop(1,\"rgba(176,87,28,0)\");\n c.fillStyle=doorGlow;c.fillRect(175,150,190,220);\n poly([[241,219],[294,219],[294,276],[241,276]], \"#5d321d\");\n poly([[247,223],[289,223],[289,271],[247,271]], \"#1a1613\");\n const door = c.createLinearGradient(247,224,289,224);\n door.addColorStop(0,\"#ffcf78\");door.addColorStop(.45,\"#d87936\");door.addColorStop(1,\"#73351d\");\n c.fillStyle=door;c.fillRect(249,225,37,45);\n c.fillStyle=\"rgba(255,226,147,.75)\";c.fillRect(252,228,2,40);\n ellipse(280,249,1.5,1.5,\"#f8c76b\");\n poly([[228,277],[305,277],[337,316],[195,316]],\"rgba(224,122,44,.12)\");\n\n // massive brick arch foreground\n c.save();\n c.fillStyle=\"#080d11\";\n c.beginPath();\n c.moveTo(0,0); c.lineTo(512,0); c.lineTo(512,117);\n c.quadraticCurveTo(389,79,352,148);\n c.quadraticCurveTo(326,195,321,235);\n c.lineTo(191,235);\n c.quadraticCurveTo(187,183,160,143);\n c.quadraticCurveTo(117,80,0,118);\n c.closePath(); c.fill();\n c.restore();\n // arch underside highlight\n c.beginPath();\n c.moveTo(0,120); c.quadraticCurveTo(117,82,160,143);\n c.quadraticCurveTo(188,184,191,235);\n c.moveTo(512,117); c.quadraticCurveTo(393,77,352,148);\n c.quadraticCurveTo(326,192,321,235);\n c.strokeStyle=\"rgba(74,79,76,.62)\"; c.lineWidth=8;c.stroke();\n c.strokeStyle=\"rgba(8,12,15,.9)\";c.lineWidth=4;c.stroke();\n\n // arch brick courses and individual blocks\n for(let y=10;y<130;y+=18){\n line([[0,y],[512,y+Math.sin(y)*2]],\"rgba(50,57,58,.31)\",2);\n for(let x=(y%37)-25;x<512;x+=42+Math.floor(rnd()*13)){\n line([[x,y-8],[x+2,y+7]],\"rgba(3,7,10,.65)\",2);\n }\n }\n // curved masonry wedge lines\n for(let a=0;a<18;a++){\n const t=a/17;\n const ang=Math.PI + t*Math.PI;\n const cx=256, cy=237, rx=164, ry=157;\n const x=cx+Math.cos(ang)*rx, y=cy+Math.sin(ang)*ry;\n line([[256,237],[x,y]],\"rgba(76,79,74,.22)\",2);\n }\n // damp arch stains\n for(let i=0;i<22;i++){\n const x=rnd()*512, y=rnd()*145;\n line([[x,y],[x+(rnd()-.5)*7,y+8+rnd()*28]],\"rgba(0,0,0,.18)\",2+rnd()*4);\n }\n\n // drain / puddle reflections\n ellipse(264,430,112,24,\"rgba(120,158,157,.08)\");\n ellipse(265,431,77,11,\"rgba(197,190,151,.09)\");\n line([[190,430],[337,431]],\"rgba(177,186,165,.15)\",1);\n\n // three bins along right wall\n function bin(x,y,w,h,color) {\n poly([[x+5,y],[x+w-5,y],[x+w,y+h],[x,y+h]],color);\n poly([[x+5,y],[x+w-5,y],[x+w-2,y+8],[x+2,y+8]],\"rgba(7,12,14,.9)\");\n line([[x+5,y],[x+w-5,y]],\"rgba(126,136,126,.32)\",2);\n line([[x+8,y+11],[x+7,y+h-2]],\"rgba(5,9,11,.45)\",2);\n line([[x+w-8,y+10],[x+w-5,y+h-3]],\"rgba(131,142,133,.15)\",1);\n ellipse(x+w*.52,y+4,5,1.5,\"rgba(28,37,35,.8)\");\n }\n bin(398,286,38,64,\"#263b3d\");\n bin(438,302,40,69,\"#304244\");\n bin(473,320,35,64,\"#1e3033\");\n for(let i=0;i<18;i++){\n line([[390+rnd()*115,290+rnd()*90],[390+rnd()*115,291+rnd()*90]],\"rgba(180,190,171,.24)\",1);\n }\n\n // bicycles left, behind foreground details\n function bicycle(cx,cy,scale) {\n const r=24*scale, base=cy;\n const wheel=\"rgba(7,11,14,.96)\";\n ellipse(cx,base,r,r,wheel,\"rgba(129,146,144,.58)\",1.5);\n ellipse(cx+61*scale,base,r,r,wheel,\"rgba(125,141,139,.62)\",1.5);\n ellipse(cx,base,r-3,r-3,null,\"rgba(35,51,54,.9)\",1);\n ellipse(cx+61*scale,base,r-3,r-3,null,\"rgba(35,51,54,.9)\",1);\n line([[cx,base],[cx+25*scale,base-35*scale],[cx+61*scale,base]],\"#7c8580\",2);\n line([[cx+25*scale,base-35*scale],[cx+42*scale,base-37*scale],[cx+61*scale,base]],\"#737e79\",2);\n line([[cx+25*scale,base-35*scale],[cx+14*scale,base]],\"#737e79\",2);\n line([[cx+42*scale,base-37*scale],[cx+46*scale,base-48*scale]],\"#828b83\",2);\n line([[cx+40*scale,base-49*scale],[cx+53*scale,base-49*scale]],\"#89918a\",2);\n ellipse(cx+25*scale,base-35*scale,3,3,\"#232c2b\");\n line([[cx+14*scale,base],[cx+34*scale,base+1]],\"#78837d\",2);\n line([[cx+25*scale,base-35*scale],[cx+20*scale,base-45*scale]],\"#68746f\",2);\n }\n bicycle(55,382,1.05);\n bicycle(109,410,.88);\n // bike overlap darkening and handlebars\n line([[44,338],[61,331],[71,335]],\"#8a918a\",2);\n line([[95,367],[111,360],[120,364]],\"#7e8882\",2);\n\n // foreground puddle highlights\n for(let i=0;i<35;i++){\n const x=20+rnd()*470, y=425+rnd()*75;\n line([[x,y],[x+5+rnd()*20,y]],\"rgba(159,181,174,.13)\",1+rnd());\n }\n\n // rainfall, brighter nearer camera\n c.save();\n c.lineCap=\"round\";\n for(let i=0;i<270;i++){\n const x=rnd()*W, y=rnd()*H;\n const near=rnd();\n const len=near<.75?4+rnd()*9:2+rnd()*5;\n const alpha=.05+rnd()*.19;\n line([[x,y],[x-1.5,y+len]],\"rgba(166,190,190,\"+alpha+\")\",near<.7?1:0.6);\n }\n c.restore();\n\n // a few rain streaks catching doorway light\n for(let i=0;i<22;i++){\n const x=205+rnd()*120, y=190+rnd()*140;\n line([[x,y],[x-1,y+7+rnd()*9]],\"rgba(232,188,126,.22)\",1);\n }\n\n // subtle vignette\n const vig=c.createRadialGradient(256,260,170,256,260,370);\n vig.addColorStop(0,\"rgba(0,0,0,0)\");\n vig.addColorStop(.72,\"rgba(0,0,0,.12)\");\n vig.addColorStop(1,\"rgba(0,0,0,.62)\");\n c.fillStyle=vig;c.fillRect(0,0,W,H);\n}"}], "metadata": {"id": "val-v1-broad-v2-composition-validation-003", "teacher": "gpt-5.6-luna", "sft_sequence_tokens": 4621, "code_sha256": "9a738eed7efe8120650e953b1adf3392b624e74b8eb809c6fb50f88d4a9cf87f"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "The camera peers through a chipped plaster arch, framing a narrow wet alley with a red cart centered nearby and four pedestrians grouped beneath a distant awning."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.width = \"512px\";\n stage.style.height = \"512px\";\n stage.style.overflow = \"hidden\";\n stage.style.background = \"#17191a\";\n\n const c = document.createElement(\"canvas\");\n c.width = c.height = 512;\n c.style.display = \"block\";\n stage.appendChild(c);\n const g = c.getContext(\"2d\");\n\n const W = 512, H = 512;\n const rnd = (() => {\n let s = 918273;\n return () => {\n s = (s * 1664525 + 1013904223) >>> 0;\n return s / 4294967296;\n };\n })();\n\n function poly(points, fill, stroke, sw = 1) {\n g.beginPath();\n g.moveTo(points[0][0], points[0][1]);\n for (let i = 1; i < points.length; i++) g.lineTo(points[i][0], points[i][1]);\n g.closePath();\n if (fill) { g.fillStyle = fill; g.fill(); }\n if (stroke) { g.strokeStyle = stroke; g.lineWidth = sw; g.stroke(); }\n }\n\n function line(points, stroke, sw = 1, alpha = 1) {\n g.save();\n g.globalAlpha = alpha;\n g.beginPath();\n g.moveTo(points[0][0], points[0][1]);\n for (let i = 1; i < points.length; i++) g.lineTo(points[i][0], points[i][1]);\n g.strokeStyle = stroke;\n g.lineWidth = sw;\n g.stroke();\n g.restore();\n }\n\n function ellipse(x, y, rx, ry, fill, alpha = 1) {\n g.save();\n g.globalAlpha = alpha;\n g.beginPath();\n g.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n g.fillStyle = fill;\n g.fill();\n g.restore();\n }\n\n function archPath(inset = 0) {\n const l = 69 + inset, r = 443 - inset, top = 20 + inset, spring = 139 + inset;\n g.beginPath();\n g.moveTo(l, H);\n g.lineTo(l, spring);\n g.bezierCurveTo(l, 60 + inset, 138 + inset, top, 256, top);\n g.bezierCurveTo(374 - inset, top, r, 60 + inset, r, spring);\n g.lineTo(r, H);\n g.closePath();\n }\n\n // Deep interior darkness\n g.fillStyle = \"#111516\";\n g.fillRect(0, 0, W, H);\n\n // Alley opening clip\n g.save();\n archPath();\n g.clip();\n\n // Atmospheric background\n const sky = g.createLinearGradient(0, 0, 0, 300);\n sky.addColorStop(0, \"#77817c\");\n sky.addColorStop(0.38, \"#9a9890\");\n sky.addColorStop(1, \"#3d4848\");\n g.fillStyle = sky;\n g.fillRect(0, 0, W, H);\n\n // Far bright mist\n const mist = g.createRadialGradient(260, 180, 10, 260, 180, 230);\n mist.addColorStop(0, \"rgba(210,205,188,.5)\");\n mist.addColorStop(1, \"rgba(73,81,79,0)\");\n g.fillStyle = mist;\n g.fillRect(0, 20, W, 350);\n\n // Left building wall\n const leftWall = g.createLinearGradient(0, 0, 220, 0);\n leftWall.addColorStop(0, \"#4a4840\");\n leftWall.addColorStop(.6, \"#776e61\");\n leftWall.addColorStop(1, \"#877c6b\");\n poly([[0, 0], [185, 0], [207, 132], [171, 244], [0, 363]], leftWall);\n // Right building wall\n const rightWall = g.createLinearGradient(512, 0, 310, 0);\n rightWall.addColorStop(0, \"#393d3b\");\n rightWall.addColorStop(.55, \"#605f57\");\n rightWall.addColorStop(1, \"#817669\");\n poly([[512, 0], [327, 0], [306, 139], [342, 244], [512, 355]], rightWall);\n\n // Wall planes and ledges\n poly([[0, 78], [178, 66], [186, 83], [0, 103]], \"rgba(35,36,34,.45)\");\n poly([[336, 67], [512, 76], [512, 101], [329, 87]], \"rgba(31,35,34,.48)\");\n poly([[0, 202], [166, 173], [164, 189], [0, 228]], \"rgba(39,39,35,.36)\");\n poly([[350, 180], [512, 211], [512, 232], [344, 199]], \"rgba(39,41,38,.34)\");\n\n // Windows, shutters, pipes\n poly([[58, 93], [127, 88], [128, 148], [54, 157]], \"#303534\");\n poly([[66, 99], [119, 95], [119, 138], [65, 145]], \"#1f2728\");\n line([[93, 95], [94, 143]], \"#6d6a5c\", 2, .55);\n line([[44, 253], [48, 54]], \"#282c2b\", 4, .8);\n line([[45, 249], [53, 249]], \"#8d8170\", 2, .4);\n poly([[388, 86], [458, 95], [458, 153], [383, 143]], \"#333735\");\n poly([[397, 94], [448, 101], [448, 143], [395, 136]], \"#202829\");\n line([[421, 98], [420, 140]], \"#777263\", 2, .4);\n line([[474, 42], [469, 250]], \"#252b2a\", 4, .8);\n\n // Far awning\n poly([[179, 170], [337, 170], [355, 198], [164, 198]], \"#252d2c\");\n poly([[171, 174], [340, 174], [332, 184], [178, 185]], \"#4b4d46\");\n for (let x = 180; x < 338; x += 23) line([[x, 175], [x + 7, 193]], \"#292d2b\", 2, .65);\n poly([[164, 197], [354, 197], [343, 207], [172, 208]], \"rgba(18,23,23,.8)\");\n\n // Distant doorway\n poly([[215, 126], [296, 126], [302, 201], [210, 201]], \"#293536\");\n poly([[223, 133], [288, 133], [292, 199], [218, 199]], \"#151f21\");\n g.fillStyle = \"rgba(188,169,123,.35)\";\n g.fillRect(245, 156, 22, 29);\n\n // Alley floor perspective\n poly([[0, 267], [170, 211], [342, 211], [512, 269], [512, 512], [0, 512]], \"#343c3a\");\n const floorGrad = g.createLinearGradient(0, 225, 0, 512);\n floorGrad.addColorStop(0, \"rgba(176,170,149,.23)\");\n floorGrad.addColorStop(.32, \"rgba(56,69,67,.12)\");\n floorGrad.addColorStop(1, \"rgba(9,18,20,.72)\");\n g.fillStyle = floorGrad;\n g.fillRect(0, 210, 512, 302);\n\n // Perspective paving and puddles\n for (let y = 233; y < 510; y += 26 + rnd() * 17) {\n const t = (y - 210) / 302;\n line([[170 - t * 180, y], [343 + t * 180, y]], \"rgba(142,145,131,.19)\", 1);\n }\n for (let x = 0; x <= 512; x += 42) {\n line([[256 + (x - 256) * .18, 210], [x, 512]], \"rgba(16,25,25,.25)\", 1);\n }\n ellipse(260, 395, 108, 15, \"#a0aaa0\", .09);\n ellipse(260, 395, 76, 8, \"#d2cdb3\", .12);\n ellipse(112, 463, 90, 16, \"#a4aaa0\", .12);\n ellipse(411, 340, 65, 9, \"#c2c3aa\", .12);\n\n // Wall grime and damp stains\n for (let i = 0; i < 90; i++) {\n const side = rnd() < .5;\n const x = side ? rnd() * 170 : 342 + rnd() * 170;\n const y = 35 + rnd() * 270;\n const len = 4 + rnd() * 32;\n line([[x, y], [x + (rnd() - .5) * 5, y + len]], \"#1d2929\", 1 + rnd() * 2, .08 + rnd() * .16);\n }\n\n // Four pedestrians under awning\n function person(x, y, scale, coat, accent) {\n ellipse(x, y - 27 * scale, 7 * scale, 8 * scale, \"#1b2424\");\n poly([\n [x - 8 * scale, y - 19 * scale],\n [x + 8 * scale, y - 19 * scale],\n [x + 13 * scale, y + 19 * scale],\n [x + 5 * scale, y + 22 * scale],\n [x - 8 * scale, y + 19 * scale],\n [x - 13 * scale, y + 5 * scale]\n ], coat);\n line([[x - 5 * scale, y + 18 * scale], [x - 7 * scale, y + 33 * scale]], \"#202727\", 3 * scale);\n line([[x + 5 * scale, y + 18 * scale], [x + 8 * scale, y + 33 * scale]], \"#202727\", 3 * scale);\n line([[x - 11 * scale, y - 8 * scale], [x - 19 * scale, y + 7 * scale]], coat, 3 * scale);\n line([[x + 10 * scale, y - 7 * scale], [x + 18 * scale, y + 5 * scale]], coat, 3 * scale);\n if (accent) line([[x - 8 * scale, y - 13 * scale], [x + 7 * scale, y - 10 * scale]], accent, 2 * scale);\n }\n person(218, 192, .82, \"#303b3b\", \"#8a7652\");\n person(248, 190, .98, \"#222b2c\", \"#6e5946\");\n person(280, 192, .9, \"#49504a\", \"#986d4c\");\n person(309, 195, .76, \"#2a3433\", \"#76684d\");\n ellipse(263, 232, 53, 8, \"#101919\", .45);\n\n // Red hand cart centered nearby\n g.save();\n g.shadowColor = \"rgba(0,0,0,.55)\";\n g.shadowBlur = 12;\n g.shadowOffsetY = 7;\n poly([[194, 284], [313, 284], [325, 372], [183, 372]], \"#842e26\");\n g.restore();\n poly([[198, 283], [310, 283], [315, 300], [191, 300]], \"#a53b2d\");\n poly([[194, 300], [316, 300], [311, 360], [200, 360]], \"#8d2a25\");\n poly([[204, 307], [305, 307], [302, 352], [207, 352]], \"#682623\");\n line([[201, 317], [307, 317]], \"#c35a40\", 2, .5);\n line([[196, 286], [311, 286]], \"#d76b4a\", 3, .55);\n line([[207, 306], [207, 354]], \"#d24d37\", 2, .45);\n line([[299, 304], [299, 354]], \"#401f20\", 2, .7);\n // handles\n line([[305, 288], [353, 265]], \"#3a2925\", 6);\n line([[314, 296], [361, 273]], \"#392722\", 5);\n line([[350, 264], [363, 265]], \"#1d2523\", 4);\n // wheels\n ellipse(204, 371, 16, 16, \"#202727\");\n ellipse(307, 371, 16, 16, \"#202727\");\n ellipse(204, 371, 6, 6, \"#8b7661\");\n ellipse(307, 371, 6, 6, \"#8b7661\");\n // cart reflection\n poly([[199, 386], [310, 386], [292, 421], [218, 421]], \"rgba(125,37,31,.24)\");\n\n // Fine rain and reflective highlights\n for (let i = 0; i < 110; i++) {\n const x = rnd() * 512, y = rnd() * 460;\n line([[x, y], [x + 1, y + 3 + rnd() * 5]], \"#cbd0c1\", .5, .04 + rnd() * .09);\n }\n\n g.restore();\n\n // Plaster arch foreground\n const plaster = g.createLinearGradient(0, 0, 512, 0);\n plaster.addColorStop(0, \"#b1a491\");\n plaster.addColorStop(.22, \"#81796b\");\n plaster.addColorStop(.5, \"#c3b6a0\");\n plaster.addColorStop(.78, \"#81796d\");\n plaster.addColorStop(1, \"#a79a86\");\n\n // side jambs\n poly([[0, 0], [69, 0], [69, 512], [0, 512]], \"#736d62\");\n poly([[443, 0], [512, 0], [512, 512], [443, 512]], \"#68675f\");\n\n // arch band with irregular inner edge\n g.save();\n g.beginPath();\n g.moveTo(0, 0); g.lineTo(512, 0); g.lineTo(512, 64);\n g.bezierCurveTo(465, 48, 438, 64, 429, 105);\n g.bezierCurveTo(415, 43, 353, 8, 256, 8);\n g.bezierCurveTo(159, 8, 96, 43, 83, 105);\n g.bezierCurveTo(74, 64, 46, 48, 0, 64);\n g.closePath();\n g.fillStyle = plaster;\n g.fill();\n g.restore();\n\n // rough plaster overlays / chips\n for (let i = 0; i < 150; i++) {\n let x, y;\n if (rnd() < .52) {\n x = rnd() < .5 ? rnd() * 69 : 443 + rnd() * 69;\n y = rnd() * 512;\n } else {\n x = rnd() * 512;\n y = rnd() * 92;\n }\n const r = .5 + rnd() * 3.8;\n ellipse(x, y, r * 1.5, r, rnd() < .5 ? \"#514f48\" : \"#d1c2a9\", .13 + rnd() * .25);\n }\n\n // exposed masonry chips\n poly([[23, 122], [48, 116], [54, 130], [31, 138]], \"#4f514b\");\n poly([[461, 185], [490, 178], [497, 193], [469, 201]], \"#4a4a43\");\n poly([[112, 25], [135, 17], [145, 28], [125, 35]], \"#5d5a51\");\n poly([[370, 51], [394, 43], [405, 53], [382, 61]], \"#5c5a52\");\n poly([[5, 344], [38, 337], [42, 353], [8, 361]], \"#4c4d48\");\n poly([[474, 410], [505, 402], [512, 419], [480, 426]], \"#4a4b47\");\n\n // foreground vignette and subtle lens haze\n const vignette = g.createRadialGradient(256, 260, 170, 256, 260, 390);\n vignette.addColorStop(0, \"rgba(0,0,0,0)\");\n vignette.addColorStop(1, \"rgba(0,0,0,.48)\");\n g.fillStyle = vignette;\n g.fillRect(0, 0, 512, 512);\n}"}], "metadata": {"id": "val-v1-broad-v2-composition-validation-004", "teacher": "gpt-5.6-luna", "sft_sequence_tokens": 5383, "code_sha256": "253023bf069d615d10db41357ffffa5d32602ed169b4b8f6b5fb8326686f0e0e"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "Seen through a decorative arched arcade, a wet alley curves left around a corner shop; three pigeons occupy the foreground and two cyclists approach behind."}, {"role": "assistant", "content": "async function render(stage) {\n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = 512;\n canvas.style.width = \"100%\";\n canvas.style.height = \"100%\";\n stage.appendChild(canvas);\n const ctx = canvas.getContext(\"2d\");\n const W = 512, H = 512;\n\n const rnd = (a = 1) => Math.random() * a;\n const clamp = (n, a, b) => Math.max(a, Math.min(b, n));\n const poly = (pts, fill, stroke, sw = 1) => {\n ctx.beginPath();\n ctx.moveTo(pts[0][0], pts[0][1]);\n for (let i = 1; i < pts.length; i++) ctx.lineTo(pts[i][0], pts[i][1]);\n ctx.closePath();\n if (fill) { ctx.fillStyle = fill; ctx.fill(); }\n if (stroke) { ctx.strokeStyle = stroke; ctx.lineWidth = sw; ctx.stroke(); }\n };\n const line = (pts, stroke, sw = 1) => {\n ctx.beginPath();\n ctx.moveTo(pts[0][0], pts[0][1]);\n for (let i = 1; i < pts.length; i++) ctx.lineTo(pts[i][0], pts[i][1]);\n ctx.strokeStyle = stroke;\n ctx.lineWidth = sw;\n ctx.lineCap = \"round\";\n ctx.stroke();\n };\n const ellipse = (x, y, rx, ry, fill, stroke, sw = 1, rot = 0) => {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rot);\n ctx.beginPath();\n ctx.ellipse(0, 0, rx, ry, 0, 0, Math.PI * 2);\n if (fill) { ctx.fillStyle = fill; ctx.fill(); }\n if (stroke) { ctx.strokeStyle = stroke; ctx.lineWidth = sw; ctx.stroke(); }\n ctx.restore();\n };\n const glow = (x, y, r, color) => {\n const g = ctx.createRadialGradient(x, y, 0, x, y, r);\n g.addColorStop(0, color);\n g.addColorStop(1, \"rgba(255,220,145,0)\");\n ctx.fillStyle = g;\n ctx.fillRect(x-r, y-r, r*2, r*2);\n };\n\n ctx.fillStyle = \"#171719\";\n ctx.fillRect(0, 0, W, H);\n\n // Arch opening clip\n ctx.save();\n ctx.beginPath();\n ctx.moveTo(47, 512);\n ctx.lineTo(47, 174);\n ctx.bezierCurveTo(47, 73, 119, 23, 256, 23);\n ctx.bezierCurveTo(393, 23, 465, 73, 465, 174);\n ctx.lineTo(465, 512);\n ctx.closePath();\n ctx.clip();\n\n // overcast sky\n const sky = ctx.createLinearGradient(0, 0, 0, 300);\n sky.addColorStop(0, \"#84929a\");\n sky.addColorStop(.55, \"#b4b9b2\");\n sky.addColorStop(1, \"#757b78\");\n ctx.fillStyle = sky;\n ctx.fillRect(0, 0, W, 300);\n\n // hazy clouds\n for (let i = 0; i < 22; i++) {\n const x = rnd(512), y = 45 + rnd(170), rx = 25 + rnd(70);\n ellipse(x, y, rx, 10 + rnd(15), `rgba(230,232,223,${.035 + rnd(.055)})`);\n }\n\n // distant end and left curving wall\n poly([[0,236],[157,223],[272,230],[287,277],[0,319]], \"#626d69\");\n poly([[0,256],[159,236],[278,243],[280,281],[0,337]], \"#59615e\");\n for (let i = 0; i < 35; i++) {\n const x = rnd(270), y = 242 + rnd(75);\n line([[x,y],[x+18+rnd(20), y-2+rnd(8)]], `rgba(34,43,42,${.15+rnd(.18)})`, .7);\n }\n // left wall bricks\n for (let y = 272; y < 355; y += 16) {\n line([[0,y],[245,y-8]], \"rgba(30,38,38,.26)\", 1);\n for (let x = (y%32 ? 25 : 5); x < 260; x += 38 + rnd(8))\n line([[x,y],[x-2,y+14]], \"rgba(35,43,42,.18)\", .8);\n }\n\n // corner shop facade\n poly([[275,166],[405,181],[464,238],[464,354],[275,307]], \"#725d4d\");\n poly([[275,166],[333,149],[464,170],[405,181]], \"#9a8064\");\n poly([[278,174],[405,187],[405,292],[278,273]], \"#413d3a\");\n // shop window\n ctx.fillStyle = \"#273436\";\n ctx.fillRect(294, 188, 94, 79);\n const win = ctx.createLinearGradient(294,188,388,267);\n win.addColorStop(0, \"#87958a\");\n win.addColorStop(.38, \"#425a58\");\n win.addColorStop(1, \"#19292d\");\n ctx.fillStyle = win; ctx.fillRect(297,191,88,72);\n line([[340,190],[340,265]], \"#171b1c\", 3);\n line([[297,232],[385,236]], \"#222729\", 2);\n // warm window reflections\n glow(321, 215, 30, \"rgba(255,198,104,.25)\");\n ctx.fillStyle = \"rgba(232,170,82,.38)\";\n ctx.fillRect(310,208,19,24);\n ctx.fillStyle = \"rgba(219,133,57,.3)\";\n ctx.fillRect(350,218,24,18);\n // awning\n poly([[270,163],[407,177],[401,193],[274,180]], \"#263b3a\");\n for (let x=276; x<405; x+=16) line([[x,164+(x-276)*.1],[x+2,180+(x-276)*.1]], \"rgba(201,184,142,.5)\", 2);\n // shop sign\n poly([[298,147],[404,157],[404,174],[298,165]], \"#b38858\", \"#4d392d\", 1);\n ctx.font = \"bold 13px Georgia\";\n ctx.fillStyle = \"#332b26\";\n ctx.save(); ctx.translate(307,160); ctx.rotate(.09); ctx.fillText(\"MERCER & SONS\",0,0); ctx.restore();\n // shop side bricks\n for (let y=190;y<340;y+=22) line([[407,y],[464,y+6]],\"rgba(37,32,29,.3)\",1);\n for (let y=190;y<340;y+=22) for(let x=416;x<462;x+=24) line([[x,y],[x-3,y+19]],\"rgba(45,36,31,.24)\",1);\n\n // road ground\n const ground = ctx.createLinearGradient(0,280,0,512);\n ground.addColorStop(0, \"#4d5654\");\n ground.addColorStop(.48, \"#3a4645\");\n ground.addColorStop(1, \"#1d292c\");\n poly([[0,319],[276,278],[512,337],[512,512],[0,512]], ground);\n // curved lane edge\n line([[268,278],[232,294],[182,318],[142,351],[105,399],[78,512]], \"rgba(161,154,128,.32)\", 2);\n line([[300,285],[267,303],[229,329],[202,365],[192,416],[192,512]], \"rgba(20,29,30,.7)\", 7);\n // puddles\n for (let i=0;i<27;i++) {\n const x=30+rnd(460), y=330+rnd(170), rx=8+rnd(35), ry=1+rnd(5);\n ellipse(x,y,rx,ry,`rgba(129,164,163,${.08+rnd(.14)})`);\n line([[x-rx*.7,y],[x+rx*.7,y+rnd(2)-1]],\"rgba(195,205,190,.13)\",.7);\n }\n // long reflected lights\n for (let i=0;i<9;i++) {\n const x=302+i*14+rnd(7);\n line([[x,321+rnd(20)],[x+10+rnd(12),480+rnd(25)]],`rgba(206,166,96,${.04+rnd(.09)})`,2+rnd(3));\n }\n\n // distant lamps\n glow(271,233,32,\"rgba(255,202,116,.45)\");\n ellipse(271,233,3,4,\"#ffd994\");\n line([[271,235],[271,269]],\"#323432\",2);\n glow(407,224,25,\"rgba(255,188,90,.3)\");\n ellipse(407,224,2,3,\"#ffd186\");\n\n // cyclists behind\n function cyclist(x,y,s,lean=0) {\n ctx.save(); ctx.translate(x,y); ctx.scale(s,s); ctx.rotate(lean);\n ctx.strokeStyle=\"#20292a\"; ctx.lineWidth=2.1; ctx.lineCap=\"round\";\n ctx.beginPath(); ctx.arc(-13,23,10,0,Math.PI*2); ctx.arc(14,23,10,0,Math.PI*2); ctx.stroke();\n line([[-13,23],[0,8],[14,23],[-5,22],[-13,23],[0,8],[2,24]],\"#172123\",2);\n line([[14,23],[16,5],[11,0]],\"#172123\",2);\n ellipse(2,-13,5,6,\"#283033\");\n poly([[-3,-7],[7,-7],[9,9],[-1,12],[-8,1]], \"#68706d\", \"#202829\", 1);\n line([[-3,-3],[-11,8]],\"#222b2c\",2); line([[5,-4],[13,5]],\"#222b2c\",2);\n line([[-1,11],[-7,24]],\"#202829\",2); line([[6,9],[13,22]],\"#202829\",2);\n ctx.restore();\n }\n cyclist(249,254,.92,-.04);\n cyclist(292,249,.72,.08);\n\n // wet mist in alley\n ctx.fillStyle = \"rgba(210,218,208,.06)\";\n ctx.fillRect(0,250,512,100);\n\n // pigeons foreground\n function pigeon(x,y,s,rot=0,body=\"#626968\") {\n ctx.save(); ctx.translate(x,y); ctx.scale(s,s); ctx.rotate(rot);\n // shadow\n ellipse(0,22,21,4,\"rgba(5,11,13,.42)\");\n // tail\n poly([[-13,5],[-30,14],[-17,17],[-5,12]], \"#3d4545\");\n // body\n ellipse(0,3,18,11,body,\"#242d2e\",1);\n // wing layered\n ctx.beginPath(); ctx.moveTo(-12,-3); ctx.bezierCurveTo(-3,-13,13,-10,15,1);\n ctx.bezierCurveTo(9,9,-3,10,-14,5); ctx.closePath();\n ctx.fillStyle=\"#4d5958\"; ctx.fill(); ctx.strokeStyle=\"#283131\";ctx.stroke();\n for(let i=0;i<4;i++) line([[-10+i*4,-2+i],[-2+i*4,5+i]],\"rgba(172,177,157,.35)\",.8);\n // neck and head\n ellipse(11,-9,7,9,\"#344242\");\n ellipse(14,-17,7,7,\"#596866\");\n ellipse(20,-17,5,2,\"#a88965\");\n ellipse(16,-19,1.2,1.2,\"#e8d276\");\n // neck sheen\n line([[8,-13],[15,-7]],\"rgba(174,183,135,.6)\",2);\n line([[-4,11],[-5,23]],\"#ba9d6d\",1); line([[5,10],[6,22]],\"#ba9d6d\",1);\n line([[-8,23],[-2,23]],\"#a88e65\",1); line([[3,22],[9,22]],\"#a88e65\",1);\n ctx.restore();\n }\n pigeon(103,430,1.2,-.1);\n pigeon(239,457,1.42,.08);\n pigeon(365,414,1.05,-.12);\n\n // foreground rain glints\n for(let i=0;i<55;i++) {\n const x=rnd(512), y=300+rnd(212);\n line([[x,y],[x+1+rnd(3),y+5+rnd(8)]],\"rgba(190,210,204,.08)\",.5);\n }\n\n ctx.restore();\n\n // stone arch surround\n const stone = ctx.createLinearGradient(0,0,512,512);\n stone.addColorStop(0,\"#27282a\");\n stone.addColorStop(.45,\"#4c4948\");\n stone.addColorStop(1,\"#1e2022\");\n ctx.fillStyle=stone;\n ctx.fillRect(0,0,512,32);\n ctx.fillRect(0,0,47,512);\n ctx.fillRect(465,0,47,512);\n ctx.fillRect(0,480,512,32);\n\n // arch ring\n ctx.beginPath();\n ctx.moveTo(32,512); ctx.lineTo(32,173);\n ctx.bezierCurveTo(32,50,113,5,256,5);\n ctx.bezierCurveTo(399,5,480,50,480,173);\n ctx.lineTo(480,512);\n ctx.strokeStyle=\"#17191b\"; ctx.lineWidth=26; ctx.stroke();\n ctx.strokeStyle=\"#6c6660\"; ctx.lineWidth=12; ctx.stroke();\n ctx.strokeStyle=\"rgba(186,171,145,.22)\"; ctx.lineWidth=2; ctx.stroke();\n\n // arch masonry joints\n for(let a=195;a<346;a+=12) {\n const r=a*Math.PI/180;\n const cx=256, cy=174, rx=224, ry=169;\n const x=cx+rx*Math.cos(r), y=cy-ry*Math.sin(r);\n const tx=-Math.sin(r), ty=-Math.cos(r);\n line([[x-tx*7,y-ty*7],[x+tx*7,y+ty*7]],\"rgba(24,25,26,.65)\",2);\n }\n // side stone seams\n for(let y=40;y<500;y+=37){\n line([[5,y],[38,y+4]],\"rgba(150,139,123,.18)\",1);\n line([[474,y+4],[507,y]],\"rgba(150,139,123,.16)\",1);\n }\n // subtle vignette\n const v=ctx.createRadialGradient(256,260,170,256,260,390);\n v.addColorStop(0,\"rgba(0,0,0,0)\");\n v.addColorStop(1,\"rgba(0,0,0,.42)\");\n ctx.fillStyle=v;ctx.fillRect(0,0,512,512);\n}"}], "metadata": {"id": "val-v1-broad-v2-composition-validation-005", "teacher": "gpt-5.6-luna", "sft_sequence_tokens": 4722, "code_sha256": "24b1e9459845a14e72a8f84632ae5a4132efdff5c2ee79549a2be395c20a7760"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "Seen through a pointed stone arch, the flooded alley bends right behind a delivery tricycle, with three orange lanterns receding overhead into the distance."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.width = \"512px\";\n stage.style.height = \"512px\";\n stage.style.overflow = \"hidden\";\n stage.style.background = \"#111\";\n\n const c = document.createElement(\"canvas\");\n c.width = c.height = 512;\n c.style.width = \"100%\";\n c.style.height = \"100%\";\n stage.appendChild(c);\n const x = c.getContext(\"2d\");\n\n const rnd = (a, b) => a + Math.random() * (b - a);\n const clamp = v => Math.max(0, Math.min(255, v));\n\n function poly(points, fill, stroke, width = 1) {\n x.beginPath();\n x.moveTo(points[0][0], points[0][1]);\n for (let i = 1; i < points.length; i++) x.lineTo(points[i][0], points[i][1]);\n x.closePath();\n if (fill) { x.fillStyle = fill; x.fill(); }\n if (stroke) { x.strokeStyle = stroke; x.lineWidth = width; x.stroke(); }\n }\n\n function line(points, stroke, width = 1) {\n x.beginPath();\n x.moveTo(points[0][0], points[0][1]);\n for (let i = 1; i < points.length; i++) x.lineTo(points[i][0], points[i][1]);\n x.strokeStyle = stroke;\n x.lineWidth = width;\n x.stroke();\n }\n\n function stone(points, color) {\n poly(points, color, \"rgba(31,28,25,.48)\", 1.1);\n for (let i = 0; i < 5; i++) {\n const px = rnd(\n Math.min(...points.map(p => p[0])),\n Math.max(...points.map(p => p[0]))\n );\n const py = rnd(\n Math.min(...points.map(p => p[1])),\n Math.max(...points.map(p => p[1]))\n );\n x.fillStyle = `rgba(255,255,255,${rnd(.025,.09)})`;\n x.fillRect(px, py, rnd(1, 5), rnd(1, 3));\n }\n }\n\n // Base darkness\n x.fillStyle = \"#0d1113\";\n x.fillRect(0, 0, 512, 512);\n\n // The pointed arch opening\n function archPath() {\n x.beginPath();\n x.moveTo(75, 512);\n x.lineTo(91, 215);\n x.quadraticCurveTo(98, 148, 151, 99);\n x.quadraticCurveTo(205, 48, 256, 37);\n x.quadraticCurveTo(307, 48, 361, 99);\n x.quadraticCurveTo(414, 148, 421, 215);\n x.lineTo(442, 512);\n x.closePath();\n }\n\n // Outer masonry\n const wall = x.createLinearGradient(0, 0, 512, 512);\n wall.addColorStop(0, \"#706b62\");\n wall.addColorStop(.42, \"#4e4b46\");\n wall.addColorStop(1, \"#292a29\");\n x.fillStyle = wall;\n x.fillRect(0, 0, 512, 512);\n\n // Random large wall blocks\n for (let row = -1; row < 10; row++) {\n const yy = row * 62 + rnd(-8, 8);\n let xx = -35;\n while (xx < 540) {\n const ww = rnd(42, 88);\n const hh = rnd(43, 69);\n const shade = Math.round(rnd(55, 115));\n stone([\n [xx, yy], [xx + ww, yy + rnd(-4, 4)],\n [xx + ww - rnd(3, 9), yy + hh],\n [xx + rnd(-5, 6), yy + hh + rnd(-4, 4)]\n ], `rgb(${shade},${shade - 2},${shade - 7})`);\n xx += ww + rnd(2, 8);\n }\n }\n\n // Opening shadow\n archPath();\n x.fillStyle = \"#080f12\";\n x.fill();\n\n // Scene clipped inside arch\n x.save();\n archPath();\n x.clip();\n\n const dusk = x.createLinearGradient(0, 30, 0, 490);\n dusk.addColorStop(0, \"#15242a\");\n dusk.addColorStop(.42, \"#243034\");\n dusk.addColorStop(1, \"#10191b\");\n x.fillStyle = dusk;\n x.fillRect(0, 0, 512, 512);\n\n // Distant hazy light\n const haze = x.createRadialGradient(315, 225, 4, 315, 225, 180);\n haze.addColorStop(0, \"rgba(155,142,112,.32)\");\n haze.addColorStop(1, \"rgba(30,38,39,0)\");\n x.fillStyle = haze;\n x.fillRect(60, 70, 390, 420);\n\n // Left buildings\n poly([[0,120],[155,155],[177,273],[117,329],[0,362]], \"#29363a\");\n poly([[0,143],[120,168],[124,282],[0,314]], \"#394448\");\n poly([[0,214],[111,223],[114,289],[0,341]], \"#263033\");\n // right buildings\n poly([[512,105],[366,150],[342,246],[419,309],[512,337]], \"#202b2e\");\n poly([[512,156],[405,178],[394,267],[512,309]], \"#354044\");\n poly([[512,245],[421,252],[413,320],[512,361]], \"#293236\");\n\n // Facade verticals and window shapes\n for (let i = 0; i < 7; i++) {\n const yy = 166 + i * 23;\n line([[0, yy], [125, yy + 17]], \"rgba(8,15,17,.55)\", rnd(1, 2));\n line([[391, yy + 8], [512, yy - 7]], \"rgba(9,15,17,.55)\", rnd(1, 2));\n }\n for (let i = 0; i < 4; i++) {\n const yy = 177 + i * 32;\n poly([[24, yy],[62,yy+6],[61,yy+22],[25,yy+18]], \"#101d20\");\n poly([[437,yy],[476,yy-4],[477,yy+14],[438,yy+18]], \"#111b1d\");\n }\n\n // Alley bending right, with wet roadway\n poly([[118,512],[179,318],[286,257],[371,249],[512,299],[512,512]], \"#182426\");\n poly([[185,512],[210,344],[291,277],[359,259],[512,305],[512,512]], \"#263537\");\n poly([[267,512],[282,360],[328,290],[383,276],[512,319],[512,512]], \"#1d2d2f\");\n\n // paving seams and reflections\n for (let i = 0; i < 20; i++) {\n const yy = 300 + i * 12 + rnd(-3, 3);\n line([[rnd(120,220), yy], [512, yy + rnd(-3, 4)]], \"rgba(101,120,116,.16)\", rnd(.5,1.3));\n }\n for (let i = 0; i < 35; i++) {\n const px = rnd(110, 510), py = rnd(315, 510);\n line([[px,py],[px+rnd(9,42),py+rnd(-1,2)]], \"rgba(152,167,156,.12)\", rnd(.5,1.5));\n }\n\n // overhead wires\n line([[102,107],[319,239],[512,194]], \"rgba(7,12,13,.85)\", 1.2);\n line([[74,148],[300,240],[512,226]], \"rgba(7,12,13,.65)\", 1);\n\n function lantern(px, py, scale) {\n x.save();\n x.shadowColor = \"rgba(255,126,30,.8)\";\n x.shadowBlur = 18 * scale;\n x.fillStyle = \"rgba(242,113,26,.3)\";\n x.beginPath(); x.arc(px, py, 13 * scale, 0, Math.PI * 2); x.fill();\n x.restore();\n\n x.strokeStyle = \"#181716\";\n x.lineWidth = Math.max(1, 2 * scale);\n x.beginPath();\n x.moveTo(px, py - 17 * scale);\n x.lineTo(px, py - 10 * scale);\n x.stroke();\n\n x.fillStyle = \"#30221b\";\n x.fillRect(px - 10 * scale, py - 9 * scale, 20 * scale, 22 * scale);\n x.fillStyle = \"#d87826\";\n x.fillRect(px - 7 * scale, py - 6 * scale, 14 * scale, 15 * scale);\n x.fillStyle = \"#ffbf55\";\n x.fillRect(px - 4 * scale, py - 4 * scale, 8 * scale, 11 * scale);\n x.strokeStyle = \"#181514\";\n x.lineWidth = Math.max(1, scale);\n x.strokeRect(px - 10 * scale, py - 9 * scale, 20 * scale, 22 * scale);\n }\n\n lantern(174, 145, .72);\n lantern(255, 191, .9);\n lantern(327, 242, 1.05);\n\n // tricycle shadow\n x.fillStyle = \"rgba(3,8,9,.65)\";\n x.beginPath(); x.ellipse(285, 462, 122, 20, -.05, 0, Math.PI*2); x.fill();\n\n // rear cargo box\n poly([[166,313],[277,300],[314,366],[181,382]], \"#8c5632\", \"#211c18\", 3);\n poly([[166,313],[277,300],[279,335],[168,348]], \"#b87945\", \"#31251d\", 2);\n poly([[181,382],[314,366],[311,399],[188,416]], \"#563723\", \"#211b18\", 2);\n line([[194,320],[198,407]], \"rgba(37,25,18,.65)\", 2);\n line([[263,305],[268,390]], \"rgba(37,25,18,.65)\", 2);\n line([[173,347],[286,334]], \"rgba(229,164,93,.2)\", 2);\n x.fillStyle = \"#d09657\";\n x.font = \"bold 12px sans-serif\";\n x.fillText(\"DELIVERY\", 205, 341);\n\n // bicycle frame\n line([[250,397],[313,443],[365,385],[250,397],[294,377],[313,443]], \"#9a653c\", 5);\n line([[294,377],[342,371],[365,385]], \"#9a653c\", 4);\n line([[342,371],[353,351]], \"#745036\", 4);\n line([[347,350],[378,346]], \"#30241d\", 4);\n\n function wheel(cx, cy, r) {\n x.strokeStyle = \"rgba(5,8,8,.95)\";\n x.lineWidth = 7;\n x.beginPath(); x.arc(cx, cy, r, 0, Math.PI*2); x.stroke();\n x.strokeStyle = \"rgba(122,129,120,.58)\";\n x.lineWidth = 1.5;\n x.beginPath(); x.arc(cx, cy, r-4, 0, Math.PI*2); x.stroke();\n for (let i = 0; i < 10; i++) {\n const a = i * Math.PI / 5;\n line([[cx,cy],[cx+Math.cos(a)*(r-5),cy+Math.sin(a)*(r-5)]], \"rgba(108,119,113,.38)\", .7);\n }\n x.fillStyle = \"#171b1a\";\n x.beginPath(); x.arc(cx,cy,5,0,Math.PI*2); x.fill();\n }\n wheel(210, 430, 33);\n wheel(309, 443, 37);\n wheel(383, 416, 28);\n\n // handlebar and lamp\n x.fillStyle = \"#d98c36\";\n x.beginPath(); x.arc(373,365,5,0,Math.PI*2); x.fill();\n x.shadowColor = \"#e78c36\"; x.shadowBlur = 13;\n x.fillStyle = \"#f2a647\";\n x.beginPath(); x.arc(373,365,3,0,Math.PI*2); x.fill();\n x.shadowBlur = 0;\n\n x.restore();\n\n // Arch inner edge and voussoirs\n x.save();\n archPath();\n x.clip();\n const edge = x.createLinearGradient(0,0,512,0);\n edge.addColorStop(0,\"rgba(5,7,7,.8)\");\n edge.addColorStop(.12,\"rgba(0,0,0,0)\");\n edge.addColorStop(.88,\"rgba(0,0,0,0)\");\n edge.addColorStop(1,\"rgba(5,7,7,.8)\");\n x.fillStyle = edge;\n x.fillRect(0,0,512,512);\n x.restore();\n\n // thick stone arch ring, segmented polygons\n const cx = 256, cy = 218;\n const outerR = 194, innerR = 166;\n const start = Math.PI * 1.09, end = Math.PI * 1.91;\n for (let i = 0; i < 13; i++) {\n const a0 = start + (end-start) * i / 13 + .008;\n const a1 = start + (end-start) * (i+1) / 13 - .008;\n const pts = [\n [cx + Math.cos(a0)*innerR, cy + Math.sin(a0)*innerR],\n [cx + Math.cos(a0)*(outerR+ rnd(-4,4)), cy + Math.sin(a0)*(outerR+ rnd(-4,4))],\n [cx + Math.cos(a1)*(outerR+ rnd(-4,4)), cy + Math.sin(a1)*(outerR+ rnd(-4,4))],\n [cx + Math.cos(a1)*innerR, cy + Math.sin(a1)*innerR]\n ];\n stone(pts, `rgb(${Math.round(rnd(70,115))},${Math.round(rnd(68,106))},${Math.round(rnd(61,96))})`);\n }\n\n // vertical arch jamb stones\n for (let side of [0,1]) {\n for (let i=0;i<7;i++) {\n const yy = 194 + i*53;\n const jitter = rnd(-4,4);\n const pts = side === 0\n ? [[18+jitter,yy],[91+jitter,yy-5],[89+jitter,yy+48],[15+jitter,yy+55]]\n : [[421+jitter,yy-5],[494+jitter,yy-1],[498+jitter,yy+52],[423+jitter,yy+48]];\n stone(pts, `rgb(${Math.round(rnd(58,105))},${Math.round(rnd(57,99))},${Math.round(rnd(52,91))})`);\n }\n }\n\n // foreground vignette\n const vg = x.createRadialGradient(256,270,190,256,270,350);\n vg.addColorStop(0,\"rgba(0,0,0,0)\");\n vg.addColorStop(1,\"rgba(0,0,0,.56)\");\n x.fillStyle = vg;\n x.fillRect(0,0,512,512);\n\n // fine photographic grain\n const img = x.getImageData(0,0,512,512);\n for (let i=0;i {\n let n = 93721;\n return () => (n = (n * 16807) % 2147483647) / 2147483647;\n })();\n\n function poly(points, fill, stroke, width = 1) {\n ctx.beginPath();\n ctx.moveTo(points[0][0], points[0][1]);\n for (let i = 1; i < points.length; i++) ctx.lineTo(points[i][0], points[i][1]);\n ctx.closePath();\n if (fill) { ctx.fillStyle = fill; ctx.fill(); }\n if (stroke) { ctx.strokeStyle = stroke; ctx.lineWidth = width; ctx.stroke(); }\n }\n function line(points, stroke, width = 1, alpha = 1) {\n ctx.save();\n ctx.globalAlpha = alpha;\n ctx.beginPath();\n ctx.moveTo(points[0][0], points[0][1]);\n for (let i = 1; i < points.length; i++) ctx.lineTo(points[i][0], points[i][1]);\n ctx.strokeStyle = stroke;\n ctx.lineWidth = width;\n ctx.stroke();\n ctx.restore();\n }\n function ellipse(x, y, rx, ry, fill, stroke, width = 1) {\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, 0, 0, Math.PI * 2);\n if (fill) { ctx.fillStyle = fill; ctx.fill(); }\n if (stroke) { ctx.strokeStyle = stroke; ctx.lineWidth = width; ctx.stroke(); }\n }\n\n ctx.scale(S, S);\n const w = 512, h = 512;\n\n // dim rainy atmosphere behind the arch\n let sky = ctx.createLinearGradient(0, 0, 0, h);\n sky.addColorStop(0, \"#89939a\");\n sky.addColorStop(.45, \"#65747b\");\n sky.addColorStop(1, \"#3f5057\");\n ctx.fillStyle = sky;\n ctx.fillRect(0, 0, w, h);\n\n // distant pale sky opening\n ctx.fillStyle = \"rgba(191,198,195,.45)\";\n ctx.fillRect(92, 62, 327, 177);\n\n // far buildings and passage\n poly([[91, 98], [211, 108], [211, 287], [91, 385]], \"#777d79\");\n poly([[421, 95], [302, 109], [302, 287], [421, 380]], \"#696e6d\");\n poly([[110, 121], [202, 128], [202, 270], [110, 337]], \"#8b8e85\");\n poly([[403, 120], [311, 128], [311, 270], [403, 339]], \"#7c817d\");\n\n // masonry shadows\n for (let i = 0; i < 20; i++) {\n const y = 125 + i * 10 + rnd() * 5;\n line([[94, y], [196, y + rnd() * 4]], \"rgba(43,48,47,.18)\", 1);\n line([[316, y + rnd() * 4], [416, y]], \"rgba(35,40,40,.2)\", 1);\n }\n for (let i = 0; i < 35; i++) {\n const x = 100 + rnd() * 315, y = 80 + rnd() * 260;\n line([[x, y], [x + (rnd() - .5) * 7, y + 2 + rnd() * 8]], \"rgba(218,218,202,.12)\", 1);\n }\n\n // far passage\n poly([[207, 190], [306, 190], [337, 330], [174, 330]], \"#27363b\");\n let passage = ctx.createLinearGradient(0, 190, 0, 331);\n passage.addColorStop(0, \"#17282d\");\n passage.addColorStop(1, \"#56666a\");\n poly([[218, 188], [294, 188], [320, 327], [192, 327]], passage);\n ellipse(256, 320, 48, 8, \"rgba(177,192,185,.17)\");\n\n // alley floor perspective\n let floor = ctx.createLinearGradient(0, 245, 0, 512);\n floor.addColorStop(0, \"#56666b\");\n floor.addColorStop(.5, \"#4c5d61\");\n floor.addColorStop(1, \"#27383e\");\n poly([[105, 238], [411, 238], [510, 512], [0, 512]], floor);\n\n // wet paving perspective bands\n for (let i = 0; i < 18; i++) {\n const y = 270 + i * i * 0.77;\n line([[70 - i * 4, y], [445 + i * 4, y + rnd() * 3]], \"rgba(174,190,187,.16)\", 1);\n }\n for (let i = 0; i < 20; i++) {\n const x = 90 + rnd() * 350;\n line([[256 + (x - 256) * .13, 246], [x, 512]], \"rgba(20,35,39,.22)\", 1);\n }\n ellipse(255, 397, 109, 17, \"rgba(172,194,188,.16)\");\n ellipse(252, 438, 184, 22, \"rgba(165,188,184,.12)\");\n\n // paired market stalls\n function stall(side) {\n const left = side === \"left\";\n const sx = left ? 94 : 336;\n const dir = left ? 1 : -1;\n const topX = left ? 105 : 407;\n const topY = 213;\n const baseX = left ? 80 : 432;\n\n // awning top\n poly(\n left\n ? [[90, 203], [178, 211], [202, 231], [101, 226]]\n : [[422, 203], [334, 211], [310, 231], [411, 226]],\n \"#433c35\", \"#262c2c\", 1\n );\n const stripes = left\n ? [[90,203,110,205],[110,205,130,207],[130,207,150,209],[150,209,170,211]]\n : [[422,203,402,205],[402,205,382,207],[382,207,362,209],[362,209,342,211]];\n stripes.forEach((a, i) => {\n poly(\n left\n ? [[a[0],a[1]],[a[2],a[3]],[a[2]+9,a[3]+17],[a[0]+10,a[1]+16]]\n : [[a[0],a[1]],[a[2],a[3]],[a[2]-9,a[3]+17],[a[0]-10,a[1]+16]],\n i % 2 ? \"#a28d70\" : \"#5c5550\"\n );\n });\n\n // wood frame\n line(left ? [[99,223],[96,340]] : [[413,223],[416,340]], \"#302c28\", 6);\n line(left ? [[193,230],[199,340]] : [[319,230],[313,340]], \"#302c28\", 6);\n line(left ? [[98,338],[201,342]] : [[412,338],[311,342]], \"#272b2a\", 5);\n\n // hanging cloth and dark interior\n poly(\n left ? [[106,233],[190,237],[190,319],[101,316]] : [[406,233],[322,237],[322,319],[411,316]],\n \"#222d2d\"\n );\n const goods = left\n ? [[112,263,135,294,\"#a75e38\"],[139,253,162,291,\"#b58b4d\"],[165,269,187,301,\"#6c7e62\"]]\n : [[400,263,377,294,\"#9e5536\"],[373,253,350,291,\"#b08a4c\"],[347,269,325,301,\"#697d65\"]];\n goods.forEach(g => {\n ellipse(g[0],g[1],g[2]/2,g[3]/2,g[4]);\n ellipse(g[0]+(left?2:-2),g[1]-3,g[2]/3,g[3]/3,\"rgba(235,194,119,.18)\");\n });\n // counter\n poly(left ? [[90,307],[202,310],[207,328],[86,325]] : [[422,307],[310,310],[305,328],[426,325]], \"#765e48\");\n line(left ? [[88,326],[207,329]] : [[305,329],[427,326]], \"#252b29\", 3);\n }\n stall(\"left\"); stall(\"right\");\n\n // clock mount and clock\n poly([[208, 112], [304, 112], [300, 188], [212, 188]], \"#655f57\");\n poly([[218, 111], [294, 111], [292, 178], [220, 178]], \"#857e70\");\n ellipse(256, 143, 31, 32, \"#292f30\", \"#171d1d\", 3);\n ellipse(256, 143, 25, 26, \"#d1c6a5\", \"#776e5d\", 2);\n ellipse(256, 143, 21, 22, \"#c6bb9c\");\n for (let i = 0; i < 12; i++) {\n const a = i * Math.PI / 6;\n const r1 = i % 3 === 0 ? 17 : 19;\n line([[256 + Math.sin(a)*r1,143 - Math.cos(a)*r1],\n [256 + Math.sin(a)*21,143 - Math.cos(a)*21]], \"#554f42\", i%3===0 ? 2 : 1);\n }\n line([[256,143],[256,128]], \"#38372f\", 2.5);\n line([[256,143],[267,149]], \"#38372f\", 2.5);\n ellipse(256,143,2.5,2.5,\"#292820\");\n\n // rain, mostly visible in opening\n ctx.save();\n ctx.globalCompositeOperation = \"screen\";\n for (let i = 0; i < 230; i++) {\n const x = rnd() * 512, y = rnd() * 512;\n const len = 5 + rnd() * 17;\n const slant = -1.5 - rnd() * 3;\n line([[x,y],[x+slant,y+len]], \"rgba(205,224,222,\" + (.08 + rnd()*.2) + \")\", .45 + rnd()*.8);\n }\n ctx.restore();\n\n // foreground arch with cutout\n ctx.save();\n ctx.fillStyle = \"#c8bea5\";\n ctx.beginPath();\n ctx.moveTo(0,0); ctx.lineTo(512,0); ctx.lineTo(512,512); ctx.lineTo(0,512); ctx.closePath();\n ctx.moveTo(68,512);\n ctx.lineTo(68,197);\n ctx.bezierCurveTo(68,67,145,25,256,25);\n ctx.bezierCurveTo(367,25,444,67,444,197);\n ctx.lineTo(444,512);\n ctx.closePath();\n ctx.fill(\"evenodd\");\n ctx.restore();\n\n // arch shading and stone variation\n let archShade = ctx.createLinearGradient(0, 0, 512, 0);\n archShade.addColorStop(0, \"rgba(75,65,53,.24)\");\n archShade.addColorStop(.16, \"rgba(255,248,218,.2)\");\n archShade.addColorStop(.5, \"rgba(255,251,225,.05)\");\n archShade.addColorStop(.84, \"rgba(255,248,217,.2)\");\n archShade.addColorStop(1, \"rgba(55,49,42,.3)\");\n ctx.fillStyle = archShade;\n ctx.fillRect(0,0,512,512);\n\n // arch voussoir blocks\n const stones = [\n [[69,197],[71,154],[81,116],[99,84],[119,63],[137,49]],\n [[137,49],[165,34],[202,27],[236,25]],\n [[236,25],[274,25],[311,30],[345,44]],\n [[345,44],[379,62],[404,91],[425,132],[441,180],[444,197]]\n ];\n stones.forEach((p,i)=> {\n line(p, \"rgba(100,89,72,.45)\", 2);\n line(p.map(([x,y])=>[x+2,y+2]), \"rgba(241,232,202,.38)\", 1);\n });\n // foreground side block seams\n for (let y = 35; y < 512; y += 48 + rnd()*16) {\n line([[0,y],[67,y+3]], \"rgba(101,89,70,.23)\", 1.3);\n line([[445,y+2],[512,y]], \"rgba(91,81,66,.24)\", 1.3);\n }\n for (let i=0;i<65;i++) {\n const side = rnd()<.5;\n const x = side ? rnd()*63 : 449+rnd()*63;\n const y = rnd()*512;\n line([[x,y],[x+(rnd()-.5)*8,y+2+rnd()*10]], \"rgba(91,82,67,.16)\", .8);\n }\n\n // inner arch wet dark rim\n ctx.save();\n ctx.beginPath();\n ctx.moveTo(68,512); ctx.lineTo(68,197);\n ctx.bezierCurveTo(68,67,145,25,256,25);\n ctx.bezierCurveTo(367,25,444,67,444,197);\n ctx.lineTo(444,512);\n ctx.strokeStyle = \"rgba(49,48,43,.43)\";\n ctx.lineWidth = 7;\n ctx.stroke();\n ctx.restore();\n\n // foreground rain droplets and subtle lens moisture\n ctx.save();\n ctx.globalAlpha = .28;\n for (let i=0;i<16;i++) {\n const x = rnd()*512, y = rnd()*512, r = 1+rnd()*2;\n ellipse(x,y,r,r*2,\"rgba(225,236,226,.25)\");\n }\n ctx.restore();\n\n // slight vignette\n const vignette = ctx.createRadialGradient(256,260,190,256,260,380);\n vignette.addColorStop(0,\"rgba(0,0,0,0)\");\n vignette.addColorStop(1,\"rgba(10,18,20,.28)\");\n ctx.fillStyle = vignette;\n ctx.fillRect(0,0,512,512);\n}"}], "metadata": {"id": "val-v1-broad-v2-composition-validation-009", "teacher": "gpt-5.6-luna", "sft_sequence_tokens": 4827, "code_sha256": "6931b4026bf6bed7182e173f756e284aebe8b8207a1561180dc731d3e7fc7aca"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A surveyor's transit stands on a wooden tripod, featuring a horizontal telescope, circular angle scale, adjustment knobs, and a hanging plumb bob."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.position = \"relative\";\n stage.style.overflow = \"hidden\";\n stage.style.background = \"#d8d1c4\";\n\n const svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 512 512\");\n svg.setAttribute(\"width\", \"512\");\n svg.setAttribute(\"height\", \"512\");\n svg.setAttribute(\"role\", \"img\");\n svg.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n `;\n\n stage.appendChild(svg);\n}"}], "metadata": {"id": "val-v1-broad-v2-entity-validation-004", "teacher": "gpt-5.6-luna", "sft_sequence_tokens": 4850, "code_sha256": "8768f2384eac3cff15085a31aefc81d70cf326d8496f96784a7ded32e87c77ec"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A tabletop mechanical orrery displays a golden Sun and several colored planets mounted on separate geared arms above a brass base."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = `\n width:512px;height:512px;position:relative;overflow:hidden;\n background:#241914;\n `;\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = 1024;\n canvas.height = 1024;\n canvas.style.cssText = \"width:512px;height:512px;display:block;\";\n stage.appendChild(canvas);\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(2, 2);\n\n const W = 512, H = 512;\n const TAU = Math.PI * 2;\n\n function ellipse(x, y, rx, ry, fill, stroke, lw = 1) {\n ctx.beginPath();\n ctx.ellipse(x, y, rx, ry, 0, 0, TAU);\n if (fill) { ctx.fillStyle = fill; ctx.fill(); }\n if (stroke) { ctx.lineWidth = lw; ctx.strokeStyle = stroke; ctx.stroke(); }\n }\n\n function roundRect(x, y, w, h, r, fill, stroke, lw = 1) {\n ctx.beginPath();\n ctx.roundRect(x, y, w, h, r);\n if (fill) { ctx.fillStyle = fill; ctx.fill(); }\n if (stroke) { ctx.lineWidth = lw; ctx.strokeStyle = stroke; ctx.stroke(); }\n }\n\n function gear(x, y, radius, teeth, color, rotation = 0, inner = radius * .62) {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rotation);\n const path = new Path2D();\n for (let i = 0; i < teeth * 4; i++) {\n const a = i * TAU / (teeth * 4);\n const phase = i % 4;\n const r = phase === 0 || phase === 3 ? radius : inner + (radius - inner) * .72;\n const px = Math.cos(a) * r, py = Math.sin(a) * r;\n if (i === 0) path.moveTo(px, py); else path.lineTo(px, py);\n }\n path.closePath();\n ctx.shadowColor = \"rgba(0,0,0,.38)\";\n ctx.shadowBlur = 5;\n ctx.shadowOffsetY = 3;\n const g = ctx.createRadialGradient(-radius*.25, -radius*.3, radius*.1, 0, 0, radius);\n g.addColorStop(0, \"#ffe28a\");\n g.addColorStop(.3, color);\n g.addColorStop(.76, \"#9b5d17\");\n g.addColorStop(1, \"#5d310f\");\n ctx.fillStyle = g;\n ctx.fill(path);\n ctx.shadowColor = \"transparent\";\n ctx.lineWidth = 1;\n ctx.strokeStyle = \"rgba(80,37,8,.7)\";\n ctx.stroke(path);\n\n ctx.beginPath();\n ctx.arc(0, 0, inner * .73, 0, TAU);\n ctx.fillStyle = \"#bc741f\";\n ctx.fill();\n ctx.lineWidth = 1;\n ctx.strokeStyle = \"#60350f\";\n ctx.stroke();\n\n ctx.beginPath();\n ctx.arc(0, 0, inner * .34, 0, TAU);\n ctx.fillStyle = \"#56300f\";\n ctx.fill();\n ctx.strokeStyle = \"#f0b957\";\n ctx.stroke();\n\n ctx.beginPath();\n ctx.moveTo(-inner*.24, 0);\n ctx.lineTo(inner*.24, 0);\n ctx.moveTo(0, -inner*.24);\n ctx.lineTo(0, inner*.24);\n ctx.strokeStyle = \"rgba(255,216,117,.7)\";\n ctx.lineWidth = 1;\n ctx.stroke();\n ctx.restore();\n }\n\n function metalLine(x1, y1, x2, y2, width = 5) {\n ctx.save();\n ctx.lineCap = \"round\";\n ctx.shadowColor = \"rgba(0,0,0,.35)\";\n ctx.shadowBlur = 4;\n ctx.shadowOffsetY = 3;\n const g = ctx.createLinearGradient(x1, y1, x2, y2);\n g.addColorStop(0, \"#70400d\");\n g.addColorStop(.23, \"#f6ca62\");\n g.addColorStop(.52, \"#b7741d\");\n g.addColorStop(.78, \"#ffe08a\");\n g.addColorStop(1, \"#63370e\");\n ctx.strokeStyle = g;\n ctx.lineWidth = width;\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n ctx.shadowColor = \"transparent\";\n ctx.strokeStyle = \"rgba(255,233,153,.7)\";\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.moveTo(x1, y1 - width*.17);\n ctx.lineTo(x2, y2 - width*.17);\n ctx.stroke();\n ctx.restore();\n }\n\n function planet(x, y, r, colors, ring = false, phase = 0) {\n ctx.save();\n ctx.shadowColor = \"rgba(0,0,0,.5)\";\n ctx.shadowBlur = 7;\n ctx.shadowOffsetY = 5;\n const g = ctx.createRadialGradient(x-r*.38, y-r*.42, r*.08, x, y, r*1.1);\n g.addColorStop(0, colors[0]);\n g.addColorStop(.42, colors[1]);\n g.addColorStop(.78, colors[2]);\n g.addColorStop(1, colors[3] || \"#26160f\");\n ctx.fillStyle = g;\n ctx.beginPath();\n ctx.arc(x, y, r, 0, TAU);\n ctx.fill();\n ctx.shadowColor = \"transparent\";\n\n ctx.save();\n ctx.beginPath();\n ctx.arc(x, y, r, 0, TAU);\n ctx.clip();\n ctx.globalAlpha = .4;\n for (let i = -2; i < 4; i++) {\n ctx.strokeStyle = i % 2 ? colors[0] : colors[3] || \"#fff\";\n ctx.lineWidth = Math.max(1, r*.18);\n ctx.beginPath();\n ctx.moveTo(x-r*1.2, y+i*r*.42);\n ctx.bezierCurveTo(x-r*.2, y+i*r*.18, x+r*.3, y+i*r*.65, x+r*1.2, y+i*r*.25);\n ctx.stroke();\n }\n ctx.restore();\n\n if (ring) {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(-.23 + phase);\n ctx.scale(1, .32);\n ctx.beginPath();\n ctx.ellipse(0, 0, r*1.8, r*.72, 0, 0, TAU);\n ctx.strokeStyle = \"#c69143\";\n ctx.lineWidth = Math.max(2, r*.18);\n ctx.globalAlpha = .85;\n ctx.stroke();\n ctx.beginPath();\n ctx.ellipse(0, 0, r*1.42, r*.53, 0, 0, TAU);\n ctx.strokeStyle = \"#f0cf83\";\n ctx.lineWidth = Math.max(1, r*.07);\n ctx.stroke();\n ctx.restore();\n }\n\n ctx.beginPath();\n ctx.arc(x-r*.33, y-r*.38, r*.18, 0, TAU);\n ctx.fillStyle = \"rgba(255,255,220,.5)\";\n ctx.fill();\n ctx.restore();\n }\n\n let t = 0;\n function draw() {\n ctx.clearRect(0, 0, W, H);\n\n const bg = ctx.createLinearGradient(0, 0, 0, H);\n bg.addColorStop(0, \"#171a1c\");\n bg.addColorStop(.45, \"#433128\");\n bg.addColorStop(1, \"#0f0d0d\");\n ctx.fillStyle = bg;\n ctx.fillRect(0, 0, W, H);\n\n const glow = ctx.createRadialGradient(250, 190, 10, 250, 190, 260);\n glow.addColorStop(0, \"rgba(247,175,63,.13)\");\n glow.addColorStop(1, \"rgba(247,175,63,0)\");\n ctx.fillStyle = glow;\n ctx.fillRect(0, 0, W, 410);\n\n ctx.fillStyle = \"rgba(0,0,0,.38)\";\n ctx.filter = \"blur(8px)\";\n ellipse(255, 433, 194, 33, \"rgba(0,0,0,.6)\");\n ctx.filter = \"none\";\n\n // tabletop grain\n ctx.globalAlpha = .16;\n for (let i = 0; i < 80; i++) {\n const x = (i * 83) % 540 - 10;\n const y = 385 + ((i * 47) % 130);\n ctx.strokeStyle = i % 3 ? \"#c19161\" : \"#180f0b\";\n ctx.lineWidth = .6;\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.bezierCurveTo(x+18, y-2, x+37, y+3, x+65, y-1);\n ctx.stroke();\n }\n ctx.globalAlpha = 1;\n\n // base feet\n roundRect(111, 411, 27, 24, 6, \"#70420f\");\n roundRect(374, 411, 27, 24, 6, \"#70420f\");\n\n // base lower body\n ctx.save();\n ctx.shadowColor = \"rgba(0,0,0,.55)\";\n ctx.shadowBlur = 8;\n ctx.shadowOffsetY = 6;\n const base = ctx.createLinearGradient(120, 372, 390, 438);\n base.addColorStop(0, \"#f2c967\");\n base.addColorStop(.2, \"#a96819\");\n base.addColorStop(.52, \"#6c3d0e\");\n base.addColorStop(.76, \"#b67522\");\n base.addColorStop(1, \"#f2c45e\");\n ctx.fillStyle = base;\n ctx.beginPath();\n ctx.ellipse(256, 411, 145, 32, 0, 0, TAU);\n ctx.fill();\n ctx.beginPath();\n ctx.moveTo(111, 411);\n ctx.lineTo(401, 411);\n ctx.lineTo(390, 433);\n ctx.quadraticCurveTo(256, 463, 122, 433);\n ctx.closePath();\n ctx.fill();\n ctx.restore();\n\n ellipse(256, 411, 142, 29, \"#bd7c24\", \"#5b320d\", 2);\n ellipse(256, 408, 125, 20, \"#8c5015\", \"#e9b84f\", 1);\n ellipse(256, 405, 101, 14, \"#4b2a10\", \"#d99732\", 1);\n\n // engraved base accents\n ctx.strokeStyle = \"rgba(255,216,119,.7)\";\n ctx.lineWidth = 2;\n ctx.beginPath();\n ctx.ellipse(256, 424, 130, 22, 0, .12, Math.PI-.12);\n ctx.stroke();\n\n // gears behind mechanism\n gear(191, 365, 31, 14, \"#b87520\", t*.35);\n gear(236, 378, 21, 11, \"#d18d2e\", -t*.55);\n gear(306, 366, 34, 16, \"#a86718\", -t*.24);\n gear(352, 382, 22, 12, \"#d08b2b\", t*.5);\n gear(269, 397, 17, 10, \"#e1a33d\", -t*.8);\n\n // central pedestal\n ctx.save();\n ctx.shadowColor = \"rgba(0,0,0,.45)\";\n ctx.shadowBlur = 5;\n ctx.shadowOffsetY = 4;\n const col = ctx.createLinearGradient(228, 220, 282, 220);\n col.addColorStop(0, \"#673b10\");\n col.addColorStop(.18, \"#efbd52\");\n col.addColorStop(.42, \"#8f5715\");\n col.addColorStop(.72, \"#f4c762\");\n col.addColorStop(1, \"#63350d\");\n ctx.fillStyle = col;\n ctx.beginPath();\n ctx.moveTo(231, 220);\n ctx.lineTo(281, 220);\n ctx.lineTo(287, 383);\n ctx.quadraticCurveTo(256, 399, 225, 383);\n ctx.closePath();\n ctx.fill();\n ctx.restore();\n ellipse(256, 220, 28, 9, \"#d7962d\", \"#5d350e\", 2);\n ellipse(256, 383, 32, 11, \"#d28b27\", \"#5d350e\", 2);\n\n // orbital rings\n ctx.save();\n ctx.globalAlpha = .48;\n ctx.strokeStyle = \"#d9a445\";\n ctx.lineWidth = 1;\n ctx.setLineDash([4, 4]);\n ctx.beginPath(); ctx.ellipse(256, 192, 100, 39, -.08, 0, TAU); ctx.stroke();\n ctx.beginPath(); ctx.ellipse(256, 192, 151, 61, -.08, 0, TAU); ctx.stroke();\n ctx.beginPath(); ctx.ellipse(256, 192, 194, 81, -.08, 0, TAU); ctx.stroke();\n ctx.restore();\n\n // arms\n const a = t;\n const p1 = [256 + Math.cos(a*0.53+2.4)*73, 192 + Math.sin(a*0.53+2.4)*29];\n const p2 = [256 + Math.cos(a*0.34+5.1)*119, 192 + Math.sin(a*0.34+5.1)*47];\n const p3 = [256 + Math.cos(a*0.21+1.2)*168, 192 + Math.sin(a*0.21+1.2)*68];\n\n metalLine(256, 191, p3[0], p3[1], 5);\n metalLine(256, 191, p2[0], p2[1], 5);\n metalLine(256, 191, p1[0], p1[1], 6);\n\n // joints\n [p1, p2, p3].forEach((p, i) => {\n ellipse(p[0], p[1], 7-i*.7, 7-i*.7, \"#e6ae42\", \"#65370d\", 1);\n ellipse(p[0]-1.5, p[1]-1.5, 2, 2, \"#fff0a0\");\n });\n\n // planets\n planet(p3[0], p3[1]-2, 13, [\"#f2a75f\",\"#bd5429\",\"#6d241c\",\"#321914\"], false, a);\n planet(p2[0], p2[1]-1, 18, [\"#f0d590\",\"#b6814c\",\"#6c452d\",\"#2c211c\"], true, a);\n planet(p1[0], p1[1]-1, 10, [\"#92d5d6\",\"#318a9d\",\"#16485d\",\"#102a36\"], false, a);\n\n // sun shaft and sun\n ellipse(256, 192, 29, 29, \"#9b5c12\", \"#5c3008\", 2);\n const sun = ctx.createRadialGradient(247, 181, 2, 256, 192, 31);\n sun.addColorStop(0, \"#fffbd0\");\n sun.addColorStop(.22, \"#ffe882\");\n sun.addColorStop(.62, \"#efa928\");\n sun.addColorStop(.9, \"#b85a0d\");\n sun.addColorStop(1, \"#632a08\");\n ctx.shadowColor = \"rgba(255,183,45,.7)\";\n ctx.shadowBlur = 18;\n ctx.fillStyle = sun;\n ctx.beginPath();\n ctx.arc(256, 192, 25, 0, TAU);\n ctx.fill();\n ctx.shadowColor = \"transparent\";\n ctx.globalAlpha = .45;\n for (let i=0;i<10;i++) {\n ctx.strokeStyle = i%2 ? \"#fff0a1\" : \"#c66b14\";\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.arc(256,192,14+i*1.1, i*.5, i*.5+.65);\n ctx.stroke();\n }\n ctx.globalAlpha = 1;\n ellipse(247, 182, 5, 4, \"rgba(255,255,220,.65)\");\n\n // top cap\n ellipse(256, 159, 18, 6, \"#d28b28\", \"#60360d\", 2);\n ctx.fillStyle = \"#bd761b\";\n ctx.fillRect(251, 151, 10, 9);\n ellipse(256, 151, 7, 3, \"#f3c55e\", \"#66380d\", 1);\n\n // foreground lip and screws\n ellipse(145, 418, 5, 3, \"#f7ce71\", \"#70420e\");\n ellipse(367, 418, 5, 3, \"#f7ce71\", \"#70420e\");\n\n t += .006;\n requestAnimationFrame(draw);\n }\n draw();\n}"}], "metadata": {"id": "val-v1-broad-v2-entity-validation-006", "teacher": "gpt-5.6-luna", "sft_sequence_tokens": 4889, "code_sha256": "9e7cf4c7b3628128b6244c34d83d6d112d662f67880528e1e6ddb9b17ec03e71"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A brass octant stands upright in a display case, revealing its one-eighth-circle frame, engraved scale, index arm, mirrors, and sighting tube."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;overflow:hidden;background:#171714;\";\n const ns = \"http://www.w3.org/2000/svg\";\n const svg = document.createElementNS(ns, \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 512 512\");\n svg.setAttribute(\"width\", \"512\");\n svg.setAttribute(\"height\", \"512\");\n svg.setAttribute(\"xmlns\", ns);\n\n const defs = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n `;\n svg.innerHTML = defs + `\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n\n \n \n\n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n\n \n OCTANT\n MADE IN BRASS\n \n\n \n \n \n \n `;\n\n const scale = svg.querySelector(\"#scale\");\n const scaleHi = svg.querySelector(\"#scaleHi\");\n const cx = 139, cy = 369;\n const a0 = -66, a1 = -22;\n for (let i = 0; i <= 88; i++) {\n const a = (a0 + (a1 - a0) * i / 88) * Math.PI / 180;\n const r1 = 260;\n const len = i % 10 === 0 ? 14 : (i % 5 === 0 ? 10 : 6);\n const r2 = r1 - len;\n const x1 = cx + Math.cos(a) * r1, y1 = cy + Math.sin(a) * r1;\n const x2 = cx + Math.cos(a) * r2, y2 = cy + Math.sin(a) * r2;\n const line = document.createElementNS(ns, \"path\");\n line.setAttribute(\"d\", `M${x1.toFixed(1)} ${y1.toFixed(1)}L${x2.toFixed(1)} ${y2.toFixed(1)}`);\n line.setAttribute(\"stroke-width\", i % 10 === 0 ? \"2.2\" : \"1.25\");\n scale.appendChild(line);\n if (i % 10 === 0) {\n const tx = cx + Math.cos(a) * 239, ty = cy + Math.sin(a) * 239;\n const t = document.createElementNS(ns, \"text\");\n t.setAttribute(\"x\", tx);\n t.setAttribute(\"y\", ty);\n t.setAttribute(\"fill\", \"#251609\");\n t.setAttribute(\"font-size\", \"8\");\n t.setAttribute(\"font-family\", \"serif\");\n t.setAttribute(\"text-anchor\", \"middle\");\n t.setAttribute(\"transform\", `rotate(${a * 180 / Math.PI + 90} ${tx} ${ty})`);\n t.textContent = String(i / 2);\n svg.querySelector(\"#instrument\").appendChild(t);\n }\n }\n stage.appendChild(svg);\n}"}], "metadata": {"id": "val-v1-broad-v2-entity-validation-008", "teacher": "gpt-5.6-luna", "sft_sequence_tokens": 4136, "code_sha256": "ed625a1b4d0a18b9b5beeea5087200e0b309ea9736f7372fca9ffb6cf2a0c171"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A marine chronometer sits inside an open mahogany box, suspended in brass gimbals with a white dial, black numerals, and two hands."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;overflow:hidden;background:#171313;\";\n const svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 512 512\");\n svg.setAttribute(\"width\", \"512\");\n svg.setAttribute(\"height\", \"512\");\n svg.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 1212\n 345\n 678\n 91011\n \n \n \n \n MARINE\n CHRONOMETER\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n `;\n stage.appendChild(svg);\n}"}], "metadata": {"id": "val-v1-broad-v2-entity-validation-009", "teacher": "gpt-5.6-luna", "sft_sequence_tokens": 3771, "code_sha256": "45dc52e03b991ad3337f986f93d314c75e8af617b3598d128efd92e8bf855468"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A black iron island crawls through dense clouds on enormous mechanical centipede legs, carrying glowing furnaces, smokestacks, and a fortified hilltop town."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;overflow:hidden;background:#101820;\";\n const c = document.createElement(\"canvas\");\n c.width = c.height = 512;\n c.style.cssText = \"display:block;width:512px;height:512px;\";\n stage.appendChild(c);\n const x = c.getContext(\"2d\");\n const W = 512, H = 512;\n const rnd = (() => { let s = 18473; return () => (s = (s * 1664525 + 1013904223) >>> 0) / 4294967296; })();\n\n function grad(a,b,c,d) {\n const g=x.createLinearGradient(0,a,0,b);\n g.addColorStop(0,c); g.addColorStop(1,d); return g;\n }\n function poly(p, fill, stroke, lw=1) {\n x.beginPath(); x.moveTo(p[0][0],p[0][1]);\n for(let i=1;ix.lineTo(p[0],p[1]));\n x.strokeStyle=color; x.lineWidth=width; x.lineCap=\"round\"; x.lineJoin=\"round\"; x.stroke();\n }\n function cloud(px,py,s,alpha=1) {\n x.save(); x.globalAlpha=alpha;\n const g=x.createRadialGradient(px,py-s*.15,1,px,py,s);\n g.addColorStop(0,\"#dbe2e2\"); g.addColorStop(.58,\"#aebbc0\"); g.addColorStop(1,\"#63747c\");\n ellipse(px,py,s*.7,s*.34,g);\n ellipse(px-s*.52,py+2,s*.42,s*.26,g);\n ellipse(px+s*.48,py+4,s*.5,s*.25,g);\n ellipse(px-s*.12,py-s*.18,s*.42,s*.38,g);\n ellipse(px+s*.28,py-s*.1,s*.38,s*.3,g);\n x.restore();\n }\n\n x.fillStyle=grad(0,512,\"#172d3c\",\"#91a5a8\"); x.fillRect(0,0,W,H);\n const sky=x.createLinearGradient(0,0,0,360);\n sky.addColorStop(0,\"rgba(8,21,31,.62)\"); sky.addColorStop(.5,\"rgba(51,72,80,.18)\"); sky.addColorStop(1,\"rgba(198,205,195,.28)\");\n x.fillStyle=sky;x.fillRect(0,0,W,370);\n\n for(let i=0;i<22;i++){\n const px=rnd()*560-25, py=235+rnd()*205, s=20+rnd()*46;\n cloud(px,py,s,.16+rnd()*.24);\n }\n cloud(40,345,66,.72); cloud(145,365,77,.65); cloud(466,354,83,.73);\n cloud(272,395,100,.55); cloud(380,424,76,.5);\n for(let i=0;i<8;i++) cloud(rnd()*560-20,445+rnd()*55,35+rnd()*44,.25);\n\n // distant mist and shadow\n x.fillStyle=\"rgba(24,36,38,.25)\"; x.fillRect(0,408,512,104);\n ellipse(262,473,205,27,\"#202b2d\",.55);\n\n // centipede legs behind the body\n const legs = [\n [95,322,42,463],[125,330,100,486],[161,336,151,478],\n [196,342,198,489],[236,346,244,477],[280,346,296,487],\n [321,340,347,472],[362,331,398,465],[405,321,455,447]\n ];\n legs.forEach((v,i)=>{\n const [sx,sy,kx,fy]=v, ex=kx+(i%2?18:-17), ey=fy-5;\n line([[sx,sy],[sx-4,sy+30],[kx,ey-37],[ex,ey]],\"#111719\",19);\n line([[sx,sy],[sx-4,sy+30],[kx,ey-37],[ex,ey]],\"#394448\",11);\n line([[sx,sy],[sx-4,sy+30],[kx,ey-37],[ex,ey]],\"rgba(109,119,115,.45)\",2);\n ellipse(sx-1,sy+29,8,8,\"#080b0d\");\n ellipse(kx,ey-37,9,9,\"#080b0d\");\n line([[ex-13,ey+3],[ex+19,ey+7]],\"#0b0e10\",7);\n });\n\n // island underside\n poly([[57,285],[88,263],[145,254],[215,246],[290,249],[357,258],[429,277],[455,306],\n [434,335],[389,358],[315,374],[228,379],[142,365],[78,340]], grad(250,379,\"#11191b\",\"#050708\"),\"#080c0d\",3);\n // armored plates\n line([[74,308],[132,321],[201,330],[285,332],[372,319],[442,299]],\"#485151\",3);\n line([[91,337],[153,349],[233,357],[319,352],[403,333]],\"#242e2f\",4);\n for(let i=0;i<28;i++){\n const px=75+rnd()*365, py=297+rnd()*61;\n line([[px,py],[px+10+rnd()*10,py+2]],\"rgba(111,121,116,.28)\",1);\n }\n // top rocky/iron island\n poly([[48,284],[67,249],[111,230],[158,218],[221,211],[283,214],[330,225],\n [379,232],[425,252],[453,280],[431,299],[370,307],[302,304],[239,310],\n [173,302],[110,311],[66,300]], grad(215,310,\"#394344\",\"#111718\"),\"#090e10\",4);\n poly([[70,263],[117,244],[174,234],[240,230],[302,237],[361,244],[413,267],\n [382,283],[313,278],[259,288],[195,278],[138,289],[89,282]],\"#303b3c\");\n line([[64,286],[115,278],[168,282],[231,272],[296,281],[355,270],[431,282]],\"#68706c\",2);\n\n // hill\n poly([[130,260],[147,223],[176,193],[215,177],[255,185],[295,204],[330,256]], grad(185,270,\"#343936\",\"#151b1a\"),\"#111615\",3);\n line([[147,239],[183,223],[237,218],[286,235],[319,258]],\"#59605b\",2);\n\n // town walls\n poly([[151,224],[151,190],[174,179],[212,184],[225,173],[267,181],[285,195],[315,195],\n [319,242],[285,250],[232,244],[193,251],[151,242]],\"#55544a\",\"#171b19\",3);\n for(let i=0;i<12;i++) {\n const px=157+i*13+(i%2)*2;\n poly([[px,194-(i%3)*2],[px+9,196-(i%3)*2],[px+9,207],[px,205]],\"#8a785d\");\n }\n line([[153,222],[193,229],[230,220],[271,229],[316,220]],\"#161b19\",3);\n // towers\n [[163,177,28],[224,164,39],[285,179,29]].forEach(([px,py,h])=>{\n poly([[px-15,py+h],[px-13,py],[px+12,py],[px+15,py+h]],\"#4b4a43\",\"#151918\",3);\n for(let j=0;j<4;j++) x.fillStyle=\"#161c1b\",x.fillRect(px-9+j*6,py+7,3,7);\n poly([[px-18,py],[px,py-10],[px+17,py]],\"#242a27\",\"#0d1111\",2);\n });\n // houses\n [[190,184,24,25],[246,184,26,29],[271,200,20,23],[208,203,25,25]].forEach(q=>{\n const [px,py,w,h]=q;\n poly([[px,py+h],[px,py+7],[px+w/2,py-6],[px+w,py+7],[px+w,py+h]],\"#5b5143\",\"#171b19\",2);\n x.fillStyle=\"#db9145\";x.fillRect(px+w*.35,py+11,5,7);\n x.fillStyle=\"#d4944e\";x.fillRect(px+5,py+13,5,5);\n });\n\n // furnace buildings and glowing windows\n function furnace(px,py,s) {\n x.save();\n x.shadowColor=\"#ff7b22\";x.shadowBlur=18;\n poly([[px-s,py+s],[px-s*.9,py-s*.42],[px-s*.48,py-s*.8],[px+s*.42,py-s*.7],\n [px+s*.78,py-s*.28],[px+s*.72,py+s],[px,py+s*1.1]],\"#292b25\",\"#0b0e0d\",3);\n x.restore();\n const g=x.createRadialGradient(px,py,1,px,py,s);\n g.addColorStop(0,\"#fff2a0\");g.addColorStop(.25,\"#ffb53e\");g.addColorStop(1,\"#a93312\");\n ellipse(px,py,s*.3,s*.43,g);\n line([[px-s*.7,py-s*.37],[px+s*.35,py-s*.55]],\"#6b6755\",2);\n }\n furnace(108,255,23); furnace(346,261,25);\n\n // smokestacks\n function stack(px,py,h,r) {\n poly([[px-r,py],[px-r*.82,py-h],[px+r*.72,py-h],[px+r,py]],\"#202726\",\"#090d0e\",3);\n for(let i=0;i<4;i++) line([[px-r*.7,py-h+12+i*10],[px+r*.65,py-h+10+i*10]],\"#4b5350\",1);\n ellipse(px,py-h,r*1.15,4,\"#111717\");\n }\n stack(119,233,72,8); stack(337,240,81,9); stack(371,247,48,7);\n // smokestacks glow openings\n ellipse(119,161,5,3,\"#f18a35\"); ellipse(337,159,6,3,\"#ef8732\");\n\n // smoke plumes\n function smoke(px,py,scale) {\n for(let i=0;i<7;i++){\n const t=i/6, xx=px+Math.sin(i*2.1)*14+t*18, yy=py-i*17;\n ellipse(xx,yy,12+scale*t,10+scale*t*.7, i<3?\"#303e40\":\"#657477\", .48-i*.045);\n }\n }\n smoke(119,154,13); smoke(337,153,15); smoke(371,196,10);\n\n // foreground atmospheric wisps\n for(let i=0;i<10;i++){\n const yy=399+i*10, px=(i%2)*-40+rnd()*430;\n line([[px,yy],[px+65,yy-5],[px+150,yy+2]],\"rgba(212,220,214,.16)\",7+rnd()*8);\n }\n // highlights and bolts\n [[78,286],[143,297],[211,285],[302,292],[389,281],[180,335],[346,326]].forEach(p=>{\n ellipse(p[0],p[1],2.3,2.3,\"#a6aaa0\");\n });\n x.fillStyle=\"rgba(0,0,0,.2)\";x.fillRect(0,0,512,512);\n const vignette=x.createRadialGradient(256,240,170,256,256,370);\n vignette.addColorStop(0,\"rgba(0,0,0,0)\");\n vignette.addColorStop(1,\"rgba(0,0,0,.38)\");\n x.fillStyle=vignette;x.fillRect(0,0,512,512);\n}"}], "metadata": {"id": "val-v1-broad-v2-imagination-validation-002", "teacher": "gpt-5.6-luna", "sft_sequence_tokens": 4211, "code_sha256": "64df72bbfdd8f1cbd60ded148fb04a18d6c5215699909304b453eb072809afd6"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A migrating clockwork island drifts above snowy mountains, carrying an amber forest whose metal roots mesh with enormous exposed gears."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.cssText = \"width:512px;height:512px;overflow:hidden;background:#07131d;\";\n const NS = \"http://www.w3.org/2000/svg\";\n const svg = document.createElementNS(NS, \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 512 512\");\n svg.setAttribute(\"width\", \"512\");\n svg.setAttribute(\"height\", \"512\");\n svg.setAttribute(\"preserveAspectRatio\", \"xMidYMid slice\");\n\n const esc = s => s.replace(/&/g, \"&\").replace(/ {\n let pts = [];\n for (let i = 0; i < teeth; i++) {\n const a = i * Math.PI * 2 / teeth;\n const a1 = a - Math.PI / teeth;\n const a2 = a - Math.PI / teeth * .45;\n const a3 = a + Math.PI / teeth * .45;\n const a4 = a + Math.PI / teeth;\n [[r * .82, a1], [r * 1.08, a1], [r * 1.08, a2], [r * .82, a3], [r * 1.08, a3], [r * 1.08, a4]].forEach(([rr, aa]) => {\n pts.push(`${cx + Math.cos(aa) * rr},${cy + Math.sin(aa) * rr}`);\n });\n }\n return `\n \n \n \n \n `;\n };\n\n const mountain = (points, fill, opacity = 1) =>\n ``;\n\n let trees = \"\";\n const treeData = [\n [126, 207, 1.1], [153, 183, .9], [178, 198, 1.15], [204, 159, 1.12],\n [231, 183, .9], [258, 146, 1.32], [287, 179, 1.05], [315, 153, 1.18],\n [344, 188, .95], [370, 169, 1.12], [396, 205, .86]\n ];\n for (const [x, y, s] of treeData) {\n trees += `\n \n \n \n \n \n `;\n }\n\n let rootLines = \"\";\n const roots = [\n \"M114 273 C143 295 163 316 183 356 C191 373 186 390 172 402\",\n \"M151 266 C177 293 202 313 214 350 C224 379 217 398 207 412\",\n \"M199 264 C219 290 249 310 253 347 C256 371 246 394 235 414\",\n \"M250 259 C273 282 290 309 288 344 C286 375 300 393 317 406\",\n \"M302 263 C323 287 350 308 345 343 C341 367 352 388 371 397\",\n \"M351 271 C373 290 396 311 389 340 C384 362 401 375 419 381\"\n ];\n rootLines = roots.map((d, i) =>\n `\n `\n ).join(\"\");\n\n svg.innerHTML = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ${mountain(\"0,332 73,207 130,292 178,176 249,298 305,204 361,284 432,168 512,288 512,400 0,400\", \"#42616c\", .72)}\n ${mountain(\"0,367 92,249 139,304 190,229 247,326 315,245 373,319 432,233 512,323 512,420 0,420\", \"#718b93\", .76)}\n ${mountain(\"0,331 73,207 59,257 94,238 130,292 178,176 162,235 195,219 249,298 305,204 290,246 321,230 361,284 432,168 414,226 448,215 512,288 512,350 0,350\", \"url(#snow)\", .9)}\n \n \n ${gear(132, 365, 55, 15, \"#653b25\", \"#d89038\", .95, 14)}\n ${gear(218, 397, 78, 18, \"#513021\", \"#d89a3d\", 1, 19)}\n ${gear(323, 373, 61, 16, \"#6f4025\", \"#edae45\", .98, 15)}\n ${gear(410, 394, 45, 13, \"#4b2c22\", \"#d18a35\", .95, 11)}\n \n \n \n \n \n \n \n ${rootLines}\n ${trees}\n \n \n \n \n \n \n \n \n \n `;\n\n stage.appendChild(svg);\n}"}], "metadata": {"id": "val-v1-broad-v2-imagination-validation-008", "teacher": "gpt-5.6-luna", "sft_sequence_tokens": 4288, "code_sha256": "48e9503459c2f191c26482c5b59091932b2d88c96d0c7583a62aeb641645c464"}} {"messages": [{"role": "system", "content": "Write JavaScript that renders the described image as realistically as possible. Define `async function render(stage)` where `stage` is an empty 512x512 DOM element already on the page - build whatever you need inside it. Do not call any AI image-generation or text-to-image service. Reply with only the code, no explanation."}, {"role": "user", "content": "A sunlit community bakery opens for the morning beneath a striped canvas awning. The view from the doorway shows a baker in a lilac apron arranging pear tarts on a marble counter, each tart glistening under pendant lights. Behind her, a tall rack holds round loaves marked with leaf-shaped flour patterns. A farmer wearing muddy boots sets a basket of brown eggs beside the register, and a caf\u00e9 worker carries two cups toward a seated couple. A girl with a violin case waits near a shelf of breadsticks. Through the open doorway, the awning casts blue shadows across cobblestones where a vegetable cart, potted geraniums, and a pale yellow sunrise brighten the village lane."}, {"role": "assistant", "content": "async function render(stage) {\n stage.innerHTML = \"\";\n stage.style.position = \"relative\";\n stage.style.width = \"512px\";\n stage.style.height = \"512px\";\n stage.style.overflow = \"hidden\";\n const canvas = document.createElement(\"canvas\");\n const dpr = Math.min(2, devicePixelRatio || 1);\n canvas.width = canvas.height = 512 * dpr;\n canvas.style.width = canvas.style.height = \"512px\";\n stage.appendChild(canvas);\n const ctx = canvas.getContext(\"2d\");\n ctx.scale(dpr, dpr);\n\n const W = 512, H = 512;\n const TAU = Math.PI * 2;\n const rnd = (a=1,b=0) => b + Math.random() * (a-b);\n const clamp = (n,a,b)=>Math.max(a,Math.min(b,n));\n\n function rect(x,y,w,h,fill,stroke=null,lw=1) {\n ctx.beginPath(); ctx.rect(x,y,w,h);\n if(fill){ctx.fillStyle=fill;ctx.fill();}\n if(stroke){ctx.strokeStyle=stroke;ctx.lineWidth=lw;ctx.stroke();}\n }\n function rr(x,y,w,h,r,fill,stroke=null,lw=1) {\n ctx.beginPath(); ctx.roundRect(x,y,w,h,r);\n if(fill){ctx.fillStyle=fill;ctx.fill();}\n if(stroke){ctx.strokeStyle=stroke;ctx.lineWidth=lw;ctx.stroke();}\n }\n function ellipse(x,y,rx,ry,fill,stroke=null,lw=1,rot=0) {\n ctx.beginPath(); ctx.ellipse(x,y,rx,ry,rot,0,TAU);\n if(fill){ctx.fillStyle=fill;ctx.fill();}\n if(stroke){ctx.strokeStyle=stroke;ctx.lineWidth=lw;ctx.stroke();}\n }\n function poly(points,fill,stroke=null,lw=1) {\n ctx.beginPath(); ctx.moveTo(points[0][0],points[0][1]);\n for(let i=1;ig.addColorStop(s[0],s[1])); return g;\n }\n function noise(x,y,w,h,n=80,alpha=.12,color=\"#fff\") {\n ctx.save(); ctx.globalAlpha=alpha; ctx.fillStyle=color;\n for(let i=0;i