Files
cnc_wams/web-rtcp-5axis-sim-plan/docs/development-continuation.md

40 KiB
Raw Blame History

5 轴数控系统 Web 仿真编写过程接续文档

生成时间2026-06-20 CST

1. 当前结论

已确定:

  • Web 前端界面可实现;
  • 首选界面风格为 gmoccapy_5_axis.png
  • 前端不使用 React/Vue 等框架,采用原生 HTML/CSS + TypeScript/JavaScript ES modules
  • 3D 使用 Three.js
  • LinuxCNC Python GUI 只做界面参考;
  • LinuxCNC C/C++/WASM/source-derived boundary 才能作为 CNC 语义和五轴运动学依据。

当前准备文档已完成:

README.md
docs/implementation-plan.md
docs/technical-roadmap.md
docs/program-implementation-guide.md
docs/development-continuation.md
docs/traceability-matrix.md
docs/linuxcnc-python-gui-reference.md
docs/linuxcnc-gui-reference-gallery.md

2. 下一轮直接开工任务

下一轮不再继续扩展方案,直接进入实现。

第一批任务:

M1-web-shell-gmoccapy

状态:

completed_with_build_gate

目标:

  • 创建 app/
  • 创建原生 HTML/CSS/TS 项目;
  • 实现 gmoccapy 风格静态 shell
  • 复制必要的参考图路径到 docs
  • 加 browser smoke 验证页面区域存在。

已补齐 M1 工程化验收:

  • app/tsconfig.json 已创建;
  • npm run build 已可输出静态产物;
  • build 产物目录 app/dist/ 已加入 .gitignore
  • browser smoke 已检查无 React/Vue/Angular/Svelte 依赖和 DOM 标记。

3. M1 任务拆分

M1.1 初始化 app

创建:

app/index.html
app/package.json
app/tsconfig.json
app/src/main.ts
app/src/styles/gmoccapy.css

要求:

  • 不安装 React/Vue
  • 可使用 Vite
  • npm run dev 能启动;
  • npm run build 能输出静态产物。

M1.2 静态 shell

创建:

app/src/ui/gmoccapy-shell.ts

渲染区域:

titlebar
preview
dro
gcode
status-sidebar
info-tabs
override
spindle-coolant
bottom-controls

M1.3 CSS layout

目标:

  • 视觉接近 gmoccapy_5_axis.png
  • 黑底 preview
  • 绿色 DRO
  • 灰色面板;
  • 橙色 override
  • 右侧竖向大按钮;
  • 底部大按钮栏。

M1.4 smoke

创建:

tests/browser/gmoccapy_shell_smoke.html
tests/browser/verify_gmoccapy_shell_browser.sh

检查:

  • 页面加载;
  • 关键 data-region 存在;
  • DRO 文本非空;
  • G-code rows 存在;
  • preview 容器非空;
  • 无 React/Vue 依赖标记。

当前 gate

gmoccapy_static_build=ok
gmoccapy_shell_smoke=ok

4. M2 任务

M2-state-and-controls

状态:

completed_with_rtcp_frame_and_control_wiring

目标:

  • 实现 store
  • 实现 Run/Stop/Pause/Step action
  • G-code active line
  • DRO state update
  • Node smoke。

本轮追加 RTCP 最小可验证链路:

  • 新增 xyzac-trt profile source reference
  • 新增 web-rtcp-5axis-motion-frame
  • store 输出 axisPosejointPosetcpPosetoolAxisVectorrtcpFrame
  • 右侧 TCP/IDENTITY 按钮可切换 rtcpState=on/off
  • DRO 和 info tabs 显示 TCP pose、tool axis vector、RTCP frame readiness
  • browser smoke 验证 RTCP DOM 和状态同步;
  • node smoke 验证 frame/store 行为。

本轮继续补齐 M2 控件接线:

  • preview X/Y/Z/Fit/Clear 按钮接入 store
  • Rapid Override / Feed Rate 加减按钮接入 store
  • Spindle override 加减按钮接入 store
  • Flood / Mist 冷却按钮接入 store
  • Reload / Home / Full 底部按钮接入 store
  • operatorMessage 记录最近一次仿真操作;
  • Node smoke 和 browser smoke 覆盖上述控制链路。

边界说明:

sourceMode=fixture-ui-only
semanticBoundary=fixture_frame_ui_plumbing_not_linuxcnc_kinematics_proof
linuxCncKinematicsReady=false
promotionAllowed=false

也就是说Web 仿真界面现在已经具备 RTCP 状态链路和显示链路,但尚未把 LinuxCNC/source-derived 五轴运动学 WASM 接入为最终语义源。

5. M3 任务

M3-threejs-preview

状态:

completed_with_canvas_smoke

目标:

  • Three.js canvas
  • 基础五轴机床;
  • tool marker
  • simple path
  • canvas nonblank browser smoke。

M3 需要消费 M2 的 rtcpFrame

  • Three.js tool marker 使用 tcpPose
  • 刀轴显示使用 toolAxisVector
  • RTCP on/off 需要在预览中产生可见姿态差异;
  • canvas smoke 需要检查 frame 与预览数据同步。

已完成:

  • 新增 app/src/vendor/three/three.module.jsthree.core.js
  • 新增 app/src/visualization/five-axis-scene.js
  • gmoccapy preview 区域由真实 WebGL canvas 渲染;
  • 预览显示基础五轴工作区、工作台、刀具/TCP marker、刀轴和刀路
  • Three.js canvas 消费 tcpPosetoolAxisVectorrtcpStatertcpFrame
  • browser smoke 验证 canvas nonblank、scene objects、path points、RTCP on/off 同步和 STEP 后 TCP pose 更新。

当前 gate

gmoccapy_static_build=ok
rtcp_store_smoke=ok
gmoccapy_shell_smoke=ok

6. M4 任务

M4-profile-and-linuxcnc-boundary

状态:

completed_with_profile_boundary_smoke

目标:

  • xyzac-trt profile
  • source reference map
  • PyVCP/HAL panel schema
  • LinuxCNC adapter 接入点;
  • traceability update。

已完成:

  • 扩展 app/src/profiles/xyzac-trt.js,记录 INI、PyVCP XML、postgui HAL、generated HAL、tool table、remap、switchkins type、HAL pins、offsets、sample programs
  • 进一步按 LinuxCNC xyzac-trt.ini/xyzac-trt_cmds.hal/*.tbl/428-430remap.ngc 整理 machine name、DISPLAY/RS274NGC/TRAJ、axis/joint limits、HALCMD nets、HALUI MDI commands、tool table 条目;
  • 新增 app/src/profiles/source-reference-map.js,建立 xyzac-trt source/config/reference map
  • 新增 app/src/panel-schema/xyzac-trt-pyvcp.js,把 xyzac-trt.xmlswitchkins_postgui.hal 的 SWITCHKINS 控件整理为 Web panel schema
  • 新增 app/src/runtime/linuxcnc-boundary-adapter.js,作为后续 LinuxCNC interpreter/kinematics WASM 的接入点;
  • store 输出 linuxCncBoundaryAdapterlinuxCncBoundaryReadiness
  • info tabs 显示 adapter、panel schema、source map 和 boundary readiness
  • 新增 tests/node/verify_profile_boundary.mjs,并接入 npm run smoke:node
  • browser smoke 验证 LinuxCNC boundary adapter/schema/readiness DOM 状态。

边界说明:

sourceMapBoundary=profile_source_map_only_not_runtime_proof
panelSchemaBoundary=pyvcp_hal_schema_reference_only
adapterBoundary=adapter_entrypoint_only_runtime_not_connected
linuxCncKinematicsReady=false
promotionAllowed=false

说明:

M4 现在可视为在 profile/source-map/panel-schema/adapter 层面完全满足;
但这不等于 LinuxCNC interpreter/kinematics runtime 已接入。

7. M5 任务

M5-operator-program-workflow

状态:

completed_with_operator_program_smoke

目标:

  • 上电、急停、自动、手动、JOG、MDI、复位等操作
  • 加载 G-code 文件;
  • 刀具预览;
  • 执行程序并显示执行的当前行。

已完成:

  • store 新增 machine.powerOnmachine.estopActivemachine.mode、JOG/MDI/reset 状态;
  • 右侧按钮栏新增 POWER、E-STOP、RESET、AUTO、MANUAL、JOG、MDI
  • 底部控制栏新增本地 G-code 文件输入、JOG X/Y、MDI run
  • LOAD_PROGRAM 可从浏览器 FileReader 或 public dispatch 加载 operator G-code 文本;
  • G-code 面板显示程序来源、当前执行行,并按当前行高亮;
  • Three.js 预览区域新增刀具预览卡,显示 T 号、直径、长度和 holder
  • RUN/STEP 会在上电且非急停状态下推进当前行,未上电时明确 blocked
  • node/browser smoke 覆盖上电、加载程序、运行、高亮当前行、JOG、MDI、复位和急停。

边界说明:

operatorWorkflowBoundary=browser_ui_runtime_fixture
gcodeLoadBoundary=file_text_staging_only
programExecutionBoundary=fixture_line_playback_not_linuxcnc_interpreter
linuxCncKinematicsReady=false
promotionAllowed=false

8. 每批完成后必须更新

每批完成后更新:

  • 本文件的“当前状态”;
  • docs/traceability-matrix.md
  • 如果新增 UI 或 runtime 约束,更新 docs/program-implementation-guide.md
  • 如果新增参考来源,更新 docs/linuxcnc-python-gui-reference.mddocs/linuxcnc-gui-reference-gallery.md

9. 当前状态

status=M22_host_native_boundary_visibility_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=M22-host-native-boundary-visibility
latest_gate=host_native_boundary_ui=ok,hardware_drive_false_visible=1,host_realtime_false_visible=1,external_user_m_false_visible=1,tool_db_false_visible=1,threejs_program_preview_mode=program-preview-and-tool-execution,threejs_preview_source=linuxcnc-interpreter-wasm_or_linuxcnc-machine-file-remap-wasm,threejs_toolpath_preview_source=linuxcnc_interpreter_canonical_motion,threejs_tool_execution_trace_source=linuxcnc_tp_samples_or_task_motion_hal_feedback,threejs_path_fit_bounds=ok,threejs_current_segment_highlight=ok,threejs_rapid_feed_visual_distinction=ok,threejs_no_gcode_semantics_generation=ok,threejs_canvas_nonblank_desktop=ok,threejs_canvas_nonblank_mobile=ok,opfs_unavailable_detected=1,opfs_fallback_current_page_lifecycle_only=1,non_opfs_workflows_still_pass=1,public_http_smoke_no_uncaught_exception=1,real_linuxcnc_5axis_program_cases_smoke=ok,native_task_hal_source_artifact_audit=ok,task_hal_web_simulation_boundary_consistent=1,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
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_with_linuxcnc_interpreter_execution
linuxcnc_5axis_gcode_sources=implemented_and_guarded_to_linuxcnc_source_manifest_trt_demos_only
linuxcnc_source_program_case_coverage=implemented_boat_xyzac_boat_xyzbc_impeller_xyzac_switchkins_xyzbc_switchkins_guarded_cases
program_current_line=implemented_linuxcnc_canonical_motion_highlight_with_fixture_fallback
tool_preview=implemented_tool_card_and_threejs_marker
threejs_preview=implemented_program_preview_and_tool_execution_with_fit_bounds_current_segment_and_rapid_feed_arc_layers
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_and_interpreter_runtime_connected_remap_planner_missing
full_execution_boundary=implemented_machine_file_remap_ready_with_planner_task_hal_blockers
host_native_boundary_visibility=implemented_ui_and_browser_smoke_guard_for_hardware_realtime_external_user_m_tool_db_false
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_with_memory_fallback_when_opfs_unavailable
machine_file_staging=implemented_linuxcnc_trt_ini_hal_tool_table_remap_demo_opfs_staging_with_memory_fallback_when_opfs_unavailable
machine_file_backed_run=implemented_linuxcnc_fiveaxis_remap_wasm_machine_file_execution
planner_task_hal_gap=closed_for_web_simulation_boundary_with_task_motion_hal_wasm_runtime
native_task_hal_sync_plan=docs_native_task_hal_sync_implementation_steps_ready
native_task_hal_phase0_8=source_manifest_native_probe_hal_runtime_motion_hal_sync_task_shim_sdk_machine_file_store_ui_full_boundary_smokes_ready_and_m18_readiness_artifact_audited
native_task_hal_readiness_artifact=web-rtcp-5axis-sim-plan/build/readiness/native-task-hal-readiness.json
next_batch=none_from_development_continuation

当前 native task/HAL 接续状态:

  • Phase 0 source manifest gate 已输出 task_hal_source_manifest_ready=1
  • Phase 1 TRT native probe 已按 opt-in 模式就绪,默认 ready_disabled_by_default,不提升;
  • Phase 2 HAL runtime 已覆盖 pin/signal/param/net/thread scheduler 和 loadusr blocked evidence
  • Phase 3 minimal motion/HAL C ABI 已覆盖 servo cycle、program-line、switchkins、jog/status HAL 同步;
  • Phase 4 minimal task/HAL C ABI 已覆盖 lctask_* session/stage/open/command/cycle/status/eventsRUN/MDI/JOG/PAUSE/RESUME/ABORT 能从 task shim 驱动 motion/HAL runtime并已补 SDK wrapper
  • Phase 5-8 已把 machine-file session、task/HAL runtime adapter、Worker/client 文件、store action mapping、gmoccapy diagnostics 和 full boundary gate 接上;
  • nativeTaskReady=truenativeHalSyncReady=true 当前只表示 Web simulation boundary 内的 task/motion/HAL WASM runtime proof仍保持 hardwareDrive=falsehostRealtimeKernel=falseexternalUserMProcessReady=falsetoolDbProcessReady=false

补充实施文档:

docs/native-task-hal-sync-implementation-steps.md

该文档给出完成 nativeTaskReadynativeHalSyncReady 的分阶段实现步骤、程序编写顺序、LinuxCNC 源程序参考清单和验收 gate。当前已完成 Web simulation boundary不表示真实硬件、host realtime kernel 或外部进程 runtime 已完成。

10. M12 任务

M12-switchkins-rtcp-program-execution

状态:

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。

边界说明:

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

16. 最新接续基线

生成时间2026-06-22 CST

本节是下一轮工作的优先入口。旧的 M1-M17 记录保留为历史,不再作为“下一步”的判断依据;后续直接按本节和 docs/native-task-hal-sync-implementation-steps.md 执行。

16.1 当前完成情况

ui_shell=ready
gmoccapy_layout=ready
profile_xyzac_trt=ready
profile_xyzbc_trt=ready
linuxcnc_kinematics_wasm=ready_browser_worker_and_node
linuxcnc_interpreter_wasm=ready_browser_worker_and_node
linuxcnc_tp_queue_timing=ready_for_canonical_motion
machine_file_staging=ready_opfs_and_memory_storage
machine_file_backed_fiveaxis_remap_run=ready_for_staged_linuxcnc_trt_sources
task_motion_hal_wasm_simulation_boundary=ready_for_web_simulation
threejs_program_preview=ready
threejs_tool_execution_display=ready
linuxcnc_source_program_case_coverage=ready_node_and_browser_guarded
nativeTaskReady=web_simulation_boundary_only
nativeHalSyncReady=web_simulation_boundary_only
opfs_degradation=ready_memory_fallback_current_page_lifecycle_only
hardwareDrive=false
hostRealtimeKernel=false
externalUserMProcessReady=false
toolDbProcessReady=false

已通过的当前 gate

npm --prefix web-rtcp-5axis-sim-plan/app run smoke:node
bash web-rtcp-5axis-sim-plan/tests/browser/verify_gmoccapy_shell_browser.sh
bash web-rtcp-5axis-sim-plan/tests/browser/verify_gmoccapy_dist_browser.sh

16.2 Three.js 当前状态

Three.js 显示区现在不再承担 CNC 语义,只消费 LinuxCNC runtime 输出:

  • 完整程序预览路径来自 state.programExecution.motion,即 LinuxCNC interpreter/WASM canonical motion events
  • 已执行路径优先来自 state.programExecutionTiming.samples,即 LinuxCNC TP queue runtime timing samples
  • 当前刀具/TCP 标记来自 state.programRuntimeFeedback.axisPose 或 task/HAL runtime feedback
  • 刀轴方向线来自 state.toolAxisVector
  • Clear 同步清空完整路径和已执行路径;
  • 鼠标/触控旋转、平移、缩放和 X/Y/Z/Fit 预设视角已保留。

可观测 dataset

canvas.dataset.threeSceneMode=program-preview-and-tool-execution
canvas.dataset.threeProgramPreviewSource=linuxcnc-interpreter-wasm / linuxcnc-machine-file-remap-wasm / fixture-line-playback
canvas.dataset.threeToolpathPreviewSource=linuxcnc_interpreter_canonical_motion
canvas.dataset.threeToolExecutionTraceSource=linuxcnc_tp_samples_or_task_motion_hal_feedback
canvas.dataset.threePathFitBounds=ok
canvas.dataset.threeCurrentSegmentHighlight=ok
canvas.dataset.threeRapidFeedVisualDistinction=ok
canvas.dataset.threeNoGcodeSemanticsGeneration=ok
canvas.dataset.threePathPoints=完整程序预览点数
canvas.dataset.threeExecutedPathPoints=已执行路径点数
canvas.dataset.threeRapidPathPoints=rapid 路径点数
canvas.dataset.threeFeedPathPoints=feed 路径点数
canvas.dataset.threeArcPathPoints=arc 路径点数
canvas.dataset.threeCurrentSegmentPoints=当前 segment 高亮点数
canvas.dataset.threeToolExecutionMarker=true/false
canvas.dataset.threeCameraControls=orbit-pan-zoom

边界要求:

Three.js 不解析 G-code
Three.js 不重写 LinuxCNC 运动语义
Three.js 只显示 interpreter canonical motion、TP samples、task/HAL feedback

刀具路径预览和刀具执行轨迹对标要求:

toolpath_preview_source=linuxcnc_source_program_interpreter_canonical_motion
tool_execution_trace_source=linuxcnc_tp_samples_or_task_motion_hal_feedback
tool_marker_source=linuxcnc_task_hal_or_runtime_feedback_tcp_pose
source_program_guard=linuxcnc_vendored_5axis_gcode_source_file
threejs_generated_toolpath_semantics=forbidden
  • 完整刀具路径预览必须来自当前选中的 LinuxCNC 源程序 .ngc 经 interpreter/WASM 输出的 canonical motion不得由 Three.js 或 Web 侧按 G-code 文本自行推导;
  • 已执行刀具轨迹必须优先来自 LinuxCNC TP queue timing samples 或 task/motion/HAL feedback不能用 UI 播放进度伪造为 LinuxCNC 执行轨迹;
  • 刀具/TCP marker、刀轴和当前 segment 高亮必须能追溯到同一个 LinuxCNC runtime snapshot 或 canonical/timing event
  • boat-xyzac.ngcboat-xyzbc.ngcimpeller-7bl-xyzac.ngcxyzac_switchkins*.ngcxyzbc_switchkins.ngc 等案例需要逐个验证预览路径点数、执行轨迹点数、当前 G-code 行、RTCP/switchkins 状态和 source guard
  • 如果 runtime fallback 到 fixture-line-playbackUI 可以显示降级预览,但不得把它标记为 LinuxCNC 源程序刀具路径对标通过。

16.3 后续工作总原则

后续工作按 docs/native-task-hal-sync-implementation-steps.md 执行,保持以下原则:

  1. 不用 Web 侧自定义状态机替代 LinuxCNC task/HAL/motion 语义。
  2. 不把 browser simulation boundary 扩大描述为真实硬件 runtime。
  3. nativeTaskReady=truenativeHalSyncReady=true 只允许在 Web simulation boundary 内成立,除非另有 host-native 对照和 WASM 比对 artifact。
  4. hardwareDrive=falsehostRealtimeKernel=falseexternalUserMProcessReady=falsetoolDbProcessReady=false 必须继续明确展示。
  5. 不修改用户个人备忘文件;本项目接续只写 docs/development-continuation.md 和必要工程文档。

16.4 下一批直接执行任务

M18-native-task-hal-source-and-artifact-audit

状态:

completed_with_machine_readable_readiness_artifact

目标:

  • 对照 docs/native-task-hal-sync-implementation-steps.md 阶段 0-8审计当前源码、构建产物、测试和 UI 证据是否一致;
  • 修正 docs/development-continuation.md 中旧段落遗留的 false/partial 状态,避免同一文件同时宣称 task/HAL ready 和 blocked
  • 产出机器可读 readiness artifact明确 Web simulation promoted 与 hardware/native blocked 的区别。

建议检查文件:

web-rtcp-5axis-sim-plan/app/src/runtime/linuxcnc-task-hal-runtime.js
web-rtcp-5axis-sim-plan/app/src/runtime/linuxcnc-task-hal-worker.js
web-rtcp-5axis-sim-plan/app/src/runtime/linuxcnc-task-hal-worker-client.js
web-rtcp-5axis-sim-plan/app/src/runtime/full-execution-boundary.js
web-rtcp-5axis-sim-plan/app/src/state/store.js
web-rtcp-5axis-sim-plan/app/src/ui/gmoccapy-shell.js
web-rtcp-5axis-sim-plan/tests/node/verify_linuxcnc_task_hal_runtime.mjs
web-rtcp-5axis-sim-plan/tests/browser/gmoccapy_shell_smoke.html
wasm-port/tests/wasm/node/verify_task_hal_wasm.sh
wasm-port/tests/wasm/node/verify_motion_hal_sync.sh
wasm-port/tests/wasm/node/verify_hal_runtime.sh
wasm-port/tests/native/probe_trt_task_hal_runtime.sh

验收:

task_hal_web_simulation_boundary_consistent=1
native_task_hal_host_probe_status=passed_or_ready_disabled_by_default_or_skipped_missing_host_runtime
hardware_drive=0
host_realtime_kernel=0
external_user_m_process_ready=0
tool_db_process_ready=0
promotion_scope=web_simulation_only

已完成:

  • 新增 app/src/runtime/native-task-hal-audit.js,汇总 source manifest、native opt-in probe、full execution boundary 和 task/HAL readiness
  • 新增 tests/node/verify_native_task_hal_audit.mjs,默认运行 wasm-port/tests/native/verify_task_hal_phase0.sh 刷新 source/probe 证据;
  • 生成机器可读 artifact build/readiness/native-task-hal-readiness.json
  • npm run smoke:node 已接入该 gate
  • 明确区分 webSimulation.promoted=truenativeHostAndHardware.hardwareDrive=falsehostRealtimeKernel=falseexternalUserMProcessReady=falsetoolDbProcessReady=false

当前 M18 gate

native_task_hal_source_artifact_audit=ok
task_hal_web_simulation_boundary_consistent=1
native_task_hal_host_probe_status=ready_disabled_by_default
hardware_drive=0
host_realtime_kernel=0
external_user_m_process_ready=0
tool_db_process_ready=0
promotion_scope=web_simulation_only

16.5 M19真实 LinuxCNC 源程序案例覆盖

M19-linuxcnc-source-program-case-coverage

状态:

completed_with_real_linuxcnc_source_program_case_smoke

目标:

  • 继续以 LinuxCNC 源程序中的 5 轴 TRT demo 为准,不新增自定义 G-code 语义;
  • 覆盖 boat-xyzac.ngcboat-xyzbc.ngcimpeller-7bl-xyzac.ngcxyzac_switchkins*.ngcxyzbc_switchkins.ngc
  • 每个案例都验证interpreter canonical motion、TP timing samples、Three.js 完整刀具路径预览、Three.js 已执行刀具轨迹、G-code 当前行、RTCP/switchkins 状态;
  • 刀具路径预览和刀具执行轨迹必须对标 LinuxCNC 源程序 runtime 输出,不能由 Three.js/Web 自行解析或生成运动语义。

验收:

linuxcnc_source_program_case_count>=5
all_cases_program_preview_points>0
all_cases_executed_path_points>0_after_run_or_step
all_cases_toolpath_preview_source=linuxcnc_interpreter_canonical_motion
all_cases_tool_execution_trace_source=linuxcnc_tp_samples_or_task_motion_hal_feedback
all_switchkins_cases_rtcp_state_changes_verified=1
all_cases_source_guard=linuxcnc_vendored_5axis_gcode_source_file
fixture_toolpath_fallback_not_promoted=1

建议新增或扩展:

web-rtcp-5axis-sim-plan/tests/node/verify_real_linuxcnc_5axis_program_cases.mjs
web-rtcp-5axis-sim-plan/tests/browser/gmoccapy_shell_smoke.html

已完成:

  • 新增 tests/node/verify_real_linuxcnc_5axis_program_cases.mjs 并接入 npm run smoke:node
  • 覆盖 staged LinuxCNC TRT demo source guardboat-xyzac.ngcboat-xyzbc.ngcimpeller-7bl-xyzac.ngcxyzac_switchkins.ngcxyzac_switchkins_test_1.ngcxyzac_switchkins_test_2.ngcxyzac_switchkins_test_3.ngcxyzbc_switchkins.ngc
  • 直接 canonical/TP 覆盖 boat-xyzac.ngcboat-xyzbc.ngcimpeller-7bl-xyzac.ngcxyzac_switchkins_test_*.ngc
  • xyzac_switchkins.ngcxyzbc_switchkins.ngc 这类 o<sub> call 入口,验证 LinuxCNC machine-file staging/remap run 和 source guard不把 direct interpreter 无子程序上下文时的 0 motion 标记为失败或通过;
  • linuxcnc-interpreter-runtime 预处理单独一行的 LinuxCNC % 程序定界符为注释,保留行号,不新增 G-code 运动语义;
  • TP WASM timing artifact 容量和大程序 sample stride 已支持 impeller-7bl-xyzac.ngc 的 4492 条 canonical motion 与 TP segment 对齐;
  • browser smoke 在现有 impeller-7bl-xyzac.ngc 源程序流程中验证 canonical motion、TP samples、Three.js 完整路径/已执行轨迹和初始 RTCP switchkins 状态。

当前 M19 gate

linuxcnc_source_program_case_count=8
all_cases_program_preview_points=ok
all_cases_executed_path_points=ok_after_run_or_step
all_cases_toolpath_preview_source=linuxcnc_interpreter_canonical_motion
all_cases_tool_execution_trace_source=linuxcnc_tp_samples_or_task_motion_hal_feedback
all_switchkins_cases_rtcp_state_changes_verified=1
all_cases_source_guard=linuxcnc_vendored_5axis_gcode_source_file
fixture_toolpath_fallback_not_promoted=1
real_linuxcnc_5axis_program_cases_smoke=ok

边界说明:

sourceProgramBoundary=linuxcnc_vendored_5axis_gcode_source_file
toolpathPreviewBoundary=linuxcnc_interpreter_canonical_motion
toolExecutionTraceBoundary=linuxcnc_tp_samples_or_task_motion_hal_feedback
threejsGeneratedToolpathSemantics=forbidden
fixtureToolpathFallbackPromoted=false
hardwareDrive=false

16.6 M20Three.js 执行显示质量提升

M20-threejs-tool-execution-quality

状态:

completed_with_tool_execution_quality_smoke

目标:

  • 保持 Three.js 不解析 G-code只消费 runtime 输出;
  • 增加执行进度色带或当前 segment 高亮;
  • 明确 rapid/feed/arc/switchkins segment 的可视区别;
  • 增加路径 fit bounds避免真实 LinuxCNC 大程序被固定 clamp 后压扁;
  • 增加 desktop/mobile 截图或 canvas pixel smoke验证刀具路径预览、已执行刀具轨迹和刀具 marker 不重叠、不空白;
  • 任何可视化质量提升都必须保持路径点、segment 类型、当前刀具位置来源于 LinuxCNC interpreter/TP/task-HAL 输出。

验收:

threejs_program_preview_mode=program-preview-and-tool-execution
threejs_preview_source=linuxcnc-interpreter-wasm_or_linuxcnc-machine-file-remap-wasm
threejs_toolpath_preview_source=linuxcnc_interpreter_canonical_motion
threejs_tool_execution_trace_source=linuxcnc_tp_samples_or_task_motion_hal_feedback
threejs_path_fit_bounds=ok
threejs_current_segment_highlight=ok
threejs_rapid_feed_visual_distinction=ok
threejs_no_gcode_semantics_generation=ok
threejs_canvas_nonblank_desktop=ok
threejs_canvas_nonblank_mobile=ok

已完成:

  • Three.js 增加 rapid/feed/arc 分层路径、已执行路径和当前 segment 高亮;
  • Fit 改为按当前程序预览、执行轨迹、当前 segment、TCP marker 和刀轴点集计算 bounds避免真实大程序在固定范围内压扁
  • dataset 明确输出 toolpath preview source、tool execution trace source、fit bounds、当前 segment、rapid/feed 区分和 no G-code semantics generation
  • fallback canvas 同步输出相同的可观测 gate并绘制当前 segment
  • browser smoke 在真实 LinuxCNC impeller-7bl-xyzac.ngc 源程序路径中验证 desktop/mobile canvas nonblank、路径来源、rapid/feed 区分和当前 segment。

当前 M20 gate

threejs_program_preview_mode=program-preview-and-tool-execution
threejs_preview_source=linuxcnc-interpreter-wasm_or_linuxcnc-machine-file-remap-wasm
threejs_toolpath_preview_source=linuxcnc_interpreter_canonical_motion
threejs_tool_execution_trace_source=linuxcnc_tp_samples_or_task_motion_hal_feedback
threejs_path_fit_bounds=ok
threejs_current_segment_highlight=ok
threejs_rapid_feed_visual_distinction=ok
threejs_no_gcode_semantics_generation=ok
threejs_canvas_nonblank_desktop=ok
threejs_canvas_nonblank_mobile=ok

16.7 M21公网部署与 OPFS 降级

M21-public-http-opfs-degradation

状态:

completed_with_public_http_fallback_smoke

背景:

公网 http://82.156.24.101:8092 这类 HTTP/IP 环境不是安全上下文OPFS 可能不可用。此前测试中 Save Session 已出现 OPFS is not available in this browser

目标:

  • 检测非安全上下文和 OPFS 不可用状态;
  • 让 Save Session、Restore Session、Stage Machine Files、Full Boundary Audit 给出明确 UI 状态;
  • 不让 OPFS 缺失阻断不依赖 OPFS 的预览、运行、Three.js 显示、DRO、G-code 加载;
  • 可选增加 memory fallback仅用于当前页面生命周期不宣称持久化。

验收:

opfs_unavailable_detected=1
opfs_dependent_actions_blocked_with_clear_message=1
non_opfs_workflows_still_pass=1
public_http_smoke_no_uncaught_exception=1

已完成:

  • five-axis-sessionlinuxcnc-machine-file-staging 增加 storage capability 检测,识别非安全上下文、缺失 navigator.storage.getDirectory() 和测试强制 OPFS unavailable
  • OPFS 不可用时 Save Session、Restore Session、Stage Machine Files 使用 memory fallback只在当前页面生命周期内有效不声明持久化
  • UI diagnostics 显示 opfs unavailable、fallback mode 和原因,避免静默失败;
  • machine-file staging 在 memory fallback 下仍可支持不依赖持久 OPFS 的预览、运行、Three.js、DRO、G-code 加载和 full boundary audit
  • browser smoke 强制 OPFS unavailable验证 source 页面没有 uncaught error非 OPFS 工作流仍通过。

当前 M21 gate

opfs_unavailable_detected=1
opfs_fallback_current_page_lifecycle_only=1
opfs_dependent_actions_report_clear_fallback_message=1
non_opfs_workflows_still_pass=1
public_http_smoke_no_uncaught_exception=1

16.8 M22Host/native 边界可见性

M22-host-native-boundary-visibility

状态:

completed_with_host_native_boundary_ui_smoke

目标:

  • 在 Web simulation boundary 已 promoted 时,继续明确展示非浏览器仿真范围;
  • UI diagnostics 必须显示 hardwareDrive=falsehostRealtimeKernel=falseexternalUserMProcessReady=falsetoolDbProcessReady=false
  • browser smoke 同时验证 state 字段和 DOM 文本,避免把 Web simulation promoted 误读为真实硬件、host realtime、外部 user-M 或 tool DB runtime ready。

已完成:

  • gmoccapy info tabs 新增 Host/native 诊断行;
  • Host/native 显示 hardware drive、host realtime、external user-M、tool DB 四项 false 状态;
  • browser smoke 在 task/HAL full simulation boundary promoted 后验证四项 state 和 DOM 可见性。

当前 M22 gate

host_native_boundary_ui=ok
hardware_drive_false_visible=1
host_realtime_false_visible=1
external_user_m_false_visible=1
tool_db_false_visible=1

16.9 每轮必须执行的回归

常规回归:

npm --prefix web-rtcp-5axis-sim-plan/app run smoke:node
bash web-rtcp-5axis-sim-plan/tests/browser/verify_gmoccapy_shell_browser.sh
bash web-rtcp-5axis-sim-plan/tests/browser/verify_gmoccapy_dist_browser.sh

涉及 WASM core 时追加:

bash wasm-port/tests/wasm/node/verify_hal_runtime.sh
bash wasm-port/tests/wasm/node/verify_motion_hal_sync.sh
bash wasm-port/tests/wasm/node/verify_task_hal_wasm.sh
bash wasm-port/tests/wasm/node/verify_task_hal_sdk.sh
bash wasm-port/tests/native/probe_trt_task_hal_runtime.sh

涉及部署时追加:

npm --prefix web-rtcp-5axis-sim-plan/app run build
bash web-rtcp-5axis-sim-plan/tests/browser/verify_gmoccapy_dist_browser.sh

16.10 禁止事项

禁止修改用户个人备忘文件,除非用户明确要求
禁止把 fixture fallback 描述为 LinuxCNC semantic proof
禁止把 Web simulation task/HAL runtime 描述为真实硬件控制
禁止绕过 LinuxCNC interpreter/TP/task/HAL 输出去手写 G-code 运动语义
禁止默认启动 host-native LinuxCNC runtime 或抢占已有 linuxcncsvr/rtapi_app

14. M16 任务

M16-linuxcnc-tp-queue-timing-runtime

状态:

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-runtimerunProgram() / runMachineFileProgram() 后调用 TP SDKprogramExecution.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。

边界说明:

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

验证:

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 任务

M13-interpreter-worker-runtime

状态:

completed_with_browser_worker_smoke

已完成:

  • 新增 linuxcnc-interpreter-worker.jslinuxcnc-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 两条路径。

边界说明:

browserInterpreterExecutionContext=worker
nodeInterpreterExecutionContext=direct
interpreterBoundary=linuxcnc_interpreter_wasm_canonical_events
remapRuntimeReady=false
plannerRuntimeReady=false
fullLinuxCncProgramExecutionReady=false

14. M16 任务

M16-planner-task-hal-boundary-audit

状态:

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=1fiveaxis_remaps_ready=1fiveaxis_file_reached_exit=1
  • Node/browser smoke 验证 partial remap boundary ready同时继续禁止 full LinuxCNC program execution promoted。

边界说明:

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 任务

M17-linuxcnc-5axis-gcode-source-ingest

状态:

completed_with_real_linuxcnc_5axis_source_program_smoke

已完成:

  • machine-file staging 从 LinuxCNC source manifest 中追加 TRT demos/*.ngc,包括 boat-xyzac.ngcboat-xyzbc.ngcimpeller-7bl-xyzac.ngcxyzac_switchkins*.ngcxyzbc_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.ngcUI 加载真实源程序machine-file run 的 wasmProgramPath 指向该源文件。

边界说明:

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 任务

M14-opfs-machine-file-staging

状态:

completed_with_node_and_browser_opfs_smoke

已完成:

  • 新增 linuxcnc-machine-file-staging.js
  • 复用 wasm-port/runtime/sdk/src/sim-config-staging.jsplanSimConfigStaging(),为 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。

边界说明:

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 任务

M15-machine-file-backed-fiveaxis-remap-run

状态:

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=1fiveaxis_remaps_ready=1fiveaxis_file_reached_exit=1
  • gmoccapy diagnostics 显示 machine-file backed run 状态。

边界说明:

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