Skip to content

[OFX][TWiR] Add CPU end-to-end masked/unmasked rendering tests for the optional mask clip #15

Open

Description

@Mike-Solar

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 is 0.5 renders
    [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):

  1. Unmasked baseline — plugin node with only Source connected. 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).
  2. Masked — connect a ConstSource with 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.
  3. Mask geometry reaches the plugin — assert the mask texture the driver
    attaches has the expected dimensions and format, using
    ClipInstance::fetch_image on 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.
  4. 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_frame on 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

Out of scope

How to run

tooling/install-deps.sh
tooling/ffmpeg/build-ffmpeg.sh --shared
cargo test -p quercus-ofx-plugin --test node_e2e_test

Mentoring

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

  1. added
    enhancement
    good first issue
    on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions