From 742bae7f094bb0f9f184d6deb925700465a32ea5 Mon Sep 17 00:00:00 2001 From: wangdequan Date: Sun, 7 Jun 2026 23:32:35 +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 结论:tool_table_setup 已通过专用 rs274 -t 工具表和毫米单位 INI 纳入 upstream side-by-side baseline,完整 native probes 验证通过。 --- wasm-port/docs/compatibility-validation.md | 19 +++++---- wasm-port/docs/drift-report.md | 14 ++++--- ...verify_native_linuxcnc_fixture_baseline.sh | 41 ++++++++++++++++++- 3 files changed, 58 insertions(+), 16 deletions(-) diff --git a/wasm-port/docs/compatibility-validation.md b/wasm-port/docs/compatibility-validation.md index 557591c..34e73ea 100644 --- a/wasm-port/docs/compatibility-validation.md +++ b/wasm-port/docs/compatibility-validation.md @@ -124,19 +124,20 @@ 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, arc geometry, offsets, feed-control, comment/logging, numbered-parameter, probing, spindle-orient, file-open reset, file-finish, -tool-reload, canned-cycle, state-tag motion, 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. +tool-reload, canned-cycle, state-tag motion, tool-table setup, 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-change state, +upstream `rs274` output gaps such as `WAIT` or hidden NURBS control-point +detail, or richer machine session state still need dedicated native LinuxCNC +baselines. Remaining positive fixtures that are not in the upstream `rs274` side-by-side baseline are intentionally held out until they get a dedicated native LinuxCNC baseline: `namedparam_semantics` depends on standalone INI/HAL adapter -resolution, and `tool_semantics`/`tool_table_setup` depend on tool table host -state. `state_tag_motion` now compares its motion events with upstream `rs274`, -while `UPDATE_TAG` events remain a standalone state-tag capture boundary. +resolution, and `tool_semantics` depends on tool-change host state. +`state_tag_motion` now compares its motion events with upstream `rs274`, while +`UPDATE_TAG` events remain a standalone state-tag capture boundary. The kinematics probes currently cover LinuxCNC identity/trivial kinematics, the switchable `5axiskins` XYZBCW bridge-mill model, TRT `xyzac`/`xyzbc` diff --git a/wasm-port/docs/drift-report.md b/wasm-port/docs/drift-report.md index 6e935cf..d319166 100644 --- a/wasm-port/docs/drift-report.md +++ b/wasm-port/docs/drift-report.md @@ -69,15 +69,17 @@ semantic rewrites: path. The upstream `rs274` side-by-side baseline now covers simple motion, arc geometry, offsets, feed-control, comment/logging, numbered-parameter, probing, spindle-orient, file-open reset, file-finish, tool-reload, and - canned-cycle, state-tag motion, 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. + canned-cycle, state-tag motion, tool-table setup, 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. - `canned_cycles` is now in the upstream `rs274` side-by-side baseline after the minimal interpreter harness was aligned with LinuxCNC `Interp::init()` default `G73/G83` peck-clearance values for millimeter units. +- `tool_table_setup` is now in the upstream `rs274` side-by-side baseline using + a dedicated `rs274 -t` tool table and `-i` millimeter-unit INI boundary. ## Current Drift Conclusion diff --git a/wasm-port/tools/verify_native_linuxcnc_fixture_baseline.sh b/wasm-port/tools/verify_native_linuxcnc_fixture_baseline.sh index 89cbb56..277f52d 100755 --- a/wasm-port/tools/verify_native_linuxcnc_fixture_baseline.sh +++ b/wasm-port/tools/verify_native_linuxcnc_fixture_baseline.sh @@ -31,6 +31,7 @@ FIXTURES=( spindle_orient state_tag_motion threading_sync + tool_table_setup tool_reload ) @@ -41,6 +42,16 @@ fi TMP_DIR="$(mktemp -d)" trap 'rm -rf "$TMP_DIR"' EXIT +TOOL_TABLE_BASELINE="$TMP_DIR/tool_table_setup.tbl" +cat > "$TOOL_TABLE_BASELINE" <<'TOOL_TABLE' +T0 P0 ; no tool +T2 P2 Z1.25 D0.25 ; standalone fixture tool 2 +TOOL_TABLE +TOOL_TABLE_INI="$TMP_DIR/tool_table_setup.ini" +cat > "$TOOL_TABLE_INI" <<'TOOL_INI' +[TRAJ] +LINEAR_UNITS = mm +TOOL_INI normalize_standalone_events() { awk ' @@ -250,6 +261,19 @@ normalize_standalone_events() { next } + if (line ~ /^SET_TOOL_TABLE_ENTRY /) { + split(line, fields, /[[:space:]]+/) + for (i in fields) { + split(fields[i], pair, "=") + values[pair[1]] = pair[2] + } + print "SET_TOOL_TABLE_ENTRY|" values["toolno"] "|" norm(values["x"]) "|" \ + norm(values["y"]) "|" norm(values["z"]) "|" \ + norm(values["frontangle"]) "|" norm(values["backangle"]) "|" values["orientation"] + delete values + next + } + if (line ~ /^START_SPEED_FEED_SYNCH /) { split(line, fields, /[[:space:]]+/) for (i in fields) { @@ -571,6 +595,17 @@ normalize_upstream_rs274_output() { next } + if (line ~ /^SET_TOOL_TABLE_ENTRY\(/) { + args = args_of(line) + split(args, values, ",") + gsub(/[[:space:]]+/, " ", values[3]) + split(trim(values[3]), offset, " ") + print "SET_TOOL_TABLE_ENTRY|" trim(values[2]) "|" norm(offset[1]) "|" \ + norm(offset[2]) "|" norm(offset[3]) "|" \ + norm(values[4]) "|" norm(values[5]) "|" trim(values[6]) + next + } + if (line ~ /^START_SPEED_FEED_SYNC\(/) { args = args_of(line) split(args, values, ",") @@ -725,7 +760,11 @@ for name in "${FIXTURES[@]}"; do fi set +e - "$UPSTREAM_RS274" -g "$gcode_file" > "$native_raw" 2>&1 + if [[ "$name" == "tool_table_setup" ]]; then + "$UPSTREAM_RS274" -g -i "$TOOL_TABLE_INI" -t "$TOOL_TABLE_BASELINE" "$gcode_file" > "$native_raw" 2>&1 + else + "$UPSTREAM_RS274" -g "$gcode_file" > "$native_raw" 2>&1 + fi rs274_rc=$? set -e