Skip to content

fix: verify 10-bit probe succeeded before advertising - #5690

Merged
ReenigneArcher merged 6 commits into
LizardByte:masterfrom
bitness:fix/yuv444-10bit-advertisement
Oct 17, 2026
Merged

ReenigneArcher merged 6 commits into
LizardByte:masterfrom
bitness:fix/yuv444-10bit-advertisement

Conversation

@bitness

@bitness bitness commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Description

These changes make Sunshine separately track encoder probe results for 10-bit encoding with 4:2:0 and 4:4:4 chroma subsampling, and verifies that the probes succeeded before advertising support for those configurations. Without these patches, Sunshine conflates a successful 8-bit YUV 4:4:4 encoding probe with the ability to encode 10-bit YUV 4:4:4, which isn't always the case on some hardware or driver/API combinations.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

See our AI usage policy.

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@bitness bitness changed the title fix certain 10-bit advertisements fix: verify 10-bit advertisements before advertising Sep 11, 2026
@bitness bitness changed the title fix: verify 10-bit advertisements before advertising fix: verify 10-bit probe succeeded before advertising Sep 11, 2026
@bitness

bitness commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Hmm, SonarQube is displeased with the new variables I added not being const, but I just followed the pattern set by an existing variable that serves a similar purpose.

@ReenigneArcher

Copy link
Copy Markdown
Member

Sunshine has a lot of existing sonar issues. I'll review if these should be fixed or not. Thanks.

@ReenigneArcher ReenigneArcher left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The separate 10-bit capability checks address the reported 8-bit/10-bit advertisement mismatch. An isolated MSYS2 UCRT64/gtest harness using the current head's advertisement function and probe-result assignments passed four tests, including 18,432 mode/capability combinations. Please add the required regression coverage to the PR before merging.

Correction: the new arrays follow the established mutable probe-capability cache pattern. Under the maintainer's policy, the cpp:S5421 warnings do not require a refactor for this PR; that inline finding has been withdrawn and resolved. The request for changes now concerns only the missing regression tests.

Verification limit: this was isolated logic validation, not a full Sunshine build or hardware encoder test. Native CI, lint, and CodeQL await maintainer workflow approval; the GH-Pages Read the Docs failure is a timeout waiting for that unstarted workflow, not a demonstrated code failure. The current head is mergeable against master.

Comment thread src/nvhttp.cpp
Comment thread src/video.h
@bitness
bitness force-pushed the fix/yuv444-10bit-advertisement branch 2 times, most recently from 9a5bd66 to 53be22b Compare October 16, 2026 00:10

@ReenigneArcher ReenigneArcher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The core advertisement fix is still needed on current master, and the new tests cover the reported 8-bit/10-bit 4:4:4 mismatch and probe-result replacement. Two items remain: fix the two new enum-related Sonar findings in the test body, and add the missing negative 10-bit 4:2:0 advertisement cases for HEVC and AV1. Both inline comments include copyable corrections.

The four cpp:S5421 findings are the previously discussed mutable probe-result arrays. They still follow the existing accepted pattern; I am not reopening the withdrawn refactor request.

Validation: an isolated MSYS2 UCRT64/gtest harness using this head's real project headers and extracted production function bodies passed all nine added PR tests. A second copy incorporating the suggested enum changes and two additional rejection cases passed all 11 tests. This was not a full Sunshine build, hardware encoder validation, or a new Sonar analysis.

Workflow status: native CI, common lint, CodeQL, and GH-Pages workflows await maintainer approval; the linked GH-Pages Read the Docs build is cancelled, not evidence of a change-related code failure. Head 53be22be099456312ebd5d38434766bd5f9dfb28 is mergeable against current master with no confirmed conflicts.

Review completed by Codex | Model: gpt-6.1-sol | Thinking: xhigh

Comment thread tests/unit/test_nvhttp_codec_flags.cpp
Comment thread tests/unit/test_nvhttp_codec_flags.cpp
@bitness
bitness force-pushed the fix/yuv444-10bit-advertisement branch from 53be22b to 648aee8 Compare October 16, 2026 21:25
ReenigneArcher
ReenigneArcher previously approved these changes Oct 17, 2026
This makes it easier for tests to access the mode flags produced by
probing.
Having this code in separate functions makes it possible for tests to
call them without duplicating their functionality.
Adds two arrays that store the probe results for h264, hevc, and av1's
10-bit 4:2:0 and 4:4:4 encoding support. The naming scheme for the
arrays follows the codebase's use of "dynamic_range" to indicate 10-bit,
even though these results can be used for SDR and HDR encoding.
With this change, 10-bit 444 encoder advertisement will correctly
reflect the results of the encoder probes.

Before it, the code used the probe result for 8-bit 444 encoding to
decide whether or not to advertise 10-bit 444 encoding, but not all
hardware can do both. (Mostly it seems like older Intel Media Engines
and older VA-API versions make up that category.) In those cases, the
code would still offer the 10-bit 444 advertisement, but if the client
selected it, it wouldn't have worked.
This helps ensure that Sunshine won't advertise incorrect codec
capabilities to clients.
@ReenigneArcher
ReenigneArcher force-pushed the fix/yuv444-10bit-advertisement branch from 648aee8 to f4ffa2b Compare October 17, 2026 00:34
@codecov

codecov Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

Comment thread tests/unit/test_nvhttp_codec_flags.cpp
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
4 New issues
4 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@codecov

codecov Bot commented Oct 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.93939% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.31%. Comparing base (d2250f2) to head (d906c04).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/video.cpp 93.10% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5690      +/-   ##
==========================================
+ Coverage   49.20%   49.31%   +0.11%     
==========================================
  Files         114      114              
  Lines       24789    24820      +31     
  Branches    10709    10718       +9     
==========================================
+ Hits        12197    12240      +43     
- Misses      10165    11839    +1674     
+ Partials     2427      741    -1686     
Flag Coverage Δ
Alpine-aarch64 30.71% <69.69%> (+0.20%) ⬆️
Alpine-x86_64 30.83% <69.69%> (+0.19%) ⬆️
Archlinux 28.48% <69.69%> (+0.20%) ⬆️
FreeBSD-amd64 30.49% <93.93%> (+0.28%) ⬆️
Homebrew-macos-15 46.97% <80.64%> (+0.24%) ⬆️
Homebrew-macos-26 47.36% <80.64%> (+0.27%) ⬆️
Homebrew-ubuntu-24.04 31.46% <69.69%> (+0.19%) ⬆️
Linux-AppImage-aarch64 33.62% <69.69%> (+0.18%) ⬆️
Linux-AppImage-x86_64 33.86% <69.69%> (+0.18%) ⬆️
PowerShell 100.00% <ø> (ø)
Web-UI 56.65% <ø> (ø)
macOS-arm64 38.88% <93.93%> (+0.38%) ⬆️
macOS-x86_64 39.46% <93.93%> (+0.37%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/nvhttp.cpp 68.13% <100.00%> (+1.37%) ⬆️
src/nvhttp.h 96.15% <ø> (ø)
src/video.h 63.56% <ø> (ø)
src/video.cpp 57.76% <93.10%> (+0.50%) ⬆️

... and 33 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d2250f2...d906c04. Read the comment docs.

@github-actions

Copy link
Copy Markdown
Last Updated 2026-10-17 01:47:43 UTC
Source Run CI Run #6349
Commit d906c04856205418cce05dae602ebae369b5d473

Screenshot Comparison

PR #5690 screenshots vs screenshots baseline.

Matrix: AppImage-aarch64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: AppImage-x86_64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: macOS-arm64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: macOS-x86_64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

@ReenigneArcher
ReenigneArcher merged commit 1582fff into LizardByte:master Oct 17, 2026
79 of 84 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants