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
## 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
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.
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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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
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
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