Commit 484620e
Codex CI R4 P1: enforce zero diagonal on callable conley_metric
P1 [new in R4] — `_validate_callable_metric_result` accepted any
symmetric / finite / non-negative matrix, even when d(i, i) > 0. The
Conley sandwich relies on K(0) = 1 to reduce the i=j term to the HC0
diagonal X_i ε_i² X_i'; a positive self-distance silently attenuates
the HC0 contribution by K(d_ii / h) < 1 and misstates Conley SEs.
Built-in metrics ("haversine", "euclidean") satisfy d(i, i) = 0 by
construction, so the existing parity tests didn't catch this gap on
the callable surface.
Adds a sixth check to the callable validator:
|d(i, i)| <= 1e-10 for all i, else ValueError naming the violated
invariant ("nonzero self-distance ... requires d(i, i) = 0 so the
kernel reduces to K(0) = 1 on the HC0 diagonal contribution").
Tests:
- test_callable_metric_nonzero_diagonal_raises: symmetric / finite /
non-negative with d(i, i) = 0.5 raises.
- test_callable_metric_near_zero_diagonal_accepted: sub-tolerance
diagonal noise (1e-13) accepted, mirroring the symmetry contract.
- test_pairwise_distance_callable updated: the constant_metric
fixture now zeroes its diagonal (otherwise it would fail the new
check); behaviorally equivalent off-diagonal coverage.
Docs:
- docs/methodology/REGISTRY.md § "Callable conley_metric validation"
extended: 6th check added to the list + a paragraph explaining the
HC0-reduction rationale.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 0a8b438 commit 484620e
3 files changed
Lines changed: 80 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
125 | 134 | | |
126 | 135 | | |
127 | 136 | | |
| |||
133 | 142 | | |
134 | 143 | | |
135 | 144 | | |
136 | | - | |
| 145 | + | |
| 146 | + | |
137 | 147 | | |
138 | 148 | | |
139 | 149 | | |
| |||
164 | 174 | | |
165 | 175 | | |
166 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
167 | 186 | | |
168 | 187 | | |
169 | 188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3130 | 3130 | | |
3131 | 3131 | | |
3132 | 3132 | | |
| 3133 | + | |
3133 | 3134 | | |
3134 | 3135 | | |
3135 | | - | |
| 3136 | + | |
| 3137 | + | |
| 3138 | + | |
| 3139 | + | |
| 3140 | + | |
| 3141 | + | |
| 3142 | + | |
3136 | 3143 | | |
3137 | 3144 | | |
3138 | 3145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
168 | 170 | | |
169 | 171 | | |
170 | | - | |
| 172 | + | |
171 | 173 | | |
172 | 174 | | |
173 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
174 | 178 | | |
175 | | - | |
176 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
177 | 183 | | |
178 | 184 | | |
179 | 185 | | |
| |||
244 | 250 | | |
245 | 251 | | |
246 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
247 | 290 | | |
248 | 291 | | |
249 | 292 | | |
| |||
0 commit comments