按规划继续工作
结论:接入 vendored LinuxCNC tooldata_common.cc 负责刀具表解析与保存,WASM/SDK/OPFS/UI 仅做运行时边界搬运;native、WASM、OPFS 和浏览器 smoke 验证已通过。
This commit is contained in:
@@ -173,9 +173,9 @@ The validation fails if:
|
||||
| --- | --- |
|
||||
| `tests/wasm/node/verify_ini_wasm.sh` | Validates the browser-facing INI WASM module can be built from vendored LinuxCNC `inifile.cc`, loaded through the JS SDK in Node, and queried through the exported C ABI. |
|
||||
| `tests/wasm/node/verify_interp_wasm.sh` | Validates the initial interpreter-core WASM module can be built from vendored LinuxCNC interpreter source, loaded through the interpreter JS SDK, run the first fixture group through `Interp::execute()` and selected file fixtures through `Interp::open()`/`read()`/`execute()`, match the native canonical event plus required state readback fixtures, and run parameter-file restore/save through vendored LinuxCNC `Interp::restore_parameters()` and `Interp::save_parameters()`. |
|
||||
| `tests/opfs/node/verify_file_service.sh` | Validates the host-owned OPFS text-file adapter, path model, session snapshot store, machine file store, G-code text store, and OPFS-to-WASM parameter-file bridge without moving file persistence or parameter semantics into the WASM core. |
|
||||
| `tests/browser/verify_ini_panel_browser.sh` | Validates the INI SDK, WASM module loading, OPFS text-file round trip, generic session snapshot round trip, machine file text round trip, and G-code text round trip in a real browser runtime. |
|
||||
| `tests/browser/verify_interp_browser.sh` | Validates the interpreter-core WASM module loads through the interpreter JS SDK in a real browser runtime and runs selected positive and negative canonical fixtures through vendored LinuxCNC `Interp::execute()` plus `Interp::open()`/`read()`/`execute()` via the exported C ABI, including OPFS-backed parameter-file restore/save through vendored LinuxCNC source. |
|
||||
| `tests/opfs/node/verify_file_service.sh` | Validates the host-owned OPFS text-file adapter, path model, session snapshot store, machine file store, G-code text store, OPFS-to-WASM parameter/tool-table bridges, and grouped machine-session loading without moving file persistence, parameter semantics, or tool-table semantics into the WASM core. |
|
||||
| `tests/browser/verify_ini_panel_browser.sh` | Validates the INI SDK, INI/interpreter WASM module loading, OPFS text-file round trip, generic session snapshot round trip, machine file text round trip, G-code text round trip, and the INI panel UI's machine-session load, G-code run, and canonical-event display paths in a real browser runtime. |
|
||||
| `tests/browser/verify_interp_browser.sh` | Validates the interpreter-core WASM module loads through the interpreter JS SDK in a real browser runtime and runs selected positive and negative canonical fixtures through vendored LinuxCNC `Interp::execute()` plus `Interp::open()`/`read()`/`execute()` via the exported C ABI, including OPFS-backed parameter-file restore/save and tool-table load/save through vendored LinuxCNC source. |
|
||||
| `tests/host/verify_host_smokes.sh` | Runs the current host-side Node, WASM interpreter-core, OPFS, and browser smoke validation with shared WASM builds. |
|
||||
|
||||
## Fixture Coverage
|
||||
@@ -242,12 +242,18 @@ The Node WASM interpreter smoke also covers LinuxCNC parameter-file
|
||||
restore/save behavior through the exported C ABI, including out-of-order file
|
||||
rejection, missing-file success, required numeric parameter writeback, removal
|
||||
of named-parameter-only lines from saved output, and the `.bak` backup produced
|
||||
by vendored `save_parameters()`.
|
||||
by vendored `save_parameters()`. It also covers LinuxCNC tool-table
|
||||
load/save behavior through vendored `tooldata_common.cc`, with the SDK only
|
||||
copying text into the Emscripten filesystem and calling the exported C ABI.
|
||||
OPFS validation covers the JavaScript host-boundary adapter, the INI browser
|
||||
smoke harness, and a browser interpreter smoke that copies OPFS-backed
|
||||
parameter text through the SDK into vendored LinuxCNC parameter-file
|
||||
restore/save. Full browser coverage, full SDK coverage, and full
|
||||
machine-session validation remain future work.
|
||||
smoke harness, the INI panel UI's machine-session load and G-code run buttons,
|
||||
the raw canonical-event display fed directly by LinuxCNC interpreter WASM
|
||||
output, the Node parameter/tool-table bridges that copy OPFS text through the
|
||||
SDK into vendored LinuxCNC file APIs, the Node machine-session bridge that
|
||||
groups INI, parameter, and tool-table loading, and a browser interpreter smoke
|
||||
that uses the same session bridge before saving OPFS-backed parameter and
|
||||
tool-table text through vendored LinuxCNC file APIs. Full browser coverage,
|
||||
full SDK coverage, and richer machine-state validation remain future work.
|
||||
|
||||
## WASM/Browser Fixture Matrix
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ semantic rewrites:
|
||||
| Canonical output | Canonical calls are captured as test events instead of driving hardware. |
|
||||
| Feed-rate state | `SET_FEED_RATE` updates standalone canonical runtime state so vendored `convert_length_units()` can read it back through `GET_EXTERNAL_FEED_RATE()` during G20/G21 changes. |
|
||||
| Tool-data reload | LinuxCNC `RELOAD_TOOLDATA` is captured as a canonical test event; browser/native tool-table reload plumbing remains a future host/runtime adapter. |
|
||||
| Tool table storage | Vendored LinuxCNC `tooldata_common.cc` owns tool-table parsing and formatting; the standalone boundary only supplies the in-memory `tooldata_get()`/`tooldata_put()` callbacks and exposes load/save through the WASM C ABI. |
|
||||
| Tool slot status | Standalone tool adapter state supplies `GET_EXTERNAL_TOOL_SLOT()` and `GET_EXTERNAL_SELECTED_TOOL_SLOT()` for vendored `Interp::synch()`; `linuxcnc_interp_init_harness` guards current/selected slot synchronization. |
|
||||
| Interpreter state tags | LinuxCNC `UPDATE_TAG` callbacks are captured from the state tags packed by vendored interpreter code; standalone code does not derive modal state. |
|
||||
| Rotary indexer lock state | LinuxCNC `UNLOCK_ROTARY` and `LOCK_ROTARY` callbacks are captured from the vendored single-axis indexer path; standalone code does not implement rotary-indexing semantics. |
|
||||
@@ -43,7 +44,7 @@ semantic rewrites:
|
||||
| Kinematics component lifecycle | Kinematics modules are initialized through LinuxCNC module entry points where native runtime probes exist, while HAL component init/ready/exit, HAL pin allocation, and RTAPI module metadata are handled by standalone shims. |
|
||||
| Go math C/C++ linkage | `genserkins` runtime probing compiles vendored `gomath.c` through a narrow C++ wrapper so LinuxCNC `genserfuncs.c` can link to the upstream Go math symbols without editing vendored source. |
|
||||
| Switchkins iterative forward | `genhexkins` runtime probing follows LinuxCNC switchkins iterative-forward behavior, including the first-call warmup path before asserting roundtrip convergence. |
|
||||
| Browser storage | OPFS remains outside the native core; `runtime/opfs/file-service.js` owns browser text-file persistence, `runtime/opfs/path-model.js` owns host-side storage paths for INI, tool table, parameter, G-code, preview-cache, and session-snapshot content, `runtime/opfs/snapshot-store.js` owns generic JSON session snapshot persistence, `runtime/opfs/machine-file-store.js` owns pure-text machine-file and G-code persistence, and `runtime/opfs/linuxcnc-parameter-bridge.js` only copies parameter files between OPFS text storage and the LinuxCNC-backed WASM parameter-file ABI. |
|
||||
| Browser storage | OPFS remains outside the native core; `runtime/opfs/file-service.js` owns browser text-file persistence, `runtime/opfs/path-model.js` owns host-side storage paths for INI, tool table, parameter, G-code, preview-cache, and session-snapshot content, `runtime/opfs/snapshot-store.js` owns generic JSON session snapshot persistence, `runtime/opfs/machine-file-store.js` owns pure-text machine-file and G-code persistence, `runtime/opfs/linuxcnc-parameter-bridge.js` only copies parameter files between OPFS text storage and the LinuxCNC-backed WASM parameter-file ABI, `runtime/opfs/linuxcnc-tool-table-bridge.js` only copies tool tables between OPFS text storage and the LinuxCNC-backed WASM tool-table ABI, and `runtime/opfs/linuxcnc-machine-session-bridge.js` groups INI, parameter, and tool-table loading without interpreting their CNC semantics. |
|
||||
|
||||
## Enforced Non-Drift Rules
|
||||
|
||||
@@ -63,11 +64,13 @@ semantic rewrites:
|
||||
- JS SDK validation now covers the INI WASM wrapper around vendored LinuxCNC
|
||||
`inifile.cc` and the interpreter-core SDK wrapper around the existing
|
||||
exported C ABI. The interpreter SDK only manages strings, Emscripten file
|
||||
writes, and calls into vendored LinuxCNC execution paths.
|
||||
writes, and calls into vendored LinuxCNC execution paths, including
|
||||
parameter-file restore/save and tool-table load/save.
|
||||
- OPFS validation covers a Node mock of the file-service adapter, the
|
||||
host-side path model, generic session snapshot storage, pure-text machine
|
||||
file and G-code storage, and a Chromium localhost round trip for those
|
||||
persistence paths.
|
||||
file and G-code storage, parameter/tool-table bridge copying into the
|
||||
interpreter SDK filesystem, grouped machine-session loading, and a Chromium
|
||||
localhost round trip for those persistence paths.
|
||||
- Host-side smoke validation is aggregated by
|
||||
`tests/host/verify_host_smokes.sh` so Node, WASM, OPFS, and browser checks
|
||||
run from one command.
|
||||
|
||||
@@ -47,13 +47,14 @@ Current validation is intentionally mechanical:
|
||||
| RS274 interpreter state and parser | `src/emc/rs274ngc/modal_state.*`, `interp_internal.*`, `interp_read.cc`, `interp_check.cc`, `interp_execute.cc`, `interp_find.cc`, `interp_array.cc`, `interp_queue.*`, `rs274ngc*`, `units.h` | Copy unchanged | Python/remap/runtime edges are isolated in standalone wrappers and shims; parser and execution logic remain LinuxCNC source | Vendor byte sync, per-file source probes, interpreter harness fixtures |
|
||||
| RS274 conversion semantics | `src/emc/rs274ngc/interp_convert.cc`, `interp_arc.cc`, `interp_inverse.cc`, `interp_cycles.cc`, `interp_g7x.cc`, `interp_o_word.cc`, `interp_write.cc` | Copy unchanged | Canonical calls are captured by standalone event sink functions; conversion behavior stays in vendored LinuxCNC files; feed-rate state is read back through the canonical runtime boundary during length-unit conversion | Vendor byte sync, per-file source probes, canonical fixture suite, no standalone `Interp::convert_g()` guard |
|
||||
| Named parameters and tool slot status | `src/emc/rs274ngc/interp_namedparams.cc`, related interpreter headers | Copy unchanged | `_ini[...]` and `_hal[...]` resolve through standalone INI/HAL adapters while lookup order stays LinuxCNC-derived; current/selected tool slot reads for vendored `Interp::synch()` come from the standalone tool adapter | Vendor byte sync, source probe, `linuxcnc_namedparam_harness`, `linuxcnc_interp_init_harness` |
|
||||
| Tool table parsing and formatting | `src/emc/tooldata/tooldata_common.cc` | Copy unchanged plus standalone storage callbacks | Native file parsing/formatting stays in vendored LinuxCNC source; the standalone tool adapter supplies `tooldata_get()`/`tooldata_put()` storage and index lookup, while OPFS remains a host-side persistence boundary | Vendor byte sync, `linuxcnc_tooldata_common_source_probe`, `tests/wasm/node/verify_interp_wasm.sh` load/save tool-table assertions |
|
||||
| Dynamic interpreter base | `src/emc/rs274ngc/interp_base.*` | Copy unchanged | `interp_base.cc` source probe uses standalone `EMC2_HOME` compile-time path boundary for LinuxCNC dynamic interpreter lookup | Vendor byte sync, `linuxcnc_interp_base_source_probe` |
|
||||
|
||||
## Dependency Matrix
|
||||
|
||||
| Dependency | LinuxCNC files that expose it | Standalone treatment |
|
||||
| --- | --- | --- |
|
||||
| Native file IO | `inifile.cc`, `rs274ngc_pre.cc`, parameter file paths | Allowed in native probes; the interpreter WASM C ABI validates parameter-file restore/save by calling vendored `Interp::restore_parameters()` and `Interp::save_parameters()` against Emscripten filesystem paths; browser OPFS remains a host-side adapter under `runtime/opfs/`, with path ownership in `runtime/opfs/path-model.js`, generic snapshot persistence in `runtime/opfs/snapshot-store.js`, pure-text machine-file persistence in `runtime/opfs/machine-file-store.js`, and OPFS-to-WASM parameter-file copying in `runtime/opfs/linuxcnc-parameter-bridge.js` |
|
||||
| Native file IO | `inifile.cc`, `rs274ngc_pre.cc`, `tooldata_common.cc`, parameter file paths, tool table paths | Allowed in native probes; the interpreter WASM C ABI validates parameter-file restore/save by calling vendored `Interp::restore_parameters()` and `Interp::save_parameters()` and tool-table load/save by calling vendored `tooldata_load()` and `tooldata_save()` against Emscripten filesystem paths; browser OPFS remains a host-side adapter under `runtime/opfs/`, with path ownership in `runtime/opfs/path-model.js`, generic snapshot persistence in `runtime/opfs/snapshot-store.js`, pure-text machine-file persistence in `runtime/opfs/machine-file-store.js`, OPFS-to-WASM parameter-file copying in `runtime/opfs/linuxcnc-parameter-bridge.js`, OPFS-to-WASM tool-table copying in `runtime/opfs/linuxcnc-tool-table-bridge.js`, and grouped INI/parameter/tool-table session loading in `runtime/opfs/linuxcnc-machine-session-bridge.js` |
|
||||
| RTAPI | `rtapi_*.h`, TP, posemath, motion headers | Minimal standalone shim in `runtime/core/shims/rtapi.h` |
|
||||
| NML transport | `emc.hh`, motion/NML type headers | Transport is not ported; only the status/type edges needed by vendored compute code are exposed through standalone shims and probes |
|
||||
| HAL runtime | named parameter lookup, kinematics component lifecycle, and runtime status edges | Standalone HAL adapter under `runtime/core/linuxcnc_wrap/` |
|
||||
@@ -74,8 +75,9 @@ Current validation is intentionally mechanical:
|
||||
the current interpreter-core smoke scope. The interpreter SDK is a thin
|
||||
allocation, filesystem, and C ABI wrapper over vendored LinuxCNC execution
|
||||
paths, including parameter-file restore/save through vendored
|
||||
`rs274ngc_pre.cc`; it does not define G-code or parameter semantics. Full
|
||||
planner/session SDK coverage remains future work.
|
||||
`rs274ngc_pre.cc` and tool-table load/save through vendored
|
||||
`tooldata_common.cc`; it does not define G-code, parameter, or tool-table
|
||||
semantics. Full planner/session SDK coverage remains future work.
|
||||
- OPFS persistence is connected to the INI panel through the host-side
|
||||
`runtime/opfs/file-service.js` adapter. `runtime/opfs/path-model.js` now
|
||||
defines paths for INI, tool table, parameter file, G-code program,
|
||||
@@ -85,6 +87,10 @@ Current validation is intentionally mechanical:
|
||||
table, parameter file, and G-code program content.
|
||||
`runtime/opfs/linuxcnc-parameter-bridge.js` copies OPFS-backed parameter
|
||||
files into the interpreter SDK filesystem and writes back the LinuxCNC-saved
|
||||
parameter file plus backup; UI-level session plumbing, semantic loading for
|
||||
tool tables, and machine-state restoration remain future work.
|
||||
parameter file plus backup. `runtime/opfs/linuxcnc-tool-table-bridge.js`
|
||||
copies OPFS-backed tool tables into the interpreter SDK filesystem and writes
|
||||
back the LinuxCNC-saved tool table.
|
||||
`runtime/opfs/linuxcnc-machine-session-bridge.js` groups INI, parameter, and
|
||||
tool-table loading into one host-side session load boundary. Full
|
||||
machine-state restoration remains future work.
|
||||
- Native LinuxCNC GUI code remains out of scope for implementation.
|
||||
|
||||
Reference in New Issue
Block a user