Repository navigation
Description
Setup. tvOS device (AppleTV14,1 / A15, tvOS 26.6), engine at the 6.21.0 pin (87868c1c), Debug host build. A live MPEG-TS session fed through MediaSource.custom(IOReader): the reader is an adapter over an app-owned, disk-backed spool (one continuous upstream socket; blocking ring reads; logical-offset seek; size unknown; isLive: true; dvrWindowSeconds deliberately unset — the host owns the rewind window and performs jumps as fresh loads, never engine seeks). Route resolves to the loopback/native path.
Finding. The session retains approximately every consumed byte as anonymous memory. phys_footprint grows at the source mux rate (~1.7 MB/s here) for the life of the session, and the process is killed silently at ~11.5 min (no crash report, no main-thread stall — the jetsam shape).
The engine's own memprobe line tells the story. Custom-reader session at t=600/630:
memprobe t=600s rss=360MB vmInt=314MB vmExt=43MB vmCmp=844MB vmIOS=0MB physFP=1158MB mallocBlocks=109568 mallocMB=2472 avioFetchedMB=0 cacheCount=62 cacheMB=105 ...
memprobe t=630s rss=393MB vmInt=347MB vmExt=43MB vmCmp=864MB vmIOS=0MB physFP=1212MB mallocBlocks=110260 mallocMB=2472 avioFetchedMB=0 cacheCount=60 cacheMB=102 ...
Log stops mid-segment at t≈687 with no teardown lines; the process is gone from the process table; no .ips is written. rss alone is misleading — it peaked at 626 MB (t=270) and the OS compressed/reclaimed it down to ~323 — but physFP (what jetsam enforces) ratchets monotonically at the mux rate: ~1.7 MB/s × 687 s ≈ 1.2 GB.
The control. Same box, same channel, same build, URL source (isLive, raw TS over HTTP), 32-minute session:
memprobe t=30s rss=90MB vmInt=28MB ... physFP=28MB ... avioFetchedMB=61 ...
memprobe t=1922s rss=92MB vmInt=29MB ... physFP=29MB ... avioFetchedMB=3424 ...
3.4 GB fetched through, physFP flat at 28–29 MB.
What the probe's buckets say. On the custom-reader session every itemized bucket is flat while physFP climbs: cacheMB ~102, pumpWinMB 4, pktAlive 3, audioFifo 0 — and avioFetchedMB=0, i.e. the custom path doesn't ride the URL path's fetch-and-release accounting at all. The retained ~1.2 GB is invisible to every bucket the probe itemizes. (mallocMB pins at 2472 early and stays — it reads as a zone high-water rather than live bytes.)
The reader is exonerated by a second consumer. The identical spool + stream adapter feeds libVLC (VLCMedia custom input) through battle-tested 30-minute rewound sessions on the same hardware with flat memory. The retention appears only when the engine is the consumer.
Ask. Where does the custom-source path buffer consumed bytes, and can it ride the same eviction/disk-cache discipline as the URL path? A custom live reader that never EOFs makes "retain everything read" unbounded by construction. Happy to re-run the 30-minute session against a branch — and we will re-measure at 6.52.0 in our upcoming pin-bump pass regardless; if anything in 6.22–6.52 already touched custom-source buffering, a pointer saves a cycle.
Full evidence (collected device log with the memprobe series, the URL-arm control, and the harness scripts) is archived in our repo under qa-artifacts/tevemate/2026-08-27-e3b-wedge/.
Activity
cmcpherson274 commentedon Aug 28, 2026
Re-measured at 6.53.0 as promised in the report — reproduced, and the series is cleaner than the original.
Same box (AppleTV14,1, tvOS 26.6), same channel, same custom-IOReader spool shape, engine at
07af2e3f(6.53.0). The memprobe series is a textbook line:20 points, perfectly linear at 1.783 MB/s — the source mux rate — with
avioFetchedMB=0(the custom path still bypasses the fetch accounting) and every itemized bucket flat, as before. One difference from the 6.21.0 run: the compressor never engaged this time (vmCmp=0throughout vs 864 MB then), so the silent kill came correspondingly earlier — the log stops mid-segment at t≈636 (was t≈687), no crash report written, no main-thread stall, process gone from a populated process table. Same jetsam shape, less compressed-memory runway.This matches the code reading:
IOReader.swiftis byte-identical between the pins and no release note in 6.22–6.53 touches custom-source buffering, so nothing was expected to move — but now the issue carries a datapoint at current, and the counter fixes in 6.53.0 make the surrounding telemetry trustworthy (rx/origin both monotonic in the same session's captures).Standing offer unchanged: happy to re-run the 30-minute session against any branch. This is the one blocker left on our side for turning the custom-reader arm on.
superuser404notfound commentedon Aug 28, 2026
Reproduced, root-caused and fixed on
main(c90ffb16). Thank you for the memprobe series and, above all, for the URL arm next to it: the pair is what made this a one-shot diagnosis instead of a hunt.Where the bytes go: nowhere the engine can see, because they are the host's.
CustomIOReaderBridgecopies straight from yourreadinto FFmpeg's 256 KB AVIO buffer and keeps nothing, which is why every itemized bucket on the probe is flat and honest. The retention is one level below that, in an object lifetime rather than in a buffer.HLSSegmentProducerruns its pump on a bareThread, and FFmpeg's read callback reaches yourIOReaderfrom inside that loop. A bare thread has no autorelease pool, and the pump never returns for the length of the session, so nothing on it ever drains. Every autoreleased object your reader creates per read (anNSDataout ofFileHandle, anything Foundation hands back +0) is therefore stranded until the session ends. On a live source that never EOFs, that is one retained byte per byte played, unbounded by construction.That also explains the two things that looked contradictory in your report:
AVIOReadernever runs host code on that thread, and the engine's own readers each carry a private pool.FileIOReader.readhas had one since Unbounded memory growth when playing a remote Blu-ray ISO over HTTP #243 with the comment "one leaked byte per byte played, measured at 625 MB in-use after 624 MB read", andHTTPDiscIOReader.rangeGethas one too. The lesson was learned twice and both times fixed one reader down, where it could never cover a reader a host wrote. The custom bridge was the one door left without a pool.Your own log carries the arithmetic. Between t=600 and t=630,
mallocBlockswent 109568 to 110260 (+692) whilephysFProse 54 MB. That is 82 KB per new block, i.e. one stranded allocation per read, sized like one read.mallocMBsitting still at 2472 across the same step is what made this hard to see from the outside, and your instinct about that field was right: 2472 MB of live malloc inside a 1158 MB footprint only balances because most of it is in the 844 MBvmCmpbucket, and the counter is too coarse to show a 54 MB step against that background.mallocBlocksis the field that moved, and it moved by exactly the right amount.The fix puts the pool at the seam the engine owns rather than asking hosts to know which of our threads their callback lands on:
read,seek, theAVSEEK_SIZEprobe, the seekability probe andcanceleach run insideautoreleasepool. Nothing about theIOReadercontract changes, and a reader that already drains its own pays nothing for the second one.Measured on a new harness (
aetherctl customio --live), a host-owned live spool paced against the wall clock, blocking at the edge instead of ever returning EOF, unknown size, seekable by logical offset, native/loopback route, 5 minutes at a 0.95 MB/s mux rate:Ratio 1.00 is your report reproduced exactly: one byte kept per byte played. After the pool the footprint is the session's rather than the stream's, and flat across the run.
Two notes for your re-measure:
c90ffb16onmain, and it will be in the next release.avioFetchedMB=0, a flat URL control, and a block census that lands on your +692.The harness ships with the fix, because that shape had no harness at all until now, which is the real reason this could sit in the engine unnoticed while three of us stared at the probe.
cmcpherson274 commentedon Aug 28, 2026
Ran the 30-minute-hold recipe against
main(8851d1ae, pool fix verified present in the resolved checkout —CustomIOReaderBridge.swift:62 autoreleasepool { body() }) on the same box, same channel, same spool. The footprint did not move: this is your "then the retention is somewhere else" branch.Slope ~1.77 MB/s — the same mux-rate line as 6.21.0 and 6.53.0 — and the same silent kill (process gone from a populated table, no crash report, log stops mid-segment at ~t≈595).
And the reason the pool cannot cover us is the one you anticipated: our reader allocates nothing autoreleased per read. The hot path, end to end:
IOReader.read→ a SwiftInputStreamsubclass'sread(_:maxLength:)override → a disk-backed ring'sread(at:into:maxLength:)→ POSIXpread(fd, buffer, …)directly into the buffer your bridge hands us. NoFileHandle.readData, noNSData, noData— the segmentFileHandleis created once per SEGMENT rotation (seconds apart) and cached, and only itsfileDescriptoris read per call.seek(rare) does touchNSNumberbridging viaStream.property(forKey:); reads do not.Two data points that may aim the next dig:
autoreleasepoolby construction.vmCmp=0across all our recent runs — the stranded pages are never even compressed, they sit dirty until jetsam.Happy to hand you the complete reader implementation (it is ~70 lines, self-contained) and re-run against any branch or diagnostic build — a per-read block-origin census (malloc stack logging on the pump thread for one minute) is also runnable here on request. Full new-pin series and logs archived in our repo as before.
superuser404notfound commentedon Aug 28, 2026
Your re-measure settles it, and it also says round 1 measured the wrong thing. Thank you for running it against
mainand for writing out the reader's hot path line by line, because that is what turned this into a correction instead of another hypothesis.The harness brought the cause with it.
aetherctl customio --liveread its spool withFileHandle.readData(ofLength:), which strands one autoreleasedDataper read on exactly the thread the fix was about. Ratio 1.00 before the pool and 0.00 after are both real numbers, and both are about the harness. Your adapterpreads straight into the buffer the bridge hands it and allocates nothing per read, so the pool has nothing to drain on your stack and could never have moved your line. The fix stays in, because it covers every host reader built on Foundation and that door was genuinely open, but it is not your defect and I should not have shipped a repro whose only arm carried its own retention.The control that was missing is an arm that allocates nothing. It is now the default (
--foundation-readerkeeps the allocating one as a control that proves the pool drains), and it is flat, ate19dffb7:That is 900 MB of source through a live spool that never EOFs, with the engine holding nothing. Worth stating plainly: this arm would have been flat before the pool fix as well, which is exactly why its absence let a harness result read as a field result.
One number from those runs may be worth more to you than the ratio. The harness now reports how far behind the live edge the engine ever reaches back:
Same in both arms, DVR window included. The one seek is the seekability probe at open. The timeshift window lives in the segment cache on disk, not in the source, so the engine never asks a live custom reader for a byte it has already consumed. If your ring keeps history because the engine might come back for it, it is keeping it for a request that does not arrive, and a ring that grows for the session grows at exactly the mux rate you are seeing.
Your own numbers also disagree with reading 1 in your last comment. Taking the three points as posted:
The byte slope is nailed to the mux rate in all three, but the block rate falls by a factor of nine while it does. At 1.78 MB/s with 82 KB reads the session performs about 22 reads a second, so in the last interval fewer than one new block appears per eight reads. Whatever still strands is therefore not one allocation per read any more. It is either a single buffer growing by
realloc, which raisessize_in_usewithout ever adding a block, or memory malloc never handed out:vm_allocatepages, a CoreMedia pool, an IOSurface.vmCmp=0fits the second family better, since ordinary heap growth of that size does engage the compressor.So the engine now names the region instead of leaving you with a slope. Three rounds ended on "footprint climbs, every itemized bucket is flat", and that stayed true because the buckets are either totals (
vmInt/vmExt/vmCmp) or heap-only (mallocBlocks, the size-class census). None of them can see a region outside malloc.maingains a per-region census: it walks the task's VM map withvm_region_recurse_64and tallies dirty plus swapped pages peruser_tag, reported as growth since the session's first tick:It reports growth rather than a total on purpose. Even the anonymous total overshoots
phys_footprint(measured here at 100 MB against 56 MB), because IOSurface and video-bitstream mappings look anonymous in that map while the kernel charges them to whoever created them, so an absolute figure would not survive being checked against the line beside it. Summed positive deltas do: holdvmGrewMBagainst the rise inphysFPover the same span, and the remainder is the part no tag explains. It rides the switch you already use,setLargeAllocationCensusEnabled(true), needs no other host change, and the first tick anchors its own baseline so the load burst does not land in the finding.Two asks, in the order that would help most:
MALLOC_LARGE, your offer of a malloc stack log becomes exactly the right next step. If it is untagged anonymous memory, that is a third place entirely, and worth knowing before anyone spends an hour on stacks.mmaped, and how it decides what it may drop. Given the 0.0 MB reach-back above, a ring that keeps everything the engine might still want is holding it for nothing, and that shape would put your slope in your own address space while the reader stays innocent.Send the ~70 lines whenever convenient, writer side included, and I will run them here against the same harness. Apologies for the round that fixed a real defect and called it yours.
cmcpherson274 commentedon Aug 28, 2026
The census run is done, and it does better than name the region — it names the allocation. The whole slope is ONE malloc block, realloc-grown on an exact ×1.25 ladder, whose content is every byte the session has consumed from the custom reader.
Setup. Same WD7 recipe as every round (app tune on the tvOS device, spool arm through the custom reader, −30 s jump at +25 s, rewound hold to the kill), wrapper built against
main@7ea32cf2— so the pool fix (c90ffb16) and everything since is in — withsetLargeAllocationCensusEnabled(true, triggerThresholdMB: 32, triggerPollHz: 8)armed at engine init. One axis note: the memprobe clock restarts at the jump's fresh install, so tabletcounts from ~30 s after the tune (last tick t=691; the log's final write lands ~12.5 s after it, at tune+734 s). The death is the same silent kill as every prior run: no crash report (.ipscount identical before/after), app gone from a populated process table.The series (30 s memprobe;
vmGrewMB= your summed positive per-tag deltas;REALLOC Δ= thevmTagTopleader every tick from t=60 on;big block= the larger of the twobigExactentries — the other is a static 3.4 MB):Reading it:
vmGrewMBaccounts for the physFP rise at EVERY tick, gap ≤ 4 MB. Nothing grew outside the census's sight.MALLOC_LARGEholds +1 MB the whole run,MALLOC_SMALL+0, and the only non-malloc entries ever to appear in the top 3 (UNTAGGEDonce, an unnamedtag89once) do so at +0 MB. So it is the malloc family after all — the non-heap hypothesis dies here, andvmCmpstayed ≈0 (3 MB at the last tick) anyway.bigBlocks=2the whole run; the second is a static 3,424,256 B across the memprobe series). Its capacity ladder is exactly geometric: every consecutive ratio in that column lands in 1.2500–1.2502 (and the t=30→60 move is two steps: 1.25² = 1.5625 vs 1.5628 measured). A growth factor that clean is a fingerprint, not a coincidence.muxBytesMBplus a small, slowly DRIFTING offset — +10.7…+11.5 MiB at the first bracketed crossing, +13.7…+14.8 at the next, +16.0…+18.8 after that, rising past +30 by mid-run. The block is holding ~every byte the session has consumed from the custom reader since load, appended forever, trimmed never.cacheMBbounded at 99–107,avioFetchedMB=0,avBufAhead4–5 s /avBufBehind≈27–31 s,pktAlive=3, packet/audio FIFOs zero. The 8 Hz trigger census fired until its own 12-emission cap (census trigger cap reached (12); further jumps are not captured— it landed ~4.4 min before the kill, so the final 1049→1312 MB step appears only in the 30 s memprobe grid); the 12 capturedcensus trigger #N jump=+…MBlines carry block tops at each jump instant — archived in the leg log if you want them.So the search image on your side is concrete: something on the custom-reader live path appends the session's consumed byte stream into one contiguous buffer with a 1.25× growth policy. The malloc-stack-log offer stands if you want the allocation site proven from our device rather than found by grep — say the word and it runs the same recipe.
Your ask 2 — the ring and the writer. The short version: the spool is a disk file store, not a memory ring, and nothing in it scales with bytes consumed.
FileHandle.write) in a per-session temp directory; logical offsets are monotonic across segments for the session's life. No mmap anywhere — writes are file appends, reads arepread.(startOffset, URL)per 64 MB), one write handle, one cached read handle per reader, a PCR→offset index at ~1 entry/second (16 B each, pruned with the ring — ≈29 KB at the full window), and a bounded TS-parse carry (< one chunk). Well under 1 MB total.read= a blocking ring read thatpreads straight into the buffer your bridge hands us (parks at the growth edge on a 0.25 s condvar quantum);seekaccepts SEEK_SET/SEEK_CUR at/above the join anchor (FFmpeg's 0-based axis translated through the offset the install joined at; below-anchor and SEEK_END/AVSEEK_SIZE refuse — a live spool has no known end); allocations per read: none (one NSNumber on the rare seek).The source, writer side included, to run against your harness:
The spool ring, the per-chunk writer path, the read path, and the engine-facing IOReader adapter
WRITER — SpoolRing.append / rollSegment / prune (disk segment files)
WRITER — the per-chunk URLSession path + the window bound
READ PATH — SpoolRing.read (pread into the caller's buffer) + the per-reader handle cache
READ PATH — SpoolInputStream.read (the stream the adapter wraps)
THE ENGINE-FACING ADAPTER — AetherSpoolReader (IOReader)
(Context for the excerpts:
SpoolRing/SpoolReader/SpoolInputStreamlive in the app'sLiveDVR.swift;AetherSpoolReaderis theIOReaderthe wrapper hands yourload(source: .custom(…)). The same ring feeds our libVLC rung through 30-minute holds flat, which is what first pointed the retention at the engine-side path.)Edited same day after our adversarial review pass caught three defects in the first posting: (1) the "content ≈ muxBytes + ~55 MB" reconciliation was wrong — impossible at the t=30 tick by this comment's own content-≤-capacity model; the bracketed offsets above (+10.7…+11.5 MiB drifting past +30) are what the log supports, and the headline (one block holding ~every consumed byte) is unchanged and better supported by them; (2) the final-write gap read ≈43 s by double-counting the ~30 s tune→jump axis offset — it is ~12.5 s; (3) the trigger census did not run "through the run" — it hit its 12-emission cap ~4.4 min before the kill (you may want that cap liftable for exactly this shape). The last code fence also over-ran the adapter's closing brace into an unrelated platform stub; trimmed.
superuser404notfound commentedon Aug 28, 2026
6.55.0 carries
c90ffb16(the pool atCustomIOReaderBridge) ande19dffb7(round 2 of the harness).Nothing in it should move your line, and that is the finding rather than a hedge: your reader preads into the buffer the bridge hands it and allocates nothing per read, so the pool has nothing to drain on your stack. The POSIX arm is the harness default now and measures flat across 900 MB, ratio -0.03 over 541 s and 0.00 with a 300 s DVR window, which is the control that was missing in round 1.
So the open half is unchanged: the region census on your side, since every itemized bucket here is either a total or heap-only and your own block arithmetic points outside malloc.
cmcpherson274 commentedon Aug 28, 2026
The census run you're asking for landed about an hour before the tag — see #445 (comment) above. Short version: it points INSIDE malloc after all — the entire physFP rise is one
REALLOC-tagged block growing on an exact ×1.25 realloc ladder, content tracking bytes-consumed-from-the-reader (trigger-bracketed offsets in the comment).vmGrewMBaccounts for the whole rise at every tick; no CM/IOSurface/untagged growth anywhere. The ring/writer answer and the reader+writer source are in the same comment.superuser404notfound commentedon Aug 28, 2026
Your census landed while I was writing the 6.55.0 note, so that comment crossed it and its last line is wrong: your data does point inside malloc. It carries more than that, though, because the ladder names the allocator family on its own.
x1.25 is Foundation's growth policy, not libav's.
Datagrows a large buffer by addingnewLength >> 2(above the 128 KB threshold), rounds the result throughmalloc_good_size, which is why your sizes are page-aligned, and it grows throughrealloc, which is why the region carries the REALLOC tag. Every other candidate on this path grows differently and your own column excludes them:av_fast_realloc/av_fast_mallocadd a sixteenth plus 32 bytes (1.0625), FFmpeg's AVIO dynamic buffer adds a half (dyn_buf_write:size += size / 2 + 1), Swift'sArrayandStringdouble, and a CoreMedia pool does not realloc at all. Nine consecutive rungs at 1.2500 to 1.2502 is one family: the block is a SwiftData.The one
Datashape that grows like that while staying small. ADataconsumed from the front withremoveFirstonly advances the slice's lower bound. The backing store keeps every byte below that bound and reallocs to fit the ever-rising upper bound, socountstays tiny while the allocation holds the entire stream. Twenty lines, no engine, on this Mac:One block (nothing else in the process is over 1 MB), successive ratios 1.2501, content equal to every byte ever appended, logical length under one TS packet for the whole run, and the footprint tracking the stream 1:1. That is your table, produced by one call.
The probe that settles it in your process, without Instruments:
Leaking carry after 78 MB consumed:
count=168 startIndex=78643032 mallocSizeAtBase=0(an interior pointer, so malloc does not recognise the base). Re-based:count=168 startIndex=0 mallocSizeAtBase=192.startIndexis the whole tell and it costs one line per long-livedData.Where to point it first: the piece you described as "a bounded TS-parse carry (< one chunk)". Bounded is a statement about
count, andcountis exactly what stays small in this defect, which is what makes it invisible from inside the code that owns it. Anything else that appends per chunk and consumes from the front (removeFirst,dropFirstassigned back, a frontreplaceSubrange) has the same shape. The engine paid for this pattern twice on its own buffers, onAVIOReader's persistent window (70430de) and inByteFIFO's consume, and both re-base withsubdata; neither sits on the custom-source path, which is why the allocation-free harness arm measures flat there across 900 MB.One correction to the axis, since it changes what your offset means:
muxBytesMBismuxerLifetimeFragmentBytes, the bytes the engine's muxer has WRITTEN to its segment files, not the bytes it consumed from your reader. So the block tracking it means it tracks the stream, and the drifting +10.7 to +30 MiB is the difference between the remuxed output and whatever the block actually holds, not a measured lead over your reader. Worth knowing before that offset is used as evidence for either side. On the engine's own side of that axis there is no long-livedDatato be found: FFmpeg writes into the muxer's fixed 64 KB AVIO buffer,FragmentSplitterhands the moof/mdat bytes straight towrite(fd), and the loopback server streams the segment file to the socket.ftyp+moovis the onlyDataon that path and it is released when moov closes.On main now (
bfcb4f61, not tagged, collecting):aetherctl customio --live --host-carry removeFirst|subdata: the carry above, put back on the harness's delivery path deliberately, as a positive control. Same fixture, same engine, 260 s at 14 Mbit:Ratio 0.82 rather than 1.00 is the ladder itself: each realloc frees the old block before the new one is fully dirtied, so the footprint dips a step every time and a slope anchored mid-ladder reads slightly under the mux rate. The per-tick line carries
carryCountandcarryStartso the tell is visible while the run is going.The census names the family itself now:
bigGrowth=1.2501x(Data)next tobigExact, on both the 30 s memprobe line and the trigger line, each with its own previous value so neither reports the ratio the other's interval produced. An unrecognised ratio is printed bare instead of being rounded into the nearest story.Your cap ask:
setLargeAllocationCensusEnabled(_:triggerThresholdMB:triggerPollHz:triggerCaptureCap:),0= uncapped. A steady mux-rate climb spends one capture per threshold climbed, which is exactly why twelve ran out 4.4 minutes early on your run and the decisive final step only survived in the 30 s grid.If the
startIndexprobe on your ingest carry prints a number that tracks the stream, that is your block and the re-base is the fix. If every long-livedDataover there prints 0, the stack-log offer is the next step and I would take you up on it, because then the ladder saysDatawhile none of yours is riding one.cmcpherson274 commentedon Aug 28, 2026
Confirmed at the bytes, same hour: it is ours, and it is exactly the shape you named. The "bounded TS-parse carry" is the one long-lived
Dataon our writer path, and its hot loop is verbatim your defect:The comment two lines above it is the part you'd appreciate: this
removeFirstwas itself a review fix — the original per-packetcarry = Data(carry.dropFirst(188))was replaced for being O(n²) on the network queue. The slow version re-based every packet and could never leak; the fast one keptcountsmall while the backing store kept the stream. "Bounded is a statement aboutcount" is going in our review checklist word for word.It also closes the one exoneration we over-trusted: we'd reasoned "the same spool feeds libVLC through 30-minute holds, so the writer is clean" — but this carry sits on the shared writer path, and the libVLC arm was never memory-measured over a long hold. Your allocation-free-arm logic said engine-clean; ours should have said "writer unmeasured", not "writer clean".
Fix (the
subdatare-base) plus the before/after re-measure on the WD7 recipe are next from our side — bench access permitting, today; thestartIndexprobe rides the same build as the belt-and-suspenders confirmation. Thank you for the forensic read of the ladder — naming Foundation's growth constant from nine ratios is the kind of thing that saves a week of Instruments.cmcpherson274 commentedon Aug 28, 2026
Fixed, measured, and the numbers agree with your diagnosis to the megabyte.
The fix:
PCRIndex.ingest's trim is now a re-base —carry = carry.subdata(in: (carry.startIndex + consumed)..<carry.endIndex)— once per ~64 KB chunk, so the O(n²) theremoveFirstwas originally installed to kill stays dead too. (YourstartIndexprobe becomes structurally moot on this shape — a fresh backing store every chunk — which is its own kind of confirmation.)Before/after, same WD7 recipe, same device, same census:
~4 GB of stream through a process that grew 2 MB; crash count unmoved; zero recoveries. The t=30 arithmetic cross-checks your identification exactly: 136 − 112.5 ≈ 24 — the pre-fix baseline WAS the carry.
So from our side #445 is resolved: your pool fix closed the class for readers that do allocate, your harness's clean arm proved the engine holds nothing, and your ladder forensics found the one buffer that was never the engine's. The census switch (
bigGrowthnaming, the settable trigger cap) has already paid for itself twice over here — it's staying in our permanent QA kit. Close whenever suits you, and thank you for chasing a leak that turned out to live in someone else's house.superuser404notfound commentedon Aug 29, 2026
Closing on your numbers. That table is the cleanest possible end to this one: the t=30 arithmetic gives the identification back without any argument (136 minus 112.5 lands on exactly the 24 MB baseline), and 4 GB of stream through a process that moved 2 MB settles the rest.
The part worth recording is that the
removeFirstwas itself a performance fix. The O(n²) re-base was correctly identified and correctly replaced, and the replacement was right aboutcountand silent about the backing store.subdatais the version that is right about both. "Bounded is a statement aboutcount" earned its place in your checklist, and it is going into the diagnostic notes here for the same reason.Where this stands on my side:
c90ffb16) is released in 6.55.0. It never covered your adapter, since apreadstraight into our buffer allocates nothing, but it does close the class for hosts whose readers hand back +0 Foundation objects. That class had already costFileIOReaderandHTTPDiscIOReadera fix each, both one altitude too low, which is why it moved to the seam the engine owns.mainisbfcb4f61, not yet in a tag:bigGrowth=<ratio>x(<family>)on the memprobe and trigger lines, the settabletriggerCaptureCapwith0for unlimited, and the--host-carry removeFirst|subdatapositive control inaetherctl customio. It ships with the next release, so a pinned build will carry it rather than a branch checkout.If the census stays in your QA kit, keep the ratio table beside it, because the family is the diagnosis: x1.25 is Foundation
Data, x1.5 is FFmpeg's dyn_buf, x2 is a Swift array, and +1/16 isav_fast_realloc. Nine rungs at the same ratio is a far stronger fingerprint than any single sample, and it is cheap to log.Thank you for the measurement discipline across all three rounds. Two of them landed on my side of the fence and you ran them anyway, including the one that exonerated the engine, and the census that eventually found your buffer only exists because you asked for it.
superuser404notfound commentedon Aug 29, 2026
The census work from round 3 is in 6.56.0, so it is on a tag rather than a branch checkout now:
bigGrowth=<ratio>x(<family>)besidebigExacton both the memprobe and the trigger lines,setLargeAllocationCensusEnabled(triggerCaptureCap:)with0for uncapped, andaetherctl customio --host-carry removeFirst|subdataas the positive control for the carry shape.