modules::display::tests::sdr_and_display_deferrals fails on this machine #727

Open
opened 2026-11-26 04:13:53 +00:00 by github-bot · 4 comments
Owner

@⁠Tanju42 on GitHub · 2026-11-24 08:27 UTC · original

Title: display test: SHELL_OBJECT Acquire returns ERROR_NOT_SUPPORTED on Windows 11 26300 / NVIDIA

modules::display::tests::sdr_and_display_deferrals
assertion `left == right` failed
  left: -2147024846   (0x80070032, HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED))
  right: 0            (S_OK)

display.rs line ~188: the Acquire call on SHELL_OBJECT vtable slot 0x20
returns ERROR_NOT_SUPPORTED on this machine instead of S_OK. Machine:
Windows 11 Insider build 26300, NVIDIA RTX 5060 Laptop 591.74 + Intel iGPU,
headless-ish (no HDR display attached). Question: is this test expected to be
display/driver dependent? If the stub should be environment-independent, the
SHELL_OBJECT acquisition may need a deferral for configurations with no HDR
path — if it is expected to differ, the test could assert both S_OK and the
documented deferral code and this issue can be closed with that documented.

No game files involved — synthetic tests only.

**@⁠Tanju42** on GitHub · 2026-11-24 08:27 UTC · [original](https://github.com/Marvisak/VIctory/issues/727) Title: `display test: SHELL_OBJECT Acquire returns ERROR_NOT_SUPPORTED on Windows 11 26300 / NVIDIA` ``` modules::display::tests::sdr_and_display_deferrals assertion `left == right` failed left: -2147024846 (0x80070032, HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)) right: 0 (S_OK) ``` display.rs line ~188: the `Acquire` call on SHELL_OBJECT vtable slot 0x20 returns ERROR_NOT_SUPPORTED on this machine instead of S_OK. Machine: Windows 11 Insider build 26300, NVIDIA RTX 5060 Laptop 591.74 + Intel iGPU, headless-ish (no HDR display attached). Question: is this test expected to be display/driver dependent? If the stub should be environment-independent, the SHELL_OBJECT acquisition may need a deferral for configurations with no HDR path — if it is expected to differ, the test could assert both S_OK and the documented deferral code and this issue can be closed with that documented. No game files involved — synthetic tests only.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:13:53 +00:00
Author
Owner

@⁠LAKSHYA-cmd-tech on GitHub · 2026-11-24 09:09 UTC · original

Confirmed root cause on Windows 11 without active display support:

  • When running headless, in virtual machines, under RDP sessions, or on laptop configurations without an active HDR/display route, Windows Power Management returns ERROR_NOT_SUPPORTED (0x80070032 / -2147024846) from PowerSetRequest(request, PowerRequestDisplayRequired).
  • PowerCreateRequest(&context) already successfully creates the power request handle. Since a display sleep deferral is purely a power-saving hint to prevent the monitor from going to sleep while playing, an inability to prevent display sleep should not fail the API call or abort the title.
  • Fix: In crates/victory-hle/src/modules/display.rs:acquire_deferral, tolerate ERROR_NOT_SUPPORTED (0x80070032), keep the valid request handle, and return S_OK.

Tested with all 94 unit tests passing in crates/victory-hle, clippy clean, and asset policy ok. Available on fork branch fix/display-deferral-headless-support.

**@⁠LAKSHYA-cmd-tech** on GitHub · 2026-11-24 09:09 UTC · [original](https://github.com/Marvisak/VIctory/issues/727#issuecomment-7127028342) Confirmed root cause on Windows 11 without active display support: - When running headless, in virtual machines, under RDP sessions, or on laptop configurations without an active HDR/display route, Windows Power Management returns `ERROR_NOT_SUPPORTED` (`0x80070032` / `-2147024846`) from `PowerSetRequest(request, PowerRequestDisplayRequired)`. - `PowerCreateRequest(&context)` already successfully creates the power request handle. Since a display sleep deferral is purely a power-saving hint to prevent the monitor from going to sleep while playing, an inability to prevent display sleep should not fail the API call or abort the title. - Fix: In `crates/victory-hle/src/modules/display.rs:acquire_deferral`, tolerate `ERROR_NOT_SUPPORTED` (`0x80070032`), keep the valid request handle, and return `S_OK`. Tested with all 94 unit tests passing in `crates/victory-hle`, clippy clean, and asset policy ok. Available on fork branch `fix/display-deferral-headless-support`.
Author
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-24 09:48 UTC · original

Ready-to-merge fix on a fork branch (since external PR creation is currently paused):

Summary

  • When PowerSetRequest(request, PowerRequestDisplayRequired) returns ERROR_NOT_SUPPORTED (50), acquire_deferral closes the OS power request handle, logs once via tracing::info!, and returns S_OK with a non-null static no-op sentinel handle.
  • close_deferral skips PowerClearRequest/CloseHandle for null and the no-op sentinel.
  • All other Win32 errors keep closing the handle and returning HRESULT_FROM_WIN32(error) (reading GetLastError() before CloseHandle), and out.is_null() keeps returning E_INVALIDARG.

Verification

Windows 11 Pro (26100), Rust 1.98.1 (x86_64-pc-windows-msvc), AMD Radeon RX 9060 XT:

  • cargo test --workspace --locked → 314 passed, 0 failed, 6 ignored (keeps sdr_and_display_deferrals and adds 3 deterministic tests covering ERROR_NOT_SUPPORTED fallback + sentinel close, ERROR_ACCESS_DENIED cleanup/HRESULT, and null out)
  • cargo clippy --workspace --all-targets --locked -- -D warnings → pass (0 warnings)
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings → pass (0 warnings)
  • rustfmt --edition 2024 --check crates/victory-hle/src/modules/display.rs → pass
  • cargo xtask policy → asset policy: 153 files ok

AI-assisted; synthetic tests only, no game files.

**@⁠geiyiliyabumo** on GitHub · 2026-11-24 09:48 UTC · [original](https://github.com/Marvisak/VIctory/issues/727#issuecomment-7127916743) Ready-to-merge fix on a fork branch (since external PR creation is currently paused): - **Branch**: https://github.com/geiyiliyabumo/VIctory/tree/fix/display-deferral-not-supported (commit [`5c37528`](https://github.com/geiyiliyabumo/VIctory/commit/5c37528) on `main` `8e79c80`, 1 file changed: `crates/victory-hle/src/modules/display.rs`) ### Summary - When `PowerSetRequest(request, PowerRequestDisplayRequired)` returns `ERROR_NOT_SUPPORTED` (`50`), `acquire_deferral` closes the OS power request handle, logs once via `tracing::info!`, and returns `S_OK` with a non-null static no-op sentinel handle. - `close_deferral` skips `PowerClearRequest`/`CloseHandle` for null and the no-op sentinel. - All other Win32 errors keep closing the handle and returning `HRESULT_FROM_WIN32(error)` (reading `GetLastError()` before `CloseHandle`), and `out.is_null()` keeps returning `E_INVALIDARG`. ### Verification Windows 11 Pro (`26100`), Rust `1.98.1` (`x86_64-pc-windows-msvc`), AMD Radeon RX 9060 XT: - `cargo test --workspace --locked` → **314 passed, 0 failed, 6 ignored** (keeps `sdr_and_display_deferrals` and adds 3 deterministic tests covering `ERROR_NOT_SUPPORTED` fallback + sentinel close, `ERROR_ACCESS_DENIED` cleanup/HRESULT, and null `out`) - `cargo clippy --workspace --all-targets --locked -- -D warnings` → **pass** (0 warnings) - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` → **pass** (0 warnings) - `rustfmt --edition 2024 --check crates/victory-hle/src/modules/display.rs` → **pass** - `cargo xtask policy` → `asset policy: 153 files ok` AI-assisted; synthetic tests only, no game files.
Author
Owner

@⁠Satanyuga on GitHub · 2026-11-24 20:38 UTC · original

Opened PR #1664 to fix this.

**@⁠Satanyuga** on GitHub · 2026-11-24 20:38 UTC · [original](https://github.com/Marvisak/VIctory/issues/727#issuecomment-7143857405) Opened PR #1664 to fix this.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:47 UTC · original

Automated triage for the maintainers.

The test failure reported here is fixed in main. PR #1125 (fix/display-deferral-test-727, commit efe102e, merged as ef65f88) changed sdr_and_display_deferrals in crates/victory-hle/src/modules/display.rs. The test now accepts either S_OK with a handle, or NOT_SUPPORTED (0x80070032) with a null handle, so it passes on a host that refuses display power requests.

The runtime behaviour is unchanged. On such hosts acquire_deferral still returns the PowerSetRequest error to the title. Open PR #1155 makes that case a no-op deferral that returns S_OK. Whether to take it is up to the maintainers, and it does not need this issue to stay open.

Proposed close: fixed in main by #1125. This issue will be closed in 48 hours unless the reporter replies or a maintainer removes the triage: proposed close label.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:47 UTC · [original](https://github.com/Marvisak/VIctory/issues/727#issuecomment-7149963169) <!-- victory-issue-triage v1 verdict=proposed-close seen=2026-11-24T20:38:29Z at=2026-11-25T01:52:00Z --> Automated triage for the maintainers. The test failure reported here is fixed in `main`. PR #1125 (`fix/display-deferral-test-727`, commit `efe102e`, merged as `ef65f88`) changed `sdr_and_display_deferrals` in `crates/victory-hle/src/modules/display.rs`. The test now accepts either `S_OK` with a handle, or `NOT_SUPPORTED` (`0x80070032`) with a null handle, so it passes on a host that refuses display power requests. The runtime behaviour is unchanged. On such hosts `acquire_deferral` still returns the `PowerSetRequest` error to the title. Open PR #1155 makes that case a no-op deferral that returns `S_OK`. Whether to take it is up to the maintainers, and it does not need this issue to stay open. Proposed close: fixed in main by #1125. This issue will be closed in 48 hours unless the reporter replies or a maintainer removes the `triage: proposed close` label. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#727
No description provided.