接入 LinuxCNC TP 运行反馈

This commit is contained in:
2026-06-21 23:29:56 +08:00
parent 626bcfe8e3
commit 3771b9eafe
44 changed files with 7881 additions and 326 deletions

View File

@@ -333,25 +333,285 @@ promotionAllowed=false
## 9. 当前状态
```text
status=M6_linuxcnc_kinematics_frame_proof_complete
status=M17_linuxcnc_5axis_gcode_source_ingest_complete
active_style=gmoccapy_5_axis
frontend_framework=none
ui_stack=html_css_typescript_es_modules
preview_stack=threejs
semantic_boundary=linuxcnc_owned
latest_batch=M6-linuxcnc-kinematics-frame-proof
latest_gate=linuxcnc_kinematics_runtime_smoke=ok,profile_boundary_smoke=ok,rtcp_store_smoke=ok,gmoccapy_shell_smoke=ok,gmoccapy_static_build=ok
rtcp_ui_state=implemented_fixture_fallback_and_node_kinematics_wasm_frame
latest_batch=M17-linuxcnc-5axis-gcode-source-ingest
latest_gate=full_execution_boundary_smoke=ok,linuxcnc_kinematics_runtime_smoke=ok,linuxcnc_interpreter_runtime_smoke=ok,linuxcnc_ini_runtime_smoke=ok,full_linuxcnc_5axis_source_node_smoke=ok,machine_file_staging_smoke=ok,five_axis_session_smoke=ok,profile_boundary_smoke=ok,rtcp_store_smoke=ok,gmoccapy_shell_smoke=ok,gmoccapy_dist_smoke=ok,gmoccapy_static_build=ok
rtcp_ui_state=implemented_browser_worker_and_node_kinematics_wasm_frame_with_fixture_fallback
control_wiring=power_estop_reset_auto_manual_jog_mdi_run_stop_pause_step_overrides_coolant_spindle_preview_home_reload_full
gcode_loading=implemented_browser_file_text_staging
program_current_line=implemented_fixture_line_playback_and_highlight
gcode_loading=implemented_browser_file_text_staging_with_linuxcnc_interpreter_execution
linuxcnc_5axis_gcode_sources=implemented_and_guarded_to_linuxcnc_source_manifest_trt_demos_only
program_current_line=implemented_linuxcnc_canonical_motion_highlight_with_fixture_fallback
tool_preview=implemented_tool_card_and_threejs_marker
threejs_preview=implemented_basic_canvas_scene
profile_source_map=implemented_xyzac_trt
profile_source_map=implemented_xyzac_trt_and_xyzbc_trt
profile_switching=implemented_xyzac_trt_and_xyzbc_trt_with_runtime_reload
pyvcp_hal_schema=implemented_xyzac_trt_switchkins
linuxcnc_boundary_adapter=kinematics_runtime_connected_node_interpreter_remap_missing
linuxcnc_kinematics_wasm=node_proof_ready_xyzac_trt
browser_kinematics_wasm=not_connected_fixture_fallback
full_program_execution=not_promoted_fixture_line_playback
next_batch=browser_kinematics_wasm_asset_worker_or_interpreter_execution_source
linuxcnc_boundary_adapter=kinematics_and_interpreter_runtime_connected_remap_planner_missing
full_execution_boundary=implemented_machine_file_remap_ready_with_planner_task_hal_blockers
linuxcnc_kinematics_wasm=browser_and_node_proof_ready_xyzac_trt
browser_kinematics_wasm=worker_connected_source_and_dist_xyzac_trt
linuxcnc_interpreter_wasm=browser_worker_and_node_direct_canonical_program_execution_ready_with_switchkins_mcode_preservation
browser_interpreter_wasm=worker_connected_source_and_dist
switchkins_rtcp_program_execution=implemented_m428_m429_program_events_drive_rtcp_and_kinematics_switch
full_program_execution=partial_interpreter_canonical_and_switchkins_event_ready_remap_planner_not_promoted
session_persistence=implemented_opfs_save_restore_for_5axis_session
machine_file_staging=implemented_linuxcnc_trt_ini_hal_tool_table_remap_demo_opfs_staging
machine_file_backed_run=implemented_linuxcnc_fiveaxis_remap_wasm_machine_file_execution
planner_task_hal_gap=audited_as_blocked_without_native_task_nml_realtime_hal_and_planner_queue_runtime
next_batch=trajectory_planner_wasm_boundary_or_native_task_hal_port
```
## 10. M12 任务
```text
M12-switchkins-rtcp-program-execution
```
状态:
```text
completed_with_program_level_rtcp_switching
```
已完成:
- `linuxcnc-interpreter-runtime` 识别 LinuxCNC TRT 配置中的 `M428/M429/M430` switchkins remap M-code
- 因当前 interpreter WASM 未启用 Python/NGC remap runtime运行前会从送入 WASM 的程序文本中移除这些高位 M-code避免 `M-code greater than 199` 阻断普通 canonical motion
- 原始程序的 `M428/M429/M430` 被保留为 `switchkinsEvents`,并打上 `linuxcnc_switchkins_remap_mcode_preserved_web_runtime_applied` 边界;
- canonical motion event 继承最近的 switchkins 状态,`RUN/STEP/RUN_FRAME` 按程序自动切换 `identity` / `tcp-xyzac` / `tcp-xyzbc`
- node/browser kinematics runtime 增加 `switchKinematics()`,程序内 `M428/M429` 会同步切换 LinuxCNC kinematics WASM 的 `lckins_switch()`
- gmoccapy diagnostics 显示 program switchkins event count
- smoke 覆盖含 `M428/M429` 的五轴联动 RTCP 程序:加载后进入 TCP执行 A/C 联动段保持 RTCP on运行到 `M429` 后回到 identity。
边界说明:
```text
switchkinsProgramBoundary=linuxcnc_remap_mcode_preserved_and_web_runtime_applied
interpreterBoundary=linuxcnc_interpreter_wasm_canonical_events
kinematicsBoundary=linuxcnc_kinematics_wasm_c_abi
remapRuntimeReady=false
plannerRuntimeReady=false
fullLinuxCncProgramExecutionReady=false
```
## 14. M16 任务
```text
M16-linuxcnc-tp-queue-timing-runtime
```
状态:
```text
completed_with_tp_wasm_and_web_node_smoke
```
已完成:
- `wasm-port/runtime/core/linuxcnc_wrap/linuxcnc_tp_wasm.c` 新增
`lctp_run_canonical_motion_timing()`
- TP WASM C ABI 将 LinuxCNC interpreter canonical motion events 入队到 vendored
LinuxCNC `src/emc/tp` runtime并通过 `tpRunCycle()` 生成 segment timing
- canonical 零长度 motion 保留为 0 秒 timing segment不作为 TP enqueue failure
- 新增 `wasm-port/runtime/sdk/src/linuxcnc-tp.js`
- `linuxcnc-interpreter-runtime``runProgram()` / `runMachineFileProgram()` 后调用
TP SDK`programExecution.plannerTiming` 使用
`linuxcnc_tp_queue_runtime_timing_from_canonical_motion` 边界;
- store 优先使用 TP planner timingJS `execution-timing.js` 保留为 fallback/MDI
lightweight path
- full execution boundary 可在 TP timing 成功时报告 `plannerRuntimeReady=true`
- browser source/dist smoke 验证 interpreter Worker readiness 包含 TP planner runtime
并验证含 `ARC_FEED` 的真实 G-code 程序通过 TP arc timing segment。
边界说明:
```text
timingBoundary=linuxcnc_tp_queue_runtime_timing_from_canonical_motion
plannerRuntimeReady=true for interpreter canonical motion with TP WASM timing
nativeTaskReady=false
nativeHalSyncReady=false
fullLinuxCncProgramExecutionReady=false
hardwareDrive=false
```
验证:
```text
source /home/cnc/emsdk/emsdk_env.sh >/dev/null && bash wasm-port/tools/build_tp_wasm.sh && bash wasm-port/tests/wasm/node/verify_tp_wasm.sh
node web-rtcp-5axis-sim-plan/tests/node/verify_linuxcnc_interpreter_runtime.mjs
npm --prefix web-rtcp-5axis-sim-plan/app run smoke:node
npm --prefix web-rtcp-5axis-sim-plan/app run smoke
```
## 11. M13 任务
```text
M13-interpreter-worker-runtime
```
状态:
```text
completed_with_browser_worker_smoke
```
已完成:
- 新增 `linuxcnc-interpreter-worker.js``linuxcnc-interpreter-worker-client.js`
- 浏览器默认优先通过 Web Worker 加载 LinuxCNC interpreter WASM
- store 的 `RUN_INTERPRETER_PROGRAM` 支持 async runtime避免 worker 结果阻塞 UI 线程;
- 增加 `interpreterExecutionPending` 和 sequence guard防止旧解释器结果覆盖新加载程序
- gmoccapy diagnostics 显示 interpreter execution context
- browser smoke 验证 kinematics 和 interpreter 都在 Worker并验证 source/dist 两条路径。
边界说明:
```text
browserInterpreterExecutionContext=worker
nodeInterpreterExecutionContext=direct
interpreterBoundary=linuxcnc_interpreter_wasm_canonical_events
remapRuntimeReady=false
plannerRuntimeReady=false
fullLinuxCncProgramExecutionReady=false
```
## 14. M16 任务
```text
M16-planner-task-hal-boundary-audit
```
状态:
```text
completed_with_full_execution_boundary_smoke
```
已完成:
- 新增 `full-execution-boundary.js`,统一汇总 kinematics、interpreter canonical、machine-file staging、five-axis remap run、switchkins HAL evidence
- store 新增 `fullExecutionBoundary` 派生状态和 `RUN_FULL_BOUNDARY_AUDIT_REQUEST`
- gmoccapy diagnostics 显示 full boundary、planner/task/HAL blockers 和证据摘要;
- 底部新增 `Audit` 按钮,可触发 machine-file staging + machine-file backed five-axis remap run
- interpreter runtime 对 machine-file backed run 的 `remapRuntimeReady` 改为基于 `fiveaxis_ini_open=1``fiveaxis_remaps_ready=1``fiveaxis_file_reached_exit=1`
- Node/browser smoke 验证 partial remap boundary ready同时继续禁止 full LinuxCNC program execution promoted。
边界说明:
```text
fullExecutionBoundary=linuxcnc_machine_file_remap_ready_planner_task_hal_blocked
remapRuntimeReady=true for staged fiveAxisRemap C ABI run
halSwitchkinsEvidenceReady=true for fiveaxis_hal_switchkins evidence
nativeTaskReady=false
nativeHalSyncReady=false
plannerRuntimeReady=false
fullLinuxCncProgramExecutionReady=false
promotionAllowed=false
```
## 15. M17 任务
```text
M17-linuxcnc-5axis-gcode-source-ingest
```
状态:
```text
completed_with_real_linuxcnc_5axis_source_program_smoke
```
已完成:
- machine-file staging 从 LinuxCNC source manifest 中追加 TRT `demos/*.ngc`,包括 `boat-xyzac.ngc``boat-xyzbc.ngc``impeller-7bl-xyzac.ngc``xyzac_switchkins*.ngc``xyzbc_switchkins.ngc`
- `selectMachineFileProgram()` 强制 5 轴 G-code 必须来自 LinuxCNC 源程序目录 `configs/sim/axis/vismach/5axis/table-rotary-tilting/demos/*.ngc`
- 新增 `listLinuxCncGcodeSources()``selectMachineFileProgram()`
- store 新增 `LOAD_LINUXCNC_GCODE_SOURCE`,可把 staged LinuxCNC 真实 5 轴 `.ngc` 源文件加载到 G-code 面板;
- gmoccapy G-code 面板新增 LinuxCNC 5-axis source 下拉框和 staging 按钮;
- machine-file backed remap run 使用当前选中的 LinuxCNC `.ngc` 源程序路径;
- Node/browser smoke 验证选择 `impeller-7bl-xyzac.ngc`UI 加载真实源程序machine-file run 的 `wasmProgramPath` 指向该源文件。
边界说明:
```text
gcodeSourceBoundary=linuxcnc_vendored_5axis_gcode_source_file
sourceMode=linuxcnc-vendored-5axis-gcode
machineFileBackedRunProgram=selected_staged_linuxcnc_ngc_source
sourceDirectoryGuard=configs/sim/axis/vismach/5axis/table-rotary-tilting/demos/*.ngc only
remapRuntimeReady=true for staged fiveAxisRemap C ABI run
plannerRuntimeReady=false
nativeTaskReady=false
nativeHalSyncReady=false
fullLinuxCncProgramExecutionReady=false
```
## 12. M14 任务
```text
M14-opfs-machine-file-staging
```
状态:
```text
completed_with_node_and_browser_opfs_smoke
```
已完成:
- 新增 `linuxcnc-machine-file-staging.js`
- 复用 `wasm-port/runtime/sdk/src/sim-config-staging.js``planSimConfigStaging()`,为 `xyzac-trt` / `xyzbc-trt` 生成 LinuxCNC sim-config staging plan
- 将 INI、tool table、HAL、PyVCP XML、`remap_subs/*.ngc`、demo G-code 等 vendored LinuxCNC 文本文件保存到 OPFS 风格路径;
- store 增加 `machineFileStaging` 状态和 `stageMachineFiles()` API
- gmoccapy diagnostics 显示 machine-file staging 状态;
- build 产物复制 `wasm-port/tools/source-manifest.txt`,保证 dist 页面也能生成 staging plan
- node smoke 使用 memory OPFS 验证文件保存browser smoke 使用真实 OPFS 验证 source/dist staging。
边界说明:
```text
machineFileStagingBoundary=linuxcnc_sim_config_file_staging_plan_plus_opfs_text_persistence
stagedFiles=ini,hal,pyvcp,tool_table,remap_ngc,demo_gcode
nativeHalTaskSync=false
remapRuntimeReady=false
plannerRuntimeReady=false
fullLinuxCncProgramExecutionReady=false
```
## 13. M15 任务
```text
M15-machine-file-backed-fiveaxis-remap-run
```
状态:
```text
completed_with_node_and_browser_fiveaxis_remap_run
```
已完成:
- `linuxcnc-interpreter-runtime` 新增 `runMachineFileProgram()`
- interpreter Worker 支持 `runMachineFileProgram` 转发;
- store 新增 `RUN_MACHINE_FILE_PROGRAM` action 和 `machineFileExecution` 状态;
- 使用 M14 的 machine-file staging plan/files把 TRT INI、tool table、remap NGC、demo G-code 写入 Emscripten FS
- 调用 LinuxCNC interpreter SDK `runSimConfigProgram({ executionMode: "fiveAxisRemap" })`
- Node/browser smoke 验证 `fiveaxis_ini_open=1``fiveaxis_remaps_ready=1``fiveaxis_file_reached_exit=1`
- gmoccapy diagnostics 显示 machine-file backed run 状态。
边界说明:
```text
machineFileBackedRunBoundary=linuxcnc_fiveaxis_remap_wasm_machine_file_execution
sourceMode=linuxcnc-machine-file-remap-wasm
remapRuntimeReady=vendored_linuxcnc_fiveaxis_remap_c_abi_for_staged_files
nativeTaskHalSync=false
plannerRuntimeReady=false
fullLinuxCncProgramExecutionReady=false
```