From c79b431019abb20ee3e73510414560b4c0a60a2f Mon Sep 17 00:00:00 2001 From: wangdequan Date: Sun, 7 Jun 2026 23:14:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E5=BB=BA=E8=AE=AE=EF=BC=8C=E7=BB=A7?= =?UTF-8?q?=E7=BB=AD=E5=AE=8C=E6=88=90=E5=90=8E=E7=BB=AD=E5=B7=A5=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 结论:arc_semantics 已纳入 upstream rs274 side-by-side fixture baseline,ARC_FEED 几何参数按 LinuxCNC rs274 输出精度标准化,完整 native probes 验证通过。 --- wasm-port/docs/compatibility-validation.md | 16 +++---- wasm-port/docs/drift-report.md | 10 ++-- ...verify_native_linuxcnc_fixture_baseline.sh | 46 +++++++++++++++++++ 3 files changed, 59 insertions(+), 13 deletions(-) diff --git a/wasm-port/docs/compatibility-validation.md b/wasm-port/docs/compatibility-validation.md index 06b0b85..44a6b7a 100644 --- a/wasm-port/docs/compatibility-validation.md +++ b/wasm-port/docs/compatibility-validation.md @@ -109,14 +109,14 @@ machine-session validation remain future work. The current fixture expectations validate standalone behavior against both the vendored LinuxCNC source path and an upstream `rs274` side-by-side baseline for -parser/conversion, offsets, feed-control, comment/logging, numbered-parameter, -probing, 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 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. +parser/conversion, arc geometry, offsets, feed-control, comment/logging, +numbered-parameter, probing, 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 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 f1933cf..1986a59 100644 --- a/wasm-port/docs/drift-report.md +++ b/wasm-port/docs/drift-report.md @@ -67,11 +67,11 @@ semantic rewrites: source. - Fixture expectations are checked against the standalone vendored source path. The upstream `rs274` side-by-side baseline now covers simple motion, - offsets, feed-control, comment/logging, numbered-parameter, probing, - 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 and program-end cleanup - calls. Adapter-heavy fixtures, standalone modal-state assertions, and + arc geometry, offsets, feed-control, comment/logging, numbered-parameter, + probing, 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 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. diff --git a/wasm-port/tools/verify_native_linuxcnc_fixture_baseline.sh b/wasm-port/tools/verify_native_linuxcnc_fixture_baseline.sh index 99ec0b9..5f61c1c 100755 --- a/wasm-port/tools/verify_native_linuxcnc_fixture_baseline.sh +++ b/wasm-port/tools/verify_native_linuxcnc_fixture_baseline.sh @@ -8,6 +8,7 @@ CANON_FIXTURE_DIR="$ROOT_DIR/tests/fixtures/canon" FIXTURES=( minimal_linear + arc_semantics canon_runtime_edges comment_logging coordinate_offsets @@ -45,6 +46,14 @@ normalize_standalone_events() { return sprintf("%.12g", value + 0) } + function norm_arc(value, numeric) { + numeric = value + 0 + if (numeric > -0.00005 && numeric < 0.00005) { + numeric = 0 + } + return sprintf("%.4f", numeric) + } + /^canon_event=/ || /^(STRAIGHT_(TRAVERSE|FEED)|SET_FEED_RATE) / { line = $0 sub(/^canon_event=/, "", line) @@ -266,6 +275,20 @@ normalize_standalone_events() { next } + if (line ~ /^ARC_FEED /) { + split(line, fields, /[[:space:]]+/) + for (i in fields) { + split(fields[i], pair, "=") + values[pair[1]] = pair[2] + } + print "ARC_FEED|" norm_arc(values["first_end"]) "|" norm_arc(values["second_end"]) "|" \ + norm_arc(values["first_axis"]) "|" norm_arc(values["second_axis"]) "|" values["rotation"] "|" \ + norm_arc(values["axis_end_point"]) "|" norm_arc(values["a"]) "|" norm_arc(values["b"]) "|" \ + norm_arc(values["c"]) + delete values + next + } + # Upstream rs274 does not emit saicanon WAIT for the M66 case. if (line ~ /^WAIT /) { next @@ -366,6 +389,14 @@ normalize_upstream_rs274_output() { return sprintf("%.12g", value + 0) } + function norm_arc(value, numeric) { + numeric = value + 0 + if (numeric > -0.00005 && numeric < 0.00005) { + numeric = 0 + } + return sprintf("%.4f", numeric) + } + function trim(value) { sub(/^[[:space:]]+/, "", value) sub(/[[:space:]]+$/, "", value) @@ -557,6 +588,15 @@ normalize_upstream_rs274_output() { next } + if (line ~ /^ARC_FEED\(/) { + args = args_of(line) + split(args, values, ",") + print "ARC_FEED|" norm_arc(values[1]) "|" norm_arc(values[2]) "|" norm_arc(values[3]) "|" \ + norm_arc(values[4]) "|" trim(values[5]) "|" norm_arc(values[6]) "|" norm_arc(values[7]) "|" \ + norm_arc(values[8]) "|" norm_arc(values[9]) + next + } + if (line ~ /^SET_FEED_MODE\(/) { args = args_of(line) split(args, values, ",") @@ -695,6 +735,12 @@ for name in "${FIXTURES[@]}"; do normalize_upstream_rs274_output < "$native_raw" > "$native_norm" normalize_standalone_events < "$expected_file" > "$expected_norm" + if [[ "$name" == "arc_semantics" ]]; then + grep -v '^COMMENT|' "$native_norm" > "$TMP_DIR/$name.rs274.no-comments" + grep -v '^COMMENT|' "$expected_norm" > "$TMP_DIR/$name.expected.no-comments" + mv "$TMP_DIR/$name.rs274.no-comments" "$native_norm" + mv "$TMP_DIR/$name.expected.no-comments" "$expected_norm" + fi 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"