Compare commits

...

3 Commits

Author SHA1 Message Date
cnc
8b89b5b4c6 参考所有分组,完成尽量多的内容:结论为 switchkins 表检查同步守住 kinematics manifest 完整性 2026-06-03 21:44:41 +08:00
cnc
21c242c9a4 参考所有分组,完成尽量多的内容。禁止顺手扩功能 smoke
结论:按 LinuxCNC rs274ngc_pre.cc save_parameters()/restore_parameters() 的参数文件流程,收紧 OPFS 参数持久化后 WASM 根目录 scratch 文件清理;未扩展临时 smoke 行为。
2026-06-03 21:32:27 +08:00
cnc
945e839e9d 参考所有分组,完成尽量多的内容。禁止顺手扩功能 smoke
结论:对齐 LinuxCNC tooldata_nml.cc 与 tooldata_db.cc 的失败诊断输出,收紧 WASM tooldata link probe;未扩展临时 smoke 行为。
2026-06-03 21:19:24 +08:00
8 changed files with 24 additions and 6 deletions

View File

@@ -35,7 +35,7 @@ if [[ ! -f "$manifest" ]]; then
echo "missing kinematics manifest: $manifest" >&2
exit 1
fi
LINUXCNC_ROOT="$linuxcnc_root" ./check-linuxcnc-inputs-cached.sh "$manifest"
LINUXCNC_ROOT="$linuxcnc_root" ./check-linuxcnc-inputs-cached.sh "$manifest" --require-kinematics-complete
validate_manifest_switchkins_complete() {
local manifest_file=$1

View File

@@ -1,5 +1,6 @@
#include "tooldata.hh"
#include <cstdio>
#include <cstring>
#include <unistd.h>
@@ -15,7 +16,11 @@ bool db_live = false;
extern "C" {
int tool_nml_register(CANON_TOOL_TABLE *tblptr) {
return tblptr ? 0 : -1;
if (!tblptr) {
std::fprintf(stderr, "%5d!!!PROBLEM tool_nml_register()\n", getpid());
return -1;
}
return 0;
}
int tooldata_db_init(char progname_plus_args[], int) {
@@ -29,10 +34,14 @@ int tooldata_db_init(char progname_plus_args[], int) {
for (char *token = program; token; token = strtok_r(nullptr, " ", &saveptr)) {
++argc;
if (argc >= MAX_DB_PROGRAM_ARGS) {
std::fprintf(stderr,
"!!!!db_init: argc exceeds MAX_DB_PROGRAM_ARGS=%d\n",
MAX_DB_PROGRAM_ARGS);
return -1;
}
}
if (!program || access(program, X_OK) != 0) {
std::fprintf(stderr, "!!!!db_init: <%s> not executable\n", program ? program : "");
return -1;
}
return -1;

View File

@@ -114,6 +114,9 @@ Efficiency rules:
nanosecond mtime stats, tracked generated table/case outputs, and the thin API/web bridge files that pass
switchkins config aliases. Native, source-link, and build-wasm entry points
must run this cached check before consuming those aliases.
The uncached switchkins/remap checker must first run kinematics-manifest
completeness validation so standalone table checks also cover the
source-manifest contract used by M428/M429/M430 and RTCP coverage.
- The switchkins/remap generator must treat LinuxCNC `[EMCIO] TOOL_TABLE`
entries as source coverage only. Resolvable tool tables referenced by
M428/M429/M430 INI files must be present as `tooldata` manifest entries and

View File

@@ -143,7 +143,7 @@ grep -F 'LinuxCNC source basis: the wasm build preflights and compiles the' buil
grep -F 'LinuxCNC source basis: manifest validation checks LinuxCNC-root relative' check-linuxcnc-inputs.sh >/dev/null
grep -F 'LinuxCNC source basis: the cached input checker keys check-linuxcnc-inputs.sh' check-linuxcnc-inputs-cached.sh >/dev/null
grep -F 'LinuxCNC source basis: switchkins/remap table validation derives M428/M429/M430' check-linuxcnc-switchkins-remap-table.sh >/dev/null
grep -F 'LINUXCNC_ROOT="$linuxcnc_root" ./check-linuxcnc-inputs-cached.sh "$manifest"' check-linuxcnc-switchkins-remap-table.sh >/dev/null
grep -F 'LINUXCNC_ROOT="$linuxcnc_root" ./check-linuxcnc-inputs-cached.sh "$manifest" --require-kinematics-complete' check-linuxcnc-switchkins-remap-table.sh >/dev/null
grep -F 'missing LinuxCNC switchkins REMAP INI in manifest:' check-linuxcnc-switchkins-remap-table.sh >/dev/null
grep -F 'missing LinuxCNC switchkins remap source in manifest:' check-linuxcnc-switchkins-remap-table.sh >/dev/null
grep -F 'LinuxCNC source basis: cached switchkins/remap validation hashes the LinuxCNC' check-linuxcnc-switchkins-remap-table-cached.sh >/dev/null

View File

@@ -11,5 +11,9 @@ probe=$(./build-linuxcnc-wasm-standalone-probe.sh --mode tooldata-link)
"$probe" 2>"$probe.err"
grep -F "tool_mmap_user(): tool mmap not available" "$probe.err" >/dev/null
grep -F "tooldata_put() no tool_mmap_base" "$probe.err" >/dev/null
grep -F "!!!PROBLEM tool_nml_register()" "$probe.err" >/dev/null
grep -F "!!!!db_init: <" "$probe.err" >/dev/null
grep -F "not executable" "$probe.err" >/dev/null
grep -F "!!!!db_init: argc exceeds MAX_DB_PROGRAM_ARGS=10" "$probe.err" >/dev/null
echo "linuxcnc wasm tooldata shim link probe passed"

View File

@@ -55,7 +55,7 @@ grep -F 'LinuxCNC source basis: the wasm build preflights and compiles the' buil
grep -F 'LinuxCNC source basis: manifest validation checks LinuxCNC-root relative' check-linuxcnc-inputs.sh >/dev/null
grep -F 'LinuxCNC source basis: the cached input checker keys check-linuxcnc-inputs.sh' check-linuxcnc-inputs-cached.sh >/dev/null
grep -F 'LinuxCNC source basis: switchkins/remap table validation derives M428/M429/M430' check-linuxcnc-switchkins-remap-table.sh >/dev/null
grep -F 'LINUXCNC_ROOT="$linuxcnc_root" ./check-linuxcnc-inputs-cached.sh "$manifest"' check-linuxcnc-switchkins-remap-table.sh >/dev/null
grep -F 'LINUXCNC_ROOT="$linuxcnc_root" ./check-linuxcnc-inputs-cached.sh "$manifest" --require-kinematics-complete' check-linuxcnc-switchkins-remap-table.sh >/dev/null
grep -F 'missing LinuxCNC switchkins REMAP INI in manifest:' check-linuxcnc-switchkins-remap-table.sh >/dev/null
grep -F 'missing LinuxCNC switchkins remap source in manifest:' check-linuxcnc-switchkins-remap-table.sh >/dev/null
grep -F 'LinuxCNC source basis: cached switchkins/remap validation hashes the LinuxCNC' check-linuxcnc-switchkins-remap-table-cached.sh >/dev/null

View File

@@ -533,6 +533,7 @@ function installOpfsWorkspace(module, options) {
} else {
await removeOpfsFileEntry(workspacePath, `${path}.bak`);
}
cleanupLinuxCncParameterFiles(module);
return data;
},
async removeFile(path) {

View File

@@ -16,13 +16,13 @@ export async function runBrowserOpfsParameterSections(context, simulator) {
withSmokeSimulator,
} = context;
const backend = { backend: "linuxcnc-rs274" };
const parseWithParameters = (program, path) =>
simulator.parseWithParameterFile(program, path, "linuxcnc", backend);
const parseWithParameters = (program, path) => simulator.parseWithParameterFile(program, path, "linuxcnc", backend);
await runSection("opfs parameter save", async () => {
await simulator.parseWithParameterFile("G21 G90\nG0 X1\nG28.1\nM30\n", "parameters/rs274ngc.var", "linuxcnc", backend);
const opfsParameterFile = await readOpfsText(simulator, "parameters/rs274ngc.var");
expectIncludes(opfsParameterFile, "5161\t1.000000", "LinuxCNC parameter file was not persisted into OPFS");
expectWasmFilesMissing(simulator.fs.module.FS, ["rs274ngc.var", "rs274ngc.var.new", "rs274ngc.var.bak"], (parameterPath) => `LinuxCNC parameter scratch file remained outside OPFS after save: ${parameterPath}`);
});
await runSection("opfs parameter restore in new instance", async () => {
@@ -84,6 +84,7 @@ export async function runBrowserOpfsParameterSections(context, simulator) {
const opfsParameterBackup = await readOpfsText(simulator, "parameters/backup-bridge.var.bak");
expectIncludes(opfsParameterBackup, "5161\t1.000000",
"LinuxCNC parameter backup file was not bridged into OPFS");
expectWasmFilesMissing(simulator.fs.module.FS, ["rs274ngc.var", "rs274ngc.var.new", "rs274ngc.var.bak"], (parameterPath) => `LinuxCNC parameter scratch file remained outside OPFS after backup bridge: ${parameterPath}`);
});
await runSection("opfs parameter backup after existing save", async () => {