按规划继续工作
结论:新增 namedparam_ini_semantics 夹具,将本地命名参数和 _ini[...] 查询纳入 upstream rs274 -i 基线,并接入 Node WASM 与浏览器 INI-aware 解释器 smoke;HAL 查询继续保留在 standalone adapter 边界。
This commit is contained in:
@@ -250,7 +250,7 @@ Positive G-code fixtures currently cover:
|
||||
- percent-delimited file `FINISH` boundary
|
||||
- file-open `ON_RESET` boundary
|
||||
- comment logging canonical calls
|
||||
- named and numbered parameters
|
||||
- local, INI-backed named parameters and numbered parameters
|
||||
- O-word subroutines
|
||||
- program-end modal reset
|
||||
- canonical runtime edge calls
|
||||
@@ -276,14 +276,16 @@ for `minimal_linear`, `arc_semantics`, `length_units`, `modal_incremental`,
|
||||
`comment_logging`, `numbered_params`, `tool_semantics`, `tool_table_setup`,
|
||||
`tool_reload`, `canned_cycles`, `cutter_comp_motion`, `threading_sync`,
|
||||
`nurbs_g5_semantics`, `nurbs_g6_semantics`, `state_tag_motion`,
|
||||
`canon_runtime_edges`, `program_end_modal_reset`, and `namedparam_semantics`
|
||||
through both Node WASM and browser INI-aware program ABI smoke coverage,
|
||||
`canon_runtime_edges`, `program_end_modal_reset`, `namedparam_ini_semantics`,
|
||||
and `namedparam_semantics` through both Node WASM and browser INI-aware
|
||||
program ABI smoke coverage,
|
||||
plus the `g1_zero_feed`, `arc_radius_mismatch`, `arc_zero_radius`,
|
||||
`cutter_comp_plane_change`, `g53_incremental`, `namedparam_readonly`,
|
||||
`numbered_param_readonly`, `tool_not_found`, and
|
||||
`tool_length_offset_not_found` negative fixtures. The WASM interpreter file
|
||||
path additionally covers the same canonical-event fixture group, plus
|
||||
`namedparam_semantics` through the INI-aware file execution ABI,
|
||||
`namedparam_ini_semantics` and `namedparam_semantics` through the INI-aware
|
||||
file execution ABI,
|
||||
`file_open_reset`, `percent_file_finish`, and `oword_subroutine`.
|
||||
`position_params` uses a dedicated file-path expectation under
|
||||
`tests/fixtures/canon_file/` because LinuxCNC file execution advances the
|
||||
@@ -369,6 +371,7 @@ Node WASM `Interp::execute()` coverage currently includes:
|
||||
- `state_tag_motion`
|
||||
- `canon_runtime_edges`
|
||||
- `program_end_modal_reset`
|
||||
- `namedparam_ini_semantics` through the INI-aware program ABI
|
||||
- `namedparam_semantics` through the INI-aware program ABI
|
||||
|
||||
Node WASM file-path coverage currently includes:
|
||||
@@ -400,6 +403,7 @@ Node WASM file-path coverage currently includes:
|
||||
- `percent_file_finish`
|
||||
- `oword_subroutine`
|
||||
- `position_params` through the dedicated `canon_file/` expectation
|
||||
- `namedparam_ini_semantics` through the INI-aware file ABI
|
||||
- `namedparam_semantics` through the INI-aware file ABI
|
||||
|
||||
Node WASM file-path negative coverage currently includes every fixture under
|
||||
@@ -454,6 +458,7 @@ Browser interpreter `Interp::execute()` coverage currently includes:
|
||||
- `canon_runtime_edges`
|
||||
- `tool_reload`
|
||||
- `program_end_modal_reset`
|
||||
- `namedparam_ini_semantics` through the INI-aware program ABI
|
||||
- `namedparam_semantics` through the INI-aware program ABI
|
||||
|
||||
Browser interpreter negative coverage currently includes every fixture under
|
||||
@@ -499,6 +504,7 @@ Browser interpreter file-path coverage currently includes the same
|
||||
- `percent_file_finish`
|
||||
- `oword_subroutine`
|
||||
- `position_params` through the dedicated `canon_file/` expectation
|
||||
- `namedparam_ini_semantics` through the INI-aware file ABI
|
||||
- `namedparam_semantics` through the INI-aware file ABI
|
||||
|
||||
All current positive G-code fixtures have browser interpreter smoke coverage
|
||||
@@ -509,24 +515,27 @@ 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 and feed-state
|
||||
readback, comment/logging,
|
||||
numbered-parameter, probing, spindle-orient, file-open reset, file-finish,
|
||||
numbered-parameter, local named-parameter plus `_ini[...]` lookup through
|
||||
`rs274 -i`, probing, spindle-orient, file-open reset, file-finish,
|
||||
tool-reload, tool select/change/length-offset, 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
|
||||
adapters, HAL/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. `state_tag_motion` now compares its motion events with upstream
|
||||
`rs274`, while `UPDATE_TAG` events remain a standalone state-tag capture
|
||||
boundary. `tool_semantics` now compares T/M6/G43/G49 canonical events with
|
||||
upstream `rs274`; M61 current-pocket host-state behavior remains covered by the
|
||||
standalone fixture expectation, and `Interp::synch()` current/selected tool
|
||||
slot reads are covered by the native init harness.
|
||||
baseline: `namedparam_semantics` still depends on the standalone HAL adapter,
|
||||
while `namedparam_ini_semantics` now covers the local named-parameter and
|
||||
LinuxCNC `_ini[...]` subset against upstream `rs274 -i`. `state_tag_motion`
|
||||
now compares its motion events with upstream `rs274`, while `UPDATE_TAG`
|
||||
events remain a standalone state-tag capture boundary. `tool_semantics` now
|
||||
compares T/M6/G43/G49 canonical events with upstream `rs274`; M61
|
||||
current-pocket host-state behavior remains covered by the standalone fixture
|
||||
expectation, and `Interp::synch()` current/selected tool slot reads are
|
||||
covered by the native init harness.
|
||||
|
||||
The kinematics probes currently cover LinuxCNC identity/trivial kinematics, the
|
||||
switchable `5axiskins` XYZBCW bridge-mill model, TRT `xyzac`/`xyzbc`
|
||||
|
||||
@@ -91,12 +91,13 @@ semantic rewrites:
|
||||
- Fixture expectations are checked against the standalone vendored source
|
||||
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
|
||||
tool select/change/length-offset, canned-cycle, state-tag motion, tool-table
|
||||
local named-parameter plus `_ini[...]` lookup through `rs274 -i`, probing,
|
||||
spindle-orient, file-open reset, file-finish, tool-reload, and tool
|
||||
select/change/length-offset, 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
|
||||
HAL-backed 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
|
||||
@@ -107,6 +108,10 @@ semantic rewrites:
|
||||
- `tool_semantics` now compares its T/M6/G43/G49 canonical subset with
|
||||
upstream `rs274 -t -i`; M61 current-pocket host-state behavior remains a
|
||||
standalone fixture expectation.
|
||||
- `namedparam_ini_semantics` now compares local named-parameter behavior and
|
||||
`_ini[...]` lookup with upstream `rs274 -i`; the broader
|
||||
`namedparam_semantics` fixture still keeps `_hal[...]` lookup on the
|
||||
documented standalone HAL adapter boundary.
|
||||
|
||||
## Current Drift Conclusion
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ G-code fixture coverage includes:
|
||||
- NURBS G5 and G6
|
||||
- spindle orient
|
||||
- tool semantics and tool table setup
|
||||
- named and numbered parameters
|
||||
- local, INI-backed named parameters and numbered parameters
|
||||
- O-word subroutines
|
||||
- program-end modal reset
|
||||
- canonical runtime edge calls
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
saveMachineTextFiles,
|
||||
} from "../../runtime/opfs/machine-file-store.js";
|
||||
import {
|
||||
INTERP_BASELINE_INI_FIXTURE,
|
||||
INTERP_BROWSER_FILE_FIXTURES,
|
||||
INTERP_BROWSER_MDI_FIXTURES,
|
||||
INTERP_ERROR_FIXTURES,
|
||||
@@ -240,6 +241,18 @@
|
||||
namedParamExpectedText,
|
||||
);
|
||||
|
||||
const baselineIniProgramText = await fetchText(
|
||||
`../fixtures/gcode/${INTERP_BASELINE_INI_FIXTURE}.ngc`,
|
||||
);
|
||||
const baselineIniExpectedText = (
|
||||
await fetchText(`../fixtures/canon/${INTERP_BASELINE_INI_FIXTURE}.events`)
|
||||
).trimEnd();
|
||||
verifyExpectedOutput(
|
||||
INTERP_BASELINE_INI_FIXTURE,
|
||||
interp.runProgramWithIni(baselineIniProgramText, namedParamIniPath),
|
||||
baselineIniExpectedText,
|
||||
);
|
||||
|
||||
const positionParamsText = await fetchText(
|
||||
`../fixtures/gcode/${INTERP_POSITION_PARAMS_FILE_FIXTURE}.ngc`,
|
||||
);
|
||||
@@ -273,6 +286,14 @@
|
||||
namedParamExpectedText,
|
||||
);
|
||||
|
||||
const baselineIniPath = `/work/${INTERP_BASELINE_INI_FIXTURE}.ngc`;
|
||||
interp.writeTextFile(baselineIniPath, baselineIniProgramText);
|
||||
verifyExpectedOutput(
|
||||
`${INTERP_BASELINE_INI_FIXTURE}_file`,
|
||||
interp.runFileWithIni(baselineIniPath, namedParamIniPath),
|
||||
baselineIniExpectedText,
|
||||
);
|
||||
|
||||
verifyExpectedOutput(
|
||||
"restore_parameters_missing_file",
|
||||
interp.restoreParameters("/work/browser-missing.var"),
|
||||
|
||||
4
wasm-port/tests/fixtures/canon/namedparam_ini_semantics.events
vendored
Normal file
4
wasm-port/tests/fixtures/canon/namedparam_ini_semantics.events
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
canon_event=MESSAGE: named local=7.2500
|
||||
canon_event=MESSAGE: exists local=1 missing=0
|
||||
canon_event=MESSAGE: ini velocity=35
|
||||
canon_event=PROGRAM_END
|
||||
8
wasm-port/tests/fixtures/gcode/namedparam_ini_semantics.ngc
vendored
Normal file
8
wasm-port/tests/fixtures/gcode/namedparam_ini_semantics.ngc
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
#<local_probe> = 7.25
|
||||
#<exists_local> = EXISTS[#<local_probe>]
|
||||
#<exists_missing> = EXISTS[#<missing_probe>]
|
||||
#<ini_velocity> = #<_ini[traj]max_linear_velocity>
|
||||
(DEBUG, named local=%f#<local_probe>)
|
||||
(DEBUG, exists local=%d#<exists_local> missing=%d#<exists_missing>)
|
||||
(DEBUG, ini velocity=%d#<ini_velocity>)
|
||||
M2
|
||||
@@ -71,4 +71,5 @@ export const INTERP_FILE_FIXTURES = [
|
||||
export const INTERP_BROWSER_FILE_FIXTURES = INTERP_FILE_FIXTURES;
|
||||
|
||||
export const INTERP_INI_FIXTURE = "namedparam_semantics";
|
||||
export const INTERP_BASELINE_INI_FIXTURE = "namedparam_ini_semantics";
|
||||
export const INTERP_POSITION_PARAMS_FILE_FIXTURE = "position_params";
|
||||
|
||||
@@ -5,6 +5,7 @@ import assert from "node:assert/strict";
|
||||
|
||||
import { createLinuxCncInterpSdk } from "../../../runtime/sdk/src/index.js";
|
||||
import {
|
||||
INTERP_BASELINE_INI_FIXTURE,
|
||||
INTERP_ERROR_FIXTURES,
|
||||
INTERP_FILE_FIXTURES,
|
||||
INTERP_INI_FIXTURE,
|
||||
@@ -188,6 +189,20 @@ verifyExpectedOutput(
|
||||
namedParamExpected,
|
||||
);
|
||||
|
||||
const baselineIniProgramText = readFileSync(
|
||||
resolve(rootDir, `tests/fixtures/gcode/${INTERP_BASELINE_INI_FIXTURE}.ngc`),
|
||||
"utf8",
|
||||
);
|
||||
const baselineIniExpected = readFileSync(
|
||||
resolve(rootDir, `tests/fixtures/canon/${INTERP_BASELINE_INI_FIXTURE}.events`),
|
||||
"utf8",
|
||||
).trimEnd();
|
||||
verifyExpectedOutput(
|
||||
INTERP_BASELINE_INI_FIXTURE,
|
||||
interp.runProgramWithIni(baselineIniProgramText, namedParamIniPath),
|
||||
baselineIniExpected,
|
||||
);
|
||||
|
||||
for (const fixtureName of INTERP_ERROR_FIXTURES) {
|
||||
const programText = readFileSync(
|
||||
resolve(rootDir, `tests/fixtures/gcode_errors/${fixtureName}.ngc`),
|
||||
@@ -239,6 +254,14 @@ verifyExpectedOutput(
|
||||
namedParamExpected,
|
||||
);
|
||||
|
||||
const baselineIniFilePath = `/work/${INTERP_BASELINE_INI_FIXTURE}.ngc`;
|
||||
interp.writeTextFile(baselineIniFilePath, baselineIniProgramText);
|
||||
verifyExpectedOutput(
|
||||
`${INTERP_BASELINE_INI_FIXTURE}_file`,
|
||||
interp.runFileWithIni(baselineIniFilePath, namedParamIniPath),
|
||||
baselineIniExpected,
|
||||
);
|
||||
|
||||
const positionParamsFilePath = "/work/position_params.ngc";
|
||||
interp.writeTextFile(
|
||||
positionParamsFilePath,
|
||||
|
||||
@@ -20,6 +20,7 @@ FIXTURES=(
|
||||
length_units
|
||||
plane_selection
|
||||
modal_incremental
|
||||
namedparam_ini_semantics
|
||||
numbered_params
|
||||
nurbs_g5_semantics
|
||||
nurbs_g6_semantics
|
||||
@@ -827,6 +828,8 @@ for name in "${FIXTURES[@]}"; do
|
||||
set +e
|
||||
if [[ "$name" == "tool_table_setup" || "$name" == "tool_semantics" ]]; then
|
||||
"$UPSTREAM_RS274" -g -i "$TOOL_TABLE_INI" -t "$TOOL_TABLE_BASELINE" "$gcode_file" > "$native_raw" 2>&1
|
||||
elif [[ "$name" == "namedparam_ini_semantics" ]]; then
|
||||
"$UPSTREAM_RS274" -g -i "$ROOT_DIR/tests/fixtures/ini/namedparams.ini" "$gcode_file" > "$native_raw" 2>&1
|
||||
else
|
||||
"$UPSTREAM_RS274" -g "$gcode_file" > "$native_raw" 2>&1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user