按建议,继续完成后续工作

结论:arc_semantics 已纳入 upstream rs274 side-by-side fixture baseline,ARC_FEED 几何参数按 LinuxCNC rs274 输出精度标准化,完整 native probes 验证通过。
This commit is contained in:
2026-06-07 23:14:45 +08:00
parent 0bb161a4bb
commit c79b431019
3 changed files with 59 additions and 13 deletions

View File

@@ -109,14 +109,14 @@ machine-session validation remain future work.
The current fixture expectations validate standalone behavior against both the The current fixture expectations validate standalone behavior against both the
vendored LinuxCNC source path and an upstream `rs274` side-by-side baseline for vendored LinuxCNC source path and an upstream `rs274` side-by-side baseline for
parser/conversion, offsets, feed-control, comment/logging, numbered-parameter, parser/conversion, arc geometry, offsets, feed-control, comment/logging,
probing, spindle-orient, file-open reset, file-finish, tool-reload, and O-word numbered-parameter, probing, spindle-orient, file-open reset, file-finish,
subroutine fixtures, plus threading/rigid tap, NURBS dispatch boundaries, and tool-reload, and O-word subroutine fixtures, plus threading/rigid tap, NURBS
the comparable canonical runtime edge and program-end cleanup calls. Fixtures dispatch boundaries, and the comparable canonical runtime edge and program-end
that depend on standalone-only runtime adapters, HAL/INI/tool table setup, cleanup calls. Fixtures that depend on standalone-only runtime adapters,
upstream `rs274` output gaps such as `WAIT` or hidden NURBS control-point HAL/INI/tool table setup, upstream `rs274` output gaps such as `WAIT` or hidden
detail, or richer machine session state still need dedicated native LinuxCNC NURBS control-point detail, or richer machine session state still need
baselines. dedicated native LinuxCNC baselines.
The kinematics probes currently cover LinuxCNC identity/trivial kinematics, The kinematics probes currently cover LinuxCNC identity/trivial kinematics,
the switchable `5axiskins` XYZBCW bridge-mill model, and the TRT `xyzac`/`xyzbc` the switchable `5axiskins` XYZBCW bridge-mill model, and the TRT `xyzac`/`xyzbc`

View File

@@ -67,11 +67,11 @@ semantic rewrites:
source. source.
- Fixture expectations are checked against the standalone vendored source - Fixture expectations are checked against the standalone vendored source
path. The upstream `rs274` side-by-side baseline now covers simple motion, path. The upstream `rs274` side-by-side baseline now covers simple motion,
offsets, feed-control, comment/logging, numbered-parameter, probing, arc geometry, offsets, feed-control, comment/logging, numbered-parameter,
spindle-orient, file-open reset, file-finish, tool-reload, and O-word probing, spindle-orient, file-open reset, file-finish, tool-reload, and
subroutine fixtures; it also covers threading/rigid tap, NURBS dispatch O-word subroutine fixtures; it also covers threading/rigid tap, NURBS
boundaries, and comparable canonical runtime edge and program-end cleanup dispatch boundaries, and comparable canonical runtime edge and program-end
calls. Adapter-heavy fixtures, standalone modal-state assertions, and cleanup calls. Adapter-heavy fixtures, standalone modal-state assertions, and
upstream `rs274` output gaps such as `WAIT` or hidden NURBS control-point upstream `rs274` output gaps such as `WAIT` or hidden NURBS control-point
detail still need dedicated native LinuxCNC baselines. detail still need dedicated native LinuxCNC baselines.

View File

@@ -8,6 +8,7 @@ CANON_FIXTURE_DIR="$ROOT_DIR/tests/fixtures/canon"
FIXTURES=( FIXTURES=(
minimal_linear minimal_linear
arc_semantics
canon_runtime_edges canon_runtime_edges
comment_logging comment_logging
coordinate_offsets coordinate_offsets
@@ -45,6 +46,14 @@ normalize_standalone_events() {
return sprintf("%.12g", value + 0) 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) / { /^canon_event=/ || /^(STRAIGHT_(TRAVERSE|FEED)|SET_FEED_RATE) / {
line = $0 line = $0
sub(/^canon_event=/, "", line) sub(/^canon_event=/, "", line)
@@ -266,6 +275,20 @@ normalize_standalone_events() {
next 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. # Upstream rs274 does not emit saicanon WAIT for the M66 case.
if (line ~ /^WAIT /) { if (line ~ /^WAIT /) {
next next
@@ -366,6 +389,14 @@ normalize_upstream_rs274_output() {
return sprintf("%.12g", value + 0) 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) { function trim(value) {
sub(/^[[:space:]]+/, "", value) sub(/^[[:space:]]+/, "", value)
sub(/[[:space:]]+$/, "", value) sub(/[[:space:]]+$/, "", value)
@@ -557,6 +588,15 @@ normalize_upstream_rs274_output() {
next 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\(/) { if (line ~ /^SET_FEED_MODE\(/) {
args = args_of(line) args = args_of(line)
split(args, values, ",") split(args, values, ",")
@@ -695,6 +735,12 @@ for name in "${FIXTURES[@]}"; do
normalize_upstream_rs274_output < "$native_raw" > "$native_norm" normalize_upstream_rs274_output < "$native_raw" > "$native_norm"
normalize_standalone_events < "$expected_file" > "$expected_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 if grep -Eq '^STRAIGHT_(TRAVERSE|FEED)$' "$expected_norm"; then
sparse_ops_file="$TMP_DIR/$name.sparse_ops" sparse_ops_file="$TMP_DIR/$name.sparse_ops"
grep -E '^STRAIGHT_(TRAVERSE|FEED)$' "$expected_norm" > "$sparse_ops_file" grep -E '^STRAIGHT_(TRAVERSE|FEED)$' "$expected_norm" > "$sparse_ops_file"