Improve verified routing cost and runtime

Use verified terminal and column constructions, cheaper straight profiles, and tighter cost bounds to reduce routing work. Reuse geometry in clearance checks and tuning while retaining verified coverage and timing constraints.

Report median routing time times squared cost in the benchmark tools and record the comparisons and regression coverage.
This commit is contained in:
Jan Petykiewicz 2026-12-05 12:05:07 -08:00
commit 13594632d4

View file

@ -13,7 +13,7 @@ from time import perf_counter
import shapely
from inire import route
from inire.tests.routing_corpus import automatic_options, profile_options, select_cases
from inire.tests.routing_corpus import automatic_options, benchmark_weighted_length, profile_options, select_cases
def capture(repeat: int, revision: str | None) -> dict:
@ -55,13 +55,21 @@ def capture(repeat: int, revision: str | None) -> dict:
}
for net_id, result in run.results_by_net.items()
},
"benchmark_weighted_length": sum(
benchmark_weighted_length(result) for result in run.results_by_net.values() if result.is_valid
),
}
if reference is None:
reference = sample
elif reference != sample:
stable = False
assert reference is not None
runs[key] = {**reference, "wall_seconds": median(timings), "wall_samples": timings, "stable": stable}
elapsed = median(timings)
has_verified = any(result["verified"] for result in reference["results"].values())
runs[key] = {
**reference, "wall_seconds": elapsed, "wall_samples": timings, "stable": stable,
"time_cost_squared": elapsed * reference["benchmark_weighted_length"]**2 if has_verified else None,
}
return {
"revision": revision or subprocess.check_output(["git", "rev-parse", "HEAD"], text=True).strip(),
"tracked_worktree": (