diff --git a/PROJECT_COMPLETION_TRACKER.md b/PROJECT_COMPLETION_TRACKER.md index 782e9b7..c09d7b2 100644 --- a/PROJECT_COMPLETION_TRACKER.md +++ b/PROJECT_COMPLETION_TRACKER.md @@ -9,7 +9,7 @@ turn-by-turn continuation notes and next-batch execution records. ## Current Status - Active continuation file: `text15.txt` -- Latest completed batch: real browser simulation page MVP +- Latest completed batch: real browser simulation test program selector - Latest relevant commit: use `git log -1 --oneline` after each committed batch - Working tree at tracker creation: clean - Required policy: LinuxCNC remains the only CNC semantic source @@ -40,7 +40,7 @@ The project is complete for the current scope when all of the following are true | --- | --- | --- | | LinuxCNC semantic boundary | Stable | JS/browser remains glue, staging, OPFS, WASM/browser boundary, docs, and tests only. | | Real browser simulation priority | Active first priority | Future batches should prioritize the real UI/browser CNC simulation page, with visible machine/session loading, G-code program state, LinuxCNC-backed interpreter execution, machine readiness/status panels, toolpath/preview rendering from LinuxCNC-produced output or validated runtime events, and browser smoke coverage. First entry point: `wasm-port/runtime/ui/simulation/index.html`; gate: `wasm-port/tests/browser/verify_real_simulation_browser.sh`. See `wasm-port/docs/real-browser-simulation-priority.md`. | -| Real browser simulation page | MVP active | `runtime/ui/simulation/index.html` loads in Chromium, runs a representative G-code program through LinuxCNC interpreter WASM, renders program lines, final axis readout, canonical event table, raw canonical output, and SVG toolpath preview. | +| Real browser simulation page | MVP active | `runtime/ui/simulation/index.html` loads in Chromium, exposes a selector for multiple LinuxCNC-backed test programs, runs them through interpreter WASM, renders program lines, final axis readout, canonical event table, raw canonical output, and SVG toolpath preview. Current program set covers square contour, Z pocket contour, incremental loop, G2/G3 arcs, and G81 drilling. | | Vendor/source guard | Stable | `verify_vendor_sync.sh` and standalone semantic guard are required every batch. | | Interpreter WASM smoke | Stable | `interp_wasm_node_smoke=ok`. | | Sim config inventory | Stable with skips | `executed=28`, `passed=28`, `skipped=131`, `unexpected_fail=0`; `docs/sim-configs-coverage-handoff.md` records the release-gate baseline. | @@ -82,6 +82,9 @@ Current first priority: - Build a real UI/browser CNC simulation page as quickly as possible. - First MVP exists at `wasm-port/runtime/ui/simulation/index.html`. +- The page now includes selectable test programs for square contour, Z pocket + contour, incremental loop, G2/G3 arcs, and G81 drilling, with browser smoke + coverage for each program. - The page must be visible and operator-oriented, not another release dashboard. - It should use OPFS/session persistence, staged G-code, and existing LinuxCNC-backed WASM SDK execution. diff --git a/text15.txt b/text15.txt index 219135e..d02ed5d 100644 --- a/text15.txt +++ b/text15.txt @@ -1630,3 +1630,56 @@ project_release_handoff_docs_node_smoke=ok - JS 只调用 LinuxCNC-backed WASM SDK,并把 LinuxCNC-produced canonical output 渲染成 program state、axis readout、motion table 和 SVG preview; - canonical output 中坐标字段的读取只用于 UI 渲染,不作为 CNC 解释或运动规划来源。 + +七十九、2026-06-16 继续执行记录:real browser simulation 多测试程序 + +本批继续围绕真实 browser CNC simulation page 推进,把页面从单一内置程序扩展为可选择 +多组 LinuxCNC-backed 测试程序的仿真入口。 + +本批新增实质能力: + +- `runtime/ui/simulation/simulation-app.js` 新增 `SIMULATION_TEST_PROGRAMS`; +- 当前测试程序覆盖: + - square contour; + - pocket with Z moves; + - incremental loop; + - G2/G3 arc path; + - G81 drill pattern; +- `runtime/ui/simulation/index.html` 新增程序选择器和 Run 按钮; +- 页面 API 新增: + - `linuxCncRealSimulationApi.getPrograms()`; + - `linuxCncRealSimulationApi.runProgramById(programId)`; + - `linuxCncRealSimulationApi.getState()`; +- browser smoke 现在会逐个运行所有测试程序,验证每个程序都经由 LinuxCNC WASM 执行, + DOM program rows、motion rows、canonical output、toolpath polyline 和 motion types 与 + LinuxCNC-produced output 保持一致; +- 增强 canonical motion 渲染解析:`ARC_FEED` 使用 LinuxCNC canonical arc endpoint 字段映射 + 到当前 active plane 的坐标轴,只作为 UI toolpath 渲染输入; +- 新增 UI Node smoke: + - `tests/ui/node/verify_real_simulation_programs.mjs`; + - `tests/ui/node/verify_real_simulation_programs.sh`; +- `tests/ui/node/verify_ui_node_smokes.sh` 接入该 smoke; +- README、real-browser priority docs、PROJECT_COMPLETION_TRACKER 同步记录多测试程序能力。 + +本批新增/更新可执行验证: + +```bash +wasm-port/tests/ui/node/verify_real_simulation_programs.sh +wasm-port/tests/ui/node/verify_ui_node_smokes.sh +SKIP_INTERP_BUILD=1 wasm-port/tests/browser/verify_real_simulation_browser.sh +``` + +关键通过输出: + +```text +real_simulation_programs_node_smoke=ok +ui_node_smokes=ok +browser_real_simulation_page_smoke=ok +``` + +本批仍保持 LinuxCNC 语义边界: + +- 新增测试程序均通过 `createLinuxCncInterpSdk()` / `interp.runProgram()` 执行; +- JS 没有解释 G-code,也没有实现 planner、kinematics、tool、parameter、remap 语义; +- JS 只保存测试程序文本、调用 LinuxCNC WASM、解析 LinuxCNC-produced canonical output 以渲染 + UI 状态和刀路终点。 diff --git a/wasm-port/README.md b/wasm-port/README.md index 9d5a2e8..b1b88a0 100644 --- a/wasm-port/README.md +++ b/wasm-port/README.md @@ -17,7 +17,9 @@ LinuxCNC-backed interpreter execution, and browser smoke coverage. This does not relax the LinuxCNC semantic boundary; browser code still must not implement G-code, tool, parameter, kinematics, remap, or planner semantics. The first real simulation entry point is `runtime/ui/simulation/index.html`, -validated by `tests/browser/verify_real_simulation_browser.sh`. +validated by `tests/browser/verify_real_simulation_browser.sh`. It now exposes +multiple LinuxCNC-backed test programs from the page selector: square contour, +Z pocket contour, incremental loop, G2/G3 arc path, and G81 drill pattern. The project release gate for the current scope is: @@ -46,6 +48,7 @@ opfs_session_docs_node_smoke=ok sim_configs_coverage_docs_node_smoke=ok host_runtime_boundary_docs_node_smoke=ok real_browser_simulation_priority_docs_node_smoke=ok +real_simulation_programs_node_smoke=ok sdk_surface_node_smoke=ok host_wasm_opfs_browser_smokes=ok project_release_gate=ok diff --git a/wasm-port/docs/real-browser-simulation-priority.md b/wasm-port/docs/real-browser-simulation-priority.md index ce41ccf..b12f856 100644 --- a/wasm-port/docs/real-browser-simulation-priority.md +++ b/wasm-port/docs/real-browser-simulation-priority.md @@ -34,6 +34,13 @@ Its browser gate is: wasm-port/tests/browser/verify_real_simulation_browser.sh ``` +The current page includes a real LinuxCNC-backed test-program selector. The +browser gate runs each listed program through the WASM interpreter and verifies +that rendered program rows, canonical output, motion rows, toolpath points, and +declared motion types stay aligned with LinuxCNC-produced output. The first +program set covers linear contouring, Z moves, incremental mode, G2/G3 arcs, +and G81 drilling. + ## Batch Priority Unless a user explicitly changes priority, choose work in this order: @@ -73,6 +80,7 @@ The priority is enforced by: ```bash wasm-port/tests/docs/node/verify_real_browser_simulation_priority_docs.sh +wasm-port/tests/ui/node/verify_real_simulation_programs.sh wasm-port/tests/host/verify_host_smokes.sh wasm-port/tests/host/verify_project_release_gate.sh ``` diff --git a/wasm-port/runtime/ui/simulation/index.html b/wasm-port/runtime/ui/simulation/index.html index 643101e..c03fcee 100644 --- a/wasm-port/runtime/ui/simulation/index.html +++ b/wasm-port/runtime/ui/simulation/index.html @@ -35,7 +35,7 @@ background: var(--surface); padding: 14px 20px; display: grid; - grid-template-columns: minmax(0, 1fr) auto; + grid-template-columns: minmax(0, 1fr) minmax(240px, auto) auto; gap: 16px; align-items: center; } @@ -63,6 +63,38 @@ color: var(--green); font-weight: 700; } + .program-controls { + display: flex; + gap: 8px; + align-items: center; + justify-content: end; + min-width: 0; + } + select, button { + border: 1px solid var(--line); + border-radius: 6px; + background: #fbfcfd; + color: var(--text); + font: 13px/1.2 "Segoe UI", sans-serif; + min-height: 32px; + } + select { + min-width: 220px; + max-width: 320px; + padding: 5px 8px; + } + button { + padding: 6px 12px; + font-weight: 650; + cursor: pointer; + } + button:hover { + border-color: var(--blue); + } + button:disabled { + cursor: wait; + opacity: 0.6; + } .workspace { display: grid; grid-template-columns: minmax(280px, 0.75fr) minmax(420px, 1.35fr) minmax(300px, 0.9fr); @@ -238,6 +270,8 @@ } @media (max-width: 560px) { header { grid-template-columns: 1fr; } + .program-controls { justify-content: stretch; } + .program-controls select { min-width: 0; width: 100%; } .status-strip { justify-content: start; } .axis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } dl { grid-template-columns: 1fr; } @@ -248,6 +282,10 @@

LinuxCNC Browser Simulation

+
+ + +
Simulation loading LinuxCNC interpreter WASM @@ -257,7 +295,7 @@

Program

-

Executed through the LinuxCNC-backed WASM interpreter.

+

Executed through the LinuxCNC-backed WASM interpreter.

@@ -319,14 +357,51 @@