按建议继续完成后续工作

结论:upstream rs274 side-by-side 基线已扩展到 program-end cleanup canonical 调用;standalone modal-state assertions 仍由 harness 覆盖,完整 native 验证已通过。
This commit is contained in:
2026-06-07 23:04:53 +08:00
parent f408d0b157
commit acb207c23e
4 changed files with 59 additions and 13 deletions

View File

@@ -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