Skip to content

feat(display): the host asserts what the engine cannot observe (#493, #459) - #505

Merged
superuser404notfound merged 1 commit into
mainfrom
feat/ae493-dv-host-assertion
Sep 6, 2026
Merged

superuser404notfound merged 1 commit into
mainfrom
feat/ae493-dv-host-assertion

Conversation

@superuser404notfound

Copy link
Copy Markdown
Owner

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.availableHDRModes is API_UNAVAILABLE(macos), so a Mac has no per-mode table to read, and 6.69.0 filled the rest of it from eligibleForHDRPlayback while 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 published videoFormat and the DV signaling cannot disagree about the same display. supportsHDR rides along, because without it the asserted session would build a DV master for a route displaySupportsHDR == false had 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, so false cannot hide a capability the system reports.

panelIsInHDRMode becomes an OR term over the criteria readout on every platform, instead of counting only where the host suppresses display criteria. Default false, 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. -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. 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:

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 also prints itself next to what was observed, so a wrong claim is legible in the same log as the rejection it can produce:

[DisplayCriteria] host assertion in force: panelIsInHDRMode=false panelPresentsDolbyVision=true (observed: panelReadout=suppressed supportsDolbyVision=false)

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

…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
@superuser404notfound
superuser404notfound merged commit 8263c38 into main Sep 6, 2026
5 checks passed
@superuser404notfound
superuser404notfound deleted the feat/ae493-dv-host-assertion branch September 6, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant