/texture-bridge:diagnosing-dead-frame-forwardsfrom texture-bridge
Diagnoses why forwarded frames stop arriving in a live-video pipeline — black previews, frozen multiviewers, or silent failures where Syphon/Spout output still works. Walks through the two signals (FrameForward.active and forwardStatus) that pinpoint the broken layer.
Ships in texture-bridge. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Forwarding is the one path in this library whose failure has no other symptom. Paint keeps firing, the native sender keeps sending, the preview window keeps updating, droppedReason stays null, and no "error" or "frameDropped" ever fires — while the forwarded target sits black. A silent log is the expected appearance of this bug, not evidence against it.
So do not open with a hypothesis. Two signals the library already publishes answer which layer in one repro; everything else is guessing at 30fps.
| # | Signal | Where | Answers |
|---|---|---|---|
| 1 | FrameForward.active | return value of forwardFrames(), read right after the call | Did the registration ever exist? |
| 2 | forwardStatus event / options.onStatus | bridge.on("forwardStatus", …), or per registration | Is it delivering, and since when is it not? |
const forward = bridge.forwardFrames(target, {
extraArgs: [slot], // tags every status with the slot
onStatus: (s) => log(`forward ${slot}`, s.ok ? "ok" : s.reason, s.ok ? "" : s.cause),
});
if (!forward.active) log(`forward ${slot} REFUSED — no frames will ever arrive`);
forwardStatus is deduped to transitions, so a plain log of every event is already the outage report: { ok: false } with no { ok: true } after it means that target has been dark since that timestamp.
Check the consumer's installed types, not the source you have checked out: if FrameForwardOptions has no onStatus (or FrameForward has no active), the app is pinned to a version that reports nothing. Upgrade — that IS the fix, not a prerequisite for one: on the old version this failure mode is undiagnosable by construction, and every substitute costs a repro cycle and hides the race (see below).
If the upgrade cannot land immediately, the surviving seams are coarse and none of them observe forwarding itself: bridge.on("frameDropped") / bridge.on("error") per source, and your own logging around every place you call forwardFrames() and dispose(). Absence of events there tells you almost nothing — which is exactly why the signals were added.
active | Status history | What it means | Where to look next |
|---|---|---|---|
false | none | Registration was refused — the bridge was disposed or the target already destroyed. The caller is holding a dead handle it believes is live | the call site: re-register against the current WebContents after a window is recreated |
true | nothing, ever | Paint never reached this entry | is the source painting at all? (see below) — then the registration's own lifecycle |
true → false | ends abruptly | The entry was pruned: target destroyed, dispose(), or the bridge disposed | whoever tore it down — an unpaired detach(), a rebuild that never re-added it |
true | ok, then nothing | The library is delivering. Stop looking at the bridge | the renderer: bindSharedTextureReceiver(sharedTexture) called (and not disposed)? consumer registered via receiver.consume? VideoFrame drawn? |
true | target-destroyed | Target died under the registration | re-register after the window is recreated |
true | import-failed / send-failed | GPU or IPC layer refused the frame; cause carries the error | the cause, then GPU/handle pressure |
OSR paint is damage-driven. A paused video, a static page, a stalled worker: zero paint, therefore zero forwards, and that is not a fault. Confirm the source is actually producing frames — the bridge's "fps" event, or a paint counter — before you conclude the forward path is broken. Skipping this check turns a paused deck into an afternoon of debugging a healthy pipeline.
The two look equally "dead" to a user and mean opposite things:
| Symptom | Meaning |
|---|---|
| Last frame frozen on screen | Frames stopped arriving; the consumer still holds its last VideoFrame. The break is upstream — source idle, or forwarding dead |
| Black / "no signal" / placeholder | The consumer discarded what it held and got nothing since. Something on the receiving side cleared its store; a still-live forward would refill it within a frame |
Ask which one the user actually sees. It splits the search space in half before you touch any code.
The failure is timing-sensitive. In a real investigation, adding logging around the paint path moved the reproduction rate from 3-in-5 launches to 0-in-22 — the probe hid the bug it was measuring. The published signals are safe to leave on permanently (deduped to transitions, nothing per frame), so wire those and reproduce, instead of adding a temporary probe to the paint loop.
| Mistake | Reality |
|---|---|
| "Nothing in the log, so forwarding is fine" | Forwarding never raises "error" and never touches "frameDropped" / droppedReason. A clean log is what this failure looks like |
| "Syphon/Spout output works, so the bridge is fine" | Native send and forwarding are independent paths in handlePaint. Either can die alone |
"forwardFrames() returned a handle, so it is registered" | A refused registration returns a handle too. Only active distinguishes them |
| "Frames stopped, so the library broke" | A paused or static source produces no paint. Check the source first |
Ranking hypotheses (backpressure, leaks, GPU pressure) before reading active + forwardStatus | Both signals already exist and are free. Guessing costs a repro cycle each |
Patching handlePaint to count in-flight promises | You are rebuilding, less accurately, the reporting the driver already does |
| Subscribing to nothing and calling forwarding "best-effort" | Best-effort means the stream survives failures, not that failures are invisible |
Building a substitute for forwardStatus because the pinned version lacks it | The upgrade is smaller than the substitute, and the substitute cannot see the forward path at all |
Reading the checked-out library source instead of the consumer's installed node_modules types | The repo you are reading and the version the app runs can differ by exactly the feature you are about to rely on |
managing-frame-forward-lifecycle — registration, teardown, and re-registration after a target window reopenshandling-texture-bridge-failures — which calls throw, reject, model a defect, or emitreceiving-shared-textures — the renderer half, once forwardStatus says ok and the canvas is still blackWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
frame-forwarding, video-pipeline, preview-debugging, syphon, spout
8 skills in this plugin
/choosing-texture-bridge-apiUse when deciding which @napolab/texture-bridge API tier to use for a feature — simple vs core, Syphon/Spout output vs in-app preview/monitor, forwardSharedTexture vs forwardFrames — when reviewing an integration plan that uses the library, or when unsure whether a texture-bridge function, method, or option actually exists./delivering-imported-texturesUse when delivering a GPU texture to a renderer from the Electron main process — about to call `sharedTexture.importSharedTexture` / `sendSharedTexture` / `release()` by hand, deciding where `release()` belongs, wrapping delivery in try/finally or neverthrow tees to guarantee exactly-once release, writing the same deliver-and-release dance in a second module, or delivering a texture you imported yourself from a receiver's native handle./handling-texture-bridge-failuresUse when adding error handling, telemetry, or crash-safety to code that uses @napolab/texture-bridge — deciding whether a call needs a try/catch or a Result.fromThrowable wrapper, reviewing the failure handling of a texture-bridge integration, defining error classes for bridge or receiver operations, or diagnosing silently black output or a main-process crash from a bridge call.npx claudepluginhub naporin0624/electron-texture-bridge --plugin texture-bridgeOther plugins' skills for the same job