From facffaab89ea8895a6d29c42721568b09461bb99 Mon Sep 17 00:00:00 2001 From: wangdequan Date: Sun, 7 Jun 2026 18:36:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E6=8E=A8=E8=8D=90=E5=BB=BA=E8=AE=AE?= =?UTF-8?q?=EF=BC=8C=E7=BB=A7=E7=BB=AD=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 结论:记录 LinuxCNC 上游 commit 与本地构建/fixture 基线,新增 upstream baseline 验证并接入 native 验证,确保 vendored 源码同步绑定到明确的 LinuxCNC 源程序版本。 --- wasm-port/docs/porting-steps-standalone.md | 4 ++ wasm-port/docs/scope-and-baseline.md | 64 +++++++++++++++++++ .../tests/native/verify_native_probes.sh | 1 + wasm-port/tools/upstream-baseline.txt | 1 + wasm-port/tools/verify_upstream_baseline.sh | 34 ++++++++++ 5 files changed, 104 insertions(+) create mode 100644 wasm-port/docs/scope-and-baseline.md create mode 100644 wasm-port/tools/upstream-baseline.txt create mode 100755 wasm-port/tools/verify_upstream_baseline.sh diff --git a/wasm-port/docs/porting-steps-standalone.md b/wasm-port/docs/porting-steps-standalone.md index 1d15488..32a7ae9 100644 --- a/wasm-port/docs/porting-steps-standalone.md +++ b/wasm-port/docs/porting-steps-standalone.md @@ -493,6 +493,10 @@ Current verified progress: `vendor/linuxcnc/`. This keeps G-code group conversion on the vendored LinuxCNC `interp_convert.cc` path instead of allowing the wrapper layer to grow another project-authored conversion implementation. +- `docs/scope-and-baseline.md` records the current upstream LinuxCNC commit, + local tool versions, and fixture baseline. `tools/verify_upstream_baseline.sh` + now runs before vendor sync validation so extraction drift is checked against + the intended upstream HEAD, not an accidental checkout change. ## Phase 4: Port INI Parsing Without Editing Upstream diff --git a/wasm-port/docs/scope-and-baseline.md b/wasm-port/docs/scope-and-baseline.md new file mode 100644 index 0000000..5af7057 --- /dev/null +++ b/wasm-port/docs/scope-and-baseline.md @@ -0,0 +1,64 @@ +# Scope And Baseline + +## Upstream Source Baseline + +The standalone port currently treats `../linuxcnc/` as the read-only upstream +source provider. + +- Upstream repository: `../linuxcnc` +- Upstream branch at baseline: `master` +- Upstream commit: `60597ee0718873d2449058c824262a275e5e4bad` +- Upstream subject: `Merge pull request #4043 from grandixximo/docs-inkscape-rsvg-shim` +- Upstream author: `andypugh` +- Upstream commit date: `2026-05-19T15:26:50+01:00` + +The upstream working tree is allowed to contain unrelated local files, but the +vendored-source validation is tied to the commit above. If upstream HEAD +changes, re-run extraction intentionally and update this baseline in the same +change. + +## Local Build Assumptions + +- C++ compiler: `g++ (Debian 14.2.0-19) 14.2.0` +- C compiler: `gcc (Debian 14.2.0-19) 14.2.0` +- Python: `Python 3.13.5` +- Node.js: `v20.19.2` +- Emscripten: `emcc 3.1.69` + +## Current Fixture Baseline + +The native standalone validation currently uses the fixture set under +`tests/fixtures/`. + +G-code fixture coverage includes: + +- linear traverse and feed +- arc semantics +- modal incremental and absolute distance modes +- position parameters +- canned cycles +- coordinate offsets +- feed and motion control modes +- probe semantics +- spindle-synchronized threading and rigid tap +- NURBS G5 and G6 +- spindle orient +- tool semantics and tool table setup +- named and numbered parameters +- O-word subroutines +- program-end modal reset +- canonical runtime edge calls + +Negative fixture coverage includes: + +- zero-feed `G1` +- arc radius mismatch +- zero-radius arc +- read-only named parameter writes +- read-only numbered parameter writes +- missing tool +- missing tool length offset + +Machine baseline is still limited to standalone interpreter and trajectory +planner probes. Full 3-axis, non-trivial kinematics, and 5-axis machine +baselines remain future work. diff --git a/wasm-port/tests/native/verify_native_probes.sh b/wasm-port/tests/native/verify_native_probes.sh index 74cfbfb..2f716dc 100755 --- a/wasm-port/tests/native/verify_native_probes.sh +++ b/wasm-port/tests/native/verify_native_probes.sh @@ -9,6 +9,7 @@ GCODE_ERROR_FIXTURE_DIR="$ROOT_DIR/tests/fixtures/gcode_errors" CANON_ERROR_FIXTURE_DIR="$ROOT_DIR/tests/fixtures/canon_errors" NAMEDPARAM_INI_FIXTURE="$ROOT_DIR/tests/fixtures/ini/namedparams.ini" +"$ROOT_DIR/tools/verify_upstream_baseline.sh" "$ROOT_DIR/tools/verify_vendor_sync.sh" "$ROOT_DIR/tools/verify_no_standalone_cnc_semantics.sh" "$ROOT_DIR/tools/build_native_probes.sh" diff --git a/wasm-port/tools/upstream-baseline.txt b/wasm-port/tools/upstream-baseline.txt new file mode 100644 index 0000000..7c25db7 --- /dev/null +++ b/wasm-port/tools/upstream-baseline.txt @@ -0,0 +1 @@ +60597ee0718873d2449058c824262a275e5e4bad diff --git a/wasm-port/tools/verify_upstream_baseline.sh b/wasm-port/tools/verify_upstream_baseline.sh new file mode 100755 index 0000000..bf969e3 --- /dev/null +++ b/wasm-port/tools/verify_upstream_baseline.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)" +UPSTREAM_DIR="$ROOT_DIR/../linuxcnc" +BASELINE_FILE="$ROOT_DIR/tools/upstream-baseline.txt" + +if [[ ! -d "$UPSTREAM_DIR/.git" ]]; then + echo "missing upstream git repository: $UPSTREAM_DIR" >&2 + exit 1 +fi + +if [[ ! -f "$BASELINE_FILE" ]]; then + echo "missing upstream baseline file: $BASELINE_FILE" >&2 + exit 1 +fi + +expected="$(sed -n '1p' "$BASELINE_FILE" | tr -d '[:space:]')" +actual="$(git -C "$UPSTREAM_DIR" rev-parse HEAD)" + +if [[ -z "$expected" ]]; then + echo "empty upstream baseline file: $BASELINE_FILE" >&2 + exit 1 +fi + +if [[ "$actual" != "$expected" ]]; then + echo "upstream baseline mismatch:" >&2 + echo " expected: $expected" >&2 + echo " actual: $actual" >&2 + echo "Update tools/upstream-baseline.txt and docs/scope-and-baseline.md only after an intentional upstream sync." >&2 + exit 1 +fi + +echo "upstream baseline validation complete"