Guard early direct-file staging

This commit is contained in:
2026-06-13 09:29:00 +08:00
parent 8f47c95bca
commit 6a64219533
3 changed files with 76 additions and 92 deletions

View File

@@ -1432,3 +1432,54 @@ wasm-port/tests/host/verify_host_smokes.sh
`assertInterpRegressionFileStaging(...)` 或小型 per-directory helper 替换内联 staged
path 对账。继续避免 blocked runtime promotion、browser full inventory 扩面和 JS CNC
语义实现。
三十四、2026-06-13 继续执行记录early direct-file staging guard
本批继续收敛 earlier direct-file guard处理 5 个已有 Node/browser coverage 的 fixture
- `do-while-break/bug.ngc`
- `do-while-break/test.ngc`
- `oword-bug315/test.ngc`
- `oword-bug315-p2/test.ngc`
- `exists/test.ngc`
- `return-value/test.ngc`
完成内容:
- Node 侧将 `do-while-break` 改为 `writeInterpRegressionFiles(...)` 加
`assertInterpRegressionStaging(...)`,对该目录 2 个 `.ngc` fixture 精确对账;
- Node 侧将 `oword-bug315`、`oword-bug315-p2`、`exists`、`return-value` 的内联
staged path 对账替换为 `assertInterpRegressionFileStaging(...)`
- browser 侧同步将 `do-while-break` 改为 fixed manifest 加 directory staging guard
- browser 侧同步将其余 4 个单文件 fixture 改为 single-file staging helper
- browser 侧仍不枚举目录;
- 仅整理 host/filesystem staging guard不改变 O-word control-flow、exists 或 return
value 语义。
已运行验证:
```bash
git diff --check
SKIP_INTERP_BUILD=1 wasm-port/tests/wasm/node/verify_interp_wasm.sh
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_sim_configs_inventory_wasm.sh
wasm-port/tests/host/verify_host_smokes.sh
```
结果:全部通过。
下一步建议:
继续收敛后续 earlier direct-file guard。优先候选
- `subs-follow-main`
- `fractional-linenumbers`
- `crazy-paths`
- `namedparam-bug424`
- `flowsnake`
这些已有 Node/browser coverage 和 fixed `.ngc` manifest可继续用
`assertInterpRegressionFileStaging(...)` 替换内联 staged path 对账。继续避免 blocked
runtime promotion、browser full inventory 扩面和 JS CNC 语义实现。

View File

@@ -6346,11 +6346,17 @@
].join("\n"),
);
const doWhileBreakPath = await writeInterpRegressionFile(
const doWhileBreakNgcFiles = [
"bug.ngc",
"test.ngc",
];
const doWhileBreakDir = await writeInterpRegressionFiles(
interp,
"do-while-break",
"test.ngc",
doWhileBreakNgcFiles,
);
assertInterpRegressionStaging("do-while-break", doWhileBreakNgcFiles, doWhileBreakDir);
const doWhileBreakPath = `${doWhileBreakDir}/test.ngc`;
verifyExpectedOutput(
"browser_interp_do_while_break",
interp.runFile(doWhileBreakPath),
@@ -6369,25 +6375,7 @@
].join("\n"),
);
const doWhileBreakBugPath = await writeInterpRegressionFile(
interp,
"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");
}
const doWhileBreakBugPath = `${doWhileBreakDir}/bug.ngc`;
verifyExpectedOutput(
"browser_interp_do_while_break_bug",
interp.runFile(doWhileBreakBugPath),
@@ -6413,12 +6401,7 @@
if (owordBug315NgcFiles.length !== 1 || new Set(owordBug315NgcFiles).size !== owordBug315NgcFiles.length) {
throw new Error("browser_interp_oword_bug315_fixture_coverage: list drift");
}
const owordBug315StagedNgcFiles = [
owordBug315Path,
].map((path) => path.replace("/work/browser-interp/oword-bug315/", ""));
if (owordBug315StagedNgcFiles.join(",") !== owordBug315NgcFiles.join(",")) {
throw new Error("browser_interp_oword_bug315_staging_manifest: list drift");
}
assertInterpRegressionFileStaging("oword-bug315", "test.ngc", owordBug315Path);
verifyExpectedOutput(
"browser_interp_oword_bug315",
interp.runFile(owordBug315Path),
@@ -6444,12 +6427,7 @@
if (owordBug315P2NgcFiles.length !== 1 || new Set(owordBug315P2NgcFiles).size !== owordBug315P2NgcFiles.length) {
throw new Error("browser_interp_oword_bug315_p2_fixture_coverage: list drift");
}
const owordBug315P2StagedNgcFiles = [
owordBug315P2Path,
].map((path) => path.replace("/work/browser-interp/oword-bug315-p2/", ""));
if (owordBug315P2StagedNgcFiles.join(",") !== owordBug315P2NgcFiles.join(",")) {
throw new Error("browser_interp_oword_bug315_p2_staging_manifest: list drift");
}
assertInterpRegressionFileStaging("oword-bug315-p2", "test.ngc", owordBug315P2Path);
verifyExpectedOutput(
"browser_interp_oword_bug315_p2",
interp.runFile(owordBug315P2Path),
@@ -6471,12 +6449,7 @@
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");
}
assertInterpRegressionFileStaging("exists", "test.ngc", existsPath);
verifyExpectedOutput(
"browser_interp_exists",
interp.runFile(existsPath),
@@ -6502,12 +6475,7 @@
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");
}
assertInterpRegressionFileStaging("return-value", "test.ngc", returnValuePath);
verifyExpectedOutput(
"browser_interp_return_value",
interp.runFile(returnValuePath),

View File

@@ -1339,7 +1339,13 @@ verifyExpectedOutput(
].join("\n"),
);
const doWhileBreakPath = writeInterpRegressionFile("do-while-break", "test.ngc");
const doWhileBreakNgcFiles = [
"bug.ngc",
"test.ngc",
];
const doWhileBreakDir = writeInterpRegressionFiles("do-while-break", doWhileBreakNgcFiles);
assertInterpRegressionStaging("do-while-break", doWhileBreakNgcFiles, doWhileBreakDir);
const doWhileBreakPath = `${doWhileBreakDir}/test.ngc`;
verifyExpectedOutput(
"interp_do_while_break_wasm",
interp.runFile(doWhileBreakPath),
@@ -1358,24 +1364,7 @@ verifyExpectedOutput(
].join("\n"),
);
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",
);
const doWhileBreakBugPath = `${doWhileBreakDir}/bug.ngc`;
verifyExpectedOutput(
"interp_do_while_break_bug_wasm",
interp.runFile(doWhileBreakBugPath),
@@ -1399,13 +1388,7 @@ assert.deepEqual(
interpRegressionNgcFilesRecursive("oword-bug315"),
"interp oword-bug315 fixture coverage drift",
);
assert.deepEqual(
[
owordBug315Path,
],
owordBug315NgcFiles.map((file) => `/work/interp/oword-bug315/${file}`),
"interp oword-bug315 staging manifest drift",
);
assertInterpRegressionFileStaging("oword-bug315", "test.ngc", owordBug315Path);
verifyExpectedOutput(
"interp_oword_bug315_wasm",
interp.runFile(owordBug315Path),
@@ -1429,13 +1412,7 @@ assert.deepEqual(
interpRegressionNgcFilesRecursive("oword-bug315-p2"),
"interp oword-bug315-p2 fixture coverage drift",
);
assert.deepEqual(
[
owordBug315P2Path,
],
owordBug315P2NgcFiles.map((file) => `/work/interp/oword-bug315-p2/${file}`),
"interp oword-bug315-p2 staging manifest drift",
);
assertInterpRegressionFileStaging("oword-bug315-p2", "test.ngc", owordBug315P2Path);
verifyExpectedOutput(
"interp_oword_bug315_p2_wasm",
interp.runFile(owordBug315P2Path),
@@ -1459,13 +1436,7 @@ assert.deepEqual(
interpRegressionNgcFilesRecursive("exists"),
"interp exists fixture coverage drift",
);
assert.deepEqual(
[
existsPath,
],
existsNgcFiles.map((file) => `/work/interp/exists/${file}`),
"interp exists staging manifest drift",
);
assertInterpRegressionFileStaging("exists", "test.ngc", existsPath);
verifyExpectedOutput(
"interp_exists_wasm",
interp.runFile(existsPath),
@@ -1489,13 +1460,7 @@ assert.deepEqual(
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",
);
assertInterpRegressionFileStaging("return-value", "test.ngc", returnValuePath);
verifyExpectedOutput(
"interp_return_value_wasm",
interp.runFile(returnValuePath),