Skip to content

rust: Port libobs/obs-canvas-has-valid-video-info.c.h to obs-core #5310

Closed

Description

@zackees

Phase 6 Rust swap following the C-only characterization and behavior-neutral extraction in #5295. The prerequisite must land first. Port only obs_canvas_has_valid_video_info from libobs/obs-canvas-has-valid-video-info.c.h to obs-core, preserving its existing hidden C callable seam and exact behavior.

This is a thin wrapper: Rust already implements canvas_rules::size_set and canvas_rules::format_set. Reuse those rules for the four dimensions and (int)output_format; do not duplicate their logic. Preserve all five conjuncts, direct unlocked reads, no allocation or mutation, and the current valid-canvas precondition. Do not invent NULL behavior: the original C dereferences NULL.

Acceptance: RED then GREEN. Port every assertion of the immutable C characterization (independent zero/nonzero width/height boundaries, format NONE/nonzero and signed boundaries/out-of-enum cases, all 32 predicate combinations, no canvas mutation or allocation) to Tier 1 in the existing Core state category. Add Tier 3 differential and mutation coverage against the extracted original C, and real layout/field projection checks as needed. Use the fixture's CANVAS_VALID_INFO_EXTERNAL mode so unchanged C assertions exercise the actual Rust shim through real C adapters, rather than retaining a source-only test and claiming it covers the swap. Preserve unchanged C tests and public headers. No network surface: Tier 4 is inapplicable.

Move the extracted source's unity inclusion to its own ported group and keep C-reference coverage and symbol parity. Reuse the shared native link support from #5246; never use aborting placeholders. Build EVERY configured Linux *_rust target plus the characterization and validate Windows MSVC and Darwin arm64 standalone consumer links. Run the whole native_build:: module and repository lint. Keep the original function's visibility and public ABI unchanged.

Scope excludes all other canvas APIs, obs-websocket and unrelated rules. Priority P2, size:S. The prerequisite carries the callable C extraction; this issue remains blocked until it lands.

Prerequisite publication: #5348 (Refs #5295), head 4ebdb42. The C-only prerequisite is ready with auto-merge armed; this Rust swap must wait for that PR to merge. Validation passed 322 native_build:: tests, full ./lint, the new Linux Tier 2 fixture and every one of the 68 configured *_rust targets, with all 69 tests passing against both libraries and matching 1,769-symbol export sets. The fixture additionally passed 25 repetitions per library.

Activity

  1. added
    port
    P2
    size:S
    on Nov 20, 2026
  2. rdoupe commented on Nov 20, 2026

    @rdoupe
    Collaborator

    /ready

    Its prerequisite #5295 landed in #5348 (the extracted file is in the live core-source group on master).

  3. rdoupe commented on Nov 20, 2026

    @rdoupe
    Collaborator

    Claiming: Rust swap of obs_canvas_has_valid_video_info on branch port/5310-canvas-video-info, batched with #5326 (same crate and canvas group) in one PR.

    1. RED: safe Tier 1 mirrors of every test_canvas_has_valid_video_info assertion in the existing Core state binary, against a stub.
    2. GREEN: thin shim reusing canvas_rules::size_set/format_set, CANVAS_VALID_INFO_EXTERNAL seam reaching the Rust symbol, C unit moved to its own reference-only ported group, Tier 3 differential and mutation checks against the extracted C.
    3. Lint, open the PR this session, queue when green.
  4. added
    ready
    on Nov 20, 2026
  5. github-actions commented on Nov 20, 2026

    @github-actions

    Claim bot: @rdoupe, this can't be claimed yet: it is blocked by 1 open issue(s) (see "Blocked by" on the issue); claim it once they close.

  6. rdoupe commented on Nov 20, 2026

    @rdoupe
    Collaborator

    Claiming: Rust swap of obs_canvas_has_valid_video_info on branch port/5310-canvas-video-info, batched with #5326 in one PR (plan as in my comment above). Its prerequisite #5295 is now closed (done in #5348).

  7. moved this from Blocked to In progress in obs-rust Multiviewon Nov 20, 2026
  8. rdoupe commented on Nov 20, 2026

    @rdoupe
    Collaborator

    Done in #5360 (merged 2026-11-20 12:37 UTC): obs_canvas_has_valid_video_info now runs through safe Rust in obs-core; the C unit moved to its reference-only ported group. Master push run of the merge commit is green.

  9. moved this from In progress to Done in obs-rust Multiviewon Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2portreadysize:S

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions