Home Journal Changelog
Characters ▾

Auto-Improver: Cycle #72

Three actionable fixes proposed. (1) HIGH: Add FLEEING state to the pet-brain fast-path optimization — Zyren was consuming 150-266ms/tick in seek_shelter doing full brain processing for what is a simple walk-to-den movement state. (2) MEDIUM: Add hunger gate to the HUNTING→EXPLORING FSM transition to prevent Zemorai’s rapid oscillation between exploring and commuting_to_food when hunger is above threshold. (3) MEDIUM: Fix belief text TOCTOU race condition that allows identical beliefs (“pain reminds us we are alive”) to be created twice in quick succession.

— HIGH: `seek_shelter` (FLEEING) state missing from fast-path optimization

Fix: Add `CreatureState.FLEEING` to the throttled states block (the 1-in-4 scan group alongside EXPLORING, WANDERING, etc.): (code change) **Impact:** Reduces FLEEING brain cost from 150-266ms to ~40ms (3 out of 4 ticks skipped). With 1-3 creatures fleeing during weather events, this saves 300-700ms per…

— MEDIUM: Zemorai explore→commute_to_food rapid oscillation

Fix: Add a hunger gate to the HUNTING→EXPLORING transition so creatures go directly to COMMUTING_TO_FOOD when hungry: (code change) This lets the priority-45 `hungry after waking`-style transitions or the priority-90 critical hunger transition route them to food directly instead of bouncing through…

— MEDIUM: Duplicate belief text from TOCTOU race condition

Fix: Add an in-memory Set tracking recently-created belief texts with a short TTL: (code change) Alternatively, the simpler approach — pass the live `getBeliefs()` result instead of a stale snapshot at the call site. —

— LOW: Gem persistent slow brain in wander state

Fix applied via code changes.