Skip to content

libobs: characterize and extract shader sampler conversion - #1718

Merged
zackees merged 1 commit into
obs-rust:masterfrom
nathan-v:test/shader-sampler-convert
Oct 22, 2026
Merged

zackees merged 1 commit into
obs-rust:masterfrom
nathan-v:test/shader-sampler-convert

Conversation

@nathan-v

@nathan-v nathan-v commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Refs #1716; Phase 6 #444. This is the C-only extraction and characterization checkpoint; the Rust port follows separately.

What and why

Move shader_sampler_convert verbatim from shader-parser.c.h into shader-sampler-convert.c.h in the same graphics unity group. Its signature, public headers, layouts and behavior are unchanged. No Rust, existing C test, PCH or workflow is changed.

Add test_shader_sampler_convert to the cmocka aggregate. Six groups call the real exported libobs function without a parser/device: default reset and unknown keys; every filter mode; each address axis and aliases; signed decimal anisotropy and partial parsing; hex border colors and skipped first character; all fields together and duplicate last-write precedence. Inputs avoid undefined or platform-dependent overflow. The test remains useful unchanged when Rust replaces the symbol.

Characterization evidence

  • Extracted function body verified byte-for-byte against master (the trailing separator blank line is removed).
  • Six groups pass against an existing native libobs build (baseline evidence, not a rebuilt final-head library).
  • The exact extracted function, compiled in a scratch harness using real headers and libobs lookup dependencies, passes all six groups under ASan/UBSan.
  • A scratch mutation changing default anisotropy from 1 to 2 fails five groups; no mutation is committed.
  • 48 focused build-group, sanitizer/registration and platform-boundary tests passed; the platform ratchet and pinned C/CMake formatting checks passed.
  • Full ./lint was attempted: unrelated macOS SDK compilation failures and host path/harness assertions prevent a local pass. No local-gate attestation claimed.
  • ./unittest: all native workspace tests passed (2,021 tests plus doctests; one ignored). The umbrella script then stopped because soldr does not support Windows GNU cross-checks on this macOS host, before Tier 2. The direct full Linux Tier 2 build stopped after zccache connection losses/retry and unrelated WebSocket/frontend-header build failures. Reusing its completed final-head libraries through the repository Docker harness, the new test passes all six groups against BOTH C reference and hybrid; ldd confirms selection and dynamic exports are identical (1,766 symbols). This is focused coverage, not a full local-suite pass. PR CI supplies the full final-head result.

RED → GREEN

Not applicable to this behavior-neutral C extraction/characterization checkpoint. The tests pass on original C; Rust RED and GREEN are a separate PR. No user-visible behavior or protocol change, so no feature-ledger entry or live-app run applies.

Checklist

  • Base is master
  • Claimed rust: Port graphics/shader-sampler-convert.c to obs-graphics #1716 before editing; no overlapping open PR found
  • Characterization precedes Rust port; no existing C tests or public headers edited
  • No behavior change, warning/flag changes, new workflow or Rust implementation
  • Final-head CI watched to completion; aggregate gate failed on an unrelated portal timeout (details below)

Final-head CI outcome

Run https://github.com/obs-rust/obs-studio/actions/runs/39726429717 tested 2319a0001a3d653f89cc1934c50a3611ce7adc58 to completion. Formatting, data validation, Fast Gate and Tier 2 build passed. Hybrid Tier 2 completed all 356 registered tests with no failures (environment-dependent skips remain). The new sampler characterization passed in BOTH modes.

C-reference completed with one failure out of 356: unchanged test_screencast_portal_teardown hit its 20-second alarm (signal 14, line 330). That test passed in hybrid CI in 1.75 seconds and then passed three consecutive local reproductions per library (six runs, 1.74–1.76 seconds). No portal code was changed. This evidence points to an intermittent test/environment timeout; it does not prove the portal test is defect-free.

@nathan-v

nathan-v commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Final-head CI run 39726429717: Fast Gate, formatting, validation and Tier 2 build passed. Hybrid Tier 2: 356/356 registry entries completed with no failures (environment-dependent skips remain). The new test_shader_sampler_convert passed in hybrid (0.03 s) and C reference (0.02 s).

C-reference had one unrelated failure: test_screencast_portal_teardown, reply_during_destroy_is_dropped, hit its alarm(20), signal 14 at test line 330. The same unchanged test passed in hybrid CI in 1.75 s. Reproducing it through the existing Docker harness against the final-head libraries passed three consecutive times per library (six runs, 1.74–1.76 s each). The PR changes no portal code, and no sampler state/graphics device is created by that test. This points to an intermittent test/environment timeout, not evidence of a sampler defect.

@nathan-v

nathan-v commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Final-head CI is terminal. The aggregate gate failed solely on the C-reference portal-test alarm timeout described above; sampler characterization passed in both modes, and all other required lanes passed. PR remains draft. A maintainer needs to rerun failed C-reference job 119654556984 and watch the resulting required gate. No unrelated test/code change or additional push was made.

@nathan-v
nathan-v force-pushed the test/shader-sampler-convert branch from 2319a00 to eebb004 Compare October 22, 2026 07:00
@nathan-v

Copy link
Copy Markdown
Contributor Author

On the maintainer’s explicit instruction, rebased the characterization commit onto current master 8c69615, replacing 2319a00 with eebb004 using an exact force-with-lease. Fresh run: https://github.com/obs-rust/obs-studio/actions/runs/39737568724

Waiting for the characterization CI gate to pass before beginning Rust RED → GREEN. The characterization assertions/public headers remain immutable. Before any GREEN push I will run the applicable local CI checks, with Linux validation in Docker; the PR stays draft until all required CI is green.

@nathan-v
nathan-v marked this pull request as ready for review October 22, 2026 07:10
@nathan-v

Copy link
Copy Markdown
Contributor Author

Rebased characterization head eebb004 is fully green: https://github.com/obs-rust/obs-studio/actions/runs/39737568724 (CI Gate, Fast Gate, Linux Tier 2 build and complete C-reference/hybrid test jobs). Marked this C-only prerequisite ready.

Proceeding with the separately auditable Rust RED → GREEN port in its own draft PR, initially stacked on this extraction. GREEN will not be pushed until the applicable local checks have passed, including Linux Docker validation. The Rust PR will remain draft until its final-head CI is green.

@nathan-v
nathan-v requested a review from zackees as a code owner October 22, 2026 07:10
@zackees
zackees added this pull request to the merge queue Oct 22, 2026
Merged via the queue into obs-rust:master with commit 224b56c Oct 22, 2026
25 checks passed
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.

2 participants