From c07858de2a11053afa1755a1ffca1864ad06eb45 Mon Sep 17 00:00:00 2001 From: ShiboSoftwareDev Date: Sun, 2 Aug 2026 21:08:43 +0200 Subject: [PATCH 1/9] test: reproduce cross-layer heuristic detour --- .github/workflows/bun-test.yml | 4 +- .../cross-layer-heuristic-detour.test.ts | 301 ++++++++++++++++++ 2 files changed, 304 insertions(+), 1 deletion(-) create mode 100644 tests/solver/cross-layer-heuristic-detour.test.ts diff --git a/.github/workflows/bun-test.yml b/.github/workflows/bun-test.yml index ff846d8..ddce5e6 100644 --- a/.github/workflows/bun-test.yml +++ b/.github/workflows/bun-test.yml @@ -36,5 +36,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: test-snapshots - path: tests/**/__snapshots__/*.diff.png + path: | + tests/**/__snapshots__/*.diff.png + tests/**/__snapshots__/*.snap.svg if-no-files-found: ignore diff --git a/tests/solver/cross-layer-heuristic-detour.test.ts b/tests/solver/cross-layer-heuristic-detour.test.ts new file mode 100644 index 0000000..48ea34f --- /dev/null +++ b/tests/solver/cross-layer-heuristic-detour.test.ts @@ -0,0 +1,301 @@ +import "bun-match-svg" +import { expect, test } from "bun:test" +import { + getSvgFromGraphicsObject, + stackGraphicsVertically, +} from "graphics-debug" +import { + TinyHyperGraphSolver, + type TinyHyperGraphProblem, + type TinyHyperGraphTopology, +} from "lib/index" + +const DISTRACTOR_COUNT = 12 +const START_TERMINAL_REGION = 0 +const TOP_HUB_REGION = 1 +const FIRST_DISTRACTOR_REGION = 2 +const FIRST_CORRIDOR_REGION = FIRST_DISTRACTOR_REGION + DISTRACTOR_COUNT +const SECOND_CORRIDOR_REGION = FIRST_CORRIDOR_REGION + 1 +const VIA_REGION = SECOND_CORRIDOR_REGION + 1 +const FOURTH_CORRIDOR_REGION = VIA_REGION + 1 +const FIFTH_CORRIDOR_REGION = FOURTH_CORRIDOR_REGION + 1 +const BOTTOM_HUB_REGION = FIFTH_CORRIDOR_REGION + 1 +const GOAL_TERMINAL_REGION = BOTTOM_HUB_REGION + 1 + +const START_PORT = 0 +const GOAL_PORT = 1 +const FIRST_DISTRACTOR_PORT = 2 +const FIRST_CORRIDOR_PORT = FIRST_DISTRACTOR_PORT + DISTRACTOR_COUNT +const SECOND_CORRIDOR_PORT = FIRST_CORRIDOR_PORT + 1 +const VIA_ENTRY_PORT = SECOND_CORRIDOR_PORT + 1 +const VIA_EXIT_PORT = VIA_ENTRY_PORT + 1 +const FOURTH_CORRIDOR_PORT = VIA_EXIT_PORT + 1 +const FIFTH_CORRIDOR_PORT = FOURTH_CORRIDOR_PORT + 1 + +interface CrossLayerDetourTopologyDraft { + incidentPortRegion: number[][] + regionIncidentPorts: number[][] + portX: Float64Array + portY: Float64Array + portZ: Int32Array +} + +interface CrossLayerDetourPortConnection { + portId: number + region1Id: number + region2Id: number + x: number + y: number + z: number +} + +const connectCrossLayerDetourPort = ( + connection: CrossLayerDetourPortConnection, + topologyDraft: CrossLayerDetourTopologyDraft, +) => { + topologyDraft.incidentPortRegion[connection.portId] = [ + connection.region1Id, + connection.region2Id, + ] + topologyDraft.regionIncidentPorts[connection.region1Id]!.push( + connection.portId, + ) + topologyDraft.regionIncidentPorts[connection.region2Id]!.push( + connection.portId, + ) + topologyDraft.portX[connection.portId] = connection.x + topologyDraft.portY[connection.portId] = connection.y + topologyDraft.portZ[connection.portId] = connection.z +} + +const createCrossLayerDetourTopology = (): TinyHyperGraphTopology => { + const portCount = FIFTH_CORRIDOR_PORT + 1 + const regionCount = GOAL_TERMINAL_REGION + 1 + const regionIncidentPorts = Array.from( + { length: regionCount }, + () => [] as number[], + ) + const incidentPortRegion = Array.from( + { length: portCount }, + () => [] as number[], + ) + const portX = new Float64Array(portCount) + const portY = new Float64Array(portCount) + const portZ = new Int32Array(portCount) + const topologyDraft = { + incidentPortRegion, + regionIncidentPorts, + portX, + portY, + portZ, + } + + connectCrossLayerDetourPort( + { + portId: START_PORT, + region1Id: START_TERMINAL_REGION, + region2Id: TOP_HUB_REGION, + x: -0.5, + y: 0, + z: 0, + }, + topologyDraft, + ) + connectCrossLayerDetourPort( + { + portId: GOAL_PORT, + region1Id: BOTTOM_HUB_REGION, + region2Id: GOAL_TERMINAL_REGION, + x: -0.5, + y: 0, + z: 1, + }, + topologyDraft, + ) + + for (let index = 0; index < DISTRACTOR_COUNT; index++) { + connectCrossLayerDetourPort( + { + portId: FIRST_DISTRACTOR_PORT + index, + region1Id: TOP_HUB_REGION, + region2Id: FIRST_DISTRACTOR_REGION + index, + x: 0, + y: -0.55 + index * 0.1, + z: 0, + }, + topologyDraft, + ) + } + + connectCrossLayerDetourPort( + { + portId: FIRST_CORRIDOR_PORT, + region1Id: TOP_HUB_REGION, + region2Id: FIRST_CORRIDOR_REGION, + x: 1, + y: 0, + z: 0, + }, + topologyDraft, + ) + connectCrossLayerDetourPort( + { + portId: SECOND_CORRIDOR_PORT, + region1Id: FIRST_CORRIDOR_REGION, + region2Id: SECOND_CORRIDOR_REGION, + x: 3, + y: 0, + z: 0, + }, + topologyDraft, + ) + connectCrossLayerDetourPort( + { + portId: VIA_ENTRY_PORT, + region1Id: SECOND_CORRIDOR_REGION, + region2Id: VIA_REGION, + x: 5.5, + y: 0, + z: 0, + }, + topologyDraft, + ) + connectCrossLayerDetourPort( + { + portId: VIA_EXIT_PORT, + region1Id: VIA_REGION, + region2Id: FOURTH_CORRIDOR_REGION, + x: 5.5, + y: 0, + z: 1, + }, + topologyDraft, + ) + connectCrossLayerDetourPort( + { + portId: FOURTH_CORRIDOR_PORT, + region1Id: FOURTH_CORRIDOR_REGION, + region2Id: FIFTH_CORRIDOR_REGION, + x: 3, + y: 0, + z: 1, + }, + topologyDraft, + ) + connectCrossLayerDetourPort( + { + portId: FIFTH_CORRIDOR_PORT, + region1Id: FIFTH_CORRIDOR_REGION, + region2Id: BOTTOM_HUB_REGION, + x: 1, + y: 0, + z: 1, + }, + topologyDraft, + ) + + const regionCenterX = new Float64Array(regionCount) + const regionCenterY = new Float64Array(regionCount) + const regionWidth = new Float64Array(regionCount).fill(0.8) + const regionHeight = new Float64Array(regionCount).fill(0.8) + const regionAvailableZMask = new Int32Array(regionCount).fill(1) + + regionCenterX[START_TERMINAL_REGION] = -1 + regionCenterX[TOP_HUB_REGION] = 0.25 + regionWidth[TOP_HUB_REGION] = 1.5 + regionHeight[TOP_HUB_REGION] = 1.6 + + for (let index = 0; index < DISTRACTOR_COUNT; index++) { + const regionId = FIRST_DISTRACTOR_REGION + index + regionCenterX[regionId] = 0 + regionCenterY[regionId] = -0.55 + index * 0.1 + regionWidth[regionId] = 0.2 + regionHeight[regionId] = 0.08 + } + + regionCenterX[FIRST_CORRIDOR_REGION] = 2 + regionCenterX[SECOND_CORRIDOR_REGION] = 4.25 + regionCenterX[VIA_REGION] = 5.5 + regionWidth[VIA_REGION] = 1 + regionHeight[VIA_REGION] = 1 + regionAvailableZMask[VIA_REGION] = 3 + regionCenterX[FOURTH_CORRIDOR_REGION] = 4.25 + regionCenterX[FIFTH_CORRIDOR_REGION] = 2 + regionCenterX[BOTTOM_HUB_REGION] = 0.25 + regionCenterX[GOAL_TERMINAL_REGION] = -1 + regionAvailableZMask[FOURTH_CORRIDOR_REGION] = 2 + regionAvailableZMask[FIFTH_CORRIDOR_REGION] = 2 + regionAvailableZMask[BOTTOM_HUB_REGION] = 2 + regionAvailableZMask[GOAL_TERMINAL_REGION] = 2 + + return { + portCount, + regionCount, + regionIncidentPorts, + incidentPortRegion, + regionWidth, + regionHeight, + regionCenterX, + regionCenterY, + regionAvailableZMask, + portAngleForRegion1: new Int32Array(portCount), + portAngleForRegion2: new Int32Array(portCount), + portX, + portY, + portZ, + regionMetadata: Array.from({ length: regionCount }, (_, regionId) => ({ + name: + regionId === VIA_REGION + ? "legal layer-change region" + : `region ${regionId}`, + availableZ: + regionId === VIA_REGION + ? [0, 1] + : regionAvailableZMask[regionId] === 2 + ? [1] + : [0], + })), + portMetadata: Array.from({ length: portCount }, (_, portId) => ({ + name: + portId === START_PORT + ? "start z0" + : portId === GOAL_PORT + ? "goal z1" + : `port ${portId}`, + })), + } +} + +const createCrossLayerDetourProblem = (): TinyHyperGraphProblem => ({ + routeCount: 1, + portSectionMask: new Int8Array(FIFTH_CORRIDOR_PORT + 1).fill(1), + routeStartPort: new Int32Array([START_PORT]), + routeEndPort: new Int32Array([GOAL_PORT]), + routeNet: new Int32Array([0]), + regionNetId: new Int32Array(GOAL_TERMINAL_REGION + 1).fill(-1), + routeMetadata: [{ connectionId: "cross-layer-detour" }], +}) + +test("cross-layer search finds the legal layer-change detour", () => { + const solver = new TinyHyperGraphSolver( + createCrossLayerDetourTopology(), + createCrossLayerDetourProblem(), + { + MAX_ITERATIONS: 12, + STATIC_REACHABILITY_PRECHECK: false, + }, + ) + const inputGraphics = solver.visualize() + + solver.solve() + + expect( + getSvgFromGraphicsObject( + stackGraphicsVertically([inputGraphics, solver.visualize()], { + titles: ["input topology", "solver result"], + }), + ), + ).toMatchSvgSnapshot(import.meta.path) + expect(solver.solved).toBe(true) + expect(solver.failed).toBe(false) +}) From 9dc186ca262c920a0a525e91ff7e352156296e37 Mon Sep 17 00:00:00 2001 From: ShiboSoftwareDev Date: Sun, 2 Aug 2026 21:12:07 +0200 Subject: [PATCH 2/9] test: add hosted cross-layer detour snapshot --- .github/workflows/bun-test.yml | 4 +- .../cross-layer-heuristic-detour.snap.svg | 322 ++++++++++++++++++ 2 files changed, 323 insertions(+), 3 deletions(-) create mode 100644 tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg diff --git a/.github/workflows/bun-test.yml b/.github/workflows/bun-test.yml index ddce5e6..ff846d8 100644 --- a/.github/workflows/bun-test.yml +++ b/.github/workflows/bun-test.yml @@ -36,7 +36,5 @@ jobs: uses: actions/upload-artifact@v4 with: name: test-snapshots - path: | - tests/**/__snapshots__/*.diff.png - tests/**/__snapshots__/*.snap.svg + path: tests/**/__snapshots__/*.diff.png if-no-files-found: ignore diff --git a/tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg b/tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg new file mode 100644 index 0000000..9532b44 --- /dev/null +++ b/tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg @@ -0,0 +1,322 @@ +input topologysolver result From d851a2b590caae66bde4f2181222a700c04df4b2 Mon Sep 17 00:00:00 2001 From: ShiboSoftwareDev Date: Sun, 2 Aug 2026 21:24:56 +0200 Subject: [PATCH 3/9] test: isolate cross-layer search from rerip optimization --- tests/solver/cross-layer-heuristic-detour.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/solver/cross-layer-heuristic-detour.test.ts b/tests/solver/cross-layer-heuristic-detour.test.ts index 48ea34f..920429e 100644 --- a/tests/solver/cross-layer-heuristic-detour.test.ts +++ b/tests/solver/cross-layer-heuristic-detour.test.ts @@ -282,6 +282,7 @@ test("cross-layer search finds the legal layer-change detour", () => { createCrossLayerDetourProblem(), { MAX_ITERATIONS: 12, + RIP_THRESHOLD_START: 1, STATIC_REACHABILITY_PRECHECK: false, }, ) From f229810763c1ee4bb46b8ebf0900d35f487aa56f Mon Sep 17 00:00:00 2001 From: ShiboSoftwareDev Date: Sun, 2 Aug 2026 21:31:20 +0200 Subject: [PATCH 4/9] test: enter the cross-layer routing hub from the start port --- tests/solver/cross-layer-heuristic-detour.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/solver/cross-layer-heuristic-detour.test.ts b/tests/solver/cross-layer-heuristic-detour.test.ts index 920429e..1c9bb92 100644 --- a/tests/solver/cross-layer-heuristic-detour.test.ts +++ b/tests/solver/cross-layer-heuristic-detour.test.ts @@ -93,8 +93,8 @@ const createCrossLayerDetourTopology = (): TinyHyperGraphTopology => { connectCrossLayerDetourPort( { portId: START_PORT, - region1Id: START_TERMINAL_REGION, - region2Id: TOP_HUB_REGION, + region1Id: TOP_HUB_REGION, + region2Id: START_TERMINAL_REGION, x: -0.5, y: 0, z: 0, From a5109150f3399fe99c78839ab2140fdccbaf942c Mon Sep 17 00:00:00 2001 From: ShiboSoftwareDev Date: Sun, 2 Aug 2026 21:32:37 +0200 Subject: [PATCH 5/9] test: regenerate corrected cross-layer failure snapshot in CI --- .github/workflows/bun-test.yml | 4 +- .../cross-layer-heuristic-detour.snap.svg | 322 ------------------ 2 files changed, 3 insertions(+), 323 deletions(-) delete mode 100644 tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg diff --git a/.github/workflows/bun-test.yml b/.github/workflows/bun-test.yml index ff846d8..ddce5e6 100644 --- a/.github/workflows/bun-test.yml +++ b/.github/workflows/bun-test.yml @@ -36,5 +36,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: test-snapshots - path: tests/**/__snapshots__/*.diff.png + path: | + tests/**/__snapshots__/*.diff.png + tests/**/__snapshots__/*.snap.svg if-no-files-found: ignore diff --git a/tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg b/tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg deleted file mode 100644 index 9532b44..0000000 --- a/tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg +++ /dev/null @@ -1,322 +0,0 @@ -input topologysolver result From accff16ff92cc6ac2d0d7a107260d7613df788c9 Mon Sep 17 00:00:00 2001 From: ShiboSoftwareDev Date: Sun, 2 Aug 2026 21:33:43 +0200 Subject: [PATCH 6/9] test: disable fallback in bounded heuristic reproduction --- tests/solver/cross-layer-heuristic-detour.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/solver/cross-layer-heuristic-detour.test.ts b/tests/solver/cross-layer-heuristic-detour.test.ts index 1c9bb92..3859a19 100644 --- a/tests/solver/cross-layer-heuristic-detour.test.ts +++ b/tests/solver/cross-layer-heuristic-detour.test.ts @@ -281,6 +281,8 @@ test("cross-layer search finds the legal layer-change detour", () => { createCrossLayerDetourTopology(), createCrossLayerDetourProblem(), { + ACCEPT_BEST_SOLUTION_ON_TIMEOUT: false, + GREEDY_FINAL_ROUTE_ITERS: 0, MAX_ITERATIONS: 12, RIP_THRESHOLD_START: 1, STATIC_REACHABILITY_PRECHECK: false, From 765f74ed489d6cb25fb1d89479501caa9c123d1c Mon Sep 17 00:00:00 2001 From: ShiboSoftwareDev Date: Sun, 2 Aug 2026 21:35:37 +0200 Subject: [PATCH 7/9] test: add corrected hosted cross-layer failure snapshot --- .github/workflows/bun-test.yml | 4 +- .../cross-layer-heuristic-detour.snap.svg | 335 ++++++++++++++++++ 2 files changed, 336 insertions(+), 3 deletions(-) create mode 100644 tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg diff --git a/.github/workflows/bun-test.yml b/.github/workflows/bun-test.yml index ddce5e6..ff846d8 100644 --- a/.github/workflows/bun-test.yml +++ b/.github/workflows/bun-test.yml @@ -36,7 +36,5 @@ jobs: uses: actions/upload-artifact@v4 with: name: test-snapshots - path: | - tests/**/__snapshots__/*.diff.png - tests/**/__snapshots__/*.snap.svg + path: tests/**/__snapshots__/*.diff.png if-no-files-found: ignore diff --git a/tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg b/tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg new file mode 100644 index 0000000..84b8c15 --- /dev/null +++ b/tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg @@ -0,0 +1,335 @@ +input topologysolver result From 7f7eb9b25ef7f29029fdc487f67941f20dc52459 Mon Sep 17 00:00:00 2001 From: ShiboSoftwareDev Date: Sun, 2 Aug 2026 21:39:17 +0200 Subject: [PATCH 8/9] test: simplify cross-layer heuristic visualization --- .github/workflows/bun-test.yml | 4 +- .../cross-layer-heuristic-detour.snap.svg | 335 ------------------ .../cross-layer-heuristic-detour.test.ts | 32 +- 3 files changed, 19 insertions(+), 352 deletions(-) delete mode 100644 tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg diff --git a/.github/workflows/bun-test.yml b/.github/workflows/bun-test.yml index ff846d8..ddce5e6 100644 --- a/.github/workflows/bun-test.yml +++ b/.github/workflows/bun-test.yml @@ -36,5 +36,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: test-snapshots - path: tests/**/__snapshots__/*.diff.png + path: | + tests/**/__snapshots__/*.diff.png + tests/**/__snapshots__/*.snap.svg if-no-files-found: ignore diff --git a/tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg b/tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg deleted file mode 100644 index 84b8c15..0000000 --- a/tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg +++ /dev/null @@ -1,335 +0,0 @@ -input topologysolver result diff --git a/tests/solver/cross-layer-heuristic-detour.test.ts b/tests/solver/cross-layer-heuristic-detour.test.ts index 3859a19..9c95bc2 100644 --- a/tests/solver/cross-layer-heuristic-detour.test.ts +++ b/tests/solver/cross-layer-heuristic-detour.test.ts @@ -10,7 +10,7 @@ import { type TinyHyperGraphTopology, } from "lib/index" -const DISTRACTOR_COUNT = 12 +const DISTRACTOR_COUNT = 8 const START_TERMINAL_REGION = 0 const TOP_HUB_REGION = 1 const FIRST_DISTRACTOR_REGION = 2 @@ -120,7 +120,7 @@ const createCrossLayerDetourTopology = (): TinyHyperGraphTopology => { region1Id: TOP_HUB_REGION, region2Id: FIRST_DISTRACTOR_REGION + index, x: 0, - y: -0.55 + index * 0.1, + y: -0.56 + index * 0.16, z: 0, }, topologyDraft, @@ -132,7 +132,7 @@ const createCrossLayerDetourTopology = (): TinyHyperGraphTopology => { portId: FIRST_CORRIDOR_PORT, region1Id: TOP_HUB_REGION, region2Id: FIRST_CORRIDOR_REGION, - x: 1, + x: 0.8, y: 0, z: 0, }, @@ -143,7 +143,7 @@ const createCrossLayerDetourTopology = (): TinyHyperGraphTopology => { portId: SECOND_CORRIDOR_PORT, region1Id: FIRST_CORRIDOR_REGION, region2Id: SECOND_CORRIDOR_REGION, - x: 3, + x: 1.6, y: 0, z: 0, }, @@ -154,7 +154,7 @@ const createCrossLayerDetourTopology = (): TinyHyperGraphTopology => { portId: VIA_ENTRY_PORT, region1Id: SECOND_CORRIDOR_REGION, region2Id: VIA_REGION, - x: 5.5, + x: 2.5, y: 0, z: 0, }, @@ -165,7 +165,7 @@ const createCrossLayerDetourTopology = (): TinyHyperGraphTopology => { portId: VIA_EXIT_PORT, region1Id: VIA_REGION, region2Id: FOURTH_CORRIDOR_REGION, - x: 5.5, + x: 2.5, y: 0, z: 1, }, @@ -176,7 +176,7 @@ const createCrossLayerDetourTopology = (): TinyHyperGraphTopology => { portId: FOURTH_CORRIDOR_PORT, region1Id: FOURTH_CORRIDOR_REGION, region2Id: FIFTH_CORRIDOR_REGION, - x: 3, + x: 1.6, y: 0, z: 1, }, @@ -187,7 +187,7 @@ const createCrossLayerDetourTopology = (): TinyHyperGraphTopology => { portId: FIFTH_CORRIDOR_PORT, region1Id: FIFTH_CORRIDOR_REGION, region2Id: BOTTOM_HUB_REGION, - x: 1, + x: 0.8, y: 0, z: 1, }, @@ -208,19 +208,19 @@ const createCrossLayerDetourTopology = (): TinyHyperGraphTopology => { for (let index = 0; index < DISTRACTOR_COUNT; index++) { const regionId = FIRST_DISTRACTOR_REGION + index regionCenterX[regionId] = 0 - regionCenterY[regionId] = -0.55 + index * 0.1 + regionCenterY[regionId] = -0.56 + index * 0.16 regionWidth[regionId] = 0.2 - regionHeight[regionId] = 0.08 + regionHeight[regionId] = 0.1 } - regionCenterX[FIRST_CORRIDOR_REGION] = 2 - regionCenterX[SECOND_CORRIDOR_REGION] = 4.25 - regionCenterX[VIA_REGION] = 5.5 + regionCenterX[FIRST_CORRIDOR_REGION] = 1.2 + regionCenterX[SECOND_CORRIDOR_REGION] = 2.05 + regionCenterX[VIA_REGION] = 2.5 regionWidth[VIA_REGION] = 1 regionHeight[VIA_REGION] = 1 regionAvailableZMask[VIA_REGION] = 3 - regionCenterX[FOURTH_CORRIDOR_REGION] = 4.25 - regionCenterX[FIFTH_CORRIDOR_REGION] = 2 + regionCenterX[FOURTH_CORRIDOR_REGION] = 2.05 + regionCenterX[FIFTH_CORRIDOR_REGION] = 1.2 regionCenterX[BOTTOM_HUB_REGION] = 0.25 regionCenterX[GOAL_TERMINAL_REGION] = -1 regionAvailableZMask[FOURTH_CORRIDOR_REGION] = 2 @@ -283,7 +283,7 @@ test("cross-layer search finds the legal layer-change detour", () => { { ACCEPT_BEST_SOLUTION_ON_TIMEOUT: false, GREEDY_FINAL_ROUTE_ITERS: 0, - MAX_ITERATIONS: 12, + MAX_ITERATIONS: 10, RIP_THRESHOLD_START: 1, STATIC_REACHABILITY_PRECHECK: false, }, From c236a88ca86df1ea03c7a85a6895d8e4d3667d81 Mon Sep 17 00:00:00 2001 From: ShiboSoftwareDev Date: Sun, 2 Aug 2026 21:40:42 +0200 Subject: [PATCH 9/9] test: add simplified hosted cross-layer failure snapshot --- .github/workflows/bun-test.yml | 4 +- .../cross-layer-heuristic-detour.snap.svg | 281 ++++++++++++++++++ 2 files changed, 282 insertions(+), 3 deletions(-) create mode 100644 tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg diff --git a/.github/workflows/bun-test.yml b/.github/workflows/bun-test.yml index ddce5e6..ff846d8 100644 --- a/.github/workflows/bun-test.yml +++ b/.github/workflows/bun-test.yml @@ -36,7 +36,5 @@ jobs: uses: actions/upload-artifact@v4 with: name: test-snapshots - path: | - tests/**/__snapshots__/*.diff.png - tests/**/__snapshots__/*.snap.svg + path: tests/**/__snapshots__/*.diff.png if-no-files-found: ignore diff --git a/tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg b/tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg new file mode 100644 index 0000000..e58d79a --- /dev/null +++ b/tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg @@ -0,0 +1,281 @@ +input topologysolver result