Skip to content

fix(routing): fail fast when IPT-only DV reaches the software path (#176) - #183

Merged
superuser404notfound merged 1 commit into
mainfrom
fix/176-av1-p10-ipt-software-gate
Jul 21, 2026
Merged

superuser404notfound merged 1 commit into
mainfrom
fix/176-av1-p10-ipt-software-gate

Conversation

@superuser404notfound

Copy link
Copy Markdown
Owner

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), requiresSoftwarePath routes 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 (VTIsHardwareDecodeSupported gate), 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

  • New VideoRoutingPolicyTests cases: 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=complete clean.
  • tvOS Simulator xcodebuild clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NAPCg4tCDdSqkK6tPkNptw

)

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
@superuser404notfound
superuser404notfound merged commit 01b8033 into main Jul 21, 2026
3 checks passed
@superuser404notfound
superuser404notfound deleted the fix/176-av1-p10-ipt-software-gate branch July 21, 2026 16:39
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