diff --git a/PROGRESS.md b/PROGRESS.md index 455e94b..7141d21 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -8,7 +8,7 @@ |---|---:|---:|---| | 研究框架与规范 | 进行中 | 83% | Scaling Laws 二轮拟合复现与逐图精读 | | 网站设计系统 | 进行中 | 89% | 打印样式与更多通用可视化组件 | -| Kimi K3 深读 | 三轮实证进行中 | 94% | 接入真实 hidden-state / expert-load / cache traces,并重绘报告数值图 | +| Kimi K3 深读 | 四轮实证进行中 | 96% | 对齐论文梯度定义、扩展深度/预算,并等待 `A_log` 官方转换合同 | | 语言模型前史 | 完成首版 | 78% | Kneser–Ney、LSTM、Bahdanau 逐图精读与真实小语料复现 | | Transformer 基础 | 完成首版 | 79% | 多头电路、归一化 traces 与真实 kernel / KV 配置 | | 表示、位置与残差高速公路 | 完成首版 | 81% | 真实 hidden-state / norm traces、长上下文位置外推与深层稳定性消融 | @@ -41,7 +41,7 @@ - [x] 完成 486 篇关键论文索引,覆盖 16 个标签专题与 Kimi/DeepSeek 聚光主线。 - [x] 完成可检索、可按专题筛选的论文库页面。 - [x] 完成 K3、语言模型前史、Transformer 基础、表示/位置/残差、DeepSeek 谱系、Scaling Laws、数据工程、长上下文、MoE、指令微调与人类偏好、推理、Agent、原生多模态、训练系统、推理服务、数值优化与评测安全十七篇首版长文。 -- [x] 完成 K3 三轴架构、八联报告实验与四联开放工件实验、语言模型前史四联实验、Transformer 四联实验、表示深度四联实验、DeepSeek 二十二联实验、长上下文、MoE 路由、推理三页签,以及训练系统、推理服务、Scaling、数据工程、数值、Alignment、Agent、原生多模态与评测安全专题各四页签等八十九个原创交互视图。 +- [x] 完成 K3 三轴架构、八联报告实验、四联开放工件实验与五联 AttnRes 独立实验、语言模型前史四联实验、Transformer 四联实验、表示深度四联实验、DeepSeek 二十二联实验、长上下文、MoE 路由、推理三页签,以及训练系统、推理服务、Scaling、数据工程、数值、Alignment、Agent、原生多模态与评测安全专题各四页签等九十四个原创交互视图。 - [x] 完成长上下文首版:五张成本账、26 篇一手论文、10+ 机制图与 8 策略交互实验室。 - [x] 核验 FlashAttention、DeepSeek-V2/V3.2/V4、Kimi Linear/K3 等六份论文原文,并建立长上下文研究账本。 - [x] 核验 Switch、ST-MoE、DeepSeekMoE、Loss-Free、V3、LatentMoE 与 K3 原文,并建立 MoE 研究账本。 @@ -272,10 +272,16 @@ - [x] 第二十二个 DeepSeek 交互实验用五页签讲解显式 CRN sampler、选定任务 bootstrap、32 题浏览器、4×4 tape 诊断与十二字段复现/失败/偏差账;正式协议、manifest、runner、独立 evaluator、分析、复现与完整/compact 数据均已进入开源树。 - [x] Round 08 本地闸门通过:88 个 Astro 文件零诊断,21 个页面、1,151 个站内引用、12 个跨页锚点零失败;数据合同、DeepSeek 全量历史、Round 06/07/08 三套 sampling 专项真实 Chrome 回归均通过,桌面与 390px 移动端无文档级溢出。 - [x] DeepSeek Round 08 以源提交 `975ed3d`、不可变镜像 `20260729T221654Z-975ed3d` 发布;OCI index digest `sha256:759a8446…21452b`,复用 NAS `12010→8080`、NPM host 31 / cert 41 与门户 `LLM ATLAS / projects / 180`。容器 healthy、0 次重启,21/21 公网路由、HTTPS/2、gzip / immutable assets、Round 08 专项与 DeepSeek 全量生产 Chrome 回归通过;保留 `20260729T195952Z-9211333` 回滚。 +- [x] K3 Round 04 在任何正式结果前冻结 `llm-atlas-k3-attnres-reduced-v1`:WikiText-2 固定 revision 与 byte 拼接、192,000-window SHA-256 日程、16-block / 32-sublayer / width-192 公共主干、Baseline / Full / Block 三结构、三个初始化 seed、2,000-step 预算、主 BPC 判据、RMS / mixer / gradient 诊断与独立 replay 合同全部先落盘。 +- [x] 九个正式训练格全部完成,共消费 147,456,000 target bytes;同一 seed 的 9,541,824 个公共 core 参数初始化 hash 在三结构间 exact。Full − Baseline 三个 paired delta 为 `−.015996 / −.013207 / −.014498`,Block 为 `−.052660 / −.041349 / −.033388`,分别以均值 `−.014567 / −.042466 BPC` 满足预注册方向支持规则。 +- [x] 反结果同时进入主审计:核心参数 gradient RMS 的 16-block mean CV 为 Baseline `0.3447`、Full `0.5087`、Block `0.6306`;本 reduced metric 没有复现论文的大模型梯度均匀性叙述,不改换指标掩盖。 +- [x] 指定 Block / seed 2026073001 进行全新进程 2,000-step replay;manifest、model、optimizer、hashes、evaluations、training history、diagnostic、environment 八字段全部 exact,最终 BPC 同为 `1.947877975922777`;timing 明确不要求 exact。 +- [x] K3 Round 04 五视图实验室完成:三 seed BPC 曲线、Residual RMS / Block 锯齿、Full / Block depth-weight heatmap、梯度反证、成本/哈希/claim boundary 分开展示;完整 9-run JSON、compact 数据、复现清单、协议、审计、训练与聚合代码进入公开仓库。 +- [x] Round 04 本地闸门通过:91 个受检文件零诊断/提示,21 个页面、1,151 个站内引用、12 个跨页锚点零失败;冻结数据、AttnRes 专项与 K3 全量真实 Chrome 回归通过,桌面/390px 移动端零文档级溢出、零运行时异常。 ## 正在进行 -- [ ] K3 三轮下一闸门:获得真实 token hidden states、expert load 与 cache traces,解释或修订 `A_log [128]` 工件冲突,再做 Figure 3/4/5 数值重绘和独立小模型复现。 +- [ ] K3 四轮下一闸门:对齐 AttnRes 论文的 activation / residual-output gradient 定义,增加模型深度与训练预算,检验本轮梯度反结果是否随尺度翻转;真实 K3 forward 继续等待 `A_log [128]→[96]` 官方转换或权重修订。 - [ ] DeepSeek 八轮下一闸门:推进干预式 mediation、SM90 FlashMLA、FP8 / pipeline traces 与 R1-like RL 小模型复现。 - [ ] 表示、位置与残差二轮:真实 hidden-state / norm traces、长上下文位置外推复现与 mHC / AttnRes 深层稳定性消融。 - [ ] 评测安全二轮:真实 cross-harness / pass@k 复跑、Judge 元评测、动态污染与过拒案例。 @@ -464,6 +470,10 @@ | 2026-07-30 | 输出长度揭示强任务域交互 | system-at-period 在 Code 为负、Math 为正,两个选定任务带都不跨零;不从长度外推能力 | | 2026-07-30 | Round 08 十二字段重放过闸 | 64/64 exact;uniform hash、完整 token IDs、文本、stop 与 RNG 一并进入复现合同,评分 gold 提前加载的流程偏差公开保留 | | 2026-07-30 | DeepSeek Round 08 任务 bootstrap / CRN 里程碑发布 | 源提交 `975ed3d`、镜像 `20260729T221654Z-975ed3d`、OCI `sha256:759a8446…21452b`;21/21 公网路由与生产专项/全量 Chrome 通过,保留 Round 07 回滚点 | +| 2026-07-30 | K3 `A_log [128]` 冲突继续阻断真实 checkpoint forward | 当前 HF / GitHub / FlashKDA / vLLM / SGLang 均未公开 128→96 转换;不裁剪、不 reshape、不把假设输出冒充 K3 | +| 2026-07-30 | AttnRes 缩小实验先冻结再训练 | 三结构共享公共主干、初始化、窗口与优化器;三 seed paired BPC 只按预注册 `3/3 same direction + mean≤−.010` 判为本协议内方向支持 | +| 2026-07-30 | 主结果与机制反结果同时发布 | Full / Block BPC 方向支持;核心参数 gradient RMS CV 却高于 Baseline,明确写成未复现论文梯度叙述 | +| 2026-07-30 | 独立重放按数值合同而非计时合同验收 | Block / seed-1 的八组冻结字段 2,000 steps exact;wall time 受调度影响,不要求或声称 bit-exact | ## 未决问题 diff --git a/README.md b/README.md index 3b56861..28b4029 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ 当前里程碑包含 17 专题学习地图、486 篇关键论文索引、Kimi K3 完整导读, 语言模型前史、Transformer 基础、表示/位置/残差、DeepSeek 技术谱系、Scaling Laws、数据工程、长上下文、MoE、指令微调与人类偏好、推理、工具使用与长程 Agent、原生多模态、训练系统、推理服务、数值优化,以及评测与安全深度专题, -以及 89 个覆盖核心机制的原创交互视图。K3 二轮导读以 32 张问题账、16 图 / 5 表审计、 +以及 94 个覆盖核心机制的原创交互视图。K3 二轮导读以 32 张问题账、16 图 / 5 表审计、 8 个交互实验和 100 个一手/官方节点,完整覆盖架构、预训练、后训练、系统、评测、案例与附录。 第三轮已完成开放工件与首个真实 kernel 里程碑:固定官方模型与 FlashKDA revisions,审计 96 个 checkpoint shards、 497,220 个 tensor entries、真实 KDA / MLA / MoE / MoonViT shapes 与小范围参数统计,并用 4 个新视图 @@ -27,6 +27,18 @@ `sm_120a` wheel,在 RTX 5090 上完成 6/6 官方参考 exact-match 和 K3 fixed / varlen 形状计时。详见 [K3_ARTIFACT_AUDIT.md](./research/K3_ARTIFACT_AUDIT.md) 与 [checkpoint_probe.py](./experiments/k3/checkpoint_probe.py)、[FlashKDA probe](./experiments/k3/flashkda/)。 +第四轮不裁剪仍未解释的 `A_log [128]` 去伪造 K3 forward,而是先冻结 +`llm-atlas-k3-attnres-reduced-v1`,用相同 16-block / 32-sublayer Transformer 主干、 +相同 WikiText-2 byte windows 与三个共同初始化 seed,从零训练 Baseline、Full AttnRes +与 Block AttnRes 共 9 个 2,000-step 正式格。最终 Full / Block 相对 Baseline 的三 seed +平均 paired delta 分别为 `−0.01457 / −0.04247 BPC`,都满足预注册的本协议内方向支持规则; +但核心参数梯度 RMS 的跨 block CV 为 `0.3447 / 0.5087 / 0.6306`,没有复现论文式 +梯度均匀性叙述。指定 Block / seed-1 的全新进程 2,000-step replay 在八组数值与哈希字段 +上全部 exact,计时不要求 exact。完整 9-run JSON、compact payload、复现清单、训练/ +聚合代码与五视图实验室均进入开源树。详见 +[K3_ATTNRES_REDUCED_PROTOCOL.md](./research/K3_ATTNRES_REDUCED_PROTOCOL.md)、 +[K3_ATTNRES_REDUCED_AUDIT.md](./research/K3_ATTNRES_REDUCED_AUDIT.md) 与 +[AttnRes experiment](./experiments/k3/attnres/)。 DeepSeek 八轮专题以 24 张问题账、10 次技术转向、 22 个交互实验和 60 个一手/官方节点,串起 Dense、MoE、MLA、V3 协同、R1 与 V4; 并固定官方 V2-Lite revision,在 RTX 5090 上连续执行 7/27 层,记录 3,240 次真实专家选择、 diff --git a/package.json b/package.json index fa2cc64..d3ad81f 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "build:data:deepseek-chat-cross-source-sampling": "node scripts/build-deepseek-chat-cross-source-sampling-compact.mjs", "build:data:deepseek-chat-task-bootstrap": "node scripts/build-deepseek-chat-task-bootstrap-crn-compact.mjs", "check:data:deepseek-chat-task-bootstrap": "node scripts/check-deepseek-chat-task-bootstrap-crn-data.mjs", + "check:data:k3-attnres": "node scripts/check-k3-attnres-data.mjs", "check:site": "node scripts/check-site.mjs", "check:moe-browser": "node scripts/check-moe-browser.mjs", "check:reasoning-browser": "node scripts/check-reasoning-browser.mjs", @@ -38,6 +39,7 @@ "check:deepseek-sampling-browser": "node scripts/check-deepseek-sampling-browser.mjs", "check:deepseek-cross-source-sampling-browser": "node scripts/check-deepseek-cross-source-sampling-browser.mjs", "check:deepseek-task-bootstrap-browser": "node scripts/check-deepseek-task-bootstrap-browser.mjs", + "check:k3-attnres-browser": "node scripts/check-k3-attnres-browser.mjs", "check:k3-browser": "node scripts/check-k3-browser.mjs" }, "dependencies": { diff --git a/research/K3_ARTIFACT_AUDIT.md b/research/K3_ARTIFACT_AUDIT.md index bf61993..3a150bd 100644 --- a/research/K3_ARTIFACT_AUDIT.md +++ b/research/K3_ARTIFACT_AUDIT.md @@ -438,11 +438,19 @@ src/data/k3-flashkda-runtime.json - [x] 使用 CUDA 13.0 / glibc 2.39 隔离环境产出可校验 `sm_120a` wheel; - [x] RTX 5090 上六组 FlashKDA / official torch reference exact correctness; - [x] K3 fixed / varlen shape、三种 state mode 的 1,800 个 CUDA Event samples; +- [x] 在不裁剪 `A_log` 的前提下完成独立缩小 AttnRes 机制实验; +- [x] Baseline / Full / Block × 三 seed × 2,000 steps 与指定正式格全新进程 exact replay; +- [x] BPC 主结果、Residual RMS、depth weights、gradient counterevidence 与执行成本公开入账; - [ ] 取得真实 hidden-state / router load trace; - [ ] 取得可加载的 reduced checkpoint、官方 trace 或多机资源; - [ ] 对 Figure 3 / 4 / 5 做真实数值重绘; - [ ] 对 AttnRes 读取分布做真实 token / layer trace。 +这里的“缩小 AttnRes 实验”只完成独立机制 probe,不满足最后一项真实 K3 trace。完整合同与 +审计见 `K3_ATTNRES_REDUCED_PROTOCOL.md` / `K3_ATTNRES_REDUCED_AUDIT.md`。下一轮优先 +对齐论文 gradient 观测对象并增加 depth / budget;真实 checkpoint forward 继续等待公开 +`A_log [128] → [96]` 转换或权重修订。 + ## 11. 发布与回归证据 - 源提交:`2ef846f`; diff --git a/scripts/check-k3-attnres-browser.mjs b/scripts/check-k3-attnres-browser.mjs new file mode 100644 index 0000000..dd04a0f --- /dev/null +++ b/scripts/check-k3-attnres-browser.mjs @@ -0,0 +1,200 @@ +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 < 80; 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("/k3/"); + +const desktop = await evaluate(`(() => { + const root = document.querySelector("[data-attnres-lab]"); + root.scrollIntoView({ block: "start", behavior: "instant" }); + window.scrollBy(0, -78); + const text = (selector) => root.querySelector(selector)?.textContent.trim(); + const panel = () => root.querySelector("[data-attnres-panel]:not([hidden])")?.dataset.attnresPanel; + const line = (architecture) => root.querySelector(\`[data-curve-series="\${architecture}"] [data-curve-line]\`)?.getAttribute("points"); + + const initial = { + panel: panel(), + tabs: root.querySelectorAll("[data-attnres-tab]").length, + panels: root.querySelectorAll("[data-attnres-panel]").length, + baseline: text('[data-curve-final="baseline"]'), + full: text('[data-curve-final="full"]'), + block: text('[data-curve-final="block"]'), + baselineLine: line("baseline"), + textBoundary: root.textContent.includes("不是 K3 checkpoint forward") && + root.textContent.includes("不能写成论文梯度结果复现"), + }; + + root.querySelector('[data-curve-seed="0"]').click(); + const seed = { + baseline: text('[data-curve-final="baseline"]'), + full: text('[data-curve-final="full"]'), + block: text('[data-curve-final="block"]'), + baselineLine: line("baseline"), + }; + + root.querySelector('[data-attnres-tab="rms"]').click(); + const rmsInitial = { + panel: panel(), + title: text("[data-rms-title]"), + blockLine: root.querySelector('[data-rms-series="block"]').getAttribute("points"), + rhythm: root.querySelectorAll(".block-rhythm i").length, + }; + root.querySelector('[data-rms-metric="branch_output_rms"]').click(); + const rmsChanged = { + title: text("[data-rms-title]"), + blockLine: root.querySelector('[data-rms-series="block"]').getAttribute("points"), + }; + + root.querySelector('[data-attnres-tab="mixer"]').click(); + const mixerInitial = { + panel: panel(), + fullVisible: !root.querySelector('[data-mixer-view="full"]').hidden, + fullRows: root.querySelectorAll('[data-mixer-view="full"] .heat-row').length, + spike: root.querySelectorAll(".spikeSource").length, + }; + root.querySelector('[data-mixer-arch="block"]').click(); + const mixerChanged = { + blockVisible: !root.querySelector('[data-mixer-view="block"]').hidden, + blockRows: root.querySelectorAll('[data-mixer-view="block"] .heat-row').length, + }; + + root.querySelector('[data-attnres-tab="gradient"]').click(); + const gradient = { + panel: panel(), + cards: root.querySelectorAll(".gradient-cv article").length, + blocks: root.querySelectorAll(".gradient-grid article").length, + boundary: root.textContent.includes("BASE < FULL < BLOCK") && + root.textContent.includes("不能写成论文梯度结果复现"), + }; + + root.querySelector('[data-attnres-tab="audit"]').click(); + const audit = { + panel: panel(), + costs: root.querySelectorAll(".cost-grid article").length, + hashes: root.querySelectorAll(".hash-ledger code").length, + exact: root.textContent.includes("2,000 steps · 8 / 8 exact"), + claims: root.querySelectorAll(".claim-grid li").length, + }; + + const first = root.querySelector('[data-attnres-tab="outcome"]'); + first.focus(); + first.dispatchEvent(new KeyboardEvent("keydown", { key: "ArrowRight", bubbles: true })); + const keyboard = { + selected: root.querySelector('[data-attnres-tab][aria-selected="true"]').dataset.attnresTab, + panel: panel(), + }; + + return { + initial, seed, rmsInitial, rmsChanged, mixerInitial, mixerChanged, gradient, audit, keyboard, + documentOverflow: document.documentElement.scrollWidth - document.documentElement.clientWidth, + }; +})()`); +await pause(180); +await screenshot("/tmp/llm-atlas-k3-attnres-desktop.png"); + +await command("Emulation.setDeviceMetricsOverride", { + width: 390, + height: 844, + deviceScaleFactor: 1, + mobile: true, +}); +await navigate("/k3/"); +const mobile = await evaluate(`(() => { + const root = document.querySelector("[data-attnres-lab]"); + root.scrollIntoView({ block: "start", behavior: "instant" }); + window.scrollBy(0, -64); + return { + tabs: root.querySelectorAll("[data-attnres-tab]").length, + ledger: root.querySelectorAll(".trace-ledger article").length, + documentOverflow: document.documentElement.scrollWidth - document.documentElement.clientWidth, + rootOverflow: root.scrollWidth - root.clientWidth, + visiblePanel: root.querySelector("[data-attnres-panel]:not([hidden])")?.dataset.attnresPanel, + }; +})()`); +await pause(180); +await screenshot("/tmp/llm-atlas-k3-attnres-mobile.png"); + +const report = { desktop, mobile, exceptions }; +console.log(JSON.stringify(report, null, 2)); + +const numeric = (text) => Number.parseFloat(text.replace("−", "-")); +const failures = []; +if (desktop.initial.panel !== "outcome" || desktop.initial.tabs !== 5 || desktop.initial.panels !== 5) failures.push("五视图初始结构异常"); +if (Math.abs(numeric(desktop.initial.baseline) - 1.99913) > 1e-5 || Math.abs(numeric(desktop.initial.full) - 1.98457) > 1e-5 || Math.abs(numeric(desktop.initial.block) - 1.95667) > 1e-5) failures.push("三 seed 均值 BPC 异常"); +if (Math.abs(numeric(desktop.seed.baseline) - 2.00054) > 1e-5 || desktop.seed.baselineLine === desktop.initial.baselineLine) failures.push("seed 切换未更新训练曲线"); +if (!desktop.initial.textBoundary) failures.push("主视区缺少 K3 forward 或梯度反证边界"); +if (desktop.rmsInitial.panel !== "rms" || desktop.rmsInitial.rhythm !== 32 || desktop.rmsInitial.title === desktop.rmsChanged.title || desktop.rmsInitial.blockLine === desktop.rmsChanged.blockLine) failures.push("RMS 指标切换或 32 层节律异常"); +if (desktop.mixerInitial.panel !== "mixer" || !desktop.mixerInitial.fullVisible || desktop.mixerInitial.fullRows !== 32 || desktop.mixerInitial.spike !== 1 || !desktop.mixerChanged.blockVisible || desktop.mixerChanged.blockRows !== 32) failures.push("Full/Block mixer heatmap 异常"); +if (desktop.gradient.panel !== "gradient" || desktop.gradient.cards !== 4 || desktop.gradient.blocks !== 16 || !desktop.gradient.boundary) failures.push("梯度反证视图异常"); +if (desktop.audit.panel !== "audit" || desktop.audit.costs !== 3 || desktop.audit.hashes !== 4 || !desktop.audit.exact || desktop.audit.claims !== 6) failures.push("成本、重放或 claim boundary 异常"); +if (desktop.keyboard.selected !== "rms" || desktop.keyboard.panel !== "rms") failures.push("键盘 tab 导航异常"); +if (desktop.documentOverflow > 1 || mobile.documentOverflow > 1 || mobile.rootOverflow > 1) failures.push("桌面或移动端出现文档级横向溢出"); +if (mobile.tabs !== 5 || mobile.ledger !== 6 || mobile.visiblePanel !== "outcome") failures.push("移动端初始结构异常"); +if (exceptions.length) failures.push(`浏览器异常:${exceptions.join(" | ")}`); + +if (failures.length) { + console.error(`\nFAIL\n- ${failures.join("\n- ")}`); + process.exitCode = 1; +} else { + console.log("\nPASS K3 AttnRes browser regression"); +} + +socket.close(); diff --git a/scripts/check-k3-attnres-data.mjs b/scripts/check-k3-attnres-data.mjs new file mode 100644 index 0000000..64653cd --- /dev/null +++ b/scripts/check-k3-attnres-data.mjs @@ -0,0 +1,61 @@ +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; + +const read = (path) => { + const bytes = readFileSync(new URL(path, import.meta.url)); + return { + bytes, + json: JSON.parse(bytes), + sha256: createHash("sha256").update(bytes).digest("hex"), + }; +}; + +const raw = read("../src/data/k3-attnres-reduced.json"); +const compact = read("../src/data/k3-attnres-reduced-compact.json"); +const reproduction = read("../experiments/k3/attnres/reproduction.json"); +const failures = []; + +const expect = (condition, message) => { + if (!condition) failures.push(message); +}; + +expect(raw.sha256 === "44f8622654d32485f8d6e698c02ba1365ddffb10cbd73db0294136d0bd93ce88", "raw payload SHA-256 changed"); +expect(compact.sha256 === "44864d48eddb2ae5887fba4b74f63b5a3d6a23497886ee307decf5b4f45d9faf", "compact payload SHA-256 changed"); +expect(reproduction.sha256 === "545543b7e4a970ca3bc0e6246610a32fb53ec3d9546a98e0f17f38d7121918a2", "reproduction payload SHA-256 changed"); +expect(compact.json.protocol_id === "llm-atlas-k3-attnres-reduced-v1", "protocol identity mismatch"); +expect(compact.json.grid.runs === 9, "formal grid is not 9 cells"); +expect(compact.json.grid.target_bytes_total === 147_456_000, "formal target-byte budget mismatch"); +expect(raw.json.formal_runs.length === 9, "raw formal run count mismatch"); +expect(Object.values(reproduction.json.common_initial_parameters).every((row) => row.exact), "common initial parameters are not exact within seed"); +expect(Object.values(reproduction.json.smoke).every((row) => row.all_exact), "paired smoke replay mismatch"); +expect(reproduction.json.formal_replay.all_numeric_and_hash_fields_exact, "formal fresh-process replay mismatch"); +expect(!reproduction.json.formal_replay.timing_exact_required, "timing must not be an exact replay requirement"); + +const full = compact.json.final_validation.full_contrast; +const block = compact.json.final_validation.block_contrast; +expect(full.paired_deltas_bpc.length === 3 && full.paired_deltas_bpc.every((value) => value < 0), "Full paired direction mismatch"); +expect(block.paired_deltas_bpc.length === 3 && block.paired_deltas_bpc.every((value) => value < 0), "Block paired direction mismatch"); +expect(Math.abs(full.mean_delta_bpc - (-0.014567152672337214)) < 1e-15, "Full mean delta changed"); +expect(Math.abs(block.mean_delta_bpc - (-0.04246557635602392)) < 1e-15, "Block mean delta changed"); +expect(compact.json.gradients.baseline.mean_cv < compact.json.gradients.full.mean_cv, "gradient counterevidence order baseline/full changed"); +expect(compact.json.gradients.full.mean_cv < compact.json.gradients.block.mean_cv, "gradient counterevidence order full/block changed"); +expect(compact.json.posthoc.label.startsWith("post-hoc"), "post-hoc callout lost its evidence label"); + +if (failures.length) { + console.error(`FAIL K3 AttnRes data\n- ${failures.join("\n- ")}`); + process.exit(1); +} + +console.log(JSON.stringify({ + protocol: compact.json.protocol_id, + formalRuns: compact.json.grid.runs, + fullMeanDeltaBpc: full.mean_delta_bpc, + blockMeanDeltaBpc: block.mean_delta_bpc, + formalReplayExact: reproduction.json.formal_replay.all_numeric_and_hash_fields_exact, + hashes: { + raw: raw.sha256, + compact: compact.sha256, + reproduction: reproduction.sha256, + }, +}, null, 2)); +console.log("PASS K3 AttnRes frozen data"); diff --git a/scripts/check-k3-browser.mjs b/scripts/check-k3-browser.mjs index 765c04a..380e64c 100644 --- a/scripts/check-k3-browser.mjs +++ b/scripts/check-k3-browser.mjs @@ -79,6 +79,8 @@ const overview = await evaluate(`(() => ({ artifactPanels: document.querySelectorAll("[data-artifact-panel]").length, artifactLayers: document.querySelectorAll("[data-layer-cell]").length, artifactMismatch: document.querySelector("#artifacts")?.textContent.includes("A_log [128] ≠ expected [96]"), + attnresTabs: document.querySelectorAll("[data-attnres-tab]").length, + attnresPanels: document.querySelectorAll("[data-attnres-panel]").length, nativeVisionCorrected: document.body.textContent.includes("MoonViT‑V2 从头训练") && document.body.textContent.includes("同一个 next-token prediction objective"), staleVisionClaim: document.body.textContent.includes("先固定语言模型训练视觉组件"), @@ -287,8 +289,9 @@ const mobile = await evaluate(`(() => { tabs: root.querySelectorAll("[data-k3-tab]").length, artifactTabs: document.querySelectorAll("[data-artifact-tab]").length, artifactLayers: document.querySelectorAll("[data-layer-cell]").length, + attnresTabs: document.querySelectorAll("[data-attnres-tab]").length, offenders: [...document.querySelectorAll("body *")] - .filter((node) => !node.closest(".paper-chain, .spec-table-wrap, .cache-strip, .architecture-explorer, [data-k3-lab], [data-k3-artifact-lab]")) + .filter((node) => !node.closest(".paper-chain, .spec-table-wrap, .cache-strip, .architecture-explorer, [data-k3-lab], [data-k3-artifact-lab], [data-attnres-lab]")) .filter((node) => node.getBoundingClientRect().right > document.documentElement.clientWidth + 1) .slice(0, 15) .map((node) => ({ @@ -319,11 +322,12 @@ console.log(JSON.stringify(report, null, 2)); const numeric = (text) => Number.parseFloat(text.replaceAll(",", "").replace("−", "-")); const failures = []; if (!overview.title.includes("因果环节")) failures.push("K3 二轮标题异常"); -if (overview.sections !== 32 || overview.tocLinks !== 32) failures.push("31 个编号专题加阅读链的目录结构异常"); +if (overview.sections !== 33 || overview.tocLinks !== 33) failures.push("32 个编号专题加阅读链的目录结构异常"); if (overview.ledgers !== 32 || overview.reportMap !== 9) failures.push("32 张问题账或报告地图异常"); if (overview.figureAtlas !== 21 || overview.paperLinks !== 100 || overview.paperGroups < 12) failures.push("图表审计或 100 节点阅读链异常"); if (overview.labTabs !== 8 || overview.labPanels !== 8) failures.push("八联实验结构异常"); if (overview.artifactTabs !== 4 || overview.artifactPanels !== 4 || overview.artifactLayers !== 93 || !overview.artifactMismatch) failures.push("开放工件四视图、93 层条带或形状冲突异常"); +if (overview.attnresTabs !== 5 || overview.attnresPanels !== 5) failures.push("AttnRes 独立实验五视图异常"); if (!overview.nativeVisionCorrected || overview.staleVisionClaim) failures.push("原生多模态纠错未生效或旧错误残留"); if (overview.documentOverflow > 1 || mobile.documentOverflow > 1) failures.push("桌面或移动端存在文档级横向溢出"); if (labs.memoryInitial.panel !== "memory" || numeric(labs.memoryInitial.additiveError) <= numeric(labs.memoryInitial.deltaError)) failures.push("Delta memory 初始递推异常"); @@ -348,7 +352,7 @@ if (artifacts.parameterChanged.shape !== "[96,128] F32" || !artifacts.parameterC if (artifacts.reproductionInitial.panel !== "reproduction" || numeric(artifacts.reproductionInitial.speedup) !== 1.85 || numeric(artifacts.reproductionInitial.localMean) < 2.6 || !artifacts.reproductionInitial.exactSuite || numeric(artifacts.reproductionInitial.cv) < 2) failures.push("FlashKDA H20、本机 exact suite 或 router 初始探针异常"); if (numeric(artifacts.reproductionChanged.speedup) !== 3.27 || numeric(artifacts.reproductionChanged.flash) !== 0.7064 || numeric(artifacts.reproductionChanged.localMean) >= numeric(artifacts.reproductionInitial.localMean) || !artifacts.reproductionChanged.localMode.includes("FP32 state") || numeric(artifacts.reproductionChanged.cv) <= numeric(artifacts.reproductionInitial.cv) || numeric(artifacts.reproductionChanged.zero) <= numeric(artifacts.reproductionInitial.zero)) failures.push("GB200 benchmark、本机 varlen/state 或 synthetic router counterexample 未更新"); if (artifacts.keyboardSelected !== "tensors" || artifacts.keyboardVisible !== "tensors") failures.push("开放工件键盘 tab 导航异常"); -if (!mobile.menuVisible || mobile.menuOpen !== "true" || mobile.tabs !== 8 || mobile.artifactTabs !== 4 || mobile.artifactLayers !== 93) failures.push("移动端导航或实验异常"); +if (!mobile.menuVisible || mobile.menuOpen !== "true" || mobile.tabs !== 8 || mobile.artifactTabs !== 4 || mobile.artifactLayers !== 93 || mobile.attnresTabs !== 5) failures.push("移动端导航或实验异常"); if (mobile.offenders.length) failures.push(`移动端越界元素:${JSON.stringify(mobile.offenders)}`); if (exceptions.length) failures.push(`浏览器异常:${exceptions.join(" | ")}`); diff --git a/src/components/K3AttnResTraceLab.astro b/src/components/K3AttnResTraceLab.astro new file mode 100644 index 0000000..8cfe1d9 --- /dev/null +++ b/src/components/K3AttnResTraceLab.astro @@ -0,0 +1,717 @@ +--- +import rawLab from "@/data/k3-attnres-reduced-compact.json"; + +const lab = rawLab as any; +const json = JSON.stringify(lab).replaceAll("<", "\\u003c"); +const architectures = ["baseline", "full", "block"]; +const labels: Record = { + baseline: "Baseline", + full: "Full AttnRes", + block: "Block AttnRes", +}; +const colors: Record = { + baseline: "#79746b", + full: "#ba603b", + block: "#163f3b", +}; +const final = lab.final_validation; +const reproduction = lab.reproduction; +const formatSigned = (value: number, digits = 5) => + `${value < 0 ? "−" : value > 0 ? "+" : ""}${Math.abs(value).toFixed(digits)}`; +const gib = (value: number) => value / 2 ** 30; +const heatOpacity = (weight: number, sources: number) => + Math.min(1, 0.12 + Math.min(2.2, weight * sources) / 2.2 * 0.88); +const gradientMax = Math.max( + ...architectures.flatMap((architecture) => lab.gradients[architecture].by_block.mean), +); +--- + +
+
+
+

ROUND 04 / REDUCED INDEPENDENT MECHANISM PROBE

+

不裁剪 K3 的冲突权重:从零训练一个可以完整审计的深度路由实验

+
+

+ WikiText-2 byte LM · 16 blocks / 32 residual sublayers · 3 structures × 3 seeds。 + 这是缩小机制探针,不是 K3 checkpoint forward,也不是论文规模复现。 +

+
+ +
+
FORMAL GRID3 × 3

9 个 2,000-step runs

+
TARGET BYTES147.456M

每格 16,384,000

+
SHARED CORE9.542M

同 seed 公共初始化 exact

+
FULL Δ BPC{formatSigned(final.full_contrast.mean_delta_bpc)}

3 / 3 paired negative

+
BLOCK Δ BPC{formatSigned(final.block_contrast.mean_delta_bpc)}

3 / 3 paired negative

+
FRESH REPLAY8 / 8 exact

timing 明确不要求 exact

+
+ +
+ + + + + +
+ +
+
+
I / PREREGISTERED PRIMARY ENDPOINT

先看三条完整曲线,再放大最后一个配对点

+

+ BPC 越低越好。主判据只读 step 2000:三个 seed 必须同方向,且 mean paired + delta 至少达到 −0.010;中途曲线不用于改终点。 +

+
+ +
+ + {lab.grid.seeds.map((seed: number, index: number) => ( + + ))} +
+ +
+
+
VALIDATION BPC0 → 2,000 TRAINING STEPS
+ + + {[2, 3, 4, 6, 8].map((tick) => { + const y = 20 + (8.2 - tick) / 6.4 * 260; + return {tick}; + })} + {[0, 500, 1000, 1500, 2000].map((tick) => { + const x = 62 + tick / 2000 * 756; + return {tick}; + })} + + {architectures.map((architecture) => ( + + + + + ))} + +
+ {architectures.map((architecture) => {labels[architecture]})} +
+
+ +
+ STEP 2000 / SELECTED VIEW + {architectures.map((architecture) => ( +
+ + {labels[architecture]} + {final.means[architecture].toFixed(5)} +
+ ))} +

三 seed 均值;正式判据使用逐 seed paired delta,不把三次运行当成 benchmark 样本总体。

+
+
+ +
+ {final.by_seed.map((row: any) => ( +
+
SEED {String(row.seed).slice(-2)}BASE {row.final_bpc.baseline.toFixed(5)}
+
FULL − BASE{formatSigned(row.full_minus_baseline, 5)}
+
BLOCK − BASE{formatSigned(row.block_minus_baseline, 5)}
+
+ ))} +
+
FROZEN RULE3 / 3 + |MEAN| ≥ .010
+ DIRECTIONAL SUPPORT +

只在这个 reduced protocol 内;不是总体显著性,也不外推 paper scale。

+
+
+
+ + + + + + + + + + +
+ + + + diff --git a/src/pages/index.astro b/src/pages/index.astro index 7a6e4b8..1565649 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -107,7 +107,7 @@ const paths = [