From 675ee5fb6cc1f5a84d6c0ac42ecc3ff00f29006f Mon Sep 17 00:00:00 2001 From: wangdequan Date: Sat, 13 Jun 2026 07:08:01 +0800 Subject: [PATCH] Guard early direct-file staging paths --- text5.txt | 192 ++++++++++++++++++ wasm-port/tests/browser/interp_smoke.html | 38 ++++ .../tests/wasm/node/verify_interp_wasm.mjs | 47 +++++ 3 files changed, 277 insertions(+) diff --git a/text5.txt b/text5.txt index 2a64f4f..315228d 100644 --- a/text5.txt +++ b/text5.txt @@ -7747,3 +7747,195 @@ Guard g52 staging path fixture。下一步可优先检查早期单文件 cases,例如 `do-while-break`、`exists`、 `return-value` 或 `subs-follow-main`,按 2 到 3 个 case 一批补 fixed manifest 与 staged path guard。 + +八十二、2026-06-13 继续执行记录:early direct-file staging path guard + +本轮继续选择已有 Node/browser coverage、且不依赖 blocked runtime 的早期 +direct-file fixture。当前 host 仍按 blocked runtime 规则处理,不执行任何 +`ENABLE_*_RUNTIME_PROBE=1` opt-in native probe。 + +1. 候选选择。 + +选择 3 个已在 Node/browser 执行的 direct-file fixture family: + +- `tests/interp/do-while-break` +- `tests/interp/exists` +- `tests/interp/return-value` + +这些 case 不需要 INI/HAL/task/tool DB/Python remap/user-M process runtime。本轮只 +固定 upstream `.ngc` manifest 与 staged path 一致性,不新增 CNC 语义。 + +2. 覆盖对账。 + +当前 upstream `.ngc` manifest: + +```text +do-while-break/bug.ngc +do-while-break/test.ngc +exists/test.ngc +return-value/test.ngc +``` + +3. 更新。 + +更新: + +- `wasm-port/tests/wasm/node/verify_interp_wasm.mjs` +- `wasm-port/tests/browser/interp_smoke.html` + +Node 新增: + +- `doWhileBreakNgcFiles` 固定 `bug.ngc` 和 `test.ngc`; +- `existsNgcFiles` 固定 `test.ngc`; +- `returnValueNgcFiles` 固定 `test.ngc`; +- 分别与 `interpRegressionNgcFilesRecursive(...)` 精确对账; +- 检查 `writeInterpRegressionFile(...)` 返回的 staged path 与 fixed manifest + path 一致。 + +Browser 新增: + +- fixed-count 和 duplicate-free guard; +- 检查 browser staged `.ngc` path 去掉对应 `/work/browser-interp/.../` 前缀后, + 与 fixed manifest 一致; +- browser 仍不枚举目录。 + +4. 已执行验证。 + +```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 +``` + +结果: + +- `git diff --check` clean。 +- `vendor sync up to date` +- `standalone CNC semantics guard complete` +- `interp_wasm_node_smoke=ok` +- Node inventory 保持: + - `executed=28` + - `passed=28` + - `skipped=131` + - `unexpected_fail=0` +- `browser_interp_smoke=ok` +- `host_wasm_opfs_browser_smokes=ok` + +5. 下一步工作建议。 + +当前工作集已稳定。建议先做小提交,message: + +```text +Guard early direct-file staging paths +``` + +提交后继续同类 early direct-file fixtures,建议下一小批选择: + +```text +subs-follow-main/test.ngc +fractional-linenumbers/test.ngc +crazy-paths/test.ngc +``` + +仍只做 fixed manifest 与 staged path guard,不扩大到 blocked runtime。 + +八十二、2026-06-13 继续执行记录:early direct-file staging path guard + +本轮继续选择已有 Node/browser coverage、且不依赖 blocked runtime 的 early +direct-file fixture。当前 host 仍按 blocked runtime 规则处理,不执行任何 +`ENABLE_*_RUNTIME_PROBE=1` opt-in native probe。 + +1. 候选选择。 + +选择: + +- `tests/interp/do-while-break/bug.ngc` +- `tests/interp/do-while-break/test.ngc` +- `tests/interp/exists/test.ngc` +- `tests/interp/return-value/test.ngc` + +这些 case 已在 Node/browser 单独执行,不需要 INI/HAL/task/tool DB/Python +remap/user-M process runtime。本轮只固定 fixed manifest 与 staged path 一致性, +不新增 CNC 语义。 + +2. 覆盖对账。 + +当前 upstream `.ngc` manifest: + +```text +do-while-break/bug.ngc +do-while-break/test.ngc +exists/test.ngc +return-value/test.ngc +``` + +3. 更新。 + +更新: + +- `wasm-port/tests/wasm/node/verify_interp_wasm.mjs` +- `wasm-port/tests/browser/interp_smoke.html` + +Node 新增: + +- `doWhileBreakNgcFiles` 固定 `bug.ngc` 和 `test.ngc`,并与 + `interpRegressionNgcFilesRecursive("do-while-break")` 精确对账; +- `existsNgcFiles` 和 `returnValueNgcFiles` 分别固定 `test.ngc`,并与 + upstream recursive manifest 精确对账; +- 检查对应 `writeInterpRegressionFile(...)` 返回的 staged path 与 fixed + manifest path 一致。 + +Browser 新增: + +- 为三组 fixture 增加 fixed-count 和 duplicate-free guard; +- 检查 browser staged `.ngc` path 去掉对应 `/work/browser-interp/.../` + 前缀后,与 fixed manifest 一致; +- browser 仍不枚举目录。 + +4. 已执行验证。 + +```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 +``` + +结果: + +- `git diff --check` clean。 +- `vendor sync up to date` +- `standalone CNC semantics guard complete` +- `interp_wasm_node_smoke=ok` +- Node inventory 保持: + - `executed=28` + - `passed=28` + - `skipped=131` + - `unexpected_fail=0` +- `browser_interp_smoke=ok` +- `host_wasm_opfs_browser_smokes=ok` + +5. 下一步工作建议。 + +当前测试工作集已稳定。建议先做小提交,message: + +```text +Guard early direct-file staging paths +``` + +提交后继续 early direct-file fixture,小批量选择: + +```text +oword-bug315/test.ngc +oword-bug315-p2/test.ngc +subs-follow-main/test.ngc +``` + +仍只做 fixed manifest 与 staged path guard,不扩大到 blocked runtime。 diff --git a/wasm-port/tests/browser/interp_smoke.html b/wasm-port/tests/browser/interp_smoke.html index 02fd135..eb878ca 100644 --- a/wasm-port/tests/browser/interp_smoke.html +++ b/wasm-port/tests/browser/interp_smoke.html @@ -6288,6 +6288,20 @@ "do-while-break", "bug.ngc", ); + const doWhileBreakNgcFiles = [ + "bug.ngc", + "test.ngc", + ]; + if (doWhileBreakNgcFiles.length !== 2 || new Set(doWhileBreakNgcFiles).size !== doWhileBreakNgcFiles.length) { + throw new Error("browser_interp_do_while_break_fixture_coverage: list drift"); + } + const doWhileBreakStagedNgcFiles = [ + doWhileBreakBugPath, + doWhileBreakPath, + ].map((path) => path.replace("/work/browser-interp/do-while-break/", "")); + if (doWhileBreakStagedNgcFiles.join(",") !== doWhileBreakNgcFiles.join(",")) { + throw new Error("browser_interp_do_while_break_staging_manifest: list drift"); + } verifyExpectedOutput( "browser_interp_do_while_break_bug", interp.runFile(doWhileBreakBugPath), @@ -6341,6 +6355,18 @@ ); const existsPath = await writeInterpRegressionFile(interp, "exists", "test.ngc"); + const existsNgcFiles = [ + "test.ngc", + ]; + if (existsNgcFiles.length !== 1 || new Set(existsNgcFiles).size !== existsNgcFiles.length) { + throw new Error("browser_interp_exists_fixture_coverage: list drift"); + } + const existsStagedNgcFiles = [ + existsPath, + ].map((path) => path.replace("/work/browser-interp/exists/", "")); + if (existsStagedNgcFiles.join(",") !== existsNgcFiles.join(",")) { + throw new Error("browser_interp_exists_staging_manifest: list drift"); + } verifyExpectedOutput( "browser_interp_exists", interp.runFile(existsPath), @@ -6360,6 +6386,18 @@ "return-value", "test.ngc", ); + const returnValueNgcFiles = [ + "test.ngc", + ]; + if (returnValueNgcFiles.length !== 1 || new Set(returnValueNgcFiles).size !== returnValueNgcFiles.length) { + throw new Error("browser_interp_return_value_fixture_coverage: list drift"); + } + const returnValueStagedNgcFiles = [ + returnValuePath, + ].map((path) => path.replace("/work/browser-interp/return-value/", "")); + if (returnValueStagedNgcFiles.join(",") !== returnValueNgcFiles.join(",")) { + throw new Error("browser_interp_return_value_staging_manifest: list drift"); + } verifyExpectedOutput( "browser_interp_return_value", interp.runFile(returnValuePath), diff --git a/wasm-port/tests/wasm/node/verify_interp_wasm.mjs b/wasm-port/tests/wasm/node/verify_interp_wasm.mjs index 745421f..e5f42d5 100644 --- a/wasm-port/tests/wasm/node/verify_interp_wasm.mjs +++ b/wasm-port/tests/wasm/node/verify_interp_wasm.mjs @@ -1240,6 +1240,23 @@ verifyExpectedOutput( ); const doWhileBreakBugPath = writeInterpRegressionFile("do-while-break", "bug.ngc"); +const doWhileBreakNgcFiles = [ + "bug.ngc", + "test.ngc", +]; +assert.deepEqual( + doWhileBreakNgcFiles, + interpRegressionNgcFilesRecursive("do-while-break"), + "interp do-while-break fixture coverage drift", +); +assert.deepEqual( + [ + doWhileBreakBugPath, + doWhileBreakPath, + ], + doWhileBreakNgcFiles.map((file) => `/work/interp/do-while-break/${file}`), + "interp do-while-break staging manifest drift", +); verifyExpectedOutput( "interp_do_while_break_bug_wasm", interp.runFile(doWhileBreakBugPath), @@ -1285,6 +1302,21 @@ verifyExpectedOutput( ); const existsPath = writeInterpRegressionFile("exists", "test.ngc"); +const existsNgcFiles = [ + "test.ngc", +]; +assert.deepEqual( + existsNgcFiles, + interpRegressionNgcFilesRecursive("exists"), + "interp exists fixture coverage drift", +); +assert.deepEqual( + [ + existsPath, + ], + existsNgcFiles.map((file) => `/work/interp/exists/${file}`), + "interp exists staging manifest drift", +); verifyExpectedOutput( "interp_exists_wasm", interp.runFile(existsPath), @@ -1300,6 +1332,21 @@ verifyExpectedOutput( ); const returnValuePath = writeInterpRegressionFile("return-value", "test.ngc"); +const returnValueNgcFiles = [ + "test.ngc", +]; +assert.deepEqual( + returnValueNgcFiles, + interpRegressionNgcFilesRecursive("return-value"), + "interp return-value fixture coverage drift", +); +assert.deepEqual( + [ + returnValuePath, + ], + returnValueNgcFiles.map((file) => `/work/interp/return-value/${file}`), + "interp return-value staging manifest drift", +); verifyExpectedOutput( "interp_return_value_wasm", interp.runFile(returnValuePath),