Repository navigation
docs: correct what makes path_generation() slow - #41
Merged
Merged
Conversation
The benchmarks page blamed the orientation sweep and advised lowering
n_orientation_samples, saying it trades coverage for time roughly
linearly. Profiling shows neither claim holds.
Verification, not search, dominates: simulating each surviving candidate
through _verify_coupler_path is 67% of the runtime, Burmester synthesis
21%.
n_orientation_samples is close to inert. It feeds
per_axis = max(6, int(round(n_samples ** (1.0 / free))))
so with 4 precision points the per-axis resolution is 6 for every value
up to 216. Measured on the README's points, 6/12/36/72 all take the same
time and return the same ten solutions; on the benchmark's points, 6
returns zero solutions and is not faster.
max_solutions is the real control -- 124 ms for one solution, 338 ms for
ten, 2316 ms for all 79 -- because the search stops once it has that many
verified solutions. The page and the docstring now say that, and the page
records that cost depends heavily on which points are asked for: two
four-point problems each returning ten solutions measured 336 ms and
1676 ms.
Documents current behaviour. Whether n_orientation_samples should be
repaired or removed is left to #29.
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.
The benchmarks page told users the wrong thing about
path_generation(), and I wrote it. Profiling for #29 shows both of its claims are false.What it said
What is actually true
Verification dominates, not search. Simulating each surviving candidate through
_verify_coupler_pathis 67% of the runtime; Burmester synthesis is 21%.n_orientation_samplesis close to inert. It feeds:With 4 precision points
free = 3, son_samples**(1/3)stays under 6 for every value up to 216 — the floor swallows the parameter. Its only other use is a cap ofn_samples * n_samples, a quadratic cap on a grid of size6**free.n_orientation_samplesLowering it does not buy time. It eventually just returns nothing.
max_solutionsis the real control, since the search stops once it has that many verified solutions:max_solutionsNoneCost depends on which points you ask for. Two four-point problems, both returning ten solutions: 336 ms for the README's points, 1676 ms for the benchmark's. The headline table reports the slower one, so the page now frames it as an upper bound rather than a typical figure.
Changes
docs/source/benchmarks.md: replaces the wrong explanation with a breakdown of where the time goes, themax_solutionstable, the point-set sensitivity, and a note thatn_orientation_samplesis not a working control.path_generation()docstring: says verification dominates, points users atmax_solutions, and warns thatn_orientation_samplesis a weak control.This documents current behaviour only. Whether
n_orientation_samplesshould be repaired or removed is a decision for #29 — as is the fact that switching verification tostep_fast()would collapse that 67%, which is blocked on #40.