Commit aa30a98
[perf]: rebuild the deferred-release schedule when a stage is added late
The schedule maps each deferred component to the last stage that holds it,
derived once after create_pipeline_stages. Every pipeline in the tree builds
its stages there, but nothing enforced it. A stage appended afterwards could
hold a component an earlier stage had already been told to free, and would
then be handed a released component mid-run with no error.
add_stage now rebuilds the schedule and says so, turning an invariant nothing
checked into a visible self-correction.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent e4c71ca commit aa30a98
2 files changed
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
51 | 55 | | |
52 | 56 | | |
53 | 57 | | |
| |||
600 | 604 | | |
601 | 605 | | |
602 | 606 | | |
| 607 | + | |
603 | 608 | | |
604 | 609 | | |
605 | 610 | | |
606 | 611 | | |
607 | 612 | | |
| 613 | + | |
608 | 614 | | |
609 | 615 | | |
610 | 616 | | |
| |||
616 | 622 | | |
617 | 623 | | |
618 | 624 | | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
619 | 634 | | |
620 | 635 | | |
621 | 636 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
0 commit comments