Bound and phase remaining loaded-world maintenance work #18

Open
opened 2026-08-23 09:39:43 +00:00 by rhelwig · 0 comments
Owner

Current behavior

The July 2026 code/performance audit found several loaded-world loops whose expensive setup can still run before or outside their intended budget:

  • construction reconciles every block of every active build site before starting its 25 ms work budget
  • defense maintenance processes all settlements on the same 20-tick boundary
  • Forester candidate selection uses nested broad searches
  • some profession workstation scans do not consistently reuse the existing batched discovery result
  • several static worker/roadwork caches still lack explicit size or expiry bounds

Expected behavior

Loaded-world simulation should use cached scans, bounded per-tick queues/cursors, and phased settlement work so one tick cannot absorb an unbounded area or settlement count.

Files involved

  • src/main/java/com/ronhelwig/livevillages/sim/SettlementConstruction.java
  • src/main/java/com/ronhelwig/livevillages/sim/SettlementDefense.java
  • src/main/java/com/ronhelwig/livevillages/sim/SettlementForesterWork.java
  • profession work classes under src/main/java/com/ronhelwig/livevillages/sim/

Already addressed

The audit stopped background village discovery from loading chunks, bounded loaded villager queries/caches, and extended/capped the expensive Roadwright internal-POI cache. Roadwright-specific path work remains tracked in #5.


Migrated from https://github.com/rhelwig/LiveVillages/issues/18
Original author: rhelwig
Original labels: none

## Current behavior The July 2026 code/performance audit found several loaded-world loops whose expensive setup can still run before or outside their intended budget: - construction reconciles every block of every active build site before starting its 25 ms work budget - defense maintenance processes all settlements on the same 20-tick boundary - Forester candidate selection uses nested broad searches - some profession workstation scans do not consistently reuse the existing batched discovery result - several static worker/roadwork caches still lack explicit size or expiry bounds ## Expected behavior Loaded-world simulation should use cached scans, bounded per-tick queues/cursors, and phased settlement work so one tick cannot absorb an unbounded area or settlement count. ## Files involved - `src/main/java/com/ronhelwig/livevillages/sim/SettlementConstruction.java` - `src/main/java/com/ronhelwig/livevillages/sim/SettlementDefense.java` - `src/main/java/com/ronhelwig/livevillages/sim/SettlementForesterWork.java` - profession work classes under `src/main/java/com/ronhelwig/livevillages/sim/` ## Already addressed The audit stopped background village discovery from loading chunks, bounded loaded villager queries/caches, and extended/capped the expensive Roadwright internal-POI cache. Roadwright-specific path work remains tracked in #5. --- Migrated from https://github.com/rhelwig/LiveVillages/issues/18 Original author: `rhelwig` Original labels: none
Sign in to join this conversation.
No labels
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
ronhelwig.com/live-villages#18
No description provided.