Repository navigation
feat(mac-o4): publish encode path and gpu-direct-stream-encode; Mac GPU stream gates (Phase 4 Task 6) - #1256
Merged
Merged
Conversation
iamfatness
force-pushed
the
mac-outputs-phase4-o4e
branch
from
November 26, 2026 17:57
d2694ee to
8d3765a
Compare
iamfatness
force-pushed
the
mac-outputs-phase4-o4d
branch
from
November 26, 2026 17:57
7311762 to
5ae42da
Compare
iamfatness
force-pushed
the
mac-outputs-phase4-o4e
branch
from
November 26, 2026 19:17
8d3765a to
a53774e
Compare
iamfatness
force-pushed
the
mac-outputs-phase4-o4d
branch
from
November 26, 2026 19:17
5ae42da to
67200f1
Compare
iamfatness
force-pushed
the
mac-outputs-phase4-o4e
branch
from
November 26, 2026 20:18
a53774e to
a1c607b
Compare
iamfatness
force-pushed
the
mac-outputs-phase4-o4d
branch
from
November 26, 2026 20:18
67200f1 to
6d8fa28
Compare
Phase 4 Task 6 (O4e).
- Sender rows carry encodePath {path, reason, codec}: null until a start
decides it, the STARTED path (a failed GPU encoder start reads
cpu-fallback/encoder-start-failed), published before admission, and
reset at every start so a refused restart never shows the old path.
- Capability gpu-direct-stream-encode: available (videotoolbox /
media-foundation) only with a platform GPU encoder AND a compositor that
exports the encoder texture (ICompositor::supportsEncoderTextureExport).
- VideoToolbox prints the MF encoder's "[gpu-encode] started" line.
- validate-gpu-encode.mjs runs on the Mac: --build-dir, --ffmpeg-bin-dir
(the bundled LGPL sender), a POSIX census that matches the executable
(not the child guard carrying its argv), and --force-raw fails when the
raw stream stops delivering.
- mac-show-drill.py --stream-srt PORT: a re-armed SRT receiver, the core's
srt destination at 1080p60, and a verdict (GPU-direct, 1920x1080, >= 58 fps).
Mutations M6a, M6a', M6b, M6c, M6d each red. Full native suite: 2350 passed.
Functional runs on a loaded Mac: h264 1080p60 PASS 58.4 fps; slow sink
PASS with 1 encoder build; drill stream 1 sender start, 20.8 s received.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
iamfatness
force-pushed
the
mac-outputs-phase4-o4e
branch
from
November 26, 2026 20:53
a1c607b to
b7e168b
Compare
iamfatness
marked this pull request as ready for review
November 26, 2026 21:41
iamfatness
pushed a commit
that referenced
this pull request
Nov 26, 2026
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> # Conflicts: # mac-shell/Sources/CoreVideoProShell/ShellTests.swift
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.
2026-11-26: rebased onto
main103604c0(after #1250, its base, merged) and force-pushed, so CI runs. The rebase was clean.2026-11-26: replayed onto the rebased #1250 and force-pushed. No conflicts.
2026-11-26: replayed onto the updated #1250 and force-pushed. No conflicts.
2026-11-26: replayed onto the rebased #1250 and force-pushed. No conflicts. Because it now includes #1255,
--force-rawis expected to pass on this stack.Phase 4 Task 6 (O4e) of the Mac parity plan (
docs/superpowers/plans/2026-11-22-mac-outputs-ingest-browser-phase4.md). Stacked on #1250 (O4d); merge order is #1245 → #1248 → #1250 → this.What it adds
encodePath {path, reason, codec}on every sender row. It is JSONnulluntil a start decides it, and it reports the path the start took:cpu-fallback/encoder-start-failed;gpu-direct-stream-encode. It isavailable(detailvideotoolbox/media-foundation) only when the build has a platform GPU encoder and the compositor exports the encoder texture (ICompositor::supportsEncoderTextureExport: Metal and D3D11). Otherwise it isomittedwith the reason. Task 7's 60 fps and H.265 pickers read it. It is added toProtocol.h, and ContractParity is green.[gpu-encode] startedline. The slow-sink gate counts these lines to prove the encoder was never rebuilt.validate-gpu-encode.mjsruns on the Mac.--build-dir native/build-metal.--ffmpeg-bin-dir: the bundled LGPL ffmpeg for the sender. Homebrew's is used for the receiver only.corevideo-child-guard, whose argv carries the ffmpeg command line.--force-rawnow fails when the raw stream stops delivering. It used to print PASS on about 11 KB.mac-show-drill.py --stream-srt PORT. An SRT receiver, re-armed per connection, plus the core'ssrtdestination at 1080p60 for the whole drill. The verdict checks the GPU-direct path, 1920x1080, at least 58 fps, and the number of sender starts.Found by running the gates end to end
-f aac -i pipe:0input. Fixed on macOS Phase 4 slice 7: AudioToolbox shared AAC; one-clock TS mux on POSIX (O4d) #1250 (its own commit, test, and mutation M5e).main: fix(mac-stream): raw-fallback stream wedges after #1234; never trial-encode a single encoder candidate #1255. This branch does not include that fix, so--force-rawhere fails until fix(mac-stream): raw-fallback stream wedges after #1234; never trial-encode a single encoder candidate #1255 merges and the stack is rebased.Tests and mutations
Tests:
OutputSenderAdapter.PublishesTheChosenEncodePath…AnEncoderThatFailsToStartPublishesTheFallback…ARefusedRestartDoesNotKeepThePreviousPathMediaCoreCommand.OutputSenderRowsPublishTheEncodePathMediaCore.AdvertisesGpuDirectStreamEncodeMutations (all red):
availablewithout the exportFull native suite: 2350 passed, 0 failed.
Independent review: three findings fixed (stale path, the drill listener race and leak, two script crashes). The details are in the outcomes doc.
Functional runs (loaded machine, not the gate numbers)
--slow-sink 0.85--burst-sink--stream-srtOwed on a quiet machine: plan Task 6 Step 3, items 1–6.
Candidate issue: on POSIX the raw path writes Program PCM to a blocking pipe on the same worker as the video.
🤖 Generated with Claude Code