参考所有分组,完成尽量多的内容:锁定RS274源码映射结论

结论:补齐 WASM header、blocked-header、metadata 的 source map 文档闭环,并把 manifest/source-map 同步检查接入 native 必跑路径;未扩展 smoke 功能。
This commit is contained in:
cnc
2026-06-04 14:20:29 +08:00
parent f9ac38251b
commit 59b8e2a832
4 changed files with 227 additions and 0 deletions

View File

@@ -141,6 +141,8 @@ grep -F 'CNC_SIM_ALL_NATIVE_GUARDRAILS_ONLY must be 0 or 1: $guardrails_only' te
grep -F 'all native guardrail checks passed' test-all-native.sh >/dev/null
grep -F 'LinuxCNC source basis: the wasm build preflights and compiles the' build-wasm.sh >/dev/null
grep -F 'LinuxCNC source basis: manifest validation checks LinuxCNC-root relative' check-linuxcnc-inputs.sh >/dev/null
grep -F 'LinuxCNC source basis: this guard keeps the local source map aligned' check-linuxcnc-rs274-source-map.sh >/dev/null
grep -F './check-linuxcnc-rs274-source-map.sh' test-native.sh >/dev/null
grep -F 'LinuxCNC source basis: the cached input checker keys check-linuxcnc-inputs.sh' check-linuxcnc-inputs-cached.sh >/dev/null
grep -F 'LinuxCNC source basis: switchkins/remap table validation derives M428/M429/M430' check-linuxcnc-switchkins-remap-table.sh >/dev/null
grep -F 'LINUXCNC_ROOT="$linuxcnc_root" ./check-linuxcnc-inputs-cached.sh "$manifest" --require-kinematics-complete' check-linuxcnc-switchkins-remap-table.sh >/dev/null
@@ -853,38 +855,98 @@ wasm_manifest_blocked = [
for line in Path("linuxcnc-rs274-wasm-source-files.txt").read_text(encoding="utf-8").splitlines()
if line.startswith("blocked:")
]
wasm_manifest_headers = [
line.split(":", 2)[1]
for line in Path("linuxcnc-rs274-wasm-source-files.txt").read_text(encoding="utf-8").splitlines()
if line.startswith("header:")
]
wasm_manifest_blocked_headers = [
line.split(":", 2)[1]
for line in Path("linuxcnc-rs274-wasm-source-files.txt").read_text(encoding="utf-8").splitlines()
if line.startswith("blocked-header:")
]
wasm_manifest_metadata = [
line.split(":", 2)[1]
for line in Path("linuxcnc-rs274-wasm-source-files.txt").read_text(encoding="utf-8").splitlines()
if line.startswith("metadata:")
]
source_map_core = []
source_map_bindings = []
source_map_wasm_core = []
source_map_wasm_blocked = []
source_map_wasm_headers = []
source_map_wasm_blocked_headers = []
source_map_wasm_metadata = []
in_core_section = False
in_binding_section = False
in_wasm_core_section = False
in_wasm_blocked_section = False
in_wasm_header_section = False
in_wasm_blocked_header_section = False
in_wasm_metadata_section = False
for line in source_map.splitlines():
if line == "### Interpreter core":
in_core_section = True
in_binding_section = False
in_wasm_core_section = False
in_wasm_blocked_section = False
in_wasm_header_section = False
in_wasm_blocked_header_section = False
in_wasm_metadata_section = False
continue
if line == "### Python binding modules":
in_core_section = False
in_binding_section = True
in_wasm_core_section = False
in_wasm_blocked_section = False
in_wasm_header_section = False
in_wasm_blocked_header_section = False
in_wasm_metadata_section = False
continue
if line == "### WASM-safe source core":
in_core_section = False
in_binding_section = False
in_wasm_core_section = True
in_wasm_blocked_section = False
in_wasm_header_section = False
in_wasm_blocked_header_section = False
in_wasm_metadata_section = False
continue
if line == "### WASM-blocked sources":
in_core_section = False
in_binding_section = False
in_wasm_core_section = False
in_wasm_blocked_section = True
in_wasm_header_section = False
in_wasm_blocked_header_section = False
in_wasm_metadata_section = False
continue
if line == "### WASM-tracked headers":
in_core_section = False
in_binding_section = False
in_wasm_core_section = False
in_wasm_blocked_section = False
in_wasm_header_section = True
in_wasm_blocked_header_section = False
in_wasm_metadata_section = False
continue
if line == "### WASM-blocked headers":
in_core_section = False
in_binding_section = False
in_wasm_core_section = False
in_wasm_blocked_section = False
in_wasm_header_section = False
in_wasm_blocked_header_section = True
in_wasm_metadata_section = False
continue
if line == "### WASM metadata sources":
in_core_section = False
in_binding_section = False
in_wasm_core_section = False
in_wasm_blocked_section = False
in_wasm_header_section = False
in_wasm_blocked_header_section = False
in_wasm_metadata_section = True
continue
if in_core_section and line.startswith("### "):
break
@@ -894,6 +956,12 @@ for line in source_map.splitlines():
in_wasm_core_section = False
if in_wasm_blocked_section and line.startswith("### "):
in_wasm_blocked_section = False
if in_wasm_header_section and line.startswith("### "):
in_wasm_header_section = False
if in_wasm_blocked_header_section and line.startswith("### "):
in_wasm_blocked_header_section = False
if in_wasm_metadata_section and line.startswith("### "):
in_wasm_metadata_section = False
if in_core_section and line.startswith("- `"):
source_map_core.append(line.split("`", 2)[1])
if in_binding_section and line.startswith("- `"):
@@ -902,6 +970,12 @@ for line in source_map.splitlines():
source_map_wasm_core.append(line.split("`", 2)[1])
if in_wasm_blocked_section and line.startswith("- `"):
source_map_wasm_blocked.append(line.split("`", 2)[1])
if in_wasm_header_section and line.startswith("- `"):
source_map_wasm_headers.append(line.split("`", 2)[1])
if in_wasm_blocked_header_section and line.startswith("- `"):
source_map_wasm_blocked_headers.append(line.split("`", 2)[1])
if in_wasm_metadata_section and line.startswith("- `"):
source_map_wasm_metadata.append(line.split("`", 2)[1])
if source_map_core != manifest_core:
raise SystemExit(
"docs/linuxcnc-rs274-source-map.md interpreter core list no longer matches linuxcnc-rs274-source-files.txt core manifest"
@@ -918,6 +992,18 @@ if source_map_wasm_blocked != wasm_manifest_blocked:
raise SystemExit(
"docs/linuxcnc-rs274-source-map.md WASM-blocked source list no longer matches linuxcnc-rs274-wasm-source-files.txt blocked manifest"
)
if source_map_wasm_headers != wasm_manifest_headers:
raise SystemExit(
"docs/linuxcnc-rs274-source-map.md WASM-tracked header list no longer matches linuxcnc-rs274-wasm-source-files.txt header manifest"
)
if source_map_wasm_blocked_headers != wasm_manifest_blocked_headers:
raise SystemExit(
"docs/linuxcnc-rs274-source-map.md WASM-blocked header list no longer matches linuxcnc-rs274-wasm-source-files.txt blocked-header manifest"
)
if source_map_wasm_metadata != wasm_manifest_metadata:
raise SystemExit(
"docs/linuxcnc-rs274-source-map.md WASM metadata source list no longer matches linuxcnc-rs274-wasm-source-files.txt metadata manifest"
)
PY
for script in \