Skip to content

fix(video): fail probe when decoder reports failure - #29

Merged
programmersd21 merged 1 commit into
programmersd21:mainfrom
Luquatic:fix/video-probe-failure-result
Sep 30, 2026
Merged

programmersd21 merged 1 commit into
programmersd21:mainfrom
Luquatic:fix/video-probe-failure-result

Conversation

@Luquatic

@Luquatic Luquatic commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Small follow-up to #28 addressing the remaining CodeRabbit finding.

  • Require more than 30 decoded frames and a non-failed decoder state for result: PASS.
  • Use the same state snapshot for diagnostics and the verdict.
  • Return a nonzero exit status for failed probes, allowing benchmark callers to reject failed runs.
  • Add regression coverage for failure after sufficient frames and the existing frame-count threshold.

Verification

  • cargo fmt --all --check
  • cargo test -p wallr-core --example video_probe
  • cargo clippy -p wallr-core --example video_probe -- -D warnings
  • git diff --check

This changes only the standalone diagnostic probe; wallpaper playback is unaffected.

Summary by Sourcery

Ensure video probe results require both sufficient decoded frames and a healthy decoder state, and propagate failures through the process exit status.

Bug Fixes:

  • Make the video probe fail when the decoder enters a failed state, even after decoding enough frames.
  • Return a nonzero exit status when the probe verdict is FAIL.

Enhancements:

  • Use a single decoder-state snapshot for probe diagnostics and pass/fail evaluation.

Tests:

  • Add regression coverage for failed decoders and the frame-count pass threshold.

Summary by CodeRabbit

  • Bug Fixes
    • The video probe now reports failure when decoder initialization fails or when decoding does not meet the success criteria. It reports success only when more than 30 frames are decoded and the decoder has not failed, making its exit status reflect the probe result.

@sourcery-ai

sourcery-ai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

The standalone video probe now reports PASS only when it decodes more than 30 frames and ends in a non-failed decoder state, using one state snapshot for output and evaluation; it also propagates probe failure through a nonzero exit status and adds regression tests for the decision boundaries.

Flow diagram for video probe pass and exit status

flowchart TD
    A[Start video_probe] --> B[Decode video and count frames]
    B --> C["state = decoder.decoder_state()"]
    C --> D[Print diagnostics using state]
    D --> E{"probe_passed(count, state)"}
    E -->|count > 30 and state != Failed| F[Print PASS]
    F --> G[Return ExitCode SUCCESS]
    E -->|Otherwise| H[Print FAIL]
    H --> I[Return ExitCode FAILURE]
Loading

File-Level Changes

Change Details Files
Make probe success depend on both decoded-frame count and the final decoder state, while returning the result through the process exit code.
  • Snapshot the decoder state once and reuse it for diagnostics and verdict evaluation.
  • Require more than 30 frames and reject the failed decoder state.
  • Return success for passing probes and failure for failed probes, including initialization errors.
  • Preserve successful handling of the capabilities mode.
wallr-core/examples/video_probe.rs
Add focused regression tests for the probe pass/fail criteria.
  • Verify a failed decoder cannot pass despite producing many frames.
  • Cover the existing frame-count boundary at 30 and 31 frames.
  • Verify active software and hardware states pass when the frame threshold is met.
wallr-core/examples/video_probe.rs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 5019bffa-cc7a-4045-986e-873a7d339b72

📥 Commits

Reviewing files that changed from the base of the PR and between 766ef43 and 8d928d6.

📒 Files selected for processing (1)
  • wallr-core/examples/video_probe.rs

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

The video probe now returns an exit code. Decoder initialization failure returns failure. Otherwise, the probe reports decoder state and returns success only when more than 30 frames were decoded and the state is not Failed.

Changes

Video probe result

Layer / File(s) Summary
Probe execution and result
wallr-core/examples/video_probe.rs
The probe returns an exit code for the capabilities path and decoder initialization failure. It checks frame count and decoder state to set the final result. A unit test covers the threshold and decoder states.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: programmersd21

Merge Risk: 🔵 Low · up to 8d928

A long video can pass the probe’s frame threshold before a later decoding error is reported, allowing a false PASS. The issue is confined to the diagnostic probe and would require decoder synchronization changes, so the PR is mergeable with bounded follow-up.

Architecture Summary

Architecture risk: 🟡 Medium · up to 8d928

The change affects 1 system.

Changed systems: wallr-core

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — wallr-core (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in wallr-core/examples/video_probe.rs: The probe imports ExitCode and DecoderState, and main now returns an exit code. The --capabilities path returns ExitCode::SUCCESS instead of returning from a () function.
  • observed — Modified behavior in wallr-core/examples/video_probe.rs: Decoder initialization failure now returns ExitCode::FAILURE instead of terminating the process with exit(1).
  • observed — Modified behavior in wallr-core/examples/video_probe.rs: The probe now prints the decoder state once, uses it with the frame count to determine the result, and returns success or failure accordingly. Previously, the result depended only on whether more than 30 frames were decoded.
  • observed — Modified behavior in wallr-core/examples/video_probe.rs: Adds probe_passed, which passes only when the frame count is greater than 30 and the decoder state is not Failed, plus a test covering the threshold and failed, software-active, and hardware-active states.

Reliability and maintainability

  • inferred — Risk-relevant change factors for wallr-core: blast_radius_1; direct_dependents_1
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: the video probe now fails when the decoder reports failure.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@programmersd21
programmersd21 merged commit 4ad4fb8 into programmersd21:main Sep 30, 2026
3 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