From 1f6d5a8e8bfa3f9527847f7114d6864e10c4d24f Mon Sep 17 00:00:00 2001 From: wangdequan Date: Mon, 8 Jun 2026 03:21:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E5=BB=BA=E8=AE=AE=EF=BC=8C=E7=BB=A7?= =?UTF-8?q?=E7=BB=AD=E5=AE=8C=E6=88=90=E5=90=8E=E7=BB=AD=E5=B7=A5=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 结论:已新增 host/WASM/browser 聚合 smoke 验证入口,一次构建 INI WASM 后串行覆盖 Node WASM、OPFS mock 和 Chromium browser smoke,并同步更新验证与漂移文档。 --- wasm-port/docs/compatibility-validation.md | 10 ++++++++++ wasm-port/docs/drift-report.md | 3 +++ wasm-port/docs/source-reuse-map.md | 2 +- wasm-port/tests/browser/verify_ini_panel_browser.sh | 4 +++- wasm-port/tests/host/verify_host_smokes.sh | 11 +++++++++++ wasm-port/tests/wasm/node/verify_ini_wasm.sh | 4 +++- 6 files changed, 31 insertions(+), 3 deletions(-) create mode 100755 wasm-port/tests/host/verify_host_smokes.sh diff --git a/wasm-port/docs/compatibility-validation.md b/wasm-port/docs/compatibility-validation.md index 6c05fd7..3864499 100644 --- a/wasm-port/docs/compatibility-validation.md +++ b/wasm-port/docs/compatibility-validation.md @@ -30,6 +30,12 @@ The current browser smoke validation command is: wasm-port/tests/browser/verify_ini_panel_browser.sh ``` +The current aggregate host/WASM/browser smoke command is: + +```bash +wasm-port/tests/host/verify_host_smokes.sh +``` + ## Validation Chain The native validation script runs these checks in order: @@ -68,6 +74,9 @@ headless against a test page that imports the JS SDK, loads the INI WASM module, queries vendored LinuxCNC INI parsing through the SDK, and performs an OPFS text-file round trip. +The aggregate host smoke script builds the INI WASM artifact once, then runs +the Node WASM smoke, the Node OPFS mock smoke, and the Chromium browser smoke. + ## Source Coverage Every `.c` and `.cc` entry in `tools/source-manifest.txt` must have a @@ -117,6 +126,7 @@ 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/opfs/node/verify_file_service.sh` | Validates the host-owned OPFS text-file adapter used by the browser INI panel without moving file persistence into the WASM core. | | `tests/browser/verify_ini_panel_browser.sh` | Validates the INI SDK, WASM module loading, and OPFS text-file round trip in a real browser runtime. | +| `tests/host/verify_host_smokes.sh` | Runs the current host-side Node, WASM, OPFS, and browser smoke validation with a single INI WASM build. | ## Fixture Coverage diff --git a/wasm-port/docs/drift-report.md b/wasm-port/docs/drift-report.md index 1adbafb..d74dc90 100644 --- a/wasm-port/docs/drift-report.md +++ b/wasm-port/docs/drift-report.md @@ -62,6 +62,9 @@ semantic rewrites: vendored LinuxCNC `inifile.cc`. - OPFS validation covers a Node mock of the file-service adapter and a Chromium localhost round trip for INI text-file persistence. +- Host-side smoke validation is aggregated by + `tests/host/verify_host_smokes.sh` so Node, WASM, OPFS, and browser checks + run from one command. - Identity/trivial, `5axiskins`, TRT `xyzac`/`xyzbc`, delta, SCARA, PUMA, serial, hexapod, pentapod, and related kinematics sources now have native source-probe coverage. diff --git a/wasm-port/docs/source-reuse-map.md b/wasm-port/docs/source-reuse-map.md index 9879781..987a0f2 100644 --- a/wasm-port/docs/source-reuse-map.md +++ b/wasm-port/docs/source-reuse-map.md @@ -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; `runtime/sdk/src/linuxcnc-ini.js` only wraps the exported WASM C ABI | Vendor byte sync, `linuxcnc_ini_probe`, `linuxcnc_inifile_source_probe`, `tests/wasm/node/verify_ini_wasm.sh`, `tests/browser/verify_ini_panel_browser.sh` | +| 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; `runtime/sdk/src/linuxcnc-ini.js` only wraps the exported WASM C ABI | Vendor byte sync, `linuxcnc_ini_probe`, `linuxcnc_inifile_source_probe`, `tests/wasm/node/verify_ini_wasm.sh`, `tests/browser/verify_ini_panel_browser.sh`, `tests/host/verify_host_smokes.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` | diff --git a/wasm-port/tests/browser/verify_ini_panel_browser.sh b/wasm-port/tests/browser/verify_ini_panel_browser.sh index 0f19a62..99a9b8a 100755 --- a/wasm-port/tests/browser/verify_ini_panel_browser.sh +++ b/wasm-port/tests/browser/verify_ini_panel_browser.sh @@ -9,7 +9,9 @@ if [[ -z "$CHROMIUM" ]]; then exit 1 fi -"$ROOT_DIR/tools/build_ini_panel.sh" +if [[ "${SKIP_INI_BUILD:-0}" != "1" ]]; then + "$ROOT_DIR/tools/build_ini_panel.sh" +fi TMP_DIR="$(mktemp -d)" PORT_FILE="$TMP_DIR/port" diff --git a/wasm-port/tests/host/verify_host_smokes.sh b/wasm-port/tests/host/verify_host_smokes.sh new file mode 100755 index 0000000..485535b --- /dev/null +++ b/wasm-port/tests/host/verify_host_smokes.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT_DIR="$(cd "$(dirname "$0")/../.." && pwd)" + +"$ROOT_DIR/tools/build_ini_panel.sh" +SKIP_INI_BUILD=1 "$ROOT_DIR/tests/wasm/node/verify_ini_wasm.sh" +"$ROOT_DIR/tests/opfs/node/verify_file_service.sh" +SKIP_INI_BUILD=1 "$ROOT_DIR/tests/browser/verify_ini_panel_browser.sh" + +echo "host_wasm_opfs_browser_smokes=ok" diff --git a/wasm-port/tests/wasm/node/verify_ini_wasm.sh b/wasm-port/tests/wasm/node/verify_ini_wasm.sh index b2508d4..57e283a 100755 --- a/wasm-port/tests/wasm/node/verify_ini_wasm.sh +++ b/wasm-port/tests/wasm/node/verify_ini_wasm.sh @@ -3,5 +3,7 @@ set -euo pipefail ROOT_DIR="$(cd "$(dirname "$0")/../../.." && pwd)" -"$ROOT_DIR/tools/build_ini_panel.sh" +if [[ "${SKIP_INI_BUILD:-0}" != "1" ]]; then + "$ROOT_DIR/tools/build_ini_panel.sh" +fi node "$ROOT_DIR/tests/wasm/node/verify_ini_wasm.mjs"