Commit 81766e6
committed
tighten(hpc/blocked_grid): apply P2 savant pre-merge findings + persist verdict
P2 savant (Phase 13) verdict: SHIP-WITH-FOLLOWUPS. 4 P2 findings; 3 applied
in this commit, 1 deferred to PR-X3.1.
P2-1 (applied) — downscope `pub` helpers on GridBlock/GridBlockMut to
`pub(crate)`. The four helpers (data_slice, padded_cols_stride on
GridBlock; data_mut, padded_cols on GridBlockMut) are intra-crate
implementation seams. Leaving them `pub` meant downstream consumers
could bypass the `# Footgun` guard on `as_padded_slice`. Also drops the
`#[doc(hidden)]` attribute — no longer needed once visibility is tight.
P2-3 (applied) — drop stray `T: Copy` bound from `GridBlock::from_grid`,
`GridBlockMut::from_grid`, `Iterator for BaseBlockIter`, `Iterator for
BaseBlockIterMut`, both `ExactSizeIterator` impls, and the impl block
holding `blocks_base` / `blocks_base_mut`. None of these positions
actually copy a `T` value — they only compute index arithmetic and
slice the storage. The bound was over-constraining; iterator surface
now works for any `T` (not just `T: Copy`). `BlockedGrid::get` / `set`
still correctly require `T: Copy` because they do copy values.
P2-4 (applied) — strengthen macro L1-only deferral wording with explicit
PR-X3.1 ticket reference + `TODO(PR-X3.1)` marker + dedicated per-field
workaround warning. Reduces the risk that callers cement per-field
loops outside the macro-generated struct.
P2-2 (DEFERRED → PR-X3.1) — typed `field_grid::<I, FieldT>()` accessor
alongside the existing erased `field_n::<I>()`. Additive but requires
either a downcast trait or extra macro emit arm; no current consumer
needs it.
Verdict file persisted at .claude/knowledge/pr-x3-p2-savant-review.md.
PR-X3.1 follow-up backlog documented at the bottom of the verdict file.
All 5 gates green after tightenings:
- cargo check: PASS
- cargo test --lib hpc::blocked_grid: 111/111 PASS
- cargo test --doc hpc::blocked_grid: 79/79 PASS
- cargo fmt --check: clean
- cargo clippy -D warnings: clean1 parent 01a70ed commit 81766e6
4 files changed
Lines changed: 90 additions & 35 deletions
File tree
- .claude/knowledge
- src/hpc/blocked_grid
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
| 334 | + | |
338 | 335 | | |
339 | 336 | | |
340 | 337 | | |
| |||
405 | 402 | | |
406 | 403 | | |
407 | 404 | | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
414 | 410 | | |
415 | 411 | | |
416 | 412 | | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
| 413 | + | |
| 414 | + | |
422 | 415 | | |
423 | 416 | | |
424 | 417 | | |
| |||
479 | 472 | | |
480 | 473 | | |
481 | 474 | | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
| 475 | + | |
486 | 476 | | |
487 | 477 | | |
488 | 478 | | |
| |||
552 | 542 | | |
553 | 543 | | |
554 | 544 | | |
555 | | - | |
556 | | - | |
557 | | - | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
558 | 550 | | |
559 | 551 | | |
560 | 552 | | |
561 | | - | |
562 | | - | |
563 | | - | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
564 | 558 | | |
565 | 559 | | |
566 | 560 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
20 | 28 | | |
21 | 29 | | |
22 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
| 187 | + | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
| 193 | + | |
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| |||
0 commit comments