使用刚更新的 AGENTS.md 和 align-linuxcnc 加速规则执行

结论:按 align-linuxcnc 先确认干净基线,避免 source-map-only 和 smoke 扩展;新增 WASM tooldata 运行探针对 LinuxCNC src/emc/tooldata/tooldata_mmap.cc 随机换刀 T0 查找分支的覆盖,确认随机换刀扫描会越过 pocket 0 并返回非零 T0 pocket。\n\n测试结论:./test-linuxcnc-wasm-tooldata-link.sh、./test-linuxcnc-wasm-tooldata-runtime-symbols.sh、./test-native.sh、./test-linuxcnc-source-link.sh 均通过。
This commit is contained in:
cnc
2026-06-05 15:03:41 +08:00
parent b773946c45
commit d5c6b7555a

View File

@@ -113,6 +113,42 @@ int main() {
return 69; return 69;
} }
const pid_t random_t0_child = fork();
if (random_t0_child < 0) {
return 70;
}
if (random_t0_child == 0) {
if (tool_mmap_creator(nullptr, 1) != 0) {
_exit(71);
}
tooldata_reset();
CANON_TOOL_TABLE spindle_t0 = tooldata_entry_init();
spindle_t0.toolno = 0;
spindle_t0.pocketno = 0;
if (tooldata_put(spindle_t0, 0) == IDX_FAIL) {
_exit(72);
}
CANON_TOOL_TABLE random_t0 = tooldata_entry_init();
random_t0.toolno = 0;
random_t0.pocketno = 15;
if (tooldata_put(random_t0, 15) == IDX_FAIL) {
_exit(73);
}
// LinuxCNC src/emc/tooldata/tooldata_mmap.cc continues past pocket 0
// while scanning random toolchanger entries, so a nonzero T0 pocket wins.
if (tooldata_find_index_for_tool(0) != 15) {
_exit(74);
}
_exit(0);
}
int random_t0_status = 0;
if (waitpid(random_t0_child, &random_t0_status, 0) != random_t0_child) {
return 75;
}
if (!WIFEXITED(random_t0_status) || WEXITSTATUS(random_t0_status) != 0) {
return 76;
}
if (tool_mmap_user() != -1) { if (tool_mmap_user() != -1) {
return 25; return 25;
} }