Skip to content

test: add confetti buffer, a robustness test for buffer and merge_elements - #1484

Merged
barendgehrels merged 1 commit into
boostorg:developfrom
barendgehrels:confetti_buffer
Jul 27, 2026
Merged

test: add confetti buffer, a robustness test for buffer and merge_elements#1484
barendgehrels merged 1 commit into
boostorg:developfrom
barendgehrels:confetti_buffer

Conversation

@barendgehrels

Copy link
Copy Markdown
Collaborator

Add a confetti-buffer robustness test 🎉

Reference https://www.boost.org/releases/1.47.0/ mentioning Boost Geometry as new library

Celebrating 15 years of Boost.Geometry in Boost (July 11, 2011)! 🎂 A new robustness test that also happens to produce a festive picture.

Screenshot 2026-07-11 at 12 10 05

What it does

test/robustness/overlay/buffer/confetti_buffer.cpp generates random "confetti" streamers — bottom-to-top snaky lines of varying length and extent — and buffers them all at once as a single multi_linestring. This stresses the buffer with many interacting pieces per run.

Also exercises merge_elements

Each test independently buffers every streamer, collects the results in a geometry_collection, and checks that merge_elements (the divide-and-conquer union of the collection) yields the same area as the buffer-at-once result. So this is a robustness test for both buffer and merge_elements. Sweeps of 1000 tests (various distances) pass with 0 problems.

See also #947

Colorful output

SVG rendering lives in confetti_buffer_svg.hpp: each streamer's buffer is drawn as a translucent colored ribbon on a dark canvas, with the merged buffer outlined on top — a warm, confetti-like palette. Where the birthday picture comes from.

✅ AI-assisted, 🤖 Generated with Claude Code

@barendgehrels

Copy link
Copy Markdown
Collaborator Author

No problems found sofar

$ test/robustness/overlay/buffer/boost_geometry_robustness_confetti_buffer --count 100000  --distance 3.1415 --ppc 72 --svg 0
Using random base seed 847908


tests: 100000 problems: 0 time: 4047.09

@mloskot mloskot 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.

Congratulations everyone!

@barendgehrels

Copy link
Copy Markdown
Collaborator Author

Thanks for the approvals. I propose to merge it indeed.

Because it is not only a nice ad hoc piece of art... It is also a proper robustness test.

Testing:

  • merge_elements (there was earlier exactly one unit test calling it once...)
  • buffer on complex multi-linestring geometries (there are several tests for multi-linestring, but not yet robustness tests - and probably not this complex).

@vissarion vissarion 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.

Congrats!

@barendgehrels
barendgehrels merged commit 10bc1ce into boostorg:develop Jul 27, 2026
17 checks passed
@barendgehrels
barendgehrels deleted the confetti_buffer branch July 27, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants