Commit 7ea32cf
fix(live): measure a window slide against the consumer's next fetch
The AE#441 retest read `live window slid past the consumer` four times in the
48 s after a deep rewound landing, every one of them firstVisible ==
consumerTarget + 1, with no stall and no cache miss behind any of them.
The line was reading the LAST fetch when the cost is decided by the NEXT one.
`declareTarget` fires as a segment is served and the consumer walks indices
forward, so everything below consumerTarget is already in AVPlayer's buffer and
the index it asks for next is consumerTarget + 1. A viewer parked at the floor
therefore sits one segment below firstVisible for part of every slide, the same
one-segment sawtooth residentFloorOutputSeconds() has against the rendered
playhead. Its next fetch is firstVisible itself, which is resident.
Chasing that turned up the reason the tolerance is not merely cosmetic: at
exactly that off-by-one, eviction unlinks the segment currently being served.
A serve holds a URL rather than a file handle (mediaSegmentURL hands peekURL's
result to a response that stats and opens it afterwards), so the window is a 404
for an index the playlist offered when it was asked for. Eviction now stops at
the fetch point, which is the bound evictBelow already documented for itself,
and never trails firstVisible by more than that one segment so a consumer that
stopped fetching cannot pin retention behind it. Not observed to fire on
loopback, where a serve completes in well under a segment; closed by
construction.
The harness could not reach this regime at all, which is why the local
counter-run read 0 lines against the retest's 4. `live --rewind-hold` filled
`window * 0.6` before rewinding, so the floor was always the session's own start
rather than an eviction frontier. It now fills past full, warns when --seconds
leaves too little hold behind that, and reports the shape of each latched line
instead of only counting them.
Measured, 220 s parked at the floor, window 60 s, paced 1x:
before 4 latched lines, all gap 1, 0 stalls, max inversion 3.80 s (TD 4)
after 0 latched lines, 0 stalls, max inversion 3.60 s
Unpaced backlog burst, window 30 s, after the change: 1326 lines, gap up to 12,
1326 of them above one segment, 8 stalled ticks. The two classes stay separated.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WbciAqCSxpaiUpTumrCuA91 parent e19dffb commit 7ea32cf
4 files changed
Lines changed: 134 additions & 10 deletions
File tree
- Sources
- AetherEngine/Video
- aetherctl
- Tests/AetherEngineTests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
350 | | - | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
351 | 352 | | |
352 | 353 | | |
353 | 354 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
593 | | - | |
| 593 | + | |
| 594 | + | |
594 | 595 | | |
595 | 596 | | |
596 | 597 | | |
| |||
606 | 607 | | |
607 | 608 | | |
608 | 609 | | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
609 | 640 | | |
610 | 641 | | |
611 | 642 | | |
| |||
616 | 647 | | |
617 | 648 | | |
618 | 649 | | |
619 | | - | |
| 650 | + | |
620 | 651 | | |
621 | 652 | | |
622 | 653 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
785 | 785 | | |
786 | 786 | | |
787 | 787 | | |
788 | | - | |
789 | | - | |
790 | | - | |
791 | | - | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
792 | 800 | | |
793 | 801 | | |
794 | 802 | | |
| |||
830 | 838 | | |
831 | 839 | | |
832 | 840 | | |
833 | | - | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
834 | 845 | | |
835 | 846 | | |
836 | 847 | | |
| |||
843 | 854 | | |
844 | 855 | | |
845 | 856 | | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
846 | 860 | | |
847 | 861 | | |
848 | 862 | | |
| 863 | + | |
| 864 | + | |
849 | 865 | | |
850 | 866 | | |
851 | | - | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
852 | 879 | | |
853 | 880 | | |
Lines changed: 65 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
0 commit comments