Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
53ece3d
test(graphics): pin legacy image-file session ordering RED (Refs #5145)
zackees Nov 18, 2026
c4377bd
graphics: swap legacy image-file orchestration to Rust (Refs #5145)
zackees Nov 18, 2026
2494511
graphics: retain real conversion dependencies in static consumers (Re…
zackees Nov 18, 2026
befa4e3
test(graphics): complete static fixture dependencies and registration…
zackees Nov 18, 2026
606d258
test(graphics): link real logging bridge into image fixture (Refs #5145)
zackees Nov 18, 2026
3375195
style(graphics): format image-file native registration (Refs #5145)
zackees Nov 18, 2026
5dd90dd
style(graphics): keep image-file graph registration in name order (Re…
zackees Nov 18, 2026
7ae68f5
test(graphics): require standalone image maximum-size callback suppor…
zackees Nov 19, 2026
abcb369
fix(graphics): complete standalone image adapter link support (Refs #…
zackees Nov 19, 2026
ea67280
test(graphics): require Windows timer imports for static consumers RE…
zackees Nov 19, 2026
272a176
fix(graphics): propagate Windows timer library to static consumers (R…
zackees Nov 19, 2026
2c4b302
test(graphics): cover Windows RPC and private logger linkage RED (Ref…
zackees Nov 19, 2026
c62c9e8
fix(graphics): complete Windows UUID and private logger linkage (Refs…
zackees Nov 19, 2026
5f748e2
test(graphics): reproduce shared-library fixture binding RED (Refs #5…
zackees Nov 19, 2026
2cc2999
fix(graphics): keep native fixture calls and cleanup local (Refs #5145)
zackees Nov 19, 2026
d685374
graphics: reuse landed shared support after master rebase (Refs #5145)
zackees Nov 25, 2026
ef02549
test(graphics): require real vertexbuffer teardown support RED (Refs …
zackees Nov 25, 2026
96fcd32
graphics: link real vertexbuffer teardown through shared support (Ref…
zackees Nov 25, 2026
dc9f8d0
test: require a sole static provider for image recording fixture (Ref…
zackees Nov 25, 2026
b124cb1
test: isolate image recording fixture from shared libobs binding (Ref…
zackees Nov 25, 2026
f3d18b3
test: expose eager adapter selection in isolated recording fixture (R…
zackees Nov 25, 2026
4914c2c
test: demand-link real support in the isolated image fixture (Refs #5…
zackees Nov 25, 2026
4d60b05
test: replay root graph creation order for recording isolation (Refs …
zackees Nov 25, 2026
d1eac62
test: defer recording isolation until graph targets exist (Refs #5145)
zackees Nov 25, 2026
4f16133
style: format image recording registration assertions (Refs #5145)
zackees Nov 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions ci/test_rust_static_link_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,34 @@ def test_non_msvc_preserves_declared_shared_binding(self):
def test_non_msvc_preserves_declared_static_binding(self):
self.check_fixture(False, False, True)

def test_isolated_recording_fixture_selects_only_needed_support(self):
with tempfile.TemporaryDirectory() as directory:
source = Path(directory)
for name, body in {
"main.c": "int rust_entry(void); int main(void) { return rust_entry() != 22; }\n",
"rust.c": "int adapter_value(void); int rust_entry(void) { return adapter_value(); }\n",
"fallback.c": "int adapter_value(void) { return 99; }\n",
"recording-link-support.c": "int adapter_value(void) { return 22; }\n",
"unused-link-support.c": "int unavailable(void); int unused_adapter(void) { return unavailable(); }\n",
}.items():
(source / name).write_text(body)
(source / "CMakeLists.txt").write_text(
"cmake_minimum_required(VERSION 3.28)\nproject(isolated_recording C)\n"
"set(MSVC FALSE)\n"
"add_library(libobs_rust-static STATIC rust.c)\n"
"add_library(support STATIC fallback.c)\n"
# The root project reads fragments before creating graph targets.
f'include("{(ROOT / "test/cmocka/tests.d/test_texture_file_data_steps.cmake").as_posix()}")\n'
"add_executable(test_texture_file_data_steps_rust main.c recording-link-support.c unused-link-support.c)\n"
"target_link_libraries(test_texture_file_data_steps_rust PRIVATE libobs_rust-static)\n"
f'include("{HELPER.as_posix()}")\n'
"obs_rust_static_consumers(support missing_owner)\n"
)
build = source / "build"
self.run_command(["cmake", "-S", str(source), "-B", str(build)])
self.run_command(["cmake", "--build", str(build)])
self.run_command([str(build / "test_texture_file_data_steps_rust")])

def test_real_logger_members_preserve_fixture_owned_guards(self):
with tempfile.TemporaryDirectory() as directory:
source = Path(directory)
Expand Down
1 change: 0 additions & 1 deletion libobs/build/libobs.media+.h.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@

#include "libobs/graphics/graphics-ffmpeg-init-adapter.c.h"
#include "libobs/graphics/graphics-ffmpeg.c.h"
#include "libobs/graphics/graphics-texture-file-data.c.h"
#include "libobs/media-io/media-remux-ffmpeg.c.h"
#include "libobs/media-io/video-scaler-ffmpeg.c.h"
4 changes: 4 additions & 0 deletions libobs/build/libobs.ported-texture-file-data+.h.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* Original legacy image-file orchestration, C reference only. */
#include "libobs/build/libobs-media.pch.h"

#include "libobs/graphics/graphics-texture-file-data.c.h"
5 changes: 5 additions & 0 deletions libobs/build/ported-source-sets/texture-file-data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"LIBOBS_PORTED_SOURCES": [
"build/libobs.ported-texture-file-data+.h.c"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gs_create_texture_file_data
1 change: 1 addition & 0 deletions rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ The private output starting/encoder-demand queries use lazy safe Rust decisions
| `libobs/graphics/graphics-shader-matrix-queries.c.h` | `obs-graphics::shader_matrix_queries` | Swapped in hybrid `libobs` (Refs #5185; prerequisite #5132/#5184). Safe Rust checks context before shader, then private C adapters dispatch the viewproj/world callback with the exact shader pointer and return the borrowed parameter unchanged, NULL included. Exact LOG_DEBUG messages and single dispatch agree with the reference-only C and a verbatim legacy oracle. Tier 1 mirrors unchanged `test_shader_matrix_queries`; Tier 3 compares boundary matrices and bounded random sequences through the real ABI and adapters in the existing Graphics category binary. No intentional differences; Tier 4 does not apply. |
| `libobs/graphics/graphics-target-size.c.h` | `obs-graphics::target_size` | Swapped in hybrid `libobs` (Refs #5100; prerequisite #5087/#5107). Safe Rust checks context before private C layout/dispatch adapters, preserves zero scalar defaults and untouched outputs without context, and forwards nullable/aliased outputs unchanged. Exact LOG_DEBUG messages, device/output identities and single matching callbacks agree with the reference-only C and verbatim legacy oracle. Tier 1 mirrors unchanged `test_graphics_target_size`; Tier 3 covers boundary and bounded random queries in the existing Graphics category binary. No intentional differences; Tier 4 does not apply. |
| `libobs/graphics/graphics-texture-copy.c.h` | `obs-graphics::texture_copy` | Swapped in hybrid `libobs` (Refs #5062; prerequisite #5074/#5059). Safe Rust preserves context-before-pointer validation, whole-copy destination-then-source guards and region-copy destination-only validation, including NULL sources, aliasing and all six unchanged offsets/extents. Private C adapters own layout and backend dispatch. Exact LOG_DEBUG messages, device and texture identity match the reference-only original C and verbatim Tier 3 legacy oracle. Tier 1 mirrors unchanged `test_graphics_texture_copy`; Tier 3 compares boundary matrices and bounded random inputs through the real ABI and adapters in the existing Graphics category binary. No intentional differences; Tier 4 does not apply. |
| `libobs/graphics/graphics-texture-file-data.c.h` | `obs-graphics::texture_file_data` | Legacy straight-alpha image-file orchestration in safe Rust, behind a thin C ABI shim. The private C session owns FFmpeg layouts, initialization, callback identities and decode; successful metadata is published before cleanup, failures preserve outputs, and the pixel allocation remains caller-owned. Unchanged C characterization plus real-loader coverage run OFF/ON; the Rust-static recording fixture reaches the Rust export. Graphics category tests mirror the characterization and compare the unchanged C oracle against the Rust export with recording dependencies. No intentional differences; Tier 4 is inapplicable. |
| `libobs/graphics/graphics-viewport.c.h` | `obs-graphics::viewport` | Full-target viewport, pixel-space projection and optional maximum-texture capability policy (#4429). Context validation and backend dispatch remain C; callback zero overrides API fallbacks. Unchanged public-API C characterization, safe-core tests and exact original-C differential traces. No intentional differences. |
| `libobs/graphics/shader-file.c.h` | `obs-graphics::shader_file` | File-backed vertex/pixel shader creation (#4306). Preserves context-first validation, reader semantics, exact logs, constructor argument identity and source cleanup. Tier 1 mirrors the C characterization; Tier 3 compares all control paths with the original C. No intentional differences. |
| `libobs/graphics/shader-param-values.c.h` | `obs-graphics::shader_param_values` | Swapped in hybrid `libobs` (group `libobs.ported-graphics`, beside `shader-param-names.c.h`). The number reads of the shader parser (#3468), moved out of `shader-parser.c` first (an extraction into its own live group, checked old against new C over 1,758,330 scripted scenarios in 8 builds), as three functions declared in the internal `graphics/shader-param-values.h` without `EXPORT` and hidden (`shader-parser.h` is public and unchanged): `shader_param_array_count` (the count of `sp_parse_param_array`: `valid_int_str()` on the token's length, then `strtol()`; written only when valid), `shader_param_int_value` and `shader_param_float_value` (the `int` and `float` values of `sp_parse_param_assign_intfloat`: `strtol()` or `(float)os_strtod()` of the number token's text, negated after a `-` token). The `int` is the effect parser's rule (`effect_param_types::int_value_by`, #3464), so both parsers read the same `int` the same way, and the count reads with its `valid_int_str` and `strtol` steps; the float reads what `os_strtod()`'s `strncpy()` copies, each byte once up to the NUL or 63 bytes, and converts the copy with libobs's `os_strtod` through the private adapter `obs_graphics_os_strtod` (`obs-graphics-adapter.c.h`), so obs-graphics never pulls obs-util's host code into the cmocka `*_rust` tests that link the staticlib. `shader-parser.c` keeps every token call, the `CFTOKEN_NUM` tests, the `-` token, the value count of a `floatN` or `floatNxM` default (each byte read in place), the push of each value and every `cf_adderror()`. Characterized, not endorsed, and kept: a float or hex token reads as its leading digits as an `int` or a count; a count checks only the token's length while `strtol()` reads every digit after it; a float past `FLT_MAX` is an infinity, and `os_strtod()` reads at most 63 bytes; a bad row or column digit of `floatNxM` adds its error and still counts (`float5` keeps five values, `float1x` none). Two intentional differences (#3468): past `INT_MAX` the C depends on the width of `long` (an `int` of `4294967297` reads as 1 and a count of `3000000000` as -1294967296 on Linux and macOS; both saturate before the sign on Windows); the port reads the digits exactly and applies the sign, then saturates an `int` to `INT_MIN..INT_MAX` (the effect parser's rule) and refuses a count outside it, so `sp_parse_param_array` fails as for a count that is not a number, on every platform. A null text, which the C hands to `strtol()` or `os_strtod()`, reads as `""` and false. Tests: `test_shader_param_values_steps` (the moved C; no `_rust` variant, as its edge cases are the intentional difference) and `test_shader_number_defaults` (`shader_parse()` through the real libobs), Tier 1 `shader::shader_param_values`, Tier 3 `shader::shader_param_values_parity` (fixed tokens with more digits after them, random texts of up to 25 bytes at every length, float texts around 63 bytes, values outside `int` checked against the fixed contract). |
Expand Down
2 changes: 2 additions & 0 deletions rust/obs-build/tests/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ mod canonical_source_show_active_counters_swap_is_registered;
mod canonical_source_showing_active_swap_is_registered;
#[path = "native/registration/canonical_source_texcoords_centered_setter_swap_is_registered.rs"]
mod canonical_source_texcoords_centered_setter_swap_is_registered;
#[path = "native/registration/canonical_texture_file_data_swap_is_registered.rs"]
mod canonical_texture_file_data_swap_is_registered;
#[path = "native/registration/canonical_websocket_helpers_is_registered.rs"]
mod canonical_websocket_helpers_is_registered;
#[path = "native/graph_host_configurations.rs"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,21 @@ static CASES: std::sync::LazyLock<Vec<String>> =
#[test]
fn canonical_rust_static_graphics_are_registered() {
let graph = rust_static_entries::assert_family(FAMILY);
assert_eq!(CASES.len(), 6);
assert_eq!(CASES.len(), 7);
for windows in [false, true] {
for msvc in [false, true] {
for available in [false, true] {
let facts = [
("HAVE_LIBOBS_RUST_STATIC".into(), available),
("OS_WINDOWS".into(), windows),
("OS_LINUX".into(), !windows),
("OS_FREEBSD".into(), false),
("MSVC".into(), msvc),
]
.into();
let selected = graph.select(&facts).unwrap();
assert_eq!(selected.targets.len(), if available { 6 } else { 0 });
assert_eq!(selected.tests.len(), if available { 6 } else { 0 });
assert_eq!(selected.targets.len(), if available { 7 } else { 0 });
assert_eq!(selected.tests.len(), if available { 7 } else { 0 });
}
}
}
Expand Down
Loading
Loading