Repository navigation
Start every hostile corpus item on its first variant, so a later run in one process reads as the first (#460) - #516
Merged
Conversation
…un in a process reads as the first AVFoundation picks a session's starting rung from a throughput history it keeps per process and offers no way to reset. A few corpus runs on the loopback raise it until every ladder entry starts on its top rung, and the severe ladder gap's top rung (frames past AAC's bit reservoir) never primes: the "lost play()" of #460. A fresh process starts on the first variant listed, so `startsOnFirstEligibleVariant` pins every run to that start and leaves the climb to AVFoundation. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MJAhQmFgdRRAKUaMHibQLe
…the run counts as observed, and cite the reservoir Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MJAhQmFgdRRAKUaMHibQLe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #460
Cause, with evidence
The cause is not a play request lost under load, and not a gap in the harness's teardown. AVFoundation picks a session's starting variant from a throughput history it keeps for the whole process, and we found no API that resets it. Every earlier corpus run on the fast loopback raises that history, until every ladder entry starts on its top rung. Started there, the severe ladder gap's top rung never plays.
Probes on
sp-460(iOS 27.1), since removed:NSHashTable.weakObjects) to every corpusAVPlayer,AVPlayerItemandAVAssetshowed zero still alive at the start of every iteration.hls-ladder-gapentry asked formedia.m3u8(the bottom rung) first. Access logindicatedBitrate = 128000.media-high.m3u8first.media-high.m3u8,segment-high0.aacandsegment-high1.aac, then stopped at position 0 with an empty access log.ratecaught the severe player atrate = 0withtimeControlStatus == .playingand the item.readyToPlay, about 100 ms afterplay(). That is the shape AVFoundation's pause at an item's end has, not a lost request.media-high.m3u8directly, in a fresh process:AudioQueueObject.cpp Prime: failed (-50); will stop.So the "lost
play()" was AVFoundation refusing media it was never obliged to decode. Whether the record met that refusal depended only on how many sessions the process had already played.Reproduction (before the fix)
xcodebuild test-without-building -test-iterations 6 -only-testing:SuperPlayerTestkitTests/HostileManifestCorpusTests/testEveryGradedEntryIsPlayedAndItsBehaviourRecordedonsp-460failed in 3 of 3 runs, always with"hls-ladder-gap (severe)": .neverStarts:The deterministic form is the fresh-process probe above: started on the severe top rung, a stock
AVPlayernever starts, every time.Remedy, and why it keeps the record honest
observesetsAVPlayerItem.startsOnFirstEligibleVariant = trueon every corpus item.hls-ladder-gapentries have more than one variant, so no other row can move.The other options:
play(): rejected. The player did not lose a request; it refused the media. Re-issuing would not prime a rung the audio queue refuses. Worse, a harness that restarts a stopped player would hide exactly the kind of silent stop the record exists to show.xcodebuildinvocation per run, and it would leave the dependence on process state undocumented.What else changed:
spec:citation. The decision is recorded as ADR-0021 rule 4's iOS: the hostile corpus record loses a play() after repeated runs in one process (hls-ladder-gap severe never starts) #460 addendum, plus a paragraph indocs/testing.md's The hostile corpus on iOS.ios/checkran the whole class.After the fix
-test-iterations 10: 10/10 passed, about 40 s each.SP_SIMULATOR=sp-460 ios/check: passed. That is 710 tests on iOS, 12 on tvOS (sp-460-tv) and 38 inios/MoQ, plus the demo build.Review
Standards
spec:citation, and the property has aref:.observepoints to the ADR rather than retelling it.Spec
docs/testing.md); the comment says that only a multi-iteration run shows the effect; it names a climb inside the budget as the failure to expect.Not done, and why
ladderStepFactor(.severe) = 48produces ADTS frames larger than AAC allows. That makes the entry's top rung invalid media as well as a ladder gap. Changing the shared corpus (both generators, fixtures, both records and the doctor's register) is out of scope for iOS: the hostile corpus record loses a play() after repeated runs in one process (hls-ladder-gap severe never starts) #460, and is worth its own issue.🤖 Generated with Claude Code
https://claude.ai/code/session_01MJAhQmFgdRRAKUaMHibQLe