# AI Agent Bug Suspicions & TODOs

This file tracks potential issues, structural anomalies, and mathematical mismatches identified by AI agents during code analysis. Items here require human verification before invasive code changes are made.

---

### [2026-04-24] Potential Double Normalization in Ranging Accumulation (Gemini)
**Location:** `CuasRanging.java`, method: `refineSingleTargetDisparity()` around line 1946.

**Observation:** 
The method accumulates transform-domain (TD) correlations across multiple scenes to increase SNR for deep disparity. 
1. It calls `OpticalFlow.accumulateCorrelationsAcOnly(accum_weights, fcorr_td_acc)`. This method loops over the array and divides `fcorr_td_acc` values by `accum_weights`.
2. It then calls `image_dtt.clt_process_tl_correlations(...)`, passing *both* the normalized `fcorr_td_acc` and the `accum_weights`.

If the downstream GPU call (`gpuQuad.execCorr2D_normalize`) uses `accum_weights` to divide the values again, the integrated signal is divided by $N^2$ instead of $N$. For a sequence of 200 frames, this suppresses the signal by a factor of 40,000, effectively destroying the correlation peak.

**Action Required:**
Verify if `execCorr2D_normalize` (or the downstream CPU equivalent if GPU falls back) applies division by the passed weights. If so, remove the `accumulateCorrelationsAcOnly` call in `refineSingleTargetDisparity`.

---

