Guard remap generated file staging

This commit is contained in:
2026-06-13 14:23:23 +08:00
parent e039cacc99
commit bea832094f
3 changed files with 55 additions and 8 deletions

View File

@@ -2169,3 +2169,42 @@ remaining staged path guard inventory重点确认
- 是否还有 generated-file staged path guard 需要单独命名,例如 `simpockets.tbl` - 是否还有 generated-file staged path guard 需要单独命名,例如 `simpockets.tbl`
- 是否有 helper 已无调用,可以删除; - 是否有 helper 已无调用,可以删除;
- 不推进 blocked runtime promotion不扩大 browser full inventory不新增 JS CNC 语义。 - 不推进 blocked runtime promotion不扩大 browser full inventory不新增 JS CNC 语义。
四十九、2026-06-13 继续执行记录remap generated-file staging helper inventory
本批按上一条建议做 remaining staged path guard inventory并收敛发现的 generated-file
路径对账:
- 复扫 Node/browser interp smoke 中的 staged path guard、`replace(...)` inline 对账、
generated-file guard 和 helper 调用;
- 确认 `remap-io/simpockets.tbl` 是当前仍以 inline 路径判断表达的 generated-file
staged path guard
- Node 侧新增 `assertRemapRegressionGeneratedFileStaging(...)`
- browser 侧新增同用途的 `assertRemapRegressionGeneratedFileStaging(...)`
- Node/browser 侧将 `remap-io` 运行时生成的 `simpockets.tbl` 路径判断切换为专用
generated-file staging helper
- 保持 browser 不枚举目录;
- 仅整理 host/filesystem staging guard不改变 remap I/O、generated tool table、
interpreter 或 CNC 语义。
已运行验证:
```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
```
结果:全部通过。
后续继续做 staged path guard inventory 的第二轮,优先确认:
- `assertInterpIniContextNgcStaging(...)` 中的 `replace(...)` 是否应抽为通用
`stripStagedPrefix(...)` helper
- direct-file 单文件 guard 是否需要按 family 增加 generated-file 命名 helper
- 是否还有已无调用 helper 可删除;
- 继续不推进 blocked runtime promotion、browser full inventory 扩面或 JS CNC 语义实现。

View File

@@ -4658,6 +4658,12 @@
} }
} }
function assertRemapRegressionGeneratedFileStaging(name, filename, wasmPath) {
if (wasmPath !== `/work/browser-remap/${name}/${filename}`) {
throw new Error(`browser_remap_${name}_${filename}_generated_staging: path drift`);
}
}
function assertRemapRegressionUnstagedOverlap(name, files, expectedUnstagedFiles) { function assertRemapRegressionUnstagedOverlap(name, files, expectedUnstagedFiles) {
if (expectedUnstagedFiles.some((file) => files.includes(file))) { if (expectedUnstagedFiles.some((file) => files.includes(file))) {
throw new Error(`browser_remap_${name}_unstaged_fixture_overlap: list drift`); throw new Error(`browser_remap_${name}_unstaged_fixture_overlap: list drift`);
@@ -6332,9 +6338,7 @@
const remapIoDir = await writeRemapRegressionFiles(interp, "remap-io", remapIoFiles); const remapIoDir = await writeRemapRegressionFiles(interp, "remap-io", remapIoFiles);
assertRemapRegressionFilesStaging("remap-io", remapIoFiles, remapIoDir); assertRemapRegressionFilesStaging("remap-io", remapIoFiles, remapIoDir);
const remapIoGeneratedToolTablePath = `${remapIoDir}/simpockets.tbl`; const remapIoGeneratedToolTablePath = `${remapIoDir}/simpockets.tbl`;
if (remapIoGeneratedToolTablePath !== "/work/browser-remap/remap-io/simpockets.tbl") { assertRemapRegressionGeneratedFileStaging("remap-io", "simpockets.tbl", remapIoGeneratedToolTablePath);
throw new Error("browser_remap_remap_io_generated_tool_table_staging: path drift");
}
interp.writeTextFile(remapIoGeneratedToolTablePath, "T2 P2 Z0 ;remap-io tool\n"); interp.writeTextFile(remapIoGeneratedToolTablePath, "T2 P2 Z0 ;remap-io tool\n");
verifyExpectedOutput( verifyExpectedOutput(
"browser_remap_io_ngc_mdi", "browser_remap_io_ngc_mdi",

View File

@@ -272,6 +272,14 @@ function assertRemapRegressionFilesStaging(name, files, wasmDir) {
} }
} }
function assertRemapRegressionGeneratedFileStaging(name, filename, wasmPath) {
assert.equal(
wasmPath,
`/work/remap/${name}/${filename}`,
`remap ${name}/${filename} generated staging path drift`,
);
}
function writeInterpRegressionFile(name, filename) { function writeInterpRegressionFile(name, filename) {
const sourceDir = resolve(rootDir, "vendor/linuxcnc/tests/interp", name); const sourceDir = resolve(rootDir, "vendor/linuxcnc/tests/interp", name);
const wasmDir = `/work/interp/${name}`; const wasmDir = `/work/interp/${name}`;
@@ -1344,11 +1352,7 @@ const remapIoDir = writeRemapRegressionFiles("remap-io", remapIoFiles);
assertRemapRegressionCoverage("remap-io", remapIoFiles); assertRemapRegressionCoverage("remap-io", remapIoFiles);
assertRemapRegressionFilesStaging("remap-io", remapIoFiles, remapIoDir); assertRemapRegressionFilesStaging("remap-io", remapIoFiles, remapIoDir);
const remapIoGeneratedToolTablePath = `${remapIoDir}/simpockets.tbl`; const remapIoGeneratedToolTablePath = `${remapIoDir}/simpockets.tbl`;
assert.equal( assertRemapRegressionGeneratedFileStaging("remap-io", "simpockets.tbl", remapIoGeneratedToolTablePath);
remapIoGeneratedToolTablePath,
"/work/remap/remap-io/simpockets.tbl",
"remap remap-io generated tool table staging path drift",
);
interp.writeTextFile(remapIoGeneratedToolTablePath, "T2 P2 Z0 ;remap-io tool\n"); interp.writeTextFile(remapIoGeneratedToolTablePath, "T2 P2 Z0 ;remap-io tool\n");
verifyExpectedOutput( verifyExpectedOutput(
"remap_io_ngc_mdi_wasm", "remap_io_ngc_mdi_wasm",