Skip to content

Commit a2cd4c4

Browse files
dalerobertsclaude
andcommitted
chore: add design_row assertion and update spec per code review
- Add assert(design_row == n_meas) in ComputeGeodesicAcceleration - Remove v_acceleration_ and geodesic_alpha_ from spec (not used) - Clarify that direction sets (D) are deferred, B/K azimuths implemented Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 30958ef commit a2cd4c4

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

docs/superpowers/specs/2026-03-11-geodesic-acceleration-design.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Add geodesic acceleration (Transtrum & Sethna, 2012) to the existing LM solver i
1515
## Design Decisions
1616

1717
- **Analytic second derivatives** (not finite-difference) — exact, no step-size tuning, but requires per-measurement-type implementation.
18-
- **High-value types first** — distances (S, C, E, M) and directions/azimuths (D, B, K). GPS baselines are nearly linear in the ECEF Cartesian parameterisation; other types can be added later.
18+
- **High-value types first** — distances (S, C, E, M) and individual azimuths (B, K). Direction sets (D) are deferred: they use derived angles (differences of constituent directions) requiring more complex second-derivative logic. GPS baselines are nearly linear in the ECEF Cartesian parameterisation; other types can be added later.
1919
- **Separate acceleration pass** — new `ComputeGeodesicAcceleration()` function called after existing `SolveLM()`. Keeps `SolveLM()` untouched.
2020
- **Lambda decay unchanged** — geodesic acceleration is additive to the current simple decay strategy. Gain-ratio adaptation is a separate future enhancement.
2121
- **Opt-in via CLI flag**`--lm-geodesic` (requires `--lm-enabled`). Default off.
@@ -174,12 +174,12 @@ void ComputeGeodesicAcceleration(const UINT32& block);
174174

175175
**New member variables:**
176176
```cpp
177-
vector<matrix_2d> v_acceleration_;
178177
vector<matrix_2d> v_choleskyFactor_; // saved Cholesky factor for acceleration solve
179178
vector<vector<double>> v_scaleDiag_; // saved scaling vector (when scale_normals_to_unity active)
180-
double geodesic_alpha_;
181179
```
182180

181+
Note: The acceleration vector is computed as a local variable within `ComputeGeodesicAcceleration()` rather than stored as a member — simpler with no persistent state needed. The alpha parameter is read from `projectSettings_.a.lm_geodesic_alpha`.
182+
183183
### Modified Iteration Loop
184184

185185
After existing `SolveLM()` call:

dynadjust/dynadjust/dnaadjust/dnaadjust.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7056,6 +7056,8 @@ void dna_adjust::ComputeGeodesicAcceleration(const UINT32& block)
70567056
}
70577057
}
70587058

7059+
assert(design_row == n_meas && "ComputeGeodesicAcceleration: design_row mismatch");
7060+
70597061
// Step 3: Assemble RHS: rhs = -(AtVinv * f_vv)
70607062
matrix_2d accel_rhs(n_params, 1);
70617063
AssembleAccelerationRHS(v_AtVinv_.at(block), f_vv, accel_rhs);

0 commit comments

Comments
 (0)