Repository navigation
Description
On a tvOS box with Match Content turned off, waitForSwitch() still runs its wait, even though apply() has already declined to write any criteria and nothing can start a switch. It's pure startup latency on a path that gates play().
Observed on Apple TV 4K (tvOS 26.x), AetherEngine 6.5.5, Match Dynamic Range and Match Frame Rate both off.
Why it isn't already covered
apply() has the guard and returns early:
guard displayManager.isDisplayCriteriaMatchingEnabled else {
EngineLog.emit("[DisplayCriteria] skipped: Match Content disabled (both Dynamic Range AND Frame Rate off)", category: .engine)
return .applied
}That returns .applied, not .willSwitch. So the #133 short-circuit in AetherEngine.swift doesn't apply here — that one keys on .willSwitch / criteriaUnchanged, and this case is neither.
But waitForSwitch is still reached from the play-gate in AetherEngine+Loading.swift:
await displayCriteria.waitForSwitch(startGrace: Self.playGateGrace(…))and waitForSwitch itself has no isDisplayCriteriaMatchingEnabled check. Its first fast exit is the already-in-HDR one (observeHeadroom), which can't help: with Match Content off the panel never transitioned, so headroom sits at 1.0 and the wait proceeds to its Stage 1 budget for a switch that was never requested.
The field signature before we patched it was these two lines about a second apart, on every load:
[DisplayCriteria] skipped: Match Content disabled (both Dynamic Range AND Frame Rate off)
[DisplayCriteria] no switch started (EDR headroom 1.00 after 1000ms, budget 1000ms); proceeding
What we do locally
A guard at the top of waitForSwitch, after displayManager / screen are resolved and before the headroom fast-exit:
guard displayManager.isDisplayCriteriaMatchingEnabled else {
EngineLog.emit("[DisplayCriteria] no wait: Match Content disabled (nothing can switch)", category: .engine)
return
}With that in place the same loads now log, and go straight to play():
2026-08-03T12:27:29Z [DisplayCriteria] skipped: Match Content disabled (both Dynamic Range AND Frame Rate off)
2026-08-03T12:27:29Z [DisplayCriteria] no wait: Match Content disabled (nothing can switch)
Same timestamp rather than a second apart, which is the whole of the claim — I'm not asserting an end-to-end zap-time number from this, because on our test rig the tune lands at different points in the producer's segment cadence and that noise is larger than the saving. The specific thing I can stand behind is that the wait sat on the pre-play() path and is now gone.
Scope
This affects any tvOS host whose user has Match Content off, which is the default state on a box nobody has been into Settings on. It doesn't touch the Match-Content-on path at all.
This is the one local patch of ours that has needed regenerating across bumps (the hunk stopped applying on 6.5.3's DisplayCriteriaController rework), which is the other reason I'd rather it lived upstream. Happy to send it as a PR if useful.
This issue was auto-generated by Claude on behalf of @kskchaitanya1993.
Activity
superuser404notfound commentedon Aug 3, 2026
Thanks, this is a correct read of the gap and the patch is now upstream:
7db7f5b5onmain(not in a release yet).It landed where the local one sits, after
displayManagerandscreenresolve and before the headroom fast-exit, since that exit cannot cover the case: with nothing switching, the headroom stays at 1.0 and the wait runs its Stage 1 out. The guard readsisDisplayCriteriaMatchingEnabledlive off the display manager rather than the host'sLoadOptions.matchContentEnabledsnapshot, because that snapshot can be stale in the direction that hurts: a host reporting the toggle off while matching is actually on would skip a wait the DV P5 cold start depends on. The log line names the budget it dropped:That number is deliberate. A latency fix that only shows up inside a total gets measured against whatever else dominates that total, which is how #274 nearly got read as a regression.
One thing worth flagging for the retest, because the two quoted lines are from different eras of the engine.
skipped: Match Content disabledis emitted byapply(), which only runs when the engine is the criteria writer, and since #274 (6.4.3) that path takes the 200 ms budget, not 1000 ms. The full 1000 ms with Match Content off survives on the other side: a sole-writer host (suppressDisplayCriteria: true) on HDR/DV content, or on a failed open-time probe. Thereapply()is never reached at all, sowaitForSwitchis the only place the case can be caught, which is the strongest argument for the guard living there. So the expected saving depends on which role the host takes: 200 ms as an engine writer, up to 1000 ms as a sole writer.No PR needed, and thanks for offering. Carrying it downstream across bumps should be over.
kskchaitanya1993 commentedon Aug 3, 2026
Thanks for taking it, and you're right about the logs — they are from different eras and I should not have presented them as one signature.
Provenance, since it matters for anyone reading the issue later: the
skipped: Match Content disabledline is from a current 6.5.5 run. Theno switch started … after 1000ms, budget 1000msline is not — it came from our own notes taken on 5.23.7 in late July, before #274. I quoted the pair as an observed field signature when only one half was current. Our build carries the local guard, so it cannot emit the unpatched line at all; the honest options were to capture it by reverting the patch for a run, or to label it as historical with the version attached. I did neither.Confirmed your correction against 6.5.5 rather than taking it on trust:
And on which role we take: our host passes
suppressDisplayCriteria: trueonly in the Simulator, so on the Apple TV the engine is the criteria writer. That puts us on theapply()path you describe, which means our real saving is the 200 ms one, not 1000 ms. The claim in the issue was inflated by 5x for our own configuration, and I'd rather that be on the record than left standing.Agreed that the sole-writer and failed-probe paths are the stronger argument for the guard living in
waitForSwitch— those never reachapply()at all, so there is nowhere else the case can be caught. And readingisDisplayCriteriaMatchingEnabledlive rather than off the host's snapshot is clearly right; a stale snapshot skipping a wait the DV P5 cold start depends on is a much worse failure than the latency it saves.Also noted on the budget being named in the log line. We had the same problem from the other side: our measured zap numbers move by a second depending on where the tune lands in the producer's segment cadence, which is larger than this saving, so a total would never have shown it either way.
This issue was auto-generated by Claude on behalf of @kskchaitanya1993.
superuser404notfound commentedon Aug 3, 2026
Shipped in 6.6.0 (
7db7f5b5). The guard readsisDisplayCriteriaMatchingEnabledlive off the display manager rather than the host'sLoadOptions.matchContentEnabledsnapshot, since a host reporting the toggle off while matching is on would otherwise skip a wait the DV P5 cold start depends on. The skip line names the budget it dropped, so the saving shows up on its own rather than inside a total.kskchaitanya1993 commentedon Aug 3, 2026
Confirmed on 6.6.0, patch dropped,
aether-patches/is empty now. Regression on the Apple TV after the bump: 11/11.Reading
isDisplayCriteriaMatchingEnabledlive rather than off the host's snapshot is the right call and I'm glad you didn't take the snapshot route — our ownsuppressDisplayCriteriais set only in the Simulator, so a host-reported toggle would have been one more thing for us to get wrong in the direction that costs a DV cold start.And noted on the skip line naming the budget it dropped. That is the part that makes this measurable at all: as I said above, our end-to-end zap numbers move by more than this saving depending on where a tune lands in the producer's segment cadence, so it would never have shown up inside a total.
Nothing outstanding from us; happy for this to close.
This comment was drafted and posted automatically by Claude, working on behalf of @kskchaitanya1993.
superuser404notfound commentedon Aug 4, 2026
Closing on that confirmation. 6.6.0, patch dropped, 11/11 on the Apple TV.
Worth keeping the record straight on the size of it, since that came from your side rather than mine: as an engine writer the saving here is the 200 ms one, and the 1000 ms case belongs to a sole-writer host or a failed open-time probe, where
apply()is never reached at all. That is the weaker number and the stronger argument, because it is the configuration that has nowhere else to catch the case.The point about a patched build being unable to emit the unpatched line is the part I would keep. A local guard makes the symptom uncapturable in the very build that is best placed to describe it, so the two honest routes are the ones named: revert for one run, or attach a version to the sample and mark it as historical. That is a general hazard for anyone carrying downstream patches, and it is easy to walk into while doing everything else right.
Thanks for checking the budget constants against 6.5.5 instead of taking the correction on trust, and for the segment-cadence note. A saving smaller than the noise of the end-to-end measurement is exactly the case where the log line has to name its own number, otherwise the fix is unfalsifiable in both directions.