Skip to content

build(decklink): enable native C++ conversion warnings (#2625) - #3787

Merged
zackees merged 5 commits into
masterfrom
fix/2625-native-decklink-cxx
Nov 7, 2026
Merged

zackees merged 5 commits into
masterfrom
fix/2625-native-decklink-cxx

Conversation

@zackees

@zackees zackees commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Refs #2625. Enable native DeckLink C++ conversion/sign/float warnings alongside C. GCC 15.2 rejected the existing out-of-range enum cast after assert(false): name its existing -1 value repack_mode_invalid in the plugin-internal enum and return it. No suppression added; global pins remain for other slices.

RED → GREEN

  • Original opt-in RED (rebased 3f0345315): native language ratchet failed for absent CXX flags; separate GREEN enables them, with per-language mutation hardening.
  • Sentinel RED 445d8d2f4: uv run python -m unittest ci.test_cross_conversion_ratchet.CrossConversionRatchet.test_decklink_repack_sentinel_compiles_with_both_compilers fails under GCC with -Werror=conversion at the actual default return. GREEN 1aa144463 passes GCC and Clang. The regression compiles the real header as C and the extracted production function as C++, checks every valid speaker/swap mapping, and checks default -1 with NDEBUG.
  • All 54 ratchet tests pass; independent clud-review clean. No Rust test executables added.

Enum and behavior audit

audio-repack.h is a PRIVATE source of the MODULE target, with no PUBLIC_HEADER/OBS_PUBLIC_HEADERS or header install. The generated native plugins/decklink/cmake_install.cmake installs the module/resources, not this header. It is not a public libobs C API header.

Both GCC 15.2 and Clang 21.1.8 select 4-byte unsigned int before, 4-byte int after, in both C and C++ (C _Generic/C++ underlying_type probes). Existing enumerators remain 0–7 because the first valid one is explicitly zero. The C++ wrapper passes the enum directly to C audio_repack_init; its only consumers index the unchanged eight-entry channel table and compare modes 4/5/6. All defined valid inputs have identical indexing, values, comparisons, function selection and calling representation. No enum field is stored in a struct.

The default still executes the same assertion and returns the same -1 sentinel with assertions disabled. It is not a valid input to audio_repack_init: indexing the eight-entry table with it remains undefined (before and after); this change does not add validation or define that previously invalid path. The caller retains its speaker-layout guard. No runtime behavior change is intended.

Actual-command replay and optimized IR

Fresh predecessor native Linux configure (DeckLink ON, frontend/scripting OFF) supplies four real commands. Replayed again after this fix with both GCC 15.2 and Clang 21.1.8, no PCH loading or forced includes, no negative conversion pins, conversion/sign/float as errors (Clang also shorten-64-to-32): 8/8 pass, including GCC audio-repack and SDK dispatch. Retain SYSTEM classification for SDK headers; no vendor changes.

Clang optimized -O2 -DNDEBUG -g0 -S -emit-llvm master (ef696e998, original source paths via VFS overlay) versus GREEN: three native pairs byte-identical; audio-repack is NOT identical. Its only difference is table-index extension zext i32 → sext i32 and removal of nuw from the inbounds GEP. For valid indices 0–7 both yield the exact same address. Out-of-table indices were already undefined; signedness does not change any defined table access. This is a signedness-only IR change, not a claim of total identity.

Supplementary mac-arm64/mac-x64 strict Clang cross replays also pass all six commands after this fix. Both core/macOS pairs per alias are identical; each audio-repack pair has the same signedness-only difference. These are cross checks, not native macOS builds.

Input master SHA-256 GREEN SHA-256
decklink.linux+.hpp.cpp 9e0840d4f78a115227cbf0573ad8074735fc91495b56033fa72318d47908e059 9e0840d4f78a115227cbf0573ad8074735fc91495b56033fa72318d47908e059
decklink.core+.hpp.cpp 5c4fc94d9a8ee90bce10531e8e0c965d6eb41feba753710df52d96c7a71bc7a1 5c4fc94d9a8ee90bce10531e8e0c965d6eb41feba753710df52d96c7a71bc7a1
decklink.audio-repack+.h.c 49ba3bc21272c9e9735097e95b10c02178c141da0101e5852da8bb003b20f8c5 37a771d746fbae44c425148cd661d0e97c1e6fe4c844bb0bfcc42bd447e16878
DeckLinkAPIDispatch.cpp aa3b956f6c7fce10f30d6ea84654cb8dc24cffe63d611614a7ce91ef1d7bb9ad aa3b956f6c7fce10f30d6ea84654cb8dc24cffe63d611614a7ce91ef1d7bb9ad
mac-arm64-decklink.core+.hpp.cpp 7e13a2d764cf95d49614b3362d02908f093ee9e28b836617de3401e498e9b6b3 7e13a2d764cf95d49614b3362d02908f093ee9e28b836617de3401e498e9b6b3
mac-arm64-decklink.audio-repack+.h.c fc941e87c6d20ce4faac39333888cfe1e383f744fa15fe3a7283aef9c9f0e5c2 dec94e81784b3dd1c1db4fbe95b980d72a8e8b923f560433514b30ab0b717bb6
mac-arm64-decklink.macos+.hpp.cpp 8e06b3539c5b05d21d25e42618cd8461e503ba8118c269f791e088435598c079 8e06b3539c5b05d21d25e42618cd8461e503ba8118c269f791e088435598c079
mac-x64-decklink.core+.hpp.cpp c3ae53a275f93775be2982960d0843a711f21b5697ca5bbf75876d3e4e7f0734 c3ae53a275f93775be2982960d0843a711f21b5697ca5bbf75876d3e4e7f0734
mac-x64-decklink.audio-repack+.h.c ce34e697bb7a2620054625920846e4f1047e71e2bf9b7ea609b5e87f299128a1 b083a45593fc8960821e581d71949c098c1fdf91c501be33d42294b524b78495
mac-x64-decklink.macos+.hpp.cpp 2e107e959511a14478e671844ec4e16ef7e546c4e05c55ac44b59f72d9eb84d0 2e107e959511a14478e671844ec4e16ef7e546c4e05c55ac44b59f72d9eb84d0

Evidence retained in /tmp/native-decklink/finish-verified.json, finish-cross-verified.json, *.finish.diff, *.finish-*.log and replay scripts. Full local lint (SOLDR_PORCELAIN=0 ./lint) exited 1 with diagnostic_state unknown/input_truncated; prescribed artifact continuation failed with "unable to produce a complete safe report". No cause inferred or guard workaround attempted. Artifact: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-8i6PXQ.log. Hosted PR CI is the merge gate. No Rust port, protocol, public-header, existing C-test, WebSocket, dependency or workflow changes. Runtime port tiers do not apply to this build-policy change; no hardware, linking/full-app, native macOS/Windows or MSVC validation claimed. No user-visible change, so no feature-ledger entry. Broader #2625 remains open.

Current-head hosted validation

Rebased prior head 1aa14446307f51e1d573cebd6e1ab06f2d95ea6b onto master 52bf4c7a5 without conflicts or code changes; pushed and verified 56bd4f8bea760bdf77648e13af69386ed1cef617. Hosted run 42328914250 passed on the first attempt: Format/self-tests, Fast Gate, ASan, conversion replay and required CI Gate. All 38 reported checks passed or skipped; zero failures or pending checks. No retry needed. CI HOLD removed.

Historical ASan blockers on the prior head were unrelated encoder failure #3788 (fixed on master by #3791) and slideshow assertion #3789. The fresh run passed both without a suppression, known-list entry, test edit or additional code change. Previous compiler/IR evidence above is retained from the completed implementation; this landing continuation performed only the clean rebase, whitespace check and hosted validation.

@zackees
zackees force-pushed the fix/2625-native-decklink-cxx branch from 1aa1444 to 56bd4f8 Compare November 7, 2026 02:22
@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Pool landing continuation: rebased prior head 1aa1444 onto current master 52bf4c7 without conflicts or code edits; pushed and verified head 56bd4f8. CI HOLD remains while fresh hosted CI runs. #3788 is fixed on master by #3791; if the sole failure is the known #3789 slideshow fade assertion at line 438, the assignment authorizes one failed-job retry. Any other failure or repeat failure remains held.

@zackees
zackees marked this pull request as ready for review November 7, 2026 02:42
@zackees
zackees added this pull request to the merge queue Nov 7, 2026
@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

QUEUED: all hosted checks passed on 56bd4f8 in run 42328914250, including ASan (first attempt, no retry), Format/self-tests, Fast Gate and CI Gate. Removed CI HOLD, marked ready, submitted with --match-head-commit, and verified mergeQueueEntry state QUEUED at position 2. Handed off to the pool manager for merge-queue observation per assignment. Slot obs-studio2 is clean and detached at origin/master 52bf4c7; no code edits, test edits, suppression, known-list changes, target pruning or soldr gc.

Merged via the queue into master with commit 752bd16 Nov 7, 2026
40 checks passed
@zackees
zackees deleted the fix/2625-native-decklink-cxx branch November 7, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant