From fba2946a671b70efd48da187a57be38fc8ee7562 Mon Sep 17 00:00:00 2001 From: wangdequan Date: Sat, 13 Jun 2026 08:46:05 +0800 Subject: [PATCH] Guard m98m99 direct-file staging helper --- text6.txt | 50 +++++++++++++++++++ wasm-port/tests/browser/interp_smoke.html | 28 ++++++----- .../tests/wasm/node/verify_interp_wasm.mjs | 34 +++++++------ 3 files changed, 84 insertions(+), 28 deletions(-) diff --git a/text6.txt b/text6.txt index a76685e..8bdaedb 100644 --- a/text6.txt +++ b/text6.txt @@ -1020,3 +1020,53 @@ m98m99 目录级 staged path guard 已基本收束。下一批建议扫描 `writ 把它们改成局部 fixed path guard;如果继续保持小步提交,可从 `g10` 之后的 direct-file families 或 `writeInterpRegressionFiles(...)` 其他调用点继续收敛。仍不推进 blocked runtime promotion、browser full inventory 扩面或 JS CNC 语义实现。 + +二十五、2026-06-13 继续执行记录:m98m99 direct-file staging helper guard + +本批按“剩余单文件 direct-file guard 收敛”推进,新增 single-file staging helper, +并先替换 m98m99 里短小且已由 aggregate slice 间接覆盖的 4 个 direct-file case: + +- `m98m99/01-basics/test.ngc` +- `m98m99/02-variables/test.ngc` +- `m98m99/03-error-M98-no-P-word/test.ngc` +- `m98m99/14-o-expression-call/test.ngc` + +完成内容: + +- Node 侧新增 `assertInterpRegressionFileStaging(...)`; +- Node 侧检查 staged path 与 `/work/interp//` 精确一致; +- Node 侧将 m98m99 initial aggregate slice 替换为 3 个局部 direct-file guard; +- Node 侧将 final `14-o-expression-call` aggregate slice 替换为局部 direct-file guard; +- browser 侧新增同名 single-file staging helper; +- browser 侧检查 staged path 与 `/work/browser-interp//` 精确一致; +- browser 侧仍不枚举目录; +- 仅整理 host/filesystem staging guard,不改变 Fanuc sub、变量作用域、M98 error 或 + o-expression call 语义。 + +已运行验证: + +```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 +``` + +结果:全部通过。 + +下一步建议: + +继续复用 `assertInterpRegressionFileStaging(...)` 收敛 m98m99 剩余 direct-file slice。 +优先候选: + +- `m98m99/04-M98-but-no-sub/test.ngc` +- `m98m99/05-M98-loops/test.ngc` +- `m98m99/07-nested-subs/test.ngc` +- `m98m99/08-sub-follows-main/test.ngc` +- `m98m99/10-M98-P001/test.ngc` + +其中 `06-error-mixed-sub-styles` 有 4 个同目录文件,可单独作为一批继续处理。继续避免 +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 20d1cb4..46a1ef1 100644 --- a/wasm-port/tests/browser/interp_smoke.html +++ b/wasm-port/tests/browser/interp_smoke.html @@ -4669,6 +4669,12 @@ return `${wasmDir}/${filename}`; } + function assertInterpRegressionFileStaging(name, filename, wasmPath) { + if (wasmPath !== `/work/browser-interp/${name}/${filename}`) { + throw new Error(`browser_interp_${name}_${filename}_staging_manifest: list drift`); + } + } + async function writeInterpRegressionFiles(interp, name, files) { const sourceDir = `../../vendor/linuxcnc/tests/interp/${name}`; const wasmDir = `/work/browser-interp/${name}`; @@ -7856,6 +7862,7 @@ "m98m99/01-basics", "test.ngc", ); + assertInterpRegressionFileStaging("m98m99/01-basics", "test.ngc", m98m99BasicsPath); verifyExpectedOutput( "browser_interp_m98m99_01_basics", interp.runFile(m98m99BasicsPath), @@ -7876,6 +7883,7 @@ "m98m99/02-variables", "test.ngc", ); + assertInterpRegressionFileStaging("m98m99/02-variables", "test.ngc", m98m99VariablesPath); const m98m99VariablesRun = runWithCapturedPrints(() => interp.runFile(m98m99VariablesPath), ); @@ -7905,14 +7913,11 @@ "m98m99/03-error-M98-no-P-word", "test.ngc", ); - const m98m99InitialStagedNgcFiles = [ - m98m99BasicsPath, - m98m99VariablesPath, + assertInterpRegressionFileStaging( + "m98m99/03-error-M98-no-P-word", + "test.ngc", m98m99M98NoPWordPath, - ].map((path) => path.replace("/work/browser-interp/m98m99/", "")); - if (m98m99InitialStagedNgcFiles.join(",") !== m98m99RegressionFiles.slice(0, 3).join(",")) { - throw new Error("browser_interp_m98m99_initial_staging_manifest: list drift"); - } + ); verifyExpectedOutput( "browser_interp_m98m99_03_error_m98_no_p_word", interp.runFile(m98m99M98NoPWordPath), @@ -8420,12 +8425,11 @@ "m98m99/14-o-expression-call", "test.ngc", ); - const m98m99OExpressionCallStagedNgcFiles = [m98m99OExpressionCallPath].map((path) => - path.replace("/work/browser-interp/m98m99/", ""), + assertInterpRegressionFileStaging( + "m98m99/14-o-expression-call", + "test.ngc", + m98m99OExpressionCallPath, ); - if (m98m99OExpressionCallStagedNgcFiles.join(",") !== m98m99RegressionFiles.slice(23, 24).join(",")) { - throw new Error("browser_interp_m98m99_final_staging_manifest: list drift"); - } const m98m99OExpressionCallRun = runWithCapturedPrints(() => interp.runFile(m98m99OExpressionCallPath), ); diff --git a/wasm-port/tests/wasm/node/verify_interp_wasm.mjs b/wasm-port/tests/wasm/node/verify_interp_wasm.mjs index 554d9f9..21feebd 100644 --- a/wasm-port/tests/wasm/node/verify_interp_wasm.mjs +++ b/wasm-port/tests/wasm/node/verify_interp_wasm.mjs @@ -276,6 +276,14 @@ function writeInterpRegressionFile(name, filename) { return `${wasmDir}/${filename}`; } +function assertInterpRegressionFileStaging(name, filename, wasmPath) { + assert.equal( + wasmPath, + `/work/interp/${name}/${filename}`, + `interp ${name}/${filename} staging manifest drift`, + ); +} + function writeInterpRegressionFiles(name, files) { const sourceDir = resolve(rootDir, "vendor/linuxcnc/tests/interp", name); const wasmDir = `/work/interp/${name}`; @@ -2857,6 +2865,7 @@ assert.deepEqual( ); const m98m99BasicsPath = writeInterpRegressionFile("m98m99/01-basics", "test.ngc"); +assertInterpRegressionFileStaging("m98m99/01-basics", "test.ngc", m98m99BasicsPath); verifyExpectedOutput( "interp_m98m99_01_basics_wasm", interp.runFile(m98m99BasicsPath), @@ -2873,6 +2882,7 @@ verifyExpectedOutput( ); const m98m99VariablesPath = writeInterpRegressionFile("m98m99/02-variables", "test.ngc"); +assertInterpRegressionFileStaging("m98m99/02-variables", "test.ngc", m98m99VariablesPath); const m98m99VariablesRun = runWithCapturedPrints(() => interp.runFile(m98m99VariablesPath)); verifyExpectedOutput( "interp_m98m99_02_variables_wasm", @@ -2899,16 +2909,10 @@ const m98m99M98NoPWordPath = writeInterpRegressionFile( "m98m99/03-error-M98-no-P-word", "test.ngc", ); -assert.deepEqual( - [ - m98m99BasicsPath, - m98m99VariablesPath, - m98m99M98NoPWordPath, - ], - m98m99RegressionFiles - .slice(0, 3) - .map((file) => `/work/interp/m98m99/${file}`), - "interp m98m99 initial direct-file staging manifest drift", +assertInterpRegressionFileStaging( + "m98m99/03-error-M98-no-P-word", + "test.ngc", + m98m99M98NoPWordPath, ); verifyExpectedOutput( "interp_m98m99_03_error_m98_no_p_word_wasm", @@ -3397,12 +3401,10 @@ const m98m99OExpressionCallPath = writeInterpRegressionFile( "m98m99/14-o-expression-call", "test.ngc", ); -assert.deepEqual( - [m98m99OExpressionCallPath], - m98m99RegressionFiles - .slice(23, 24) - .map((file) => `/work/interp/m98m99/${file}`), - "interp m98m99 final o-expression direct-file staging manifest drift", +assertInterpRegressionFileStaging( + "m98m99/14-o-expression-call", + "test.ngc", + m98m99OExpressionCallPath, ); const m98m99OExpressionCallRun = runWithCapturedPrints(() => interp.runFile(m98m99OExpressionCallPath),