From 5175444fe9980942759c333a197d8103fdfab288 Mon Sep 17 00:00:00 2001 From: wangdequan Date: Sat, 13 Jun 2026 12:53:55 +0800 Subject: [PATCH] Guard ccomp per-file staging paths --- text6.txt | 54 +++++++++++++++++++ wasm-port/tests/browser/interp_smoke.html | 17 +++--- .../tests/wasm/node/verify_interp_wasm.mjs | 29 ++++++---- 3 files changed, 82 insertions(+), 18 deletions(-) diff --git a/text6.txt b/text6.txt index cfa8cfc..91eedae 100644 --- a/text6.txt +++ b/text6.txt @@ -1863,3 +1863,57 @@ path helper,优先候选: 建议下一批先处理 ccomp 4 组,因为 file manifest 固定为 `test.ngc`、`test.tbl`, 且 Node/browser coverage 已成型。继续避免 blocked runtime promotion、browser full inventory 扩面和 JS CNC 语义实现。 + +四十三、2026-06-13 继续执行记录:ccomp per-file staging helper guard + +本批按第 42 批建议处理 ccomp 专用 staged path helper: + +- `lathe-comp` +- `mill-g90g91g92` +- `mill-line-arc-entry` +- `mill-zchanges` + +完成内容: + +- Node 侧将 `assertCcompRegressionStaging(...)` 拆分为 + `assertCcompRegressionCoverage(...)` 和 `assertCcompRegressionFilesStaging(...)`; +- Node 侧保留 vendored `test.ngc`、`test.tbl` manifest coverage; +- Node 侧将 4 个 ccomp fixture 切换为 coverage helper 加 per-file staging helper; +- browser 侧将 ccomp helper 改为逐个文件检查 + `/work/browser-ccomp//` staged path; +- browser 侧同步替换 4 个 ccomp fixture 调用; +- `test.ini` 仍由 `writeCcompRegressionFiles(...)` 运行时生成,不纳入 vendored + staged manifest; +- browser 侧仍不枚举目录; +- 仅整理 host/filesystem staging guard,不改变 cutter compensation、tool table、 + generated INI 或 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 +``` + +结果:全部通过。 + +下一步建议: + +继续处理 g10 专用 helper。当前候选: + +- `g10-l1-l10` +- `g10-l11` +- `g10-l2-while-active` +- `g10-l20-while-active` +- `g10-with-g92` + +这些已有 fixed file list 和 Node/browser coverage,可按 ccomp 模式将 +`assertG10RegressionStaging(...)` 拆成 coverage helper 与 per-file staging helper。 +注意 `test.tbl` 存在时 `test.ini` 仍由 `writeG10RegressionFiles(...)` 运行时生成, +不要纳入 vendored staged manifest。继续避免 blocked runtime promotion、browser full +inventory 扩面和 JS CNC 语义实现。 diff --git a/wasm-port/tests/browser/interp_smoke.html b/wasm-port/tests/browser/interp_smoke.html index d9155e5..87b342e 100644 --- a/wasm-port/tests/browser/interp_smoke.html +++ b/wasm-port/tests/browser/interp_smoke.html @@ -4730,13 +4730,14 @@ "test.tbl", ]; - function assertCcompRegressionStaging(name, wasmDir) { + function assertCcompRegressionFilesStaging(name, wasmDir) { if (ccompRegressionFiles.length !== 2 || new Set(ccompRegressionFiles).size !== ccompRegressionFiles.length) { throw new Error("browser_interp_ccomp_fixture_coverage: list drift"); } - const ccompStagedRelativeFiles = ccompRegressionFiles.map((file) => `${wasmDir}/${file}`.replace(`/work/browser-ccomp/${name}/`, "")); - if (ccompStagedRelativeFiles.join(",") !== ccompRegressionFiles.join(",")) { - throw new Error(`browser_interp_ccomp_${name}_staging_manifest: list drift`); + for (const file of ccompRegressionFiles) { + if (`${wasmDir}/${file}` !== `/work/browser-ccomp/${name}/${file}`) { + throw new Error(`browser_interp_ccomp_${name}_${file}_staging_manifest: list drift`); + } } } @@ -6791,7 +6792,7 @@ ); const ccompLatheCompDir = await writeCcompRegressionFiles(interp, "lathe-comp"); - assertCcompRegressionStaging("lathe-comp", ccompLatheCompDir); + assertCcompRegressionFilesStaging("lathe-comp", ccompLatheCompDir); verifyExpectedOutput( "browser_interp_ccomp_lathe_comp", interp.runFileWithIni( @@ -6816,7 +6817,7 @@ interp, "mill-g90g91g92", ); - assertCcompRegressionStaging("mill-g90g91g92", ccompMillG90G91G92Dir); + assertCcompRegressionFilesStaging("mill-g90g91g92", ccompMillG90G91G92Dir); verifyExpectedOutput( "browser_interp_ccomp_mill_g90g91g92", interp.runFileWithIni( @@ -6840,7 +6841,7 @@ interp, "mill-line-arc-entry", ); - assertCcompRegressionStaging("mill-line-arc-entry", ccompMillLineArcEntryDir); + assertCcompRegressionFilesStaging("mill-line-arc-entry", ccompMillLineArcEntryDir); verifyExpectedOutput( "browser_interp_ccomp_mill_line_arc_entry", interp.runFileWithIni( @@ -6861,7 +6862,7 @@ ); const ccompMillZchangesDir = await writeCcompRegressionFiles(interp, "mill-zchanges"); - assertCcompRegressionStaging("mill-zchanges", ccompMillZchangesDir); + assertCcompRegressionFilesStaging("mill-zchanges", ccompMillZchangesDir); verifyExpectedOutput( "browser_interp_ccomp_mill_zchanges", interp.runFileWithIni( diff --git a/wasm-port/tests/wasm/node/verify_interp_wasm.mjs b/wasm-port/tests/wasm/node/verify_interp_wasm.mjs index 83b2fb7..cbbd44f 100644 --- a/wasm-port/tests/wasm/node/verify_interp_wasm.mjs +++ b/wasm-port/tests/wasm/node/verify_interp_wasm.mjs @@ -377,7 +377,7 @@ const ccompRegressionFiles = [ "test.tbl", ]; -function assertCcompRegressionStaging(name, wasmDir) { +function assertCcompRegressionCoverage(name) { const sourceDir = resolve(rootDir, "vendor/linuxcnc/tests/ccomp", name); assert.deepEqual( readdirSync(sourceDir) @@ -386,11 +386,16 @@ function assertCcompRegressionStaging(name, wasmDir) { ccompRegressionFiles, `interp ccomp ${name} fixture coverage drift`, ); - assert.deepEqual( - ccompRegressionFiles.map((file) => `${wasmDir}/${file}`), - ccompRegressionFiles.map((file) => `/work/ccomp/${name}/${file}`), - `interp ccomp ${name} staging manifest drift`, - ); +} + +function assertCcompRegressionFilesStaging(name, wasmDir) { + for (const file of ccompRegressionFiles) { + assert.equal( + `${wasmDir}/${file}`, + `/work/ccomp/${name}/${file}`, + `interp ccomp ${name}/${file} staging manifest drift`, + ); + } } function writeG10RegressionFiles(name, files) { @@ -1763,7 +1768,8 @@ verifyExpectedOutput( ); const ccompLatheCompDir = writeCcompRegressionFiles("lathe-comp"); -assertCcompRegressionStaging("lathe-comp", ccompLatheCompDir); +assertCcompRegressionCoverage("lathe-comp"); +assertCcompRegressionFilesStaging("lathe-comp", ccompLatheCompDir); verifyExpectedOutput( "interp_ccomp_lathe_comp_wasm", interp.runFileWithIni(`${ccompLatheCompDir}/test.ngc`, `${ccompLatheCompDir}/test.ini`), @@ -1782,7 +1788,8 @@ verifyExpectedOutput( ); const ccompMillG90G91G92Dir = writeCcompRegressionFiles("mill-g90g91g92"); -assertCcompRegressionStaging("mill-g90g91g92", ccompMillG90G91G92Dir); +assertCcompRegressionCoverage("mill-g90g91g92"); +assertCcompRegressionFilesStaging("mill-g90g91g92", ccompMillG90G91G92Dir); verifyExpectedOutput( "interp_ccomp_mill_g90g91g92_wasm", interp.runFileWithIni( @@ -1803,7 +1810,8 @@ verifyExpectedOutput( ); const ccompMillLineArcEntryDir = writeCcompRegressionFiles("mill-line-arc-entry"); -assertCcompRegressionStaging("mill-line-arc-entry", ccompMillLineArcEntryDir); +assertCcompRegressionCoverage("mill-line-arc-entry"); +assertCcompRegressionFilesStaging("mill-line-arc-entry", ccompMillLineArcEntryDir); verifyExpectedOutput( "interp_ccomp_mill_line_arc_entry_wasm", interp.runFileWithIni( @@ -1824,7 +1832,8 @@ verifyExpectedOutput( ); const ccompMillZchangesDir = writeCcompRegressionFiles("mill-zchanges"); -assertCcompRegressionStaging("mill-zchanges", ccompMillZchangesDir); +assertCcompRegressionCoverage("mill-zchanges"); +assertCcompRegressionFilesStaging("mill-zchanges", ccompMillZchangesDir); verifyExpectedOutput( "interp_ccomp_mill_zchanges_wasm", interp.runFileWithIni(`${ccompMillZchangesDir}/test.ngc`, `${ccompMillZchangesDir}/test.ini`),