按规划持续工作

结论:已将 vendored LinuxCNC impeller-7bl-xyzac.ngc 纳入五轴 TRT remap/tool-table/file 执行 baseline,native、Node WASM、browser 和 UI 均通过同源验证,未实现自有 M428/M429/M430 或运动学语义。
This commit is contained in:
2026-06-08 18:37:22 +08:00
parent c6c60c4866
commit 4cd01deafb
10 changed files with 100 additions and 24 deletions

View File

@@ -109,12 +109,13 @@ Emscripten filesystem through the SDK and runs them through LinuxCNC
`Interp::open()`, `Interp::read()`, and `Interp::execute()` to validate the `Interp::open()`, `Interp::read()`, and `Interp::execute()` to validate the
file execution path. It also writes the vendored LinuxCNC `xyzac-trt` and file execution path. It also writes the vendored LinuxCNC `xyzac-trt` and
`xyzbc-trt` table-rotary-tilting sample machine INI, `remap_subs/*.ngc`, and `xyzbc-trt` table-rotary-tilting sample machine INI, `remap_subs/*.ngc`, and
`xyzac_switchkins.ngc`/`xyzbc_switchkins.ngc` plus `boat-xyzac.ngc` and `xyzac_switchkins.ngc`/`xyzbc_switchkins.ngc`, `boat-xyzac.ngc`,
`boat-xyzbc.ngc` demo files into the Emscripten filesystem, then validates the `boat-xyzbc.ngc`, and `impeller-7bl-xyzac.ngc` demo files into the Emscripten
WASM C ABI/SDK path for vendored LinuxCNC `REMAP` parsing, vendored LinuxCNC filesystem, then validates the WASM C ABI/SDK path for vendored LinuxCNC
tool-table loading from the machine INI, O-word remap execution, `M68`/`M66` `REMAP` parsing, vendored LinuxCNC tool-table loading from the machine INI,
HAL synchronization, and file `open()`/`read()`/`execute()` completion O-word remap execution, `M68`/`M66` HAL synchronization, and file
without JavaScript M-code or kinematics semantics. The same Node smoke writes `open()`/`read()`/`execute()` completion without JavaScript M-code or
kinematics semantics. The same Node smoke writes
LinuxCNC-format parameter files into the Emscripten filesystem and validates LinuxCNC-format parameter files into the Emscripten filesystem and validates
vendored `Interp::restore_parameters()` and `Interp::save_parameters()`, vendored `Interp::restore_parameters()` and `Interp::save_parameters()`,
including the saved parameter values, missing required numeric parameter including the saved parameter values, missing required numeric parameter
@@ -197,10 +198,10 @@ override INI-derived names before OPFS text is copied into the LinuxCNC-backed
WASM filesystem, and that absent INI file-name values use the default OPFS WASM filesystem, and that absent INI file-name values use the default OPFS
parameter/tool-table paths in a real browser session. It also writes vendored parameter/tool-table paths in a real browser session. It also writes vendored
LinuxCNC `xyzac-trt`/`xyzbc-trt` INI, remap subroutines, and switchkins demo LinuxCNC `xyzac-trt`/`xyzbc-trt` INI, remap subroutines, and switchkins demo
files, including the larger `boat-xyzac.ngc` and `boat-xyzbc.ngc` demos, into files, including the larger `boat-xyzac.ngc`, `boat-xyzbc.ngc`, and
the browser WASM filesystem and verifies `runFiveAxisRemapFile()` for both `impeller-7bl-xyzac.ngc` demos, into the browser WASM filesystem and verifies
sample machines through the exported LinuxCNC remap/tool-table/file execution `runFiveAxisRemapFile()` for both sample machines through the exported
path. LinuxCNC remap/tool-table/file execution path.
The aggregate host smoke script builds the INI, interpreter-core, and The aggregate host smoke script builds the INI, interpreter-core, and
trajectory-planner WASM artifacts once, then runs the Node WASM smokes, the trajectory-planner WASM artifacts once, then runs the Node WASM smokes, the
@@ -230,7 +231,7 @@ The validation fails if:
| `linuxcnc_interp_init_harness` | Validates vendored LinuxCNC `Interp::init()` emits canonical initialization boundaries, reads metric/inch machine units, and synchronizes current/selected tool slots through standalone status adapters. | | `linuxcnc_interp_init_harness` | Validates vendored LinuxCNC `Interp::init()` emits canonical initialization boundaries, reads metric/inch machine units, and synchronizes current/selected tool slots through standalone status adapters. |
| `linuxcnc_indexer_harness` | Validates vendored LinuxCNC single-axis rotary indexer dispatch emits lock/unlock and motion 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_remap_hal_sync_harness` | Validates vendored LinuxCNC `M68`/`M66` execution can drive the standalone HAL adapter boundary used by 5-axis switchkins remap files, including `_hal[motion.switchkins-type]` readback. | | `linuxcnc_remap_hal_sync_harness` | Validates vendored LinuxCNC `M68`/`M66` execution can drive the standalone HAL adapter boundary used by 5-axis switchkins remap files, including `_hal[motion.switchkins-type]` readback. |
| `linuxcnc_5axis_remap_execute_harness` | Validates vendored LinuxCNC `REMAP` parsing plus NGC remap execution for the 5-axis `M429 -> M428 -> M430 -> M429` switchkins path in the `xyzac-trt` and `xyzbc-trt` sample machines, loads vendored machine tool tables through LinuxCNC `tooldata_load()`, then runs vendored `xyzac_switchkins.ngc`, `xyzbc_switchkins.ngc`, `xyzac_switchkins_test_1.ngc`, `xyzac_switchkins_test_3.ngc`, `boat-xyzac.ngc`, and `boat-xyzbc.ngc` through the LinuxCNC file `open/read/execute` path. | | `linuxcnc_5axis_remap_execute_harness` | Validates vendored LinuxCNC `REMAP` parsing plus NGC remap execution for the 5-axis `M429 -> M428 -> M430 -> M429` switchkins path in the `xyzac-trt` and `xyzbc-trt` sample machines, loads vendored machine tool tables through LinuxCNC `tooldata_load()`, then runs vendored `xyzac_switchkins.ngc`, `xyzbc_switchkins.ngc`, `xyzac_switchkins_test_1.ngc`, `xyzac_switchkins_test_3.ngc`, `boat-xyzac.ngc`, `boat-xyzbc.ngc`, and `impeller-7bl-xyzac.ngc` through the LinuxCNC file `open/read/execute` path. |
| `linuxcnc_tp_api_probe` | Validates vendored LinuxCNC trajectory planner calls for linear, arc, and queued motion paths. | | `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_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_5axis_kinematics_probe` | Validates vendored LinuxCNC `5axiskins.c` through `switchkins.c`, including 5-axis forward/inverse round-trip behavior and switching to identity kinematics. |

View File

@@ -806,13 +806,13 @@ Current five-axis switchkins status:
vendored machine tool tables through LinuxCNC `tooldata_load()`, and runs vendored machine tool tables through LinuxCNC `tooldata_load()`, and runs
vendored `xyzac_switchkins.ngc`, `xyzbc_switchkins.ngc`, vendored `xyzac_switchkins.ngc`, `xyzbc_switchkins.ngc`,
`xyzac_switchkins_test_1.ngc`, `xyzac_switchkins_test_3.ngc`, `xyzac_switchkins_test_1.ngc`, `xyzac_switchkins_test_3.ngc`,
`boat-xyzac.ngc`, and `boat-xyzbc.ngc` through LinuxCNC remap/file `boat-xyzac.ngc`, `boat-xyzbc.ngc`, and `impeller-7bl-xyzac.ngc` through
execution paths. LinuxCNC remap/file execution paths.
7. The WASM interpreter core now links vendored `interp_remap.cc` plus the 7. The WASM interpreter core now links vendored `interp_remap.cc` plus the
Python-only runtime edge stub, and the Node WASM smoke runs vendored Python-only runtime edge stub, and the Node WASM smoke runs vendored
`xyzac_switchkins.ngc`, `xyzbc_switchkins.ngc`, `boat-xyzac.ngc`, and `xyzac_switchkins.ngc`, `xyzbc_switchkins.ngc`, `boat-xyzac.ngc`, and
`boat-xyzbc.ngc` through the SDK C ABI without JavaScript M-code or `boat-xyzbc.ngc`, plus `impeller-7bl-xyzac.ngc` through the SDK C ABI
kinematics semantics. without JavaScript M-code or kinematics semantics.
8. Browser smoke and the INI panel UI now expose the same validated 5-axis 8. Browser smoke and the INI panel UI now expose the same validated 5-axis
remap execution path by copying vendored LinuxCNC sample-machine files into remap execution path by copying vendored LinuxCNC sample-machine files into
the interpreter WASM filesystem and calling the SDK C ABI. the interpreter WASM filesystem and calling the SDK C ABI.
@@ -821,9 +821,9 @@ Next work:
1. Continue broadening five-axis fixture coverage through the same 1. Continue broadening five-axis fixture coverage through the same
source-backed execution boundary. source-backed execution boundary.
2. Evaluate remaining larger vendored LinuxCNC TRT demos such as impeller 2. Evaluate additional vendored LinuxCNC five-axis sample machines and demos
after the boat demos are stable in native, Node WASM, browser, and UI after the TRT boat and impeller demos are stable in native, Node WASM,
remap paths. browser, and UI remap paths.
Involved LinuxCNC source: Involved LinuxCNC source:

View File

@@ -229,6 +229,12 @@ int main()
"configs/sim/axis/vismach/5axis/table-rotary-tilting/demos/boat-xyzbc.ngc", "configs/sim/axis/vismach/5axis/table-rotary-tilting/demos/boat-xyzbc.ngc",
true, true,
true); true);
ok &= check_text_mcodes(
"xyzac_trt_impeller",
"configs/sim/axis/vismach/5axis/table-rotary-tilting/demos/"
"impeller-7bl-xyzac.ngc",
true,
true);
print_bool("fiveaxis_remap_assets_from_linuxcnc", ok); print_bool("fiveaxis_remap_assets_from_linuxcnc", ok);
return ok ? 0 : 1; return ok ? 0 : 1;

View File

@@ -53,7 +53,7 @@ void print_interp_error(Interp &interp, const std::string &label, int rc)
std::cout << label << "_blocktext=" << interp._setup.blocktext << "\n"; std::cout << label << "_blocktext=" << interp._setup.blocktext << "\n";
} }
constexpr int kMaxDemoFileSteps = 4096; constexpr int kMaxDemoFileSteps = 8192;
void seed_switchkins_hal() void seed_switchkins_hal()
{ {
@@ -328,6 +328,12 @@ int main()
"boat-xyzbc.ngc", "boat-xyzbc.ngc",
0.0, 0.0,
}, },
{
"impeller_7bl_xyzac",
"configs/sim/axis/vismach/5axis/table-rotary-tilting/demos/"
"impeller-7bl-xyzac.ngc",
0.0,
},
}; };
ok &= execute_demo_file(cases[0], demos[0]); ok &= execute_demo_file(cases[0], demos[0]);
@@ -336,6 +342,7 @@ int main()
ok &= execute_demo_file(cases[0], demos[3]); ok &= execute_demo_file(cases[0], demos[3]);
ok &= execute_demo_file(cases[0], demos[4]); ok &= execute_demo_file(cases[0], demos[4]);
ok &= execute_demo_file(cases[1], demos[5]); ok &= execute_demo_file(cases[1], demos[5]);
ok &= execute_demo_file(cases[0], demos[6]);
print_bool("fiveaxis_linuxcnc_remap_execute_path", ok); print_bool("fiveaxis_linuxcnc_remap_execute_path", ok);
return ok ? 0 : 1; return ok ? 0 : 1;

View File

@@ -485,7 +485,7 @@ char *lcinterp_run_fiveaxis_remap_file(const char *path, const char *ini_path)
return copy_result(output.str()); return copy_result(output.str());
} }
constexpr int max_file_steps = 4096; constexpr int max_file_steps = 8192;
int file_read_count = 0; int file_read_count = 0;
int file_execute_count = 0; int file_execute_count = 0;
int file_finish_count = 0; int file_finish_count = 0;

View File

@@ -179,8 +179,8 @@ async function writeFiveAxisTrtMachineFiles(interp) {
} }
await writeFetchedTextFile( await writeFetchedTextFile(
interp, interp,
`${FIVEAXIS_TRT_SOURCE_PATH}/demos/boat-xyzac.ngc`, `${FIVEAXIS_TRT_SOURCE_PATH}/demos/impeller-7bl-xyzac.ngc`,
`${FIVEAXIS_TRT_WASM_DIR}/demos/boat-xyzac.ngc`, `${FIVEAXIS_TRT_WASM_DIR}/demos/impeller-7bl-xyzac.ngc`,
); );
} }
@@ -311,7 +311,7 @@ document.getElementById("run-fiveaxis-remap").addEventListener("click", async ()
const interp = requireInterpSdk(); const interp = requireInterpSdk();
await writeFiveAxisTrtMachineFiles(interp); await writeFiveAxisTrtMachineFiles(interp);
const iniPath = `${FIVEAXIS_TRT_WASM_DIR}/xyzac-trt.ini`; const iniPath = `${FIVEAXIS_TRT_WASM_DIR}/xyzac-trt.ini`;
const programPath = `${FIVEAXIS_TRT_WASM_DIR}/demos/boat-xyzac.ngc`; const programPath = `${FIVEAXIS_TRT_WASM_DIR}/demos/impeller-7bl-xyzac.ngc`;
const result = interp.runFiveAxisRemapFile(programPath, iniPath); const result = interp.runFiveAxisRemapFile(programPath, iniPath);
setField("fiveaxisRemap", "ok"); setField("fiveaxisRemap", "ok");
setCanonicalEvents(result.trim()); setCanonicalEvents(result.trim());

View File

@@ -374,7 +374,8 @@ TOOL_TABLE = browser-tool.tbl
if ( if (
!remapLog.includes("fiveaxis_ini_open=1") || !remapLog.includes("fiveaxis_ini_open=1") ||
!remapLog.includes("fiveaxis_tool_table_load=0") || !remapLog.includes("fiveaxis_tool_table_load=0") ||
!remapLog.includes("fiveaxis_file_read_count=1927") || !remapLog.includes("fiveaxis_file_read_count=4558") ||
!remapLog.includes("fiveaxis_file_finish_count=2") ||
!remapLog.includes("fiveaxis_hal_switchkins: rc=0 found=1 value=0") || !remapLog.includes("fiveaxis_hal_switchkins: rc=0 found=1 value=0") ||
!remapLog.includes("fiveaxis_linuxcnc_remap_file_execute=1") !remapLog.includes("fiveaxis_linuxcnc_remap_file_execute=1")
) { ) {

View File

@@ -145,6 +145,11 @@
`${sourceDir}/demos/boat-xyzbc.ngc`, `${sourceDir}/demos/boat-xyzbc.ngc`,
`${wasmDir}/demos/boat-xyzbc.ngc`, `${wasmDir}/demos/boat-xyzbc.ngc`,
); );
await writeFetchedTextFile(
interp,
`${sourceDir}/demos/impeller-7bl-xyzac.ngc`,
`${wasmDir}/demos/impeller-7bl-xyzac.ngc`,
);
return wasmDir; return wasmDir;
} }
@@ -453,6 +458,28 @@
"fiveaxis_linuxcnc_remap_file_execute=1", "fiveaxis_linuxcnc_remap_file_execute=1",
].join("\n"), ].join("\n"),
); );
verifyExpectedOutput(
"browser_fiveaxis_impeller_7bl_xyzac",
interp.runFiveAxisRemapFile(
`${fiveAxisTrtDir}/demos/impeller-7bl-xyzac.ngc`,
`${fiveAxisTrtDir}/xyzac-trt.ini`,
),
[
"fiveaxis_ini_open=1",
"fiveaxis_tool_table_load=0",
"fiveaxis_parse_remap_1=0",
"fiveaxis_parse_remap_2=0",
"fiveaxis_parse_remap_3=0",
"fiveaxis_file_open=0",
"fiveaxis_file_read_count=4558",
"fiveaxis_file_execute_count=4558",
"fiveaxis_file_finish_count=2",
"fiveaxis_file_final_rc=1",
"fiveaxis_file_reached_exit=1",
"fiveaxis_hal_switchkins: rc=0 found=1 value=0",
"fiveaxis_linuxcnc_remap_file_execute=1",
].join("\n"),
);
verifyExpectedOutput( verifyExpectedOutput(
"restore_parameters_missing_file", "restore_parameters_missing_file",

View File

@@ -350,6 +350,14 @@ grep -Fq "xyzbc_trt_boat_xyzbc_file_final_rc=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
grep -Fq "xyzbc_trt_boat_xyzbc_file_reached_exit=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT" grep -Fq "xyzbc_trt_boat_xyzbc_file_reached_exit=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
grep -Fq "xyzbc_trt_boat_xyzbc__hal[motion.switchkins-type]: rc=0 found=1 value=0" "$FIVEAXIS_REMAP_EXECUTE_STDOUT" grep -Fq "xyzbc_trt_boat_xyzbc__hal[motion.switchkins-type]: rc=0 found=1 value=0" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
grep -Fq "xyzbc_trt_boat_xyzbc_linuxcnc_demo_file_execute=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT" grep -Fq "xyzbc_trt_boat_xyzbc_linuxcnc_demo_file_execute=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
grep -Fq "xyzac_trt_impeller_7bl_xyzac_file_open=0" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
grep -Fq "xyzac_trt_impeller_7bl_xyzac_file_read_count=4558" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
grep -Fq "xyzac_trt_impeller_7bl_xyzac_file_execute_count=4558" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
grep -Fq "xyzac_trt_impeller_7bl_xyzac_file_finish_count=2" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
grep -Fq "xyzac_trt_impeller_7bl_xyzac_file_final_rc=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
grep -Fq "xyzac_trt_impeller_7bl_xyzac_file_reached_exit=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
grep -Fq "xyzac_trt_impeller_7bl_xyzac__hal[motion.switchkins-type]: rc=0 found=1 value=0" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
grep -Fq "xyzac_trt_impeller_7bl_xyzac_linuxcnc_demo_file_execute=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
grep -Fq "fiveaxis_linuxcnc_remap_execute_path=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT" grep -Fq "fiveaxis_linuxcnc_remap_execute_path=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
NAMEDPARAM_STDOUT="$BUILD_DIR/linuxcnc_namedparam_harness.run.stdout.log" NAMEDPARAM_STDOUT="$BUILD_DIR/linuxcnc_namedparam_harness.run.stdout.log"

View File

@@ -129,6 +129,10 @@ function writeFiveAxisTrtMachineFiles() {
resolve(sourceDir, "demos/boat-xyzbc.ngc"), resolve(sourceDir, "demos/boat-xyzbc.ngc"),
`${wasmDir}/demos/boat-xyzbc.ngc`, `${wasmDir}/demos/boat-xyzbc.ngc`,
); );
writeVendorTextFile(
resolve(sourceDir, "demos/impeller-7bl-xyzac.ngc"),
`${wasmDir}/demos/impeller-7bl-xyzac.ngc`,
);
return wasmDir; return wasmDir;
} }
@@ -442,6 +446,28 @@ verifyExpectedOutput(
"fiveaxis_linuxcnc_remap_file_execute=1", "fiveaxis_linuxcnc_remap_file_execute=1",
].join("\n"), ].join("\n"),
); );
verifyExpectedOutput(
"fiveaxis_impeller_7bl_xyzac_wasm",
interp.runFiveAxisRemapFile(
`${fiveAxisTrtDir}/demos/impeller-7bl-xyzac.ngc`,
`${fiveAxisTrtDir}/xyzac-trt.ini`,
),
[
"fiveaxis_ini_open=1",
"fiveaxis_tool_table_load=0",
"fiveaxis_parse_remap_1=0",
"fiveaxis_parse_remap_2=0",
"fiveaxis_parse_remap_3=0",
"fiveaxis_file_open=0",
"fiveaxis_file_read_count=4558",
"fiveaxis_file_execute_count=4558",
"fiveaxis_file_finish_count=2",
"fiveaxis_file_final_rc=1",
"fiveaxis_file_reached_exit=1",
"fiveaxis_hal_switchkins: rc=0 found=1 value=0",
"fiveaxis_linuxcnc_remap_file_execute=1",
].join("\n"),
);
const parameterFilePath = "/work/rs274ngc.var"; const parameterFilePath = "/work/rs274ngc.var";
interp.writeTextFile( interp.writeTextFile(