Skip to content

rust: Port obs-video-graphics-tasks.c to obs-core after extraction #4408

Closed

Description

@zackees

Phase 6 libobs-core follow-up to prerequisite #4403. Port execute_graphics_tasks from libobs/obs-video-graphics-tasks.c.h to obs-core only after its behavior-neutral extraction lands.

Preserve FIFO deque draining under video.task_mutex, releasing the mutex before each task callback and reacquiring it before checking the current queue again. Preserve public obs_queue_task behavior: calls on the graphics thread execute inline, while another producer may append during a callback. The Rust audio task drain is a separate queue/path and is not this implementation.

The prerequisite adds test/cmocka/test_video_graphics_tasks.c through the public OBS_TASK_GRAPHICS dispatch path, covering FIFO, inline nested dispatch, and callback-triggered producer enqueue without holding the queue mutex. These assertions must remain unchanged for Tier 2 on hybrid and the C reference. Mirror them in the existing obs-tests-core category binary, start RED against a stub, implement GREEN with a private deque/mutex/callback adapter, add exact Tier 3 parity and a mutation check, and prove symbol parity. Tier 4 is not applicable to this internal queue. Do not alter public headers or obs-websocket. No claim is placed on this follow-up by the prerequisite worker.

Activity

  1. added
    enhancement
    port
    P2
    size:S
    ready
    on Nov 9, 2026
  2. zackees commented on Nov 9, 2026

    @zackees
    MemberAuthor

    Claiming: execute_graphics_tasks Rust port on branch port/4408-graphics-tasks, stacked on #4410 (415f58e). 1. Commit RED safe-core tests mirroring the characterization. 2. Implement the Rust drain and private adapter, exact C-oracle differential and mutation check. 3. Run focused Tier 1/2/3, symbol parity, fmt and full lint, then push a branch-only handoff this session; no PR per pool manager instructions.

  3. moved this from In progress to Ready in obs-rust Multiviewon Nov 10, 2026
  4. rdoupe commented on Nov 11, 2026

    @rdoupe
    Collaborator

    Are you still on this port? Your branch port/4408-graphics-tasks has the RED and GREEN commits (last pushed 2026-11-09) but no PR, and the claim has gone stale. I'm porting the stop check from the same obs-video.c.h split (#4670) and could carry this one in the same PR, keeping your commits with your authorship. If you'd rather open it yourself, say so and I'll leave it.

  5. rdoupe commented on Nov 12, 2026

    @rdoupe
    Collaborator

    Taking over stale claim from @zackees

    Claiming: the Rust port of execute_graphics_tasks (obs-video-graphics-tasks.c.h) in obs-core.

    The draft on port/4408-graphics-tasks has no PR and no activity since 2026-11-09, and the question above got no answer. I'm carrying its RED and GREEN work over with Co-Authored-By, rebased onto current master and shaped like the video stop check port that just landed:

    1. RED: Tier 1 tests in obs-core's existing test binary against a todo!() drain, mirroring test_video_graphics_tasks.c (FIFO, a task that queues another runs in the same pass, the mutex released around each callback).
    2. GREEN: obs-core::video_graphics_tasks drains the queue through a lock, size, pop and run adapter, so task_mutex and the deque stay C-owned. execute_graphics_tasks() keeps its name and call site and becomes a bridge to a hidden shim; the original C moves to a reference group for libobs-c-reference. The unchanged characterization runs on hybrid libobs and on the C reference, and the export sets stay identical.
    3. Tier 3: an obs-c-oracle wrapper over the original C, with a proptest over random queues and tasks that queue tasks, comparing the call and lock logs, plus planted mutants.
    4. Docs: rust/README.md, naming.md, obs-core's description and module docs.

    Draft PR at RED expected today.

  6. rdoupe commented on Nov 13, 2026

    @rdoupe
    Collaborator

    Fixed by the PR that ports the graphics task drain (#4742, merge commit 00e363c).

    • Done: execute_graphics_tasks() now drains the OBS_TASK_GRAPHICS queue in Rust, in obs-core::video_graphics_tasks. The deque and its mutex stay C-owned, and the original C is kept as the C reference. The unchanged test_video_graphics_tasks passes against both hybrid libobs and the C reference. Tier 3 parity and planted mutants are in. A queued NULL task is now skipped instead of crashing the graphics thread, as its own RED/GREEN pair after the port.
    • Left: nothing from this issue, so no follow-up issue was filed. This finishes the obs-video.c.h split, after the stop check and the render size.
    • The master push run of the merge commit (43340889737) has one red test, test_transition_load_release in Tier 2 Linux. It is not in this code, and the transition ownership failures on parallel Tier 2 are already tracked in bug: libobs: transition load ownership checks fail on parallel master Tier 2 #4800.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2enhancementportreadysize:S

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions