结论:probe_semantics 已纳入 native LinuxCNC rs274 side-by-side fixture baseline,验证文档已同步,完整 native probes 验证通过。
5.6 KiB
Compatibility Validation
Purpose
This document records how the standalone LinuxCNC WASM port currently proves that migrated behavior remains tied to LinuxCNC source code and fixture semantics.
The primary validation command is:
wasm-port/tests/native/verify_native_probes.sh
Validation Chain
The native validation script runs these checks in order:
tools/verify_upstream_baseline.shConfirms../linuxcncis at the recorded upstream commit intools/upstream-baseline.txt.tools/verify_vendor_sync.shConfirms every manifest file is present invendor/linuxcnc/, no extra vendored file exists, and every vendored file is byte-identical to upstream.tools/verify_no_standalone_cnc_semantics.shConfirms standalone code has not reintroducedInterp::convert_g().tools/verify_native_linuxcnc_fixture_baseline.shRuns a side-by-side fixture baseline through upstream../linuxcnc/bin/rs274and compares normalized canonical events for fixtures that do not require standalone-only runtime adapters.tools/build_native_probes.shBuilds native source probes and standalone harnesses from vendored LinuxCNC source plus narrow runtime wrappers.tests/native/verify_native_probes.shChecks probe exit codes, source-probe coverage, harness stdout, canonical fixture events, and expected error behavior.
Source Coverage
Every .c and .cc entry in tools/source-manifest.txt must have a
corresponding *_source_probe entry in build/native/source-probes.tsv.
The validation fails if:
- a manifest source file lacks a source probe;
- a source probe references a file not listed in the manifest;
- a manifest file is duplicated;
- vendored files drift byte-for-byte from upstream LinuxCNC.
Current Native Harnesses
| Harness | Purpose |
|---|---|
linuxcnc_ini_probe |
Validates vendored LinuxCNC INI parsing can be used standalone. |
linuxcnc_interp_state_probe |
Validates interpreter state constants and structs compile under the standalone boundary. |
linuxcnc_namedparam_harness |
Validates LinuxCNC named parameter behavior, _ini[...], and _hal[...] adapter resolution. |
linuxcnc_interp_minimal_harness |
Runs G-code fixtures through vendored LinuxCNC parser/execution/conversion code and captures canonical events. |
linuxcnc_parameter_file_harness |
Validates LinuxCNC parameter file restore/save behavior and required/read-only parameter handling. |
linuxcnc_interp_init_harness |
Validates vendored LinuxCNC Interp::init() emits canonical initialization boundaries through the standalone event sink. |
linuxcnc_indexer_harness |
Validates vendored LinuxCNC single-axis rotary indexer dispatch emits lock/unlock and motion boundaries through the standalone event sink. |
linuxcnc_tp_api_probe |
Validates vendored LinuxCNC trajectory planner calls for linear, arc, and queued motion paths. |
linuxcnc_kinematics_probe |
Validates vendored LinuxCNC trivkins.c plus kins_util.c initialize and perform identity forward/inverse mapping through the standalone HAL/RTAPI boundary. |
linuxcnc_5axis_kinematics_probe |
Validates vendored LinuxCNC 5axiskins.c through switchkins.c, including 5-axis forward/inverse round-trip behavior and switching to identity kinematics. |
linuxcnc_xyzac_trt_kinematics_probe |
Validates vendored LinuxCNC XYZAC TRT kinematics through switchkins.c, including forward/inverse round-trip behavior and switching to identity kinematics. |
linuxcnc_xyzbc_trt_kinematics_probe |
Validates vendored LinuxCNC XYZBC TRT kinematics through switchkins.c, including forward/inverse round-trip behavior and switching to identity kinematics. |
Fixture Coverage
Positive G-code fixtures currently cover:
- linear traverse/feed
- arc semantics
- modal absolute/incremental motion
- position parameters
- canned cycles
- coordinate offsets
- G53 machine-coordinate motion
- feed and motion control modes
- probing
- threading and rigid tap
- NURBS G5/G6
- spindle orient
- tool semantics
- tool table setup
- tool-data reload boundary
- interpreter state-tag boundary
- percent-delimited file
FINISHboundary - file-open
ON_RESETboundary - comment logging canonical calls
- named and numbered parameters
- O-word subroutines
- program-end modal reset
- canonical runtime edge calls
Negative fixtures currently cover:
- zero-feed
G1 - arc radius mismatch
- zero-radius arc
- G53 incremental-mode rejection
- read-only named parameter writes
- read-only numbered parameter writes
- missing tool
- missing tool length offset
Validation Boundaries
Current validation is native-only. WASM, browser, SDK, OPFS, and full 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.
The kinematics probes currently cover LinuxCNC identity/trivial kinematics,
the switchable 5axiskins XYZBCW bridge-mill model, and the TRT xyzac/xyzbc
table-rotary models. Serial, delta, SCARA, and other machine-specific
kinematics still need dedicated baselines.