Skip to content

fix(display): an accepted HDR master proves the panel for every engine in the process - #855

Merged
superuser404notfound merged 3 commits into
superuser404notfound:mainfrom
PieterVO:pr/fel-route-hdr-label
Oct 25, 2026
Merged

superuser404notfound merged 3 commits into
superuser404notfound:mainfrom
PieterVO:pr/fel-route-hdr-label

Conversation

@PieterVO

Copy link
Copy Markdown
Contributor

Summary

On a display whose EDR headroom never moves, the HDR / Dolby Vision label depends on AVFoundation accepting an HDR master, and that answer was neither remembered nor shared. A host that builds an engine per item lost it at every load, and the Dolby Vision FEL route (software host, no master to accept) labelled every session SDR while the TV showed Dolby Vision.

Refs #459, #588, #589, #667.

What changed

  • An accepted HDR master latches panelProvenToEngageHDR, the same proof a headroom reading latches.
  • The latch is process-wide, so it survives a host creating a new engine per title.
  • It is only trusted while AVPlayer.eligibleForHDRPlayback holds.
  • It is forgotten when the app leaves for the background, via one process-wide observer that works whether or not an engine is alive, and when a display refuses an HDR master (The master-refusal latch goes stale after an output-format change, and costs more than the master route #588's rule). Either can mean the output configuration changed.
  • New PanelHDRProofLifetimeTests; CHANGELOG (Unreleased › Fixed).

Test plan

  • macOS: swift test --filter "PanelHDRProofLifetime|DisplayCriteria|Issue459|Issue588|MasterFallback|PanelReadout": 126 tests pass. xcodebuild -scheme AetherEngine -destination 'generic/platform=tvOS' builds.
  • Apple TV 4K (1st generation), tvOS 26.6, Release build of a host app that creates an engine per title:
    • The headroom read 1.00 through every HDR and Dolby Vision session.
    • After a Profile 7 MEL title on the AVPlayer route (panel proven to engage HDR (AVFoundation accepted the HDR master)), the next title, a Profile 7 FEL on the software host, loaded with provenHDR=yes and kept its Dolby Vision label.
    • Before this change the FEL title logged playback probe: no HDR reading … keeps its SDR label.
    • The device run used an earlier revision that forgot the proof on foreground return inside each engine. The process-wide background observer in this PR has not run on a device.

Notes for review

  • Who this affects: every tvOS host, but only the label and the master-vs-media routing gate that already reads this proof. Nothing changes for a display whose headroom works.
  • Remaining false-positive window: an output change made without leaving the app, while eligibleForHDRPlayback stays true. The same window already existed for the per-engine latch.

Checklist

  • CHANGELOG updated
  • Conventional Commit message
  • Engine-side fix
  • Test added

Co-authored with Claude (Anthropic); the commit carries a Co-authored-by: Claude trailer.

…e in the process

A display whose EDR headroom never moves (Apple TV 4K 1st gen, tvOS 26.6: 1.00 through every HDR and Dolby Vision session) proves HDR only when AVFoundation accepts an HDR master. That proof now latches panelProvenToEngageHDR like a headroom reading, and the latch is process-wide, so a host that builds an engine per item and a software-host session (the Dolby Vision FEL route, which has no master to accept) keep the HDR / Dolby Vision label the panel shows. It is read only while AVPlayer.eligibleForHDRPlayback holds, and is forgotten when the app leaves for the background (a process-wide observer, independent of any engine) and on a refused HDR master (AE#588), since either can mean the output configuration changed.

Co-authored-by: Claude <[email protected]>
@PieterVO
PieterVO marked this pull request as ready for review October 22, 2026 22:02
@superuser404notfound
superuser404notfound merged commit fcfe3e7 into superuser404notfound:main Oct 25, 2026
@superuser404notfound

Copy link
Copy Markdown
Owner

Merged, thank you! Making the proof process-wide and letting an accepted HDR master latch it is the right fix for panels whose headroom never moves, and the tests plus the device trace made it easy to follow.

Two follow-ups landed on top in main:

  • 20a2272f clears the proof synchronously where the refusal latches. The didSet queued the clear in a Task, so the master-to-media fallback that runs right after it on the main actor could still read the proof and label the refused panel HDR.
  • 13275283 updates the proof's doc comment, which still said it was never cleared, and the residual-risk note above panelPresentsHDR.

One behaviour change worth knowing: hosts that keep a single engine for the whole process (Sodalite, AetherPlayer) used to keep a headroom-latched proof across a trip to the home screen. It is now forgotten there too. A panel whose headroom works latches it again at the next HDR transition. On a panel parked in HDR, a software-host or FEL title played right after returning reads SDR until an AVPlayer HDR title proves the panel again. That seems an acceptable trade against a stale HDR label after a Settings change, so it stays as is for now. A device run of the process-wide background observer would still be welcome.

It ships with the next engine release.

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.

2 participants