Repository navigation
Conversation
5d36750 to
2da11e3
Compare
|
Stacked on #2887 ( |
2da11e3 to
b43279b
Compare
b43279b to
e99ef02
Compare
|
Round 2: the macOS build of
Note: this branch also carries #2892's three cocoa commits (it is stacked on them and its base is |
|
Round 3 — two further waves, both in
Re-dispatched: Scheduled 40854256103. The sweep found no other uncast enum -> int call in |
|
Round 4 — the lane is clean.
Diagnostic count by round: 2 (stage-surf) -> 6 (gl-cocoa) -> 4 (obs-cocoa) -> 1 (coreaudio) -> 19 (seam enums) -> 16 (draw plan) -> 9 (frame copy) -> 9 (video mix + output slots) -> 0. Marking ready and handing off to the coordinator. |
zackees
left a comment
There was a problem hiding this comment.
Coordinator review — #2897
Reviewed 91bf158bf (13 files, 49 added (int)-class casts, +74/−68). Verdict: correct and in scope; queueing it.
Correctness. Every change states a conversion that already happened implicitly, so values and behaviour are unchanged:
- Enum →
intat the Rust seam helpers (obs_scene_item_transform_bounded,obs_canvas_rules_format_set,obs_display_clear_linear,obs_output_slots_{video,audio}_type_ok,obs_encoder_gpu_gates_p010, the draw-plan / deinterlace-draw families). The seam signatures and thec_intABI do not move, so the-1sentinels some helpers take still arrive as-1; the cast is applied to the enum value, never to a computed result. obs_source_frame_copy_plan((int)src->format, …),frame_copy_shape.format,full_range/rangesites: the plan helpers takeintand compare against enum constants, so an explicit cast is exactly the implicit one they relied on.captionData = (uint16_t)(captionData << 8)restores the truncation the assignment already performed on auint16_t— no new width.- Cocoa/coreaudio:
(size_t) max_sizeafterassert(max_size > 0),(CFIndex) length/strlen(uid),(GLsizei) tex->width/height,(uint32_t)texture size,(UInt16) code(virtual key codes) — all narrowings into API parameter types where the source range is already the parameter's range.
RED → GREEN. Present and traceable: the RED is the Rust Tier 2 (macos-26) / macOS 🍏 (arm64) lane log at each push (job 123343547757, then one wave per push) with the verbatim diagnostics; GREEN is the same lane at 91bf158bf on Scheduled 40855996033 (job 123388266212) with the -Werror conversion flags, plus the local clang-21 replay documented in the description. Diagnostic count 19 → 16 → 9 → 9 → 0.
Rules (AGENTS.md / coordination.md §4). Mechanical warning class (#516): one PR for the class, explicit casts only, no -Wno-*, no #pragma, no per-file exemption — verified, the pin itself was removed in #2877, so the same-change rule is satisfied. No existing C test and no public header touched: the edits are in unity implementation bodies (*.c.h) and libobs-opengl/gl-cocoa.m.h. No docs/features.md line, which is right for a build-warning change with no user-visible behaviour. Base is master (no longer stacked on the closed #2892 — its cocoa commits ride here, so no separate base to land).
Residual risk, not a blocker. The wave enumeration is complete for the units the Tier 2 lane compiles, and the local clang-21 replay is a good filter; the app-build lanes (#2886's territory) compile units Tier 2 does not, so the next -Wsign-conversion group can only show up there. That is tracked, not hidden.
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.
Wave 3 of the same lane (run 40848587918, job 123371438242): 10 more 'const enum video_format' / 'const enum video_range_type' -> int diagnostics in libobs/obs-source.c.h — every obs_source_frame_copy_full_range()/..._full_range2() call site, plus the .format field of obs_source_frame_copy_shape. Validated locally with clang -Wsign-conversion -Wimplicit-int-conversion -Werror against the generated libobs.core-source unity TU (GCC build graph, clang front end, same warning set the lane uses): zero diagnostics. No Rust, cmocka or public-API change.
91bf158 to
229ed38
Compare
Coordinator tick — the Tier 2 macOS lane was not clean at
|
The macOS Tier 2 lane (`libobs C vs with Rust`, AppleClang,
`CMAKE_COMPILE_WARNING_AS_ERROR`) reports eight more conversion errors
once the RIST and render-plan ones are cast:
- obs-output.c.h: `obs_output_slots_{video,audio}_type_ok()` take `int`
and are passed `encoder->info.type` (`enum obs_encoder_type`), four
sites; and the CEA-608 accumulator adds an `int` to a `uint16_t`.
- obs-video-gpu-encode.c.h: `obs_encoder_gpu_gates_p010()` takes `int`
and is passed `info->format` (`enum video_format`).
- obs-video.c.h: `obs_video_mix_reuse_key.render_space` and the scale
input's `.scale_type` are `int` fields holding a `gs_color_space` and
an `obs_scale_type`.
Explicit casts at the seams, no behaviour change and no `-Wno-*` back.
Refs #2896
|
Rebased onto master (
|
Coordinator read of the latest macOS lane failure (2026-10-29 11:01Z, run 40860283546, head
|
|
Coordinator: pushed a |
The macOS Tier 2 lane (AppleClang) reports one more seam once the encoder and frame-copy casts are in: obs_key_from_name() returns the int the name map stores as an obs_key_t. Refs #2896
|
The macOS Tier 2 lane ( |
|
Superseded by master: the coordinator landed the same seam casts (997c3d5 "fixup: state the caption shift conversion in obs-output.c.h", and master's obs-output.c.h:1084/1092 + obs-hotkey-name-map.c.h:109 already carry the calls I raised here). Rebasing onto master dropped six of my nine commits as already upstream and only the caption hunk conflicted, so there is nothing left in this branch. Closing; #2896 still needs a macOS Tier 2 run to confirm the lane is green. |
Pull request was closed
Fixes #2896 and #2879. Was stacked on #2892, which is now closed: its three cocoa commits are the first three on this branch, so this PR lands the whole macOS conversion set.
What
Same lane, one wave:
Rust Tier 2 (macos-26)on master's code and on #2887's head (job123343547757) reported 19-Werror,-Wsign-conversion/-Wimplicit-int-conversiondiagnostics inlibobs's Rust seam call sites:AppleClang gives an enumeration whose enumerators are all non-negative an unsigned underlying type; GCC and Linux clang keep
int. The port's seam helpers takeint(the Rust ABI isc_int, and some carry-1sentinels), so each call site that passes the real enum value is an implicit enum -> int conversion: visible on Apple platforms only, which is why #2877's Linux replay of the same TUs was clean.The same breakage reaches the merge queue: the merge group for #2872 (run 40841144417) failed this lane on master's code and #2872 was ejected.
Green
Cast at each call site. The seam signatures and the Rust
c_intABI do not move, so there is no Rust or cmocka change and the tests are untouched. Two further sites of the same class are cast in the same commit so the next macOS wave does not re-report the group:obs_canvas_draw_technique()/obs_canvas_draw_reads_white_level()inobs.c.h, and the deinterlace mode-change call inobs_set_deinterlace_mode()../lintok (39 s);clang-format --dry-run --Werrorclean on the five files. Nodocs/features.mdline (a build-warning change, no user-visible behaviour).Draft until this PR's own
Rust Tier 2 (macos-26)lane is green: Linux cannot reproduce the finding, so that lane is the only proof. After #2892 lands I rebase this single commit ontoorigin/masterand retarget.Waves after the first push
The lane reports one wave per push because clang stops at the first failing TU group; each subsequent green attempt surfaced the next file:
b43279b18— Wave 2 (libobs/obs-source.c.h), 19 more sites:obs_source_audio_place_outputs(source->monitoring_type), the async/sync render plans'source_space/current_space(obs_source_draw_plan_async_linear_srgb,..._async_nonlinear_alpha,..._technique,..._reads_white_level,..._multiplier,..._convert) andsrc->formatintoobs_source_frame_copy_plan(). The lane on that push (run 40845602973, job 123357694178) is the RED evidence, verbatim:9f5c17d86— Wave 3: 10 more sites in the same file (obs_source_frame_copy_full_range(),..._full_range2()andobs_source_frame_copy_shape.format). Lane log from run 40848587918, job 123371438242:Local reproduction (cheaper than one macOS queue slot per wave)
The lane's warning set reproduces on Linux with clang 21 against the generated unity TU from the existing GCC build tree:
That reports the same
enum -> intdiagnostics AppleClang does (Linux clang picks an unsigned underlying type for all-non-negative enums too), so the remaining waves can be found locally in seconds. With wave 3 applied,libobs.core+,core-output+,graphics+andcore-source+are all clean under-Wsign-conversion -Wimplicit-int-conversion -Werror.