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/shader-sampler-convert.c to obs-graphics #1716
Port shader_sampler_convert from libobs/graphics/shader-parser.c.h, extracted verbatim to libobs/graphics/shader-sampler-convert.c.h, to the existing obs-graphics crate.
Phase and position
Phase 6 (#444): independent sampler-state conversion slice. The name lookups are already ported (#839); parsing and the claimed cf preprocessor are outside this scope.
Dependencies and existing tests
Uses shader_sampler and gs_sampler_info, astrcmpi, strtol and the existing get_sample_filter/get_address_mode functions. No focused conversion test was found. First add C characterization covering defaults, all recognized states, case-insensitive names, duplicates, unknown states and defined numeric conversions. Preserve public headers and existing tests.
Plan and notes
Current authorization is a C-only behavior-neutral extraction and characterization PR. Preserve the signature and owning unity group. The function is exported in shader-parser.h: link characterization against the real libobs symbol so the unchanged test reaches the future Rust swap. Rust RED/GREEN, layout and differential parity follow separately. No intended behavior changes; no protocol surface.
Claiming: shader_sampler_convert extraction and characterization (#1716).
Extract the C function verbatim into shader-sampler-convert.c.h in the existing graphics unity group; preserve signature, public headers and behavior.
Add C characterization against the real exported libobs function, covering defaults, all state names, case-insensitivity, duplicates/unknowns and portable numeric edge cases. Run against C reference and hybrid.
Open a C-only characterization PR today. Rust implementation follows separately.
Correction to the initial scoping note: shader-parser.h declares shader_sampler_convert with EXPORT. The new test will link the actual libobs symbol and will therefore exercise the future Rust swap; source-only testing is unnecessary.
Commit 2319a00 preserves the C function body and adds six characterization groups against the exported libobs symbol. All six pass against an existing native library and against the extracted routine in a scratch ASan/UBSan harness. A default-anisotropy mutation fails five groups. The Rust port has not started.
Characterization #1718 is fully green after the requested rebase (head eebb004; run 39737568724) and is ready. Rust port draft: #1750
RED 63e33e4: all six Tier 1 mirrors fail at the todo stub. GREEN is local only: nine focused tests and the 223-test graphics category pass; a wrong-default mutation fails fixed and randomized differential checks. Public headers and C characterization assertions remain unchanged. Numeric conversion stays at the native strtol boundary, with output/errno parity against the original C.
Running full local Linux lint/Rust/cross lanes, Docker OFF/ON Tier 2 and native macOS Rust workspace tests before pushing GREEN. The Rust PR remains draft until its final-head CI is completely green.
Characterization #1718 passed all CI after the requested rebase (eebb004, run 39737568724), was marked ready only after CI Gate passed, and has now merged.
Remote RED 63e33e4 completed CI run 39738851100: the six intended sampler mirrors fail at todo!, while Linux Tier 2 build and both C-reference/hybrid test jobs pass. That is expected RED evidence.
The Rust branch has been rebased onto master d71d985. Local commits are now RED b41d4f6 and GREEN d80b8a262. GREEN is NOT pushed. It adds the read-only safe core, native strtol boundary, ABI shim/export and production swap, real-C oracle/layout/errno parity, randomized cases and defined null-state/address-value coverage. Existing C tests/public headers are unchanged. No intended behavior differences.
Exact local GREEN validation:
Full native workspace tests and doctests passed, including all 224 graphics tests.
rustfmt, workspace Clippy with warnings denied, and Dylint passed.
56 focused policy tests passed.
A wrong-default mutation fails fixed and randomized differential tests; it was restored before committing.
Linux validation is incomplete, not green: initial local lint found/fixed oracle module ordering; container scratch/path failures were corrected. x86 compiler probes crash under both installed and newer user-mode emulation. Native Linux OFF/ON build was started, but the shared 3.8 GB Podman VM became unresponsive to Docker API and SSH during compilation. Attempts to stop only my containers have not reliably completed. The native macOS cross attempt also cannot find the Windows SDK headers. No local attestation is claimed.
Per the maintainer’s requirement, GREEN remains local while Linux/cross checks are unresolved, and this Rust PR remains draft. Restarting the shared Podman VM would interrupt existing whera application containers, so restart authorization has been requested rather than doing that implicitly. No shared VM restart, unrelated source fix or GREEN push has occurred.
Activity
nathan-v commentedon Oct 22, 2026
Claiming: shader_sampler_convert extraction and characterization (#1716).
Correction to the initial scoping note: shader-parser.h declares shader_sampler_convert with EXPORT. The new test will link the actual libobs symbol and will therefore exercise the future Rust swap; source-only testing is unnecessary.
nathan-v commentedon Oct 22, 2026
C-only characterization and extraction PR: #1718
Commit 2319a00 preserves the C function body and adds six characterization groups against the exported libobs symbol. All six pass against an existing native library and against the extracted routine in a scratch ASan/UBSan harness. A default-anisotropy mutation fails five groups. The Rust port has not started.
nathan-v commentedon Oct 22, 2026
Characterization #1718 is fully green after the requested rebase (head eebb004; run 39737568724) and is ready. Rust port draft: #1750
RED 63e33e4: all six Tier 1 mirrors fail at the todo stub. GREEN is local only: nine focused tests and the 223-test graphics category pass; a wrong-default mutation fails fixed and randomized differential checks. Public headers and C characterization assertions remain unchanged. Numeric conversion stays at the native strtol boundary, with output/errno parity against the original C.
Running full local Linux lint/Rust/cross lanes, Docker OFF/ON Tier 2 and native macOS Rust workspace tests before pushing GREEN. The Rust PR remains draft until its final-head CI is completely green.
nathan-v commentedon Oct 22, 2026
Characterization #1718 passed all CI after the requested rebase (eebb004, run 39737568724), was marked ready only after CI Gate passed, and has now merged.
Remote RED 63e33e4 completed CI run 39738851100: the six intended sampler mirrors fail at todo!, while Linux Tier 2 build and both C-reference/hybrid test jobs pass. That is expected RED evidence.
The Rust branch has been rebased onto master d71d985. Local commits are now RED b41d4f6 and GREEN d80b8a262. GREEN is NOT pushed. It adds the read-only safe core, native strtol boundary, ABI shim/export and production swap, real-C oracle/layout/errno parity, randomized cases and defined null-state/address-value coverage. Existing C tests/public headers are unchanged. No intended behavior differences.
Exact local GREEN validation:
Linux validation is incomplete, not green: initial local lint found/fixed oracle module ordering; container scratch/path failures were corrected. x86 compiler probes crash under both installed and newer user-mode emulation. Native Linux OFF/ON build was started, but the shared 3.8 GB Podman VM became unresponsive to Docker API and SSH during compilation. Attempts to stop only my containers have not reliably completed. The native macOS cross attempt also cannot find the Windows SDK headers. No local attestation is claimed.
Per the maintainer’s requirement, GREEN remains local while Linux/cross checks are unresolved, and this Rust PR remains draft. Restarting the shared Podman VM would interrupt existing whera application containers, so restart authorization has been requested rather than doing that implicitly. No shared VM restart, unrelated source fix or GREEN push has occurred.