From 5d7348544a1a482fbb38be1754e8df6eaaa06219 Mon Sep 17 00:00:00 2001 From: songqing Date: Fri, 22 Aug 2025 14:12:56 +0800 Subject: [PATCH 1/2] fix(analytical): Fix WCC's wrong result --- analytical_engine/apps/property/wcc_property.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/analytical_engine/apps/property/wcc_property.h b/analytical_engine/apps/property/wcc_property.h index 09db60a64aec..b311e67c7d17 100644 --- a/analytical_engine/apps/property/wcc_property.h +++ b/analytical_engine/apps/property/wcc_property.h @@ -140,6 +140,21 @@ class WCCProperty : public PropertyAppBase> { } } + for (label_id_t i = 0; i < v_label_num; ++i) { + auto iv = frag.InnerVertices(i); + bool ok = false; + for (auto v : iv) { + if (ctx.next_modified[i][v]) { + messages.ForceContinue(); + ok = true; + break; + } + } + if (ok) { + break; + } + } + ctx.curr_modified.swap(ctx.next_modified); } From 96f1da62a64a86f05226ab43b195474ac5032078 Mon Sep 17 00:00:00 2001 From: songqing Date: Fri, 22 Aug 2025 14:55:25 +0800 Subject: [PATCH 2/2] fix code lint check --- .../apps/property/wcc_property.h | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/analytical_engine/apps/property/wcc_property.h b/analytical_engine/apps/property/wcc_property.h index b311e67c7d17..7cdb7f975914 100644 --- a/analytical_engine/apps/property/wcc_property.h +++ b/analytical_engine/apps/property/wcc_property.h @@ -140,21 +140,7 @@ class WCCProperty : public PropertyAppBase> { } } - for (label_id_t i = 0; i < v_label_num; ++i) { - auto iv = frag.InnerVertices(i); - bool ok = false; - for (auto v : iv) { - if (ctx.next_modified[i][v]) { - messages.ForceContinue(); - ok = true; - break; - } - } - if (ok) { - break; - } - } - + HandleMessageForceContinue(frag, ctx, messages); ctx.curr_modified.swap(ctx.next_modified); } @@ -220,6 +206,14 @@ class WCCProperty : public PropertyAppBase> { } } } + + HandleMessageForceContinue(frag, ctx, messages); + ctx.curr_modified.swap(ctx.next_modified); + } + + void HandleMessageForceContinue(const fragment_t& frag, context_t& ctx, + message_manager_t& messages) { + label_id_t v_label_num = frag.vertex_label_num(); for (label_id_t i = 0; i < v_label_num; ++i) { auto iv = frag.InnerVertices(i); bool ok = false; @@ -234,7 +228,6 @@ class WCCProperty : public PropertyAppBase> { break; } } - ctx.curr_modified.swap(ctx.next_modified); } };