Repository navigation
Description
Difficulty: medium (~4–6 hours, CPU-only, no GPU)
Background
crates/quercus-ofx-plugin ships a minimal OFX test plugin
(cbits/quercus_test_plugin.c) that the host tests render through, both
directly (render_frame) and end to end through the node graph
(tests/node_e2e_test.rs). #3 (merged as PR #12) added an optional mask clip to
that fixture: when the mask is connected the fixture uses it, when it is absent
the source passes through.
Today nothing renders a mask end to end on the host side. The mask issue
#5 cannot
close on descriptor-level tests alone: its acceptance criteria ask for CPU pixel
tests covering masked and unmasked output, and for the mask to reach the
plugin clip "with the expected dimensions, format, and pixels".
Fixture contract (already landed)
#3 was merged as PR #12, so the fixture below exists on main today:
- plugin id:
org.quercus.test-plugin.mask
(Host::global().create_instance("org.quercus.test-plugin.mask", None)); - clips:
Source,Mask(OfxImageClipPropOptional = 1,
OfxImageClipPropIsMask = 1),Output; - documented behavior: mask connected → output RGB = Source RGB × Mask red
channel, alpha from Source; mask absent → Source passes through; - the render path was exercised manually during review: Source
[0.8, 0.6, 0.4, 1.0]with a mask whose red channel is0.5renders
[0.4, 0.3, 0.2, 1.0], and the no-mask path reproduces the fixture's
pass-through. A test-only change is expected; - existing coverage lives in
`tests/mask_clip_test.rs`
(descriptor flags plus attach/clear/reattach) — this issue adds the missing
render-level coverage.
One dependency to know about: case 4 below (disconnect / reconnect across
renders) needs
#14
(the render driver currently keeps the previous job's mask texture and reports
the clip as connected after the input disappears). Cases 1–3 do not depend on
it. Land #14 first, or contribute cases 1–3 and leave case 4 for the follow-up.
What the ask is
Add integration coverage in crates/quercus-ofx-plugin/tests/node_e2e_test.rs,
following plugin_renders_constant_frame_end_to_end (graph + ConstSource +
Traverser/RenderEvalHooks + rendered_texture/first_pixel):
- Unmasked baseline — plugin node with only
Sourceconnected. Assert the
output equals the fixture's documented no-mask behavior (per [OFX][TWiR] Add optional-mask fixture and clip connection lifecycle tests #3; do not
hard-code 0.5 if [OFX][TWiR] Add optional-mask fixture and clip connection lifecycle tests #3 changed it). - Masked — connect a
ConstSourcewith a known pattern to the fixture's
mask clip, e.g.("Mask", [0.0, 0.0, 0.0, 1.0])and a second case with a
white mask. Assert the pixels match the fixture's documented masked result,
computed from the fixture contract rather than captured as a golden file. - Mask geometry reaches the plugin — assert the mask texture the driver
attaches has the expected dimensions and format, using
ClipInstance::fetch_imageon the mask clip
(src/clip.rs:251)
under the same job, or a fixture-side echo of the mask's width/height. A
silently dropped mask must fail this test. - Disconnect / reconnect across renders — after a masked render, evaluate
again with the mask disconnected and then reconnected with a different
pattern. Assert the output follows the current connection state each time.
If the graph hands you a fresh instance per evaluation, assert it (compare
PluginNode::instance_handle()) and drive the repeated renders through
render_frameon one instance instead, which is the layer the staleness
lives in.
Keep the cases deterministic: fixed sizes, fixed patterns, no random data and
no timing dependence. Skip cleanly when the test plugin is not built, using the
existing common::skip helper.
Acceptance criteria
- The four cases above exist and pass with
cargo test -p quercus-ofx-plugin. - Masked and unmasked outputs differ in the documented way; the mask's size and
format are asserted, not assumed. - Disconnecting and reconnecting the mask across renders produces the output of
the current connection state — no stale mask pixels (requires [OFX][TWiR] Clear stale clip input state in the render driver between jobs #14; skip this
case while [OFX][TWiR] Clear stale clip input state in the render driver between jobs #14 is open and say so in the PR). - The tests are CPU-only, need no GPU, no
QUERCUS_OFX_GL, and no third-party
plugin. - No production-code change is expected; if a case exposes a host defect, open a
focused follow-up issue and link it here rather than fixing it inline.
Out of scope
- GL masked-pixel verification (gated on real hardware; stays in [OFX] Verify and complete optional mask rendering and lifecycle semantics #5).
- Mask inversion, feathering and edge behavior: these follow the plugin
contract, not the host. - The fixture itself ([OFX][TWiR] Add optional-mask fixture and clip connection lifecycle tests #3) and the render-driver cleanup fix (separate issue).
How to run
tooling/install-deps.sh
tooling/ffmpeg/build-ffmpeg.sh --shared
cargo test -p quercus-ofx-plugin --test node_e2e_testMentoring
A maintainer can walk through the fixture's mask contract and the graph test
harness; comment here to claim the issue.
Contributing
Quercus follows Oak's CONTRIBUTING.md
and Code Style Guide.
In short: format with cargo fmt --all, keep the change focused, 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