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 util/cf-lexer.c (cf preprocessor) to obs-util #1499
Port libobs/util/cf-lexer.c.h (the former cf-lexer.c) to obs-util: the cf preprocessor (cf_preprocessor_init, cf_preprocessor_free, cf_preprocess, cf_preprocessor_add_def, cf_preprocessor_remove_def) and its internal steps (#include, #define with and without parameters, #undef, #ifdef/#ifndef/#else/#endif, define expansion).
Phase and position
Phase 3, lexer/parser step 3, deferred follow-up tracked by #43. After this, the libobs.util-cf group is Rust: the tokenizer is already in obs-util::cf_tokenizer, and cf-parser.c in obs-util::cf_parser (#1466). It also opens graphics/shader-parser.c and the effect parser for a later port.
Dependencies and existing tests
Uses obs_util::cf_tokenizer, obs_util::lexer (strref, base_token), dstr, darray layout and os_quick_read_utf8_file (Rust since #1444). Callers: graphics/effect-parser.c, graphics/shader-parser.c, and callback/decl (which does not run the preprocessor in the Rust port).
test/cmocka/test_cf_lexer.c covers #define, #ifdef/#else, preprocessor errors and add/remove of defines. Not covered yet: #include (local and system include, include directories, missing file, nested include), function-like macros with parameters, #undef, #ifndef, nested conditionals and recursive define expansion. A C-only characterization PR for these comes first.
Notes
Preserve public headers, exported signatures, token and preprocessor layouts and existing C tests. The port follows docs/rust-port/testing-policy.md: RED then GREEN, Tier 1 mirrors, layout checks, differential parity against the C oracle on arbitrary input (including invalid UTF-8 and unterminated directives), file tests in their own temp directories, unchanged Tier 2 OFF/ON. No intended behavior changes; any difference is listed in the parity test header and rust/README.md.
Current authorized work is the claim and the characterization PR; the Rust implementation follows separately.
Plan: one C-only characterization PR first (the gaps listed above, in test/cmocka/test_cf_lexer.c or a new test_cf_preprocessor.c), then the port PR (RED on a todo!() core, then GREEN, with differential parity against the oracle).
Claiming: #1499 — cf preprocessor Rust port. Taking over stale claim from @vpacher; C characterization #1502 is merged.
Mirror the existing C assertions in the existing Rust test category against safe-core stubs, record RED, and open a draft PR targeting master in this session.
Implement the safe core and C ABI adapter, real-header layout checks, and differential C-oracle coverage; preserve existing C tests and public headers.
Run local lint and Rust/Tier 2 OFF/ON CI before pushing GREEN, then wait for current-head PR CI to pass before marking ready for review.
@nathan-v Please hold off on this claim for now and check with @zackees first. The #1499 port is tied to related work that is still being coordinated with Zach, and a port branch already exists. Starting in parallel would likely duplicate or conflict with it. Sorry the claim went stale; I should have refreshed it.
Activity
vpacher commentedon Oct 20, 2026
Claiming: #1499
Plan: one C-only characterization PR first (the gaps listed above, in
test/cmocka/test_cf_lexer.cor a newtest_cf_preprocessor.c), then the port PR (RED on atodo!()core, then GREEN, with differential parity against the oracle).test: characterize the cf preprocessor before its port (Refs obs-rust…
test: characterize the cf preprocessor before its port (Refs obs-rust…
nathan-v commentedon Oct 22, 2026
Claiming: #1499 — cf preprocessor Rust port. Taking over stale claim from @vpacher; C characterization #1502 is merged.
vpacher commentedon Oct 22, 2026
@nathan-v Please hold off on this claim for now and check with @zackees first. The #1499 port is tied to related work that is still being coordinated with Zach, and a port branch already exists. Starting in parallel would likely duplicate or conflict with it. Sorry the claim went stale; I should have refreshed it.
nathan-v commentedon Oct 22, 2026
Just saw your note. I'll drop the PR. No worries!
nathan-v commentedon Oct 22, 2026
Releasing #1499 — handing it to @vpacher. The original work remains active; the stale claim was a missed refresh. Duplicate PR #1807 is closed.
vpacher commentedon Oct 24, 2026
Blocked: waiting on non-public work that is coordinated with a maintainer.
17 remaining items
vpacher commentedon Nov 8, 2026
Blocked: waiting on non-public work that is coordinated with a maintainer.
vpacher commentedon Nov 16, 2026
Blocked: waiting on non-public work that is coordinated with a maintainer.
github-actions commentedon Nov 16, 2026
Claim bot: @vpacher, nothing is claimed here, so there is no claim to mark blocked.
vpacher commentedon Nov 16, 2026
Claiming: #1499
vpacher commentedon Nov 16, 2026
Blocked: waiting on non-public work that is coordinated with a maintainer.
vpacher commentedon Nov 23, 2026
Blocked: waiting on non-public work that is coordinated with a maintainer.