Repository navigation
perf(creatures): scan pet and combat candidates only when used - #429
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (8)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe creature cycle now passes sense cadence into active-creature collection. The collection logic gates candidate scans and uses indexed lookups for players and active objects. ChangesCreature sweep updates
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to Creature candidate discovery now uses indexes and sense cadence while retaining the documented filtering behavior. No current merge-blocking risk is identified. Sequence Diagram(s)sequenceDiagram
participant run_cycle
participant CreatureWorld
participant active_cell_creatures
participant WorldEntity
participant game_creature_ai_state
run_cycle->>CreatureWorld: awake_creatures(scope, tick.sense)
CreatureWorld->>active_cell_creatures: collect active creatures
active_cell_creatures->>WorldEntity: query entry index for entry 0
active_cell_creatures->>game_creature_ai_state: query by_active_object index
active_cell_creatures-->>CreatureWorld: return TickSweep
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
2b5df44 to
554ffbb
Compare
|
@coderabbitai full review |
|
|
@coderabbitai full review |
✅ Action performedFull review finished. |
Creature candidate discovery scanned every WorldEntity on each movement tick and looked up EventAI state for each row. Characters now seed discovery through an entry index, and active objects come from an EventAI-state index. The remaining scan for pets and combat flags runs only on the slower sense cadence, when those lists are consumed.
The Character type-bit check, instance scope, default pets, combined combat flags and active objects outside Character AOI retain their existing behavior. This addresses the creature-scan finding in the performance and correctness report.
Verified with 1,470 Module tests in an isolated build, 233 focused cycle tests, a Wasm check and offline preflight. A private baseline-to-change plain publish created only the two indexes and preserved a distinctive existing row. The row shapes stay unchanged. The reduction concerns candidate discovery; no realm capacity improvement is claimed from this test.
Implemented by GPT-5.6 Sol through Codex, reviewed by GPT-6 through Codex.
Summary by CodeRabbit
Performance
Bug Fixes
Data Updates