Skip to content

perf(AABB): parallel and deterministic self intersections - #1335

Open
panquez wants to merge 2 commits into
nextfrom
perf/aabb-parallel-self-intersections
Open

panquez wants to merge 2 commits into
nextfrom
perf/aabb-parallel-self-intersections

Conversation

@panquez

@panquez panquez commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Summary

AABBTree::compute_self_element_bbox_intersections now runs in parallel and returns the kept pairs in a deterministic order. This moves the optimization from Geode-solutions/Geode-Explicit_private#314 (per-triangle queries in a parallel_for in client code) into the AABB, so every caller gets it with a plain call.

This is a breaking change and deliberately goes against part of c385201 ("remove bad parallel design"). It needs discussion before merging, see Points to discuss.

Design

  • One query per leaf, run with async::parallel_for over chunks of 128 leaves.
  • Each query only visits subtrees located after its leaf in the tree. This is the same pruning rule as the old self traversal (element_end2 <= element_begin1), so every pair is evaluated exactly once, with the same orientation as before.
  • Each chunk keeps its own vector of kept pairs, and the vectors are concatenated in leaf order at the end. The result does not depend on the number of threads, and extra memory is proportional to the number of kept pairs, not to the number of candidate pairs.

Differences from the design removed in c385201:

  • No task spawning inside the recursion: there is one flat parallel_for at the top.
  • Only the self-intersection query is parallel. Point, box, ray and other-tree queries stay sequential, so small queries called from parallel client loops are unaffected.
  • Results are deterministic.

API change

// before
template < class EvalIntersection >
void compute_self_element_bbox_intersections( EvalIntersection& action ) const;
// action: bool operator()( index_t, index_t ); records its own results, returns true to stop

// after
template < class EvalIntersection >
[[nodiscard]] std::vector< std::pair< index_t, index_t > >
    compute_self_element_bbox_intersections( const EvalIntersection& action ) const;
// action: bool operator()( index_t, index_t ) const; thread-safe, returns true to keep the pair

Old call sites fail to compile, because of the non-const operator() and the [[nodiscard]] result, so no caller changes meaning silently. Porting means turning the action into a const test and then working on the returned pairs. Where an action had other side effects, those move to a sequential loop over the result.

The search can no longer be stopped early. This only affected Inspector's "has self-intersection" checks, which now run the full (parallel) search.

Results

i7-12800H, Release build, tests run one at a time. "2 cores" means taskset -c 0,2 with LIBASYNC_NUM_THREADS=2, close to CI conditions.

Explicit triangle search (find_too_close_triangles, median of 3 runs):

next Explicit#314 this PR
cva-cliff (193k triangles, 1.6 M candidate pairs), 20 threads 3224 ms 375 ms 352 ms
grame-faults, 20 threads 967 ms 95 ms 91 ms
spe-wells, 20 threads 506 ms 54 ms 49 ms
total-model-a1-fracture, 20 threads 251 ms 60 ms 31 ms
cva-cliff, 2 cores 3372 ms 1787 ms 1702 ms
cva-cliff whole test, 20 threads 13.9 s 11.1 s 10.6 s
Explicit C++ suite, 2 cores 161.2 s 157.6 s 152.2 s

This PR is a bit faster than #314 because each query skips the left part of the tree. #314 queried the whole tree for each triangle and dropped t1 <= t0 only at the leaves.

Other callers get the speed-up without any client-side work:

next this PR
Inspector test-section (one large surface), 20 threads 0.99 s 0.28 s
Inspector suite, 20 threads / 2 cores 2.28 s / 3.80 s 1.58 s / 3.15 s
Hybrid facet intersection filter (test-anisotropic-frame-field) ~820 ms ~94 ms
Hybrid constrained facet filter (700k candidate pairs, cheap test) 20 ms 2 ms
Hybrid suite, 20 threads 11.2 s 9.7 s

Validation

  • OpenGeode 143/143, OpenGeode-Inspector 23/23, Geode-Explicit 42/42 and Geode-Hybrid 5/5 C++ tests pass. Python bindings were not built.
  • test-aabb checks that two runs return the same pairs in the same order.
  • On the 36 Explicit tests whose search inputs are stable from run to run on next, every self-intersection call returned the same pairs in the same order with 20 threads (twice), 1 thread and 2 cores. The same holds for the 6 Inspector tests that call it. The 2 other Explicit tests, best-effort and dhi-daan, already vary between runs on next.
  • Result order differs from next: it is now leaf order instead of the old callback order. Explicit's element graph is therefore numbered differently, as with New functions in Geometry and Mesh  #314's sort, and all tests still pass.

Points to discuss

  1. Breaking the callback contract. Is it acceptable, or would we rather keep the old sequential method and add this one under a new name?
  2. Early stop. We lose it for self-intersection. Is anyone relying on it for speed?
  3. compute_other_element_bbox_intersections still uses the old contract (non-const, true = stop). Should it get the same treatment for consistency? It would also parallelize Inspector's surface-pair checks and Explicit's border search.
  4. Chunk size. It is fixed at 128 leaves. It doesn't affect results, only load balancing.

Downstream PRs (same branch name, so CI picks this build up)

Merge order: this PR, then OpenGeode-Inspector, then Geode-Hybrid and Geode-Explicit. Geode-Numerics also calls this method but is no longer active, so it isn't ported.

🤖 Generated with Claude Code

compute_self_element_bbox_intersections runs one query per leaf in
parallel. Each query only visits the boxes located after its leaf in the
tree, so every pair is evaluated once. The kept pairs of each chunk of
leaves are concatenated in leaf order: the result does not depend on the
number of threads.

BREAKING CHANGE: compute_self_element_bbox_intersections now takes a const
thread-safe functor that returns true for the pairs to keep, and returns
these pairs. The search can no longer be stopped early.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-tidy (v21.1.8) reports: 63 concern(s)
  • include/geode/geometry/detail/aabb_impl.hpp:100:9: warning: [google-explicit-constructor]

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

      100 |         Impl( absl::Span< const BoundingBox< dimension > > bboxes )
          |         ^
          |         explicit 
  • include/geode/geometry/detail/aabb_impl.hpp:106:31: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '-'; add parentheses to explicitly specify the order of operations

      106 |                 tree_.resize( 2 * bboxes.size() - 1 );
          |                               ^~~~~~~~~~~~~~~~~
          |                               (                )
  • include/geode/geometry/detail/aabb_impl.hpp:124:57: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'get_recursive_iterators' of similar type ('index_t') are easily swapped by mistake

      124 |         [[nodiscard]] Iterator get_recursive_iterators( index_t node_index,
          |                                                         ^~~~~~~~~~~~~~~~~~~
      125 |             index_t element_begin,
          |             ~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:124:65: note: the first parameter in the range is 'node_index'
      124 |         [[nodiscard]] Iterator get_recursive_iterators( index_t node_index,
          |                                                                 ^~~~~~~~~~
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:125:21: note: the last parameter in the range is 'element_begin'
      125 |             index_t element_begin,
          |                     ^~~~~~~~~~~~~
  • include/geode/geometry/detail/aabb_impl.hpp:128:22: warning: [readability-identifier-length]

    variable name 'it' is too short, expected at least 3 characters

      128 |             Iterator it;
          |                      ^
  • include/geode/geometry/detail/aabb_impl.hpp:130:33: warning: [readability-math-missing-parentheses]

    '/' has higher precedence than '+'; add parentheses to explicitly specify the order of operations

      130 |                 element_begin + ( element_end - element_begin ) / 2;
          |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                                 (                                  )
  • include/geode/geometry/detail/aabb_impl.hpp:173:33: warning: [readability-math-missing-parentheses]

    '/' has higher precedence than '+'; add parentheses to explicitly specify the order of operations

      173 |                 element_begin + ( element_end - element_begin ) / 2;
          |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                                 (                                  )
  • include/geode/geometry/detail/aabb_impl.hpp:193:14: warning: [readability-function-cognitive-complexity]

    function 'closest_element_box_recursive' has cognitive complexity of 13 (threshold 10)

      193 |         void closest_element_box_recursive( const Point< dimension >& query,
          |              ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:209:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      209 |             if( is_leaf( element_begin, element_end ) )
          |             ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:214:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      214 |                 if( cur_squared_distance < squared_distance )
          |                 ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:230:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      230 |             if( squared_distance_left < squared_distance_right )
          |             ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:232:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      232 |                 if( squared_distance_left < squared_distance )
          |                 ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:238:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      238 |                 if( squared_distance_right < squared_distance )
          |                 ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:245:13: note: +1, nesting level increased to 1
      245 |             else
          |             ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:247:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      247 |                 if( squared_distance_right < squared_distance )
          |                 ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:253:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      253 |                 if( squared_distance_left < squared_distance )
          |                 ^
  • include/geode/geometry/detail/aabb_impl.hpp:193:14: warning: [readability-function-size]

    function 'closest_element_box_recursive' exceeds recommended size/complexity thresholds

      193 |         void closest_element_box_recursive( const Point< dimension >& query,
          |              ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:193:14: note: 7 parameters (threshold 4)
  • include/geode/geometry/detail/aabb_impl.hpp:221:24: warning: [readability-identifier-length]

    variable name 'it' is too short, expected at least 3 characters

      221 |             const auto it = get_recursive_iterators(
          |                        ^
  • include/geode/geometry/detail/aabb_impl.hpp:306:28: warning: [readability-identifier-length]

    variable name 'it' is too short, expected at least 3 characters

      306 |                 const auto it = get_recursive_iterators(
          |                            ^
  • include/geode/geometry/detail/aabb_impl.hpp:323:14: warning: [readability-function-size]

    function 'leaf_self_intersect_recursive' exceeds recommended size/complexity thresholds

      323 |         void leaf_self_intersect_recursive( index_t leaf_node_index,
          |              ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:323:14: note: 7 parameters (threshold 4)
  • include/geode/geometry/detail/aabb_impl.hpp:324:13: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'leaf_self_intersect_recursive' of similar type ('index_t') are easily swapped by mistake

      324 |             index_t leaf_position,
          |             ^~~~~~~~~~~~~~~~~~~~~~
      325 |             index_t node_index,
          |             ~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:324:21: note: the first parameter in the range is 'leaf_position'
      324 |             index_t leaf_position,
          |                     ^~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:325:21: note: the last parameter in the range is 'node_index'
      325 |             index_t node_index,
          |                     ^~~~~~~~~~
  • include/geode/geometry/detail/aabb_impl.hpp:350:24: warning: [readability-identifier-length]

    variable name 'it' is too short, expected at least 3 characters

      350 |             const auto it = get_recursive_iterators(
          |                        ^
  • include/geode/geometry/detail/aabb_impl.hpp:360:14: warning: [readability-function-size]

    function 'other_intersect_recursive' exceeds recommended size/complexity thresholds

      360 |         bool other_intersect_recursive( index_t node_index1,
          |              ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:360:14: note: 8 parameters (threshold 4)
  • include/geode/geometry/detail/aabb_impl.hpp:398:28: warning: [readability-identifier-length]

    variable name 'it' is too short, expected at least 3 characters

      398 |                 const auto it = other_tree.impl_->get_recursive_iterators(
          |                            ^
  • include/geode/geometry/detail/aabb_impl.hpp:410:24: warning: [readability-identifier-length]

    variable name 'it' is too short, expected at least 3 characters

      410 |             const auto it = get_recursive_iterators(
          |                        ^
  • include/geode/geometry/detail/aabb_impl.hpp:424:14: warning: [readability-function-size]

    function 'generic_intersect_recursive' exceeds recommended size/complexity thresholds

      424 |         bool generic_intersect_recursive( const BOX_FILTER& box_filter,
          |              ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:424:14: note: 5 parameters (threshold 4)
  • include/geode/geometry/detail/aabb_impl.hpp:447:24: warning: [readability-identifier-length]

    variable name 'it' is too short, expected at least 3 characters

      447 |             const auto it = get_recursive_iterators(
          |                        ^
  • include/geode/geometry/detail/aabb_impl.hpp:466:28: warning: [readability-identifier-length]

    variable name 'it' is too short, expected at least 3 characters

      466 |                 const auto it = get_recursive_iterators(
          |                            ^
  • include/geode/geometry/detail/aabb_impl.hpp:484:14: warning: [readability-function-size]

    function 'containing_boxes_recursive' exceeds recommended size/complexity thresholds

      484 |         void containing_boxes_recursive( index_t node_index,
          |              ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:484:14: note: 5 parameters (threshold 4)
  • include/geode/geometry/detail/aabb_impl.hpp:504:24: warning: [readability-identifier-length]

    variable name 'it' is too short, expected at least 3 characters

      504 |             const auto it = get_recursive_iterators(
          |                        ^
  • tests/geometry/test-aabb.cpp:37:33: warning: [misc-use-internal-linkage]

    function 'create_bounding_box' can be made static or moved into an anonymous namespace to enforce internal linkage

       37 | geode::BoundingBox< dimension > create_bounding_box(
          |                                 ^
          | static 
  • tests/geometry/test-aabb.cpp:41:21: warning: [readability-identifier-length]

    variable name 'c' is too short, expected at least 3 characters

       41 |     for( const auto c : geode::LRange{ dimension } )
          |                     ^
  • tests/geometry/test-aabb.cpp:52:48: warning: [misc-use-internal-linkage]

    function 'create_box_vector' can be made static or moved into an anonymous namespace to enforce internal linkage

       52 | std::vector< geode::BoundingBox< dimension > > create_box_vector(
          |                                                ^
          | static 
  • tests/geometry/test-aabb.cpp:64:24: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations

       64 |             box_vector[nb_box_range * i + j] =
          |                        ^~~~~~~~~~~~~~~~
          |                        (               )
  • tests/geometry/test-aabb.cpp:71:16: warning: [misc-use-internal-linkage]

    function 'global_box_index' can be made static or moved into an anonymous namespace to enforce internal linkage

       71 | geode::index_t global_box_index(
          |                ^
          | static 
  • tests/geometry/test-aabb.cpp:72:20: warning: [readability-identifier-length]

    parameter name 'i' is too short, expected at least 3 characters

       72 |     geode::index_t i, geode::index_t j, geode::index_t size )
          |                    ^
  • tests/geometry/test-aabb.cpp:72:38: warning: [readability-identifier-length]

    parameter name 'j' is too short, expected at least 3 characters

       72 |     geode::index_t i, geode::index_t j, geode::index_t size )
          |                                      ^
  • tests/geometry/test-aabb.cpp:74:12: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations

       74 |     return size * i + j;
          |            ^~~~~~~~
          |            (       )
  • tests/geometry/test-aabb.cpp:78:6: warning: [misc-use-internal-linkage]

    function 'test_build_aabb' can be made static or moved into an anonymous namespace to enforce internal linkage

       78 | void test_build_aabb()
          |      ^
          | static 
  • tests/geometry/test-aabb.cpp:95:7: warning: [cppcoreguidelines-special-member-functions]

    class 'BoxAABBEvalDistance' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator

       95 | class BoxAABBEvalDistance
          |       ^
  • tests/geometry/test-aabb.cpp:98:5: warning: [google-explicit-constructor]

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

       98 |     BoxAABBEvalDistance(
          |     ^
          |     explicit 
  • tests/geometry/test-aabb.cpp:120:6: warning: [misc-use-internal-linkage]

    function 'test_nearest_neighbor_search' can be made static or moved into an anonymous namespace to enforce internal linkage

      120 | void test_nearest_neighbor_search()
          |      ^
          | static 
  • tests/geometry/test-aabb.cpp:142:37: warning: [readability-math-missing-parentheses]

    '/' has higher precedence than '+'; add parentheses to explicitly specify the order of operations

      142 |             query.set_value( 0, i + box_size / 2. );
          |                                     ^~~~~~~~~~~~~
          |                                     (            )
  • tests/geometry/test-aabb.cpp:142:48: warning: [cppcoreguidelines-avoid-magic-numbers]

    1. is a magic number; consider replacing it with a named constant
      142 |             query.set_value( 0, i + box_size / 2. );
          |                                                ^
  • tests/geometry/test-aabb.cpp:143:37: warning: [readability-math-missing-parentheses]

    '/' has higher precedence than '+'; add parentheses to explicitly specify the order of operations

      143 |             query.set_value( 1, j + box_size / 2. );
          |                                     ^~~~~~~~~~~~~
          |                                     (            )
  • tests/geometry/test-aabb.cpp:143:48: warning: [cppcoreguidelines-avoid-magic-numbers]

    1. is a magic number; consider replacing it with a named constant
      143 |             query.set_value( 1, j + box_size / 2. );
          |                                                ^
  • tests/geometry/test-aabb.cpp:144:28: warning: [cppcoreguidelines-init-variables]

    variable 'box_id' is not initialized

      144 |             geode::index_t box_id;
          |                            ^     
          |                                   = 0
  • tests/geometry/test-aabb.cpp:145:20: warning: [cppcoreguidelines-init-variables]

    variable 'distance' is not initialized

       35 |             double distance;
          |                    ^       
          |                             = NAN
  • tests/geometry/test-aabb.cpp:167:7: warning: [cppcoreguidelines-special-member-functions]

    class 'BoxAABBIntersection' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator

      167 | class BoxAABBIntersection
          |       ^
  • tests/geometry/test-aabb.cpp:170:5: warning: [google-explicit-constructor]

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

      170 |     BoxAABBIntersection(
          |     ^
          |     explicit 
  • tests/geometry/test-aabb.cpp:185:16: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'mutex_' has public visibility

      185 |     std::mutex mutex_;
          |                ^
  • tests/geometry/test-aabb.cpp:186:43: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'box_intersections_' has public visibility

      186 |     absl::flat_hash_set< geode::index_t > box_intersections_;
          |                                           ^
  • tests/geometry/test-aabb.cpp:212:50: warning: [readability-suspicious-call-argument]

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

      212 |         return box_contains_box( box1, box2 ) || box_contains_box( box2, box1 );
          |                                                  ^                 ~~~~  ~~~~
    /__w/OpenGeode/OpenGeode/tests/geometry/test-aabb.cpp:202:24: note: in the call to 'box_contains_box', declared here
      202 |     [[nodiscard]] bool box_contains_box(
          |                        ^
      203 |         geode::index_t box1, geode::index_t box2 ) const
          |                        ~~~~                 ~~~~
  • tests/geometry/test-aabb.cpp:220:6: warning: [misc-use-internal-linkage]

    function 'test_intersections_with_query_box' can be made static or moved into an anonymous namespace to enforce internal linkage

      220 | void test_intersections_with_query_box()
          |      ^
          | static 
  • tests/geometry/test-aabb.cpp:285:5: warning: [google-explicit-constructor]

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

      285 |     RayAABBIntersection(
          |     ^
          |     explicit 
  • tests/geometry/test-aabb.cpp:299:16: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'mutex_' has public visibility

      299 |     std::mutex mutex_;
          |                ^
  • tests/geometry/test-aabb.cpp:300:43: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'box_intersections_' has public visibility

      300 |     absl::flat_hash_set< geode::index_t > box_intersections_;
          |                                           ^
  • tests/geometry/test-aabb.cpp:307:6: warning: [misc-use-internal-linkage]

    function 'test_intersections_with_ray_trace' can be made static or moved into an anonymous namespace to enforce internal linkage

      307 | void test_intersections_with_ray_trace()
          |      ^
          | static 
  • tests/geometry/test-aabb.cpp:338:25: warning: [readability-identifier-length]

    variable name 'c' is too short, expected at least 3 characters

      338 |         for( const auto c : geode::Range{ nb_boxes - i } )
          |                         ^
  • tests/geometry/test-aabb.cpp:362:21: warning: [readability-identifier-length]

    variable name 'c' is too short, expected at least 3 characters

      362 |     for( const auto c : geode::Range{ nb_boxes } )
          |                     ^
  • tests/geometry/test-aabb.cpp:384:56: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations

      384 |         eval_intersection.box_intersections_.size() == 3 * ( nb_boxes - 1 ) + 1,
          |                                                        ^~~~~~~~~~~~~~~~~~~~
          |                                                        (                   )
  • tests/geometry/test-aabb.cpp:391:21: warning: [readability-identifier-length]

    variable name 'c' is too short, expected at least 3 characters

      391 |     for( const auto c : geode::Range{ nb_boxes - 2 } )
          |                     ^
  • tests/geometry/test-aabb.cpp:407:6: warning: [misc-use-internal-linkage]

    function 'test_self_intersections' can be made static or moved into an anonymous namespace to enforce internal linkage

      407 | void test_self_intersections()
          |      ^
          | static 
  • tests/geometry/test-aabb.cpp:414:65: warning: [cppcoreguidelines-avoid-magic-numbers]

    0.75 is a magic number; consider replacing it with a named constant

      414 |     auto box_vector = create_box_vector< dimension >( nb_boxes, 0.75 );
          |                                                                 ^
  • tests/geometry/test-aabb.cpp:453:23: warning: [hicpp-use-emplace]

    use emplace_back instead of push_back

      453 |         included_box_.push_back( { box1, box2 } );
          |                       ^~~~~~~~~~~~            ~
          |                       emplace_back(
  • tests/geometry/test-aabb.cpp:463:6: warning: [misc-use-internal-linkage]

    function 'test_other_intersections' can be made static or moved into an anonymous namespace to enforce internal linkage

      463 | void test_other_intersections()
          |      ^
          | static 
  • tests/geometry/test-aabb.cpp:469:9: warning: [cppcoreguidelines-avoid-magic-numbers]

    5 is a magic number; consider replacing it with a named constant

      469 |         5, 0.2 ) };
          |         ^
  • tests/geometry/test-aabb.cpp:469:12: warning: [cppcoreguidelines-avoid-magic-numbers]

    0.2 is a magic number; consider replacing it with a named constant

      469 |         5, 0.2 ) };
          |            ^
  • tests/geometry/test-aabb.cpp:476:21: warning: [cppcoreguidelines-avoid-magic-numbers]

    5 is a magic number; consider replacing it with a named constant

      476 |         { 1, 1 }, { 5, 2 }, { 6, 3 } };
          |                     ^
  • tests/geometry/test-aabb.cpp:476:31: warning: [cppcoreguidelines-avoid-magic-numbers]

    6 is a magic number; consider replacing it with a named constant

      476 |         { 1, 1 }, { 5, 2 }, { 6, 3 } };
          |                               ^
  • tests/geometry/test-aabb.cpp:486:6: warning: [misc-use-internal-linkage]

    function 'do_test' can be made static or moved into an anonymous namespace to enforce internal linkage

      486 | void do_test()
          |      ^
          | static 
  • tests/geometry/test-aabb.cpp:496:6: warning: [misc-use-internal-linkage]

    function 'test' can be made static or moved into an anonymous namespace to enforce internal linkage

      496 | void test()
          |      ^
          | static 

Have any feedback or feature suggestions? Share it here.

@BotellaA BotellaA left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe apply this comment? And see the perf impact
3. compute_other_element_bbox_intersections still uses the old contract (non-const, true = stop). Should it get the same treatment for consistency? It would also parallelize Inspector's surface-pair checks and Explicit's border search.

for( const auto& pairs : chunk_pairs )
{
return false;
result.insert( result.end(), pairs.begin(), pairs.end() );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use absl::c_move() avec un std::back_inserter

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants