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
2 changed files with 1022 additions and 135 deletions

View file

@ -346,7 +346,7 @@ def main() -> None:
parser.add_argument("--repeat", type=int, default=3)
parser.add_argument("--node-limit", type=int, default=1000)
parser.add_argument("--net-order", choices=("input", "bank"), help="order for routing nets (floorplan defaults to bank order)")
parser.add_argument("--native-jog-limit", type=int, help="two-turn launch attempts per native warm start")
parser.add_argument("--native-jog-limit", type=int, help="jog or detour attempts per net during native warm start")
parser.add_argument("--constructive", action=argparse.BooleanOptionalAction, help="try constructive catalog routes first")
parser.add_argument("--no-refinement", action="store_true")
parser.add_argument("--no-independent-retry", action="store_true")
@ -380,10 +380,13 @@ def main() -> None:
for _ in range(args.repeat):
measurements, elapsed = run_native(case, args) if args.mode == "native" else run_catalog(case, technology, args)
samples.append(elapsed)
elapsed = median(samples)
total_cost = fsum(entry["cost"] for entry in measurements["per_net"].values())
print(json.dumps({
"options": vars(args), "machine": platform.machine(), "python": platform.python_version(), "requested": len(case.nets),
"wall_seconds": samples, "median_seconds": median(samples), "peak_rss": resource.getrusage(resource.RUSAGE_SELF).ru_maxrss,
"catalog_cost": fsum(entry["cost"] for entry in measurements["per_net"].values()), **measurements,
"wall_seconds": samples, "median_seconds": elapsed, "peak_rss": resource.getrusage(resource.RUSAGE_SELF).ru_maxrss,
"catalog_cost": total_cost, "time_cost_squared": elapsed * total_cost**2 if measurements["completed"] else None,
**measurements,
}, indent=2))

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": (