Commit 186bccc
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 Luce-Org#214 review-4308296776 (cubic-bot P1+P2).1 parent 3f26661 commit 186bccc
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 | |
|---|---|---|---|
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
358 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
359 | 362 | | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | 363 | | |
365 | 364 | | |
366 | 365 | | |
| |||
726 | 725 | | |
727 | 726 | | |
728 | 727 | | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
729 | 743 | | |
730 | 744 | | |
731 | 745 | | |
| |||
0 commit comments