From e7df5b3eda25a225cc6314bdd443d7ea78d6e2c1 Mon Sep 17 00:00:00 2001 From: wangdequan Date: Tue, 9 Jun 2026 07:49:06 +0800 Subject: [PATCH] Add flowsnake interpreter regression coverage --- wasm-port/docs/compatibility-validation.md | 7 +- .../docs/linuxcnc-test-porting-tracker.md | 1 + wasm-port/docs/source-reuse-map.md | 2 +- wasm-port/tests/browser/interp_smoke.html | 26 ++ .../tests/native/verify_native_probes.sh | 17 + .../tests/wasm/node/verify_interp_wasm.mjs | 22 + wasm-port/tools/build_native_probes.sh | 2 + wasm-port/tools/source-manifest.txt | 4 + .../linuxcnc/tests/interp/flowsnake/README | 6 + .../linuxcnc/tests/interp/flowsnake/expected | 403 ++++++++++++++++++ .../tests/interp/flowsnake/flowsnake.ngc | 41 ++ .../linuxcnc/tests/interp/flowsnake/test.sh | 3 + 12 files changed, 530 insertions(+), 4 deletions(-) create mode 100644 wasm-port/vendor/linuxcnc/tests/interp/flowsnake/README create mode 100644 wasm-port/vendor/linuxcnc/tests/interp/flowsnake/expected create mode 100644 wasm-port/vendor/linuxcnc/tests/interp/flowsnake/flowsnake.ngc create mode 100644 wasm-port/vendor/linuxcnc/tests/interp/flowsnake/test.sh diff --git a/wasm-port/docs/compatibility-validation.md b/wasm-port/docs/compatibility-validation.md index f3aacba..bbb5f98 100644 --- a/wasm-port/docs/compatibility-validation.md +++ b/wasm-port/docs/compatibility-validation.md @@ -459,7 +459,7 @@ The validation fails if: | 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 through the JS SDK in Node, and queried through the exported C ABI, including LinuxCNC-backed boolean conversion and machine-session file-name string lookup. | -| `tests/wasm/node/verify_interp_wasm.sh` | Validates the interpreter-core WASM module can be built from vendored LinuxCNC interpreter/remap source, loaded through the interpreter JS SDK, run the first fixture group through `Interp::execute()` and selected file fixtures plus vendored upstream `tests/interp` regression files through `Interp::open()`/`read()`/`execute()`, match the native canonical event plus required state readback fixtures, emit `run_step` execution-status records with LinuxCNC line number, encoded source statement, return code, and interpreter axis positions for file execution, cover vendored `tests/interp/g33.1` rigid-tap file execution, run vendored `xyzac-trt`/`xyzbc-trt` switchkins remap demo files through the WASM C ABI/SDK path, and run parameter-file restore/save through vendored LinuxCNC `Interp::restore_parameters()` and `Interp::save_parameters()`. | +| `tests/wasm/node/verify_interp_wasm.sh` | Validates the interpreter-core WASM module can be built from vendored LinuxCNC interpreter/remap source, loaded through the interpreter JS SDK, run the first fixture group through `Interp::execute()` and selected file fixtures plus vendored upstream `tests/interp` regression files through `Interp::open()`/`read()`/`execute()`, match the native canonical event plus required state readback fixtures, emit `run_step` execution-status records with LinuxCNC line number, encoded source statement, return code, and interpreter axis positions for file execution, cover vendored `tests/interp/flowsnake` recursive O-word file execution and `tests/interp/g33.1` rigid-tap file execution, run vendored `xyzac-trt`/`xyzbc-trt` switchkins remap demo files through the WASM C ABI/SDK path, and run parameter-file restore/save through vendored LinuxCNC `Interp::restore_parameters()` and `Interp::save_parameters()`. | | `tests/wasm/node/verify_sim_configs_wasm.sh` | Validates representative vendored LinuxCNC `configs/sim` programs in Node WASM through `planSimConfigStaging()` plus `runSimConfigProgram()`. The staging planner uses INI text and `tools/source-manifest.txt` to collect the program, INI, tool table, parameter file when vendored, `SUBROUTINE_PATH` files, `USER_M_PATH` files, and remap-NGC files before forwarding to `runFileWithIni()` or `runFiveAxisRemapFile()`. This covers INI-driven `U/V/W` axis mask handling, real `USER_M_PATH` registration for executable `M110`/`M111`, all four current external-offset M111 expected-failure programs, `SUBROUTINE_PATH` staging for `opa_demo.ngc -> circles.ngc`, bridge-mill remap-subroutine staging, and vendored LinuxCNC bridge-mill NGC remap execution without spawning host processes. The same smoke includes a synthetic staging-plan assertion for `TOOL_TABLE`, `PARAMETER_FILE`, `SUBROUTINE_PATH`, and `USER_M_PATH` collection. | | `tests/wasm/node/verify_nc_files_wasm.sh` | Validates representative vendored LinuxCNC `nc_files` examples in Node WASM by copying `3D_Chips.ngc`, `arcspiral.ngc`, `hole-circle.ngc`, `factorial.ngc`, and `m6demo.ngc` into the Emscripten filesystem and forwarding to the LinuxCNC-backed `Interp::open()`/`read()`/`execute()` path. `3D_Chips.ngc` is staged with a minimal INI-declared `tool.tbl` because the upstream program contains `T1 M6`; JavaScript only stages files and checks LinuxCNC output, including `run_step` status records, and does not implement G-code, O-word, tool-change, or M-code behavior. | | `tests/wasm/node/verify_tp_wasm.sh` | Validates a standalone trajectory-planner WASM module can be built from vendored LinuxCNC TP/TC/Ruckig support source, loaded in Node, and run the same linear, arc, and queued-line planner probe paths covered by the native TP harness. | @@ -784,8 +784,9 @@ numbered-parameter, local named-parameter plus `_ini[...]` lookup through `rs274 -i`, probing, spindle-orient, file-open reset, file-finish, tool-reload, tool select/change/length-offset, M61 current-tool-number update, canned-cycle, state-tag motion, tool-table setup, and O-word subroutine -fixtures, plus threading/rigid tap, vendored `tests/interp/g33.1` rigid-tap -file execution, NURBS dispatch boundaries, and the +fixtures, plus vendored `tests/interp/flowsnake` recursive O-word toolpath, +threading/rigid tap, vendored `tests/interp/g33.1` rigid-tap file execution, +NURBS dispatch boundaries, and the comparable canonical runtime edge and program-end cleanup calls. The standalone vendored-source harness, Node WASM smoke, and browser smoke also pin `coordinate_offsets` MDI/file-path, `feed_control_modes`, `run_step` diff --git a/wasm-port/docs/linuxcnc-test-porting-tracker.md b/wasm-port/docs/linuxcnc-test-porting-tracker.md index 82ef5d0..64d1697 100644 --- a/wasm-port/docs/linuxcnc-test-porting-tracker.md +++ b/wasm-port/docs/linuxcnc-test-porting-tracker.md @@ -80,6 +80,7 @@ wasm-port/tests/host/verify_host_smokes.sh | `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/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/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/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`. | diff --git a/wasm-port/docs/source-reuse-map.md b/wasm-port/docs/source-reuse-map.md index 5ffe098..bda3c2f 100644 --- a/wasm-port/docs/source-reuse-map.md +++ b/wasm-port/docs/source-reuse-map.md @@ -44,7 +44,7 @@ Current validation is intentionally mechanical: | Representative sim-config machine programs | `configs/sim/axis/foam/*`, `configs/sim/axis/geometry/M110`, `xyzc.ini`, `xyzc.ngc`, `configs/sim/axis/external_offsets/M111`, `dyn_demo.ngc`, `dynamic_offsets.ini`, `eoffsets.ngc`, `eoffsets.ini`, `jwp_z.ngc`, `jwp_z.ini`, `opa_demo.ngc`, `opa.ini`, `circles.ngc`, `eoffset.tbl`, and `configs/sim/axis/sim.tbl` | Copy unchanged | The `foam`, `xyzc`, and external-offset sample programs remain LinuxCNC sim-config assets. The standalone boundary only copies INI, tool table, G-code, executable user-M files, and `SUBROUTINE_PATH` files into the native or WASM filesystem, then calls vendored LinuxCNC INI parsing and `Interp::open()`/`read()`/`execute()` through the existing machine-config adapter. The native sim-config harness now prefers `[DISPLAY]OPEN_FILE` when several INI files live beside a program, so each program is judged with its corresponding machine context. The JS SDK `runSimConfigProgram()` is only the host file-staging helper for this boundary: it writes caller-provided text files to the Emscripten filesystem, applies executable bits, and forwards to LinuxCNC-backed C ABI entry points. `M110`/`M111` process execution stays a runtime boundary represented by deterministic `USER_M_COMMAND` canonical events | Vendor byte sync, `tests/native/verify_sim_configs.sh`, `tests/wasm/node/verify_sim_configs_wasm.sh`, `tests/browser/verify_interp_browser.sh` | | Representative `nc_files` examples | `nc_files/3D_Chips.ngc`, `nc_files/arcspiral.ngc`, `nc_files/factorial.ngc`, `nc_files/hole-circle.ngc`, `nc_files/m6demo.ngc` | Copy unchanged | These upstream `linuxcnc/nc_files` examples are copied byte-for-byte into the WASM vendor tree after the native `nc_files` harness classifies the broader directory. Node and browser tests only stage the original `.ngc` text and, for `3D_Chips.ngc`, the minimal INI-declared tool table context required by its upstream `T1 M6` line in the Emscripten filesystem, then call the LinuxCNC-backed `Interp::open()`, `read()`, and `execute()` path through the existing SDK; no G-code, O-word, tool-change, or M-code behavior is implemented in JavaScript | Vendor byte sync, `tests/native/verify_nc_files.sh`, `tests/wasm/node/verify_nc_files_wasm.sh`, `tests/browser/verify_interp_browser.sh`, `tests/host/verify_host_smokes.sh` | | LinuxCNC remap regression fixtures | `tests/remap/duplicate-o-word/*`, `tests/remap/fail/args.0/*`, `tests/remap/fail/args.1/*`, `tests/remap/fail/args.2/*`, `tests/remap/fail/body-ngc/*`, `tests/remap/m30-interaction/*`, `tests/remap/nested-remaps-oword/*`, `tests/remap/posargs.0/*`, `tests/remap/sequencing/*`, selected NGC-only `tests/remap/remap-io/test-ngc.ini` plus `io_*.ngc`, and `src/emc/rs274ngc/interp_remap.cc` plus `interp_o_word.cc` | Copy unchanged | The upstream duplicate O-word, NGC-only remap failure, M30/remap-level interaction, nested O-word remap, positional-argument remap, G/M remap sequencing, and remap-IO NGC subroutine regressions remain LinuxCNC REMAP/O-word/file or MDI execution tests. The standalone boundary only copies the upstream test files into native or WASM filesystems, reads LinuxCNC INI `SUBROUTINE_PATH`, `REMAP`, and `OWORD_NARGS` entries, and calls vendored `Interp::parse_remap()`, `open()`, `read()`, and `execute()` or feeds the upstream remap-IO MDI sequence into vendored `Interp::execute()`; the continue-on-error runner path only mirrors LinuxCNC `rs274 -n 0` test execution and does not implement duplicate-label, O-word, nested remap, M30, positional-argument, failure, sequencing, M62-M68, M66 input, or remap semantics | Vendor byte sync, `linuxcnc_duplicate_oword_remap_harness`, `tests/wasm/node/verify_interp_wasm.sh`, `tests/browser/verify_interp_browser.sh` | -| LinuxCNC interpreter regression fixtures | `tests/interp/do-while-break/*`, `tests/interp/oword-bug315/*`, `tests/interp/oword-bug315-p2/*`, `tests/interp/exists/*`, `tests/interp/return-value/*`, `tests/interp/subs-follow-main/*`, `tests/interp/fractional-linenumbers/*`, `tests/interp/namedparam-bug424/*`, `tests/interp/g33.1/*`, selected `tests/interp/rotation/*` pure interpreter cases, `tests/interp/iniparam/*`, `tests/interp/iniparam-failassign/*`, `tests/interp/m19/*`, `tests/interp/magic_comments/param_format_printing/*`, selected `tests/interp/m98m99/*` pure interpreter cases, `tests/interp/sub-call-from-sub/*`, `tests/interp/sequence-number/*`, `tests/interp/nested-sub-error/*`, `tests/interp/nested-sub-in-file-error/*`, `tests/interp/abort-hot-comment/*`, plus vendored interpreter/O-word sources including `interp_o_word.cc`, `interp_read.cc`, `interp_execute.cc`, `interp_find.cc`, `interp_namedparams.cc`, and `rs274ngc_pre.cc` | Copy unchanged | The upstream do/while/break, O-word bug315, `EXISTS[]`, subroutine return-value, subs-after-main, fractional line-number, named-parameter, rigid-tap `G33.1`, selected rotation/G53/G28 absolute-position and endpoint, INI named-parameter lookup/read-only protection, M19 spindle-orient offset/timeout handling, magic-comment parameter formatting, selected Fanuc `M98/M99` and O-expression call regressions, external-subroutine-call, external-subroutine line-number, nested-subroutine-definition rejection, blocked forward-seek-to-later-numbered-sub, and `(ABORT,...)` hot-comment parameter-expansion regressions remain LinuxCNC interpreter file-execution tests. The standalone boundary only vendors the original upstream assets, copies `*.ngc`, `test.ini`, `test.tbl`, `subs/*.ngc`, and referenced external subroutine `.ngc` files into native or WASM filesystems where applicable, sets the LinuxCNC `INI_FILE_NAME` runtime edge for `_ini[...]`, applies LinuxCNC INI machine settings such as `[RS274NGC]ORIENT_OFFSET`, reads LinuxCNC INI `SUBROUTINE_PATH`, captures LinuxCNC `(PRINT,...)` output through the existing stdout/Emscripten `print` boundary, and calls vendored `Interp::open()`, `read()`, and `execute()`; it does not implement O-word loop, break, subroutine, dynamic call, `M98/M99`, `EXISTS[]`, named-parameter, rigid tap, absolute-position named-parameter, G28/G53 endpoint, INI-variable, read-only parameter, line-number, spindle-speed, spindle-orient, magic-comment formatting, subroutine lookup, ABORT hot-comment, error, or branch semantics | Vendor byte sync, `linuxcnc_interp_minimal_harness`, `tests/wasm/node/verify_interp_wasm.sh`, `tests/browser/verify_interp_browser.sh` | +| LinuxCNC interpreter regression fixtures | `tests/interp/do-while-break/*`, `tests/interp/oword-bug315/*`, `tests/interp/oword-bug315-p2/*`, `tests/interp/exists/*`, `tests/interp/return-value/*`, `tests/interp/subs-follow-main/*`, `tests/interp/fractional-linenumbers/*`, `tests/interp/namedparam-bug424/*`, `tests/interp/flowsnake/*`, `tests/interp/g33.1/*`, selected `tests/interp/rotation/*` pure interpreter cases, `tests/interp/iniparam/*`, `tests/interp/iniparam-failassign/*`, `tests/interp/m19/*`, `tests/interp/magic_comments/param_format_printing/*`, selected `tests/interp/m98m99/*` pure interpreter cases, `tests/interp/sub-call-from-sub/*`, `tests/interp/sequence-number/*`, `tests/interp/nested-sub-error/*`, `tests/interp/nested-sub-in-file-error/*`, `tests/interp/abort-hot-comment/*`, plus vendored interpreter/O-word sources including `interp_o_word.cc`, `interp_read.cc`, `interp_execute.cc`, `interp_find.cc`, `interp_namedparams.cc`, and `rs274ngc_pre.cc` | Copy unchanged | The upstream do/while/break, O-word bug315, `EXISTS[]`, subroutine return-value, subs-after-main, fractional line-number, named-parameter, recursive O-word flowsnake toolpath, rigid-tap `G33.1`, selected rotation/G53/G28 absolute-position and endpoint, INI named-parameter lookup/read-only protection, M19 spindle-orient offset/timeout handling, magic-comment parameter formatting, selected Fanuc `M98/M99` and O-expression call regressions, external-subroutine-call, external-subroutine line-number, nested-subroutine-definition rejection, blocked forward-seek-to-later-numbered-sub, and `(ABORT,...)` hot-comment parameter-expansion regressions remain LinuxCNC interpreter file-execution tests. The standalone boundary only vendors the original upstream assets, copies `*.ngc`, `test.ini`, `test.tbl`, `subs/*.ngc`, and referenced external subroutine `.ngc` files into native or WASM filesystems where applicable, sets the LinuxCNC `INI_FILE_NAME` runtime edge for `_ini[...]`, applies LinuxCNC INI machine settings such as `[RS274NGC]ORIENT_OFFSET`, reads LinuxCNC INI `SUBROUTINE_PATH`, captures LinuxCNC `(PRINT,...)` output through the existing stdout/Emscripten `print` boundary, and calls vendored `Interp::open()`, `read()`, and `execute()`; it does not implement O-word loop, break, subroutine, dynamic call, `M98/M99`, `EXISTS[]`, named-parameter, recursive O-word toolpath generation, rigid tap, absolute-position named-parameter, G28/G53 endpoint, INI-variable, read-only parameter, line-number, spindle-speed, spindle-orient, magic-comment formatting, subroutine lookup, ABORT hot-comment, error, or branch semantics | Vendor byte sync, `linuxcnc_interp_minimal_harness`, `tests/wasm/node/verify_interp_wasm.sh`, `tests/browser/verify_interp_browser.sh` | | Additional non-switchable kinematics | `src/emc/kinematics/corexykins.c`, `rotatekins.c`, `rosekins.c`, `maxkins.c`, `lineardeltakins.c`, `lineardeltakins-common.h`, `rotarydeltakins.c`, `rotarydeltakins-common.h`, `scorbot-kins.c`, `tripodkins.c`, `scarakins.c`, `pumakins.c`, `pumakins.h`, `genhexkins.c`, `genhexkins.h`, `genserfuncs.c`, `genserkins.c`, `genserkins.h`, `ugenserkins.c`, `pentakins.c`, `pentakins.h`, `cubic.c` | Copy unchanged | HAL pin allocation, HAL parameter allocation, HAL component lifecycle, RTAPI module metadata, Go math C/C++ linkage, switchkins iterative-forward warmup, and userspace test-program process entry remain standalone runtime edges; forward/inverse behavior remains LinuxCNC source where the module exposes it | Vendor byte sync, per-file source probes, `linuxcnc_corexy_kinematics_probe`, `linuxcnc_rotate_kinematics_probe`, `linuxcnc_rose_kinematics_probe`, `linuxcnc_max_kinematics_probe`, `linuxcnc_lineardelta_kinematics_probe`, `linuxcnc_rotarydelta_kinematics_probe`, `linuxcnc_scorbot_kinematics_probe`, `linuxcnc_tripod_kinematics_probe`, `linuxcnc_scara_kinematics_probe`, `linuxcnc_puma_kinematics_probe`, `linuxcnc_genser_kinematics_probe`, `linuxcnc_genhex_kinematics_probe`, `linuxcnc_pentakins_kinematics_probe` | | Trajectory planner | `src/emc/tp/tp.c`, `tc.c`, `tcq.c`, `spherical_arc.c`, `blendmath.c`, `sp_scurve.c`, `ruckig_wrapper.c`, plus matching `*.h` files | Copy unchanged | Native realtime scheduling and motion process state are replaced by standalone probe setup; the WASM TP probe uses the same deterministic status/config boundary and calls vendored TP APIs through a narrow C ABI | Vendor byte sync, per-file source probes, `linuxcnc_tp_api_probe`, `tests/wasm/node/verify_tp_wasm.sh` | | Ruckig C planner support | Selected `src/emc/tp/cruckig/*.c` and `*.h` files in the manifest | Copy unchanged | Used as LinuxCNC planner support code through vendored TP sources | Vendor byte sync, per-file source probes, `tests/wasm/node/verify_tp_wasm.sh` | diff --git a/wasm-port/tests/browser/interp_smoke.html b/wasm-port/tests/browser/interp_smoke.html index 61e34e7..815e066 100644 --- a/wasm-port/tests/browser/interp_smoke.html +++ b/wasm-port/tests/browser/interp_smoke.html @@ -1537,6 +1537,32 @@ ].join("\n"), ); + const flowsnakePath = await writeInterpRegressionFile( + interp, + "flowsnake", + "flowsnake.ngc", + ); + verifyExpectedOutput( + "browser_interp_flowsnake", + interp.runFile(flowsnakePath), + [ + "file_open=0", + "file_read_count=6414", + "file_execute_count=6414", + "file_saw_error=0", + "canon_event=COMMENT: Program to mill a flowsnake", + "canon_event=START_SPINDLE_CLOCKWISE spindle=0", + "canon_event=STRAIGHT_TRAVERSE line=33 x=0.25 y=1 z=1", + "canon_event=STRAIGHT_FEED line=13 x=3.75 y=1 z=0", + "canon_event=STRAIGHT_FEED line=13 x=2 y=3.95 z=0", + "canon_event=STRAIGHT_FEED line=13 x=0.25 y=1 z=0", + "canon_event=STOP_SPINDLE_TURNING spindle=0", + "setup.current_x=0.25", + "setup.current_y=1", + "setup.current_z=1", + ].join("\n"), + ); + const g33_1Path = await writeInterpRegressionFile(interp, "g33.1", "g33.1.ngc"); verifyExpectedOutput( "browser_interp_g33_1", diff --git a/wasm-port/tests/native/verify_native_probes.sh b/wasm-port/tests/native/verify_native_probes.sh index 18f332e..96b1571 100755 --- a/wasm-port/tests/native/verify_native_probes.sh +++ b/wasm-port/tests/native/verify_native_probes.sh @@ -210,6 +210,7 @@ check_exitcode linuxcnc_interp_minimal_harness.return_value.run check_exitcode linuxcnc_interp_minimal_harness.subs_follow_main.run check_exitcode linuxcnc_interp_minimal_harness.fractional_linenumbers.run check_exitcode linuxcnc_interp_minimal_harness.namedparam_bug424.run +check_exitcode linuxcnc_interp_minimal_harness.flowsnake.run check_exitcode linuxcnc_interp_minimal_harness.g33_1.run check_exitcode linuxcnc_interp_minimal_harness.g6164.run check_exitcode linuxcnc_interp_minimal_harness.rotation_abs_pts.run @@ -1130,6 +1131,22 @@ grep -Fq "canon_event=USE_LENGTH_UNITS units=1" "$NAMEDPARAM_BUG424_STDOUT" grep -Fq "canon_event=STRAIGHT_TRAVERSE line=5 x=2 y=3 z=4" "$NAMEDPARAM_BUG424_STDOUT" grep -Fq "canon_event=PROGRAM_END" "$NAMEDPARAM_BUG424_STDOUT" +FLOWSNAKE_STDOUT="$BUILD_DIR/linuxcnc_interp_minimal_harness.flowsnake.run.stdout.log" +grep -Fq "file_open=0" "$FLOWSNAKE_STDOUT" +grep -Fq "file_read_count=6414" "$FLOWSNAKE_STDOUT" +grep -Fq "file_execute_count=6414" "$FLOWSNAKE_STDOUT" +grep -Fq "file_saw_error=0" "$FLOWSNAKE_STDOUT" +grep -Fq "canon_event=COMMENT: Program to mill a flowsnake" "$FLOWSNAKE_STDOUT" +grep -Fq "canon_event=START_SPINDLE_CLOCKWISE spindle=0" "$FLOWSNAKE_STDOUT" +grep -Fq "canon_event=STRAIGHT_TRAVERSE line=33 x=0.25 y=1 z=1" "$FLOWSNAKE_STDOUT" +grep -Fq "canon_event=STRAIGHT_FEED line=13 x=3.75 y=1 z=0" "$FLOWSNAKE_STDOUT" +grep -Fq "canon_event=STRAIGHT_FEED line=13 x=2 y=3.95 z=0" "$FLOWSNAKE_STDOUT" +grep -Fq "canon_event=STRAIGHT_FEED line=13 x=0.25 y=1 z=0" "$FLOWSNAKE_STDOUT" +grep -Fq "canon_event=STOP_SPINDLE_TURNING spindle=0" "$FLOWSNAKE_STDOUT" +grep -Fq "setup.current_x=0.25" "$FLOWSNAKE_STDOUT" +grep -Fq "setup.current_y=1" "$FLOWSNAKE_STDOUT" +grep -Fq "setup.current_z=1" "$FLOWSNAKE_STDOUT" + G33_1_STDOUT="$BUILD_DIR/linuxcnc_interp_minimal_harness.g33_1.run.stdout.log" grep -Fq "file_open=0" "$G33_1_STDOUT" grep -Fq "file_read_count=5" "$G33_1_STDOUT" diff --git a/wasm-port/tests/wasm/node/verify_interp_wasm.mjs b/wasm-port/tests/wasm/node/verify_interp_wasm.mjs index b86d504..8965943 100644 --- a/wasm-port/tests/wasm/node/verify_interp_wasm.mjs +++ b/wasm-port/tests/wasm/node/verify_interp_wasm.mjs @@ -1249,6 +1249,28 @@ verifyExpectedOutput( ].join("\n"), ); +const flowsnakePath = writeInterpRegressionFile("flowsnake", "flowsnake.ngc"); +verifyExpectedOutput( + "interp_flowsnake_wasm", + interp.runFile(flowsnakePath), + [ + "file_open=0", + "file_read_count=6414", + "file_execute_count=6414", + "file_saw_error=0", + "canon_event=COMMENT: Program to mill a flowsnake", + "canon_event=START_SPINDLE_CLOCKWISE spindle=0", + "canon_event=STRAIGHT_TRAVERSE line=33 x=0.25 y=1 z=1", + "canon_event=STRAIGHT_FEED line=13 x=3.75 y=1 z=0", + "canon_event=STRAIGHT_FEED line=13 x=2 y=3.95 z=0", + "canon_event=STRAIGHT_FEED line=13 x=0.25 y=1 z=0", + "canon_event=STOP_SPINDLE_TURNING spindle=0", + "setup.current_x=0.25", + "setup.current_y=1", + "setup.current_z=1", + ].join("\n"), +); + const g33_1Path = writeInterpRegressionFile("g33.1", "g33.1.ngc"); verifyExpectedOutput( "interp_g33_1_wasm", diff --git a/wasm-port/tools/build_native_probes.sh b/wasm-port/tools/build_native_probes.sh index 04ae4de..84d4a3f 100755 --- a/wasm-port/tools/build_native_probes.sh +++ b/wasm-port/tools/build_native_probes.sh @@ -17,6 +17,7 @@ RETURN_VALUE_FIXTURE="$ROOT_DIR/vendor/linuxcnc/tests/interp/return-value/test.n SUBS_FOLLOW_MAIN_FIXTURE="$ROOT_DIR/vendor/linuxcnc/tests/interp/subs-follow-main/test.ngc" FRACTIONAL_LINENUMBERS_FIXTURE="$ROOT_DIR/vendor/linuxcnc/tests/interp/fractional-linenumbers/test.ngc" NAMEDPARAM_BUG424_FIXTURE="$ROOT_DIR/vendor/linuxcnc/tests/interp/namedparam-bug424/test.ngc" +FLOWSNAKE_FIXTURE="$ROOT_DIR/vendor/linuxcnc/tests/interp/flowsnake/flowsnake.ngc" G33_1_FIXTURE="$ROOT_DIR/vendor/linuxcnc/tests/interp/g33.1/g33.1.ngc" G6164_FIXTURE="$ROOT_DIR/vendor/linuxcnc/tests/interp/g6164/test.ngc" ROTATION_ABS_PTS_FIXTURE="$ROOT_DIR/vendor/linuxcnc/tests/interp/rotation/abs-pts/test.ngc" @@ -1468,6 +1469,7 @@ run_interp_minimal_fixture return_value "$RETURN_VALUE_FIXTURE" run_interp_minimal_fixture subs_follow_main "$SUBS_FOLLOW_MAIN_FIXTURE" run_interp_minimal_fixture fractional_linenumbers "$FRACTIONAL_LINENUMBERS_FIXTURE" run_interp_minimal_fixture namedparam_bug424 "$NAMEDPARAM_BUG424_FIXTURE" +run_interp_minimal_fixture flowsnake "$FLOWSNAKE_FIXTURE" run_interp_minimal_fixture g33_1 "$G33_1_FIXTURE" run_interp_minimal_fixture g6164 "$G6164_FIXTURE" run_interp_minimal_fixture rotation_abs_pts "$ROTATION_ABS_PTS_FIXTURE" diff --git a/wasm-port/tools/source-manifest.txt b/wasm-port/tools/source-manifest.txt index 97e0c58..1f66616 100644 --- a/wasm-port/tools/source-manifest.txt +++ b/wasm-port/tools/source-manifest.txt @@ -280,6 +280,10 @@ tests/interp/namedparam-bug424/README tests/interp/namedparam-bug424/expected tests/interp/namedparam-bug424/test.ngc tests/interp/namedparam-bug424/test.sh +tests/interp/flowsnake/README +tests/interp/flowsnake/expected +tests/interp/flowsnake/flowsnake.ngc +tests/interp/flowsnake/test.sh tests/interp/g33.1/expected tests/interp/g33.1/g33.1.ngc tests/interp/g33.1/test.sh diff --git a/wasm-port/vendor/linuxcnc/tests/interp/flowsnake/README b/wasm-port/vendor/linuxcnc/tests/interp/flowsnake/README new file mode 100644 index 0000000..74ea683 --- /dev/null +++ b/wasm-port/vendor/linuxcnc/tests/interp/flowsnake/README @@ -0,0 +1,6 @@ +This test mills the flowsnake form, testing the following interpreter features: + +named owords +recursive subroutine calls + + diff --git a/wasm-port/vendor/linuxcnc/tests/interp/flowsnake/expected b/wasm-port/vendor/linuxcnc/tests/interp/flowsnake/expected new file mode 100644 index 0000000..1984f4b --- /dev/null +++ b/wasm-port/vendor/linuxcnc/tests/interp/flowsnake/expected @@ -0,0 +1,403 @@ + N..... USE_LENGTH_UNITS(CANON_UNITS_MM) + N..... SET_G5X_OFFSET(1, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_G92_OFFSET(0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_XY_ROTATION(0.0000) + N..... SET_FEED_REFERENCE(CANON_XYZ) + N..... ON_RESET() + N..... COMMENT("Program to mill a flowsnake") + N..... COMMENT("K. Lerman") + N..... SET_SPINDLE_SPEED(0, 1.0000) + N..... START_SPINDLE_CLOCKWISE(0) + N..... STRAIGHT_TRAVERSE(0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000) + N..... STRAIGHT_TRAVERSE(0.2500, 1.0000, 1.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.2500, 1.0000, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.3796, 1.0000, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.4444, 0.8877, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.5093, 1.0000, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.6389, 1.0000, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.7037, 0.8877, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.6389, 0.7755, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.7685, 0.7755, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.8333, 0.6632, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.8981, 0.7755, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.0278, 0.7755, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.9630, 0.8877, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.0278, 1.0000, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.1574, 1.0000, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.2222, 0.8877, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.2870, 1.0000, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.4167, 1.0000, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.4815, 0.8877, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.4167, 0.7755, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.5463, 0.7755, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.6111, 0.6632, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.5463, 0.5509, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.4167, 0.5509, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.4815, 0.4387, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.4167, 0.3264, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.5463, 0.3264, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.6111, 0.2142, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.6759, 0.3264, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.8056, 0.3264, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.8704, 0.2142, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.8056, 0.1019, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.9352, 0.1019, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.0000, -0.0104, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.0648, 0.1019, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.1944, 0.1019, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.1296, 0.2142, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.1944, 0.3264, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.3241, 0.3264, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.3889, 0.2142, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.4537, 0.3264, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.5833, 0.3264, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.5185, 0.4387, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.5833, 0.5509, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.4537, 0.5509, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.3889, 0.6632, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.4537, 0.7755, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.5833, 0.7755, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.5185, 0.8877, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.5833, 1.0000, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.7130, 1.0000, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.7778, 0.8877, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.8426, 1.0000, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.9722, 1.0000, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.0370, 0.8877, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.9722, 0.7755, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.1019, 0.7755, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.1667, 0.6632, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.2315, 0.7755, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.3611, 0.7755, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.2963, 0.8877, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.3611, 1.0000, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.4907, 1.0000, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.5556, 0.8877, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.6204, 1.0000, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.7500, 1.0000, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.6852, 1.1093, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.7474, 1.2200, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.6204, 1.2185, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.5556, 1.3278, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.6178, 1.4385, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.7448, 1.4400, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.6800, 1.5493, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.7422, 1.6601, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.6152, 1.6586, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.5504, 1.7678, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.4881, 1.6571, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.3611, 1.6556, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.2963, 1.7648, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.3585, 1.8756, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.2315, 1.8741, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.1667, 1.9833, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.2289, 2.0941, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.3559, 2.0956, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.2911, 2.2049, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.3533, 2.3156, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.4803, 2.3171, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.5452, 2.2079, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.6074, 2.3186, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.7344, 2.3201, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.6696, 2.4294, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.7318, 2.5401, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.6048, 2.5386, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.5399, 2.6479, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.6022, 2.7587, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.7292, 2.7602, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.6644, 2.8694, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.7266, 2.9802, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.5996, 2.9787, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.5347, 3.0879, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.4725, 2.9772, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.3455, 2.9757, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.2807, 3.0849, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.3429, 3.1957, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.2159, 3.1942, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.1511, 3.3035, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.0888, 3.1927, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.9618, 3.1912, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(3.0266, 3.0819, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.9644, 2.9712, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.8374, 2.9697, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.7726, 3.0789, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.7104, 2.9682, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.5833, 2.9667, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.5185, 3.0759, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.5807, 3.1867, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.4537, 3.1852, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.3889, 3.2944, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.4511, 3.4052, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.5781, 3.4067, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.5133, 3.5160, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.5755, 3.6267, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.4485, 3.6252, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.3837, 3.7345, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.3215, 3.6237, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.1944, 3.6222, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.1296, 3.7315, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.1918, 3.8422, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.0648, 3.8407, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(2.0000, 3.9500, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.9352, 3.8407, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.8082, 3.8422, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.8704, 3.7315, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.8056, 3.6222, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.6785, 3.6237, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.6163, 3.7345, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.5515, 3.6252, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.4245, 3.6267, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.4867, 3.5160, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.4219, 3.4067, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.5489, 3.4052, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.6111, 3.2944, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.5463, 3.1852, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.4193, 3.1867, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.4815, 3.0759, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.4167, 2.9667, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.2896, 2.9682, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.2274, 3.0789, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.1626, 2.9697, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.0356, 2.9712, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.9734, 3.0819, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(1.0382, 3.1912, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.9112, 3.1927, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.8489, 3.3035, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.7841, 3.1942, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.6571, 3.1957, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.7193, 3.0849, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.6545, 2.9757, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.5275, 2.9772, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.4653, 3.0879, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.4004, 2.9787, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.2734, 2.9802, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.3356, 2.8694, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.2708, 2.7602, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.3978, 2.7587, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.4601, 2.6479, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.3952, 2.5386, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.2682, 2.5401, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.3304, 2.4294, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.2656, 2.3201, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.3926, 2.3186, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.4548, 2.2079, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.5197, 2.3171, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.6467, 2.3156, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.7089, 2.2049, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.6441, 2.0956, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.7711, 2.0941, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.8333, 1.9833, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.7685, 1.8741, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.6415, 1.8756, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.7037, 1.7648, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.6389, 1.6556, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.5119, 1.6571, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.4496, 1.7678, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.3848, 1.6586, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.2578, 1.6601, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.3200, 1.5493, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.2552, 1.4400, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.3822, 1.4385, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.4444, 1.3278, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.3796, 1.2185, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.2526, 1.2200, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.3148, 1.1093, 0.0000, 0.0000, 0.0000, 0.0000) + N..... SET_FEED_RATE(10.0000) + N..... STRAIGHT_FEED(0.2500, 1.0000, 0.0000, 0.0000, 0.0000, 0.0000) + N..... STRAIGHT_TRAVERSE(0.2500, 1.0000, 1.0000, 0.0000, 0.0000, 0.0000) + N..... STOP_SPINDLE_TURNING(0) + N..... FINISH() + N..... ON_RESET() + N..... ON_RESET() diff --git a/wasm-port/vendor/linuxcnc/tests/interp/flowsnake/flowsnake.ngc b/wasm-port/vendor/linuxcnc/tests/interp/flowsnake/flowsnake.ngc new file mode 100644 index 0000000..db1a16f --- /dev/null +++ b/wasm-port/vendor/linuxcnc/tests/interp/flowsnake/flowsnake.ngc @@ -0,0 +1,41 @@ +% +(Program to mill a flowsnake) +(K. Lerman) + +o sub +# = #1 +# = #2 +# = #3 +# = #4 +# = #5 + + o if [# EQ 0] + g1 f10 x# y# + o else + # = [[# * 2 + #]/3] + # = [[# * 2 + #]/3] + + # = [[# + #]/2 + [# - #]/[SQRT[12.0]]] + # = [[# + #]/2 - [# - #]/[SQRT[12.0]]] + + # = [[# + 2 * #]/3] + # = [[# + 2 * #]/3] + + o call [#-1] [#] [#] [#] [#] + o call [#-1] [#] [#] [#] [#] + o call [#-1] [#] [#] [#] [#] + o call [#-1] [#] [#] [#] [#] + o endif +o endsub + +S1M3 +g0 z1 +g0 x.25 y1.0 +g1 f10 z0 +# = 3 +o call [#] [.25] (will this comment cause problems) [1.0] [3.75] [1.0] +o call [#] [3.75] [1.0] [2.0] [3.95] +o call [#] [2.0] [3.95] [.25] [1.0] +g0 z1 +M5 +% diff --git a/wasm-port/vendor/linuxcnc/tests/interp/flowsnake/test.sh b/wasm-port/vendor/linuxcnc/tests/interp/flowsnake/test.sh new file mode 100644 index 0000000..18893aa --- /dev/null +++ b/wasm-port/vendor/linuxcnc/tests/interp/flowsnake/test.sh @@ -0,0 +1,3 @@ +#!/bin/bash +rs274 -g flowsnake.ngc | awk '{$1=""; print}' +exit "${PIPESTATUS[0]}"