Add blocked runtime gate review coverage

This commit is contained in:
2026-06-12 22:59:57 +08:00
parent 949d5d2756
commit dcab5eaf32
9 changed files with 12494 additions and 37 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -34,7 +34,17 @@ RUNTIME_BOUNDARY_PROMOTION_READINESS="$ROOT_DIR/build/wasm/sim-configs-inventory
RUNTIME_BOUNDARY_PROMOTION_BLOCKERS="$ROOT_DIR/build/wasm/sim-configs-inventory/runtime-boundary-promotion-blockers.tsv"
RUNTIME_BOUNDARY_POST_NATIVE_PASS_GATES="$ROOT_DIR/build/wasm/sim-configs-inventory/runtime-boundary-post-native-pass-gates.tsv"
RUNTIME_BOUNDARY_HOST_PREFLIGHT="$ROOT_DIR/build/wasm/sim-configs-inventory/runtime-boundary-host-preflight.tsv"
RUNTIME_BOUNDARY_HOST_REQUIREMENT_SUMMARY="$ROOT_DIR/build/wasm/sim-configs-inventory/runtime-boundary-host-requirement-summary.tsv"
RUNTIME_BOUNDARY_HOST_UNBLOCK_PLAN="$ROOT_DIR/build/wasm/sim-configs-inventory/runtime-boundary-host-unblock-plan.tsv"
RUNTIME_BOUNDARY_FAMILY_HOST_READINESS="$ROOT_DIR/build/wasm/sim-configs-inventory/runtime-boundary-family-host-readiness.tsv"
RUNTIME_BOUNDARY_HOST_READINESS_ROLLUP="$ROOT_DIR/build/wasm/sim-configs-inventory/runtime-boundary-host-readiness-rollup.tsv"
RUNTIME_BOUNDARY_OPT_IN_PROBE_DISPATCH_PLAN="$ROOT_DIR/build/wasm/sim-configs-inventory/runtime-boundary-opt-in-probe-dispatch-plan.tsv"
RUNTIME_BOUNDARY_OPT_IN_PROBE_DISPATCH_ROLLUP="$ROOT_DIR/build/wasm/sim-configs-inventory/runtime-boundary-opt-in-probe-dispatch-rollup.tsv"
RUNTIME_BOUNDARY_OPT_IN_PROBE_SKIP_EVIDENCE_CONTRACT="$ROOT_DIR/build/wasm/sim-configs-inventory/runtime-boundary-opt-in-probe-skip-evidence-contract.tsv"
RUNTIME_BOUNDARY_OPT_IN_PROBE_SKIP_EVIDENCE_ROLLUP="$ROOT_DIR/build/wasm/sim-configs-inventory/runtime-boundary-opt-in-probe-skip-evidence-rollup.tsv"
RUNTIME_BOUNDARY_NATIVE_EVIDENCE_ACCEPTANCE_GATE="$ROOT_DIR/build/wasm/sim-configs-inventory/runtime-boundary-native-evidence-acceptance-gate.tsv"
BOUNDARY_PHASE_COMPLETION_SUMMARY="$ROOT_DIR/build/wasm/sim-configs-inventory/boundary-phase-completion-summary.tsv"
NEXT_BOUNDARY_WORKLIST="$ROOT_DIR/build/wasm/sim-configs-inventory/next-boundary-worklist.tsv"
NEXT_BOUNDARY_RECOMMENDATIONS="$ROOT_DIR/build/wasm/sim-configs-inventory/next-boundary-recommendations.tsv"
INVENTORY_SCRIPT="$ROOT_DIR/tests/wasm/node/verify_sim_configs_inventory_wasm.mjs"
NATIVE_SOURCE_PROOF_SUMMARY="$ROOT_DIR/build/native/native-source-proof-summary.tsv"
@@ -84,7 +94,17 @@ for artifact in \
"$RUNTIME_BOUNDARY_PROMOTION_BLOCKERS" \
"$RUNTIME_BOUNDARY_POST_NATIVE_PASS_GATES" \
"$RUNTIME_BOUNDARY_HOST_PREFLIGHT" \
"$RUNTIME_BOUNDARY_HOST_REQUIREMENT_SUMMARY" \
"$RUNTIME_BOUNDARY_HOST_UNBLOCK_PLAN" \
"$RUNTIME_BOUNDARY_FAMILY_HOST_READINESS" \
"$RUNTIME_BOUNDARY_HOST_READINESS_ROLLUP" \
"$RUNTIME_BOUNDARY_OPT_IN_PROBE_DISPATCH_PLAN" \
"$RUNTIME_BOUNDARY_OPT_IN_PROBE_DISPATCH_ROLLUP" \
"$RUNTIME_BOUNDARY_OPT_IN_PROBE_SKIP_EVIDENCE_CONTRACT" \
"$RUNTIME_BOUNDARY_OPT_IN_PROBE_SKIP_EVIDENCE_ROLLUP" \
"$RUNTIME_BOUNDARY_NATIVE_EVIDENCE_ACCEPTANCE_GATE" \
"$BOUNDARY_PHASE_COMPLETION_SUMMARY" \
"$NEXT_BOUNDARY_WORKLIST" \
"$NEXT_BOUNDARY_RECOMMENDATIONS"; do
if [[ ! -f "$artifact" || "$INVENTORY_SCRIPT" -nt "$artifact" ]]; then
INVENTORY_REQUIRED=1
@@ -117,6 +137,33 @@ fi
if [[ -f "$NATIVE_RUNTIME_PROBE_SOURCE_SUMMARY" && "$NATIVE_RUNTIME_PROBE_SOURCE_SUMMARY" -nt "$RUNTIME_BOUNDARY_HOST_PREFLIGHT" ]]; then
INVENTORY_REQUIRED=1
fi
if [[ -f "$NATIVE_RUNTIME_PROBE_SOURCE_SUMMARY" && "$NATIVE_RUNTIME_PROBE_SOURCE_SUMMARY" -nt "$RUNTIME_BOUNDARY_HOST_REQUIREMENT_SUMMARY" ]]; then
INVENTORY_REQUIRED=1
fi
if [[ -f "$NATIVE_RUNTIME_PROBE_SOURCE_SUMMARY" && "$NATIVE_RUNTIME_PROBE_SOURCE_SUMMARY" -nt "$RUNTIME_BOUNDARY_HOST_UNBLOCK_PLAN" ]]; then
INVENTORY_REQUIRED=1
fi
if [[ -f "$NATIVE_RUNTIME_PROBE_SOURCE_SUMMARY" && "$NATIVE_RUNTIME_PROBE_SOURCE_SUMMARY" -nt "$RUNTIME_BOUNDARY_FAMILY_HOST_READINESS" ]]; then
INVENTORY_REQUIRED=1
fi
if [[ -f "$NATIVE_RUNTIME_PROBE_SOURCE_SUMMARY" && "$NATIVE_RUNTIME_PROBE_SOURCE_SUMMARY" -nt "$RUNTIME_BOUNDARY_HOST_READINESS_ROLLUP" ]]; then
INVENTORY_REQUIRED=1
fi
if [[ -f "$NATIVE_RUNTIME_PROBE_SOURCE_SUMMARY" && "$NATIVE_RUNTIME_PROBE_SOURCE_SUMMARY" -nt "$RUNTIME_BOUNDARY_OPT_IN_PROBE_DISPATCH_PLAN" ]]; then
INVENTORY_REQUIRED=1
fi
if [[ -f "$NATIVE_RUNTIME_PROBE_SOURCE_SUMMARY" && "$NATIVE_RUNTIME_PROBE_SOURCE_SUMMARY" -nt "$RUNTIME_BOUNDARY_OPT_IN_PROBE_DISPATCH_ROLLUP" ]]; then
INVENTORY_REQUIRED=1
fi
if [[ -f "$NATIVE_RUNTIME_PROBE_SOURCE_SUMMARY" && "$NATIVE_RUNTIME_PROBE_SOURCE_SUMMARY" -nt "$RUNTIME_BOUNDARY_OPT_IN_PROBE_SKIP_EVIDENCE_CONTRACT" ]]; then
INVENTORY_REQUIRED=1
fi
if [[ -f "$NATIVE_RUNTIME_PROBE_SOURCE_SUMMARY" && "$NATIVE_RUNTIME_PROBE_SOURCE_SUMMARY" -nt "$RUNTIME_BOUNDARY_OPT_IN_PROBE_SKIP_EVIDENCE_ROLLUP" ]]; then
INVENTORY_REQUIRED=1
fi
if [[ -f "$NATIVE_RUNTIME_PROBE_SOURCE_SUMMARY" && "$NATIVE_RUNTIME_PROBE_SOURCE_SUMMARY" -nt "$RUNTIME_BOUNDARY_NATIVE_EVIDENCE_ACCEPTANCE_GATE" ]]; then
INVENTORY_REQUIRED=1
fi
if [[ "$INVENTORY_REQUIRED" == "1" ]]; then
SKIP_INTERP_BUILD=1 "$ROOT_DIR/tests/wasm/node/verify_sim_configs_inventory_wasm.sh"
fi

View File

@@ -266,6 +266,35 @@ function writeInterpRegressionFiles(name, files) {
return wasmDir;
}
function interpRegressionNgcFiles(name) {
const sourceDir = resolve(rootDir, "vendor/linuxcnc/tests/interp", name);
return readdirSync(sourceDir)
.filter((filename) => filename.endsWith(".ngc"))
.sort();
}
function interpRegressionNgcFilesRecursive(name) {
const sourceDir = resolve(rootDir, "vendor/linuxcnc/tests/interp", name);
const files = [];
function walk(relativeDir) {
const directory = resolve(sourceDir, relativeDir);
for (const entry of readdirSync(directory, { withFileTypes: true })) {
const relativePath = relativeDir ? `${relativeDir}/${entry.name}` : entry.name;
if (entry.isDirectory()) {
walk(relativePath);
continue;
}
if (entry.isFile() && entry.name.endsWith(".ngc")) {
files.push(relativePath);
}
}
}
walk("");
return files.sort();
}
function writeCcompRegressionFiles(name) {
const sourceDir = resolve(rootDir, "vendor/linuxcnc/tests/ccomp", name);
const wasmDir = `/work/ccomp/${name}`;
@@ -1210,6 +1239,21 @@ verifyExpectedOutput(
].join("\n"),
);
const doWhileBreakBugPath = writeInterpRegressionFile("do-while-break", "bug.ngc");
verifyExpectedOutput(
"interp_do_while_break_bug_wasm",
interp.runFile(doWhileBreakBugPath),
[
"file_open=0",
"file_read_count=7",
"file_execute_count=7",
"file_saw_error=0",
"canon_event=PROGRAM_END",
"absent=@end of do-while-loop",
"absent=file_saw_error=1",
].join("\n"),
);
const owordBug315Path = writeInterpRegressionFile("oword-bug315", "test.ngc");
verifyExpectedOutput(
"interp_oword_bug315_wasm",
@@ -1550,7 +1594,7 @@ verifyExpectedOutput(
].join("\n"),
);
for (const badFixture of [
const badInterpFixtures = [
{
name: "a_in_canned_cycle",
file: "a-in-canned-cycle.ngc",
@@ -1698,7 +1742,13 @@ for (const badFixture of [
executeCount: 1,
errorText: "All axes missing with motion code",
},
]) {
];
assert.deepEqual(
badInterpFixtures.map((fixture) => fixture.file).sort(),
interpRegressionNgcFiles("bad"),
"interp bad fixture coverage drift",
);
for (const badFixture of badInterpFixtures) {
const badPath = writeInterpRegressionFile("bad", badFixture.file);
verifyExpectedOutput(
`interp_bad_${badFixture.name}_wasm`,
@@ -1733,7 +1783,7 @@ verifyExpectedOutput(
].join("\n"),
);
for (const goodArcFixture of [
const goodArcFixtures = [
{
name: "big_imperial_center_format",
file: "good-arc.big.imperial.center-format.ngc",
@@ -1776,7 +1826,13 @@ for (const goodArcFixture of [
firstEnd: 50,
firstAxis: 24.986,
},
]) {
];
assert.deepEqual(
goodArcFixtures.map((fixture) => fixture.file).sort(),
interpRegressionNgcFiles("good"),
"interp good fixture coverage drift",
);
for (const goodArcFixture of goodArcFixtures) {
const goodArcPath = writeInterpRegressionFile("good", goodArcFixture.file);
verifyExpectedOutput(
`interp_good_arc_${goodArcFixture.name}_wasm`,
@@ -1952,6 +2008,16 @@ verifyExpectedOutput(
);
const rotationAbsPtsPath = writeInterpRegressionFile("rotation/abs-pts", "test.ngc");
const rotationRegressionFiles = [
"abs-pts/test.ngc",
"g28/g28.ngc",
"g53/g53.ngc",
];
assert.deepEqual(
rotationRegressionFiles,
interpRegressionNgcFilesRecursive("rotation"),
"interp_rotation_fixture_coverage: upstream .ngc manifest",
);
const rotationAbsPtsOutput = interp.runFile(rotationAbsPtsPath);
verifyExpectedOutput(
"interp_rotation_abs_pts_wasm",
@@ -2198,6 +2264,14 @@ const magicCommentsParamFormatPath = writeInterpRegressionFile(
"magic_comments/param_format_printing",
"test.ngc",
);
const magicCommentsRegressionFiles = [
"param_format_printing/test.ngc",
];
assert.deepEqual(
magicCommentsRegressionFiles,
interpRegressionNgcFilesRecursive("magic_comments"),
"interp_magic_comments_fixture_coverage: upstream .ngc manifest",
);
verifyExpectedOutput(
"interp_magic_comments_param_format_wasm",
interp.runFile(magicCommentsParamFormatPath),
@@ -2218,6 +2292,38 @@ verifyExpectedOutput(
].join("\n"),
);
const m98m99RegressionFiles = [
"01-basics/test.ngc",
"02-variables/test.ngc",
"03-error-M98-no-P-word/test.ngc",
"04-M98-but-no-sub/test.ngc",
"05-M98-loops/test.ngc",
"06-error-mixed-sub-styles/O...-called-with-O..._call.ngc",
"06-error-mixed-sub-styles/O...-ended-with-O..._endsub.ngc",
"06-error-mixed-sub-styles/O...-sub-called-with-M98.ngc",
"06-error-mixed-sub-styles/O...-sub-ended-with-M99.ngc",
"07-nested-subs/test.ngc",
"08-sub-follows-main/test.ngc",
"09-disable-fanuc-subs/test-fanuc.ngc",
"09-disable-fanuc-subs/test-rs274ngc.ngc",
"10-M98-P001/test.ngc",
"11-main-program-oword/test-illegal-end-main-with-eof.ngc",
"11-main-program-oword/test-illegal-no-m30-before-osub.ngc",
"11-main-program-oword/test-illegal-sub-after-percent.ngc",
"11-main-program-oword/test-legal-end-main-with-m02.ngc",
"11-main-program-oword/test-legal-end-main-with-m2.ngc",
"11-main-program-oword/test-legal-end-main-with-m30.ngc",
"11-main-program-oword/test-legal-end-main-with-percent.ngc",
"13-named-program/test-named.ngc",
"13-named-program/test-numbered.ngc",
"14-o-expression-call/test.ngc",
];
assert.deepEqual(
m98m99RegressionFiles,
interpRegressionNgcFilesRecursive("m98m99"),
"interp m98m99 fixture coverage drift",
);
const m98m99BasicsPath = writeInterpRegressionFile("m98m99/01-basics", "test.ngc");
verifyExpectedOutput(
"interp_m98m99_01_basics_wasm",

File diff suppressed because it is too large Load Diff