Commit 2b92878
committed
fix(mtp): cubic review — invariant-guard prefill capture + hoist migrate to init
P1: capture-invariant violation now fails loud instead of clearing
all_prefill_hidden mid-loop, which let the next chunk's memcpy
write past freed memory (heap UB).
P2: migrate_prefill_cache moved out of generate() into init_mtp_();
max_ctx and gamma are config-time constants, so checking the bool
return where backend init can fail cleanly removes the
OOM-on-first-request → null ssm_intermediate → segfault path.
PR #214 review-4308296776 (cubic-bot P1+P2).1 parent e93ecfe commit 2b92878
2 files changed
Lines changed: 29 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
80 | 83 | | |
| 84 | + | |
| 85 | + | |
81 | 86 | | |
82 | 87 | | |
83 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
359 | | - | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
360 | 363 | | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | 364 | | |
366 | 365 | | |
367 | 366 | | |
| |||
727 | 726 | | |
728 | 727 | | |
729 | 728 | | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
730 | 744 | | |
731 | 745 | | |
732 | 746 | | |
| |||
0 commit comments