Skip to content

fix(scripting): make native Python conversion boundaries explicit - #3786

Merged
zackees merged 2 commits into
masterfrom
fix/2625-native-scripting
Nov 7, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/2625-native-scripting

Conversation

@zackees

@zackees zackees commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Refs #2625. Make four measured hand-written Python conversion boundaries explicit without changing behavior: a uint64_t timer multiplier, the existing hotkey-to-long long storage conversion, and two nonnegative same-string pointer offsets to size_t.

  • RED 32c396538: the extracted production statements fail GCC/Clang conversion-as-error compilation. GCC reports all four sites; Clang reports three (its unsigned timer multiplication is already clean).
  • GREEN a6cd12afc: the regression compiles and executes with both compilers, checking negative/extreme timer milliseconds, zero/max/invalid hotkey round trips, and zero/nonzero path offsets. All 50 ratchet tests pass. Independent clud-review is clean.
  • Timer conversion retains unsigned modulo arithmetic, including negative milliseconds. Hotkey conversion uses the exact calldata_set_int parameter type; the existing cast back to obs_hotkey_id restores the sentinel. Pointer searches establish nonnegative offsets inside the same string.

No scripting opt-in is added. SWIG external runtime headers are textually included by four hand-written Lua/Python unity groups. Current-master strict replay still fails in those generated headers; positive translation-unit scoping cannot isolate them. The generated wrappers are separate targets, but excluding those targets alone does not resolve the runtime headers. Per assignment, leave opt-in pending the maintainer boundary decision. No generated/third-party edits, new suppression, negative pins, global-pin deletion, public headers, existing C tests, or WebSocket changes.

Validation baseline: master 96b0e63b194aa055b0392f564fcb139c00777981. Reconfigured native Linux with frontend, Lua and Python ON. Nix GCC 15.2.0, Clang 21.1.8, SWIG 4.4.1, LuaJIT 2.1.1774638290, Python 3.13.15. All 12 actual scripting inputs replayed from fresh compile commands without PCH loading or forced includes, keeping textual group headers. Clang forces conversion/sign/float/shorten as errors: hand-written errors 3 → 0; generated runtime/wrapper errors remain (23 occurrences total). GCC GREEN warning replay: 0 handwritten, 35 generated occurrences, no parse failures. This is not a passing full strict target build.

Every input also compiled at -O2 -g0 -S -emit-llvm, no PCH/forced includes, using a Clang VFS overlay for the master implementation. All 12 master/GREEN outputs compare byte-for-byte:

Input / consumer SHA-256 (both versions)
obs-scripting.lua-frontend+.h.c / 0 b9edca35c845e1223bccba91654c497688727f4e985357a47d118269144573f3
obs-scripting.lua+.h.c / 1 bc86f5367cb54545e1266b3f844759279ebb29701536040031c91b99e1b9d055
obs-scripting.lua-host-posix+.h.c / 2 7feb1c7320844786fb033cbf82ff57826f2af35bde545b34f48887e468afff6e
obs-scripting.python-frontend+.h.c / 3 a69e88ac873de25b86d7cea8ddf7e276ee4da5bd7162de086dde5429063236f4
obs-scripting.python-host-posix+.h.c / 4 c3237b9787f46aa5b330cce1e4b7b3b81fff4f9dfe573d65240ff0e249172af6
obs-scripting.python+.h.c / 5 cf6a772e1cc73dea7a1c9302e941c05215849720c2c29c714d8ef9d6283ce380
obs-scripting.core+.h.c / 6 f093f814f6d78f5fd4b266737b55fc514a56a267fa4fb9fea109c0390a66d4cb
obs-scripting.cstrcache+.hpp.cpp / 7 9b3e64a98f0f66e6ab0758b9b67106c5fae27a74e69f150e8dc8d0a6a994bf4a
obsluaLUA_wrap.c / 8 b555ec4b2ccbeed9237ef63d0c7f7d2c7ab3f836db3c1fbcd4ee23795d13741a
obs-scripting.cstrcache+.hpp.cpp / 9 9b3e64a98f0f66e6ab0758b9b67106c5fae27a74e69f150e8dc8d0a6a994bf4a
obspythonPYTHON_wrap.c / 10 e3d47c8ac6c3f6031eb824de2792edcb10e3b344c6be0c4a20fa920e5653a30b
obs-scripting.cstrcache+.hpp.cpp / 11 9b3e64a98f0f66e6ab0758b9b67106c5fae27a74e69f150e8dc8d0a6a994bf4a

Evidence: /tmp/native-scripting-worker/{master,green}.json, commands, diagnostics, overlay, IR pairs and RED/GREEN test logs; CMake tree /tmp/scripting-scout/build.

Lane limits: hosted Fast Gate/self-tests prove the extracted production boundary regression. The scripting-ON native GCC/Clang replay and IR comparison above are the local proof of the actual scripting inputs; no hosted scripting build is claimed. Native macOS/Windows, MSVC, script execution, full object/link builds, Tier 2, protocol, sanitizers and packaging were not run locally. This is a C warning-only change, no Rust port or protocol/ABI change; Rust port tiers do not apply. No user-visible behavior change or features ledger line.

Full local lint (env SOLDR_PORCELAIN=0 ./lint) exited 1 with diagnostic state unknown. The prescribed bounded artifact continuation returned unable to produce a complete safe report; no guard workaround or cause inferred. Hosted PR CI remains the merge gate. Artifact: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-ILDfIm.log.

@obs-rust-project-manager obs-rust-project-manager Bot moved this to In progress in obs-rust Multiview Nov 6, 2026
@zackees
zackees marked this pull request as ready for review November 6, 2026 23:43
@zackees
zackees enabled auto-merge November 6, 2026 23:44
@zackees
zackees added this pull request to the merge queue Nov 6, 2026
Merged via the queue into master with commit ef696e9 Nov 7, 2026
45 checks passed
@zackees
zackees deleted the fix/2625-native-scripting branch November 7, 2026 00:01
@obs-rust-project-manager obs-rust-project-manager Bot moved this from In progress to Done in obs-rust Multiview Nov 7, 2026
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