Repository navigation
build(libobs): state the source frame-copy seam conversions (#2879) - #2900
Conversation
zackees
left a comment
There was a problem hiding this comment.
Review: coordinator tick 2026-10-29
Verdict: the change itself is correct and ready once its lane lands. I cannot queue it yet (see the last section).
What I checked
- Diff scope. The PR's own commit (
e4ac8e5f5) touches one file,libobs/obs-source.c.h, and only the seven call sites named in the description (3167,3192,3263,3308,3333,3407,3432). Each is a stated(int)conversion offrame->format/frame->range, nothing else on the line changed. - Public API untouched.
libobs/obs-source-frame-copy.halready takesint format/int range(obs_source_frame_copy_full_range,_full_range2) andstruct obs_source_frame_copy_shape.formatis alreadyint, so casting at the call site is the right seam rather than widening a public header. - No behaviour change. Every
enum video_formatconstant is non-negative (VIDEO_FORMAT_NONE= 0 onward) andenum video_range_typeis{0,1,2}, so the conversions cannot change a value. - No suppression added. No
-Wno-*, no pragma, no widening type in the diff — the class stays visible, which is the point of the burn-down. - RED → GREEN. RED is the AppleClang-only nightly (
scheduled.yamlon the #2886 head, job123368785769(x86_64) /123368785586(arm64)): seven distinct call sites, repeated by the unity build. It is not reproducible on Linux, so a CI log as RED evidence is the right call here; GREEN is the next nightly on this branch../lintclean is claimed and matches the diff shape. - Ledger. Warning/flag only, no user-visible change, so no
docs/features.mdline is correct (coordination.md §4). - Stack. Content-wise it is exactly
pr2886..pr2900, so once #2886 lands a rebase drops the five carried commits and leaves this one — the stated landing order (#2892 → #2897 → #2886 → this) is right.
Two nits (not blocking, both mechanical)
- coordination.md §4 wants the description to start with the stacked form:
> **Stacked:** builds on #2886; the new commits are …. Right now it is the second sentence (Refs #2879. Stacked on #2886 …), which a future reader skimming for the base may miss while #2892 and #2897 are still drafts. - #2886 is stacked on #2897, which is stacked on #2892, and #2892/#2897 are still drafts. Four PRs deep, one red nightly re-runs the whole lane; the description already names the order, so this only needs the drafts to be marked ready when their nightly is green.
Why it is not queued
mergeStateStatus is BLOCKED and the PR CI run started at 09:32Z still has Fast Gate, Rust Tier 2 Linux, Qt Frontend Linux and Cross Compile (mac-arm64) pending, so checks is not green yet. It also cannot enter the queue ahead of #2892/#2897/#2886. The coordinator will queue it in the tick after its lane lands and CI is green.
Wave 5 — the macOS lane's next diagnostics, now stated explicitly
|
|
Coordinator note for head
Eight sites in three headers this PR does not modify, so Not touching the branch — you are mid-series on the stack. No action from this tick beyond recording the list. |
The first green attempt still failed: the same #ifdef-only blind spot hides four more -Wsign-conversion diagnostics (CGLTexImageIOSurface2D takes GLsizei widths from uint32_t texture fields) and two -Wfloat-conversion ones (CGSize CGFloat dimensions into device_texture_create's uint32_t). State them at the call; values unchanged.
The libobs ratchet (#2877) had the same Linux-only replay blind spot: the macOS Tier 2 lane then reported CFIndex -> size_t (dstr_reserve), obs_key_t -> int (mouse button index), int -> UInt16 (UCKeyTranslate key code) and UniCharCount -> CFIndex (CFStringCreateWithCharactersNoCopy). State each at the call; values unchanged.
-Wsign-conversion on the macOS Tier 2 lane rejects strlen()'s size_t as the CFIndex byte count; cast at the boundary.
-RED: `Rust Tier 2 (macos-26)` on `07340d52e` + #2887's cocoa fix (job 123343547757) reports 19 `-Werror,-Wsign-conversion` / `-Wimplicit-int-conversion` diagnostics in the four Rust seam call sites below: `enum video_format`, `obs_bounds_type`, `obs_scale_type`, `obs_blending_method`, `obs_blending_type`, `gs_color_space` and `obs_deinterlace_mode` passed to a helper the port declares with an `int` parameter. AppleClang gives an all-non-negative enum an unsigned underlying type; GCC and Linux clang keep `int`, so #2877's replay of the same TUs could not see them. -GREEN: state the conversion at each call site, leaving the seam signatures and the Rust `c_int` ABI unchanged. Two further sites of the same class (obs_canvas_draw_technique()/reads_white_level() in obs.c.h, the deinterlace mode-change call) are cast with them so the next macOS wave does not re-report the group. No Rust or cmocka change: no signature moved, and the casts are behaviour-neutral (the values are enum members, not sentinels).
The next macOS Tier 2 wave after b43279b reports 19 more 'enum -> int' conversions, all in libobs/obs-source.c.h: the monitoring type fed to obs_source_audio_place_outputs(), the async and sync render plans' gs_color_space arguments, and src->format into obs_source_frame_copy_plan(). AppleClang gives all-positive enums an unsigned underlying type; the seam helpers take int (the Rust c_int ABI carries -1 sentinels), so each call site is an implicit conversion visible only on Apple platforms. Cast at each call site; signatures, Rust ABI and tests do not move.
-Wsign-conversion on the macOS lane rejects enum video_format and enum video_range_type as the int parameters of the frame-copy helpers, whose signatures are public API (obs-source-frame-copy.h) and stay int. State the conversion at each of the seven call sites in obs-source.c.h.
…reports (#2879) The macOS Tier 2 lane on this branch stopped on the next wave after the obs-source frame-copy seams: encoder-type slots, the CoreAudio caption shift, the video copy-plan keys and the GPU encode format gate. Explicit casts only; same values the compiler converted implicitly.
d62206c to
7bb440c
Compare
|
Wave 6: |
|
Wave 7: |
|
Handed off to the coordinator. All 19 required checks are green on Summary of this tick's waves, each proven by the macOS lane log then cleared on the next run:
No local-gate stamp on the final commit; Linux Tier 2 ( |
|
Handed off to the coordinator. Full CI is green ( |
…t#2946) (obs-rust#2947) `qt_platform::translate_modifiers()` accumulates `INTERACT_*` flags in an `int` and returns them as `uint32_t`. AppleClang's `-Wsign-conversion` (part of the conversion ratchet obs-rust#2872 added for obs-rust#2625) rejects the return on both macOS app builds and the clang-analyze lane: qt-host-macos.cpp.hpp:43:9: error: implicit conversion changes signedness: 'int' to 'uint32_t' (aka 'unsigned int') [-Werror,-Wsign-conversion] return obsModifiers; The statement is the one the POSIX sibling already carries (`qt-host-posix.cpp.hpp:47`, `5298ad7ec` for obs-rust#2900): the local stays `int`, the return states the widening. Every `INTERACT_*` flag is a non-negative constant, so the returned value is unchanged - all 16 modifier combinations return the same value with and without the cast. RED: a reduced translation unit with this function's return compiled under `-Wconversion -Wsign-conversion -Werror` stops on the diagnostic above. GREEN: the same unit with `static_cast<uint32_t>` compiles, and the run agrees on all 16 combinations. Refs obs-rust#2946
…bs-rust#2923) (obs-rust#2955) * test(ci): the sanitizer lane a ratchet PR must pay for (obs-rust#2923) RED: the scope has no sanitizer selection, so a PR that changes a compile input of a target already in the conversion ratchet runs no asan build and the diagnostic only that configuration reports reaches master (three times: obs-rust#2869, obs-rust#2900, obs-rust#2923). uv run python -m unittest ci/test_ci_scope.py ci/test_conversion_ratchet.py -> TypeError: scope() got an unexpected keyword argument 'ratchet_dirs' -> ModuleNotFoundError: No module named 'conversion_ratchet' The ratchet itself has no reader either: ci/test_conversion_ratchet.py asks for the directories of the CMakeLists files that name a conversion group. * ci: a ratchet PR runs the sanitizer lane that would have caught it (obs-rust#2923) GREEN: ci/conversion_ratchet.py reads the conversion ratchet from the tree it builds: the directories of the CMakeLists whose own target_compile_options names a conversion group (the positive spelling; -Wno- keeps the pin and is not a ratchet entry). ci_scope.py selects a new 'asan' lane for a pull request that changes a compile input below one of them, and build-project.yaml runs the existing sanitizers.yaml 'asan' pass for it (workflow_call, allowlisted in ci.toml). Pull requests only: the merge queue reruns CI on the merge result (obs-rust#692) and a sanitizer build there would grow its critical path for every ratcheted change (obs-rust#2072, obs-rust#2593); a master push and the schedule run the full lane anyway. The list is read from the PR's own tree, so the PR that adds a target to the ratchet selects the lane too -- the mechanism the maintainer chose in obs-rust#2923 (option 2, narrowed) over a reviewer checklist that has now failed three times. --------- Co-authored-by: zackees <[email protected]>
Refs #2879. Stacked on #2886 (which is stacked on #2897 -> #2892).
Wave 4 of the macOS conversion burn-down. #2892, #2897 and #2886 clear the
libobs-opengl/libobsCocoa conversions, the enum -> int seams inobs-scene.c.h/obs-source-deinterlace.c.hand the frontend-Wsign-conversionopt-in; the nightly dispatched on that whole stack(
run 40850486279, job123368785769) then stopped on this wave.RED — the nightly job log
scheduled.yamlon the #2886 head,Build 🧱 / macOS 🍏 (x86_64):Seven sites, both architectures (arm64 job
123368785586reports the sameset). The unity build repeats each diagnostic, hence 19
##[error]lines for7 distinct call sites. No local RED is possible: this is AppleClang-only and
the Linux replay does not reproduce it, so the CI log above is the RED
evidence and the GREEN is the next nightly on this branch.
GREEN — the change
obs_source_frame_copy_full_range()/_full_range2()takeint format/int rangeinlibobs/obs-source-frame-copy.h, which is public API and staysint; the same is true ofstruct obs_source_frame_copy_shape.format.So the conversion is stated at each of the seven call sites in
libobs/obs-source.c.h((int)frame->format,(int)frame->range) rather thanchanging a public header. No
-Wno-*, no pragma, no behaviour change: everyvalue converted is one of the enum's non-negative constants.
./lintis clean (111 s). This is a warning/flag change, so nodocs/features.mdledger line.Landing order for the lane: #2892 -> #2897 -> #2886 -> this.