Expand description
Reference routes for the bench subcommand: a fixed set of
positions in Slovenian and Italian waters, checked against a real
chart on every run, for measuring the effect of a change to
route-find’s search or its caches.
Every position is verified against a real chart as open, safe
water – a reference case sitting on a rock or in charted shallows
would only prove itself broken, not detect a regression. A
zero-length enc-check leg --from P --to P probe cannot verify a
candidate point reliably: a degenerate leg has no corridor band for
check_leg to test, so it reports “nothing found” for any
position, land included. Instead, each candidate point is checked
with a short real leg (a tenth of a nautical mile) in a few
directions; route-find’s own Hazards::blocked (private to that
crate) tests a small square around the point directly, without
this gap.
Structs§
- Baseline
Entry - One
ReferenceRoute’s own previously measured result, against whichbenchcompares a later run’s own result to decide whether it regressed – seedistance_regressedandtime_regressed. - Reference
Route - One route
benchmeasures on every run: a name, and the two positions [route_find::find_route] searches between.
Constants§
- DISTANCE_
REGRESSION_ 🔒FLOOR_ NM - The absolute floor
distance_regressedapplies alongsideDISTANCE_REGRESSION_RELATIVE, in NM, so a short hop’s own tiny baseline (the two short Gulf of Trieste cases measure a bare 3-4 NM) does not make one percent tighter than floating-point noise can actually promise. - DISTANCE_
REGRESSION_ 🔒RELATIVE - How much a route may grow, relative to its own baseline length,
before
distance_regressedreports a regression – whichever is larger, this orDISTANCE_REGRESSION_FLOOR_NM. - REFERENCE_
ROUTES - A spread of distances and difficulty; each entry tests something specific:
- TIME_
REGRESSION_ 🔒FLOOR_ MS - The absolute floor
time_regressedapplies alongsideTIME_REGRESSION_RELATIVE, in milliseconds, so the two fastest cases here (the short Gulf of Trieste hops, under 100 ms each) are not held to a tighter margin in absolute terms than scheduler jitter alone can already account for. - TIME_
REGRESSION_ 🔒RELATIVE - How much slower a route may run, relative to its own baseline
time, before
time_regressedreports a regression – whichever is larger, this orTIME_REGRESSION_FLOOR_MS.
Functions§
- distance_
regressed - Whether
current_nmcounts as a regression againstbaseline_nm– seeDISTANCE_REGRESSION_RELATIVEandDISTANCE_REGRESSION_FLOOR_NMfor the margin. A route that got shorter never regresses here, whatever the reason. - load_
baseline - Loads a
Baselinefrompath. A missing file reads as an empty baseline, not an error – the ordinary state beforebenchhas ever been run with--write-baseline, or for aReferenceRoutejust added and not yet measured. - parse_
baseline_ 🔒line - The one-line, tab-separated format
load_baselinereads andwrite_baselinewrites:name\troute_nm\telapsed_ms, oneReferenceRouteper line, blank lines and#-comments ignored. - time_
regressed - Whether
current_mscounts as a regression againstbaseline_ms– seeTIME_REGRESSION_RELATIVEandTIME_REGRESSION_FLOOR_MSfor the margin. A run that got faster never regresses here, whatever the reason. - write_
baseline - Writes
entriestopathasparse_baseline_line’s own format, inREFERENCE_ROUTES’s own order rather than whatever order aBaseline’s own hash map would iterate in – so the file reads the same top-to-bottom asbench’s own printed table, and so a diff between two baselines is a diff between two runs, not shuffled noise.
Type Aliases§
- Baseline
- Every
ReferenceRoute’s ownBaselineEntry, keyed byReferenceRoute::name.