reikhelm/.dev/2026-05-28-procgen-map-core/state/smell-ledger.md
Parley Hatch 068df27c7d chore: orchestration bookkeeping through Task 6 (progress, ledger, conventions)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-28 21:22:42 -06:00

7 lines
1 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.
- **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.