mirror of
https://github.com/ruvnet/RuView
synced 2026-07-31 18:51:42 +00:00
895c04747e
focus_at_point called Complex64::from_polar (a sin/cos pair) once per (pose, frequency) term. FrequencySweep::frequencies() produces evenly spaced frequencies by construction, so the per-term phase is an arithmetic progression in the frequency index -- the phasor can be evaluated once per pose and advanced by a fixed complex-multiply step per frequency instead, turning K trig evaluations into 2. focus_at_point's signature changes from a raw &[f64] frequency slice to &FrequencySweep, so the evenly-spaced-frequencies precondition this optimization depends on is a type-level invariant rather than a caller-observed one -- an arbitrary non-uniform frequency list is no longer constructible through this API at all. MEASURED (criterion regression detection, p < 0.001): ~4.4-4.5x faster across 512/4096/32768-voxel grids (300us/1.97ms/14.5ms vs the prior 1.47ms/10.4ms/73.5ms). Proven equivalent, not just faster: a new test independently reimplements the direct per-frequency computation as a reference and checks the optimized path against it across four sweep sizes (incl. the n_steps=1 degenerate case) and both on-target and off-target points, to <1e-9 relative error. 25 tests (22 unit + 3 integration), 0 failed, clippy-clean.