You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rust: Port graphics/effect-parser lifecycle to obs-graphics #1644
Extract ep_free verbatim from libobs/graphics/effect-parser.c.h into libobs/graphics/effect-parser-lifecycle.c.h, then port that lifecycle unit to obs-graphics in a later PR.
Phase and position
Phase 6, the effect/shader parser item of #444. This is the first effect-parser slice; parsing, shader text generation and graphics-device compilation remain out of scope.
Dependencies and existing tests
The cleanup routine uses the existing effect-parser header-inline destructors, darray/dstr/bmem and cf-parser cleanup. No dedicated cmocka characterization exists for ep_free. Add it before the Rust port, covering empty and repeated cleanup, nested parameters/annotations, structs, functions, samplers, techniques/passes and populated lexer/preprocessor state.
Decisions
First PR is C-only: behavior-neutral extraction plus characterization. No public header, signature or existing C test changes.
ep_free is an internal, non-EXPORT symbol. The test compiles the extracted original C source and links libobs for its dependencies, explicitly documenting that this is source-only characterization, not proof of a future Rust symbol swap. The later port must establish the Rust test seam and layout/parity coverage.
Pin current ownership: owned strings/arrays are released; borrowed effect pointers and dependency strings remain caller-owned. No graphics device is required.
No Rust implementation in this first PR; RED/GREEN and differential coverage belong to the subsequent port.
Extract the existing cleanup routine verbatim into its own C implementation file in the same unity group.
Add source-only cmocka characterization for nested ownership, empty/repeated cleanup and populated parser state; preserve public headers and existing tests.
Validate locally, including a temporary mutation check, then open the C-only characterization PR against master and follow its required CI.
First PR expected this session. The Rust implementation is a subsequent PR.
Characterization PR: #1646 at 91ff26f. The ep_free extraction is byte-for-byte unchanged. All eight original-C cases pass locally on macOS arm64 with ASan/UBSan; a temporary missing-parameter-cleanup mutation fails two allocation-balance cases. Required upstream PR CI is running. The test is explicitly source-only because ep_free is hidden; Rust implementation remains a subsequent PR.
Characterization PR #1646 is ready for review at 91ff26f. Required CI Gate is green, including Fast Gate and all four Linux OFF/ON Tier 2 shards; logs explicitly confirm test_effect_parser_lifecycle passed in both modes. Native macOS arm64 also passed all eight cases with ASan/UBSan. The claim remains for the subsequent Rust port; no Rust implementation is included here.
Scope remains ep_free, not the header-inline destructors. A safe Rust core owns iteration order, collection cleanup and parser reset; a private C adapter invokes the existing unchanged header-inline destructors. No public header or exported ABI changes.
Keep ep_free hidden. In addition to the existing C-source characterization, build the same unchanged C test against the production Rust staticlib and private adapter, so the Rust implementation is exercised without exporting a test API from libobs.
Add Tier 1 cases to the existing graphics test executable; add C layout and differential coverage against the extracted original C. A temporary core mutation must fail parity.
Draft PR opens with the failing RED commit; GREEN follows separately. Keep it draft until current-head CI is green.
Activity
nathan-v commentedon Oct 21, 2026
Claiming: #1644, effect-parser lifecycle (
ep_free).First PR expected this session. The Rust implementation is a subsequent PR.
nathan-v commentedon Oct 21, 2026
Characterization PR: #1646 at 91ff26f. The ep_free extraction is byte-for-byte unchanged. All eight original-C cases pass locally on macOS arm64 with ASan/UBSan; a temporary missing-parameter-cleanup mutation fails two allocation-balance cases. Required upstream PR CI is running. The test is explicitly source-only because ep_free is hidden; Rust implementation remains a subsequent PR.
nathan-v commentedon Oct 21, 2026
Characterization PR #1646 is ready for review at 91ff26f. Required CI Gate is green, including Fast Gate and all four Linux OFF/ON Tier 2 shards; logs explicitly confirm test_effect_parser_lifecycle passed in both modes. Native macOS arm64 also passed all eight cases with ASan/UBSan. The claim remains for the subsequent Rust port; no Rust implementation is included here.
nathan-v commentedon Oct 21, 2026
Continuing #1644 with the Rust RED/GREEN port.
Decisions:
ep_free, not the header-inline destructors. A safe Rust core owns iteration order, collection cleanup and parser reset; a private C adapter invokes the existing unchanged header-inline destructors. No public header or exported ABI changes.ep_freehidden. In addition to the existing C-source characterization, build the same unchanged C test against the production Rust staticlib and private adapter, so the Rust implementation is exercised without exporting a test API from libobs.