Commit a7abc1b
committed
fix(sweep): P1 grid cardinality bound + P2 lance_fragment_path honesty
Two fixes from Codex review on the D3.1 sweep_handler:
P1 — Reject oversized sweep grids before enumerate().
A small JSON payload with moderately-sized axes can explode into
an enormous Cartesian product and exhaust CPU/memory. Added
MAX_GRID_CARDINALITY = 10,000 check before materialization;
returns 400 with explicit error message if exceeded.
P2 — Stop echoing req.log_to_lance into lance_fragment_path.
The D3.1 stub does NOT actually append rows to Lance; echoing
the requested path back in the response falsely claims persistence
that never occurred. Clients treating lance_fragment_path as
evidence of successful logging would silently skip retries and
lose experiment results. Set to None until the real Lance append
writer lands (D3.1b).
Same anti-#219 pattern: don't claim a measurement/persistence
happened when it didn't. The stub:true flag on per-point results
covers measurement-honesty; this fix covers persistence-honesty.
117/117 tests pass. Clippy clean under --features serve.
https://claude.ai/code/session_01SbYsmmbPf9YQuYbHZN52Zh1 parent 778e52a commit a7abc1b
1 file changed
Lines changed: 25 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
309 | 327 | | |
310 | | - | |
311 | 328 | | |
312 | 329 | | |
313 | 330 | | |
| |||
333 | 350 | | |
334 | 351 | | |
335 | 352 | | |
336 | | - | |
| 353 | + | |
337 | 354 | | |
338 | 355 | | |
339 | | - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
340 | 362 | | |
341 | 363 | | |
342 | 364 | | |
| |||
0 commit comments