Skip to content

obs-graphics: Port the shader-parser name lookups - #844

Merged
zackees merged 3 commits into
masterfrom
port/shader-param-names-rust
Oct 15, 2026
Merged

zackees merged 3 commits into
masterfrom
port/shader-param-names-rust

Conversation

@zackees

@zackees zackees commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Refs #839 (step 3).

RED (obs-graphics: Test the shader-parser name lookups against todo!() stubs): get_shader_param_type, get_sample_filter, get_address_mode shims in obs-graphics over todo!() cores. Tier 1 aborts on todo!("shader param names port (#839)").

  • Tier 1 tests/shader_param_names.rs: 1:1 port of test_shader_param_names (test: Characterize the shader-parser name lookups before port #843).
  • Tier 2 ENABLE_RUST_LIBOBS=ON drops graphics/shader-param-names.c; exports in rust-exports.d/obs-graphics-shader_param_names.txt.
  • Tier 3 tests/shader_param_names_parity.rs: every name either side knows, in its own, lower and upper case and with a trailing space or letter, plus random names and random bytes (1–255), against the original compiled as oracle_* with the C dstr.c (astrcmpi, astrcmp_n).

GREEN (obs-graphics: Port the shader-parser name lookups): exact byte matches for strcmp, ASCII case-insensitive whole-string matches for astrcmpi, and a texture prefix test for astrcmp_n, in the C's order with its fallbacks. A follow-up commit links obs-util into the parity test, since the oracle's C dstr.c needs bmem on the windows-gnu link (RED's CI shows that link failure).

Intentional difference: a null name gives the fallback (UNKNOWN, LINEAR) where C calls strcmp(NULL). get_address_mode(NULL) is CLAMP in both (C's astrcmpi reads NULL as ""), and parity checks it.

Local:

  • Tier 1 and Tier 3 green; ci/local_gate.py --lane rust-test ok (includes the Windows cross build).
  • Mutation: matching MIN_MAG_MIP_POINT case-insensitively fails known_names_in_every_case.
  • Tier 2 rust/tools/linux-validate/run.sh: 249/249 OFF and ON, test_shader_param_names repeated.
  • ./lint ok.

@zackees
zackees marked this pull request as ready for review October 15, 2026 21:10
…bs (RED)

get_shader_param_type, get_sample_filter and get_address_mode shims
over todo!() cores.
- Tier 1 (tests/shader_param_names.rs): 1:1 port of
  test_shader_param_names.
- Tier 3 (tests/shader_param_names_parity.rs): every known name in its
  own, lower and upper case and with trailing noise, random names and
  bytes, against shader-param-names.c compiled as oracle_* with the C
  dstr.c.
- ENABLE_RUST_LIBOBS=ON drops graphics/shader-param-names.c.

Refs #839
Exact byte matches for strcmp, ASCII case-insensitive whole-string
matches for astrcmpi, and a "texture" prefix test for astrcmp_n, in
the C's order with its fallbacks (unknown type, linear filter, clamp).

Refs #839
The oracle's C dstr.c needs bmem, which the windows-gnu link only finds
when the test references obs-util.

Refs #839
@zackees
zackees force-pushed the port/shader-param-names-rust branch from 0aee745 to afbcdd5 Compare October 15, 2026 21:15
@zackees

zackees commented Oct 15, 2026

Copy link
Copy Markdown
Member Author

#840 and #843 merged; rebased onto master: replaced head 0aee745d0 with afbcdd504 (RED, GREEN and the obs-util link fix only), verified on the remote. Tier 1 and Tier 3 pass after the rebase.

@zackees
zackees enabled auto-merge October 15, 2026 21:20
@zackees
zackees added this pull request to the merge queue Oct 15, 2026
Merged via the queue into master with commit 4d869b3 Oct 15, 2026
23 checks passed
@zackees
zackees deleted the port/shader-param-names-rust branch October 26, 2026 15:46
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