8 lines
2.4 KiB
Markdown
8 lines
2.4 KiB
Markdown
# Smell Ledger — reikhelm
|
|
|
|
Patterns surfaced by implementers/reviewers. Format: pattern — where found — where fixed — where it remains.
|
|
|
|
- **range() i32 overflow for astronomically large spans** — rng.rs `range` does `lo + self.below(span) as i32`; spans ≳2³¹ could overflow. UNREACHABLE in a grid-coordinate generator (spans are tiny). Logged, not fixed — fixing would be over-engineering for the domain. Revisit only if a pass ever needs huge ranges.
|
|
- **Map equality workaround (RESOLVED)** — map.rs originally compared maps via serialized-JSON strings because Map wasn't Eq. Fixed at source by deriving PartialEq/Eq on Grid<T> + Map (commit 8c4ef2e). Downstream (T6/T12) should use `assert_eq!` on Maps, not reinvent the workaround.
|
|
- **INTEGRATION BUG (Phase 3 adversarial verify) — corridor/door topology conflict** — CorridorCarver carves center→center (pierces room wall ring → guarantees connectivity); DoorPlacer requires a Wall between room-floor and corridor-floor (destroyed by piercing). Result over 120 seeds of full pipeline: 88% edges no door, 36% maps zero doors. All 5 passes individually PASS (BSP perfect tiling; MST deterministic under ties/collinear/dup centers; corridor connectivity; door correct in isolation). Plan-level inconsistency between Task 10 (center-to-center) and Task 11 (wall threshold). RESOLVED by user decision (Variant A) backed by a 2000-seed experiment: A (pierce + door-at-mouth) = 0/2000 orphans, ~50/50 doors/openings at door_chance 0.5; B (stop-short walled, faithful setback=1) = 1330/2000 orphans (66.5%) — B cannot deliver walled-rooms AND connectivity. FIX = revise DoorPlacer to pierce-aware door-at-mouth with DoorConfig{door_chance} default 0.5: a door candidate is the pierced-wall cell (corridor Floor, outside all rooms, with a room-membership neighbor on one orthogonal side and corridor-Floor-outside on the opposite side); per candidate flip rng.chance(door_chance) → Door else leave open archway (Floor); set edge.at to a placed door for that edge's corridor (corridor-region i ↔ graph edge i, append order). Connectivity is via corridor floor regardless of doors → never orphans.
|
|
- **Watch in passes**: Point/Tile derive Hash — using a HashSet for flood-fill *visited* membership is fine (determinism only breaks on HashMap/HashSet *iteration order*). If any pass iterates a HashMap/HashSet to produce output, that's a determinism bug — flag it.
|