From 9265825843ac24b9da56307db7b380a99da99b71 Mon Sep 17 00:00:00 2001 From: wangdequan Date: Sun, 14 Jun 2026 06:18:41 +0800 Subject: [PATCH] Guard browser OPFS direct session load options --- text8.txt | 53 +++++++++++++++++++++++ wasm-port/tests/browser/interp_smoke.html | 22 +++++----- 2 files changed, 64 insertions(+), 11 deletions(-) diff --git a/text8.txt b/text8.txt index 5c94b3f..59e9378 100644 --- a/text8.txt +++ b/text8.txt @@ -1684,3 +1684,56 @@ host_wasm_opfs_browser_smokes=ok 继续小批量 browser OPFS test glue guard。优先扫描 OPFS save result `verifyExpectedOutput(...)` 的重复 result verification 是否还能收敛为小 helper; 只改测试胶水,不改变保存结果内容、OPFS path、WASM path 字符串或保存/读取行为。 + +三十六、2026-06-14 继续执行记录:browser OPFS direct session load options helper guard + +本轮按防重检查确认 save/load result helper 已存在,避免重复做旧批次;改为继续收敛 +direct browser session 的 `loadMachineSessionFromOpfs(...)` options object,范围仍只 +触及 `wasm-port/tests/browser/interp_smoke.html` 的 browser/OPFS test glue。 + +完成内容: + +- 新增 `opfsSessionLoadOptions(...)`,统一 direct browser session 中 + `iniWasmPath`、`parameterWasmPath`、`toolTableWasmPath` 的 load options 构造; +- `browser-interp` session 的 load options 改为复用 + `opfsSessionLoadOptions(browserInterpWasmPaths)`; +- `browser-random-toolchanger` session 的 load options 改为复用 + `opfsSessionLoadOptions(browserRandomWasmPaths, { iniSdk: ini })`; +- custom session override 继续保留 `opfsCustomSessionLoadOptions(...)`,未混合 + custom filename override 边界; +- 实际 OPFS path、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 OPFS test glue guard。优先扫描 direct browser session 的 +parameter fixture value groups 是否能像 custom session 一样收敛为局部常量或复用 +现有 parameter helper;只改测试胶水,不改变参数值、OPFS path、WASM path 字符串或 +保存/读取行为。 diff --git a/wasm-port/tests/browser/interp_smoke.html b/wasm-port/tests/browser/interp_smoke.html index cd856c4..3f53aa8 100644 --- a/wasm-port/tests/browser/interp_smoke.html +++ b/wasm-port/tests/browser/interp_smoke.html @@ -4647,6 +4647,15 @@ }; } + function opfsSessionLoadOptions(wasmPaths, extraOptions = {}) { + return { + ...extraOptions, + iniWasmPath: wasmPaths.ini, + parameterWasmPath: wasmPaths.parameters, + toolTableWasmPath: wasmPaths.toolTable, + }; + } + async function verifyOpfsSavedText(label, loadActualText, expectedLines) { verifyExpectedOutput(label, await loadActualText(), expectedLines.join("\n")); } @@ -9322,11 +9331,7 @@ const loadedSession = await loadMachineSessionFromOpfs( interp, browserInterpMachineId, - { - iniWasmPath: browserInterpWasmPaths.ini, - parameterWasmPath: browserInterpWasmPaths.parameters, - toolTableWasmPath: browserInterpWasmPaths.toolTable, - }, + opfsSessionLoadOptions(browserInterpWasmPaths), ); assertOpfsSessionStaging( "opfs_load_session_staging", @@ -9486,12 +9491,7 @@ const loadedRandomSession = await loadMachineSessionFromOpfs( interp, browserRandomMachineId, - { - iniSdk: ini, - iniWasmPath: browserRandomWasmPaths.ini, - parameterWasmPath: browserRandomWasmPaths.parameters, - toolTableWasmPath: browserRandomWasmPaths.toolTable, - }, + opfsSessionLoadOptions(browserRandomWasmPaths, { iniSdk: ini }), ); assertOpfsSessionStaging( "opfs_load_random_session_staging",