Guard browser OPFS session wasm path group helper

This commit is contained in:
2026-06-14 01:30:13 +08:00
parent 9757d196d1
commit 6a9f1c99df
2 changed files with 71 additions and 28 deletions

View File

@@ -704,3 +704,50 @@ host_wasm_opfs_browser_smokes=ok
继续保持小批量 browser staging path literal guard。优先扫描 `/work/browser-*` 继续保持小批量 browser staging path literal guard。优先扫描 `/work/browser-*`
的 direct session WASM path 常量,看是否还能把 `browserInterp*` 与 `browserRandom*` 的 direct session WASM path 常量,看是否还能把 `browserInterp*` 与 `browserRandom*`
分组的重复前缀抽成局部 helper只改 browser test glue不改变 staging model。 分组的重复前缀抽成局部 helper只改 browser test glue不改变 staging model。
十七、2026-06-14 继续执行记录browser OPFS session wasm path group helper guard
本轮按上一条下一步建议继续扫描 direct session WASM path 常量,范围仍只触及
`wasm-port/tests/browser/interp_smoke.html` 的 browser/OPFS test glue。
完成内容:
- 新增 `opfsBrowserSessionWasmPaths(prefix)`,统一生成 direct browser session 的
INI、parameter、tool-table WASM paths
- 将 `browserInterp*WasmPath` 三元组收敛为 `browserInterpWasmPaths`
- 将 `browserRandom*WasmPath` 三元组收敛为 `browserRandomWasmPaths`
- 未改变实际 `/work/browser-*` staging path、OPFS bridge behavior、file-service、
path-model、SDK planner、interpreter、INI、tool、parameter 或 LinuxCNC-owned
runtime semantics。
验证已通过:
```bash
git diff --check
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
SKIP_INI_BUILD=1 SKIP_INTERP_BUILD=1 wasm-port/tests/browser/verify_interp_browser.sh
wasm-port/tests/host/verify_host_smokes.sh
```
关键输出:
```text
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
browser_interp_smoke=ok
host_wasm_opfs_browser_smokes=ok
```
下一步建议:
继续小批量扫描 browser staging path literal。优先看 custom INI-named / explicit session
的 `iniFileIniWasmPath`、`iniOverrideIniWasmPath` 是否能复用一个 session INI WASM
path helper只改测试胶水不改变 staging path 字符串或 custom filename 输入。

View File

@@ -4580,6 +4580,14 @@
return { ini, parameters, toolTable }; return { ini, parameters, toolTable };
} }
function opfsBrowserSessionWasmPaths(prefix) {
return opfsSessionWasmPaths(
`/work/${prefix}-machine.ini`,
`/work/${prefix}-linuxcnc.var`,
`/work/${prefix}-tool.tbl`,
);
}
function opfsCustomSessionPaths(machineId, parameterFilename, toolTableFilename, iniWasmPath) { function opfsCustomSessionPaths(machineId, parameterFilename, toolTableFilename, iniWasmPath) {
return { return {
opfs: { opfs: {
@@ -9172,9 +9180,7 @@
); );
const browserInterpMachineId = "browser-interp"; const browserInterpMachineId = "browser-interp";
const browserInterpIniWasmPath = "/work/browser-machine.ini"; const browserInterpWasmPaths = opfsBrowserSessionWasmPaths("browser");
const browserInterpParameterWasmPath = "/work/browser-linuxcnc.var";
const browserInterpToolTableWasmPath = "/work/browser-tool.tbl";
const browserInterpTextPaths = await saveMachineTextFiles(browserInterpMachineId, { const browserInterpTextPaths = await saveMachineTextFiles(browserInterpMachineId, {
ini: `[EMC]\nMACHINE = ${browserInterpMachineId}\n`, ini: `[EMC]\nMACHINE = ${browserInterpMachineId}\n`,
toolTable: "T2 P7 Z3.125 D1.5 I12 J34 Q4 ;browser finish tool\n", toolTable: "T2 P7 Z3.125 D1.5 I12 J34 Q4 ;browser finish tool\n",
@@ -9197,9 +9203,9 @@
interp, interp,
browserInterpMachineId, browserInterpMachineId,
{ {
iniWasmPath: browserInterpIniWasmPath, iniWasmPath: browserInterpWasmPaths.ini,
parameterWasmPath: browserInterpParameterWasmPath, parameterWasmPath: browserInterpWasmPaths.parameters,
toolTableWasmPath: browserInterpToolTableWasmPath, toolTableWasmPath: browserInterpWasmPaths.toolTable,
}, },
); );
assertOpfsSessionStaging( assertOpfsSessionStaging(
@@ -9207,11 +9213,7 @@
loadedSession, loadedSession,
browserInterpMachineId, browserInterpMachineId,
{ {
wasm: opfsSessionWasmPaths( wasm: browserInterpWasmPaths,
browserInterpIniWasmPath,
browserInterpParameterWasmPath,
browserInterpToolTableWasmPath,
),
}, },
); );
verifyOpfsLoadResult( verifyOpfsLoadResult(
@@ -9251,14 +9253,14 @@
5221: 9.87, 5221: 9.87,
5399: 66.6, 5399: 66.6,
}, },
{ wasmPath: browserInterpParameterWasmPath }, { wasmPath: browserInterpWasmPaths.parameters },
); );
assertOpfsSavedParameterStaging( assertOpfsSavedParameterStaging(
"opfs_save_parameters_staging", "opfs_save_parameters_staging",
savedParameters, savedParameters,
browserInterpMachineId, browserInterpMachineId,
OPFS_DEFAULT_PARAMETER_FILENAME, OPFS_DEFAULT_PARAMETER_FILENAME,
browserInterpParameterWasmPath, browserInterpWasmPaths.parameters,
); );
verifyOpfsSaveResult( verifyOpfsSaveResult(
"opfs_save_parameters", "opfs_save_parameters",
@@ -9297,14 +9299,14 @@
const savedToolTable = await saveMachineToolTableToOpfs( const savedToolTable = await saveMachineToolTableToOpfs(
interp, interp,
browserInterpMachineId, browserInterpMachineId,
{ wasmPath: browserInterpToolTableWasmPath }, { wasmPath: browserInterpWasmPaths.toolTable },
); );
assertOpfsSavedToolTableStaging( assertOpfsSavedToolTableStaging(
"opfs_save_tool_table_staging", "opfs_save_tool_table_staging",
savedToolTable, savedToolTable,
browserInterpMachineId, browserInterpMachineId,
OPFS_DEFAULT_TOOL_TABLE_FILENAME, OPFS_DEFAULT_TOOL_TABLE_FILENAME,
browserInterpToolTableWasmPath, browserInterpWasmPaths.toolTable,
); );
verifyOpfsSaveResult( verifyOpfsSaveResult(
"opfs_save_tool_table", "opfs_save_tool_table",
@@ -9332,9 +9334,7 @@
); );
const browserRandomMachineId = "browser-random-toolchanger"; const browserRandomMachineId = "browser-random-toolchanger";
const browserRandomIniWasmPath = "/work/browser-random-machine.ini"; const browserRandomWasmPaths = opfsBrowserSessionWasmPaths("browser-random");
const browserRandomParameterWasmPath = "/work/browser-random-linuxcnc.var";
const browserRandomToolTableWasmPath = "/work/browser-random-tool.tbl";
const browserRandomTextPaths = await saveMachineTextFiles(browserRandomMachineId, { const browserRandomTextPaths = await saveMachineTextFiles(browserRandomMachineId, {
ini: [ ini: [
"[EMC]", "[EMC]",
@@ -9368,9 +9368,9 @@
browserRandomMachineId, browserRandomMachineId,
{ {
iniSdk: ini, iniSdk: ini,
iniWasmPath: browserRandomIniWasmPath, iniWasmPath: browserRandomWasmPaths.ini,
parameterWasmPath: browserRandomParameterWasmPath, parameterWasmPath: browserRandomWasmPaths.parameters,
toolTableWasmPath: browserRandomToolTableWasmPath, toolTableWasmPath: browserRandomWasmPaths.toolTable,
}, },
); );
assertOpfsSessionStaging( assertOpfsSessionStaging(
@@ -9378,11 +9378,7 @@
loadedRandomSession, loadedRandomSession,
browserRandomMachineId, browserRandomMachineId,
{ {
wasm: opfsSessionWasmPaths( wasm: browserRandomWasmPaths,
browserRandomIniWasmPath,
browserRandomParameterWasmPath,
browserRandomToolTableWasmPath,
),
}, },
); );
verifyOpfsLoadResult( verifyOpfsLoadResult(
@@ -9407,14 +9403,14 @@
const savedRandomToolTable = await saveMachineToolTableToOpfs( const savedRandomToolTable = await saveMachineToolTableToOpfs(
interp, interp,
browserRandomMachineId, browserRandomMachineId,
{ wasmPath: browserRandomToolTableWasmPath }, { wasmPath: browserRandomWasmPaths.toolTable },
); );
assertOpfsSavedToolTableStaging( assertOpfsSavedToolTableStaging(
"opfs_save_random_tool_table_staging", "opfs_save_random_tool_table_staging",
savedRandomToolTable, savedRandomToolTable,
browserRandomMachineId, browserRandomMachineId,
OPFS_DEFAULT_TOOL_TABLE_FILENAME, OPFS_DEFAULT_TOOL_TABLE_FILENAME,
browserRandomToolTableWasmPath, browserRandomWasmPaths.toolTable,
); );
verifyOpfsSaveResult( verifyOpfsSaveResult(
"opfs_save_random_tool_table", "opfs_save_random_tool_table",