Skip to content

perf(ModelIntersections): compute them in parallel#183

Merged
BotellaA merged 7 commits into
nextfrom
perf/model-intersection-async
Jun 22, 2026
Merged

perf(ModelIntersections): compute them in parallel#183
BotellaA merged 7 commits into
nextfrom
perf/model-intersection-async

Conversation

@BotellaA

Copy link
Copy Markdown
Member

No description provided.

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-tidy (v20.1.8) reports: 11 concern(s)
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:85:13: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'BRepLineSurfacesIntersection' of similar type ('const geode::uuid &') are easily swapped by mistake

       85 |             const geode::uuid& surface_id,
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       86 |             const geode::uuid& line_id )
          |             ~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:85:32: note: the first parameter in the range is 'surface_id'
       85 |             const geode::uuid& surface_id,
          |                                ^~~~~~~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:86:32: note: the last parameter in the range is 'line_id'
       86 |             const geode::uuid& line_id )
          |                                ^~~~~~~
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:187:13: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'polygons_intersect' of similar type ('geode::index_t') are easily swapped by mistake

      187 |             geode::index_t p1_id, geode::index_t p2_id ) const
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:187:28: note: the first parameter in the range is 'p1_id'
      187 |             geode::index_t p1_id, geode::index_t p2_id ) const
          |                            ^~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:187:50: note: the last parameter in the range is 'p2_id'
      187 |             geode::index_t p1_id, geode::index_t p2_id ) const
          |                                                  ^~~~~
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:229:17: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'triangles_common_vertices' of similar type ('const geode::PolygonVertices &') are easily swapped by mistake

      229 |                 const geode::PolygonVertices& t1_vertices,
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      230 |                 const geode::PolygonVertices& t2_vertices ) const
          |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:229:47: note: the first parameter in the range is 't1_vertices'
      229 |                 const geode::PolygonVertices& t1_vertices,
          |                                               ^~~~~~~~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:230:47: note: the last parameter in the range is 't2_vertices'
      230 |                 const geode::PolygonVertices& t2_vertices ) const
          |                                               ^~~~~~~~~~~
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:413:58: warning: [readability-function-cognitive-complexity]

    function 'triangles_intersect' has cognitive complexity of 28 (threshold 10)

      413 |         ModelSurfacesIntersectionBase< geode::Section >::triangles_intersect(
          |                                                          ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:419:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      419 |         if( common_vertices.size() == 2 )
          |         ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:427:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      427 |             if( geode::segment_segment_intersection_detection(
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:431:17: note: +1
      431 |                 || geode::segment_segment_intersection_detection(
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:443:20: note: +1
      443 |                    || geode::point_triangle_position( t2_third_pt, triangle1 )
          |                    ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:446:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      446 |         for( const auto t1_edge_v : geode::LRange{ 3 } )
          |         ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:450:44: note: +2, including nesting penalty of 1, nesting level increased to 2
      450 |                 t1_vertices[t1_edge_v == 2 ? 0 : t1_edge_v + 1]
          |                                            ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:454:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      454 |             for( const auto t2_edge_v : geode::LRange{ 3 } )
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:458:48: note: +3, including nesting penalty of 2, nesting level increased to 3
      458 |                     t2_vertices[t2_edge_v == 2 ? 0 : t2_edge_v + 1]
          |                                                ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:464:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      464 |                 if( edge_edge_inter.first == geode::POSITION::outside
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:465:21: note: +1
      465 |                     || edge_edge_inter.first == geode::POSITION::parallel )
          |                     ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:469:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      469 |                 if( common_vertices.size() != 1 )
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:477:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      477 |                 if( t1_edge_inter_pt_id == geode::NO_LID
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:478:21: note: +1
      478 |                     || t2_edge_inter_pt_id == geode::NO_LID )
          |                     ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:482:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      482 |                 if( edge1_vertices[t1_edge_inter_pt_id] != common_vertices[0][0]
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:483:21: note: +1
      483 |                     || edge2_vertices[t2_edge_inter_pt_id]
          |                     ^
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:493:24: warning: [readability-function-cognitive-complexity]

    function 'triangle_intersects_other' has cognitive complexity of 22 (threshold 10)

      493 |     [[nodiscard]] bool triangle_intersects_other(
          |                        ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:501:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      501 |         for( const auto v_id : geode::LRange{ 3 } )
          |         ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:503:42: note: +2, including nesting penalty of 1, nesting level increased to 2
      503 |             const auto v2_id = v_id == 2 ? 0 : v_id + 1;
          |                                          ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:507:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      507 |             if( intersection.first != geode::POSITION::outside )
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:509:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      509 |                 if( common_vertices.size() != 1 )
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:517:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      517 |                 if( edge_inter_pt_id == geode::NO_LID
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:518:21: note: +1
      518 |                     || t2_inter_pt_id == geode::NO_LID )
          |                     ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:522:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      522 |                 if( t1_vertices[edge_inter_pt_id == 0 ? v_id : v2_id]
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:524:21: note: +1
      524 |                     || t2_vertices[t2_inter_pt_id]
          |                     ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:522:55: note: +3, including nesting penalty of 2, nesting level increased to 3
      522 |                 if( t1_vertices[edge_inter_pt_id == 0 ? v_id : v2_id]
          |                                                       ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:523:71: note: +3, including nesting penalty of 2, nesting level increased to 3
      523 |                         != common_vertices[0][t2_vertex_position == 0 ? 1 : 0]
          |                                                                       ^
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:493:24: warning: [readability-function-size]

    function 'triangle_intersects_other' exceeds recommended size/complexity thresholds

      493 |     [[nodiscard]] bool triangle_intersects_other(
          |                        ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:493:24: note: 6 parameters (threshold 4)
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:562:19: warning: [readability-suspicious-call-argument]

    1st argument 'triangle2' (passed to 'triangle1') looks like it might be swapped with the 2nd, 'triangle1' (passed to 'triangle2')

      562 |                || triangle_intersects_other( triangle2, triangle1, t2_vertices,
          |                   ^                          ~~~~~~~~~  ~~~~~~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:493:24: note: in the call to 'triangle_intersects_other', declared here
      493 |     [[nodiscard]] bool triangle_intersects_other(
          |                        ^
      494 |         const geode::Triangle3D& triangle1,
          |                                  ~~~~~~~~~
      495 |         const geode::Triangle3D& triangle2,
          |                                  ~~~~~~~~~
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:562:19: warning: [readability-suspicious-call-argument]

    3rd argument 't2_vertices' (passed to 't1_vertices') looks like it might be swapped with the 4th, 't1_vertices' (passed to 't2_vertices')

      562 |                || triangle_intersects_other( triangle2, triangle1, t2_vertices,
          |                   ^                                                ~~~~~~~~~~~
      563 |                    t1_vertices, common_vertices, 0 );
          |                    ~~~~~~~~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:493:24: note: in the call to 'triangle_intersects_other', declared here
      493 |     [[nodiscard]] bool triangle_intersects_other(
          |                        ^
      494 |         const geode::Triangle3D& triangle1,
      495 |         const geode::Triangle3D& triangle2,
      496 |         const geode::PolygonVertices& t1_vertices,
          |                                       ~~~~~~~~~~~
      497 |         const geode::PolygonVertices& t2_vertices,
          |                                       ~~~~~~~~~~~
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:588:9: warning: [google-explicit-constructor]

    single-argument constructors must be marked explicit to avoid unintentional implicit conversions

      588 |         Impl( const Model& model )
          |         ^
          |         explicit 
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:681:13: warning: [readability-function-cognitive-complexity]

    function 'intersecting_polygons' has cognitive complexity of 12 (threshold 10)

      681 |             intersecting_polygons() const
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:684:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      684 |             for( const auto& surface : model_.active_surfaces() )
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:686:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      686 |                 if( surface.mesh().nb_polygons() == 0 )
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:698:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      698 |             for( const auto& surface : model_.active_surfaces() )
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:700:51: note: nesting level increased to 2
      700 |                 tasks.emplace_back( async::spawn( [this, &surface] {
          |                                                   ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:710:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      710 |                     for( const auto& [polygon1, polygon2] :
          |                     ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:723:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      723 |             for( const auto& components : surfaces_overlap.component_pairs )
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:725:51: note: nesting level increased to 2
      725 |                 tasks.emplace_back( async::spawn( [this, &components] {
          |                                                   ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:741:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      741 |                     for( const auto& [polygon1, polygon2] :
          |                     ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:751:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      751 |             for( auto& task : async::when_all( tasks ).get() )
          |             ^
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:761:13: warning: [readability-function-cognitive-complexity]

    function 'intersecting_lines_surfaces' has cognitive complexity of 15 (threshold 10)

      761 |             intersecting_lines_surfaces( const BRep& brep ) const
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:766:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      766 |             for( const auto& surface : brep.active_surfaces() )
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:768:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      768 |                 if( surface.mesh().nb_polygons() == 0 )
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:776:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      776 |             for( const auto& line : brep.active_lines() )
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:778:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      778 |                 if( line.mesh().nb_edges() == 0 )
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:788:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      788 |             for( const auto& surface : brep.active_surfaces() )
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:793:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      793 |                 for( const auto& line : brep.active_lines() )
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:795:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      795 |                     if( brep.nb_embedding_blocks( line ) == 0 )
          |                     ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:806:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      806 |                     for( const auto& element_pair :
          |                     ^

Have any feedback or feature suggestions? Share it here.

@BotellaA BotellaA merged commit 3f1bd51 into next Jun 22, 2026
18 of 19 checks passed
@BotellaA BotellaA deleted the perf/model-intersection-async branch June 22, 2026 09:21
@BotellaA

Copy link
Copy Markdown
Member Author

🎉 This PR is included in version 6.11.1-rc.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@BotellaA

Copy link
Copy Markdown
Member Author

🎉 This PR is included in version 6.11.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants