# Manuscript-to-code mapping This implementation follows the corrected/refactored MOSAIC formulation. | Manuscript concept | Code | |---|---| | Rank-one Grassmann exponential | `src/mosaic_online/geometry.py::grassmann_exp_rank1` | | Precision-preconditioned direction `(S + sigma^2 I)^-1 c` | `src/mosaic_online/model.py::MOSAIC.partial_fit` | | Online residual noise floor | `src/mosaic_online/model.py::MOSAIC.partial_fit` | | Exact square-root-free AIRM update | `src/mosaic_online/geometry.py::spd_geodesic_step` | | Sherman--Morrison inverse update | `src/mosaic_online/geometry.py::spd_geodesic_step` | | Mahalanobis novelty `q=c^T S^-1 c` | `src/mosaic_online/model.py::MOSAIC.novelty_score` | | Fixed-memory state | `src/mosaic_online/model.py::MOSAIC.memory_floats` | | Exact AIRM equation verification | `tests/test_geometry.py` | | End-to-end standard benchmark smoke test | `scripts/smoke_digits.py` | ## Deliberate differences from earlier draft code 1. The implementation does **not** describe the state as a globally independent `Gr x SPD` product. 2. `(S + sigma^2 I)^-1 c` is described as a stable precision preconditioner, not as the exact Fisher natural gradient. 3. The fixed-rank core is isolated from heuristic rank-growth/shrinkage logic so the smoke tests measure the central geometric algorithm. 4. The AIRM update's exponent cap is explicitly treated as an overflow safeguard rather than part of the mathematical update. 5. Optional QR numerical cleanup rotates the SPD fiber consistently with the induced gauge change.