Repository navigation
feat(display): the host asserts what the engine cannot observe (#493, #459) - #505
Merged
Merged
Conversation
…459) Two platforms, one gap. On macOS `AVPlayer.availableHDRModes` is `API_UNAVAILABLE(macos)`, so there is no per-mode capability table to read at all, and 6.69.0 filled the rest of that table from `eligibleForHDRPlayback` while deliberately leaving Dolby Vision unclaimed: eligibility proves EDR, not that AVFoundation will accept a DV variant on this display. On tvOS the panel-mode readout rests on the EDR headroom, which only answers around a dynamic-range transition, so an Apple TV whose output format is locked to HDR never makes one and reads as an SDR panel forever, and on tvOS 27 the property has stopped answering on at least one box even across a real switch. Neither is a question the engine can ask better. Both are questions the host can answer. `LoadOptions.panelPresentsDolbyVision` is that answer for Dolby Vision. It composes into the session capability table (`DisplayCapabilities.assertingDolbyVision`), which the format clamp and the served route now take from one place, so the published `videoFormat` and the DV signaling cannot disagree about the same display. `supportsHDR` rides along because DV is an HDR format: without that term the asserted session would have built a DV master for a route `displaySupportsHDR == false` had already sent media-direct, which is the HDR10 base layer, which is what the assertion exists to stop. HDR10 and HLG are not implied; that every DV television also takes HDR10 is a fact about the market, not an entailment of the claim. An assertion only ever adds, so `false` cannot hide an observed capability. `panelIsInHDRMode` becomes an OR term over the criteria readout on every platform instead of counting only where the host suppresses display criteria (#459). Default `false`, so a host that asserts nothing is exactly where it was, and the readout still decides when it can. What makes both safe rather than reckless is that the refusal is already handled: `-11868` and `-11848` are classified as master rejections and `MasterFallbackDecision` reloads the media playlist once, in place, at the same position. A wrong assertion costs a reload, not the item. `aetherctl play --assert-dv` drives the flag, because the DV route was reachable from no macOS harness at all, which is how the reporter ended up A/B-ing a local patch instead of a session option. Measured here on macOS 26.5 against a real DV P5 file (Dolby "Patterns of Nature" UHD): without: source-format=dolbyVision effective-format=hdr10 serving (dvModeAvailable=false effectiveDvMode=false ... dvVariant=profile5) with: source-format=dolbyVision effective-format=dolbyVision serving (dvModeAvailable=true effectiveDvMode=true ... dvVariant=profile5) Both play; the assertion line names the claim next to what was observed, so a wrong claim is legible in the same log as the rejection it produces. 15 tests. Full suite green on both runners (XCTest 606 with 1 skipped, swift-testing 2697 in 370 suites, exit 0) with the fixtures linked in. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_014tQ8MerNbZQdWBpDStitoD
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.
The Dolby Vision round from #493, and the tvOS half of #459, because both come down to the same gap: the engine derives "what is this display presenting" from a per-platform readout that macOS never had and that one tvOS 27 box has stopped answering.
What lands
LoadOptions.panelPresentsDolbyVision, a host assertion rather than an inferred capability.AVPlayer.availableHDRModesisAPI_UNAVAILABLE(macos), so a Mac has no per-mode table to read, and 6.69.0 filled the rest of it fromeligibleForHDRPlaybackwhile leaving DV unclaimed on purpose: eligibility proves EDR, not that AVFoundation will accept a DV variant on this display. The claim now belongs to whoever knows the hardware.It composes into the session capability table through
DisplayCapabilities.assertingDolbyVision, which the format clamp and the served route both take from one place, so the publishedvideoFormatand the DV signaling cannot disagree about the same display.supportsHDRrides along, because without it the asserted session would build a DV master for a routedisplaySupportsHDR == falsehad already sent media-direct, and a DV source through a bare media playlist is the HDR10 base layer, which is what the assertion exists to stop. HDR10 and HLG are not implied. An assertion only ever adds, sofalsecannot hide a capability the system reports.panelIsInHDRModebecomes an OR term over the criteria readout on every platform, instead of counting only where the host suppresses display criteria. Defaultfalse, so a host that asserts nothing is where it was, and the readout still decides whenever it can answer.The net is the one that already existed.
-11868and-11848are classified as master rejections andMasterFallbackDecisionreloads the media playlist once, in place, at the same position. A wrong assertion costs a reload, not the item.aetherctl play --assert-dvdrives the flag. The DV route was reachable from no macOS harness at all, which is how the reporter ended up A/B-ing a local patch instead of a session option.Measured
macOS 26.5, real DV P5 file (Dolby "Patterns of Nature" UHD), same command twice:
Both play. The assertion also prints itself next to what was observed, so a wrong claim is legible in the same log as the rejection it can produce:
Tests
15 new, covering the assertion table, what it changes about a source, the routing consequence, the panel-mode OR term and the option's correctability through
reloadAtCurrentPosition(applying:). One of them pins the measured correction from the #493 thread: the capability clamp returns early for anything that is not Dolby Vision, so it never touched a plain HDR10 or HLG source.Full suite green on both runners: XCTest 606 with 1 skipped, swift-testing 2697 in 370 suites, exit 0, fixtures linked in.
Part of #493 and #459; the reporters' own runs are what settle those.
🤖 Generated with Claude Code
https://claude.ai/code/session_014tQ8MerNbZQdWBpDStitoD