Initial buildout
This commit is contained in:
parent
34615f3aac
commit
84b76d0f6a
1 changed files with 25658 additions and 25 deletions
113
docs/complex-routing-example-1.md
Normal file
113
docs/complex-routing-example-1.md
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
# Complex-routing example 1
|
||||
|
||||
Follow the outer return, `net_08`, from the input ports to its final eastbound arrival. Run from the repository root.
|
||||
|
||||
```sh
|
||||
python examples/advanced_layouts.py \
|
||||
--case complex-routing-example-1 \
|
||||
--output-dir /tmp/inire-complex-routing-example-1
|
||||
```
|
||||
|
||||
Origin. [Board 1 from Terminal-Bench pull request 345](https://raw.githubusercontent.com/harbor-framework/terminal-bench/249d125b59c0a5352d9e132195cfead6d81446be/tasks/photonic-waveguide-routing/environment/layout_spec.json).
|
||||
|
||||
## 1. Load the board and set the routing target
|
||||
|
||||
The 2,500 by 1,000 board has seven keepouts and nine nets. Width is 2, clearance is 6, and both bend radii are 50. All ports require eastbound travel. Automatic starts with a target of nine verified nets after checking port conflicts and track capacity.
|
||||
|
||||

|
||||
|
||||
Open circles mark sources and filled squares mark targets. The inset shows 24 tracks fitting through the purple cut after allowing for width and clearance.
|
||||
|
||||
## 2. Assign lanes and compile path seeds
|
||||
|
||||
The bundle planner groups nets by their passages and spaces the lanes at a pitch of 9. The first `net_08` plan takes the bottom lane at `y = 1`, rises on the right, and approaches its target heading west.
|
||||
|
||||

|
||||
|
||||
The dots mark waypoints. In the lower inset, only `net_08` and `net_00` fit below the tower. The planner compiles straight runs, right-angle corners, and diagonals into straight, quarter-turn, and S-bend seeds.
|
||||
|
||||
## 3. Fit the required eastbound arrival
|
||||
|
||||
The turnaround planner shifts the upper shelf route `net_07` and brings `net_08` beneath it. The return rises west of its target and takes a final right turn. The planner recompiles both changed seeds.
|
||||
|
||||

|
||||
|
||||
Compare the heading arrows above the red target squares.
|
||||
|
||||
## 4. Verify the seeds and refine the layout
|
||||
|
||||
A worker in mode `off` replays the `bundle-turnaround` seeds with a zero-node budget. It checks the resulting polygons against the board, keepouts, and other routes. All nine verify, so automatic skips search.
|
||||
|
||||

|
||||
|
||||
The upper panel shows the first four paths in installation order. The lower panel shows all nine checked together.
|
||||
|
||||
Automatic replays the seeds again with refinement enabled. The refiner replaces sections of `net_05` and `net_07`, preserving all nine verified nets and lowering the configured objective.
|
||||
|
||||

|
||||
|
||||
Compare the solid and dashed approaches of `net_07` near the top edge.
|
||||
|
||||
## 5. Inspect the result
|
||||
|
||||
Inspect `run.automatic.stages` and `run.automatic.selected_stage` after routing the fixed-heading board under the public defaults. Both stages report zero A* expansions.
|
||||
|
||||
| Stage | Planner | Operation | Verified nets |
|
||||
| --- | --- | --- | --- |
|
||||
| 0 | `bundle-turnaround` | Verify the compiled seeds | 9 |
|
||||
| 1, selected | `bundle-turnaround` | Refine and verify the layout | 9 |
|
||||
|
||||
The point-terminal variant accepts a westbound arrival for `net_08`, so the original bundle needs no turnaround. Rerun the gallery command with `--case complex-routing-example-1-point-terminals` to see the result.
|
||||
|
||||
- [Example gallery](../examples/advanced.md#complex-routing-example-1)
|
||||
|
||||
## Compare all routing modes
|
||||
|
||||
Each run uses 100 nodes per search and one congestion iteration, with warm start and refinement disabled. Set `infer_terminal_headings=True` for `bundle` so `net_08` can arrive westbound. Fixed eastbound headings raise a mismatch in that mode.
|
||||
|
||||
| Mode | Result |
|
||||
| --- | --- |
|
||||
| `automatic` | 9/9 verified. The turnaround plan completes the layout without building a mesh. |
|
||||
| `off` | 0/9 verified at this budget. The worker runs lattice search directly. |
|
||||
| `guide` | 1/9 verified. The worker builds a mesh and suggests corridors to lattice search. |
|
||||
| `seed` | 1/9 verified. The worker builds a mesh and searches for starting paths inside the corridors before its routing iteration. |
|
||||
| `bundle` | 9/9 verified. The worker builds and verifies ordered tracks directly from the board geometry. |
|
||||
|
||||

|
||||
|
||||
### Triangulation support
|
||||
|
||||
Inire requires Shapely 2.1 or newer with GEOS 3.10 or newer. Check the versions in the environment that runs Inire.
|
||||
|
||||
```sh
|
||||
python -c 'import shapely; print(shapely.__version__, shapely.geos_version_string)'
|
||||
```
|
||||
|
||||
Automatic builds a mesh when it reaches corridor search. Here the turnaround plan finishes first. Guide and seed also replay supplied paths without a mesh at `node_limit=0`.
|
||||
|
||||
- [Shapely installation](https://shapely.readthedocs.io/en/2.1.2/installation.html)
|
||||
- [Constrained triangulation API](https://shapely.readthedocs.io/en/2.1.2/reference/shapely.constrained_delaunay_triangles.html)
|
||||
|
||||
## Compare a guide-mode search
|
||||
|
||||
To see the corridor model on the same board, run `net_08` on its own in guide mode.
|
||||
|
||||

|
||||
|
||||
Left, the mesh, green corridor cells, and dashed guide. Right, purple expanded positions and the red partial path at the 12-node limit.
|
||||
|
||||
```sh
|
||||
python -m scripts.render_documentation_figures --output-dir /tmp/inire-complex-routing-example-1
|
||||
```
|
||||
|
||||
- [Corridor planning](topological-routing.md#corridor-planning-and-realization)
|
||||
|
||||
## Implementation
|
||||
|
||||
| Stage | Inputs and code |
|
||||
| --- | --- |
|
||||
| Board and routing target | [Board inputs](../examples/advanced-layouts.json), [problem builder](../examples/advanced_layouts.py#L37), [capacity calculation](../inire/router/_capacity.py#L29) |
|
||||
| Lanes and seeds | [Lane assignment](../inire/router/_bundle.py#L114), [waypoint compiler](../inire/router/_waypoints.py#L33) |
|
||||
| Eastbound arrival | [Turnaround candidates](../inire/router/_perimeter.py#L103) |
|
||||
| Verification and refinement | [Seeded worker](../inire/router/_automatic.py#L173), [physical verification](../inire/geometry/collision.py#L687), [refinement handoff](../inire/router/_automatic.py#L610) |
|
||||
| Figures and mode comparison | [Figure generator](../scripts/render_documentation_figures.py) |
|
||||
Loading…
Reference in a new issue