diff --git a/wasm-port/docs/drift-report.md b/wasm-port/docs/drift-report.md index 3848b25..dac67d8 100644 --- a/wasm-port/docs/drift-report.md +++ b/wasm-port/docs/drift-report.md @@ -55,9 +55,9 @@ semantic rewrites: - Full machine baselines beyond the current identity/trivial, `5axiskins`, TRT, delta, SCARA, PUMA, serial `genserkins`, hexapod `genhexkins`, pentapod `pentakins`, and other existing runtime probes are not established. -- Positive cutter-compensated motion is not yet a standalone runtime baseline; - current cutter compensation coverage is limited to vendored interpreter - rejection paths. +- Positive cutter-compensated motion and cutter compensation rejection paths + now have standalone interpreter fixture coverage through vendored LinuxCNC + source. - Fixture expectations are currently checked against the standalone vendored source path, not by running a native LinuxCNC binary for every fixture. diff --git a/wasm-port/docs/porting-steps-standalone.md b/wasm-port/docs/porting-steps-standalone.md index 8048d0e..abff659 100644 --- a/wasm-port/docs/porting-steps-standalone.md +++ b/wasm-port/docs/porting-steps-standalone.md @@ -394,6 +394,14 @@ Current verified progress: cutter radius compensation. The source basis is vendored `interp_convert.cc::convert_cutter_compensation_on()` and `interp_convert.cc::convert_set_plane()`. +- `runtime/core/linuxcnc_wrap/linuxcnc_runtime_state_stubs.cpp` now initializes + `setup::cutter_comp_firstmove` to the same initial value as vendored + `rs274ngc_pre.cc`, allowing the first cutter-compensated straight move to + follow LinuxCNC `interp_convert.cc::convert_straight_comp1()` instead of the + subsequent-move path. `tests/fixtures/gcode/cutter_comp_motion.ngc` and + `tests/fixtures/canon/cutter_comp_motion.events` pin positive `G41.1`/`G40` + compensated straight-feed output through vendored `interp_convert.cc` and + `interp_queue.cc`. - `runtime/core/linuxcnc_wrap/linuxcnc_interp_minimal_runtime.cpp` now records feed/control canonical boundary calls emitted by vendored LinuxCNC conversion and queue code: `SET_TRAVERSE_RATE`, `SET_FEED_REFERENCE`, diff --git a/wasm-port/docs/scope-and-baseline.md b/wasm-port/docs/scope-and-baseline.md index 04fc1df..5a560cf 100644 --- a/wasm-port/docs/scope-and-baseline.md +++ b/wasm-port/docs/scope-and-baseline.md @@ -41,6 +41,7 @@ G-code fixture coverage includes: - canned cycles - coordinate offsets - feed and motion control modes +- cutter compensation motion - probe semantics - spindle-synchronized threading and rigid tap - NURBS G5 and G6 diff --git a/wasm-port/docs/source-reuse-map.md b/wasm-port/docs/source-reuse-map.md index 0464adf..8bfd35c 100644 --- a/wasm-port/docs/source-reuse-map.md +++ b/wasm-port/docs/source-reuse-map.md @@ -66,9 +66,8 @@ Current validation is intentionally mechanical: source-probe level. Serial `genserkins`, hexapod `genhexkins`, and pentapod `pentakins` have native runtime baselines; full runtime machine baselines for userspace genser flows are not yet established. -- Cutter compensation negative interpreter paths are fixture-covered through - vendored `interp_convert.cc`, but a positive cutter-compensated motion - runtime baseline is not yet established for the standalone harness. +- 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. - OPFS persistence is not yet connected to INI, tool table, parameter file, or diff --git a/wasm-port/runtime/core/linuxcnc_wrap/linuxcnc_runtime_state_stubs.cpp b/wasm-port/runtime/core/linuxcnc_wrap/linuxcnc_runtime_state_stubs.cpp index 9207e74..de1d23d 100644 --- a/wasm-port/runtime/core/linuxcnc_wrap/linuxcnc_runtime_state_stubs.cpp +++ b/wasm-port/runtime/core/linuxcnc_wrap/linuxcnc_runtime_state_stubs.cpp @@ -132,7 +132,7 @@ setup::setup() toolchange_flag(0), input_index(0), input_digital(0), - cutter_comp_firstmove(0), + cutter_comp_firstmove(true), program_x(0.0), program_y(0.0), program_z(0.0), diff --git a/wasm-port/tests/fixtures/canon/cutter_comp_motion.events b/wasm-port/tests/fixtures/canon/cutter_comp_motion.events new file mode 100644 index 0000000..b477899 --- /dev/null +++ b/wasm-port/tests/fixtures/canon/cutter_comp_motion.events @@ -0,0 +1,7 @@ +canon_event=SELECT_PLANE plane=1 +canon_event=STRAIGHT_TRAVERSE line=1 x=0 y=0 z=0 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=COMMENT: interpreter: cutter radius compensation on left +canon_event=SET_FEED_RATE rate=60 +canon_event=STRAIGHT_FEED line=3 x=0.9 y=0.1 z=0 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=STRAIGHT_FEED line=4 x=0.9 y=1 z=0 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=COMMENT: interpreter: cutter radius compensation off diff --git a/wasm-port/tests/fixtures/gcode/cutter_comp_motion.ngc b/wasm-port/tests/fixtures/gcode/cutter_comp_motion.ngc new file mode 100644 index 0000000..db25d8b --- /dev/null +++ b/wasm-port/tests/fixtures/gcode/cutter_comp_motion.ngc @@ -0,0 +1,5 @@ +G90 G17 G0 X0 Y0 +G41.1 D0.2 +G1 X1 Y0 F60 +G1 X1 Y1 +G40