Skip to content

fix(browser): prepare actual SHM arrivals off Program (#802) - #816

Merged
iamfatness merged 2 commits into
mainfrom
codex/browser-cpu-preparation-802
Oct 7, 2026
Merged

iamfatness merged 2 commits into
mainfrom
codex/browser-cpu-preparation-802

Conversation

@iamfatness

@iamfatness iamfatness commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Refs #802.

Browser source SHM mapping/full BGRA copies previously ran on the render tick. With CPU preparation enabled, one bounded reader now owns mapping, seqlock copying and preparation outside the metadata lock; Program collects immutable descriptors/tokens. Each actual host spawn gets a unique SHM name and source epoch. Retained old mappings cannot collide with restarted hosts or publish into removed/replaced sources. Held-token refresh preserves CPU bytes and observation/frame identity. Original CPU/ISO representation and preparation-off behavior remain available; defaults remain off.

Actual opt-in WebView2/SHM pixels matched an independent CPU-upload compositor, with zero Program uploads/scratch uploads/texture creation. Host frames arrived before render polling; consumer recreation, blocked-reader polling and removal with a retained in-flight reader passed. The initial known-color test failed on WebView2's startup blank frame; that FAIL is retained and the corrected test waits for its independently specified page colors.

Real 1920x1080@60-requested browser trials, 1080p60 Program, isolation on and unchanged two-frame buffer: preparation on delivered 7,189 measured packets with zero buffer loss and one absorbed render overrun; control off delivered 7,192 with zero buffer loss and four absorbed overruns. Mean Program work was 0.363 ms prepared versus 2.841 ms control. Both sampled input/host progress checks passed, as did prepared-source GPU admission. Sampled selection age was median/p95 0 ms, max 47.9 ms; control has no comparable GPU source-identity age evidence. This is not per-frame host acquisition or capture-to-presentation latency qualification.

All 1,497 native tests pass on the frozen native tree; all 17 final-head CI checks on b684def pass (the build-tool installation stall was cancelled and its sanitizer job successfully retried). Native tree a5424be613f95f460c13b237bf750769b9f23431 is unchanged by rebasing onto merged #815; original trial commit c93cf51 is preserved locally. No installed beta, default change, receiver/display/A/V/fleet qualification or parent closure is included. NDI/SRT/RTMP CPU preparation, device recovery and #517 qualification remain open.

@iamfatness
iamfatness marked this pull request as ready for review October 7, 2026 21:01
@iamfatness
iamfatness merged commit 8022624 into main Oct 7, 2026
28 of 29 checks passed
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