Repository navigation
Description
From #134 Not done: spacing parallel routes in a shared channel can add crossings to certified placements (diagnosed dagre 0-1: 2 → 8; 1-3: 0 → 2), so joint placements lose to the existing drawing on such maps. Order the tracks of every shared channel consistently with the order of their endpoints at both ends (and across bends, as the routing experiment's ordering prototype did), so spacing never introduces a crossing that the unspaced routes did not have. Measure on the 23 book sketches, both engines, both widths: crossings, how many maps select the joint placement, within-rank agreement for narrow ELK and dagre. Guards from #134 must pass.
Generated by Claude Code
Author's decisions
-
Start from the routing experiment's ordering work (
experiments/routing/, branch constraints and bend coupling from Routing experiment: channel router vs libavoid on placed boxes #79): order tracks in each shared channel by the order of their endpoints, keep that order through shared bends, and resolve opposite demands at two joins with one crossing at the join (as Routing experiment: channel router vs libavoid on placed boxes #79 accepted), never inside the channel. -
Steps: (1) a pure ordering function with property tests (no crossing introduced by spacing that the unspaced routes do not have; invariance under input order); (2) use it in the channel router; (3) measure.
-
Measures: total crossings and per map for the 23 book sketches (both engines, both widths) and the examples; number of maps where the joint placement is selected (feat: improve sketch order with checked joint placement #134); within-rank agreement for narrow ELK and dagre. All feat: improve sketch order with checked joint placement #134 CI guards must pass; raise them where results improve.
-
Unattended: conservative choices under "Decisions taken"; stop only for a verify failure on the unchanged branch, a public API or format change, or a first-download limit rising by more than 1 KB. Ten iterations on step 3 at most, then the best safe result. Commit type
feat(0.6.0 work). Checks per Loop checks: Chromium per iteration, three browsers in CI #112. -
Next (answer to the stop at 20:51; not a deadline): ordering is done, trace the proposal rejections. Keep the three ordering iterations (committed by the author before the restart). The remaining dagre crossings are mostly single join crossings from opposite endpoint demands, and several maps (dagre 0-1, 1-3 natural) never reach final selection: the joint proposal is rejected with null placement counts.
- For every map × engine × width where the joint variant is not selected, record why in one table (rejected proposal: contradiction / infeasible / route rejected / label reservation / certificate; or proposal made but lost the comparison: on which measure). Commit it under
docs/evidence/sketches/selection/. - Fix the most common rejection cause first; a change counts as progress if it increases the number of maps where the joint variant is selected without breaking any guard, or lowers dagre crossings.
- Join crossings from opposite demands stay allowed (one per join); do not try to remove them by ordering.
The three-iteration rule restarts here.
- For every map × engine × width where the joint variant is not selected, record why in one table (rejected proposal: contradiction / infeasible / route rejected / label reservation / certificate; or proposal made but lost the comparison: on which measure). Commit it under
-
Timeouts under load (answer to the stop at 21:17; not a deadline). This is the third unit test that crossed Vitest's 5 s default only while scorers ran in parallel. Fix it once for all: set
testTimeout: 20_000in the Vitest configuration with a comment (onetest:commit), and keep the explicit per-test timeouts that already exist. From now on runnpm run verifyand the sketch scorers one after another, never concurrently. Then continue with the rejection table. -
Faster iterations (author, 21:32). Per iteration run only the sketch scorer(s) the change targets (for the rejection work: dagre natural and dagre 39 em) plus
npm run verifyand related Chromium specs, one after another. Run all four scorers every third iteration and beforeDONE; CI runs all four guards on the pull request anyway. -
Inductive pattern search, five iterations (author, answer to the stop at 21:44; not a deadline). Stop trying routing policies. Instead:
- Catalogue every case where the joint variant is not selected or adds a crossing (all four engine × width runs): map, engine, width, rejection stage or losing measure, and structural features of the region involved — fan-in/fan-out at the boxes, return arrows, lanes crossed, label count on the arrows, channel width in ticks, whether the crossing is between independent paths or an allowed opposite-demand join crossing, how far the joint placement moved the boxes. One row per case, committed under
docs/evidence/sketches/patterns/with the traces needed to reproduce it (small files). - Look for patterns: group the rows by features and state candidate rules ("rejection happens when …") with how many cases each explains and which it does not. Prefer the simplest rule that explains the most cases; special cases count as findings.
- Change code only for a rule that explains at least three cases, and then make one targeted change and measure it with the targeted scorers; if it does not help, revert and record it.
- After five iterations, stop with the catalogue, the patterns and their counts, the change (if any) and a recommendation, then write
DONEwith what is committed (ordering, timeout, rejection table, catalogue). Commit typefixfor code,docsfor the catalogue.
Iterations that add rows or patterns count as progress in this phase.
- Catalogue every case where the joint variant is not selected or adds a crossing (all four engine × width runs): map, engine, width, rejection stage or losing measure, and structural features of the region involved — fan-in/fan-out at the boxes, return arrows, lanes crossed, label count on the arrows, channel width in ticks, whether the crossing is between independent paths or an allowed opposite-demand join crossing, how far the joint placement moved the boxes. One row per case, committed under
Generated by Claude Code
Activity