import { writeFileSync } from "node:fs"; const cdpPort = process.env.CDP_PORT ?? "9227"; const baseUrl = process.env.SITE_URL ?? "http://127.0.0.1:4327"; const pages = await fetch(`http://127.0.0.1:${cdpPort}/json/list`).then((response) => response.json()); const page = pages.find((entry) => entry.type === "page"); if (!page) throw new Error(`CDP ${cdpPort} 没有可用页面`); const socket = new WebSocket(page.webSocketDebuggerUrl); await new Promise((resolve, reject) => { socket.addEventListener("open", resolve, { once: true }); socket.addEventListener("error", reject, { once: true }); }); let nextId = 0; const pending = new Map(); const exceptions = []; socket.addEventListener("message", (event) => { const message = JSON.parse(event.data); if (message.id && pending.has(message.id)) { const { resolve, reject } = pending.get(message.id); pending.delete(message.id); if (message.error) reject(new Error(message.error.message)); else resolve(message.result); } if (message.method === "Runtime.exceptionThrown") { exceptions.push(message.params.exceptionDetails.exception?.description ?? message.params.exceptionDetails.text); } }); const command = (method, params = {}) => new Promise((resolve, reject) => { const id = ++nextId; pending.set(id, { resolve, reject }); socket.send(JSON.stringify({ id, method, params })); }); const pause = (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds)); const evaluate = async (expression) => { const result = await command("Runtime.evaluate", { expression, returnByValue: true, awaitPromise: true }); if (result.exceptionDetails) throw new Error(result.exceptionDetails.exception?.description ?? result.exceptionDetails.text); return result.result.value; }; const navigate = async (path) => { await command("Page.navigate", { url: `${baseUrl}${path}` }); for (let attempt = 0; attempt < 70; attempt += 1) { await pause(100); if (await evaluate("document.readyState === 'complete'")) return; } throw new Error(`${path} 加载超时`); }; const screenshot = async (path) => { const result = await command("Page.captureScreenshot", { format: "png", captureBeyondViewport: false }); writeFileSync(path, Buffer.from(result.data, "base64")); }; await command("Page.enable"); await command("Runtime.enable"); await command("Emulation.setDeviceMetricsOverride", { width: 1440, height: 1100, deviceScaleFactor: 1, mobile: false, }); await navigate("/deepseek/"); await screenshot("/tmp/llm-atlas-deepseek-desktop.png"); const overview = await evaluate(`(() => ({ title: document.querySelector("h1")?.textContent.trim(), sections: document.querySelectorAll(".article-section").length, tocLinks: document.querySelectorAll(".side-rail a").length, ledgers: document.querySelectorAll(".ledger-card").length, waves: document.querySelectorAll(".wave-grid > article").length, paperLinks: document.querySelectorAll("[data-deepseek-paper-chain] a").length, labTabs: document.querySelectorAll("[data-ds-tab]").length, labPanels: document.querySelectorAll("[data-ds-panel]").length, artifactTabs: document.querySelectorAll("[data-artifact-tab]").length, artifactPanels: document.querySelectorAll("[data-artifact-panel]").length, artifactLayers: document.querySelectorAll(".layer-evidence > span").length, behaviorTabs: document.querySelectorAll("[data-behavior-tab]").length, behaviorPanels: document.querySelectorAll("[data-behavior-panel]").length, behaviorSources: document.querySelectorAll("[data-behavior-source] option").length, behaviorEdges: document.querySelectorAll("[data-behavior-map-edge]").length, completionDepthTabs: document.querySelectorAll("[data-cd-tab]").length, completionDepthPanels: document.querySelectorAll("[data-cd-panel]").length, crossSourceTabs: document.querySelectorAll("[data-cs-tab]").length, crossSourcePanels: document.querySelectorAll("[data-cs-panel]").length, hiddenStages: document.querySelectorAll("[data-hidden-stage]").length, routerLayers: document.querySelectorAll("[data-router-layer]").length, branches: document.querySelectorAll(".branch-grid > a").length, followups: document.querySelectorAll(".lineage-row.followup").length, navLinks: document.querySelectorAll(".top-nav a").length, activeNav: document.querySelector('.top-nav a[aria-current="page"]')?.textContent.trim(), heroLabs: [...document.querySelectorAll(".page-facts > div")] .find((node) => node.querySelector("dt")?.textContent.trim() === "LABS") ?.querySelector("dd")?.textContent.trim(), documentOverflow: document.documentElement.scrollWidth - document.documentElement.clientWidth, }))()`); const capacity = await evaluate(`(() => { const root = document.querySelector("[data-deepseek-lab]"); const read = () => ({ panel: root.querySelector("[data-ds-panel]:not([hidden])").dataset.dsPanel, total: root.querySelector("[data-total-capacity]").textContent.trim(), active: root.querySelector("[data-active-compute]").textContent.trim(), combinations: root.querySelector("[data-combinations]").textContent.trim(), communication: root.querySelector("[data-communication]").textContent.trim(), name: root.querySelector("[data-capacity-name]").textContent.trim(), explain: root.querySelector("[data-capacity-explain]").textContent.trim(), }); const initial = read(); root.querySelector('[data-capacity-preset="dense"]').click(); const dense = read(); root.querySelector('[data-capacity-preset="deepseekmoe"]').click(); const fine = read(); root.querySelector('[data-capacity-preset="v3"]').click(); const v3 = read(); return { initial, dense, fine, v3 }; })()`); const cache = await evaluate(`(() => { const root = document.querySelector("[data-deepseek-lab]"); root.querySelector('[data-ds-tab="cache"]').click(); const read = () => ({ panel: root.querySelector("[data-ds-panel]:not([hidden])").dataset.dsPanel, mha: root.querySelector("[data-mha-elements]").textContent.trim(), gqa: root.querySelector("[data-gqa-elements]").textContent.trim(), mla: root.querySelector("[data-mla-elements]").textContent.trim(), rope: root.querySelector("[data-rope-cache]").textContent.trim(), selected: root.querySelector("[data-selected-cache]").textContent.trim(), baseline: root.querySelector("[data-mha-cache]").textContent.trim(), reduction: root.querySelector("[data-cache-reduction]").textContent.trim(), boundary: root.querySelector("[data-cache-boundary]").textContent.trim(), }); const initial = read(); const rope = root.querySelector("[data-rope-dim]"); rope.value = "0"; rope.dispatchEvent(new Event("input", { bubbles: true })); const noRope = read(); const context = root.querySelector("[data-context-length]"); context.value = "1048576"; context.dispatchEvent(new Event("input", { bubbles: true })); const million = read(); return { initial, noRope, million }; })()`); const codesign = await evaluate(`(() => { const root = document.querySelector("[data-deepseek-lab]"); root.querySelector('[data-ds-tab="codesign"]').click(); const readSchedule = () => ({ bubble: root.querySelector("[data-bubble]").textContent.trim(), exposed: root.querySelector("[data-exposed-comm]").textContent.trim(), }); const oneWay = readSchedule(); root.querySelector('[data-schedule="dual"]').click(); const dual = readSchedule(); root.querySelector('[data-precision="naive"]').click(); const naive = { risk: root.querySelector("[data-risk-label]").textContent.trim(), accum: root.querySelector("[data-accum-dtype]").textContent.trim(), explain: root.querySelector("[data-precision-explain]").textContent.trim(), }; root.querySelector('[data-precision="mixed"]').click(); const mixed = { risk: root.querySelector("[data-risk-label]").textContent.trim(), accum: root.querySelector("[data-accum-dtype]").textContent.trim(), sensitive: root.querySelector("[data-sensitive-dtype]").textContent.trim(), }; root.querySelector('[data-mtp-role="off"]').click(); const off = root.querySelector("[data-mtp-supervision]").textContent.trim(); root.querySelector('[data-mtp-role="draft"]').click(); const draft = { supervision: root.querySelector("[data-mtp-supervision]").textContent.trim(), cost: root.querySelector("[data-mtp-main-cost]").textContent.trim(), explain: root.querySelector("[data-mtp-explain]").textContent.trim(), }; return { panel: root.querySelector("[data-ds-panel]:not([hidden])").dataset.dsPanel, oneWay, dual, naive, mixed, off, draft }; })()`); const rl = await evaluate(`(() => { const root = document.querySelector("[data-deepseek-lab]"); root.querySelector('[data-ds-tab="rl"]').click(); const read = () => ({ signal: root.querySelector("[data-signal-state]").textContent.trim(), mean: root.querySelector("[data-reward-mean]").textContent.trim(), std: root.querySelector("[data-reward-std]").textContent.trim(), effective: root.querySelector("[data-effective]").textContent.trim(), provenance: root.querySelector("[data-provenance]").textContent.trim(), algorithm: root.querySelector("[data-algorithm-name]").textContent.trim(), boundary: root.querySelector("[data-rl-boundary]").textContent.trim(), weights: [...root.querySelectorAll("[data-advantage-rows] > div span:last-child")].map((node) => node.textContent.trim()), }); const initial = read(); root.querySelector('[data-reward-preset="same"]').click(); const same = read(); root.querySelector('[data-reward-preset="longwrong"]').click(); root.querySelector('[data-rl-algorithm="dapo"]').click(); const dapo = read(); root.querySelector('[data-rl-algorithm="dr"]').click(); const dr = read(); root.querySelector('[data-r1-mode="r1"]').click(); const r1 = root.querySelector("[data-r1-mode-explain]").textContent.trim(); root.querySelector('[data-r1-mode="distill"]').click(); const distill = root.querySelector("[data-r1-mode-explain]").textContent.trim(); const first = root.querySelector('[data-ds-tab="capacity"]'); first.focus(); first.dispatchEvent(new KeyboardEvent("keydown", { key: "ArrowRight", bubbles: true })); return { initial, same, dapo, dr, r1, distill, keyboardSelected: root.querySelector('[data-ds-tab][aria-selected="true"]').dataset.dsTab, keyboardVisible: root.querySelector("[data-ds-panel]:not([hidden])").dataset.dsPanel, }; })()`); const artifactRoute = await evaluate(`(() => { const root = document.querySelector("[data-dsv2-lab]"); const read = () => ({ panel: root.querySelector("[data-artifact-panel]:not([hidden])").dataset.artifactPanel, position: root.querySelector("[data-route-position]").textContent.trim(), piece: root.querySelector("[data-route-piece]").textContent.trim(), tokenId: root.querySelector("[data-route-token-id]").textContent.trim(), weightSum: root.querySelector("[data-route-weight-sum]").textContent.trim(), chosen: [...root.querySelectorAll("[data-route-experts] article")].map((node) => ({ expert: node.querySelector("b").textContent.trim(), weight: node.querySelector("small").textContent.trim(), })), heatCells: root.querySelectorAll("[data-route-heatmap] > span").length, selectedCells: root.querySelectorAll("[data-route-heatmap] > span.selected").length, routes: root.querySelector("[data-route-count]").textContent.trim(), used: root.querySelector("[data-route-used]").textContent.trim(), cv: root.querySelector("[data-route-cv]").textContent.trim(), effective: root.querySelector("[data-route-effective]").textContent.trim(), }); const initial = read(); const layer = root.querySelector("[data-route-layer]"); const prompt = root.querySelector("[data-route-prompt]"); const token = root.querySelector("[data-route-token]"); layer.value = "4"; layer.dispatchEvent(new Event("change", { bubbles: true })); prompt.value = "en_architecture"; prompt.dispatchEvent(new Event("change", { bubbles: true })); token.value = String(token.options.length - 1); token.dispatchEvent(new Event("change", { bubbles: true })); const switched = read(); return { initial, switched, tokenOptions: token.options.length }; })()`); const artifactLoad = await evaluate(`(() => { const root = document.querySelector("[data-dsv2-lab]"); root.querySelector('[data-artifact-tab="load"]').click(); const read = () => ({ panel: root.querySelector("[data-artifact-panel]:not([hidden])").dataset.artifactPanel, used: root.querySelector("[data-load-used]").textContent.trim(), zero: root.querySelector("[data-load-zero]").textContent.trim(), cv: root.querySelector("[data-load-cv]").textContent.trim(), gini: root.querySelector("[data-load-gini]").textContent.trim(), effective: root.querySelector("[data-load-effective]").textContent.trim(), rows: root.querySelectorAll("[data-load-rows] > div").length, jaccards: root.querySelectorAll("[data-load-jaccard] > article").length, }); const layer1 = read(); root.querySelector('[data-load-layer="2"]').click(); const layer2 = read(); root.querySelector('[data-load-layer="4"]').click(); const layer4 = read(); return { layer1, layer2, layer4 }; })()`); const artifactCache = await evaluate(`(() => { const root = document.querySelector("[data-dsv2-lab]"); root.querySelector('[data-artifact-tab="cache"]').click(); const read = () => ({ panel: root.querySelector("[data-artifact-panel]:not([hidden])").dataset.artifactPanel, latent: root.querySelector("[data-cache-latent-bytes]").textContent.trim(), eager: root.querySelector("[data-cache-eager-bytes]").textContent.trim(), ratio: root.querySelector("[data-cache-ratio]").textContent.trim(), reduction: root.querySelector("[data-cache-reduction]").textContent.trim(), }); const trace = read(); const context = root.querySelector("[data-cache-context]"); const batch = root.querySelector("[data-cache-batch]"); const layers = root.querySelector("[data-cache-layers]"); context.value = "1048576"; context.dispatchEvent(new Event("change", { bubbles: true })); batch.value = "8"; batch.dispatchEvent(new Event("input", { bubbles: true })); layers.value = "27"; layers.dispatchEvent(new Event("input", { bubbles: true })); const million = read(); return { trace, million }; })()`); const artifactAbsorb = await evaluate(`(() => { const root = document.querySelector("[data-dsv2-lab]"); root.querySelector('[data-artifact-tab="absorb"]').click(); return { panel: root.querySelector("[data-artifact-panel]:not([hidden])").dataset.artifactPanel, algebra: root.querySelectorAll(".absorb-algebra article").length, naive: root.querySelector(".absorb-cache-flow .naive header b").textContent.trim(), absorbed: root.querySelector(".absorb-cache-flow .absorbed header b").textContent.trim(), metrics: [...root.querySelectorAll(".absorb-metrics article b")].map((node) => node.textContent.trim()), precisionRows: root.querySelectorAll(".precision-lens > div").length, matrixRows: root.querySelectorAll(".kernel-matrix > div").length, localUnsupported: root.querySelectorAll(".kernel-matrix i.no").length, executionCards: root.querySelectorAll(".execution-split article").length, boundary: root.querySelector('[data-artifact-panel="absorb"] .artifact-boundary').textContent.replaceAll(/\\s+/g, " ").trim(), }; })()`); await evaluate(`(() => { document.querySelector("[data-dsv2-lab]").scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -82); })()`); await pause(180); await screenshot("/tmp/llm-atlas-deepseek-absorb-desktop.png"); const artifactCorpus = await evaluate(`(() => { const root = document.querySelector("[data-dsv2-lab]"); root.querySelector('[data-artifact-tab="corpus"]').click(); const read = () => ({ panel: root.querySelector("[data-artifact-panel]:not([hidden])").dataset.artifactPanel, rows: root.querySelectorAll("[data-corpus-domain-rows] > div").length, tokens: [...root.querySelectorAll("[data-corpus-domain-rows] > div > span:first-child > small")].map((node) => node.textContent.trim()), heatRows: root.querySelectorAll("[data-corpus-heatmap] > div").length, heatCells: root.querySelectorAll("[data-corpus-heatmap] > div > span").length, jsdCells: root.querySelectorAll("[data-corpus-jsd] > *").length, highest: root.querySelector("[data-corpus-highest-cv]").textContent.trim(), largest: root.querySelector("[data-corpus-largest-jsd]").textContent.trim(), heatTitle: root.querySelector("[data-corpus-heat-title]").textContent.trim(), cohortTitle: root.querySelector("[data-corpus-cohort-title]").textContent.trim(), exact: root.querySelector(".corpus-ledger .exact b").textContent.trim(), modeNote: root.querySelector("[data-corpus-mode-note]").textContent.trim(), deltaCards: root.querySelectorAll("[data-length-delta-grid] > article").length, lengthJsd: root.querySelector("[data-length-jsd]").textContent.trim(), lengthLargest: root.querySelector("[data-length-largest]").textContent.trim(), }); const layer1 = read(); root.querySelector('[data-corpus-layer="4"]').click(); const layer4 = read(); root.querySelector('[data-corpus-cohort="matched16"]').click(); root.querySelector('[data-corpus-layer="2"]').click(); const matched16 = read(); root.querySelector('[data-corpus-cohort="matched24"]').click(); const matched24 = read(); root.querySelector('[data-corpus-mode="token_weighted"]').click(); const tokenWeighted = read(); return { layer1, layer4, matched16, matched24, tokenWeighted }; })()`); await evaluate(`(() => { document.querySelector("[data-dsv2-lab]").scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -82); })()`); await pause(180); await screenshot("/tmp/llm-atlas-deepseek-corpus-desktop.png"); await evaluate(`(() => { document.querySelector(".length-sensitivity").scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -82); })()`); await pause(120); await screenshot("/tmp/llm-atlas-deepseek-length-sensitivity-desktop.png"); const artifactTemplate = await evaluate(`(() => { const root = document.querySelector("[data-dsv2-lab]"); root.querySelector('[data-artifact-tab="template"]').click(); const read = () => ({ panel: root.querySelector("[data-artifact-panel]:not([hidden])").dataset.artifactPanel, domainCards: root.querySelectorAll("[data-template-domain-grid] > article").length, domains: [...root.querySelectorAll("[data-template-domain-grid] > article")].map((node) => ({ label: node.querySelector("span").textContent.trim(), values: node.querySelector("b").textContent.trim(), delta: node.querySelector("strong").textContent.trim(), className: node.querySelector("strong").className, ci: node.querySelector("p").textContent.trim(), distance: node.querySelector("small").textContent.trim(), stability: node.querySelector("em").textContent.trim(), })), prefixExact: root.querySelector("[data-template-prefix-exact]").textContent.trim(), contentZero: root.querySelector("[data-template-content-zero]").textContent.trim(), suffixTv: root.querySelector("[data-template-suffix-tv]").textContent.trim(), note: root.querySelector("[data-template-note]").textContent.trim(), depthRows: root.querySelectorAll("[data-template-depth-map] > div").length, depthCells: root.querySelectorAll("[data-template-depth-map] > div > span").length, exact: root.querySelector(".template-ledger .exact b").textContent.trim(), activeLayer: root.querySelector("[data-template-layer].active").textContent.trim(), activeScope: root.querySelector('[data-template-scope][aria-pressed="true"]').dataset.templateScope, activeMode: root.querySelector('[data-template-mode][aria-pressed="true"]').dataset.templateMode, }); const layer1Content = read(); root.querySelector('[data-template-layer="6"]').click(); const layer6Content = read(); root.querySelector('[data-template-scope="full_input"]').click(); const layer6Full = read(); root.querySelector('[data-template-mode="token_weighted"]').click(); const layer6FullToken = read(); root.querySelector('[data-template-scope="content_only"]').click(); root.querySelector('[data-template-mode="prompt_balanced"]').click(); root.querySelector('[data-template-layer="2"]').click(); const layer2Content = read(); return { layer1Content, layer6Content, layer6Full, layer6FullToken, layer2Content }; })()`); await evaluate(`(() => { document.querySelector("[data-dsv2-lab]").scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -82); })()`); await pause(180); await screenshot("/tmp/llm-atlas-deepseek-template-desktop.png"); await evaluate(`(() => { document.querySelector(".template-domain-grid").scrollIntoView({ block: "center", behavior: "instant" }); })()`); await pause(120); await screenshot("/tmp/llm-atlas-deepseek-template-results-desktop.png"); const artifactHistory = await evaluate(`(() => { const root = document.querySelector("[data-dsv2-lab]"); root.querySelector('[data-artifact-tab="history"]').click(); const read = () => ({ panel: root.querySelector("[data-artifact-panel]:not([hidden])").dataset.artifactPanel, matrixRows: root.querySelectorAll(".history-row").length, matrixCells: root.querySelectorAll(".history-row > article").length, domainCards: root.querySelectorAll("[data-history-domain-grid] > article").length, domains: [...root.querySelectorAll("[data-history-domain-grid] > article")].map((node) => ({ label: node.querySelector("span").textContent.trim(), cells: [...node.querySelectorAll(".history-cell-values i")].map((cell) => ({ name: cell.querySelector("small").textContent.trim(), value: cell.querySelector("b").textContent.trim(), })), effect: node.querySelector("strong").textContent.trim(), className: node.querySelector("strong").className, ci: node.querySelector("p").textContent.trim(), allEffects: node.querySelector(":scope > small").textContent.trim(), edges: node.querySelector("em").textContent.trim(), })), bufferSummary: [...root.querySelectorAll('[data-artifact-panel="history"] .history-buffer-summary article b')].map((node) => node.textContent.trim()), bufferCards: [...root.querySelectorAll("[data-history-buffer-grid] > article")].map((node) => ({ label: node.querySelector("span").textContent.trim(), tv: node.querySelector("b").textContent.trim(), reduction: node.querySelector("strong").textContent.trim(), stability: node.querySelector("p").textContent.trim(), })), depthRows: root.querySelectorAll("[data-history-depth-map] > div").length, depthCells: root.querySelectorAll("[data-history-depth-map] > div > span").length, depthTitle: root.querySelector("[data-history-depth-title]").textContent.trim(), exact: root.querySelector(".history-ledger .exact b").textContent.trim(), note: root.querySelector("[data-history-note]").textContent.trim(), activeLayer: root.querySelector("[data-history-layer].active").textContent.trim(), activeScope: root.querySelector('[data-history-scope][aria-pressed="true"]').dataset.historyScope, activeMode: root.querySelector('[data-history-mode][aria-pressed="true"]').dataset.historyMode, activeEffect: root.querySelector('[data-history-effect][aria-pressed="true"]').dataset.historyEffect, }); const layer1Interaction = read(); root.querySelector('[data-history-layer="4"]').click(); const layer4Interaction = read(); root.querySelector('[data-history-effect="system_main"]').click(); const layer4System = read(); root.querySelector('[data-history-scope="full_input"]').click(); const layer4FullSystem = read(); root.querySelector('[data-history-mode="token_weighted"]').click(); const layer4FullToken = read(); root.querySelector('[data-history-scope="target_content"]').click(); root.querySelector('[data-history-mode="prompt_balanced"]').click(); root.querySelector('[data-history-effect="interaction"]').click(); return { layer1Interaction, layer4Interaction, layer4System, layer4FullSystem, layer4FullToken, restored: read() }; })()`); await evaluate(`(() => { document.querySelector("[data-dsv2-lab]").scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -82); })()`); await pause(180); await screenshot("/tmp/llm-atlas-deepseek-history-desktop.png"); await evaluate(`(() => { document.querySelector(".history-domain-grid").scrollIntoView({ block: "center", behavior: "instant" }); })()`); await pause(120); await screenshot("/tmp/llm-atlas-deepseek-history-results-desktop.png"); const artifactDistance = await evaluate(`(() => { const root = document.querySelector("[data-dsv2-lab]"); root.querySelector('[data-artifact-tab="distance"]').click(); const read = () => ({ panel: root.querySelector("[data-artifact-panel]:not([hidden])").dataset.artifactPanel, matrixRows: root.querySelectorAll(".distance-row:not(.head)").length, matrixCells: root.querySelectorAll(".distance-row:not(.head) > article").length, domainCards: root.querySelectorAll("[data-distance-domain-grid] > article").length, domains: [...root.querySelectorAll("[data-distance-domain-grid] > article")].map((node) => ({ label: node.querySelector(":scope > span").textContent.trim(), values: [...node.querySelectorAll(".distance-tv-ladder i")].map((cell) => ({ name: cell.querySelector("small").textContent.trim(), value: cell.querySelector("b").textContent.trim(), })), effect: node.querySelector("strong").textContent.trim(), className: node.querySelector("strong").className, ci: node.querySelector(":scope > p").textContent.trim(), stability: node.querySelector(":scope > small").textContent.trim(), lexical: node.querySelector(":scope > em").textContent.trim(), cv: node.querySelector(":scope > u").textContent.trim(), })), summary: [...root.querySelectorAll(".distance-summary article b")].map((node) => node.textContent.trim()), depthRows: root.querySelectorAll("[data-distance-depth-map] > div").length, depthCells: root.querySelectorAll("[data-distance-depth-map] > div > span").length, depthTitle: root.querySelector("[data-distance-depth-title]").textContent.trim(), exact: root.querySelector(".distance-ledger .exact b").textContent.trim(), note: root.querySelector("[data-distance-note]").textContent.trim(), activeLayer: root.querySelector("[data-distance-layer].active").textContent.trim(), activeScope: root.querySelector('[data-distance-scope][aria-pressed="true"]').dataset.distanceScope, activeMode: root.querySelector('[data-distance-mode][aria-pressed="true"]').dataset.distanceMode, activeContrast: root.querySelector('[data-distance-contrast][aria-pressed="true"]').dataset.distanceContrast, }); const layer1Filler = read(); root.querySelector('[data-distance-layer="4"]').click(); const layer4Filler = read(); root.querySelector('[data-distance-contrast="demo_minus_filler"]').click(); const layer4Demo = read(); root.querySelector('[data-distance-scope="full_input"]').click(); const layer4FullDemo = read(); root.querySelector('[data-distance-mode="token_weighted"]').click(); const layer4FullToken = read(); root.querySelector('[data-distance-scope="target_content"]').click(); root.querySelector('[data-distance-mode="prompt_balanced"]').click(); root.querySelector('[data-distance-contrast="filler_minus_none"]').click(); return { layer1Filler, layer4Filler, layer4Demo, layer4FullDemo, layer4FullToken, restored: read() }; })()`); await evaluate(`(() => { document.querySelector("[data-dsv2-lab]").scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -82); })()`); await pause(180); await screenshot("/tmp/llm-atlas-deepseek-distance-desktop.png"); await evaluate(`(() => { document.querySelector(".distance-domain-grid").scrollIntoView({ block: "center", behavior: "instant" }); })()`); await pause(120); await screenshot("/tmp/llm-atlas-deepseek-distance-results-desktop.png"); const artifactBoundary = await evaluate(`(() => { const root = document.querySelector("[data-dsv2-lab]"); root.querySelector('[data-artifact-tab="boundary"]').click(); const read = () => ({ panel: root.querySelector("[data-artifact-panel]:not([hidden])").dataset.artifactPanel, tokenCards: root.querySelectorAll(".boundary-token-grid > article").length, domainCards: root.querySelectorAll("[data-boundary-domain-grid] > article").length, domains: [...root.querySelectorAll("[data-boundary-domain-grid] > article")].map((node) => ({ label: node.querySelector(":scope > span").textContent.trim(), values: [...node.querySelectorAll(".boundary-tv-ladder > b")].map((cell) => ({ name: cell.querySelector("small").textContent.trim(), value: cell.querySelector("strong").textContent.trim(), })), effect: node.querySelector(":scope > strong").textContent.trim(), className: node.querySelector(":scope > strong").className, ci: node.querySelector(":scope > p").textContent.trim(), stability: node.querySelector(":scope > small").textContent.trim(), substitution: node.querySelector(":scope > em").textContent.trim(), interaction: node.querySelector(":scope > u").textContent.trim(), cv: node.querySelector(":scope > i").textContent.trim(), })), summary: [...root.querySelectorAll('[data-artifact-panel="boundary"] .boundary-summary article b')].map((node) => node.textContent.trim()), depthRows: root.querySelectorAll("[data-boundary-depth-map] > div").length, depthCells: root.querySelectorAll("[data-boundary-depth-map] > div > span").length, depthTitle: root.querySelector("[data-boundary-depth-title]").textContent.trim(), exact: root.querySelector(".boundary-ledger .exact b").textContent.trim(), note: root.querySelector("[data-boundary-note]").textContent.trim(), trackToken: root.querySelector("[data-boundary-track-token]").textContent.trim(), activeLayer: root.querySelector("[data-boundary-layer].active").textContent.trim(), activeScope: root.querySelector('[data-boundary-scope][aria-pressed="true"]').dataset.boundaryScope, activeMode: root.querySelector('[data-boundary-mode][aria-pressed="true"]').dataset.boundaryMode, activeContrast: root.querySelector('[data-boundary-contrast][aria-pressed="true"]').dataset.boundaryContrast, }); const layer1X = read(); root.querySelector('[data-boundary-layer="4"]').click(); const layer4X = read(); root.querySelector('[data-boundary-contrast="period_minus_eos"]').click(); const layer4Period = read(); root.querySelector('[data-boundary-contrast="newline_minus_eos"]').click(); const layer4Newline = read(); root.querySelector('[data-boundary-scope="full_input"]').click(); const layer4Full = read(); root.querySelector('[data-boundary-mode="token_weighted"]').click(); const layer4FullToken = read(); root.querySelector('[data-boundary-layer="1"]').click(); root.querySelector('[data-boundary-scope="target_content"]').click(); root.querySelector('[data-boundary-mode="prompt_balanced"]').click(); root.querySelector('[data-boundary-contrast="x_minus_eos"]').click(); return { layer1X, layer4X, layer4Period, layer4Newline, layer4Full, layer4FullToken, restored: read() }; })()`); await evaluate(`(() => { document.querySelector("[data-dsv2-lab]").scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -82); })()`); await pause(180); await screenshot("/tmp/llm-atlas-deepseek-boundary-desktop.png"); await evaluate(`(() => { document.querySelector(".boundary-domain-grid").scrollIntoView({ block: "center", behavior: "instant" }); })()`); await pause(120); await screenshot("/tmp/llm-atlas-deepseek-boundary-results-desktop.png"); const artifactRole = await evaluate(`(() => { const root = document.querySelector("[data-dsv2-lab]"); root.querySelector('[data-artifact-tab="role"]').click(); const read = () => ({ panel: root.querySelector("[data-artifact-panel]:not([hidden])").dataset.artifactPanel, levelCards: root.querySelectorAll(".role-level-grid > article").length, domainCards: root.querySelectorAll("[data-role-domain-grid] > article").length, domains: [...root.querySelectorAll("[data-role-domain-grid] > article")].map((node) => ({ label: node.querySelector(":scope > span").textContent.trim(), values: [...node.querySelectorAll(".role-tv-ladder > b")].map((cell) => ({ name: cell.querySelector("small").textContent.trim(), value: cell.querySelector("strong").textContent.trim(), })), effect: node.querySelector(":scope > strong").textContent.trim(), className: node.querySelector(":scope > strong").className, ci: node.querySelector(":scope > p").textContent.trim(), stability: node.querySelector(":scope > small").textContent.trim(), direct: node.querySelector(":scope > em").textContent.trim(), interaction: node.querySelector(":scope > u").textContent.trim(), cv: node.querySelector(":scope > i").textContent.trim(), })), summary: [...root.querySelectorAll('[data-artifact-panel="role"] .role-summary article b')].map((node) => node.textContent.trim()), depthRows: root.querySelectorAll("[data-role-depth-map] > div").length, depthCells: root.querySelectorAll("[data-role-depth-map] > div > span").length, depthTitle: root.querySelector("[data-role-depth-title]").textContent.trim(), exact: root.querySelector(".role-ledger .exact b").textContent.trim(), causalCards: root.querySelectorAll(".role-causal-ledger > article").length, batchCells: root.querySelectorAll('[data-artifact-panel="role"] .role-batch-audit > div:last-child > span').length, batchValues: [...root.querySelectorAll('[data-artifact-panel="role"] .role-batch-audit > div:last-child > span i')].map((node) => node.textContent.trim()), note: root.querySelector("[data-role-note]").textContent.trim(), targetHead: root.querySelector("[data-role-target-head]").textContent.trim(), suffixHead: root.querySelector("[data-role-suffix-head]").textContent.trim(), activeLayer: root.querySelector("[data-role-layer].active").textContent.trim(), activeScope: root.querySelector('[data-role-scope][aria-pressed="true"]').dataset.roleScope, activeMode: root.querySelector('[data-role-mode][aria-pressed="true"]').dataset.roleMode, activeContrast: root.querySelector('[data-role-contrast][aria-pressed="true"]').dataset.roleContrast, }); const layer1Assistant = read(); root.querySelector('[data-role-layer="5"]').click(); root.querySelector('[data-role-contrast="target_x_minus_official"]').click(); const layer5X = read(); root.querySelector('[data-role-contrast="suffix_user_minus_official"]').click(); const layer5Suffix = read(); root.querySelector('[data-role-scope="full_input"]').click(); const layer5FullSuffix = read(); root.querySelector('[data-role-mode="token_weighted"]').click(); const layer5FullToken = read(); root.querySelector('[data-role-layer="1"]').click(); root.querySelector('[data-role-scope="target_content"]').click(); root.querySelector('[data-role-mode="prompt_balanced"]').click(); root.querySelector('[data-role-contrast="target_assistant_minus_official"]').click(); return { layer1Assistant, layer5X, layer5Suffix, layer5FullSuffix, layer5FullToken, restored: read() }; })()`); await evaluate(`(() => { document.querySelector("[data-dsv2-lab]").scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -82); })()`); await pause(180); await screenshot("/tmp/llm-atlas-deepseek-role-desktop.png"); await evaluate(`(() => { document.querySelector(".role-domain-grid").scrollIntoView({ block: "center", behavior: "instant" }); })()`); await pause(120); await screenshot("/tmp/llm-atlas-deepseek-role-results-desktop.png"); const artifactSpecial = await evaluate(`(() => { const root = document.querySelector("[data-dsv2-lab]"); root.querySelector('[data-artifact-tab="special"]').click(); const read = () => ({ panel: root.querySelector("[data-artifact-panel]:not([hidden])").dataset.artifactPanel, tokenCards: root.querySelectorAll(".special-token-grid > article").length, domainCards: root.querySelectorAll("[data-special-domain-grid] > article").length, domains: [...root.querySelectorAll("[data-special-domain-grid] > article")].map((node) => ({ label: node.querySelector(":scope > span").textContent.trim(), values: [...node.querySelectorAll(".special-tv-ladder > b")].map((cell) => ({ name: cell.querySelector("small").textContent.trim(), value: cell.querySelector("strong").textContent.trim(), })), effect: node.querySelector(":scope > strong").textContent.trim(), className: node.querySelector(":scope > strong").className, ci: node.querySelector(":scope > p").textContent.trim(), detail: node.querySelector(":scope > em").textContent.trim(), stability: node.querySelector(":scope > small").textContent.trim(), cv: node.querySelector(":scope > i").textContent.trim(), })), summary: [...root.querySelectorAll('[data-artifact-panel="special"] .special-summary article b')].map((node) => node.textContent.trim()), depthRows: root.querySelectorAll("[data-special-depth-map] > div").length, depthCells: root.querySelectorAll("[data-special-depth-map] > div > span").length, depthTitle: root.querySelector("[data-special-depth-title]").textContent.trim(), exact: root.querySelector(".special-ledger .exact b").textContent.trim(), scopeCards: root.querySelectorAll('[data-artifact-panel="special"] .special-scope-ledger > article').length, batchCells: root.querySelectorAll(".special-batch-audit > div:last-child > span").length, batchValues: [...root.querySelectorAll(".special-batch-audit > div:last-child > span i")].map((node) => node.textContent.trim()), note: root.querySelector("[data-special-note]").textContent.trim(), activeLayer: root.querySelector("[data-special-layer].active").textContent.trim(), activeScope: root.querySelector('[data-special-scope][aria-pressed="true"]').dataset.specialScope, activeMode: root.querySelector('[data-special-mode][aria-pressed="true"]').dataset.specialMode, activeContrast: root.querySelector('[data-special-contrast][aria-pressed="true"]').dataset.specialContrast, }); const layer1Bos = read(); root.querySelector('[data-special-layer="4"]').click(); root.querySelector('[data-special-contrast="x_minus_eos"]').click(); const layer4X = read(); root.querySelector('[data-special-contrast="period_minus_eos"]').click(); const layer4Period = read(); root.querySelector('[data-special-contrast="family"]').click(); const layer4Family = read(); root.querySelector('[data-special-scope="full_input"]').click(); const layer4FullFamily = read(); root.querySelector('[data-special-mode="token_weighted"]').click(); const layer4FullToken = read(); root.querySelector('[data-special-layer="1"]').click(); root.querySelector('[data-special-scope="target_content"]').click(); root.querySelector('[data-special-mode="prompt_balanced"]').click(); root.querySelector('[data-special-contrast="bos_minus_eos"]').click(); return { layer1Bos, layer4X, layer4Period, layer4Family, layer4FullFamily, layer4FullToken, restored: read() }; })()`); await evaluate(`(() => { document.querySelector("[data-dsv2-lab]").scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -82); })()`); await pause(180); await screenshot("/tmp/llm-atlas-deepseek-special-desktop.png"); await evaluate(`(() => { document.querySelector(".special-domain-grid").scrollIntoView({ block: "center", behavior: "instant" }); })()`); await pause(120); await screenshot("/tmp/llm-atlas-deepseek-special-results-desktop.png"); const artifactRoleBlock = await evaluate(`(() => { const root = document.querySelector("[data-dsv2-lab]"); root.querySelector('[data-artifact-tab="role-block"]').click(); const read = () => ({ panel: root.querySelector("[data-artifact-panel]:not([hidden])").dataset.artifactPanel, matrixCards: root.querySelectorAll(".role-block-matrix > article").length, domainCards: root.querySelectorAll("[data-role-block-domain-grid] > article").length, domains: [...root.querySelectorAll("[data-role-block-domain-grid] > article")].map((node) => ({ label: node.querySelector(":scope > span").textContent.trim(), values: [...node.querySelectorAll(".role-block-tv-ladder > b")].map((cell) => ({ name: cell.querySelector("small").textContent.trim(), value: cell.querySelector("strong").textContent.trim(), })), effect: node.querySelector(":scope > strong").textContent.trim(), className: node.querySelector(":scope > strong").className, ci: node.querySelector(":scope > p").textContent.trim(), direct: node.querySelector(":scope > em").textContent.trim(), dependency: node.querySelector(":scope > u").textContent.trim(), stability: node.querySelector(":scope > small").textContent.trim(), cv: node.querySelector(":scope > i").textContent.trim(), })), summary: [...root.querySelectorAll('[data-artifact-panel="role-block"] .role-block-summary article b')].map((node) => node.textContent.trim()), directCards: root.querySelectorAll(".role-block-direct > article").length, depthRows: root.querySelectorAll("[data-role-block-depth-map] > div").length, depthCells: root.querySelectorAll("[data-role-block-depth-map] > div > span").length, depthTitle: root.querySelector("[data-role-block-depth-title]").textContent.trim(), exact: root.querySelector(".role-block-ledger .exact b").textContent.trim(), boundaryCards: root.querySelectorAll(".role-block-boundaries > article").length, batchCells: root.querySelectorAll(".role-block-batch-audit > div:last-child > span").length, batchValues: [...root.querySelectorAll(".role-block-batch-audit > div:last-child > span i")].map((node) => node.textContent.trim()), note: root.querySelector("[data-role-block-note]").textContent.trim(), activeLayer: root.querySelector("[data-role-block-layer].active").textContent.trim(), activeScope: root.querySelector('[data-role-block-scope][aria-pressed="true"]').dataset.roleBlockScope, activeMode: root.querySelector('[data-role-block-mode][aria-pressed="true"]').dataset.roleBlockMode, activeEffect: root.querySelector('[data-role-block-effect][aria-pressed="true"]').dataset.roleBlockEffect, }); const layer1Head = read(); root.querySelector('[data-role-block-layer="4"]').click(); root.querySelector('[data-role-block-effect="delimiter_main"]').click(); const layer4Delimiter = read(); root.querySelector('[data-role-block-layer="5"]').click(); root.querySelector('[data-role-block-effect="head_by_delimiter"]').click(); const layer5Interaction = read(); root.querySelector('[data-role-block-scope="full_input"]').click(); const layer5FullInteraction = read(); root.querySelector('[data-role-block-mode="token_weighted"]').click(); const layer5FullToken = read(); root.querySelector('[data-role-block-layer="1"]').click(); root.querySelector('[data-role-block-scope="target_content"]').click(); root.querySelector('[data-role-block-mode="prompt_balanced"]').click(); root.querySelector('[data-role-block-effect="head_main"]').click(); return { layer1Head, layer4Delimiter, layer5Interaction, layer5FullInteraction, layer5FullToken, restored: read() }; })()`); await evaluate(`(() => { document.querySelector("[data-dsv2-lab]").scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -82); })()`); await pause(180); await screenshot("/tmp/llm-atlas-deepseek-role-block-desktop.png"); await evaluate(`(() => { document.querySelector(".role-block-domain-grid").scrollIntoView({ block: "center", behavior: "instant" }); })()`); await pause(120); await screenshot("/tmp/llm-atlas-deepseek-role-block-results-desktop.png"); const artifactEvidence = await evaluate(`(() => { const root = document.querySelector("[data-dsv2-lab]"); root.querySelector('[data-artifact-tab="evidence"]').click(); const result = { panel: root.querySelector("[data-artifact-panel]:not([hidden])").dataset.artifactPanel, layers: root.querySelectorAll(".layer-evidence > span").length, executed: root.querySelectorAll(".layer-evidence > span.executed").length, split: root.querySelectorAll(".layer-evidence > span.split").length, unloaded: root.querySelectorAll(".layer-evidence > span.unloaded").length, exact: root.querySelector(".repro-gate strong").textContent.trim(), dependency: root.querySelector(".dependency-split").textContent.replaceAll(/\\s+/g, " ").trim(), boundary: root.querySelector('[data-artifact-panel="evidence"] .artifact-boundary').textContent.replaceAll(/\\s+/g, " ").trim(), }; const first = root.querySelector('[data-artifact-tab="route"]'); first.focus(); first.dispatchEvent(new KeyboardEvent("keydown", { key: "ArrowRight", bubbles: true })); result.keyboardSelected = root.querySelector('[data-artifact-tab][aria-selected="true"]').dataset.artifactTab; result.keyboardVisible = root.querySelector("[data-artifact-panel]:not([hidden])").dataset.artifactPanel; return result; })()`); await evaluate(`(() => { document.querySelector("[data-dsv2-lab]").scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -82); })()`); await pause(180); await screenshot("/tmp/llm-atlas-deepseek-artifact-desktop.png"); const behavior = await evaluate(`(() => { const root = document.querySelector("[data-behavior-lab]"); const readPair = () => ({ panel: root.querySelector("[data-behavior-panel]:not([hidden])").dataset.behaviorPanel, source: root.querySelector("[data-behavior-source-id]").textContent.trim(), domain: root.querySelector("[data-behavior-domain]").textContent.trim(), exact: root.querySelector("[data-behavior-exact]").textContent.trim(), prefix: root.querySelector("[data-behavior-prefix]").textContent.trim(), edit: root.querySelector("[data-behavior-edit]").textContent.trim(), similarity: root.querySelector("[data-behavior-similarity]").textContent.trim(), conditions: [...root.querySelectorAll("[data-output-condition]")].map((node) => node.textContent.trim()), statuses: [...root.querySelectorAll("[data-output-status]")].map((node) => node.textContent.trim()), outputCharacters: [...root.querySelectorAll("[data-output-text]")].map((node) => node.textContent.length), }); const initial = readPair(); const source = root.querySelector("[data-behavior-source]"); const edge = root.querySelector("[data-behavior-edge]"); source.value = "gsm8k/test/1069"; source.dispatchEvent(new Event("change", { bubbles: true })); edge.value = "x_at_s1"; edge.dispatchEvent(new Event("change", { bubbles: true })); const switched = readPair(); root.querySelector('[data-behavior-tab="map"]').click(); const map = root.querySelector("[data-behavior-map-domain]"); map.value = "math"; map.dispatchEvent(new Event("change", { bubbles: true })); const mathMap = { panel: root.querySelector("[data-behavior-panel]:not([hidden])").dataset.behaviorPanel, rows: root.querySelectorAll("[data-behavior-map-edge]").length, note: root.querySelector("[data-behavior-map-note]").textContent.trim(), firstExact: root.querySelector("[data-behavior-map-edge] [data-map-exact]").textContent.trim(), firstSimilarity: root.querySelector("[data-behavior-map-edge] [data-map-similarity]").textContent.trim(), }; root.querySelector('[data-behavior-tab="execution"]').click(); const execution = { panel: root.querySelector("[data-behavior-panel]:not([hidden])").dataset.behaviorPanel, layers: root.querySelectorAll(".layer-device-map > span").length, gpu: root.querySelectorAll(".layer-device-map > span.gpu").length, cpu: root.querySelectorAll(".layer-device-map > span.cpu").length, runtimeCards: root.querySelectorAll(".runtime-grid > article").length, }; root.querySelector('[data-behavior-tab="boundary"]').click(); const boundary = { panel: root.querySelector("[data-behavior-panel]:not([hidden])").dataset.behaviorPanel, ladder: root.querySelectorAll(".evidence-ladder > article").length, tokenCards: root.querySelectorAll(".token-contract > article").length, reproCards: root.querySelectorAll(".repro-grid > article").length, links: root.querySelectorAll(".artifact-links > a").length, forbidden: root.querySelector(".forbidden-claims").textContent.replaceAll(/\\s+/g, " ").trim(), }; const first = root.querySelector('[data-behavior-tab="pair"]'); first.focus(); first.dispatchEvent(new KeyboardEvent("keydown", { key: "ArrowRight", bubbles: true })); return { initial, switched, mathMap, execution, boundary, keyboardSelected: root.querySelector('[data-behavior-tab][aria-selected="true"]').dataset.behaviorTab, keyboardVisible: root.querySelector("[data-behavior-panel]:not([hidden])").dataset.behaviorPanel, }; })()`); await evaluate(`(() => { const root = document.querySelector("[data-behavior-lab]"); root.querySelector('[data-behavior-tab="pair"]').click(); root.scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -82); })()`); await pause(180); await screenshot("/tmp/llm-atlas-deepseek-behavior-desktop.png"); const completionDepth = await evaluate(`(() => { const root = document.querySelector("[data-completion-depth-lab]"); const initial = { panel: root.querySelector("[data-cd-panel]:not([hidden])").dataset.cdPanel, conditionRows: root.querySelectorAll("[data-completion-condition]").length, incompleteRows: root.querySelectorAll(".incomplete-ledger article").length, prefixCards: root.querySelectorAll(".prefix-gate > article").length, }; root.querySelector('[data-cd-tab="tasks"]').click(); const condition = root.querySelector("[data-task-condition]"); condition.value = "s1_eos"; condition.dispatchEvent(new Event("change", { bubbles: true })); const tasks = { panel: root.querySelector("[data-cd-panel]:not([hidden])").dataset.cdPanel, mathCards: root.querySelectorAll("[data-math-task-grid] > article").length, codeCards: root.querySelectorAll("[data-code-task-grid] > article").length, mathTotal: root.querySelector("[data-math-condition-total]").textContent.trim(), codeTotal: root.querySelector("[data-code-condition-total]").textContent.trim(), sandboxSteps: root.querySelectorAll(".sandbox-flow > article").length, }; root.querySelector('[data-cd-tab="hidden"]').click(); const hiddenEdge = root.querySelector("[data-hidden-edge]"); const hiddenDomain = root.querySelector("[data-hidden-domain]"); const hiddenMetric = root.querySelector("[data-hidden-metric]"); hiddenEdge.value = "period_at_s1"; hiddenEdge.dispatchEvent(new Event("change", { bubbles: true })); hiddenDomain.value = "code"; hiddenDomain.dispatchEvent(new Event("change", { bubbles: true })); hiddenMetric.value = "relative"; hiddenMetric.dispatchEvent(new Event("change", { bubbles: true })); root.querySelector('[data-hidden-stage="8"]').click(); const hidden = { panel: root.querySelector("[data-cd-panel]:not([hidden])").dataset.cdPanel, stages: root.querySelectorAll("[data-hidden-stage]").length, selected: root.querySelector("[data-hidden-stage-name]").textContent.trim(), cosine: root.querySelector("[data-hidden-cosine]").textContent.trim(), relative: root.querySelector("[data-hidden-relative]").textContent.trim(), exact: root.querySelector("[data-hidden-exact]").textContent.trim(), points: root.querySelector("[data-hidden-line]").getAttribute("points").split(" ").length, }; root.querySelector('[data-cd-tab="router"]').click(); const routerEdge = root.querySelector("[data-router-edge]"); const routerDomain = root.querySelector("[data-router-domain]"); routerEdge.value = "period_at_s1"; routerEdge.dispatchEvent(new Event("change", { bubbles: true })); routerDomain.value = "math"; routerDomain.dispatchEvent(new Event("change", { bubbles: true })); root.querySelector('[data-router-layer="23"]').click(); const router = { panel: root.querySelector("[data-cd-panel]:not([hidden])").dataset.cdPanel, layers: root.querySelectorAll("[data-router-layer]").length, selected: root.querySelector("[data-router-layer-name]").textContent.trim(), ordered: root.querySelector("[data-router-ordered]").textContent.trim(), setExact: root.querySelector("[data-router-set]").textContent.trim(), tv: root.querySelector("[data-router-tv]").textContent.trim(), points: root.querySelector("[data-router-line]").getAttribute("points").split(" ").length, reproCards: root.querySelectorAll(".repro-proof > article").length, links: root.querySelectorAll('[data-cd-panel="router"] .artifact-links > a').length, }; const first = root.querySelector('[data-cd-tab="completion"]'); first.focus(); first.dispatchEvent(new KeyboardEvent("keydown", { key: "ArrowRight", bubbles: true })); return { initial, tasks, hidden, router, keyboardSelected: root.querySelector('[data-cd-tab][aria-selected="true"]').dataset.cdTab, keyboardVisible: root.querySelector("[data-cd-panel]:not([hidden])").dataset.cdPanel, }; })()`); await evaluate(`(() => { const root = document.querySelector("[data-completion-depth-lab]"); root.querySelector('[data-cd-tab="hidden"]').click(); root.scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -82); })()`); await pause(180); await screenshot("/tmp/llm-atlas-deepseek-completion-depth-desktop.png"); await navigate("/"); const home = await evaluate(`(() => ({ releaseCards: document.querySelectorAll(".release-card").length, firstRelease: document.querySelector(".release-card h2").textContent.trim(), firstHref: document.querySelector(".release-card").getAttribute("href"), paperCount: document.querySelector(".hero-stats div:nth-child(3) b").textContent.trim(), navLinks: document.querySelectorAll(".top-nav a").length, }))()`); await navigate("/papers/"); const papers = await evaluate(`(() => { const button = [...document.querySelectorAll("[data-filter]")].find((node) => node.textContent.trim() === "DeepSeek"); button?.click(); return { total: document.querySelectorAll("[data-paper]").length, visible: document.querySelectorAll("[data-paper]:not([hidden])").length, hasFilter: Boolean(button), hasCoder: document.body.textContent.includes("DeepSeek-Coder-V2"), hasEngram: document.body.textContent.includes("Conditional Memory via Scalable Lookup"), }; })()`); await command("Emulation.setDeviceMetricsOverride", { width: 390, height: 844, deviceScaleFactor: 1, mobile: true, }); await navigate("/deepseek/"); const mobile = await evaluate(`(() => { const root = document.querySelector("[data-deepseek-lab]"); const artifact = document.querySelector("[data-dsv2-lab]"); const behavior = document.querySelector("[data-behavior-lab]"); const completionDepth = document.querySelector("[data-completion-depth-lab]"); root.scrollIntoView({ block: "start", behavior: "instant" }); const toggle = document.querySelector("#menu-toggle"); toggle?.click(); return { documentOverflow: document.documentElement.scrollWidth - document.documentElement.clientWidth, menuVisible: getComputedStyle(toggle).display !== "none", menuOpen: toggle.getAttribute("aria-expanded"), mobileLinks: document.querySelectorAll("#mobile-nav a").length, tabs: root.querySelectorAll("[data-ds-tab]").length, artifactTabs: artifact.querySelectorAll("[data-artifact-tab]").length, behaviorTabs: behavior.querySelectorAll("[data-behavior-tab]").length, behaviorSources: behavior.querySelectorAll("[data-behavior-source] option").length, behaviorEdges: behavior.querySelectorAll("[data-behavior-map-edge]").length, behaviorDeviceCells: behavior.querySelectorAll(".layer-device-map > span").length, completionDepthTabs: completionDepth.querySelectorAll("[data-cd-tab]").length, completionDepthHiddenStages: completionDepth.querySelectorAll("[data-hidden-stage]").length, completionDepthRouterLayers: completionDepth.querySelectorAll("[data-router-layer]").length, artifactHeatCells: artifact.querySelectorAll("[data-route-heatmap] > span").length, corpusCohorts: artifact.querySelectorAll("[data-corpus-cohort]").length, lengthDeltaCards: artifact.querySelectorAll("[data-length-delta-grid] > article").length, templateLayers: artifact.querySelectorAll("[data-template-layer]").length, templateScopes: artifact.querySelectorAll("[data-template-scope]").length, templateModes: artifact.querySelectorAll("[data-template-mode]").length, templateDomainCards: artifact.querySelectorAll("[data-template-domain-grid] > article").length, templateDepthCells: artifact.querySelectorAll("[data-template-depth-map] > div > span").length, historyLayers: artifact.querySelectorAll("[data-history-layer]").length, historyScopes: artifact.querySelectorAll("[data-history-scope]").length, historyModes: artifact.querySelectorAll("[data-history-mode]").length, historyEffects: artifact.querySelectorAll("[data-history-effect]").length, historyDomainCards: artifact.querySelectorAll("[data-history-domain-grid] > article").length, historyDepthCells: artifact.querySelectorAll("[data-history-depth-map] > div > span").length, distanceLayers: artifact.querySelectorAll("[data-distance-layer]").length, distanceScopes: artifact.querySelectorAll("[data-distance-scope]").length, distanceModes: artifact.querySelectorAll("[data-distance-mode]").length, distanceContrasts: artifact.querySelectorAll("[data-distance-contrast]").length, distanceDomainCards: artifact.querySelectorAll("[data-distance-domain-grid] > article").length, distanceDepthCells: artifact.querySelectorAll("[data-distance-depth-map] > div > span").length, boundaryLayers: artifact.querySelectorAll("[data-boundary-layer]").length, boundaryScopes: artifact.querySelectorAll("[data-boundary-scope]").length, boundaryModes: artifact.querySelectorAll("[data-boundary-mode]").length, boundaryContrasts: artifact.querySelectorAll("[data-boundary-contrast]").length, boundaryTokenCards: artifact.querySelectorAll(".boundary-token-grid > article").length, boundaryDomainCards: artifact.querySelectorAll("[data-boundary-domain-grid] > article").length, boundaryDepthCells: artifact.querySelectorAll("[data-boundary-depth-map] > div > span").length, roleLayers: artifact.querySelectorAll("[data-role-layer]").length, roleScopes: artifact.querySelectorAll("[data-role-scope]").length, roleModes: artifact.querySelectorAll("[data-role-mode]").length, roleContrasts: artifact.querySelectorAll("[data-role-contrast]").length, roleLevelCards: artifact.querySelectorAll(".role-level-grid > article").length, roleDomainCards: artifact.querySelectorAll("[data-role-domain-grid] > article").length, roleDepthCells: artifact.querySelectorAll("[data-role-depth-map] > div > span").length, specialLayers: artifact.querySelectorAll("[data-special-layer]").length, specialScopes: artifact.querySelectorAll("[data-special-scope]").length, specialModes: artifact.querySelectorAll("[data-special-mode]").length, specialContrasts: artifact.querySelectorAll("[data-special-contrast]").length, specialTokenCards: artifact.querySelectorAll(".special-token-grid > article").length, specialDomainCards: artifact.querySelectorAll("[data-special-domain-grid] > article").length, specialDepthCells: artifact.querySelectorAll("[data-special-depth-map] > div > span").length, roleBlockLayers: artifact.querySelectorAll("[data-role-block-layer]").length, roleBlockScopes: artifact.querySelectorAll("[data-role-block-scope]").length, roleBlockModes: artifact.querySelectorAll("[data-role-block-mode]").length, roleBlockEffects: artifact.querySelectorAll("[data-role-block-effect]").length, roleBlockMatrixCards: artifact.querySelectorAll(".role-block-matrix > article").length, roleBlockDomainCards: artifact.querySelectorAll("[data-role-block-domain-grid] > article").length, roleBlockDepthCells: artifact.querySelectorAll("[data-role-block-depth-map] > div > span").length, offenders: [...document.querySelectorAll("body *")] .filter((node) => !node.closest(".paper-chain, .advantage-table, .precision-table, .mapping-table, [data-deepseek-lab], [data-dsv2-lab], [data-behavior-lab], [data-completion-depth-lab]")) .filter((node) => node.getBoundingClientRect().right > document.documentElement.clientWidth + 1) .slice(0, 12) .map((node) => ({ tag: node.tagName, className: typeof node.className === "string" ? node.className : "", right: Math.round(node.getBoundingClientRect().right), width: Math.round(node.getBoundingClientRect().width), })), }; })()`); await evaluate(`(() => { document.querySelector("#menu-toggle")?.click(); const artifact = document.querySelector("[data-dsv2-lab]"); artifact.querySelector('[data-artifact-tab="corpus"]').click(); artifact.scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -82); })()`); await pause(180); await screenshot("/tmp/llm-atlas-deepseek-corpus-mobile.png"); await evaluate(`(() => { document.querySelector(".length-sensitivity").scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -70); })()`); await pause(120); await screenshot("/tmp/llm-atlas-deepseek-length-sensitivity-mobile.png"); await evaluate(`(() => { const artifact = document.querySelector("[data-dsv2-lab]"); artifact.querySelector('[data-artifact-tab="template"]').click(); artifact.scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -70); })()`); await pause(180); await screenshot("/tmp/llm-atlas-deepseek-template-mobile.png"); await evaluate(`(() => { document.querySelector(".template-domain-grid").scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -72); })()`); await pause(120); await screenshot("/tmp/llm-atlas-deepseek-template-results-mobile.png"); await evaluate(`(() => { const artifact = document.querySelector("[data-dsv2-lab]"); artifact.querySelector('[data-artifact-tab="history"]').click(); artifact.scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -70); })()`); await pause(180); await screenshot("/tmp/llm-atlas-deepseek-history-mobile.png"); await evaluate(`(() => { document.querySelector(".history-domain-grid").scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -72); })()`); await pause(120); await screenshot("/tmp/llm-atlas-deepseek-history-results-mobile.png"); await evaluate(`(() => { const artifact = document.querySelector("[data-dsv2-lab]"); artifact.querySelector('[data-artifact-tab="distance"]').click(); artifact.scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -70); })()`); await pause(180); await screenshot("/tmp/llm-atlas-deepseek-distance-mobile.png"); await evaluate(`(() => { document.querySelector(".distance-domain-grid").scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -72); })()`); await pause(120); await screenshot("/tmp/llm-atlas-deepseek-distance-results-mobile.png"); await evaluate(`(() => { const artifact = document.querySelector("[data-dsv2-lab]"); artifact.querySelector('[data-artifact-tab="boundary"]').click(); artifact.scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -70); })()`); await pause(180); await screenshot("/tmp/llm-atlas-deepseek-boundary-mobile.png"); await evaluate(`(() => { document.querySelector(".boundary-domain-grid").scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -72); })()`); await pause(120); await screenshot("/tmp/llm-atlas-deepseek-boundary-results-mobile.png"); await evaluate(`(() => { const artifact = document.querySelector("[data-dsv2-lab]"); artifact.querySelector('[data-artifact-tab="role"]').click(); artifact.scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -70); })()`); await pause(180); await screenshot("/tmp/llm-atlas-deepseek-role-mobile.png"); await evaluate(`(() => { document.querySelector(".role-domain-grid").scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -72); })()`); await pause(120); await screenshot("/tmp/llm-atlas-deepseek-role-results-mobile.png"); await evaluate(`(() => { const artifact = document.querySelector("[data-dsv2-lab]"); artifact.querySelector('[data-artifact-tab="special"]').click(); artifact.scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -70); })()`); await pause(180); await screenshot("/tmp/llm-atlas-deepseek-special-mobile.png"); await evaluate(`(() => { document.querySelector(".special-domain-grid").scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -72); })()`); await pause(120); await screenshot("/tmp/llm-atlas-deepseek-special-results-mobile.png"); await evaluate(`(() => { const artifact = document.querySelector("[data-dsv2-lab]"); artifact.querySelector('[data-artifact-tab="role-block"]').click(); artifact.scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -70); })()`); await pause(180); await screenshot("/tmp/llm-atlas-deepseek-role-block-mobile.png"); await evaluate(`(() => { document.querySelector(".role-block-domain-grid").scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -72); })()`); await pause(120); await screenshot("/tmp/llm-atlas-deepseek-role-block-results-mobile.png"); await evaluate(`(() => { const behavior = document.querySelector("[data-behavior-lab]"); behavior.querySelector('[data-behavior-tab="pair"]').click(); behavior.scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -70); })()`); await pause(180); await screenshot("/tmp/llm-atlas-deepseek-behavior-mobile.png"); await evaluate(`(() => { const completionDepth = document.querySelector("[data-completion-depth-lab]"); completionDepth.querySelector('[data-cd-tab="router"]').click(); completionDepth.scrollIntoView({ block: "start", behavior: "instant" }); window.scrollBy(0, -70); })()`); await pause(180); await screenshot("/tmp/llm-atlas-deepseek-completion-depth-mobile.png"); const report = { overview, capacity, cache, codesign, rl, artifactRoute, artifactLoad, artifactCache, artifactAbsorb, artifactCorpus, artifactTemplate, artifactHistory, artifactDistance, artifactBoundary, artifactRole, artifactSpecial, artifactRoleBlock, artifactEvidence, behavior, completionDepth, home, papers, mobile, exceptions }; console.log(JSON.stringify(report, null, 2)); const numeric = (text) => Number.parseFloat(text.replaceAll(",", "")); const failures = []; if (!overview.title.includes("为什么转向")) failures.push("专题标题异常"); if (overview.sections !== 31 || overview.tocLinks !== 31) failures.push("三十个编号专题加阅读链的目录结构异常"); if (overview.ledgers !== 24 || overview.waves !== 10) failures.push("二十四张问题账或十次转向结构异常"); if (overview.paperLinks !== 60 || overview.branches !== 5 || overview.followups !== 1) failures.push("论文链、旁支或公开后续标记异常"); if (overview.labTabs !== 4 || overview.labPanels !== 4) failures.push("四联实验结构异常"); if (overview.artifactTabs !== 13 || overview.artifactPanels !== 13 || overview.artifactLayers !== 27) failures.push("真实权重十三联实验结构异常"); if (overview.behaviorTabs !== 4 || overview.behaviorPanels !== 4 || overview.behaviorSources !== 16 || overview.behaviorEdges !== 10) failures.push("Chat 行为实验结构异常"); if (overview.completionDepthTabs !== 4 || overview.completionDepthPanels !== 4 || overview.hiddenStages !== 29 || overview.routerLayers !== 26) failures.push("Chat 完成度与全深度实验结构异常"); if (overview.crossSourceTabs !== 4 || overview.crossSourcePanels !== 4) failures.push("跨来源采样实验结构异常"); if (overview.heroLabs !== "22 个可操作实验") failures.push("DeepSeek 实验总数账异常"); if (overview.navLinks !== 20 || home.navLinks !== 20 || mobile.mobileLinks !== 20 || overview.activeNav !== "DeepSeek") failures.push("全站导航未同步 DeepSeek"); if (overview.documentOverflow > 1 || mobile.documentOverflow > 1) failures.push("桌面或移动端存在文档级横向溢出"); if (capacity.initial.panel !== "capacity" || capacity.initial.total !== "32.1× FFN" || capacity.initial.active !== "1.13× FFN") failures.push("V3 稀疏容量初始账异常"); if (!capacity.dense.name.includes("DENSE") || capacity.dense.communication !== "NONE" || numeric(capacity.dense.total) !== numeric(capacity.dense.active)) failures.push("Dense 容量预设异常"); if (!capacity.fine.name.includes("FINE-GRAINED") || !capacity.fine.explain.includes("shared")) failures.push("DeepSeekMoE 预设异常"); if (!capacity.v3.combinations.includes("10^") || capacity.v3.communication !== "HIGH") failures.push("V3 路由组合或通信方向异常"); if (cache.initial.panel !== "cache" || numeric(cache.initial.mha) !== 32768 || numeric(cache.initial.gqa) !== 2048 || numeric(cache.initial.mla) !== 576 || numeric(cache.initial.rope) !== 64) failures.push("MLA 精确元素账异常"); if (numeric(cache.initial.reduction) !== 98.2 || numeric(cache.noRope.mla) !== 512 || numeric(cache.noRope.reduction) <= numeric(cache.initial.reduction)) failures.push("RoPE cache 或 MLA reduction 异常"); if (!cache.million.selected.includes("GiB") || !cache.million.boundary.includes("1,048,576")) failures.push("百万 Token 缓存账异常"); if (numeric(codesign.dual.bubble) >= numeric(codesign.oneWay.bubble) || numeric(codesign.dual.exposed) >= numeric(codesign.oneWay.exposed)) failures.push("Dual-ended toy 没有减少空泡或暴露通信"); if (codesign.naive.risk !== "CRITICAL" || codesign.naive.accum !== "FP8" || codesign.mixed.risk !== "MANAGED" || !codesign.mixed.accum.includes("FP32")) failures.push("FP8 角色合同异常"); if (!codesign.off.includes("1 token") || !codesign.draft.supervision.includes("draft") || !codesign.draft.explain.includes("验收率")) failures.push("MTP 生命周期异常"); if (rl.initial.signal !== "GROUP-RELATIVE SIGNAL" || rl.same.signal !== "ZERO GROUP SIGNAL" || !rl.same.boundary.includes("优势为零")) failures.push("GRPO 零方差信号异常"); if (!rl.dapo.provenance.includes("2503.14476") || !rl.dapo.algorithm.includes("FOLLOW-UP") || !rl.dr.provenance.includes("2503.20783")) failures.push("DAPO / Dr.GRPO 来源边界异常"); if (!rl.r1.includes("cold start") || !rl.distill.includes("没有重演")) failures.push("R1 / distill 身份切换异常"); if (rl.keyboardSelected !== "cache" || rl.keyboardVisible !== "cache") failures.push("实验键盘 tab 导航异常"); if (artifactRoute.initial.panel !== "route" || artifactRoute.initial.chosen.length !== 6 || artifactRoute.initial.heatCells !== 64 || artifactRoute.initial.selectedCells !== 6) failures.push("真实 top-6 路由结构异常"); if (artifactRoute.initial.routes !== "156" || artifactRoute.initial.used !== "54 / 64" || artifactRoute.initial.weightSum !== "0.4540") failures.push("Layer 1 中文 token 路由初值异常"); if (artifactRoute.switched.chosen.length !== 6 || artifactRoute.switched.heatCells !== 64 || artifactRoute.tokenOptions !== 18 || numeric(artifactRoute.switched.weightSum) >= 1) failures.push("路由层 / prompt / token 切换异常"); if (artifactLoad.layer1.panel !== "load" || artifactLoad.layer1.used !== "63" || artifactLoad.layer1.cv !== "0.925" || artifactLoad.layer1.rows !== 5 || artifactLoad.layer1.jaccards !== 6) failures.push("Layer 1 聚合负载账异常"); if (artifactLoad.layer2.used !== "64" || artifactLoad.layer2.cv !== "0.549" || artifactLoad.layer4.used !== "62" || artifactLoad.layer4.gini !== "0.417") failures.push("跨层负载统计切换异常"); if (artifactCache.trace.panel !== "cache" || artifactCache.trace.latent !== "850.50 KiB" || artifactCache.trace.eager !== "7.38 MiB" || artifactCache.trace.ratio !== "8.89×" || artifactCache.trace.reduction !== "88.75%") failures.push("V2-Lite trace 缓存实现账异常"); if (!artifactCache.million.latent.includes("GiB") || !artifactCache.million.eager.includes("TiB")) failures.push("V2-Lite 百万 Token 缓存外推异常"); if (artifactAbsorb.panel !== "absorb" || artifactAbsorb.algebra !== 2 || artifactAbsorb.naive !== "260.00 KiB" || artifactAbsorb.absorbed !== "29.25 KiB") failures.push("真实 absorb 缓存执行账异常"); if (artifactAbsorb.metrics[0] !== "8.8889×" || artifactAbsorb.metrics[1] !== "0.00390625" || artifactAbsorb.metrics[2] !== "1.19e-7" || artifactAbsorb.metrics[3] !== "BYTE-EXACT") failures.push("absorb 数值正确性或复跑闸门异常"); if (artifactAbsorb.precisionRows !== 3 || artifactAbsorb.matrixRows !== 5 || artifactAbsorb.localUnsupported !== 4 || artifactAbsorb.executionCards !== 3 || !artifactAbsorb.boundary.includes("不是 FlashMLA 性能")) failures.push("FlashMLA SM120 边界结构异常"); if (artifactCorpus.layer1.panel !== "corpus" || artifactCorpus.layer1.rows !== 4 || artifactCorpus.layer1.heatRows !== 4 || artifactCorpus.layer1.heatCells !== 256 || artifactCorpus.layer1.jsdCells !== 25) failures.push("128 样本路由区间结构异常"); if (!artifactCorpus.layer1.highest.includes("中文新闻 · 0.754") || !artifactCorpus.layer1.largest.includes("中文新闻 ↔ Python 代码 · 0.059") || artifactCorpus.layer1.exact !== "3 / 3 EXACT") failures.push("Layer 1 多域统计或三 cohort 复跑闸门异常"); if (!artifactCorpus.layer4.highest.includes("中文新闻 · 0.910") || !artifactCorpus.layer4.largest.includes("中文新闻 ↔ Python 代码 · 0.150") || !artifactCorpus.layer4.heatTitle.includes("layer 4")) failures.push("Layer 4 多域路由切换异常"); if (!artifactCorpus.matched16.highest.includes("Python 代码 · 0.969") || artifactCorpus.matched16.cohortTitle !== "同样本 · 16 tokens" || !artifactCorpus.matched16.tokens.every((value) => value.includes("512 tokens"))) failures.push("16-token 同源 cohort 切换异常"); if (!artifactCorpus.matched24.highest.includes("Python 代码 · 0.718") || artifactCorpus.matched24.cohortTitle !== "同样本 · 24 tokens" || !artifactCorpus.matched24.tokens.every((value) => value.includes("768 tokens"))) failures.push("24-token 同源 cohort 切换异常"); if (artifactCorpus.matched24.deltaCards !== 4 || artifactCorpus.matched24.lengthLargest !== "Python 代码 · Δ -0.251" || artifactCorpus.matched24.lengthJsd !== "0.091 → 0.065 · Δ -0.026") failures.push("16→24 token 成对敏感性结论异常"); if (!artifactCorpus.tokenWeighted.heatTitle.includes("token 加权") || !artifactCorpus.tokenWeighted.modeNote.includes("理论上重合")) failures.push("等长 cohort 聚合口径切换异常"); if (artifactTemplate.layer1Content.panel !== "template" || artifactTemplate.layer1Content.domainCards !== 4 || artifactTemplate.layer1Content.depthRows !== 4 || artifactTemplate.layer1Content.depthCells !== 24 || artifactTemplate.layer1Content.exact !== "BYTE-EXACT") failures.push("官方模板扰动结构或独立复跑闸门异常"); if (artifactTemplate.layer1Content.domains[0].values !== "0.633 → 0.593" || artifactTemplate.layer1Content.domains[0].delta !== "Δ -0.040" || artifactTemplate.layer1Content.domains[1].delta !== "Δ -0.049") failures.push("L1 对齐内容模板敏感性统计异常"); if (artifactTemplate.layer1Content.prefixExact !== "3,642 / 3,642 EXACT · L1" || artifactTemplate.layer1Content.contentZero !== "4 / 4 DOMAINS · Δ 0") failures.push("L1 causal suffix 负对照异常"); if (artifactTemplate.layer6Content.domains.some((domain) => domain.className !== "up") || artifactTemplate.layer6Content.domains[0].delta !== "Δ +0.060" || artifactTemplate.layer6Content.domains[2].delta !== "Δ +0.058") failures.push("L6 对齐内容跨域方向异常"); if (artifactTemplate.layer6Full.domains[0].delta !== "Δ +0.134" || !artifactTemplate.layer6Full.note.includes("完整输入") || artifactTemplate.layer6Full.activeScope !== "full_input") failures.push("模板完整输入 scope 切换异常"); if (artifactTemplate.layer6FullToken.activeMode !== "token_weighted" || artifactTemplate.layer2Content.activeLayer !== "L2" || artifactTemplate.layer2Content.domains[2].delta !== "Δ -0.067") failures.push("模板层或聚合口径切换异常"); if (artifactHistory.layer1Interaction.panel !== "history" || artifactHistory.layer1Interaction.matrixRows !== 2 || artifactHistory.layer1Interaction.matrixCells !== 4 || artifactHistory.layer1Interaction.domainCards !== 4 || artifactHistory.layer1Interaction.depthRows !== 4 || artifactHistory.layer1Interaction.depthCells !== 24 || artifactHistory.layer1Interaction.exact !== "BYTE-EXACT") failures.push("消息历史 2×2 结构或独立复跑闸门异常"); if (artifactHistory.layer1Interaction.domains[0].cells.map((cell) => cell.value).join("/") !== "0.596/0.810/0.779/0.737" || artifactHistory.layer1Interaction.domains[0].effect !== "INTERACTION · Δ -0.256" || artifactHistory.layer1Interaction.domains[1].effect !== "INTERACTION · Δ +0.150") failures.push("L1 消息历史四格或 interaction 统计异常"); if (artifactHistory.layer1Interaction.bufferSummary.join("|") !== "24 / 24 ↓|.073 → .019|21 / 24 ↓|HISTORY BUFFER" || artifactHistory.layer1Interaction.bufferCards.length !== 4 || !artifactHistory.layer1Interaction.bufferCards[0].tv.startsWith("TV ") || !artifactHistory.layer1Interaction.bufferCards[0].stability.includes("top-6 set exact")) failures.push("消息历史缓冲总账或逐 token 稳定性异常"); if (artifactHistory.layer4Interaction.domains[1].cells.map((cell) => cell.value).join("/") !== "0.851/0.611/0.719/0.683" || artifactHistory.layer4Interaction.domains[1].effect !== "INTERACTION · Δ +0.204") failures.push("L4 中文消息历史 interaction 异常"); if (artifactHistory.layer4System.domains[0].effect !== "SYSTEM MAIN · Δ -0.082" || artifactHistory.layer4System.activeEffect !== "system_main" || !artifactHistory.layer4System.depthTitle.includes("System main")) failures.push("消息历史 effect 切换异常"); if (artifactHistory.layer4FullSystem.domains[0].effect !== "SYSTEM MAIN · Δ -0.057" || artifactHistory.layer4FullSystem.activeScope !== "full_input" || !artifactHistory.layer4FullSystem.note.includes("完整输入")) failures.push("消息历史完整输入 scope 异常"); if (artifactHistory.layer4FullToken.activeMode !== "token_weighted" || artifactHistory.restored.activeScope !== "target_content" || artifactHistory.restored.activeMode !== "prompt_balanced" || artifactHistory.restored.activeEffect !== "interaction") failures.push("消息历史聚合口径或恢复状态异常"); if (artifactDistance.layer1Filler.panel !== "distance" || artifactDistance.layer1Filler.matrixRows !== 2 || artifactDistance.layer1Filler.matrixCells !== 6 || artifactDistance.layer1Filler.domainCards !== 4 || artifactDistance.layer1Filler.depthRows !== 4 || artifactDistance.layer1Filler.depthCells !== 24 || artifactDistance.layer1Filler.exact !== "BYTE-EXACT") failures.push("等长历史 2×3 结构或独立复跑闸门异常"); if (artifactDistance.layer1Filler.domains[0].values.map((cell) => cell.value).join("/") !== "0.106/0.056/0.024" || artifactDistance.layer1Filler.domains[0].effect !== "FILLER − NONE · ΔTV -0.050" || artifactDistance.layer1Filler.domains[1].effect !== "FILLER − NONE · ΔTV -0.050") failures.push("L1 等长 filler 阶梯统计异常"); if (artifactDistance.layer1Filler.summary.join("|") !== "24 / 24 ↓|24 / 24 ↓|.074 → .038 → .019|NOT PURE DISTANCE" || !artifactDistance.layer1Filler.domains[0].stability.includes("target top-6 set exact") || !artifactDistance.layer1Filler.domains[0].lexical.includes("filler↔demo TV")) failures.push("等长历史双台阶总账或逐 token 稳定性异常"); if (artifactDistance.layer4Filler.domains[1].values.map((cell) => cell.value).join("/") !== "0.071/0.029/0.015" || artifactDistance.layer4Filler.domains[1].effect !== "FILLER − NONE · ΔTV -0.043") failures.push("L4 中文 filler 阶梯异常"); if (artifactDistance.layer4Demo.domains[1].effect !== "DEMO − FILLER · ΔTV -0.014" || artifactDistance.layer4Demo.activeContrast !== "demo_minus_filler" || !artifactDistance.layer4Demo.depthTitle.includes("文本替换")) failures.push("等长历史文本替换 contrast 异常"); if (artifactDistance.layer4FullDemo.domains[1].effect !== "DEMO − FILLER · ΔTV -0.023" || artifactDistance.layer4FullDemo.activeScope !== "full_input" || !artifactDistance.layer4FullDemo.note.includes("完整输入")) failures.push("等长历史完整输入 scope 异常"); if (artifactDistance.layer4FullToken.activeMode !== "token_weighted" || artifactDistance.restored.activeScope !== "target_content" || artifactDistance.restored.activeMode !== "prompt_balanced" || artifactDistance.restored.activeContrast !== "filler_minus_none") failures.push("等长历史聚合口径或恢复状态异常"); if (artifactBoundary.layer1X.panel !== "boundary" || artifactBoundary.layer1X.tokenCards !== 4 || artifactBoundary.layer1X.domainCards !== 4 || artifactBoundary.layer1X.depthRows !== 4 || artifactBoundary.layer1X.depthCells !== 24 || artifactBoundary.layer1X.exact !== "BYTE-EXACT") failures.push("单 token 边界控制结构或独立复跑闸门异常"); if (artifactBoundary.layer1X.domains[0].values.map((cell) => cell.value).join("/") !== "0.056/0.084/0.081/0.080" || artifactBoundary.layer1X.domains[0].effect !== "X − EOS · ΔTV +0.028" || !artifactBoundary.layer1X.domains[0].ci.includes("+0.019, +0.035")) failures.push("L1 英文边界替换统计异常"); if (artifactBoundary.layer1X.summary.join("|") !== "24 / 24 ↑|24 / 24 ↑|23 / 24 ↑|.037 → .054 / .055 / .049" || artifactBoundary.layer1X.trackToken !== "X" || !artifactBoundary.layer1X.domains[0].stability.includes("EOS 50.7%")) failures.push("边界控制总账、协议轨或逐 token 稳定性异常"); if (artifactBoundary.layer4X.domains[0].values.map((cell) => cell.value).join("/") !== "0.032/0.051/0.051/0.045" || artifactBoundary.layer4X.domains[0].effect !== "X − EOS · ΔTV +0.019") failures.push("L4 英文 x 边界替换异常"); if (artifactBoundary.layer4Period.domains[2].effect !== "PERIOD − EOS · ΔTV +0.034" || artifactBoundary.layer4Period.activeContrast !== "period_minus_eos" || artifactBoundary.layer4Period.trackToken !== ".") failures.push("L4 代码句点边界替换异常"); if (artifactBoundary.layer4Newline.activeContrast !== "newline_minus_eos" || artifactBoundary.layer4Newline.trackToken !== "↵" || !artifactBoundary.layer4Newline.depthTitle.includes("换行")) failures.push("换行边界替换切换异常"); if (artifactBoundary.layer4Full.activeScope !== "full_input" || !artifactBoundary.layer4Full.note.includes("完整输入") || artifactBoundary.layer4Full.domains[0].values[0].value === artifactBoundary.layer4Newline.domains[0].values[0].value) failures.push("边界控制完整输入 scope 异常"); if (artifactBoundary.layer4FullToken.activeMode !== "token_weighted" || artifactBoundary.restored.activeLayer !== "L1" || artifactBoundary.restored.activeScope !== "target_content" || artifactBoundary.restored.activeMode !== "prompt_balanced" || artifactBoundary.restored.activeContrast !== "x_minus_eos") failures.push("边界控制聚合口径或恢复状态异常"); if (artifactRole.layer1Assistant.panel !== "role" || artifactRole.layer1Assistant.levelCards !== 4 || artifactRole.layer1Assistant.domainCards !== 4 || artifactRole.layer1Assistant.depthRows !== 4 || artifactRole.layer1Assistant.depthCells !== 24 || artifactRole.layer1Assistant.exact !== "BYTE-EXACT" || artifactRole.layer1Assistant.causalCards !== 3 || artifactRole.layer1Assistant.batchCells !== 6) failures.push("角色词头单 ID 控制结构或独立复跑闸门异常"); if (artifactRole.layer1Assistant.domains[0].values.map((cell) => cell.value).join("/") !== "0.056/0.059/0.062/0.056" || artifactRole.layer1Assistant.domains[0].effect !== "U→A − OFFICIAL · ΔTV +0.003" || !artifactRole.layer1Assistant.domains[0].ci.includes("-0.003, +0.007")) failures.push("L1 英文角色词头 system-edge 统计异常"); if (!artifactRole.layer1Assistant.domains[0].stability.includes("S0 79.7% · S1 84.6%") || !artifactRole.layer1Assistant.domains[0].direct.includes("S0 0.024 · S1 0.021") || artifactRole.layer1Assistant.summary.join("|") !== ".0222 / .0218|.0263 / .0253|34,488 / 34,488|12↑12↓ / 13↑11↓") failures.push("角色词头直接效应、对齐率或总账异常"); if (artifactRole.layer5X.activeContrast !== "target_x_minus_official" || artifactRole.layer5X.targetHead !== "x" || !artifactRole.layer5X.depthTitle.includes("普通 token")) failures.push("角色词头 U→x 层或 contrast 切换异常"); if (artifactRole.layer5Suffix.domains.some((domain) => domain.effect !== "SUFFIX A→U − OFFICIAL · ΔTV +0.000") || artifactRole.layer5Suffix.targetHead !== "User" || artifactRole.layer5Suffix.suffixHead !== "User" || !artifactRole.layer5Suffix.domains.every((domain) => domain.direct.includes("S0 0.000 · S1 0.000"))) failures.push("后置角色词头 causal suffix 负对照异常"); if (artifactRole.layer5FullSuffix.activeScope !== "full_input" || !artifactRole.layer5FullSuffix.note.includes("suffix 自身") || artifactRole.layer5FullSuffix.domains[0].values[0].value === artifactRole.layer5Suffix.domains[0].values[0].value) failures.push("角色词头完整输入 scope 异常"); if (artifactRole.layer5FullToken.activeMode !== "token_weighted" || artifactRole.restored.activeLayer !== "L1" || artifactRole.restored.activeScope !== "target_content" || artifactRole.restored.activeMode !== "prompt_balanced" || artifactRole.restored.activeContrast !== "target_assistant_minus_official" || artifactRole.restored.targetHead !== "Assistant" || artifactRole.restored.suffixHead !== "Assistant") failures.push("角色词头聚合口径或恢复状态异常"); if (artifactRole.layer1Assistant.batchValues.join("|") !== "256 / 256|180 / 256|149 / 256|102 / 256|72 / 256|73 / 256") failures.push("角色词头 BF16 batch-content 审计异常"); if (artifactSpecial.layer1Bos.panel !== "special" || artifactSpecial.layer1Bos.tokenCards !== 4 || artifactSpecial.layer1Bos.domainCards !== 4 || artifactSpecial.layer1Bos.depthRows !== 4 || artifactSpecial.layer1Bos.depthCells !== 24 || artifactSpecial.layer1Bos.exact !== "BYTE-EXACT" || artifactSpecial.layer1Bos.scopeCards !== 3 || artifactSpecial.layer1Bos.batchCells !== 6) failures.push("特殊词元家族控制结构或独立复跑闸门异常"); if (artifactSpecial.layer1Bos.domains[0].values.map((cell) => cell.value).join("/") !== "0.056/0.108/0.084/0.081" || artifactSpecial.layer1Bos.domains[0].effect !== "BOS − EOS · ΔTV +0.052" || !artifactSpecial.layer1Bos.domains[0].ci.includes("+0.040, +0.061")) failures.push("L1 英文特殊词元家族统计异常"); if (!artifactSpecial.layer1Bos.domains[0].detail.includes("S0 0.087 · S1 0.064") || !artifactSpecial.layer1Bos.domains[0].stability.includes("S0 37.4%") || artifactSpecial.layer1Bos.summary.join("|") !== ".037518|+.010500|24↑ / 24↑|+.011864") failures.push("特殊词元直接效应、对齐率或总账异常"); if (artifactSpecial.layer4X.activeContrast !== "x_minus_eos" || !artifactSpecial.layer4X.depthTitle.includes("普通内容 token") || artifactSpecial.layer4Period.activeContrast !== "period_minus_eos" || !artifactSpecial.layer4Period.depthTitle.includes("句点")) failures.push("特殊词元单 ID contrast 切换异常"); if (artifactSpecial.layer4Family.activeContrast !== "family" || !artifactSpecial.layer4Family.note.includes("四个 ID") || !artifactSpecial.layer4Family.domains.every((domain) => domain.stability.includes("2-vs-2"))) failures.push("特殊词元描述性 family 汇总异常"); if (artifactSpecial.layer4FullFamily.activeScope !== "full_input" || !artifactSpecial.layer4FullFamily.note.includes("完整输入") || artifactSpecial.layer4FullToken.activeMode !== "token_weighted") failures.push("特殊词元完整输入或聚合口径切换异常"); if (artifactSpecial.restored.activeLayer !== "L1" || artifactSpecial.restored.activeScope !== "target_content" || artifactSpecial.restored.activeMode !== "prompt_balanced" || artifactSpecial.restored.activeContrast !== "bos_minus_eos") failures.push("特殊词元控制恢复状态异常"); if (artifactSpecial.layer1Bos.batchValues.join("|") !== "768 / 768|610 / 768|477 / 768|368 / 768|269 / 768|244 / 768") failures.push("特殊词元 BF16 batch-content 审计异常"); if (artifactRoleBlock.layer1Head.panel !== "role-block" || artifactRoleBlock.layer1Head.matrixCards !== 4 || artifactRoleBlock.layer1Head.domainCards !== 4 || artifactRoleBlock.layer1Head.depthRows !== 4 || artifactRoleBlock.layer1Head.depthCells !== 24 || artifactRoleBlock.layer1Head.exact !== "BYTE-EXACT" || artifactRoleBlock.layer1Head.directCards !== 4 || artifactRoleBlock.layer1Head.boundaryCards !== 3 || artifactRoleBlock.layer1Head.batchCells !== 6) failures.push("完整角色块 2×2 结构或独立复跑闸门异常"); if (artifactRoleBlock.layer1Head.domains[0].values.map((cell) => cell.value).join("/") !== "0.056/0.059/0.056/0.058" || artifactRoleBlock.layer1Head.domains[0].effect !== "HEAD MAIN · ΔTV +0.002" || !artifactRoleBlock.layer1Head.domains[0].ci.includes("-0.002, +0.004")) failures.push("L1 英文完整角色块 head 统计异常"); if (!artifactRoleBlock.layer1Head.domains[0].direct.includes("head @ colon") || !artifactRoleBlock.layer1Head.domains[0].dependency.includes("head @ x") || artifactRoleBlock.layer1Head.summary.join("|") !== ".037304 → .036220|−.000654|−.000430|−.000729") failures.push("完整角色块直接边或总账异常"); if (artifactRoleBlock.layer4Delimiter.activeEffect !== "delimiter_main" || !artifactRoleBlock.layer4Delimiter.depthTitle.includes("冒号→x") || artifactRoleBlock.layer5Interaction.activeEffect !== "head_by_delimiter" || !artifactRoleBlock.layer5Interaction.depthTitle.includes("依赖 delimiter") || !artifactRoleBlock.layer5Interaction.domains[0].direct.includes("head@x − head@colon")) failures.push("完整角色块因子或 interaction 切换异常"); if (artifactRoleBlock.layer5FullInteraction.activeScope !== "full_input" || artifactRoleBlock.layer5FullToken.activeMode !== "token_weighted" || artifactRoleBlock.restored.activeLayer !== "L1" || artifactRoleBlock.restored.activeScope !== "target_content" || artifactRoleBlock.restored.activeMode !== "prompt_balanced" || artifactRoleBlock.restored.activeEffect !== "head_main") failures.push("完整角色块 scope、聚合口径或恢复状态异常"); if (artifactRoleBlock.layer1Head.batchValues.join("|") !== "512 / 512|368 / 512|279 / 512|230 / 512|178 / 512|156 / 512") failures.push("完整角色块 BF16 batch-content 审计异常"); if (artifactEvidence.panel !== "evidence" || artifactEvidence.layers !== 27 || artifactEvidence.executed !== 7 || artifactEvidence.split !== 1 || artifactEvidence.unloaded !== 19 || artifactEvidence.exact !== "31 / 31") failures.push("真实工件执行边界或复跑闸门异常"); if (!artifactEvidence.dependency.includes("Transformers 5.5") || !artifactEvidence.dependency.includes("4.41.2") || !artifactEvidence.boundary.includes("完整 27 层生成")) failures.push("依赖版本或未覆盖边界异常"); if (artifactEvidence.keyboardSelected !== "load" || artifactEvidence.keyboardVisible !== "load") failures.push("真实工件实验键盘 tab 导航异常"); if (behavior.initial.panel !== "pair" || behavior.initial.source !== "wikitext2/raw-validation/0443" || behavior.initial.conditions.join("|") !== "S0 · EOS|S1 · EOS" || behavior.initial.exact !== "DIVERGED" || behavior.initial.prefix !== "63" || behavior.initial.edit !== "33" || behavior.initial.similarity !== "74.2%") failures.push("Chat 行为逐格输出初值异常"); if (behavior.switched.domain !== "Grade-school math" || behavior.switched.conditions.join("|") !== "S1 · EOS|S1 · x" || behavior.switched.exact !== "DIVERGED" || behavior.switched.outputCharacters.some((value) => value < 100)) failures.push("Chat 行为 source / contrast 切换异常"); if (behavior.mathMap.panel !== "map" || behavior.mathMap.rows !== 10 || !behavior.mathMap.note.includes("GSM8K") || behavior.mathMap.firstExact !== "2 / 4" || behavior.mathMap.firstSimilarity !== "84.0%") failures.push("Chat 行为分域分叉地图异常"); if (behavior.execution.panel !== "execution" || behavior.execution.layers !== 29 || behavior.execution.gpu !== 25 || behavior.execution.cpu !== 4 || behavior.execution.runtimeCards !== 4) failures.push("Chat BF16 GPU / CPU offload 设备图异常"); if (behavior.boundary.panel !== "boundary" || behavior.boundary.ladder !== 3 || behavior.boundary.tokenCards !== 4 || behavior.boundary.reproCards !== 4 || behavior.boundary.links !== 3 || !behavior.boundary.forbidden.includes("route TV")) failures.push("Chat 行为证据阶梯或限制异常"); if (behavior.keyboardSelected !== "map" || behavior.keyboardVisible !== "map") failures.push("Chat 行为实验键盘 tab 导航异常"); if (completionDepth.initial.panel !== "completion" || completionDepth.initial.conditionRows !== 8 || completionDepth.initial.incompleteRows !== 7 || completionDepth.initial.prefixCards !== 3) failures.push("512-token 完成度阶梯结构异常"); if (completionDepth.tasks.panel !== "tasks" || completionDepth.tasks.mathCards !== 4 || completionDepth.tasks.codeCards !== 4 || completionDepth.tasks.mathTotal !== "3 / 4 PASS" || completionDepth.tasks.codeTotal !== "2 / 4 PASS" || completionDepth.tasks.sandboxSteps !== 4) failures.push("Math / HumanEval 完成感知评测切换异常"); if (completionDepth.hidden.panel !== "hidden" || completionDepth.hidden.stages !== 29 || completionDepth.hidden.selected !== "layer_07" || completionDepth.hidden.points !== 29 || completionDepth.hidden.exact === "1,537 / 1,537" || numeric(completionDepth.hidden.relative) <= 0) failures.push("29 阶段隐藏状态曲线或交互异常"); if (completionDepth.router.panel !== "router" || completionDepth.router.layers !== 26 || completionDepth.router.selected !== "layer 24" || completionDepth.router.points !== 26 || !completionDepth.router.ordered.includes("%") || !completionDepth.router.setExact.includes("%") || numeric(completionDepth.router.tv) <= 0 || completionDepth.router.reproCards !== 4 || completionDepth.router.links !== 4) failures.push("26 层 MoE 路由曲线或复跑证据异常"); if (completionDepth.keyboardSelected !== "tasks" || completionDepth.keyboardVisible !== "tasks") failures.push("完成度与全深度实验键盘 tab 导航异常"); if (home.releaseCards !== 17 || !home.firstRelease.includes("尖峰不是出生时就有") || home.firstHref !== "/k3/" || home.paperCount !== "486") failures.push("首页 K3 首发入口或论文数异常"); if (papers.total !== 486 || !papers.hasFilter || papers.visible < 20 || !papers.hasCoder || !papers.hasEngram) failures.push("论文库 DeepSeek 聚光异常"); if (!mobile.menuVisible || mobile.menuOpen !== "true" || mobile.tabs !== 4 || mobile.artifactTabs !== 13 || mobile.behaviorTabs !== 4 || mobile.behaviorSources !== 16 || mobile.behaviorEdges !== 10 || mobile.behaviorDeviceCells !== 29 || mobile.completionDepthTabs !== 4 || mobile.completionDepthHiddenStages !== 29 || mobile.completionDepthRouterLayers !== 26 || mobile.artifactHeatCells !== 64 || mobile.corpusCohorts !== 3 || mobile.lengthDeltaCards !== 4 || mobile.templateLayers !== 6 || mobile.templateScopes !== 2 || mobile.templateModes !== 2 || mobile.templateDomainCards !== 4 || mobile.templateDepthCells !== 24 || mobile.historyLayers !== 6 || mobile.historyScopes !== 2 || mobile.historyModes !== 2 || mobile.historyEffects !== 3 || mobile.historyDomainCards !== 4 || mobile.historyDepthCells !== 24 || mobile.distanceLayers !== 6 || mobile.distanceScopes !== 2 || mobile.distanceModes !== 2 || mobile.distanceContrasts !== 2 || mobile.distanceDomainCards !== 4 || mobile.distanceDepthCells !== 24 || mobile.boundaryLayers !== 6 || mobile.boundaryScopes !== 2 || mobile.boundaryModes !== 2 || mobile.boundaryContrasts !== 3 || mobile.boundaryTokenCards !== 4 || mobile.boundaryDomainCards !== 4 || mobile.boundaryDepthCells !== 24 || mobile.roleLayers !== 6 || mobile.roleScopes !== 2 || mobile.roleModes !== 2 || mobile.roleContrasts !== 3 || mobile.roleLevelCards !== 4 || mobile.roleDomainCards !== 4 || mobile.roleDepthCells !== 24 || mobile.specialLayers !== 6 || mobile.specialScopes !== 2 || mobile.specialModes !== 2 || mobile.specialContrasts !== 4 || mobile.specialTokenCards !== 4 || mobile.specialDomainCards !== 4 || mobile.specialDepthCells !== 24 || mobile.roleBlockLayers !== 6 || mobile.roleBlockScopes !== 2 || mobile.roleBlockModes !== 2 || mobile.roleBlockEffects !== 3 || mobile.roleBlockMatrixCards !== 4 || mobile.roleBlockDomainCards !== 4 || mobile.roleBlockDepthCells !== 24) failures.push("移动端导航或实验异常"); if (mobile.offenders.length) failures.push(`移动端越界元素:${JSON.stringify(mobile.offenders)}`); if (exceptions.length) failures.push(`浏览器异常:${exceptions.join(" | ")}`); if (failures.length) { console.error(`\nFAIL\n- ${failures.join("\n- ")}`); process.exitCode = 1; } else { console.log("\nPASS DeepSeek browser regression"); } socket.close();