Skip to content

graphics: extract and characterize GPU metadata queries (Refs #5094) - #5286

Merged
rdoupe merged 2 commits into
masterfrom
test/5094-gpu-metadata
Nov 19, 2026
Merged

rdoupe merged 2 commits into
masterfrom
test/5094-gpu-metadata

Conversation

@rdoupe

@rdoupe rdoupe commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Refs #5094

C-only prerequisite for the Rust swap of the four GPU metadata queries. gs_get_driver_version, gs_get_renderer, gs_get_gpu_dmem and gs_get_gpu_smem move verbatim out of libobs/graphics/graphics.c.h into libobs/graphics/graphics-gpu-metadata.c.h, which joins the existing libobs.graphics unity group (same shape as the device-query extraction, #5079). The private thread_graphics and gs_valid it needs are declared ahead, as that one does.

Characterization

New test/cmocka/test_graphics_gpu_metadata.c (recording backend, no GPU), registered in test-graph.json with a tests.d pointer:

  • no_context: each entry returns NULL / 0 and logs exactly <name>: called while not in a graphics context at LOG_DEBUG, once per call, with callbacks installed and absent; no callback runs.
  • absent_callbacks: in a context with the optional slot NULL, each returns its default silently.
  • each_slot_dispatches_alone: distinct callbacks prove each entry calls only its own slot, once, with the graphics context current; clearing two slots leaves the other two dispatching.
  • strings_returned_unchanged: NULL, an empty string, caller-owned and static strings come back as the same pointer, with no bmalloc and the string untouched.
  • memory_values_bit_for_bit: 0, 1, 2^32-1, 2^32, the high bit, a mixed pattern and UINT64_MAX (and their complements on the other slot) come back unchanged.

RED → GREEN

  • RED 3292c1c6c (test only): gcc -fsyntax-only -std=gnu17 -I libobs -I <cmocka include> test/cmocka/test_graphics_gpu_metadata.c →
    error: #error "graphics GPU-metadata extraction seam is missing" (the only diagnostic).

  • GREEN f9c9c9d31 (extraction): OBS_CTEST_JOBS=10 uv run rust/tools/linux-validate/run.py --repeat 2 --tests "test_graphics_gpu_metadata|test_graphics_device_queries" →

    • libobs exported symbols, C vs Rust: IDENTICAL (1769 symbols)
    • [OFF] (C reference, /build/tree/libobs-c-reference/libobs.so.30): 100% tests passed, 0 tests failed out of 1040, then the repeat out of 2
    • [ON] (hybrid): 100% tests passed, 0 tests failed out of 1040, then the repeat out of 2

    The test has no skip(), so Passed means all five cases ran. Mode OFF is the original C, so the characterization holds against it before any swap.

  • ./lint: lane lint: ok.

No public header, existing C test, Rust code or OBS WebSocket change. No user-visible change, so no features-ledger line. The Rust swap (Tier 1 mirror, Tier 3 differential and mutation coverage, ported group) follows as its own issue once this lands.

🤖 Generated with Claude Code

rdoupe and others added 2 commits November 19, 2026 16:01
Refs #5094. RED: the test stops at its seam guard, because
libobs/graphics/graphics-gpu-metadata.c.h does not exist yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refs #5094. Move gs_get_driver_version, gs_get_renderer, gs_get_gpu_dmem
and gs_get_gpu_smem verbatim into graphics-gpu-metadata.c.h in the
graphics unity group, keeping the original private context validator.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ci-Attestation: {"at":1795123665,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["3292c1c6ccf3ab08e4d0fc6f78dfc25643c4746e"],"secs":95,"stamp":"66f650aa204a5b1d2a0a72560ca484e3","tree":"218fa662c803389324529df8bdba792ed5c5974d","v":1,"via":"run"}
Ci-Attestation: {"at":1795123665,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["3292c1c6ccf3ab08e4d0fc6f78dfc25643c4746e"],"secs":95,"stamp":"a733f94becd14dff910cd54208cf9e28","tree":"218fa662c803389324529df8bdba792ed5c5974d","v":1,"via":"run"}
Ci-Attestation: {"at":1795123665,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["3292c1c6ccf3ab08e4d0fc6f78dfc25643c4746e"],"secs":95,"stamp":"07c3aa3e19297f6e59791ee8223a7072","tree":"218fa662c803389324529df8bdba792ed5c5974d","v":1,"via":"run"}
Ci-Attestation: {"at":1795123665,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["3292c1c6ccf3ab08e4d0fc6f78dfc25643c4746e"],"secs":95,"stamp":"5ea3b1330cc74ef636da39f2378f5ef9","tree":"218fa662c803389324529df8bdba792ed5c5974d","v":1,"via":"run"}
Ci-Attestation: {"at":1795123568,"gate":"general/all/client-lint","host":"linux-x86_64","key":"5d88a23015ce6b87f9b583e29e449f92310bd578bb0c159fe4d89e6c1364c70d","lane":"client-lint","parents":["3292c1c6ccf3ab08e4d0fc6f78dfc25643c4746e"],"secs":65,"stamp":"29b201caf596d337174873145caa2e6e","tree":"218fa662c803389324529df8bdba792ed5c5974d","v":1,"via":"run"}
Ci-Attestation: {"at":1795123665,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["3292c1c6ccf3ab08e4d0fc6f78dfc25643c4746e"],"secs":95,"stamp":"a22208a4dc97f895dcb9c2230dec36ec","tree":"218fa662c803389324529df8bdba792ed5c5974d","v":1,"via":"run"}
Ci-Attestation: {"at":1795123569,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"5d88a23015ce6b87f9b583e29e449f92310bd578bb0c159fe4d89e6c1364c70d","lane":"client-lint","parents":["3292c1c6ccf3ab08e4d0fc6f78dfc25643c4746e"],"secs":65,"stamp":"528eb8827c1ee42cd26af300abc2b0fa","tree":"218fa662c803389324529df8bdba792ed5c5974d","v":1,"via":"run"}
Ci-Attestation: {"at":1795123569,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"5d88a23015ce6b87f9b583e29e449f92310bd578bb0c159fe4d89e6c1364c70d","lane":"client-lint","parents":["3292c1c6ccf3ab08e4d0fc6f78dfc25643c4746e"],"secs":65,"stamp":"00862b92239ef8617ac46fb5a91ca5c5","tree":"218fa662c803389324529df8bdba792ed5c5974d","v":1,"via":"run"}
Ci-Attestation: {"at":1795123568,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"5d88a23015ce6b87f9b583e29e449f92310bd578bb0c159fe4d89e6c1364c70d","lane":"client-lint","parents":["3292c1c6ccf3ab08e4d0fc6f78dfc25643c4746e"],"secs":65,"stamp":"a9f70b0ccac031554c265f749cc114c3","tree":"218fa662c803389324529df8bdba792ed5c5974d","v":1,"via":"run"}
Ci-Attestation: {"at":1795123568,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"5d88a23015ce6b87f9b583e29e449f92310bd578bb0c159fe4d89e6c1364c70d","lane":"client-lint","parents":["3292c1c6ccf3ab08e4d0fc6f78dfc25643c4746e"],"secs":65,"stamp":"4dba916871db290f8c78ec2025a20dcc","tree":"218fa662c803389324529df8bdba792ed5c5974d","v":1,"via":"run"}
Ci-Attestation: {"at":1795123568,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"5d88a23015ce6b87f9b583e29e449f92310bd578bb0c159fe4d89e6c1364c70d","lane":"client-lint","parents":["3292c1c6ccf3ab08e4d0fc6f78dfc25643c4746e"],"secs":65,"stamp":"448f4b545884afb7853f09326cee1cb2","tree":"218fa662c803389324529df8bdba792ed5c5974d","v":1,"via":"run"}
Ci-Attestation: {"at":1795123568,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"5d88a23015ce6b87f9b583e29e449f92310bd578bb0c159fe4d89e6c1364c70d","lane":"client-lint","parents":["3292c1c6ccf3ab08e4d0fc6f78dfc25643c4746e"],"secs":65,"stamp":"9cabbd0804a451554f2be3003cd33722","tree":"218fa662c803389324529df8bdba792ed5c5974d","v":1,"via":"run"}
Ci-Attestation: {"at":1795123568,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"5d88a23015ce6b87f9b583e29e449f92310bd578bb0c159fe4d89e6c1364c70d","lane":"client-lint","parents":["3292c1c6ccf3ab08e4d0fc6f78dfc25643c4746e"],"secs":65,"stamp":"2034cfcf73dfe0ac9f4782f0e7666ae3","tree":"218fa662c803389324529df8bdba792ed5c5974d","v":1,"via":"run"}
Ci-Attestation: {"at":1795123568,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"5d88a23015ce6b87f9b583e29e449f92310bd578bb0c159fe4d89e6c1364c70d","lane":"client-lint","parents":["3292c1c6ccf3ab08e4d0fc6f78dfc25643c4746e"],"secs":65,"stamp":"e67aea8d158b9d1ff97efa0e4a590437","tree":"218fa662c803389324529df8bdba792ed5c5974d","v":1,"via":"run"}
Ci-Attestation: {"at":1795123568,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"5d88a23015ce6b87f9b583e29e449f92310bd578bb0c159fe4d89e6c1364c70d","lane":"client-lint","parents":["3292c1c6ccf3ab08e4d0fc6f78dfc25643c4746e"],"secs":65,"stamp":"1d404c03e0f77824fbfa481d8ec82961","tree":"218fa662c803389324529df8bdba792ed5c5974d","v":1,"via":"run"}
Ci-Attestation: {"at":1795123568,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"5d88a23015ce6b87f9b583e29e449f92310bd578bb0c159fe4d89e6c1364c70d","lane":"client-lint","parents":["3292c1c6ccf3ab08e4d0fc6f78dfc25643c4746e"],"secs":65,"stamp":"6890d97d0d644648a43f3f1e5a8054dc","tree":"218fa662c803389324529df8bdba792ed5c5974d","v":1,"via":"run"}
Ci-Attestation: {"at":1795123568,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"5d88a23015ce6b87f9b583e29e449f92310bd578bb0c159fe4d89e6c1364c70d","lane":"client-lint","parents":["3292c1c6ccf3ab08e4d0fc6f78dfc25643c4746e"],"secs":65,"stamp":"d52d96b16d169f98e746a4f9e989b995","tree":"218fa662c803389324529df8bdba792ed5c5974d","v":1,"via":"run"}
Ci-Attestation: {"at":1795123568,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"5d88a23015ce6b87f9b583e29e449f92310bd578bb0c159fe4d89e6c1364c70d","lane":"client-lint","parents":["3292c1c6ccf3ab08e4d0fc6f78dfc25643c4746e"],"secs":65,"stamp":"00fca5a9c4e73fa34146177c70b25c57","tree":"218fa662c803389324529df8bdba792ed5c5974d","v":1,"via":"run"}
Ci-Attestation: {"at":1795123884,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"3f0335dd4324768b07768642fdea6cb082c55f77badbdaf67527418d24767b43","lane":"client-test-x86_64-unknown-linux-gnu","parents":["3292c1c6ccf3ab08e4d0fc6f78dfc25643c4746e"],"secs":219,"stamp":"0e0383bd4fd5184db0aae036b98df438","tree":"218fa662c803389324529df8bdba792ed5c5974d","v":1,"via":"run"}

Client-Checks: {"checks":{"base":"fb7d018d535fabef94fc62230556ce620132f294","coverage":"all-tracked-applicable-files","diff":[".github/workflows/build-project.yaml",".github/workflows/ci.yml","ci/run_base_runner_selector.py","ci/select_mq_runner.py","ci/test_ci_scope.py","ci/test_member_pr_routing.py","ci/test_soldr_cache_report.py","ci/test_tier2_build_setup.py","ci/test_tier2_configure.py","ci/test_tier2_modcache.py","ci/tier2_configure.py","docs/ci-tooling.md","docs/features.md","libobs/audio-monitoring/null/null-audio-monitoring-reference.c.h","libobs/audio-monitoring/null/null-audio-monitoring.c.h","libobs/audio-monitoring/null/null-audio-monitoring.h","libobs/build/libobs-nix.pch.h","libobs/build/libobs-ported-null-audio-monitoring.pch.h","libobs/build/libobs.graphics+.h.c","libobs/build/libobs.ported-null-audio-monitoring+.h.c","libobs/build/ported-source-sets/nix-null-audio-monitoring.json","libobs/cmake/rust-hidden.d/obs-audio-monitoring-null_monitoring.txt","libobs/graphics/graphics-gpu-metadata.c.h","libobs/graphics/graphics.c.h","rust/README.md","rust/obs-audio-monitoring/Cargo.toml","rust/obs-audio-monitoring/src/ffi/mod.rs","rust/obs-audio-monitoring/src/ffi/null_monitoring.rs","rust/obs-audio-monitoring/src/lib.rs","rust/obs-audio-monitoring/src/null_monitoring.rs","rust/obs-audio-monitoring/tests/audio_monitoring/main.rs","rust/obs-audio-monitoring/tests/audio_monitoring/null_monitoring.rs","rust/obs-audio-monitoring/tests/audio_monitoring/null_monitoring_parity.rs","rust/obs-build/tests/native/registration/rust-static/cases/core-relinked/test_null_audio_monitoring.json","rust/obs-c-oracle/oracle/null_monitoring.c","rust/obs-c-oracle/src/lib.rs","rust/obs-c-oracle/src/null_monitoring.rs","rust/tools/linux-validate/validate.sh","test/cmocka/build/test-graph.json","test/cmocka/test_graphics_gpu_metadata.c","test/cmocka/tests.d/test_graphics_gpu_metadata.cmake"],"head":"cf2e2f4217df51acaccb2ecf051181b88903059e","tools":{"orchestrator-python":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]","schema-dependencies":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]\n{'jsonschema': '4.26.0', 'json_source_map': '1.0.5'}","uv":"uv 0.13.5 (x86_64-unknown-linux-gnu)","xmllint":"xmllint: using libxml version 21504-GITv2.15.4\n   compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ICU ISO8859X Regexps Automata RelaxNG Schemas Schematron Modules Debug Zlib"},"tracked-digest":"3b10b0c4b8879e960f86b020622c9875a572dfa219aae6f18bde1bafbacfa939","tree":"218fa662c803389324529df8bdba792ed5c5974d"}}
@rdoupe
rdoupe requested a review from zackees as a code owner November 19, 2026 21:31
@rdoupe rdoupe changed the title graphics: extract GPU metadata entry points without behavior changes graphics: extract and characterize GPU metadata queries (Refs #5094) Nov 19, 2026
@rdoupe
rdoupe enabled auto-merge November 19, 2026 21:32
@rdoupe
rdoupe added this pull request to the merge queue Nov 19, 2026
Merged via the queue into master with commit bea1a54 Nov 19, 2026
46 checks passed
@rdoupe
rdoupe deleted the test/5094-gpu-metadata branch November 19, 2026 22:13
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