Guard browser direct non-random generated tool-table
This commit is contained in:
57
text9.txt
57
text9.txt
@@ -465,3 +465,60 @@ host_wasm_opfs_browser_smokes=ok
|
|||||||
tool-table file block 中的 load/save/readback expected lines 是否能复用现有
|
tool-table file block 中的 load/save/readback expected lines 是否能复用现有
|
||||||
`opfsToolTable*` helpers 或局部常量;只改测试胶水,不改变 direct generated file input、
|
`opfsToolTable*` helpers 或局部常量;只改测试胶水,不改变 direct generated file input、
|
||||||
WASM path 字符串或保存/读取行为。
|
WASM path 字符串或保存/读取行为。
|
||||||
|
|
||||||
|
十一、2026-06-14 继续执行记录:browser direct generated non-random tool-table helper guard
|
||||||
|
|
||||||
|
本轮按上一条下一步建议继续收敛 direct non-random generated toolchanger file block 的
|
||||||
|
load/save/readback expected lines,范围仍只触及
|
||||||
|
`wasm-port/tests/browser/interp_smoke.html` 的 browser test glue。
|
||||||
|
|
||||||
|
完成内容:
|
||||||
|
|
||||||
|
- 新增 `directToolTableResultLines(...)`,统一 direct non-random generated load/save
|
||||||
|
result expected lines 的拼装;
|
||||||
|
- 新增 `directToolTableTextLines(...)`,统一 direct non-random generated saved
|
||||||
|
tool-table readback expected lines 的拼装;
|
||||||
|
- 为 direct non-random generated file block 增加 `browserDirectFinishTool`、
|
||||||
|
`browserDirectRoughTool` 与 `browserDirectTools` 局部常量;
|
||||||
|
- `load_tool_table_direct` expected lines 改为复用
|
||||||
|
`directToolTableResultLines("load", ...)`,并继续显式保留 `tooldata_last_index=2`
|
||||||
|
和 `tool_index_for_tool_2=1`;
|
||||||
|
- `save_tool_table_direct` expected lines 改为复用
|
||||||
|
`directToolTableResultLines("save", ...)`;
|
||||||
|
- `saved_tool_table_direct_text` expected lines 改为复用
|
||||||
|
`directToolTableTextLines(...)`;
|
||||||
|
- 未改变 direct generated file input、WASM path 字符串、save/read/load 行为;
|
||||||
|
- 未改变 staging path 模型、OPFS bridge behavior、file-service、SDK planner、
|
||||||
|
interpreter、INI、tool、parameter 或 LinuxCNC-owned runtime semantics。
|
||||||
|
|
||||||
|
验证已通过:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git diff --check
|
||||||
|
SKIP_INI_BUILD=1 SKIP_INTERP_BUILD=1 wasm-port/tests/browser/verify_interp_browser.sh
|
||||||
|
wasm-port/tools/verify_vendor_sync.sh
|
||||||
|
wasm-port/tools/verify_no_standalone_cnc_semantics.sh
|
||||||
|
SKIP_INTERP_BUILD=1 wasm-port/tests/wasm/node/verify_interp_wasm.sh
|
||||||
|
SKIP_INTERP_BUILD=1 wasm-port/tests/wasm/node/verify_sim_configs_inventory_wasm.sh
|
||||||
|
wasm-port/tests/host/verify_host_smokes.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
关键输出:
|
||||||
|
|
||||||
|
```text
|
||||||
|
browser_interp_smoke=ok
|
||||||
|
vendor sync up to date
|
||||||
|
standalone CNC semantics guard complete
|
||||||
|
interp_wasm_node_smoke=ok
|
||||||
|
sim_configs_wasm_node_inventory_executed=28
|
||||||
|
sim_configs_wasm_node_inventory_passed=28
|
||||||
|
sim_configs_wasm_node_inventory_skipped=131
|
||||||
|
sim_configs_wasm_node_inventory_unexpected_fail=0
|
||||||
|
host_wasm_opfs_browser_smokes=ok
|
||||||
|
```
|
||||||
|
|
||||||
|
下一步建议:
|
||||||
|
|
||||||
|
继续小批量 browser test glue guard。优先扫描 direct `browser-interp` session 和
|
||||||
|
direct generated file block 之间是否还能抽出更小的共享 tool-table helper;只改测试
|
||||||
|
胶水,不改变输入、OPFS path、WASM path 字符串或保存/读取行为。
|
||||||
|
|||||||
@@ -4619,6 +4619,23 @@
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function directToolTableResultLines(operation, tools, extraLines = []) {
|
||||||
|
return [
|
||||||
|
`tooldata_${operation}=0`,
|
||||||
|
...extraLines,
|
||||||
|
...tools.flatMap((tool) => tool.resultLines),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
function directToolTableTextLines(tools) {
|
||||||
|
return tools.flatMap((tool) => [
|
||||||
|
`T${tool.toolNo}`,
|
||||||
|
`P${tool.pocketNo}`,
|
||||||
|
...(tool.extraTextLines ?? []),
|
||||||
|
tool.comment,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
function opfsRandomToolTableResultLines(operation, tools) {
|
function opfsRandomToolTableResultLines(operation, tools) {
|
||||||
return [
|
return [
|
||||||
...(operation === "load" ? ["tooldata_random_toolchanger=1"] : []),
|
...(operation === "load" ? ["tooldata_random_toolchanger=1"] : []),
|
||||||
@@ -9238,12 +9255,11 @@
|
|||||||
"",
|
"",
|
||||||
].join("\n"),
|
].join("\n"),
|
||||||
);
|
);
|
||||||
verifyExpectedOutput(
|
const browserDirectFinishTool = {
|
||||||
"load_tool_table_direct",
|
toolNo: "2",
|
||||||
interp.loadToolTable(browserToolTablePath),
|
pocketNo: "7",
|
||||||
[
|
comment: ";browser direct finish tool",
|
||||||
"tooldata_load=0",
|
resultLines: [
|
||||||
"tooldata_last_index=2",
|
|
||||||
"tool_1.toolno=2",
|
"tool_1.toolno=2",
|
||||||
"tool_1.pocketno=7",
|
"tool_1.pocketno=7",
|
||||||
"tool_1.z=3.125",
|
"tool_1.z=3.125",
|
||||||
@@ -9252,37 +9268,46 @@
|
|||||||
"tool_1.backangle=34",
|
"tool_1.backangle=34",
|
||||||
"tool_1.orientation=4",
|
"tool_1.orientation=4",
|
||||||
"tool_1.comment=browser direct finish tool",
|
"tool_1.comment=browser direct finish tool",
|
||||||
"tool_2.toolno=5",
|
],
|
||||||
"tool_2.pocketno=9",
|
extraTextLines: [
|
||||||
"tool_2.comment=browser direct rough tool",
|
|
||||||
"tool_index_for_tool_2=1",
|
|
||||||
].join("\n"),
|
|
||||||
);
|
|
||||||
verifyExpectedOutput(
|
|
||||||
"save_tool_table_direct",
|
|
||||||
interp.saveToolTable(browserToolTablePath),
|
|
||||||
[
|
|
||||||
"tooldata_save=0",
|
|
||||||
"tool_1.toolno=2",
|
|
||||||
"tool_2.toolno=5",
|
|
||||||
].join("\n"),
|
|
||||||
);
|
|
||||||
verifyExpectedOutput(
|
|
||||||
"saved_tool_table_direct_text",
|
|
||||||
interp.readTextFile(browserToolTablePath),
|
|
||||||
[
|
|
||||||
"T2",
|
|
||||||
"P7",
|
|
||||||
"Z+3.125000",
|
"Z+3.125000",
|
||||||
"D+1.500000",
|
"D+1.500000",
|
||||||
"I+12.000000",
|
"I+12.000000",
|
||||||
"J+34.000000",
|
"J+34.000000",
|
||||||
"Q4",
|
"Q4",
|
||||||
";browser direct finish tool",
|
],
|
||||||
"T5",
|
};
|
||||||
"P9",
|
const browserDirectRoughTool = {
|
||||||
";browser direct rough tool",
|
toolNo: "5",
|
||||||
].join("\n"),
|
pocketNo: "9",
|
||||||
|
comment: ";browser direct rough tool",
|
||||||
|
resultLines: [
|
||||||
|
"tool_2.toolno=5",
|
||||||
|
"tool_2.pocketno=9",
|
||||||
|
"tool_2.comment=browser direct rough tool",
|
||||||
|
],
|
||||||
|
};
|
||||||
|
const browserDirectTools = [browserDirectFinishTool, browserDirectRoughTool];
|
||||||
|
verifyExpectedOutput(
|
||||||
|
"load_tool_table_direct",
|
||||||
|
interp.loadToolTable(browserToolTablePath),
|
||||||
|
directToolTableResultLines("load", browserDirectTools, [
|
||||||
|
"tooldata_last_index=2",
|
||||||
|
"tool_index_for_tool_2=1",
|
||||||
|
]).join("\n"),
|
||||||
|
);
|
||||||
|
verifyExpectedOutput(
|
||||||
|
"save_tool_table_direct",
|
||||||
|
interp.saveToolTable(browserToolTablePath),
|
||||||
|
directToolTableResultLines("save", [
|
||||||
|
{ resultLines: ["tool_1.toolno=2"] },
|
||||||
|
{ resultLines: ["tool_2.toolno=5"] },
|
||||||
|
]).join("\n"),
|
||||||
|
);
|
||||||
|
verifyExpectedOutput(
|
||||||
|
"saved_tool_table_direct_text",
|
||||||
|
interp.readTextFile(browserToolTablePath),
|
||||||
|
directToolTableTextLines(browserDirectTools).join("\n"),
|
||||||
);
|
);
|
||||||
|
|
||||||
const browserRandomToolTablePath = writeGeneratedToolTableFixture(
|
const browserRandomToolTablePath = writeGeneratedToolTableFixture(
|
||||||
|
|||||||
Reference in New Issue
Block a user