Expand LinuxCNC interpreter regression coverage

This commit is contained in:
2026-06-09 14:54:54 +08:00
parent 50757e45ba
commit 5bd8f12872
143 changed files with 10895 additions and 219 deletions

View File

@@ -57,6 +57,28 @@ wasm-port/tests/host/verify_host_smokes.sh
| Add aggregate smoke coverage | Done | `tests/host/verify_host_smokes.sh` now runs stable Node WASM, sim-config WASM, `nc_files` WASM, OPFS, and browser smoke checks with shared builds. Current run passed with `host_wasm_opfs_browser_smokes=ok`. |
| Add `linuxcnc/nc_files` basic examples | Done | `tests/native/verify_nc_files.sh` now runs the basic/example subset of upstream `linuxcnc/nc_files` through LinuxCNC `bin/rs274`; current native baseline is 107 total, 101 pass, 6 expected context/entry-point edges, 0 unexpected failures. Exploratory `--all` inventory is 247 total, 219 pass, 28 expected context/entry-point edges, 0 unexpected failures. A representative vendored subset now passes Node WASM and browser execution through LinuxCNC-backed `Interp::open()`/`read()`/`execute()`, with `3D_Chips.ngc` using an INI-declared tool-table context for its upstream `T1 M6` line. |
## Current Review Boundaries
Use these batches when reviewing or splitting the current uncommitted work.
| Batch | Scope | Files |
| --- | --- | --- |
| A | `run_step` status output and UI/Node/browser assertions. | `wasm-port/runtime/core/linuxcnc_wrap/linuxcnc_interp_minimal_harness.cpp`, `wasm-port/runtime/core/linuxcnc_wrap/linuxcnc_interp_minimal_runtime.cpp`, `wasm-port/runtime/core/linuxcnc_wrap/linuxcnc_interp_wasm.cpp`, `wasm-port/runtime/core/linuxcnc_wrap/linuxcnc_runtime_state.hh`, `wasm-port/tests/wasm/node/verify_interp_wasm.mjs`, `wasm-port/tests/browser/interp_smoke.html`, `wasm-port/tests/fixtures/canon/arc_semantics.events`. |
| B | `nc_files` representative smoke and `3D_Chips.ngc` tool-table context. | `wasm-port/tests/native/verify_native_probes.sh`, `wasm-port/tests/wasm/node/verify_interp_wasm.mjs`, `wasm-port/tests/browser/interp_smoke.html`, `wasm-port/tools/source-manifest.txt`, vendored `wasm-port/vendor/linuxcnc/nc_files/3D_Chips.ngc`, `arcspiral.ngc`, `factorial.ngc`, `hole-circle.ngc`, and `m6demo.ngc`. |
| C | Selected upstream `tests/interp/*` and `tests/ccomp/*` fixture intake. | `wasm-port/tests/native/verify_native_probes.sh`, `wasm-port/tests/wasm/node/verify_interp_wasm.mjs`, `wasm-port/tests/browser/interp_smoke.html`, `wasm-port/tools/extract_sources.sh`, `wasm-port/tools/source-manifest.txt`, vendored `wasm-port/vendor/linuxcnc/tests/interp/...`, and vendored `wasm-port/vendor/linuxcnc/tests/ccomp/...` files listed in `tools/source-manifest.txt`. |
| D | Interpreter regression coverage for G92 parameter persistence, tool tables, G10/G52/G71/G72/G76, rotation, INI parameters, M19, M98/M99, subroutine lookup, sequence numbers, nested-sub errors, and ABORT hot comments. | `wasm-port/runtime/core/linuxcnc_wrap/linuxcnc_interp_minimal_harness.cpp`, `wasm-port/runtime/core/linuxcnc_wrap/linuxcnc_interp_minimal_runtime.cpp`, `wasm-port/runtime/core/linuxcnc_wrap/linuxcnc_interp_wasm.cpp`, `wasm-port/tests/native/verify_native_probes.sh`, `wasm-port/tests/wasm/node/verify_interp_wasm.mjs`, `wasm-port/tests/browser/interp_smoke.html`, and the corresponding vendored upstream fixture files under `wasm-port/vendor/linuxcnc/tests/interp/`. |
| E | Generic INI-context staging helper and Node/browser synthetic coverage. | `wasm-port/runtime/sdk/src/sim-config-staging.js`, `wasm-port/runtime/sdk/src/index.js`, `wasm-port/runtime/sdk/README.md`, `wasm-port/tests/wasm/node/verify_sim_configs_wasm.mjs`, `wasm-port/tests/browser/interp_smoke.html`. |
| F | Validation docs, source reuse map, tracker updates, native probe build/source-sync glue. | `wasm-port/docs/compatibility-validation.md`, `wasm-port/docs/drift-report.md`, `wasm-port/docs/linuxcnc-test-porting-tracker.md`, `wasm-port/docs/source-reuse-map.md`, `wasm-port/tools/build_native_probes.sh`, `wasm-port/tools/extract_sources.sh`, `wasm-port/tools/source-manifest.txt`, `wasm-port/tools/verify_vendor_sync.sh`. |
Vendored files in the current workset must stay byte-identical to upstream and
covered by both `wasm-port/tools/source-manifest.txt` and
`wasm-port/tools/verify_vendor_sync.sh`. The current untracked vendor groups
are `wasm-port/vendor/linuxcnc/tests/ccomp/`, selected
`wasm-port/vendor/linuxcnc/tests/interp/bad/*.ngc`, and selected upstream
directories under `wasm-port/vendor/linuxcnc/tests/interp/` including
`cam-nisley`, `crazy-paths`, `g10`, `g52`, `g71-*`, `g72-*`, `g76`, `good`,
`inside-corners`, `inverse-time-with-comp`, and selected `m98m99` cases.
## LinuxCNC Test Asset Queue
| LinuxCNC test path | Status | Current target | Notes |
@@ -79,21 +101,34 @@ wasm-port/tests/host/verify_host_smokes.sh
| `tests/interp/return-value` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/return-value`; validates LinuxCNC O-word return-value and `#<_value>` behavior through vendored file execution paths. |
| `tests/interp/subs-follow-main` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/subs-follow-main`; validates LinuxCNC subroutines after main program text through vendored file execution paths. |
| `tests/interp/fractional-linenumbers` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/fractional-linenumbers`; validates LinuxCNC fractional line-number parsing through vendored file execution paths. |
| `tests/interp/cam-nisley` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/cam-nisley`; validates the upstream storm-door latch cam toolpath through `Interp::open()`, `read()`, and `execute()` with upstream `test.tbl` staged through an INI-declared tool table. Native, WASM Node, and browser checks also assert that bare execution without that tool-table context fails at the upstream `T1 M6` lookup. |
| `tests/interp/namedparam-bug424` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/namedparam-bug424`; validates LinuxCNC named-parameter parsing regression behavior through vendored file execution paths. |
| `tests/interp/flowsnake` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/flowsnake`; validates LinuxCNC recursive O-word subroutine execution, expression evaluation, and comment argument handling through a pure file-execution fractal toolpath. |
| `tests/interp/bad` selected file errors | Done | Native, WASM Node, browser | Vendored selected upstream files under `wasm-port/vendor/linuxcnc/tests/interp/bad`; validates LinuxCNC file-execution error text for malformed `EXISTS[]` parameter expressions, nested subroutine definitions, zero-feed G1, missing arc center/radius words, and probe motion without axes. |
| `tests/interp/inside-corners` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/inside-corners`; validates LinuxCNC cutter-compensation geometry through concave corners, convex corners, and tangencies across XY and ZX plane file execution. |
| `tests/interp/inverse-time-with-comp` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/inverse-time-with-comp`; validates LinuxCNC inverse-time feed (`G93`), units-per-minute feed (`G94`), and cutter compensation interaction across uncompensated, right-compensated, and left-compensated subprogram calls. |
| `tests/ccomp` selected standalone cases | Done | Native, WASM Node, browser | Vendored `lathe-comp`, `mill-g90g91g92`, `mill-line-arc-entry`, and `mill-zchanges` under `wasm-port/vendor/linuxcnc/tests/ccomp`; validates standalone LinuxCNC cutter-compensation file execution with upstream tool tables staged through LinuxCNC `tooldata_load()` and `Interp::load_tool_table()`, with the standalone minimal interpreter startup now aligned to LinuxCNC's default incremental IJK mode (`G91.1`). |
| `tests/interp/bad` selected file errors | Done | Native, WASM Node, browser | Vendored selected upstream files under `wasm-port/vendor/linuxcnc/tests/interp/bad`; validates LinuxCNC file-execution error text for canned-cycle A-axis rejection, center-format arc radius mismatch rejection, cutter-compensation arc-exit/gouging rejection, malformed `EXISTS[]` parameter expressions, nested subroutine definitions, zero-feed G1, missing arc center/radius words, and probe motion without axes. |
| `tests/interp/good` selected arc tolerance cases | Done | Native, WASM Node, browser | Vendored selected upstream files under `wasm-port/vendor/linuxcnc/tests/interp/good`; validates LinuxCNC center-format arc tolerance acceptance across small/medium/big inch and metric cases through `ARC_FEED` canonical output and successful program end. |
| `tests/interp/g6164` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/g6164`; validates LinuxCNC `G61`/`G64` path-control and naive-cam tolerance canonical output through vendored file execution paths. |
| `tests/interp/g72-facing` and `tests/interp/g72-missing-iteration` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/g72-facing` and `wasm-port/vendor/linuxcnc/tests/interp/g72-missing-iteration`; validates LinuxCNC G72 lathe facing canned-cycle iteration behavior through vendored file execution paths, canonical `STRAIGHT_FEED` endpoints, and successful program end without timeout. |
| `tests/interp/g71-*` selected lathe canned-cycle cases | Done | Native, WASM Node, browser | Vendored `g71-endless-loop`, `g71-endless-loop2`, `g71-endless-loop_2`, and `g71-with-g70`; validates LinuxCNC G71 roughing and G70 finishing canned-cycle regressions through vendored file execution paths, canonical feed/arc endpoints, and successful program end without timeout. |
| `tests/interp/g76` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/g76`; validates LinuxCNC G76 lathe threading with upstream `test.tbl` staged through an INI-declared tool table, covering tool change, spindle start, speed-feed sync, threading feed events, and successful program end. |
| `tests/interp/g33.1` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/g33.1`; validates LinuxCNC rigid-tap `G33.1` file execution, spindle start, feed synchronization, and `RIGID_TAP` canonical output through vendored interpreter paths. |
| `tests/interp/g10` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/g10`; validates LinuxCNC `G10 L1/L10/L11/L2/L20`, tool-table updates, tool-length offset application timing, active G5X offset changes, G92 interaction, and XY-rotation behavior through vendored file execution paths with upstream `test.tbl` files staged through LinuxCNC tool-table loading. |
| `tests/interp/g52/g52-g92-interaction` plus G92 startup persistence | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/g52/g52-g92-interaction`; validates LinuxCNC G52/G92 shared offset parameter behavior, `G92.1`/`G92.2`/`G92.3` transitions, and `SET_G92_OFFSET` canonical output through vendored file execution paths. Native, WASM Node, and browser validation also stage a `[RS274NGC]PARAMETER_FILE` and exercise vendored `ini_load()`/`Interp::init()`/`restore_parameters()` startup behavior, including `DISABLE_G92_PERSISTENCE` clearing parameters 5210-5219. |
| `tests/interp/rotation` selected pure interpreter cases | Done | Native, WASM Node, browser | Vendored selected upstream cases under `wasm-port/vendor/linuxcnc/tests/interp/rotation`; validates LinuxCNC machine-coordinate `G53` absolute-position named parameters `#<_abs_x>`, `#<_abs_y>`, and `#<_abs_z>` across G54 offsets, G92 offsets, XY rotation, and inch/millimeter modes, plus rotated-coordinate `G28` and `G53` endpoint behavior through vendored file execution paths. |
| `tests/interp/iniparam` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/iniparam`; validates LinuxCNC `_ini[...]` lookup, missing INI-parameter error text, and continued file execution through vendored file execution paths and `INI_FILE_NAME`. |
| `tests/interp/iniparam-failassign` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/iniparam-failassign`; validates LinuxCNC `_ini[...]` read-only named-parameter assignment rejection through vendored file execution paths and `INI_FILE_NAME`. |
| `tests/interp/m19` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/m19`; validates LinuxCNC `M19` spindle orient canonical events, wait timeout, and `[RS274NGC]ORIENT_OFFSET` handling through vendored file execution paths. |
| `tests/interp/magic_comments/param_format_printing` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/magic_comments/param_format_printing`; validates LinuxCNC `(DEBUG,...)` magic-comment parameter formatting for integer, default float, and explicit precision formats through vendored file execution paths. |
| `tests/interp/m98m99` selected pure interpreter cases | Done | Native, WASM Node, browser | Vendored selected upstream cases under `wasm-port/vendor/linuxcnc/tests/interp/m98m99`; validates LinuxCNC Fanuc-style `M98/M99`, parameter scope, nested numbered subprograms, subprograms after main program text, leading-zero O-word lookup, named and numbered main programs, and expression-based O-sub/M98 calls through vendored file execution paths. |
| `tests/interp/m98m99` selected pure interpreter cases | Done | Native, WASM Node, browser | Vendored selected upstream cases under `wasm-port/vendor/linuxcnc/tests/interp/m98m99`; validates LinuxCNC Fanuc-style `M98/M99`, missing-P-word, missing-subprogram, mixed Fanuc/RS274NGC sub-style, `DISABLE_FANUC_STYLE_SUB` INI-gated errors, main-program O-word termination rules, parameter scope, loop counts including `L0`, nested numbered subprograms, subprograms after main program text, leading-zero O-word lookup, named and numbered main programs, and expression-based O-sub/M98 calls through vendored file execution paths. |
| `tests/interp/sub-call-from-sub` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/sub-call-from-sub`; validates LinuxCNC external subroutine calls from another external subroutine through vendored file execution paths and LinuxCNC INI `SUBROUTINE_PATH`. |
| `tests/interp/sequence-number` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/sequence-number`; validates LinuxCNC `#<_line>` reporting in main files and external subroutines through vendored file execution paths and LinuxCNC INI `SUBROUTINE_PATH`. |
| `tests/interp/nested-sub-error` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/nested-sub-error`; validates LinuxCNC nested-subroutine-definition rejection through vendored file execution paths and LinuxCNC INI `SUBROUTINE_PATH`. |
| `tests/interp/nested-sub-in-file-error` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/nested-sub-in-file-error`; validates LinuxCNC rejection of forward seek to a later numbered subroutine in the same external subroutine file through vendored file execution paths and LinuxCNC INI `SUBROUTINE_PATH`. |
| `tests/interp/oword-unwind` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/oword-unwind`; validates LinuxCNC O-word stack unwind after a subroutine error through upstream-style continue-on-error file execution and LinuxCNC INI `SUBROUTINE_PATH`. |
| `tests/interp/abort-hot-comment` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/abort-hot-comment`; validates LinuxCNC `(ABORT,...)` hot-comment parameter expansion for numbered, named, and INI named parameters through vendored file execution paths and `INI_FILE_NAME`. |
| `tests/interp/compile` | Done | Native source probe | Upstream `linuxcnc/tests/interp/compile` is a C++ compile/source test (`use-rs274.cc`), not a runtime `.ngc` interpreter fixture. The current port covers this class through the native `linuxcnc_rs274_compile_probe` object build in `wasm-port/tools/build_native_probes.sh`; do not add it to file-execution intake unless an upstream runtime fixture appears. |
| `configs/sim/axis/foam/foam.ngc` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/configs/sim/axis/foam`; validates LinuxCNC INI-driven `U/V` axis mask handling through `axis_foam.ini` and vendored file execution paths. |
| `configs/sim/axis/geometry/xyzc.ngc` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/configs/sim/axis/geometry`; validates LinuxCNC `USER_M_PATH` registration with the real executable `M110` while process execution remains a deterministic standalone `USER_M_COMMAND` boundary. |
| `configs/sim/axis/external_offsets/*.ngc` M111 demos | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/configs/sim/axis/external_offsets`; validates `dyn_demo.ngc`, `eoffsets.ngc`, `jwp_z.ngc`, and `opa_demo.ngc` with their corresponding INI files, real executable `M111`, shared `eoffset.tbl`, and `opa_demo.ngc`'s `circles.ngc` subroutine while process execution remains a deterministic standalone boundary. |