Repository navigation
Description
Difficulty: easy — good first issue (~2–3 hours, CPU-only, no GPU, no third-party plugin)
Background
Oak Video Editor is a professional non-linear video editor; Quercus is its editing
engine. OpenFX (OFX) is the cross-editor plugin standard that editors such as
DaVinci Resolve and Natron support, and thousands of third-party plugins ship
against it. Quercus implements the OFX host side in
crates/quercus-ofx-plugin.
A plugin instance is created once and reused across frames. Before every render,
the driver attaches the input textures the job provides — render_frame step 3,
src/render_driver.rs:255:
for clip in &inst.clips {
if clip.name == "Output" {
continue;
}
if let Some(tex) = pick_input(&clip.name, job) {
if usable(&tex) {
clip.set_input_texture(Some(tex), job.time);
}
}
}The "no input this job" case is silently skipped. For an optional mask that the
user just disconnected, the clip therefore keeps the previous job's texture
and keeps OfxImageClipPropConnected = 1 — see
ClipInstance::set_input_texture,
which only ever runs on the Some path. ClipInstance::fetch_image
(src/clip.rs:251)
reads the stored texture and never consults Connected, so the plugin's
clipGetImage really does hand back last frame's mask.
The GL zero-copy path in the same file already clears its per-job state
(set_input_gl_texture(None) at src/render_driver.rs:640 and :662); the CPU
texture path is the one that was forgotten.
This is the host-side defect tracked by the mask issue
#5; it is
independent of the fixture work in
#3.
What the ask is
Make the per-job input state describe the current job instead of the previous
one: for every non-Output clip, attach the resolved texture when the job
provides one and clear the clip when it does not.
A straightforward shape:
for clip in &inst.clips {
if clip.name == "Output" {
continue;
}
let input = pick_input(&clip.name, job).filter(usable);
clip.set_input_texture(input, job.time);
}Keep pick_input and usable as they are. Step 6 (src/render_driver.rs:315,
region-of-definition and pixel format) already guards on the input being present;
leave that behavior alone unless the fix genuinely requires it.
Tests to add
In src/render_driver/tests.rs, next to render_frame_identity_passthrough
(the file already has make_instance, job, f32_texture and first_pixel
helpers, and the fake test_entry plugin, so no real plugin or GPU is needed):
- Build an instance with clips
&["Source", "Matte", "Output"]. Render once
withjob.srcset andjob.inputs = vec![("Matte".into(), mask)];
assert theMatteclip reportsPROP_CLIP_CONNECTED == 1and
input_texture_value().is_some(). - Render a second time on the same instance with
job.inputsempty.
AssertMattenow reportsPROP_CLIP_CONNECTED == 0,
input_texture_value().is_none(), and
fetch_image(0.0, RenderScale { x: 1.0, y: 1.0 }, None)returns
Error::NotFound. - In the same second render, assert the
Sourceclip is still attached, so the
fix cannot be "clear everything".
Both renders must return Ok — the test entry point accepts them.
Acceptance criteria
- A render job that omits a previously connected input leaves that clip
disconnected:OfxImageClipPropConnected = 0and no stored texture. fetch_imageon such a clip returnsError::NotFoundinstead of stale
pixels.- Clips the job does provide behave exactly as before; the existing
render_driverandnode_e2etests pass unchanged. cargo test -p quercus-ofx-pluginpasses,cargo fmt --allis applied, and
the change stays insidecrates/quercus-ofx-plugin.
Out of scope
- The optional-mask fixture itself: [OFX][TWiR] Add optional-mask fixture and clip connection lifecycle tests #3.
- End-to-end masked/unmasked pixel comparisons: separate follow-up.
- GL/GPU clip state: the zero-copy path already clears it.
How to run
From the workspace root:
tooling/install-deps.sh
tooling/ffmpeg/build-ffmpeg.sh --shared
cargo test -p quercus-ofx-pluginbuild.rs compiles the C fixture and the C shims automatically; the first build
takes a few minutes. Filter the new test with
cargo test -p quercus-ofx-plugin render_driver.
Mentoring
A maintainer can pair on the test scaffolding and review the change;
comment here to claim the issue and you will be assigned.
Contributing
Quercus follows Oak's CONTRIBUTING.md
and Code Style Guide.
In short: format with cargo fmt --all, keep the change focused (no new
dependencies, no unrelated refactors), propagate errors instead of silently
falling back, and run the tests for the files you change.
Contributions are accepted under the
Contributor License Agreement
(inbound = outbound, GPL-3.0-or-later; no copyright transfer).
Activity
Mike-Solar commentedon Nov 21, 2026
Reproduction (confirmed on
main@0f7205e, after the mask fixture from #3/PR #12 landed)No third-party plugin or GPU needed — the in-tree fixture
org.quercus.test-plugin.maskreproduces this in two
render_framecalls on one instance:src = [0.8, 0.6, 0.4, 1.0],mask = [0.5, 0.5, 0.5, 1.0].RenderJob { src: Some(src), effect_input_id: Some("Source"), inputs: vec![("Mask", mask)], .. }.The fixture computes
Source RGB × mask.red, output is[0.4, 0.3, 0.2, 1.0](correct).src,inputs: Vec::new()(the mask input disappeared,as when the user disconnects it). Expected pass-through
[0.8, 0.6, 0.4, 1.0].Actual on
main:So the plugin still sees the previous frame's mask as a live, connected input
(
clipGetImagereturns it, becauseClipInstance::fetch_imagenever consultsConnected).A regression test can be exactly this pair of renders: assert the second output is
[0.8, 0.6, 0.4, 1.0]and that theMaskclip reportsOfxImageClipPropConnected = 0withinput_texture_value().is_none(). That coversthe "clear" half of the acceptance criteria without any C fixture changes; the
dimension/format and masked-pixel assertions stay in the follow-up issue #15.