Repository navigation
fix(video): guard mobile supplemental decoder declarations - #900
Conversation
There was a problem hiding this comment.
Automated review
The PR wraps the two VTRegisterSupplementalVideoDecoderIfAvailable calls in #if os(macOS) || compiler(>=6.2.3), so the mobile targets can compile against the Xcode 26.0 and 26.1 SDKs. The guard looks correct as written. The bigger question is whether the project wants this at all: the README requires Xcode 27 / Swift 6.4, says the source needs at least the 26.2 SDK, and CI deliberately tests only Xcode 27. That call belongs to the maintainer.
Findings
- Should fix: The PR lowers a floor the project does not support or test, and it leaves
README.md:654saying the opposite ("The source needs at least the 26.2 SDK in any case ... an unguarded C symbol has to exist at compile time").ci.ymlrecords that Swift 6.2 timed out type-checking code in this repo, and that 6.4 and 6.3 disagree on isolation. Nothing shows the rest of the package builds on Xcode 26.0/26.1, and the PR body says those SDKs were not tried. If this is accepted, the README Requirements section should state the real floor, and that floor should be one some lane has actually built. (Sources/AetherEngine/Video/VTCapabilityProbe.swift:14) - Should fix: The new paragraph in
docs/architecture.mdsits at the top of the file, before "Playback pipelines". It is a toolchain requirement, not architecture, and it duplicates (and contradicts) the README Requirements note. It would fit better as an edit toREADME.md:654. (docs/architecture.md:5) - Nit:
compiler(>=6.2.3)uses the compiler version as a stand-in for the SDK version. A newer swift.org toolchain used with an Xcode 26.1 SDK would pass the check and still fail to compile. That is probably acceptable, but the comment could say it is a proxy. (Sources/AetherEngine/Decoder/HardwareVideoDecoder.swift:312)
Checklist: CHANGELOG yes, docs yes (but README not reconciled), tests n.a. (compile-time guard, the CI toolchain takes the unchanged path), traits both ways n.a.
Needs a device run: nothing beyond CI on Xcode 27. A build with Xcode 26.0/26.1 for iOS/tvOS would be needed to show the claim holds, and CI does not run one. With such a build, a tvOS 26.2+ device would never register the supplemental AV1/VP9 decoders and would always route those codecs to software. That matches the PR's stated intent.
Thanks for the careful write-up of what you did and did not validate.
Automated review by Claude of 2f92bbc. It reads the code, it does not build or run it; a maintainer reviews and merges.
| static let av1Available: Bool = { | ||
| // Mobile SDKs first declare this function in Xcode 26.2 (Swift 6.2.3). | ||
| // Older SDKs still query hardware support and keep the normal software fallback. | ||
| #if os(macOS) || compiler(>=6.2.3) |
There was a problem hiding this comment.
The guard itself is fine. But README.md:654 still says the source needs at least the 26.2 SDK and that the symbol has to exist at compile time. CI only builds Xcode 27, and ci.yml notes Swift 6.2 failing on this repo for unrelated reasons (a type-checking timeout in tests). So nothing shows the package builds on Xcode 26.0/26.1 after this change. If the maintainer wants to support those SDKs, the README Requirements section should be updated in the same PR, and ideally some lane should build it. Otherwise the floor stays at 26.2 and this guard isn't needed.
|
|
||
| How AetherEngine is put together: the three playback pipelines, the source-file map, and the dependency surface. For the public API and integration, see the [README](../README.md); for format and codec depth, [docs/formats.md](formats.md). | ||
|
|
||
| Mobile supplemental AV1/VP9 registration requires the Xcode 26.2 SDKs (bundled Swift 6.2.3) |
There was a problem hiding this comment.
This paragraph is a toolchain requirement placed ahead of "Playback pipelines" in the architecture doc, and it duplicates the README Requirements note at README.md:654 while contradicting it. Suggest dropping it here and editing the README line instead, so the minimum SDK lives in one place.
| if codecpar.pointee.codec_id == AV_CODEC_ID_VP9 { | ||
| // Mobile SDKs first declare this function in Xcode 26.2 (Swift 6.2.3). | ||
| // Older SDKs still query hardware support and keep the normal software fallback. | ||
| #if os(macOS) || compiler(>=6.2.3) |
There was a problem hiding this comment.
Nit: compiler(>=6.2.3) stands in for the SDK version. It holds for stock Xcode bundles. A newer swift.org toolchain used with an Xcode 26.1 SDK would pass this check and still fail on the missing symbol. Worth a few words in the comment saying it is a proxy.
There was a problem hiding this comment.
🔵 Needs a closer look
Compilation with the targeted Xcode 26.0/26.1 mobile SDKs remains unverified and needs confirmation before approval.
No open issues 🎉
What changed in this PR
This PR adds compile-time guards around AetherEngine’s supplemental AV1/VP9 decoder registration to support older mobile SDKs without changing capability queries or software fallback.
Changes:
- Gate mobile registration calls on Swift compiler version 6.2.3 or newer while preserving the existing macOS path.
- Document the SDK requirement and compatibility fix in the architecture guide and changelog.
| File | Description |
|---|---|
| Sources/AetherEngine/Video/VTCapabilityProbe.swift | Guards supplemental AV1 registration while retaining hardware detection. |
| Sources/AetherEngine/Decoder/HardwareVideoDecoder.swift | Guards supplemental VP9 registration while retaining the hardware availability check. |
| docs/architecture.md | Explains compile-time gating and preserved fallback behavior. |
| CHANGELOG.md | Records the older mobile SDK compatibility fix. |
Review effort: Balanced
There was a problem hiding this comment.
Automated review
The PR guards the two VTRegisterSupplementalVideoDecoderIfAvailable calls with #if os(macOS) || compiler(>=6.2.3) so that stock Xcode 26.0/26.1 mobile SDKs skip registration. Capability queries and the software fallback stay outside the guard. Since my last review, all three earlier findings are fixed:
- The README Requirements note now says the opposite of nothing: it states that Xcode 27 / Swift 6.4 is the only supported toolchain and that this guard does not lower that floor.
- The paragraph in
docs/architecture.mdis gone. - Both code comments now say the compiler version stands in for the SDK version.
One question is still open and belongs to the maintainer: does the project want to carry a guard for a toolchain it says it does not support?
Findings
- No new findings. I re-checked the guards against the base sources. Only the two engine call sites existed. The unguarded call in
Tests/AetherEngineTests/ActiveVideoDecoderTests.swift:64runs under macOSswift test, which this PR does not change.testToolchainRowsAreTheOnesCITestsWithstill finds| Xcode | 27.0 |and| Swift | 6.4 |.
Checklist: CHANGELOG yes, docs yes, tests n.a. (compile-time guard; the CI toolchain still compiles the registration path), traits both ways n.a.
Needs a device run: nothing beyond CI on Xcode 27. A claim about Xcode 26.0/26.1 needs a build with those SDKs, and no CI lane runs one.
Thanks for working through the earlier points so carefully.
Automated review by Claude of 75aef0a. It reads the code, it does not build or run it; a maintainer reviews and merges.
75aef0a to
42c43f4
Compare
There was a problem hiding this comment.
Automated review
I checked the new head 42c43f4. Nothing my review covers has changed since 75aef0a: the two guarded call sites, the README Requirements note and the CHANGELOG entry under [Unreleased] match what I reviewed then, so I have no new findings. One question is still open for the maintainer: whether the project wants to carry a guard for a toolchain it does not support.
Automated review by Quint (Claude) of 42c43f4. It reads the code, it does not build or run it; a maintainer reviews and merges.
e2cded0
into
superuser404notfound:main
|
Merged into main ( The guard is small and keeps the capability queries and the software fallback outside it, so the supported Xcode 27 path compiles exactly as before; full suite green (XCTest 800 + 17, Swift Testing 5129) and a final review found nothing. One follow-up on my side: main had moved past 7.48.0, so the CHANGELOG entry ended up under the released 7.48.0 section after the merge. It now sits under |
The two supplemental AV1/VP9 registration calls now have a narrow compile-time guard for the declaration first exposed by the stock Xcode 26.2 mobile SDKs. Capability queries and software fallback remain outside the guard, and the macOS path is unchanged.
The supported and tested requirement remains Xcode 27 / Swift 6.4. This does not claim the package supports or builds with older toolchains. README Requirements now owns the explanation, including that
compiler(>=6.2.3)is an SDK proxy for stock Xcode bundles and does not cover a newer custom Swift compiler paired with an older SDK.Validation: 27 Swift Testing capability/decoder-selection tests and 27 XCTest public API/documented-constant tests passed on the original implementation, with warnings as errors on Xcode 27.1 / Swift 6.4. Those focused tests used #899 and a temporary test-source allowlist because unrelated upstream tests fail warnings-as-errors compilation; neither validation overlay is in this PR. After the documentation-only follow-up, all 27 documentation tests were rerun against the updated files and passed, along with documentation links and diff checks. Xcode 26.0/26.1 builds remain unverified.