Repository navigation
Description
Rust port, round 12 unit 2: the module load decisions in libobs/obs-module.c.h, moved to Rust (rust/obs-core, new module module_load_rules, next to module_type_rules, module_source_rules and module_paths).
Unit
libobs/obs-module.c.h → libobs/obs-module-load-rules.c.h → rust/obs-core (module_load_rules).
Phase and position
Phase 6 (core), the next slice of obs-module.c.h after the search paths (#1876), the names (#1915), the source and type registration rules (#1929, #2194). Waits on the core-module reload fix (#2730, landed as #2732).
Scope
Rust takes over these decisions:
obs_open_module: the gates (no module pointer, path or core: error; the host skip), the open failure, the exports result, and the version rule (ver() & 0xFFFF0000aboveLIBOBS_API_VERis incompatible);load_module_exports: which required export is missing first (obs_module_load,obs_module_set_pointer,obs_module_ver, in that order). C still looks each one up where it does today and asks after each lookup;is_safe_module/is_disabled_module: an empty safe list allows every module, an empty disabled list disables none (the name match is already Rust,obs_module_names_listed);obs_get_module_allow_disable;load_all_callback, the routing: not an OBS plugin, not on the safe list, disabled, a legacy plugin with a core module's name, already loaded (core, legacy and plugin wording), then per open code (missing exports, failed to open with the core-module carry-on, error, incompatible version, host skip), then the init result, and whether a failure is counted;obs_load_core_modules: the cached result, and loaded only when no failure was counted;find_core_module: the core-type refusal;obs_is_core_module,obs_is_legacy_module.
C keeps get_plugin_info, obs_get_module, obs_host_skip_module, os_dlopen, os_dlsym, the ver() call, the module struct setup, obs_create_disabled_module, obs_init_module, free_module, the failure string and its split, load_core_modules, obs_module_paths_find, obs_module_names_find_core, and every log message (same text, level and order). Every read and call stays in its original place and under its original condition: the lookups stop at the first missing export and the routing at the first skip, as today.
Dependencies and existing tests
- Depends on
module_names(obs_module_names_listed, already Rust) and the core-module reload fix (libobs: stop obs_load_core_modules reloading already loaded core modules (#2730) #2732, landed). - Existing real-libobs coverage: the module search and load tests from the
module_paths,module_namesandmodule_type_rulesports, andtest_core_module_load. - No characterization of the routing itself yet:
test_module_load_stepslands first, pinning every pre-route combination, every open code for a core module and a plugin (an unknown code goes on to init: characterized, not endorsed), the version word (same major and minor with any patch, one minor above,0xFFFF0000), a missing export at each of the three places,obs_load_core_modulestwice after a success and after a failure, a core module that can't be opened, and a NULLfail_info.
Plan
The standard six commits, one PR:
- move to
libobs/obs-module-load-rules.c.h(behaviour-neutral; the export sets stay identical on the C, hybrid and c-ref builds); - characterization test;
- Tier 1 RED;
- GREEN in
libobs.ported-module-load-rules; - Tier 3 parity (exhaustive over the booleans, types and codes; proptest over
u32version words and list sizes), with a mutation check; - docs.
Notes
No intentional behaviour difference. No SIMD, threading or per-OS code. The MODULE_*, OBS_MODULE_TYPE_* and OBS_MODULE_DISABLED* values are copied into the rules header and _Static_asserted against the core headers in obs-module.c.h.
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
rdoupe commentedon Oct 28, 2026
Claiming: #2801 (round 12 unit 2).
libobs/obs-module-load-rules.c.h(behaviour-neutral).test_module_load_steps.todo!()stubs.libobs.ported-module-load-rules.One PR; a draft opens with the RED commit today.
libobs: Move module load rules to their own file
test: Characterize the module load rules
obs-core: Add Tier 1 tests for module load rules
libobs: Port the module load rules to obs-core
obs-core: Add Tier 3 parity for module load rules
docs: Document the module load rules port
libobs: Port the module load rules to obs-core (obs-rust#2807)