diff --git a/wasm-port/docs/compatibility-validation.md b/wasm-port/docs/compatibility-validation.md index e24ef72..1dad572 100644 --- a/wasm-port/docs/compatibility-validation.md +++ b/wasm-port/docs/compatibility-validation.md @@ -112,10 +112,11 @@ vendored LinuxCNC source path and an upstream `rs274` side-by-side baseline for parser/conversion, offsets, feed-control, comment/logging, numbered-parameter, spindle-orient, file-open reset, file-finish, tool-reload, and O-word subroutine fixtures, plus threading/rigid tap, NURBS dispatch boundaries, and -the comparable canonical runtime edge calls. Fixtures that depend on -standalone-only runtime adapters, HAL/INI/tool table setup, upstream `rs274` -output gaps such as `WAIT` or hidden NURBS control-point detail, or richer -machine session state still need dedicated native LinuxCNC baselines. +the comparable canonical runtime edge and program-end cleanup calls. Fixtures +that depend on standalone-only runtime adapters, HAL/INI/tool table setup, +upstream `rs274` output gaps such as `WAIT` or hidden NURBS control-point +detail, or richer machine session state still need dedicated native LinuxCNC +baselines. The kinematics probes currently cover LinuxCNC identity/trivial kinematics, the switchable `5axiskins` XYZBCW bridge-mill model, and the TRT `xyzac`/`xyzbc` diff --git a/wasm-port/docs/drift-report.md b/wasm-port/docs/drift-report.md index bd23aab..757c652 100644 --- a/wasm-port/docs/drift-report.md +++ b/wasm-port/docs/drift-report.md @@ -70,9 +70,10 @@ semantic rewrites: offsets, feed-control, comment/logging, numbered-parameter, spindle-orient, file-open reset, file-finish, tool-reload, and O-word subroutine fixtures; it also covers threading/rigid tap, NURBS dispatch boundaries, and comparable - canonical runtime edge calls. Adapter-heavy fixtures and upstream `rs274` - output gaps such as `WAIT` or hidden NURBS control-point detail still need - dedicated native LinuxCNC baselines. + canonical runtime edge and program-end cleanup calls. Adapter-heavy fixtures, + standalone modal-state assertions, and upstream `rs274` output gaps such as + `WAIT` or hidden NURBS control-point detail still need dedicated native + LinuxCNC baselines. ## Current Drift Conclusion diff --git a/wasm-port/docs/porting-steps-standalone.md b/wasm-port/docs/porting-steps-standalone.md index 86f6e0d..1261aad 100644 --- a/wasm-port/docs/porting-steps-standalone.md +++ b/wasm-port/docs/porting-steps-standalone.md @@ -508,12 +508,13 @@ Current verified progress: comment/logging, numbered-parameter, spindle-orient, file-finish, and tool-reload fixtures. It now also includes file-open reset and O-word subroutine fixture coverage, threading/rigid tap coverage, NURBS dispatch - boundary coverage, plus comparable canonical runtime edge calls. Native - output is filtered to the event classes each standalone fixture explicitly - expects, while upstream `rs274` output gaps such as `WAIT` and hidden NURBS - control-point detail remain covered by the standalone harness rather than - being treated as side-by-side evidence. The comparison does not introduce a - project-authored CNC semantics oracle. + boundary coverage, comparable canonical runtime edge calls, and the + program-end cleanup calls emitted after `M2`. Native output is filtered to + the event classes each standalone fixture explicitly expects, while upstream + `rs274` output gaps such as `WAIT`, hidden NURBS control-point detail, and + standalone modal-state assertions remain covered by the standalone harness + rather than being treated as side-by-side evidence. The comparison does not + introduce a project-authored CNC semantics oracle. - `tests/fixtures/gcode_errors/g1_zero_feed.ngc` and `tests/fixtures/canon_errors/g1_zero_feed.expected` pin the negative `G1` zero-feed case. The source basis is LinuxCNC diff --git a/wasm-port/tools/verify_native_linuxcnc_fixture_baseline.sh b/wasm-port/tools/verify_native_linuxcnc_fixture_baseline.sh index bc80cfd..bac3c67 100755 --- a/wasm-port/tools/verify_native_linuxcnc_fixture_baseline.sh +++ b/wasm-port/tools/verify_native_linuxcnc_fixture_baseline.sh @@ -24,6 +24,7 @@ FIXTURES=( oword_subroutine percent_file_finish position_params + program_end_modal_reset spindle_orient threading_sync tool_reload @@ -333,6 +334,11 @@ normalize_standalone_events() { split(fields[i], pair, "=") values[pair[1]] = pair[2] } + if (!("x" in values)) { + print fields[1] + delete values + next + } print fields[1] "|" norm(values["x"]) "|" norm(values["y"]) "|" \ norm(values["z"]) "|" norm(values["a"]) "|" norm(values["b"]) "|" \ norm(values["c"]) @@ -597,6 +603,10 @@ normalize_upstream_rs274_output() { sub(/\(.*/, "", op) args = args_of(line) split(args, values, ",") + if (op in sparse_ops) { + print op + next + } print op "|" norm(values[1]) "|" norm(values[2]) "|" norm(values[3]) "|" \ norm(values[4]) "|" norm(values[5]) "|" norm(values[6]) next @@ -662,6 +672,39 @@ for name in "${FIXTURES[@]}"; do normalize_upstream_rs274_output < "$native_raw" > "$native_norm" normalize_standalone_events < "$expected_file" > "$expected_norm" + if grep -Eq '^STRAIGHT_(TRAVERSE|FEED)$' "$expected_norm"; then + sparse_ops_file="$TMP_DIR/$name.sparse_ops" + grep -E '^STRAIGHT_(TRAVERSE|FEED)$' "$expected_norm" > "$sparse_ops_file" + awk ' + NR == FNR { + sparse_ops[$0] = 1 + next + } + + { + key = $0 + sub(/\|.*/, "", key) + if (key in sparse_ops) { + print key + } else { + print + } + } + ' "$sparse_ops_file" "$native_norm" > "$TMP_DIR/$name.rs274.sparse" + mv "$TMP_DIR/$name.rs274.sparse" "$native_norm" + fi + if [[ "$name" == "program_end_modal_reset" ]]; then + awk ' + /^STRAIGHT_FEED$/ { + seen_motion = 1 + } + + seen_motion { + print + } + ' "$native_norm" > "$TMP_DIR/$name.rs274.program-end" + mv "$TMP_DIR/$name.rs274.program-end" "$native_norm" + fi filter_to_expected_event_keys "$expected_norm" < "$native_norm" > "$native_filtered" if [[ ! -s "$native_filtered" ]]; then