参考所有分组,完成尽量多的内容。禁止顺手扩功能 smoke:锁定WASM smoke源码映射结论

This commit is contained in:
cnc
2026-06-04 16:26:51 +08:00
parent cb22ecd8ef
commit 7b171c605b
5 changed files with 216 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
# LinuxCNC WASM smoke source map
This map records the source basis and boundaries for the Node and browser WASM
smoke wrappers. It is a smoke-test guard only; it must not add CNC behavior,
must not expand the temporary smoke parser, and must keep browser filesystem
persistence OPFS-only. In browser contexts, browser filesystem persistence
OPFS-only is the required boundary.
## LinuxCNC Source Basis
- `src/emc/rs274ngc/rs274ngc_pre.cc` provides `Interp::ini_load()`,
`Interp::restore_parameters()`, `Interp::save_parameters()`, and `read_text()`
behavior exercised by Node/browser bridge tests.
- `src/emc/rs274ngc/interp_convert.cc` provides `convert_m()` coverage for
M66 waits and M68 analog output side effects used by generated remap cases.
- `src/emc/nml_intf/canon.hh` declares the `WAIT()` and
`SET_AUX_OUTPUT_VALUE()` canon entry points surfaced through the event bridge.
- `src/emc/kinematics/5axiskins.c`, `src/emc/kinematics/trtfuncs.c`,
`src/emc/kinematics/xyzac-trt-kins.c`,
`src/emc/kinematics/xyzbc-trt-kins.c`, and
`src/emc/kinematics/userkfuncs.c` provide the RTCP/kinematics inverse paths
covered by WASM smoke tests.
- `configs/sim/**.ini` files and `remap_subs/{428,429,430}remap.ngc` sources
generate `web/public/linuxcnc_switchkins_remap_config_cases.json`.
## Smoke Coverage
| Smoke entry | Boundary |
| --- | --- |
| `test-web-wasm-node-smoke.sh` | Runs the Node WASM wrapper with generated LinuxCNC switchkins cases and LinuxCNC-backed RTCP checks. |
| `test-web-wasm-node-smoke.cjs` | Exercises the C ABI, `web/src/wasm-core.js`, generated switchkins config cases, and source-backed kinematics events. |
| `test-web-wasm-browser-smoke.sh` | Runs browser checks after verifying copied WASM artifacts and smoke module structure. |
| `web/test-browser-wasm-smoke-linuxcnc-sections.js` | Exercises LinuxCNC browser parsing and generated switchkins cases without INI_FILE_NAME remap-load aliases. |
| `web/test-browser-wasm-smoke-opfs-parameter-sections.js` | Exercises LinuxCNC parameter restore/save/backup semantics through OPFS. |
| `web/test-browser-wasm-smoke-app-sections.js` | Verifies the browser app uses OPFS program and parameter persistence. |
## Boundaries
- Node smoke must leave OPFS disabled and must reject `parseFile*` methods that
require an OPFS workspace.
- Browser smoke must keep program files, LinuxCNC parameter files, temporary
`.new` files, and `.bak` backups under OPFS-backed storage.
- Generated switchkins config smoke cases must continue to come from
`web/public/linuxcnc_switchkins_remap_config_cases.json`.
- Smoke wrappers must keep positive minimum coverage thresholds so accidental
section loss is visible.
## Checks
Run:
```bash
./check-linuxcnc-wasm-smoke-source-map.sh
./test-native.sh
./test-linuxcnc-source-link.sh
```
`check-linuxcnc-wasm-smoke-source-map.sh` keeps this document, LinuxCNC source
anchors, smoke wrapper boundaries, OPFS-only policy, and generated switchkins
case usage synchronized.