Repository navigation
[GH-3276] Stop straight skeleton from flooding stderr on rasterised outlines - #3285
Merged
Merged
Conversation
…ised outlines Polygons with many short, near-collinear edges (outlines traced from raster pixels, ST_SubDivide pieces) trigger degenerate collision events inside campskeleton. The library caught the resulting Error internally and printed the full stack trace to stderr for every event: 130-190 traces per call for a 557-vertex polygon, hundreds of thousands for a job over a few thousand polygons. The call still returned a result. Bump campskeleton to 0.0.2-20260823, which routes these diagnostics through java.util.logging at FINE level instead of stderr. The algorithm is unchanged: the degenerate event is still skipped exactly as before. Add a regression test that runs ST_StraightSkeleton and ST_ApproximateMedialAxis on the polygon from the report with System.err captured and asserts nothing is written. Document in the function pages that such inputs should be simplified first.
jiayuasu
marked this pull request as draft
August 25, 2026 21:07
The 557-vertex polygon from the issue triggered the degenerate traces a varying 130-190 times per call. Delta-debugging it down to a 10-vertex fragment preserves the trigger and makes it deterministic: with campskeleton 0.0.2-20260118 it prints exactly six traces on every run, across fresh JVMs and with assertions enabled. The fragment is short enough to inline, so the test resource file is no longer needed.
The fixture emits three traces per skeleton computation on campskeleton 0.0.2-20260118; the test captures six because it runs two computations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Did you read the Contributor Guide?
Is this PR related to a ticket?
[GH-XXX] my subject. Closes ST_ApproximateMedialAxis and ST_StraightSkeleton flood stderr with 'Planes do not intersect at a single point' traces #3276What changes were proposed in this PR?
Polygons with many short, near-collinear edges (outlines traced from raster pixels,
ST_SubDividepieces) trigger degenerate collision events inside campskeleton. The library caught the resultingjava.lang.Error: Planes do not intersect at a single pointinternally and printed the full stack trace to stderr for every event: 130-190 traces per call for the 557-vertex polygon in the issue, hundreds of thousands for a job over a few thousand polygons. The call still returned a result, so nothing signalled a problem except the log volume.This bumps campskeleton to
0.0.2-20260823(jiayuasu/campskeleton#3), which fixes this at the source:SingularPlanesErrorlogged viajava.util.loggingat FINE level (silent by default, can be enabled for debugging).Also adds a note to the
ST_StraightSkeleton/ST_ApproximateMedialAxisdoc pages (sql, flink, snowflake) that such inputs should be simplified first, e.g. withST_SimplifyPreserveTopology, since the skeleton quality around near-collinear edges is degraded regardless of logging.How was this patch tested?
StraightSkeletonTest#rasterizedOutlineWritesNothingToStderr: runsST_StraightSkeletonandST_ApproximateMedialAxiswithSystem.errcaptured, and asserts nothing is written while both calls still produce non-empty results. The input is a 10-vertex fragment of the 557-vertex repro polygon from the issue, minimised while preserving the trigger: against campskeleton0.0.2-20260118every skeleton computation deterministically prints three degenerate-collision traces (six across the test's two calls, verified across fresh JVMs and with-ea), so the test fails there and passes with0.0.2-20260823.StraightSkeletonTestsuite (24/24) passes with the dependency resolved fresh from Maven Central.-ea).Did this PR include necessary documentation updates?