Commit 2939839
committed
fix(perturbation-sim): degenerate-grid + key-cardinality guards (review #511)
Addresses the open review findings on the merged #511:
- examples/calibrate.rs: guard degenerate grids up front. `k = 24.min(m)` is 0
when m==0, so `m / k` panics (divide by zero); `eigenvector(1)` / `m - 1` also
break on n<2. Exit cleanly with a message instead. (CodeRabbit Major)
- src/hhtl.rs: basin_lambda2 asserts keys.len() == grid.n. A mismatched slice
silently produced wrong basin groupings + lambda2; fail fast at the API
boundary. (CodeRabbit Major)
- .claude/board/TECH_DEBT.md: reflow the wrapped `#507` so it is not parsed as
an ATX heading (markdownlint MD018). (CodeRabbit Minor)
Already-fixed before merge (no change needed): Codex P2 — `infight` is 4-bit
(columns.rs `spec("infight", 4, ...)`, the certified width per the §10 note).
Deferred: the TECH_DEBT.md append-only addendum-placement nit (CodeRabbit Major)
is a board-hygiene reorganization, left to a focused governance pass rather than
churned inside a code-fix PR.
Gates: fmt + clippy -D warnings + test green (75 lib tests) on the standalone
perturbation-sim crate.
https://claude.ai/code/session_016b33swuXE23hKtqxsHu9p11 parent 8a3e335 commit 2939839
3 files changed
Lines changed: 19 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
179 | | - | |
180 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
126 | 135 | | |
127 | 136 | | |
128 | 137 | | |
129 | 138 | | |
130 | | - | |
131 | 139 | | |
132 | 140 | | |
133 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
109 | 116 | | |
110 | 117 | | |
111 | 118 | | |
| |||
0 commit comments