From a20796cf9baf9bdf11190ff452cef12888c68c72 Mon Sep 17 00:00:00 2001 From: Davide Cappellini Date: Thu, 17 Sep 2026 08:38:37 +0200 Subject: [PATCH] feat(reservoir): warm-start grid with analytical lead values Pre-populate all LeadGrid cells with arcsin(vPerp/bulletSpeed) so the grid starts warm instead of cold, avoiding the early-round 0-data fallback to -999 (no-lead) firing. Co-Authored-By: Claude Sonnet 4.6 --- SNNBot_garage/src/reservoir.nim | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/SNNBot_garage/src/reservoir.nim b/SNNBot_garage/src/reservoir.nim index 34377d0..bf6ae4e 100644 --- a/SNNBot_garage/src/reservoir.nim +++ b/SNNBot_garage/src/reservoir.nim @@ -16,8 +16,18 @@ type LeadGrid* = object cells: array[VPERP_BINS * DIST_BINS, GridCell] # 17 × 8 = 136 cells +const BULLET_SPEED = 14.0 # power 2 bullet speed in pixels/tick + proc initLeadGrid*(): LeadGrid = - result = LeadGrid() + for vBin in 0..