完善 xyzbc-trt 刀具偏置闭环

This commit is contained in:
mes123456
2026-07-02 09:41:10 -04:00
parent bb939644b9
commit 8fd9952dac
16 changed files with 15926 additions and 10971 deletions

View File

@@ -10758,3 +10758,75 @@ nginx: configuration file /etc/nginx/nginx.conf test is successful
17. 执行 `git status --short`,确认推送后仅剩未跟踪生成目录 `app/dist/``tools/__pycache__/`
18. 执行 `git log -1 --oneline``git ls-remote origin refs/heads/master`,确认本地和远端 `master` 均为 `fb128e6`
19. 本轮结论:源码、证据和工作文档已提交并推送到云仓库;未跟踪构建产物和 Python 缓存未提交。
## 2026-07-02 09:14:51 EDT Codex 执行过程日志
1. 接收用户要求:接续上一轮,按 `/home/mes123456/cnc_wams/web-rtcp-5axis-xyzbc-trt-sim-plan/working` 持续编写程序。
2. 读取 workspace 规则,确认每轮结束必须将中文过程日志追加到 `/home/mes123456/cnc_wams/web-rtcp-5axis-sim-plan/gptlog-process/gpdlog.md`
3. 检查目标目录文件,确认 `working` 下存在推进台账、任务矩阵、验收证据、全量对标矩阵和 evidence JSON。
4. 读取 `working/README.md``03-推进台账.md``04-任务矩阵.md`,确认当前主要缺口包含 T-014 浏览器 smoke、T-029 Vismach 3D pin 对标、T-034 tool-offset 闭环、T-019/T-037 native path 重采集。
5. 检查目标 app 源码、profile、Node smoke 和 package 脚本,确认默认 profile 已为 `xyzbc-trt`,已有 Web evidence 和 compare 脚本。
6. 读取 `five-axis-scene.js``store.js``main.js``collect-web-xyzbc-trt-evidence.mjs``linuxcnc-task-hal-runtime.js``tool-db-simulation.js`,确认 Three.js 机床参考模型仍是静态几何,尚未按 Vismach HAL pin 层级驱动。
7. 新增 `app/src/runtime/vismach-model-state.js`,统一生成 `table-x/saddle-y/spindle-z/tilt-b/rotate-c/tool-offset/x-offset/z-offset` pin 状态、模型变换、HAL net 对标关系和语义边界。
8. 修改 `app/src/visualization/five-axis-scene.js`,把参考模型拆成 `vismach-table-x``vismach-saddle-y``vismach-spindle-z``vismach-tilt-b``vismach-rotate-c``vismach-tool-offset` 层级,并在渲染时由 `buildVismachModelState()` 驱动位移和旋转。
9. 在 canvas dataset 中新增 `threeVismachPins``threeVismachTransforms``threeVismachPinDrivenModel`,供浏览器 smoke 验证 WebGL 模型和 HAL pin 语义。
10. 修改 `tools/collect-web-xyzbc-trt-evidence.mjs`,将 `vismachEquivalent` 从静态 pin 清单升级为包含 `pinValues``transforms``halNets``semanticBoundary` 的 evidence 字段。
11. 扩展 `tests/node/verify_xyzbc_trt_web_app.mjs`,增加 profile feedback/offset net 断言,以及 Vismach pin 到模型变换的 smoke 断言。
12. 运行 `npm --prefix web-rtcp-5axis-xyzbc-trt-sim-plan/app run smoke:node`,结果通过,输出 `xyzbc_trt_web_app_smoke=ok`
13. 运行 `npm --prefix web-rtcp-5axis-xyzbc-trt-sim-plan/app run evidence:web`,重新生成 `working/evidence/web-xyzbc-trt-evidence.json`
14. 抽查 Web evidence确认 `status=ready-for-wasm-runtime``blockers=[]``previewPath.sampleCount=3074``executionPath.sampleCount=569`,并确认 `vismachEquivalent` 已包含 pin 值、变换和 9 条 HAL net。
15. 运行 `npm --prefix web-rtcp-5axis-xyzbc-trt-sim-plan/app run evidence:compare`,重新生成 compare JSON结果为真实失败 `fail_count=5`,失败原因仍是 native `previewPath`/`executionPath` 样本和采样周期字段缺失。
16. 运行 `npm --prefix web-rtcp-5axis-xyzbc-trt-sim-plan/app run build`,结果通过,输出 `gmoccapy_static_build=ok`
17. 更新 `working/03-推进台账.md``04-任务矩阵.md``05-验收证据.md``07-全量对标追踪矩阵.md`,记录 T-029 完成、Web evidence 字段和剩余 native path 缺口。
18. 检查已有浏览器 smoke发现从参考项目复制的脚本仍指向 `web-rtcp-5axis-sim-plan`,并包含大量 `xyzac-trt` 假设,不适合作为当前目标项目 T-014 验收。
19. 新增 `tests/browser/xyzbc_trt_browser_smoke.html`,实现精简的 `xyzbc-trt` 浏览器验收:默认 profile、kinematics/interpreter/task-HAL worker runtime、默认程序预览、canvas 非空和 Vismach dataset。
20. 新增 `tests/browser/verify_xyzbc_trt_browser.sh`,通过临时 HTTP server 和 headless Chromium 加载 `app/dist/index.html`,执行浏览器 smoke。
21. 修改 `app/package.json`,增加 `smoke:browser` 脚本。
22. 执行 `chmod +x tests/browser/verify_xyzbc_trt_browser.sh`,然后运行 `npm --prefix web-rtcp-5axis-xyzbc-trt-sim-plan/app run smoke:browser`,结果通过,输出 `xyzbc_trt_browser_smoke=ok`
23. 再次更新 `working/03-推进台账.md``04-任务矩阵.md``05-验收证据.md``07-全量对标追踪矩阵.md`,将 T-014 标记为完成,并记录浏览器 smoke 验收内容。
24. 执行 `git diff --check -- web-rtcp-5axis-xyzbc-trt-sim-plan`,未发现空白错误。
25. 执行 `git status --short web-rtcp-5axis-xyzbc-trt-sim-plan`,确认本轮修改包含 app/package、Vismach runtime、Three.js 场景、Web evidence 脚本、Node/browser smoke、working 文档和 evidence JSON未跟踪的 `app/dist/``tools/__pycache__/` 为已有/生成物,未清理。
26. 本轮结论T-029 Vismach 3D pin 对标和 T-014 目标浏览器 smoke 已完成并通过验证compare 剩余失败仍来自 native path evidence 未重采集,下一步应推进 T-019/T-037 或 T-034。
27. 按前端应用规则尝试启动开发服务器:先运行 `npm --prefix web-rtcp-5axis-xyzbc-trt-sim-plan/app run dev`,端口 4174 已被占用,启动失败。
28. 尝试在 app 目录运行 `python3 -m http.server 4175`,端口 4175 也已被占用。
29. 通过 Python 端口探测找到 4176 可用。
30.`/home/mes123456/cnc_wams/web-rtcp-5axis-xyzbc-trt-sim-plan/app` 运行 `python3 -m http.server 4176`,服务器已启动,访问地址为 `http://127.0.0.1:4176/`
## 2026-07-02 Codex 执行过程日志 - T-034 tool-offset 闭环
1. 接收用户要求:接续上一轮,按 `/home/mes123456/cnc_wams/web-rtcp-5axis-xyzbc-trt-sim-plan/working` 持续编写程序。
2. 检查目标项目 `working` 目录、任务矩阵和推进台账,确认上一轮已完成 T-014 浏览器 smoke 与 T-029 Vismach pin 驱动模型,当前可继续推进 T-034 tool table 到 tool-offset 闭环。
3. 执行 `git status --short`,确认工作区已有上一轮未提交改动,包括 `app/package.json``five-axis-scene.js`、browser smoke、evidence JSON 和 working 文档;本轮在这些成果基础上继续,不回退用户或上一轮改动。
4. 读取 `app/src/runtime/tool-db-simulation.js`,确认已有 LinuxCNC tool table 解析、T/M6/G43/M61 命令模拟、activeToolOffset 和 interpreter parameter 5400-5413 生成能力。
5. 读取 `app/src/runtime/vismach-model-state.js`,确认 Vismach tool-offset 当时优先读取 `toolDbSimulation.activeToolOffset.offset.z`,否则回退 `toolPreview.length`
6. 读取 `tools/collect-web-xyzbc-trt-evidence.mjs`,确认 Web path 样本 tool 字段仍使用 `firstTool(profile)`,没有从 staged `xyzbc-trt.tbl` 和 active G43 偏置生成。
7. 读取 `wasm-port/vendor/linuxcnc/configs/sim/axis/vismach/5axis/table-rotary-tilting/xyzbc-trt.tbl`,确认真实工具表包含 `T1 P1 D1``T2 P2 Z10 D8`
8. 读取默认程序 `xyzbc_switchkins.ngc`,确认该程序调用子程序但自身没有 T/M6/G43因此本轮设计为 evidence 同时记录程序扫描命令和工具表默认激活证据,避免伪造程序命令。
9. 修改 `app/src/runtime/tool-db-simulation.js`,新增 `createToolRuntimeState()`统一输出当前工具、active offset、`motion.tooloffset.z` 等效值、下游 `xyzbc-trt-kins.tool-offset``xyzbc-trt-gui.tool-offset`、path tool 和 Vismach tool-offset。
10. 修改 `app/src/runtime/vismach-model-state.js`,让 `toolRuntimeState.vismach.toolOffset` 优先于旧的 `toolPreview.length`,使 Web 3D 模型刀具长度来自 active tool offset。
11. 修改 `tools/collect-web-xyzbc-trt-evidence.mjs`,引入 tool DB 解析和命令扫描逻辑,从 staged `xyzbc-trt.tbl` 创建 tool DB并扫描选定程序中的 T/M6/G43。
12. 在默认程序无工具命令时,`collect-web-xyzbc-trt-evidence.mjs` 选择工具表中第一个带 Z 偏置的工具 T2生成 T/M6/G43 默认激活证据,并记录 `defaultActivationUsed=true`
13. 修改 Web path 采集逻辑,使 `previewPath.samples[].tool``executionPath.samples[].tool` 使用 `toolRuntime.pathTool`,即 T2/P2/Z10/D8。
14. 在 Web evidence 中新增 `toolRuntime``toolOffsetClosure` 字段,记录 source tool table、selected program、programToolCommands、activeToolOffset、kinematicsToolOffsetZ、pathTool、vismachToolOffset 和 closed 状态。
15. 扩展 `coverage.toolTableToToolOffsetClosed`,要求 tool table ready、active offset applied、kinematics/path/Vismach 三方 tool length 一致才通过。
16. 修改 `tests/node/verify_xyzbc_trt_web_app.mjs`,断言 staged `xyzbc-trt.tbl` 包含 `T2 P2 Z10 D8`
17. 扩展 Node smoke使用 T2/M6/G43 创建 tool runtime state并断言 active tool number=2、pocket=2、current tool Z=10、diameter=8、kinematics toolOffsetZ=10、path tool length=10、Vismach toolOffset=10。
18. 扩展 Vismach smoke 断言,确认 `buildVismachModelState()` 在传入 toolRuntimeState 后输出 `pinValues.tool-offset=10`tool transform Z 为 `-25`
19. 运行 `npm --prefix app run smoke:node`,结果通过,输出 `xyzbc_trt_web_app_smoke=ok`
20. 运行 `npm --prefix app run evidence:web`,重新生成 `working/evidence/web-xyzbc-trt-evidence.json`
21. 抽查 Web evidence确认 `toolRuntime.ready=true``activeOffsetApplied=true``activeToolNumber=2``activePocket=2``kinematics.toolOffsetZ=10``pathTool.length=10``pathTool.diameter=8``vismach.toolOffset=10``toolOffsetClosure.closed=true``coverage.toolTableToToolOffsetClosed=true`
22. 运行 `npm --prefix app run evidence:compare`,重新生成 compare evidence仍为真实失败 `fail_count=5`,失败原因仍集中在 native preview/execution path 样本缺失。
23. 运行 `npm --prefix app run build`,结果通过,输出 `gmoccapy_static_build=ok`
24. 运行 `npm --prefix app run smoke:browser`,结果通过,输出 `xyzbc_trt_browser_smoke=ok`
25. 更新 `working/04-任务矩阵.md`,将 T-034 从“待实现”改为“完成”,验收标准改为 T2/P2/Z10/D8 驱动 kinematics、path tool 和 Vismach tool-offset。
26. 更新 `working/05-验收证据.md`,新增 “Tool table 到 tool-offset 闭环验收” 章节,记录 smoke、evidence、compare、build、browser smoke 命令和 JSON 摘要。
27. 更新 `working/03-推进台账.md`,新增本轮 T-034 实现记录、修改文件、验证结果和下一步。
28. 更新 `working/07-全量对标追踪矩阵.md`,把 `xyzbc-trt.tbl``tool-offset/x-offset/z-offset` 的状态改为 Web evidence 已完成 tool table active offset 闭环native 仍待重采集对比。
29. 修改 `tools/compare-xyzbc-trt-evidence.mjs`,新增 compare 检查 `web tool table active offset drives kinematics, path, and Vismach`,使 T-034 不只停留在 Web evidence而是进入自动对比报告。
30. 重跑 `npm --prefix app run evidence:compare`,确认新增 T-034 检查通过compare 摘要变为 `checkCount=24``passCount=19``failCount=5`
31. 重跑 `npm --prefix app run smoke:node`,结果仍通过。
32. 更新 `working/04-任务矩阵.md` 中 T-017 摘要为当前 `19/24` 通过,剩余 5 项均为 native preview/execution path 样本缺失。
33. 更新 `working/05-验收证据.md``working/03-推进台账.md`,记录 compare 当前 19/24 通过以及 T-034 compare 检查通过。
34. 执行 `git diff --check -- web-rtcp-5axis-xyzbc-trt-sim-plan`,未发现空白或格式错误。
35. 执行 `git status --short``git diff --stat -- web-rtcp-5axis-xyzbc-trt-sim-plan`,确认本轮改动包含 tool DB runtime、Vismach state、Web evidence、compare、Node smoke、working 文档和 evidence JSON未跟踪的 `app/dist/`、browser smoke 文件、Vismach state 文件等为上一轮/当前未提交工作区内容,未删除。
36. 本轮结论T-034 已完成Web evidence 与 compare 均证明 `xyzbc-trt.tbl` 的 T2/P2/Z10/D8 已闭环驱动 kinematics tool-offset、path JSON 和 Vismach tool-offset剩余主要任务仍是 T-019/T-037 native path 重采集、T-026/T-038 AXIS/UI 状态流复核、T-028/T-030 basic_sim 与 Ngcgui/remap 执行验收。