Repository navigation
fix(routing): fail fast when IPT-only DV reaches the software path (#176) - #183
Merged
Merged
Conversation
) Follow-up to the P5 probe exemption: AV1 Profile 10.0 (compat 0) has the same IPT-PQ-c2-only signal as HEVC P5 and no compatible base layer, but without HW AV1 decode it routes to dav1d, where the IPT signal decodes as YCbCr with the same green/purple cast. Unlike P5 there is no native fallback (AVPlayer HLS requires HW AV1), so playing it can never be color-correct. The dispatch now consults softwarePathCannotRepresent after the final routing decision and fails the load with a clear error (AetherEngineError.dolbyVisionUnplayableOnSoftwarePath) instead of starting a wrong-color session. This also closes the remaining P5 doors into the software path (forward-only sources, test override). P7/P8.x and AV1 P10.1/2/4 stay software-eligible; their base layer decodes with correct color. New public error case: minor version bump. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NAPCg4tCDdSqkK6tPkNptw
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.
Follow-up to #182 (the P5 VT-probe exemption). Part of the #176 cleanup.
Problem
AV1 DV Profile 10.0 (compat 0) carries the same IPT-PQ-c2-only signal as HEVC P5: no HDR10/HLG/SDR-compatible base layer. On devices without hardware AV1 decode (all Apple TVs, M1/M2 Macs, pre-A17 iPhones),
requiresSoftwarePathroutes AV1 to the software host, where dav1d's output is treated as YCbCr and renders with the same green/purple cast reported in #176. Unlike HEVC P5 there is no native fallback to prefer: AVPlayer's HLS pipeline requires HW AV1 (VTIsHardwareDecodeSupportedgate), so no route on such devices can render P10.0 with correct color.HEVC P5 also retained two remaining doors into the software path after #182: forward-only sources (which the native path cannot serve) and the test override.
Fix
A new pure policy check,
VideoRoutingPolicy.softwarePathCannotRepresent(codecID:dvProfile:dvBlCompatID:), is consulted in the dispatch after the final routing decision. When IPT-only DV (HEVC P5, AV1 P10.0) would start on the software path, the load fails fast with a new public error (AetherEngineError.dolbyVisionUnplayableOnSoftwarePath) and a clear player-state message instead of starting a session that can only render wrong color. P7 / P8.x and AV1 P10.1 / P10.2 / P10.4 stay software-eligible; their base layer is self-contained and decodes with correct color.New public error case, so this releases as a minor bump (5.18.0).
Verification
VideoRoutingPolicyTestscases: P10.0 unrepresentable, P10.1/2/4 eligible, P5 unrepresentable, P7/P8/non-DV eligible, non-DV-capable codecs never trip. 904/904 tests pass.swift build -Xswiftc -strict-concurrency=completeclean.xcodebuildclean.🤖 Generated with Claude Code
https://claude.ai/code/session_01NAPCg4tCDdSqkK6tPkNptw