Decouple aim() from tickGA - compute input vector once per tick #124

Closed
opened 2026-08-29 19:04:37 +02:00 by SirStone · 1 comment
Owner

What to build

Compute the 91-dimensional input vector once per tick instead of recomputing it in both aim() and tickGA(). Make aim() a pure function that receives a pre-computed vector.

Currently aim() calls toInputVec internally, duplicating 91 multiplies and additions that tickGA already performed.

Acceptance criteria

  • Input vector is computed once per tick (in onScannedBot or a shared method)
  • tickGA accepts pre-computed input vector as parameter
  • aim() accepts pre-computed input vector, no longer calls toInputVec
  • aim() is a pure function with no side effects
  • CPU usage reduced (no redundant vector construction per shot)
  • Existing behavior unchanged: same aim angle and power output

Blocked by

Input cleanup (#120) - the toInputVec signature changes from 91 to 90 elements, so aim() must be updated to match

Parent

Closes part of #118

## What to build Compute the 91-dimensional input vector once per tick instead of recomputing it in both aim() and tickGA(). Make aim() a pure function that receives a pre-computed vector. Currently aim() calls toInputVec internally, duplicating 91 multiplies and additions that tickGA already performed. ## Acceptance criteria - Input vector is computed once per tick (in onScannedBot or a shared method) - tickGA accepts pre-computed input vector as parameter - aim() accepts pre-computed input vector, no longer calls toInputVec - aim() is a pure function with no side effects - CPU usage reduced (no redundant vector construction per shot) - Existing behavior unchanged: same aim angle and power output ## Blocked by Input cleanup (#120) - the toInputVec signature changes from 91 to 90 elements, so aim() must be updated to match ## Parent Closes part of #118
SirStone added the ready-for-agent label 2026-08-29 19:05:49 +02:00
Author
Owner

Implemented in commit a730a9e

Summary: Decoupled aim() from tickGA by computing the input vector once per tick instead of duplicating it. aim() now receives pre-computed vector as parameter and is a pure function. Eliminates redundant 91-element vector construction per shot.

Files:

  • vapourbot_garage/src/vapourbot/gun.nim - aim() signature, vector parameter threading
Implemented in commit a730a9e **Summary:** Decoupled aim() from tickGA by computing the input vector once per tick instead of duplicating it. aim() now receives pre-computed vector as parameter and is a pure function. Eliminates redundant 91-element vector construction per shot. **Files:** - `vapourbot_garage/src/vapourbot/gun.nim` - aim() signature, vector parameter threading
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SirStone/SirRoboGarage#124