Skip to content

patina_internal_depex: Report protocol present status#1552

Open
yangrongwei wants to merge 4 commits into
OpenDevicePartnership:mainfrom
uefi-lab:ray-report-depex-log
Open

patina_internal_depex: Report protocol present status#1552
yangrongwei wants to merge 4 commits into
OpenDevicePartnership:mainfrom
uefi-lab:ray-report-depex-log

Conversation

@yangrongwei

@yangrongwei yangrongwei commented Jun 3, 2026

Copy link
Copy Markdown

Description

Add log filter patina_depex_report

When this filter is set to Debug or left unset, pi_dispatcher.rs reports a detailed dependency list for each "found but not dispatched" driver in Debug builds.

  • [ N] Impacts functionality?
  • [ N] Impacts security?
  • [ N] Breaking change?
  • [ N] Includes tests?
  • [ N] Includes documentation?

How This Was Tested

Tested on real hardware.

Integration Instructions

Examples for logger

// Configure Advanced Logger
static LOGGER: AdvancedLogger<Foo> = AdvancedLogger::new(
    Format::Standard,
    &[
    // ..
        TargetFilter { target: "patina_depex_report", log_level: LevelFilter::Debug, hw_filter_override: None,},
   //..
    ],
);

@patina-automation

patina-automation Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

❌ QEMU Readiness Check Failed

patina-dxe-core-qemu needs to be updated before QEMU validation can run.

  • Local patina workspace version: 21.1.1 (major: 21)
  • patina dependency in patina-dxe-core-qemu: 22 (major: 22)
  • Latest release (informational only):
    • Latest patina release major: 22 (tag: patina-v22.0.0)

Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/27128469252

Dependencies

Repository Ref
patina f02fd80
patina-dxe-core-qemu d4bf009
patina-fw-patcher 1958fd4
patina-qemu firmware v4.0.1
patina-qemu build script 1b77360

Note: Previous results are available in this comment's edit history.

This comment was automatically generated by the Patina QEMU PR Validation Post workflow.

@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.83333% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
patina_dxe_core/src/pi_dispatcher.rs 92.86% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment thread patina_dxe_core/src/pi_dispatcher.rs Outdated

match &mut driver.depex {
Some(depex) => {
depex.eval_with_report(&PROTOCOL_DB.registered_protocols());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rather than this approach, which will print out the hard to parse depex report, e.g.:

Image

I would suggest we print out something nicer here. I know this can get a little hairy because depex statements are allowed to get complex, but in practice we typically don't see very complex ones.

i.e. instead of the stack of true and false, I would hope to see a report like:

Driver X failed to dispatch because GUID Y was not found.
Driver Z failed to dispatch because GUID alpha was found and GUID beta was not found.

etc. I think that is feasible and a lot easier to parse from the logs.

@Javagedes @makubacki thoughts?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I agree that should be explored here while the feature is being added. We should be able to map back image names from PDB paths and/or UI sections to the module GUID.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@os-d
I’ll figure out a way to make this nicer, based on my understanding.

@makubacki
I’ll keep this in mind. I also have a more aggressive idea.

@yangrongwei yangrongwei Jun 6, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

If we prefer "nicer", to balance verbosity and correctness, my understanding is this:
Trying to construct an expression tree from the DEPEX op list, then report the false node in the evaluation.
I feel this might be a bit too aggressive for debug code.

This problem shifts from the computer engineering domain to the computer science domain.
We are trying to touch the SAT (Boolean Satisfiability) problem.

After reviewing the cost-benefit tradeoffs against our purpose, we decided to use a "simpler" format. This format reports the present status of dependent protocols. Engineers can then open the corresponding INF file (or build report) and perform a one-to-one mapping check.

One ref for SAT: https://people.eecs.berkeley.edu/~sseshia/219c/spr16/lectures/SATSolving.pdf

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is the updated format.

a) The detail report section is marked as Debug.
b) Intentionally use the same leading description for DXE in the summary table.

image

@antklein antklein requested a review from Copilot June 3, 2026 17:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a detailed “DEPEX evaluation report” logging path to help diagnose why drivers remain pending/not dispatched.

Changes:

  • Added optional detailed pending-driver reporting in the PI dispatcher guarded by a log-enabled check.
  • Introduced a Depex::eval_with_report API that logs DEPEX evaluation under a dedicated log target.
  • Switched DEPEX debug logs to use explicit log targets (default vs report).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
patina_dxe_core/src/pi_dispatcher.rs Adds a “detail report” loop that logs pending drivers and evaluates DEPEX with reporting enabled.
core/patina_internal_depex/src/lib.rs Adds report log target constants and routes DEPEX debug output through an overridable target via eval_with_report.

Comment thread patina_dxe_core/src/pi_dispatcher.rs Outdated
Comment thread patina_dxe_core/src/pi_dispatcher.rs Outdated
Comment thread patina_dxe_core/src/pi_dispatcher.rs Outdated
Comment thread core/patina_internal_depex/src/lib.rs Outdated
Comment thread core/patina_internal_depex/src/lib.rs Outdated
@makubacki makubacki self-requested a review June 3, 2026 18:38
@yangrongwei yangrongwei changed the title patina_internal_depex: Report eval steps on demand patina_internal_depex: Report protocol present status Jun 6, 2026
@yangrongwei yangrongwei force-pushed the ray-report-depex-log branch from aa8fa25 to 2726141 Compare June 7, 2026 01:29
Comment thread patina_dxe_core/src/pi_dispatcher.rs
@yangrongwei yangrongwei force-pushed the ray-report-depex-log branch from 2726141 to f02fd80 Compare June 8, 2026 09:14
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.

5 participants