Skip to content

Filter disabled Windows GPU adapters and order by DXGI enumeration - #3087

Merged
dbwiddis merged 1 commit into
oshi:masterfrom
dbwiddis:default-graphics
Mar 10, 2026
Merged

dbwiddis merged 1 commit into
oshi:masterfrom
dbwiddis:default-graphics

Conversation

@dbwiddis

@dbwiddis dbwiddis commented Mar 10, 2026 •

Copy link
Copy Markdown
Member

When DXGI is available, getGraphicsCards() now excludes ghost adapters (stale registry/WMI entries from hardware no longer physically present) and returns the list ordered by DXGI enumeration order, which guarantees the primary desktop adapter is first.

  • Registry path: registry entries with no matching DXGI adapter are skipped
  • WMI fallback path: entries with ConfigManagerErrorCode != 0 are skipped; DXGI ordering applied when adapters are available
  • When DXGI is unavailable, existing behavior is preserved (all entries, registry key order)

Fixes #2670

Summary by CodeRabbit

  • Bug Fixes

    • Filtered out disabled/ghost Windows GPU adapters and improved DXGI-based ordering for more accurate graphics card detection
    • Improved fallback behavior and VRAM handling when DXGI is unavailable
  • Documentation

    • Updated changelog entry formatting and added a new note about filtering and DXGI ordering
    • Updated copyright year and minor DXGI docs/comments

@coderabbitai

coderabbitai Bot commented Mar 10, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3226b7c9-261b-4d9c-a131-b2b7b22a2414

📥 Commits

Reviewing files that changed from the base of the PR and between a3ef7d8 and 03a5dd2.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • oshi-core/src/main/java/oshi/driver/windows/wmi/Win32VideoController.java
  • oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsGraphicsCard.java
  • oshi-core/src/main/java/oshi/jna/platform/windows/WindowsDxgi.java
🚧 Files skipped from review as they are similar to previous changes (2)
  • CHANGELOG.md
  • oshi-core/src/main/java/oshi/jna/platform/windows/WindowsDxgi.java
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Test JDK 25, macos-latest
  • GitHub Check: Test JDK 21, macos-latest
  • GitHub Check: Test JDK 11, macos-latest
  • GitHub Check: Test JDK 11, windows-latest
  • GitHub Check: Analyze (java)
🔇 Additional comments (8)
oshi-core/src/main/java/oshi/driver/windows/wmi/Win32VideoController.java (1)

26-28: LGTM!

The addition of CONFIGMANAGERERRORCODE to the enum enables ghost-adapter filtering in the WMI fallback path. The constant follows the existing naming convention and will be automatically included in WMI queries via the WmiUtil.queryToString() infrastructure.

oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsGraphicsCard.java (7)

39-53: Documentation accurately reflects the new behavior.

The class-level documentation clearly explains ghost-adapter filtering via DXGI enumeration and the primary-desktop-first ordering guarantee.


91-102: Clean initialization of DXGI data structures.

The match-and-consume pattern using remainingDxgi correctly prevents duplicate matches. TreeMap naturally orders by key, ensuring DXGI adapter 0 (primary desktop) appears first in the final result.


134-143: Correct DXGI matching and ghost-adapter filtering logic.

Using dxgiAdapters.indexOf() on the original list (not remainingDxgi) correctly preserves the DXGI enumeration order. The ghost-adapter detection is sound: registry entries without a DXGI match are excluded when DXGI is available.


163-174: Well-designed deferred removal pattern.

Removing dxgiMatch only after successful card construction ensures that if a Win32Exception is thrown during registry fallback reads (lines 146-149), the adapter remains available for subsequent iterations or WMI fallback. The comment at lines 163-166 clearly documents this intentional behavior.


183-190: Correct merge and fallback logic.

DXGI-ordered cards appear first (primary adapter at position 0), followed by any non-DXGI entries. Passing remainingDxgi to the WMI fallback ensures unconsumed adapters are still available for matching.


247-263: Minor pattern difference from registry path, but safe in context.

In the registry path, dxgiMatch removal is deferred until after card construction (lines 167-169) to handle potential Win32Exception. Here, removal at line 253 happens immediately. This is acceptable because:

  1. All WMI reads are already complete (data is in the WmiResult object)
  2. WmiUtil methods return default values rather than throwing exceptions
  3. The WindowsGraphicsCard constructor is straightforward

The slight inconsistency is not a defect, though aligning the patterns would improve maintainability.


216-221: Correct use of ConfigManagerErrorCode for ghost-device filtering.

The combined check (dxgiAvailable && ConfigManagerErrorCode != 0) correctly excludes ghost devices while preserving maximum compatibility when DXGI is unavailable. This complements the registry path's DXGI-match-based filtering.


📝 Walkthrough

Walkthrough

Implements DXGI-first graphics card enumeration with ghost-adapter filtering and DXGI-based ordering (primary-desktop first), preserves DXGI VRAM values and falls back to WMI when needed; adds CONFIGMANAGERERRORCODE to the Win32VideoController enum and minor changelog/comment punctuation edits.

Changes

Cohort / File(s) Summary
Changelog & DXGI binding
CHANGELOG.md, oshi-core/src/main/java/oshi/jna/platform/windows/WindowsDxgi.java
Minor formatting/comment punctuation changes and a new changelog entry for PR 3087.
WMI VideoController properties
oshi-core/src/main/java/oshi/driver/windows/wmi/Win32VideoController.java
Added CONFIGMANAGERERRORCODE constant to the VideoControllerProperty enum (public enum addition).
DXGI-aware graphics card enumeration
oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsGraphicsCard.java
Reworked enumeration to prefer DXGI: produce a DXGI-ordered primary-first list, consume DXGI matches to avoid duplicates, filter registry-only "ghost"/disabled adapters when DXGI is present, retain legitimate zero/64-bit VRAM values, map DXGI indices for ordering, and fall back to WMI if DXGI yields no results.

Sequence Diagram

sequenceDiagram
    participant Registry as Windows Registry
    participant DXGI as DXGI Enumeration
    participant Logic as Graphics Card Logic
    participant WMI as WMI Fallback
    participant Result as Graphics Cards List

    Logic->>Registry: Query registry video controller entries
    Registry-->>Logic: Registry controller data
    Logic->>DXGI: Query DXGI adapters (if available)
    alt DXGI Available
        DXGI-->>Logic: DXGI adapter list (with VRAM, indices)
        Logic->>Logic: Match registry entries to DXGI adapters (track dxgiIndex)
        Logic->>Logic: Consume matched DXGI entries to avoid duplicates
        Logic->>Logic: Filter out registry-only ghost/disabled adapters
        Logic->>Logic: Order results by DXGI enumeration (primary-desktop first)
        Logic-->>Result: DXGI-ordered cards + remaining non-DXGI cards
    else DXGI Not Available / Empty
        DXGI-->>Logic: No DXGI results
        Logic->>WMI: Query WMI for graphics cards
        WMI-->>Logic: WMI controller data
        Logic->>Logic: Build list from WMI (preserve VRAM semantics)
        Logic-->>Result: WMI-derived cards
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰
I hop through listings, sniff out the true,
DXGI leads — ghosts bid adieu,
Primary first, the lineup's fine,
VRAM kept safe, order by design,
Hooray — fewer duplicates, more carrot time! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. 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 pull request title accurately describes the primary change: filtering disabled GPU adapters and ordering results by DXGI enumeration.
Linked Issues check ✅ Passed The code changes successfully implement the objectives from issue #2670: filtering ghost/disabled adapters (via DXGI matching and ConfigManagerErrorCode checks) and ordering by DXGI enumeration to prioritize the primary desktop adapter.
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue objectives: enum addition for ConfigManagerErrorCode, DXGI-based filtering/ordering logic, and documentation updates are all in scope.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (2)
CHANGELOG.md (1)

8-8: Use hyphen instead of em dash for consistency.

Line 7 was just updated to use a hyphen delimiter, but this new entry uses an em dash. For consistency with line 7 and most other entries in the changelog, consider using a hyphen.

📝 Proposed fix
-* [`#3087`](https://github.com/oshi/oshi/pull/3087): Filter disabled Windows GPU adapters and order by DXGI enumeration — [`@dbwiddis`](https://github.com/dbwiddis).
+* [`#3087`](https://github.com/oshi/oshi/pull/3087): Filter disabled Windows GPU adapters and order by DXGI enumeration - [`@dbwiddis`](https://github.com/dbwiddis).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHANGELOG.md` at line 8, The changelog entry for PR `#3087` uses an em dash —
replace it with a hyphen to match the rest of the file's delimiter style; locate
the line containing "* [`#3087`](https://github.com/oshi/oshi/pull/3087): Filter
disabled Windows GPU adapters and order by DXGI enumeration —
[`@dbwiddis`](https://github.com/dbwiddis)." and change the em dash to a hyphen so
it reads "...DXGI enumeration - [`@dbwiddis`](https://github.com/dbwiddis)."
oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsGraphicsCard.java (1)

134-146: Consider deferring DXGI consumption until card creation succeeds.

The DXGI match is consumed from remainingDxgi at line 141 before the registry fallback operations (lines 149-151). If a Win32Exception is thrown during registry access and caught at line 171, the card won't be created but the DXGI entry is already removed. In the rare case where this affects all registry entries, the WMI fallback at line 184 would receive a depleted remainingDxgi, potentially causing incorrect ordering.

💡 Suggested fix: move consumption after card creation
                 long vram = -1L;
                 int dxgiIndex = -1;
                 DxgiAdapterInfo dxgiMatch = WindowsDxgi.findMatch(remainingDxgi, pciVendorId, pciDeviceId, name);
                 if (dxgiMatch != null) {
                     vram = dxgiMatch.getDedicatedVideoMemory();
                     dxgiIndex = dxgiAdapters.indexOf(dxgiMatch);
-                    // Consume the matched entry so it cannot be assigned to a second registry card
-                    // with the same PCI IDs (e.g. identical multi-GPU configurations).
-                    remainingDxgi.remove(dxgiMatch);
                 } else if (dxgiAvailable) {
                     // DXGI is available but this registry entry has no matching adapter:
                     // it is a ghost device (stale driver from hardware no longer present). Skip it.
                     continue;
                 }
                 
                 // ... existing fallback and normalization code ...
                 
                 GraphicsCard card = new WindowsGraphicsCard(Util.isBlank(name) ? Constants.UNKNOWN : name,
                         Util.isBlank(deviceId) ? Constants.UNKNOWN : deviceId,
                         Util.isBlank(vendor) ? Constants.UNKNOWN : vendor,
                         Util.isBlank(versionInfo) ? Constants.UNKNOWN : versionInfo, vram);
+                // Consume the matched entry after successful card creation so it cannot be
+                // assigned to a second registry card with the same PCI IDs.
+                if (dxgiMatch != null) {
+                    remainingDxgi.remove(dxgiMatch);
+                }
                 if (dxgiIndex >= 0) {
                     dxgiOrdered.put(dxgiIndex, card);
                 } else {
                     cardList.add(card);
                 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsGraphicsCard.java`
around lines 134 - 146, The DXGI entry (dxgiMatch) is being removed from
remainingDxgi before the registry-based card creation completes, which can
deplete remainingDxgi if a Win32Exception aborts creation; change the logic in
WindowsGraphicsCard so WindowsDxgi.findMatch(...) still identifies dxgiMatch and
sets dxgiIndex/vram, but defer calling remainingDxgi.remove(dxgiMatch) (and any
reliance on dxgiAdapters.indexOf(dxgiMatch)) until after the registry card
object is successfully constructed (i.e., after the code path that can throw
Win32Exception completes without error); ensure the removal only happens on
successful creation so DXGI entries remain available for subsequent fallback/WMI
processing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@CHANGELOG.md`:
- Line 8: The changelog entry for PR `#3087` uses an em dash — replace it with a
hyphen to match the rest of the file's delimiter style; locate the line
containing "* [`#3087`](https://github.com/oshi/oshi/pull/3087): Filter disabled
Windows GPU adapters and order by DXGI enumeration —
[`@dbwiddis`](https://github.com/dbwiddis)." and change the em dash to a hyphen so
it reads "...DXGI enumeration - [`@dbwiddis`](https://github.com/dbwiddis)."

In
`@oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsGraphicsCard.java`:
- Around line 134-146: The DXGI entry (dxgiMatch) is being removed from
remainingDxgi before the registry-based card creation completes, which can
deplete remainingDxgi if a Win32Exception aborts creation; change the logic in
WindowsGraphicsCard so WindowsDxgi.findMatch(...) still identifies dxgiMatch and
sets dxgiIndex/vram, but defer calling remainingDxgi.remove(dxgiMatch) (and any
reliance on dxgiAdapters.indexOf(dxgiMatch)) until after the registry card
object is successfully constructed (i.e., after the code path that can throw
Win32Exception completes without error); ensure the removal only happens on
successful creation so DXGI entries remain available for subsequent fallback/WMI
processing.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5f5a82bb-2489-4309-8868-4ef7aeeee45f

📥 Commits

Reviewing files that changed from the base of the PR and between 44425a7 and e581785.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • oshi-core/src/main/java/oshi/driver/windows/wmi/Win32VideoController.java
  • oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsGraphicsCard.java
  • oshi-core/src/main/java/oshi/jna/platform/windows/WindowsDxgi.java
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Test JDK 11, windows-latest
  • GitHub Check: Test JDK 25, windows-latest
  • GitHub Check: Test JDK 11, macos-latest
  • GitHub Check: Test JDK 25, macos-latest
  • GitHub Check: Analyze (java)
🔇 Additional comments (5)
CHANGELOG.md (1)

7-7: LGTM - Formatting consistency improvement.

The change from em dash to hyphen aligns with the formatting used in most other entries in the changelog.

oshi-core/src/main/java/oshi/jna/platform/windows/WindowsDxgi.java (1)

57-58: LGTM!

Documentation-only change; the updated comment format is clearer.

oshi-core/src/main/java/oshi/driver/windows/wmi/Win32VideoController.java (1)

26-28: LGTM!

The new CONFIGMANAGERERRORCODE enum constant follows the existing naming convention. WQL is case-insensitive, so this correctly queries the ConfigManagerErrorCode property from Win32_VideoController (where 0 indicates a properly working device).

oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsGraphicsCard.java (2)

39-54: LGTM!

The documentation clearly explains the VRAM detection priority, the 2 GiB cap workaround, and the ghost adapter filtering behavior. The addition of details about DXGI enumeration order guaranteeing the primary desktop adapter is first provides helpful context for API consumers.


201-261: LGTM!

The WMI fallback path correctly mirrors the registry path's DXGI ordering and ghost-adapter filtering logic. The ConfigManagerErrorCode != 0 check at lines 212-215 appropriately identifies disabled/error devices, and only applying this filter when DXGI is available preserves backward compatibility on older systems.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (2)
oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsGraphicsCard.java (2)

203-209: Consider clarifying parameter naming for dual usage.

The dxgiAdapters parameter serves two roles: (1) the reference list for indexOf lookups, and (2) the source for initializing the local remainingDxgi. While functionally correct, renaming to originalDxgiAdapters or adding a brief comment would clarify this isn't modified within the method.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsGraphicsCard.java`
around lines 203 - 209, The parameter dxgiAdapters in getGraphicsCardsFromWmi is
used both as the immutable reference for indexOf lookups and as the source for
creating remainingDxgi, which can be confusing; rename the parameter to
originalDxgiAdapters (or similar) and update all references within
getGraphicsCardsFromWmi (including where you construct new
ArrayList<>(remainingDxgi) and where you call indexOf) or alternatively add a
short comment above the declaration explaining that dxgiAdapters is
intentionally not mutated and that remainingDxgi is the working copy.

163-167: Comment is slightly imprecise but logic is correct.

The comment mentions "if a Win32Exception aborts here" but the card constructor doesn't throw. The actual benefit is that if registry reads earlier in the try block fail (lines 111-127), the DXGI entry remains unconsumed for subsequent iterations. The deferred consumption pattern is correct; the comment could be clearer.

📝 Suggested comment clarification
-                // Consume the matched DXGI entry only after successful card construction so it
-                // remains available for fallback/WMI processing if a Win32Exception aborts here.
+                // Consume the matched DXGI entry only after the full registry read succeeds,
+                // so it remains available if a Win32Exception from earlier registry operations
+                // causes this iteration to be skipped.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsGraphicsCard.java`
around lines 163 - 167, The existing comment in WindowsGraphicsCard near the
deferred consumption of dxgiMatch is misleading about the failure mode; update
the comment at the block that removes dxgiMatch from remainingDxgi to state that
the DXGI entry is only removed after successful card construction so it remains
available for fallback/WMI processing if earlier registry reads in the try block
fail, rather than referencing a non-existent Win32Exception from the
constructor; keep the deferred-removal logic as-is and mention the specific
symbols dxgiMatch and remainingDxgi to make the intent clear.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsGraphicsCard.java`:
- Around line 203-209: The parameter dxgiAdapters in getGraphicsCardsFromWmi is
used both as the immutable reference for indexOf lookups and as the source for
creating remainingDxgi, which can be confusing; rename the parameter to
originalDxgiAdapters (or similar) and update all references within
getGraphicsCardsFromWmi (including where you construct new
ArrayList<>(remainingDxgi) and where you call indexOf) or alternatively add a
short comment above the declaration explaining that dxgiAdapters is
intentionally not mutated and that remainingDxgi is the working copy.
- Around line 163-167: The existing comment in WindowsGraphicsCard near the
deferred consumption of dxgiMatch is misleading about the failure mode; update
the comment at the block that removes dxgiMatch from remainingDxgi to state that
the DXGI entry is only removed after successful card construction so it remains
available for fallback/WMI processing if earlier registry reads in the try block
fail, rather than referencing a non-existent Win32Exception from the
constructor; keep the deferred-removal logic as-is and mention the specific
symbols dxgiMatch and remainingDxgi to make the intent clear.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 195325ff-193d-40ef-b01f-d5005edfb454

📥 Commits

Reviewing files that changed from the base of the PR and between e581785 and a3ef7d8.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • oshi-core/src/main/java/oshi/driver/windows/wmi/Win32VideoController.java
  • oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsGraphicsCard.java
  • oshi-core/src/main/java/oshi/jna/platform/windows/WindowsDxgi.java
🚧 Files skipped from review as they are similar to previous changes (3)
  • CHANGELOG.md
  • oshi-core/src/main/java/oshi/jna/platform/windows/WindowsDxgi.java
  • oshi-core/src/main/java/oshi/driver/windows/wmi/Win32VideoController.java
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Test JDK 25, windows-latest
  • GitHub Check: Test JDK 25, macos-latest
  • GitHub Check: Test JDK 21, macos-latest
  • GitHub Check: Analyze (java)
  • GitHub Check: Test JDK 11, windows-latest
🔇 Additional comments (6)
oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsGraphicsCard.java (6)

49-53: Documentation clearly explains the new DXGI-first ordering and ghost adapter filtering.

The added documentation accurately describes the behavior: DXGI enumeration excludes ghost adapters and guarantees primary desktop adapter first.


91-102: LGTM - DXGI setup and ordering approach is sound.

Using TreeMap keyed by DXGI index guarantees primary-adapter-first ordering, and the match-and-consume pattern with remainingDxgi correctly prevents duplicate matches.


134-142: LGTM - Correct index resolution and ghost adapter filtering.

Using dxgiAdapters.indexOf() on the original list (not remainingDxgi) ensures consistent DXGI enumeration indices even after matches are consumed. The ghost filtering logic correctly skips registry entries with no physical DXGI counterpart.


181-188: LGTM - Merge strategy and WMI fallback are correct.

The merge correctly places DXGI-ordered cards first (TreeMap guarantees ascending key order). When falling back to WMI, remainingDxgi still contains all original DXGI adapters since no cards were successfully created.


212-217: LGTM - ConfigManagerErrorCode filtering preserves compatibility.

Filtering disabled devices only when DXGI is available ensures backward compatibility on systems where DXGI enumeration fails. The non-zero check correctly identifies problematic device entries.


243-263: LGTM - WMI DXGI matching and merge logic is correct.

The WMI path correctly mirrors the registry path's ordering strategy. The removal of matched DXGI entries prevents duplicate matching, and the final merge preserves DXGI enumeration order.

@dbwiddis
dbwiddis merged commit a3626c0 into oshi:master Mar 10, 2026
12 checks passed
@dbwiddis
dbwiddis deleted the default-graphics branch March 10, 2026 20:06
@codecov

codecov Bot commented Mar 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.38%. Comparing base (44425a7) to head (03a5dd2).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3087      +/-   ##
==========================================
+ Coverage   84.64%   85.38%   +0.74%     
==========================================
  Files          33       33              
  Lines        1478     1478              
  Branches      217      217              
==========================================
+ Hits         1251     1262      +11     
+ Misses        132      118      -14     
- Partials       95       98       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Get default graphics card

1 participant