Conversation
…e placeholder flashes on scene switches Owner-reported (third round of "those colors"): switching camera <-> screen+camera sometimes flashed a blocky orange pattern over the screen region of the live output. Root cause, finally unified: the "colors" were never buffer corruption — they are the compositor's animated missing-source placeholders (missing_source_placeholder_bgra: accent BGRA [0,160,255] = ORANGE for screen/window, [255,0,255] = MAGENTA for camera; a 64px texture whose border + marching diagonal scale up into exactly the blocky pattern in the owner's screenshots). Why they showed: CompositorLiveSources cleared its held last frame whenever a source slot went EMPTY — and a slot goes empty during every stop/restart interval (camera geometry restarts; the screen source is retired on camera-only and restarted on the way back). The warm gate does wait for real frame evidence before committing, but the render loop re-adopts sources via try-lock and can lag by several ticks — and with the held frame thrown away, those ticks rendered the placeholder straight into the preview, the stream, and the recording. This defeated the documented "the compositor holds the last frame across the restart" contract and explains the earlier magenta episodes too. Fix: adopt_camera_source/adopt_screen_source remember the key of the source that produced the held frame. An empty slot HOLDS the frame (the bridge picture); only a source with a genuinely DIFFERENT key drops it (switching displays never shows the old display's picture). The missing-source placeholder still renders for sources that never delivered a frame — it remains an honest diagnostic, just never a transient flash. Camera staleness semantics are unchanged (frames past the cutoff still refuse to render or count as barrier evidence). Tests: two new unit tests pin the hold contract (empty slot holds across the interval + same-key restart keeps the bridge; a different display key drops it). Test-only frame-source constructors added. Gates: cargo 1513 + clippy + fmt; smoke:recording-matrix 12/12; smoke:live-layout-switch-recording PASS (transitions on). (smoke:layout-source-loop fails identically on clean main — pre-existing, verified via stash.)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe compositor now tracks camera and screen source keys. It retains the last frame during temporary source unavailability and same-key restarts. It clears the held frame when a different source key appears. Test-only constructors support regression coverage without live source slots. ChangesSource frame retention
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The change preserves the last real frame across source restarts while dropping frames from different devices, preventing transient placeholders during switches; no actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant SourceSlot
participant Compositor
participant CompositorLiveSources
participant FrameStore
SourceSlot->>Compositor: report source key or empty slot
Compositor->>CompositorLiveSources: adopt camera or screen source
CompositorLiveSources->>FrameStore: retain frame for empty or same-key source
CompositorLiveSources->>FrameStore: clear frame for different source key
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The orange flash (owner screenshots, camera ↔ screen+camera)
The "colors" are finally identified — all three rounds of them. They were never buffer corruption: they're the compositor's own missing-source placeholders.
missing_source_placeholder_bgrapaints a 64px dark texture with an accent border + marching diagonal — accent BGRA[0,160,255]= orange for Screen/Window,[255,0,255]= magenta for Camera. Scaled to canvas size, that's exactly the blocky orange staircase in the owner's screenshots (and the magenta band from the 0.9.63 report).Why it flashed on switches
CompositorLiveSourcescleared its held last frame whenever a source slot went empty — and a slot goes empty during every stop/restart interval: the screen source is retired while in camera-only and restarted on the way back; the camera slot empties during geometry restarts. The warm gate genuinely waits for frame evidence before committing the scene, but the render loop re-adopts sources via try-lock and can lag several ticks behind the commit. With the held frame already thrown away, those ticks rendered the placeholder into the preview, stream, and recording. This silently defeated the documented contract — "the compositor holds the last frame across the restart, so the swap is a brief hold, not a blank slot" — and retroactively explains the magenta camera episodes too.Fix
adopt_camera_source/adopt_screen_sourcenow remember the key of the source that produced the held frame:Gates
cargo test: 1513 pass (2 new tests pin the hold contract: empty-slot hold + same-key restart keeps the bridge; different-key drops)-D warnings·fmt --check: cleansmoke:recording-matrix: 12/12 ·smoke:live-layout-switch-recording(transitions on): PASSsmoke:layout-source-loopfails identically on clean main (verified via stash) — pre-existing, tracked separately.Owner acceptance
Switch camera ↔ screen+camera repeatedly (motion on and off, idle and while recording): the screen region must always show a real desktop picture — worst case a briefly frozen one — never the orange pattern; the camera must never flash magenta.
Summary by CodeRabbit
Bug Fixes
Tests