From 99abe4607a5b5a89f0c5d10a23ffceec67a6a55c Mon Sep 17 00:00:00 2001 From: hm-thinkbook14p Date: Sat, 31 Oct 2026 18:49:33 +0800 Subject: [PATCH] feat(tools): summarize import issue histogram --- CHANGELOG.md | 1 + docs/guides/brep-health-check.md | 1 + tools/vde_brep_check.cpp | 17 +++++++++++++++++ 3 files changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3dd75d454..e848f0f4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ - CLI `--heal --out `:自动修复后把每个 body 保存为可复读的 `.vde`; - CLI `--strict`:警告/可修复项也计入失败,目录模式区分 PASS/WARN/FAIL; - CLI `--quick`:仅解析级快速筛查,便于大语料目录先定位导入失败/不支持表达; +- 目录模式汇总 issues 直方图(如 `step.warning×N`),便于按问题类型审查; - 版本 1.0.93 全链路同步;权威根构建四批 **7707/7707 PASS**; - 1.0.93 SDK 11/11 consumers PASS; - 独立验证报告:`docs/reference/93-VDE微内核1.0.93-验证报告.md`。 diff --git a/docs/guides/brep-health-check.md b/docs/guides/brep-health-check.md index 4548d1456..6f5981077 100644 --- a/docs/guides/brep-health-check.md +++ b/docs/guides/brep-health-check.md @@ -48,6 +48,7 @@ result: PASS (0 body defect(s)) [WARN] part.step format=STEP bodies=1 E=0 W=6 repairs=2 heal=1 [FAIL] broken.stl format=STL bodies=1 E=1 W=3 repairs=4 heal=1 summary: total=3 pass=1 warn=1 defect=0 import_failed=1 healable=2 +issues: step.warning×12 step.skipped_entities×3 ``` ## 2. 输出字段怎么读 diff --git a/tools/vde_brep_check.cpp b/tools/vde_brep_check.cpp index 07915c879..c2b8130ab 100644 --- a/tools/vde_brep_check.cpp +++ b/tools/vde_brep_check.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -158,6 +159,7 @@ int check_directory(const std::string& dir, bool strict, bool quick) { return 2; } int total = 0, pass = 0, warn = 0, defect = 0, failed = 0, healable = 0; + std::map issue_counts; for (const auto& f : files) { ++total; const ImportDiagnostic d = quick ? import_cad(f).diagnostic @@ -169,6 +171,9 @@ int check_directory(const std::string& dir, bool strict, bool quick) { else if (soft) ++warn; else ++pass; if (d.can_heal()) ++healable; + for (const auto& i : d.issues) + if (i.severity != ImportIssueSeverity::Info) + ++issue_counts[i.code]; const char* status = hard ? "FAIL" : (soft ? "WARN" : "PASS"); std::printf("[%s] %s format=%s bodies=%d E=%d W=%d repairs=%zu heal=%d\n", status, f.c_str(), d.format.c_str(), @@ -198,6 +203,18 @@ int check_directory(const std::string& dir, bool strict, bool quick) { } std::printf("\nsummary: total=%d pass=%d warn=%d defect=%d import_failed=%d healable=%d quick=%d\n", total, pass, warn, defect, failed, healable, quick ? 1 : 0); + if (!issue_counts.empty()) { + std::vector> top; + for (const auto& kv : issue_counts) top.emplace_back(kv.second, kv.first); + std::sort(top.begin(), top.end(), [](const auto& a, const auto& b) { + if (a.first != b.first) return a.first > b.first; + return a.second < b.second; + }); + std::printf("issues:"); + for (size_t i = 0; i < top.size() && i < 8; ++i) + std::printf(" %s×%d", top[i].second.c_str(), top[i].first); + std::printf("\n"); + } return failed > 0 ? 2 : ((defect > 0 || (strict && warn > 0)) ? 1 : 0); }