Guard final special remap staging paths

This commit is contained in:
2026-06-13 13:29:37 +08:00
parent 76aa9fb39e
commit e039cacc99
3 changed files with 71 additions and 28 deletions

View File

@@ -2119,3 +2119,53 @@ remap aggregate helper 仅剩两个特殊 case
staged path guard建议留到最后单独处理。
继续避免 blocked runtime promotion、browser full inventory 扩面和 JS CNC 语义实现。
四十八、2026-06-13 继续执行记录final special remap per-file staging helper guard
本批处理剩余两个特殊 remap staged path guard
- `nested-remaps-oword`
- `remap-io`
完成内容:
- Node 侧将 `nested-remaps-oword` 从 `assertRemapRegressionStaging(...)` 切换为
`assertRemapRegressionCoverage(...)` 加
`assertRemapRegressionFilesStaging(...)`
- Node 侧继续保留 expected-unstaged `testsub.ngc` 的 manifest coverage 与 overlap
guard
- browser 侧新增 `assertRemapRegressionUnstagedOverlap(...)`,只检查 fixed list 与
expected-unstaged list 不重叠,不枚举目录;
- browser 侧将 `nested-remaps-oword` 切换为 expected-unstaged overlap guard 加
per-file staging helper
- Node/browser 侧将 `remap-io` vendored file list 切换为 per-file staging helper
- `remap-io` 运行时生成的 `simpockets.tbl` 继续保留单独 staged path guard
- 删除 Node/browser 侧已无调用的 `assertRemapRegressionStaging(...)` aggregate helper
- browser 侧仍不枚举目录;
- 仅整理 host/filesystem staging guard不改变 remap execution、nested O-word、
remap I/O、generated tool table 或 interpreter 语义。
已运行验证:
```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_INI_BUILD=1 SKIP_INTERP_BUILD=1 wasm-port/tests/browser/verify_interp_browser.sh
SKIP_INTERP_BUILD=1 wasm-port/tests/wasm/node/verify_sim_configs_inventory_wasm.sh
wasm-port/tests/host/verify_host_smokes.sh
```
结果:全部通过。
下一步建议:
remap/ccomp/g10/ordinary interp aggregate staged path guard 已收敛完成。下一批建议做一次
remaining staged path guard inventory重点确认
- 是否还有 `replace(.../work/browser-...)` 形式的 inline staged path 对账可以改为
专用 helper
- 是否还有 generated-file staged path guard 需要单独命名,例如 `simpockets.tbl`
- 是否有 helper 已无调用,可以删除;
- 不推进 blocked runtime promotion不扩大 browser full inventory不新增 JS CNC 语义。

View File

@@ -4647,19 +4647,6 @@
return wasmDir;
}
function assertRemapRegressionStaging(name, files, wasmDir, expectedUnstagedFiles = []) {
if (files.length === 0 || new Set(files).size !== files.length) {
throw new Error(`browser_remap_${name}_fixture_coverage: list drift`);
}
if (expectedUnstagedFiles.some((file) => files.includes(file))) {
throw new Error(`browser_remap_${name}_unstaged_fixture_overlap: list drift`);
}
const remapStagedRelativeFiles = files.map((file) => `${wasmDir}/${file}`.replace(`/work/browser-remap/${name}/`, ""));
if (remapStagedRelativeFiles.join(",") !== files.join(",")) {
throw new Error(`browser_remap_${name}_staging_manifest: list drift`);
}
}
function assertRemapRegressionFilesStaging(name, files, wasmDir) {
if (files.length === 0 || new Set(files).size !== files.length) {
throw new Error(`browser_remap_${name}_fixture_coverage: list drift`);
@@ -4671,6 +4658,12 @@
}
}
function assertRemapRegressionUnstagedOverlap(name, files, expectedUnstagedFiles) {
if (expectedUnstagedFiles.some((file) => files.includes(file))) {
throw new Error(`browser_remap_${name}_unstaged_fixture_overlap: list drift`);
}
}
async function writeInterpRegressionFile(interp, name, filename) {
const sourceDir = `../../vendor/linuxcnc/tests/interp/${name}`;
const wasmDir = `/work/browser-interp/${name}`;
@@ -6201,11 +6194,15 @@
"nested-remaps-oword",
nestedRemapsOwordFiles,
);
assertRemapRegressionStaging(
assertRemapRegressionUnstagedOverlap(
"nested-remaps-oword",
nestedRemapsOwordFiles,
nestedRemapsOwordUnstagedFiles,
);
assertRemapRegressionFilesStaging(
"nested-remaps-oword",
nestedRemapsOwordFiles,
nestedRemapsOwordDir,
nestedRemapsOwordUnstagedFiles,
);
verifyExpectedOutput(
"browser_nested_remaps_oword_remap",
@@ -6333,7 +6330,7 @@
"io_output_m68.ngc",
];
const remapIoDir = await writeRemapRegressionFiles(interp, "remap-io", remapIoFiles);
assertRemapRegressionStaging("remap-io", remapIoFiles, remapIoDir);
assertRemapRegressionFilesStaging("remap-io", remapIoFiles, remapIoDir);
const remapIoGeneratedToolTablePath = `${remapIoDir}/simpockets.tbl`;
if (remapIoGeneratedToolTablePath !== "/work/browser-remap/remap-io/simpockets.tbl") {
throw new Error("browser_remap_remap_io_generated_tool_table_staging: path drift");

View File

@@ -272,15 +272,6 @@ function assertRemapRegressionFilesStaging(name, files, wasmDir) {
}
}
function assertRemapRegressionStaging(name, files, wasmDir, expectedUnstagedFiles = []) {
assertRemapRegressionCoverage(name, files, expectedUnstagedFiles);
assert.deepEqual(
files.map((file) => `${wasmDir}/${file}`),
files.map((file) => `/work/remap/${name}/${file}`),
`remap ${name} staging manifest drift`,
);
}
function writeInterpRegressionFile(name, filename) {
const sourceDir = resolve(rootDir, "vendor/linuxcnc/tests/interp", name);
const wasmDir = `/work/interp/${name}`;
@@ -1212,11 +1203,15 @@ const nestedRemapsOwordDir = writeRemapRegressionFiles(
"nested-remaps-oword",
nestedRemapsOwordFiles,
);
assertRemapRegressionStaging(
assertRemapRegressionCoverage(
"nested-remaps-oword",
nestedRemapsOwordFiles,
nestedRemapsOwordUnstagedFiles,
);
assertRemapRegressionFilesStaging(
"nested-remaps-oword",
nestedRemapsOwordFiles,
nestedRemapsOwordDir,
nestedRemapsOwordUnstagedFiles,
);
verifyExpectedOutput(
"nested_remaps_oword_remap_wasm",
@@ -1346,7 +1341,8 @@ const remapIoFiles = [
"io_output_m68.ngc",
];
const remapIoDir = writeRemapRegressionFiles("remap-io", remapIoFiles);
assertRemapRegressionStaging("remap-io", remapIoFiles, remapIoDir);
assertRemapRegressionCoverage("remap-io", remapIoFiles);
assertRemapRegressionFilesStaging("remap-io", remapIoFiles, remapIoDir);
const remapIoGeneratedToolTablePath = `${remapIoDir}/simpockets.tbl`;
assert.equal(
remapIoGeneratedToolTablePath,