CaltechExperimentalGravity / CaltechExperimentalGravity/system_ident

P_eff < 2 sets var_H = 0, which the 1e-9 floor turns into weight 4.6e19 forever

Open
#6 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

**Stage B1 (spec §3.2).** A single degenerate pass permanently swamps the whole campaign.

[`src/system_ident/loop.py:444`](https://github.com/CaltechExperimentalGravity/system_ident/blob/feat/cds-hardware-backend/src/system_ident/loop.py#L444) sets `var_H = 0` when only one period survives, and
[`src/system_ident/loop.py:460`](https://github.com/CaltechExperimentalGravity/system_ident/blob/feat/cds-hardware-backend/src/system_ident/loop.py#L460)'s floor `H_err = maximum(H_err, 1e-9 * abs(Hb))` converts that into
a **measured weight of 4.56e+19** in `_accumulate` ([`src/system_ident/loop.py:317`](https://github.com/CaltechExperimentalGravity/system_ident/blob/feat/cds-hardware-backend/src/system_ident/loop.py#L317)) — identical to
a healthy 8-period pass. Every later pass is then numerically irrelevant.

This is verbatim a lesson the sibling project learned on hardware: *a bin is excluded by making its
uncertainty **infinite**, not zero — zeroing it produces an infinite weight, the opposite of the
intent.*

**It is reachable from shipped config, not hypothetical.** `_choose_transient`
([`src/system_ident/loop.py:359`](https://github.com/CaltechExperimentalGravity/system_ident/blob/feat/cds-hardware-backend/src/system_ident/loop.py#L359)) returns `min(n_min, max(P-1, 0))` when `P <= n_min + 2`. On
[`src/system_ident/configs/rtsfreerun_hsts.yml`](https://github.com/CaltechExperimentalGravity/system_ident/blob/feat/cds-hardware-backend/src/system_ident/configs/rtsfreerun_hsts.yml) (`n_segments: 6`, `segment_duration: 16`, Q≈50 modes
at 0.67 Hz → τ = 23.8 s), [`src/system_ident/design/resolution.py:58`](https://github.com/CaltechExperimentalGravity/system_ident/blob/feat/cds-hardware-backend/src/system_ident/design/resolution.py#L58)'s own recommendation gives
`n_transient = ceil(3*23.8/16) = 5` → `P=6, n_drop=5` → **`P_eff = 1`**. The config only escapes by
omitting `n_transient` and defaulting to 1.

### Fix

- `P_eff < 2` → `H_err = inf` (zero weight in `_accumulate`), or raise — consistent with
[`src/system_ident/loop.py:410`](https://github.com/CaltechExperimentalGravity/system_ident/blob/feat/cds-hardware-backend/src/system_ident/loop.py#L410)'s "periodic FRF needs at least 2 whole periods". **Never `0`.**
- Add a config-time check that `n_segments >= n_transient + 3` — `_choose_transient` needs that headroom
to adapt at all ([`src/system_ident/loop.py:376`](https://github.com/CaltechExperimentalGravity/system_ident/blob/feat/cds-hardware-backend/src/system_ident/loop.py#L376)).

### Acceptance

Weight at `P_eff == 1` goes 4.56e+19 → 0.

Already correct and not to be touched: [`src/system_ident/loop.py:458`](https://github.com/CaltechExperimentalGravity/system_ident/blob/feat/cds-hardware-backend/src/system_ident/loop.py#L458) uses `inf` for unexcited
bins and [`src/system_ident/loop.py:317`](https://github.com/CaltechExperimentalGravity/system_ident/blob/feat/cds-hardware-backend/src/system_ident/loop.py#L317) weights on `isfinite & > 0`.

---
**Campaign:** CDS hardware backend · branch [`feat/cds-hardware-backend`](https://github.com/CaltechExperimentalGravity/system_ident/tree/feat/cds-hardware-backend)
· [spec](https://github.com/CaltechExperimentalGravity/system_ident/blob/feat/cds-hardware-backend/docs/superpowers/specs/2026-08-03-cds-hardware-backend-design.md) · [plan](https://github.com/CaltechExperimentalGravity/system_ident/blob/feat/cds-hardware-backend/docs/superpowers/plans/2026-08-03-cds-hardware-backend.md) · [handoff](https://github.com/CaltechExperimentalGravity/system_ident/blob/feat/cds-hardware-backend/notes/cds-hardware-bringup-2026-08.md)
*Code is deferred until the plan and issues have been reviewed.*

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in src/system_ident/loop.py at _accumulate, _choose_transient, and the cited uncertainty calculations, then inspect src/system_ident/configs/rtsfreerun_hsts.yml and the configuration path. Ensure a single effective period contributes zero weight and invalid segment/transient settings are rejected; verify the reported weight changes from 4.56e+19 to 0.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.