Repository navigation
Add the Tier 1 loopback benchmark with an emulated network (851-3593) - #904
Merged
pondorasti merged 2 commits intoOct 29, 2026
Conversation
`CodevisorBench loopback` streams the S1–S6 scenes through the product ScreenSharingSender and ScreenSharingReceiver (ScreenSharingProductProfile, the product field trials and the adaptive quality loop) in one process. The viewer renders through the product render coordinator and Metal encoder offscreen, or in a window with --onscreen. - An in-process UDP relay rewrites each peer's SDP to one host candidate on a relay socket. It forwards both directions through BenchRelayLink, which wraps the T1 BenchNetworkModel for N0–N7: seeded loss, delay, jitter, capacity and queue. Each peer socket gets its own mapping socket, like a NAT, so every ICE pair goes through the relay. - Sources: synthetic (BenchSceneGenerator, pushed on version change at 60 Hz) and own-window. The own-window source captures the player's window through the product ScreenSharingCapture, found with SCShareableContent.currentProcess. - Report v1 gains e2e_ms with e2e_endpoint (capture to committed, or on-glass), stages from the 851-3583 timeline, timing_frame_check (WebRTC timing frames matched to timeline frames), relay statistics with the first lost packet indices, codec_errors and bitrate from the relay. - Clock domains: timeline timestamps (mach absolute) are shifted to mach continuous once per scene before they're joined with the bench library. `.github/workflows/screen-sharing-bench-loopback.yml` (workflow_dispatch, pinned to tamale, concurrency group screen-sharing-bench) runs scripts/loopback.sh inside one job: back-to-back full matrices plus the own-window run, then uploads the reports. T3's calibration and the loopback share scripts/record-installed-commit.sh. Product code changes are access levels only (the Metal encoder, the capture's filter start and a statistics overload for extra fields), plus ScreenSharingTunnelSDP returning the candidate's port. Nothing in the product pipeline changes behaviour. Part of 851-3593 Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Drain each scene until the relay has delivered everything it holds (up to 5 s), so slow links don't lose the tail of the window. - Count relay send failures in the report (`send_failures`). - Adapt the source before the sender, close the sender if the receiver can't be created, and pre-render only the ticks that will be shown. - Check --output and --frames before the matrix runs. Part of 851-3593 Co-Authored-By: Claude Opus 5.5 <[email protected]>
pondorasti
deleted the
alexandru/851-3593-screen-sharing-v2-t4-tier-1-in-process-loopback-benchmark
branch
October 29, 2026 06:09
pondorasti
added a commit
that referenced
this pull request
Oct 29, 2026
…93) (#905) #895 added `presentsWindows` to BenchCommand while #904 was in review, so LoopbackCommand no longer conformed once both landed. Loopback presents windows with --onscreen or the own-window source. Also schedule the barcode verifier's drain from a method, so the tap callback doesn't capture a weak self var across queues. Part of 851-3593 Co-authored-by: Claude Opus 5.5 <[email protected]>
dylanplayer
added a commit
that referenced
this pull request
Oct 29, 2026
Since #904, CodevisorBench links ScreenSharingWebRTC, so its test bundle needs WebRTC.framework at runtime. Without the @loader_path/../../.. rpath that the other WebRTC test targets carry, the bundle failed to dlopen and swift:test (and so the pre-commit hook) failed on every machine. CI's Build doesn't run Swift package tests, so main stayed green. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 29, 2026
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.
Part of 851-3593
Summary
Adds
CodevisorBench loopback, the Tier 1 benchmark from the design (§4.2). It streams the S1–S6 scenes through the productScreenSharingSenderandScreenSharingReceiverin one process, over an in-process UDP relay that emulates N0–N7, and writes report v1.ScreenSharingProductProfilefrom Share one screen sharing product profile between the host and the bench (851-3593) #894, the product field trials and the adaptive quality loop. The viewer renders through the product render coordinator and Metal encoder into an offscreen texture. With--onscreen, the productScreenSharingMetalViewshows it in a window.ScreenSharingTunnelSDP. Both directions go throughBenchRelayLink, which wraps the T1BenchNetworkModel(seeded loss, delay, jitter, capacity, queue). Each peer socket gets its own mapping socket, like a NAT, so every ICE pair goes through the relay. The report records the first lost packet indices per direction.synthetic:BenchSceneGeneratoron a 60 Hz tick, pushed only when the version changes, rendering up to three ticks ahead.own-window: the player window, captured by the productScreenSharingCaptureviaSCShareableContent.currentProcess.ScreenSharingBench):e2e_msande2e_endpoint(capture → committed, or on-glass);stages_msfrom the 851-3583 timeline;timing_frame_check: WebRTC timing frames matched to timeline frames by capture time;relaystatistics;codec_errors;.github/workflows/screen-sharing-bench-loopback.ymlis aworkflow_dispatchjob pinned to tamale, in concurrency groupscreen-sharing-bench. It runsscripts/loopback.sh: back-to-back full matrices plus the own-window run, then uploads the reports. It has to be onmainbefore it can be dispatched, which is why this PR lands before the acceptance runs. The results go on 851-3593 and in the final PR.Product changes are access levels only:
TextureFrameand the shader becomepackage;ScreenSharingCapture.start(filter:);ScreenSharingPeer.statistics(including:), sogoogTimingFrameInfocan be read;BenchUDPAddresssockaddr access.ScreenSharingTunnelSDPalso gainslocalIPv4Candidate, which returns the candidate's port. No behaviour or performance changes in the product pipeline.Checks
Swift tests:
BenchRelayLinkTests,BenchLoopbackAnalysisTestsandBenchTimingFrameCheckTests;ScreenSharingBenchTests(61),CodevisorBenchTests,ScreenSharingTunnelSDPTestsandScreenSharingProductProfileTestspass.The pre-commit
bun run checkpassed on both commits. Earlier attempts failed inScreenSharingCodecRoundTripTests/ScreenSharingEncoderRateControlTestswithCreate encoder (-12903), because another agent's stress run held the hardware encoders; they passed once those runs finished.code-reviewat level high, twice. I fixed:BenchUDPAddressandScreenSharingTunnelSDP;I'm leaving three:
RelaySocketstays separate from the blocking probe socket;spotlight_busyisn't measured yet, which is T5's preflight (C5).Smoke runs on tamale over SSH were for development only. Acceptance numbers come from the workflow.
🤖 Generated with Claude Code