Skip to content

Fix selective rerip owner dependency cycles - #168

Draft
0hmX wants to merge 4 commits into
agent/bugreport87-portpoint-reprofrom
agent/fix-repeated-owner-rerip-cycle
Draft

Fix selective rerip owner dependency cycles#168
0hmX wants to merge 4 commits into
agent/bugreport87-portpoint-reprofrom
agent/fix-repeated-owner-rerip-cycle

Conversation

@0hmX

@0hmX 0hmX commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

What

Stacked on #167.

  • Record directed failed-route → blocking-owner dependencies.
  • Correct the owner inclusion check by walking those dependencies before the next selective rerip.
  • Fall back to the solver's global rerip as soon as adding the current owner would close a dependency cycle.
  • Clear learned dependency history after escalation so a fresh routing round does not inherit the stale cycle.
  • Report the fallback as failed_owner_cycle in selective-rerip statistics.

Root cause

The bugreport87 graph is valid. One cramped port changes route 32 onto a Z0 path through that port. Later routes rotate blockers and eventually form the directed dependency cycle 51 → 48 → 49 → 50 → 51.

Previously, selective rerip only reacted when the same failed-route/owner pair repeated. Each edge in this larger cycle looked new, so the solver kept displacing another route without recognizing that it had returned to the same dependency chain.

The normal global-rerip solver completes the same graph. This fix preserves selective reripping for acyclic conflicts and escalates immediately when the complete owner dependency graph becomes cyclic.

Impact

The exact repro completes instead of running until the CI job timeout. No fixture, snapshot, or test changes are included in this stacked diff.

Validation

  • bun run typecheck
  • bunx biome format lib/selective-rerip-tiny-hyper-graph-solver.ts tests/solver/bugreport87-unused-port-repro.test.ts
  • bun test tests/selective-rerip-tiny-hyper-graph-solver.test.ts tests/solver/port-chokepoint-repro.test.ts tests/solver/same-net-shared-bottleneck-repro.test.ts tests/solver/bugreport87-unused-port-repro.test.ts
  • Result: 5 passed, 0 failed; exact repro completed locally in about 7.2 seconds.

@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tiny-hypergraph Ready Ready Preview Aug 13, 2026 11:50pm

Request Review

@tscircuitbot

Copy link
Copy Markdown

Benchmark This PR

Run benchmarks by commenting on this PR:

/benchmark [benchmark.sh args...]
/benchmark --dataset <hg07|srj18> --limit <n> --solver <core|poly> --families <default|default+deep|all> --concurrency <n|auto>

Everything after /benchmark is forwarded directly to ./benchmark.sh.
Every command runs current main and the PR head sequentially on the same Blacksmith machine, then reports their results side by side.

Examples:

  • /benchmark -> all committed completed SRJ18 Pipeline7 cases, core solver
  • /benchmark --limit 4 -> first four committed Pipeline7 cases
  • /benchmark --dataset srj18 --concurrency auto -> srj18 samples with runner CPU-count concurrency
  • /benchmark --sample sample003 -> one committed SRJ18 Pipeline7 case
  • /benchmark --dataset hg07 --limit 20 --solver poly -> first 20 hg07 samples with the poly solver
  • /benchmark --dataset hg07 --limit 40 --families default+deep -> first 40 hg07 samples with deeper candidate families

Any PR whose title contains [BENCHMARK TEST] will automatically run the benchmark workflow on PR updates.

@0hmX
0hmX force-pushed the agent/bugreport87-portpoint-repro branch 2 times, most recently from 3944c9f to e3d8290 Compare August 13, 2026 23:02
@0hmX
0hmX force-pushed the agent/fix-repeated-owner-rerip-cycle branch from 52dad70 to e7ba41d Compare August 13, 2026 23:02
@0hmX 0hmX changed the title Fix repeated selective rerip owner cycles Fix selective rerip owner dependency cycles Aug 13, 2026
@0hmX

0hmX commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

/benchmark

@tscircuitbot

tscircuitbot commented Aug 13, 2026

Copy link
Copy Markdown

Tiny Hypergraph Same Machine Benchmark Results

Main c60c552 and PR e7ba41d ran sequentially on blacksmith-01kzyp7prtp3v1hgf1d2fbekdy-32vcpu with identical arguments.

Run Dataset Solver Families Success Routes Final Cost Avg Hops P50 P95
Main srj18 core default 100.0% 100.0% 1.739 5.786 2.938s 13.398s
PR srj18 core default 100.0% 100.0% 1.739 5.786 2.912s 14.050s
Main Branch Details
Metric Value
Dataset srj18
Source dataset-srj18 committed Pipeline7 tiny-hypergraph inputs
Revision source dataset-srj18@c0aad90256a95256fcac814f9f7da81a82a2fdea; tscircuit-autorouter@ac87ba2740c450c226ef84a5bbcef7fb31369297
Sample selection all cases completed in autorouter run 31336663867
Solver core
Families default
Samples 8
Success rate 100.0%
Solved-route completion rate 100.0%
Improved rate 0.0%
Zero final max region cost rate 0.0%
Total completion time 36.525s
Avg baseline max region cost 1.739
Avg final max region cost 1.739
Avg max region delta 0.000
Avg candidate count 0.000
Avg generated candidate count 0.000
Avg duplicate candidate count 0.000
Avg iterations 329223.500
Avg route hops 5.786
Routes requiring rip 0
Avg solveGraph time 3.931s
Avg section search time 0.000s
Avg optimizeSection time 0.001s
Avg duration 4.566s
P50 duration 2.938s
P95 duration 13.398s
Sample Status Routes Baseline Final Delta Hops Rips Attempts Iterations Duration Error
sample001 success 205/205 1.440 1.440 0.000 5.693 0 0 221738 2.938s
sample003 success 145/145 1.543 1.543 0.000 6.910 0 0 108848 1.664s
sample005 success 172/172 0.766 0.766 0.000 5.785 0 0 132205 1.664s
sample007 success 263/263 0.542 0.542 0.000 5.148 0 0 308095 5.737s
sample008 success 361/361 3.391 3.391 0.000 6.673 0 0 1197441 13.398s
sample009 success 256/256 1.492 1.492 0.000 5.500 0 0 155158 2.823s
sample010 success 310/310 1.278 1.278 0.000 4.739 0 0 141829 2.963s
sample011 success 289/289 3.464 3.464 0.000 5.841 0 0 368474 5.339s
PR Details
Metric Value
Dataset srj18
Source dataset-srj18 committed Pipeline7 tiny-hypergraph inputs
Revision source dataset-srj18@c0aad90256a95256fcac814f9f7da81a82a2fdea; tscircuit-autorouter@ac87ba2740c450c226ef84a5bbcef7fb31369297
Sample selection all cases completed in autorouter run 31336663867
Solver core
Families default
Samples 8
Success rate 100.0%
Solved-route completion rate 100.0%
Improved rate 0.0%
Zero final max region cost rate 0.0%
Total completion time 37.510s
Avg baseline max region cost 1.739
Avg final max region cost 1.739
Avg max region delta 0.000
Avg candidate count 0.000
Avg generated candidate count 0.000
Avg duplicate candidate count 0.000
Avg iterations 329223.500
Avg route hops 5.786
Routes requiring rip 0
Avg solveGraph time 4.061s
Avg section search time 0.000s
Avg optimizeSection time 0.001s
Avg duration 4.689s
P50 duration 2.912s
P95 duration 14.050s
Sample Status Routes Baseline Final Delta Hops Rips Attempts Iterations Duration Error
sample001 success 205/205 1.440 1.440 0.000 5.693 0 0 221738 2.670s
sample003 success 145/145 1.543 1.543 0.000 6.910 0 0 108848 1.840s
sample005 success 172/172 0.766 0.766 0.000 5.785 0 0 132205 1.678s
sample007 success 263/263 0.542 0.542 0.000 5.148 0 0 308095 6.025s
sample008 success 361/361 3.391 3.391 0.000 6.673 0 0 1197441 14.050s
sample009 success 256/256 1.492 1.492 0.000 5.500 0 0 155158 2.912s
sample010 success 310/310 1.278 1.278 0.000 4.739 0 0 141829 3.121s
sample011 success 289/289 3.464 3.464 0.000 5.841 0 0 368474 5.214s

Workflow: View run
Artifact: https://github.com/tscircuit/tiny-hypergraph/actions/runs/31752820717

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants