ai-code-battle/cmd
jedarden 7befe516bf fix(db): eliminate O(n²) iteration in generateBotProfiles
The generateBotProfiles function had two nested loops that caused O(n²) memory usage:
- Iterating through all rating history entries (10,000) for each bot (10,000) = 100M iterations
- Iterating through all matches (1,000) for each bot (10,000) = 10M iterations

This caused acb-index-builder to run out of memory and get OOMKilled during the build cycle.

Fixed by pre-building lookup maps (O(n) build + O(1) lookup):
- historyMap[botID] -> []RatingHistoryEntry
- matchMap[botID] -> []MatchSummary

Reduces complexity from O(bots × matches) to O(matches + bots) for lookups.

Resolves acb-index-builder CrashLoopBackOff after 45 days of failure.
2026-06-25 01:29:26 -04:00
..
acb-api feat(api): add GET /api/status/{bot_id} endpoint per plan §8.2 2026-05-25 16:53:03 -04:00
acb-enrichment fix(dockerfile): correct golang version from 1.24 to 1.25 2026-06-04 08:52:03 -04:00
acb-evolver feat(evolver): add C# language support 2026-06-17 05:08:19 -04:00
acb-index-builder fix(db): eliminate O(n²) iteration in generateBotProfiles 2026-06-25 01:29:26 -04:00
acb-local Implement SiegeBot: spawn-lockout strategy 2026-06-17 01:02:01 -04:00
acb-map-evolver style: apply gofmt alignment fixes across codebase 2026-05-24 10:40:33 -04:00
acb-mapgen fix(mapgen): align spawn radius comment with actual implementation (30% vs 15%) 2026-05-26 19:28:49 -04:00
acb-maps-loader style: format Go files with gofmt 2026-05-25 15:33:38 -04:00
acb-matchmaker style: apply gofmt alignment fixes across codebase 2026-05-24 10:40:33 -04:00
acb-wasm style: apply gofmt alignment fixes across codebase 2026-05-24 10:40:33 -04:00
acb-worker feat(engine): add pre-generated map loading from map library 2026-05-25 14:14:27 -04:00