Loop generator: identical candidates listed twice (no dedupe of survivors) #76

Closed
opened 2026-11-06 11:34:05 +00:00 by maximus · 1 comment
Member

Found by the #73 browser acceptance run (2026-11-06, live https://wanderer.bearoverse.com, test user claude_test, source read from origin/deploy c48b528d). Minor / UX.

Summary

The loop generator can list the same loop more than once. generateLoops (web/src/lib/routing/generator.ts) keeps one survivor per rotation and never removes candidates whose routed geometry is the same. With a must-visit point (or a constrained network such as a peninsula), several rotations snap to the same ways, and the list shows identical-looking entries.

Repro

  1. New trail → Draw a route → Loop tab. Start 43.693486, 7.332852 (Saint-Jean-Cap-Ferrat), distance 6 km, tolerance 15 %, neutral, no area, familiarity off.
  2. Must visit → "Add point on map" → 43.68269, 7.32959.
  3. Generate loop.

Expected

Each listed candidate is a different loop. Duplicates are dropped, or the next distinct rotation fills the slot.

Actual

Two candidates, both "7.07 km · ↑ 253 m · Score 21.6". Distance, D+ and score are all the same, so it is almost certainly the same route twice (the run spent its full 40-call budget for one real option). Without the must-visit point, the same start gave 2 distinct loops (4.62 km and 8.13 km).

Evidence

  • Screenshot: /root/tools/wanderer-shots/acceptance/out/t8l-must-visit-preview.png (candidate list on the left of the map)
  • Results: /root/tools/wanderer-shots/acceptance/out/t8-live-2026-11-06.json (check 8l)

Suggested fix: in generateLoops, dedupe survivors whose distance and D+ match within a few metres and whose geometry overlaps almost completely (or whose snapped via sets are the same) before ranking.

Refs #73.

🤖 Generated with Claude Code

Found by the #73 browser acceptance run (2026-11-06, live https://wanderer.bearoverse.com, test user `claude_test`, source read from `origin/deploy` c48b528d). Minor / UX. ## Summary The loop generator can list the same loop more than once. `generateLoops` (`web/src/lib/routing/generator.ts`) keeps one survivor per rotation and never removes candidates whose routed geometry is the same. With a must-visit point (or a constrained network such as a peninsula), several rotations snap to the same ways, and the list shows identical-looking entries. ## Repro 1. New trail → Draw a route → **Loop** tab. Start 43.693486, 7.332852 (Saint-Jean-Cap-Ferrat), distance 6 km, tolerance 15 %, neutral, no area, familiarity off. 2. Must visit → "Add point on map" → 43.68269, 7.32959. 3. Generate loop. ## Expected Each listed candidate is a different loop. Duplicates are dropped, or the next distinct rotation fills the slot. ## Actual Two candidates, both "7.07 km · ↑ 253 m · Score 21.6". Distance, D+ and score are all the same, so it is almost certainly the same route twice (the run spent its full 40-call budget for one real option). Without the must-visit point, the same start gave 2 distinct loops (4.62 km and 8.13 km). ## Evidence - Screenshot: `/root/tools/wanderer-shots/acceptance/out/t8l-must-visit-preview.png` (candidate list on the left of the map) - Results: `/root/tools/wanderer-shots/acceptance/out/t8-live-2026-11-06.json` (check 8l) Suggested fix: in `generateLoops`, dedupe survivors whose distance and D+ match within a few metres and whose geometry overlaps almost completely (or whose snapped via sets are the same) before ranking. Refs #73. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Member

Fixed by #77 (duplicate loop candidates dropped). Live since 2026-11-06 (web deploy-e5a57df8, hf #924). t8 on live: 8l lists 1 candidate instead of 2 identical ones; 14/14 PASS.

🤖 Generated with Claude Code

Fixed by #77 (duplicate loop candidates dropped). Live since 2026-11-06 (web deploy-e5a57df8, hf #924). t8 on live: 8l lists 1 candidate instead of 2 identical ones; 14/14 PASS. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
public/wanderer#76
No description provided.