按建议,继续完成后续工作

结论:已新增 INI WASM Node smoke 验证,确认 vendored LinuxCNC inifile.cc 构建出的 WASM 模块可通过导出 C ABI 查询 INI 内容,并同步更新兼容性与漂移文档。
This commit is contained in:
2026-06-08 00:15:50 +08:00
parent 0b70bb0aa8
commit 0a8bf7d5e2
8 changed files with 116 additions and 9 deletions

View File

@@ -6,12 +6,18 @@ This document records how the standalone LinuxCNC WASM port currently proves
that migrated behavior remains tied to LinuxCNC source code and fixture
semantics.
The primary validation command is:
The primary native validation command is:
```bash
wasm-port/tests/native/verify_native_probes.sh
```
The current WASM smoke validation command is:
```bash
wasm-port/tests/wasm/node/verify_ini_wasm.sh
```
## Validation Chain
The native validation script runs these checks in order:
@@ -35,6 +41,11 @@ The native validation script runs these checks in order:
Checks probe exit codes, source-probe coverage, harness stdout, canonical
fixture events, and expected error behavior.
The WASM INI smoke script builds `runtime/ui/ini-panel/linuxcnc_ini.js` and
`linuxcnc_ini.wasm` from vendored LinuxCNC `inifile.cc`, then loads that
module in Node and verifies `lcini_get_string()` against an in-memory INI file
written to the Emscripten filesystem.
## Source Coverage
Every `.c` and `.cc` entry in `tools/source-manifest.txt` must have a
@@ -77,6 +88,12 @@ The validation fails if:
| `linuxcnc_genhex_kinematics_probe` | Validates vendored LinuxCNC generic hexapod inverse/forward behavior, including the switchkins iterative-forward warmup path. |
| `linuxcnc_pentakins_kinematics_probe` | Validates vendored LinuxCNC pentapod inverse/forward pose round-trip behavior. |
## Current WASM Harnesses
| Harness | Purpose |
| --- | --- |
| `tests/wasm/node/verify_ini_wasm.sh` | Validates the browser-facing INI WASM module can be built from vendored LinuxCNC `inifile.cc`, loaded in Node, and queried through the exported C ABI. |
## Fixture Coverage
Positive G-code fixtures currently cover:
@@ -118,8 +135,9 @@ Negative fixtures currently cover:
## Validation Boundaries
Current validation is native-only. WASM, browser, SDK, OPFS, and full
machine-session validation remain future work.
Current full-core validation is native-only. WASM validation is limited to the
INI parser smoke harness. Browser, SDK, OPFS, and full machine-session
validation remain future work.
The current fixture expectations validate standalone behavior against both the
vendored LinuxCNC source path and an upstream `rs274` side-by-side baseline for

View File

@@ -56,7 +56,8 @@ semantic rewrites:
## Known Gaps
- No browser/WASM parity tests yet.
- No browser/full-core WASM parity tests yet. The INI parser now has a Node
WASM smoke harness against vendored LinuxCNC `inifile.cc`.
- No JS SDK validation yet.
- No OPFS persistence validation yet.
- Identity/trivial, `5axiskins`, TRT `xyzac`/`xyzbc`, delta, SCARA, PUMA,

View File

@@ -31,7 +31,7 @@ Current validation is intentionally mechanical:
| Capability | LinuxCNC source files | Port classification | Standalone boundary | Current validation |
| --- | --- | --- | --- | --- |
| INI parsing | `src/emc/ini/inifile.cc`, `inifile.h`, `inifile.hh` | Copy unchanged | Native file IO remains LinuxCNC-style in the vendored parser; browser OPFS integration remains outside this layer | Vendor byte sync, `linuxcnc_ini_probe`, `linuxcnc_inifile_source_probe` |
| INI parsing | `src/emc/ini/inifile.cc`, `inifile.h`, `inifile.hh` | Copy unchanged | Native file IO remains LinuxCNC-style in the vendored parser; browser OPFS integration remains outside this layer | Vendor byte sync, `linuxcnc_ini_probe`, `linuxcnc_inifile_source_probe`, `tests/wasm/node/verify_ini_wasm.sh` |
| RTAPI compatibility headers | `src/rtapi/rtapi_*.h` in the manifest | Copy unchanged plus standalone shim include path | `runtime/core/shims/rtapi.h` supplies the minimal standalone RTAPI surface needed by vendored code | Vendor byte sync, compile coverage through dependent source probes |
| Canon/NML-facing interpreter types | `src/emc/nml_intf/canon*.hh`, `emctool.h`, `interp_return.hh`, `motion_types.h`, `emcpose.*`, `emcpos.h`, `debugflags.h`, `src/emc/linuxcnc.h` | Copy unchanged plus narrow standalone status shim | NML transport is not ported; `runtime/core/shims/nml_intf/emc.hh` exposes only the `emcStatus` machine-units status edge currently needed by vendored interpreter conversion and initialization code | Vendor byte sync, dependent source probes, `linuxcnc_emc_status_probe`, `linuxcnc_tp_api_probe`, interpreter harnesses |
| Motion state headers | `src/emc/motion/state_tag.h`, `emcmotcfg.h`, `simple_tp.h`, `motion.h`, `mot_priv.h`, `axis.h` | Copy unchanged | Realtime motion process is not ported; standalone probes seed the small motion status/config state required by TP calls | Vendor byte sync, `linuxcnc_tp_api_probe` |
@@ -69,7 +69,7 @@ Current validation is intentionally mechanical:
- Cutter compensation positive motion and negative interpreter paths are
fixture-covered through vendored `interp_convert.cc` and `interp_queue.cc`.
- Browser/WASM C ABI and JS SDK layers are not yet built for the full
interpreter/planner core.
interpreter/planner core. The INI parser has a Node WASM smoke harness.
- OPFS persistence is not yet connected to INI, tool table, parameter file, or
G-code program loading.
- Native LinuxCNC GUI code remains out of scope for implementation.