From c32f2bc4d78a9f5b6acffa7564f97a82ec93bb07 Mon Sep 17 00:00:00 2001 From: ShiboSoftwareDev Date: Sun, 2 Aug 2026 23:09:34 +0200 Subject: [PATCH 1/6] test: reproduce intermediate-layer graph guidance release --- .../cross-layer-heuristic-detour.test.ts | 65 ++++++++++++++----- 1 file changed, 49 insertions(+), 16 deletions(-) diff --git a/tests/solver/cross-layer-heuristic-detour.test.ts b/tests/solver/cross-layer-heuristic-detour.test.ts index 9c95bc2..01c268b 100644 --- a/tests/solver/cross-layer-heuristic-detour.test.ts +++ b/tests/solver/cross-layer-heuristic-detour.test.ts @@ -11,13 +11,17 @@ import { } from "lib/index" const DISTRACTOR_COUNT = 8 +const INTERMEDIATE_LAYER_DISTRACTOR_COUNT = 16 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 FIRST_INTERMEDIATE_LAYER_DISTRACTOR_REGION = VIA_REGION + 1 +const FOURTH_CORRIDOR_REGION = + FIRST_INTERMEDIATE_LAYER_DISTRACTOR_REGION + + INTERMEDIATE_LAYER_DISTRACTOR_COUNT const FIFTH_CORRIDOR_REGION = FOURTH_CORRIDOR_REGION + 1 const BOTTOM_HUB_REGION = FIFTH_CORRIDOR_REGION + 1 const GOAL_TERMINAL_REGION = BOTTOM_HUB_REGION + 1 @@ -28,7 +32,10 @@ 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 FIRST_INTERMEDIATE_LAYER_DISTRACTOR_PORT = VIA_ENTRY_PORT + 1 +const VIA_EXIT_PORT = + FIRST_INTERMEDIATE_LAYER_DISTRACTOR_PORT + + INTERMEDIATE_LAYER_DISTRACTOR_COUNT const FOURTH_CORRIDOR_PORT = VIA_EXIT_PORT + 1 const FIFTH_CORRIDOR_PORT = FOURTH_CORRIDOR_PORT + 1 @@ -108,7 +115,7 @@ const createCrossLayerDetourTopology = (): TinyHyperGraphTopology => { region2Id: GOAL_TERMINAL_REGION, x: -0.5, y: 0, - z: 1, + z: 5, }, topologyDraft, ) @@ -160,6 +167,21 @@ const createCrossLayerDetourTopology = (): TinyHyperGraphTopology => { }, topologyDraft, ) + + for (let index = 0; index < INTERMEDIATE_LAYER_DISTRACTOR_COUNT; index++) { + connectCrossLayerDetourPort( + { + portId: FIRST_INTERMEDIATE_LAYER_DISTRACTOR_PORT + index, + region1Id: VIA_REGION, + region2Id: FIRST_INTERMEDIATE_LAYER_DISTRACTOR_REGION + index, + x: 2.5, + y: -0.6 + index * 0.08, + z: 1 + (index % 4), + }, + topologyDraft, + ) + } + connectCrossLayerDetourPort( { portId: VIA_EXIT_PORT, @@ -167,7 +189,7 @@ const createCrossLayerDetourTopology = (): TinyHyperGraphTopology => { region2Id: FOURTH_CORRIDOR_REGION, x: 2.5, y: 0, - z: 1, + z: 5, }, topologyDraft, ) @@ -178,7 +200,7 @@ const createCrossLayerDetourTopology = (): TinyHyperGraphTopology => { region2Id: FIFTH_CORRIDOR_REGION, x: 1.6, y: 0, - z: 1, + z: 5, }, topologyDraft, ) @@ -189,7 +211,7 @@ const createCrossLayerDetourTopology = (): TinyHyperGraphTopology => { region2Id: BOTTOM_HUB_REGION, x: 0.8, y: 0, - z: 1, + z: 5, }, topologyDraft, ) @@ -218,15 +240,26 @@ const createCrossLayerDetourTopology = (): TinyHyperGraphTopology => { regionCenterX[VIA_REGION] = 2.5 regionWidth[VIA_REGION] = 1 regionHeight[VIA_REGION] = 1 - regionAvailableZMask[VIA_REGION] = 3 + regionAvailableZMask[VIA_REGION] = 63 + + for (let index = 0; index < INTERMEDIATE_LAYER_DISTRACTOR_COUNT; index++) { + const regionId = FIRST_INTERMEDIATE_LAYER_DISTRACTOR_REGION + index + const z = 1 + (index % 4) + regionCenterX[regionId] = 2.5 + regionCenterY[regionId] = -0.6 + index * 0.08 + regionWidth[regionId] = 0.2 + regionHeight[regionId] = 0.06 + regionAvailableZMask[regionId] = 1 << z + } + 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 - regionAvailableZMask[FIFTH_CORRIDOR_REGION] = 2 - regionAvailableZMask[BOTTOM_HUB_REGION] = 2 - regionAvailableZMask[GOAL_TERMINAL_REGION] = 2 + regionAvailableZMask[FOURTH_CORRIDOR_REGION] = 32 + regionAvailableZMask[FIFTH_CORRIDOR_REGION] = 32 + regionAvailableZMask[BOTTOM_HUB_REGION] = 32 + regionAvailableZMask[GOAL_TERMINAL_REGION] = 32 return { portCount, @@ -250,17 +283,17 @@ const createCrossLayerDetourTopology = (): TinyHyperGraphTopology => { : `region ${regionId}`, availableZ: regionId === VIA_REGION - ? [0, 1] - : regionAvailableZMask[regionId] === 2 - ? [1] - : [0], + ? [0, 1, 2, 3, 4, 5] + : Array.from({ length: 6 }, (_, z) => z).filter( + (z) => (regionAvailableZMask[regionId]! & (1 << z)) !== 0, + ), })), portMetadata: Array.from({ length: portCount }, (_, portId) => ({ name: portId === START_PORT ? "start z0" : portId === GOAL_PORT - ? "goal z1" + ? "goal z5" : `port ${portId}`, })), } From 10d96bba27cbebcaede4b79e9777c8352f2bc671 Mon Sep 17 00:00:00 2001 From: ShiboSoftwareDev Date: Sun, 2 Aug 2026 23:10:38 +0200 Subject: [PATCH 2/6] ci: generate intermediate-layer repro snapshot --- .github/workflows/bun-test.yml | 4 +- .../cross-layer-heuristic-detour.snap.svg | 304 ------------------ 2 files changed, 3 insertions(+), 305 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 68daeb7..0000000 --- a/tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg +++ /dev/null @@ -1,304 +0,0 @@ -input topologysolver result From d4d31b0a20d4381ac7e5fe28f8fe7a8908ddcb1b Mon Sep 17 00:00:00 2001 From: ShiboSoftwareDev Date: Sun, 2 Aug 2026 23:12:07 +0200 Subject: [PATCH 3/6] test: add hosted intermediate-layer failure snapshot --- .github/workflows/bun-test.yml | 4 +- .../cross-layer-heuristic-detour.snap.svg | 496 ++++++++++++++++++ 2 files changed, 497 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..052bcc3 --- /dev/null +++ b/tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg @@ -0,0 +1,496 @@ +input topologysolver result From 24564259de40da9c9bcb3cfc604167e12a08180e Mon Sep 17 00:00:00 2001 From: ShiboSoftwareDev Date: Sun, 2 Aug 2026 23:14:22 +0200 Subject: [PATCH 4/6] test: make intermediate exits win the XY heuristic --- tests/solver/cross-layer-heuristic-detour.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/solver/cross-layer-heuristic-detour.test.ts b/tests/solver/cross-layer-heuristic-detour.test.ts index 01c268b..5a7b63d 100644 --- a/tests/solver/cross-layer-heuristic-detour.test.ts +++ b/tests/solver/cross-layer-heuristic-detour.test.ts @@ -174,7 +174,7 @@ const createCrossLayerDetourTopology = (): TinyHyperGraphTopology => { portId: FIRST_INTERMEDIATE_LAYER_DISTRACTOR_PORT + index, region1Id: VIA_REGION, region2Id: FIRST_INTERMEDIATE_LAYER_DISTRACTOR_REGION + index, - x: 2.5, + x: 2.4, y: -0.6 + index * 0.08, z: 1 + (index % 4), }, From d533db8fede610bce6c1a00e50c12c547b56ca88 Mon Sep 17 00:00:00 2001 From: ShiboSoftwareDev Date: Sun, 2 Aug 2026 23:14:45 +0200 Subject: [PATCH 5/6] ci: regenerate deterministic intermediate repro snapshot --- .github/workflows/bun-test.yml | 4 +- .../cross-layer-heuristic-detour.snap.svg | 496 ------------------ 2 files changed, 3 insertions(+), 497 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 052bcc3..0000000 --- a/tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg +++ /dev/null @@ -1,496 +0,0 @@ -input topologysolver result From f3545ec3bd4e697880ad5ed6392785d602980884 Mon Sep 17 00:00:00 2001 From: ShiboSoftwareDev Date: Sun, 2 Aug 2026 23:16:21 +0200 Subject: [PATCH 6/6] test: add hosted deterministic intermediate failure snapshot --- .github/workflows/bun-test.yml | 4 +- .../cross-layer-heuristic-detour.snap.svg | 527 ++++++++++++++++++ 2 files changed, 528 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..3057b67 --- /dev/null +++ b/tests/solver/__snapshots__/cross-layer-heuristic-detour.snap.svg @@ -0,0 +1,527 @@ +input topologysolver result