GPU: VICTORY_MODE overrides the reported console display mode #1700

Open
Calvix2k wants to merge 1 commit from upstream-pr/1701 into main
Calvix2k commented 2026-11-24 20:54:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-24T20:54:33Z.


Implements the VICTORY_MODE local patch @pfhandler posted under #1677.

Summary

The DXGI output mode list reported one fixed 3840x2160 mode, so a host smaller than the console still carried the 4K render targets and their VRAM cost (about 3.5 GB with the Series S profile and 1080p in the report).

  • VICTORY_MODE=<width>x<height> sets the reported mode; 1920x1080 is documented.
  • Both dimensions must be 1..=16384 (D3D12's texture limit); anything unparseable or out of range falls back to the console's 3840x2160, so the variable cannot make the mode list invalid.
  • README environment table updated.

Test

output_mode_override_parses_or_falls_back covers 1920x1080, whitespace, X as separator, the 4K value, zero, above-limit, and non-size strings.

Validation

  • cargo test -p victory-gpu --locked -- --test-threads=1 — passed (51 tests, 1 ignored).
  • cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings — passed.
  • cargo xtask policy — passed (154 files).
  • rustfmt --edition 2024 --check on the changed file — passed.

Tested by the reporter on GE-Proton 11-14 / vkd3d-proton 3.2.0 with an RTX 4060 Ti, where it kept the title's targets at 1080p.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5480161528 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1701). Originally posted by [Calvix2k](https://github.com/Calvix2k) on 2026-11-24T20:54:33Z. --- Implements the `VICTORY_MODE` local patch @pfhandler posted under #1677. ## Summary The DXGI output mode list reported one fixed 3840x2160 mode, so a host smaller than the console still carried the 4K render targets and their VRAM cost (about 3.5 GB with the Series S profile and 1080p in the report). - `VICTORY_MODE=<width>x<height>` sets the reported mode; `1920x1080` is documented. - Both dimensions must be 1..=16384 (D3D12's texture limit); anything unparseable or out of range falls back to the console's 3840x2160, so the variable cannot make the mode list invalid. - README environment table updated. ## Test `output_mode_override_parses_or_falls_back` covers `1920x1080`, whitespace, `X` as separator, the 4K value, zero, above-limit, and non-size strings. ## Validation - `cargo test -p victory-gpu --locked -- --test-threads=1` — passed (51 tests, 1 ignored). - `cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings` — passed. - `cargo xtask policy` — passed (154 files). - `rustfmt --edition 2024 --check` on the changed file — passed. Tested by the reporter on GE-Proton 11-14 / vkd3d-proton 3.2.0 with an RTX 4060 Ti, where it kept the title's targets at 1080p.
catminou4 commented 2026-11-24 22:20:07 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T22:20:07Z.

Review: COMMENTED


Static review only: apps/Windows-only — nothing compiles on macOS; source review of the diff.

VICTORY_MODE overrides the reported console display mode (dxgi.rs + README). Debug/env override for mode reporting — check it cannot leak into release paths accidentally.

<!-- greyfinch-sync:Marvisak/VIctory:review:6048314218 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1701#pullrequestreview-6048314218). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T22:20:07Z. **Review:** COMMENTED --- Static review only: apps/Windows-only — nothing compiles on macOS; source review of the diff. VICTORY_MODE overrides the reported console display mode (dxgi.rs + README). Debug/env override for mode reporting — check it cannot leak into release paths accidentally.
Calvix2k commented 2026-11-24 23:05:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-24T22:13:32Z.


Rebased onto 70564ae; the only conflict was the README environment table (upstream added two pipeline-log rows). Both sets of rows are kept. output_mode_override_parses_or_falls_back passes, clippy -D warnings and cargo xtask policy (174 files) are clean.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7145962932 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1701#issuecomment-7145962932). Originally posted by [Calvix2k](https://github.com/Calvix2k) on 2026-11-24T22:13:32Z. --- Rebased onto 70564ae; the only conflict was the README environment table (upstream added two pipeline-log rows). Both sets of rows are kept. output_mode_override_parses_or_falls_back passes, clippy -D warnings and cargo xtask policy (174 files) are clean.
Marvisak commented 2026-11-25 04:06:57 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T03:34:36Z.


Automated triage for the maintainers.

Merge candidate, unchanged. The head is still fb27a56, and it merges cleanly into current main. main still reports a fixed 3840x2160 mode in crates/victory-gpu/src/dxgi.rs, and nothing on main reads VICTORY_MODE. The opt-in override is range-checked (1..=16384) by parse_mode and covered by output_mode_override_parses_or_falls_back. The earlier optional suggestion stands: log a warning when the value is invalid, as VICTORY_WINDOW_MAX does.

On the replies: the five failures in StExpeditus's NVIDIA report are the descriptor-heap and hardware tests that also fail on main, so nothing changes.

CI: passing (check).


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7152042958 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1701#issuecomment-7152042958). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T03:34:36Z. --- <!-- victory-triage v1 head=fb27a56d0c09e1dca822aa0a8b89b344e78bf95c verdict=merge-candidate at=2026-11-26T00:25:57Z --> Automated triage for the maintainers. **Merge candidate, unchanged.** The head is still `fb27a56`, and it merges cleanly into current `main`. `main` still reports a fixed 3840x2160 mode in `crates/victory-gpu/src/dxgi.rs`, and nothing on `main` reads `VICTORY_MODE`. The opt-in override is range-checked (1..=16384) by `parse_mode` and covered by `output_mode_override_parses_or_falls_back`. The earlier optional suggestion stands: log a warning when the value is invalid, as `VICTORY_WINDOW_MAX` does. On the replies: the five failures in StExpeditus's NVIDIA report are the descriptor-heap and hardware tests that also fail on `main`, so nothing changes. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
StExpeditus commented 2026-11-25 10:07:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by StExpeditus on 2026-11-25T09:18:34Z.


Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24. Branch at fb27a56. cargo test --workspace --locked --no-fail-fast -> 697 passed, 5 failed, 10 ignored. The failures are the same 5 pre-existing NVIDIA 1M-view-heap-cap failures (also on main; see my reports on #2030 and #1940). Nothing introduced by this PR fails on this machine.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7158156676 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1701#issuecomment-7158156676). Originally posted by [StExpeditus](https://github.com/StExpeditus) on 2026-11-25T09:18:34Z. --- **Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24.** Branch at `fb27a56`. `cargo test --workspace --locked --no-fail-fast` -> 697 passed, 5 failed, 10 ignored. The failures are the same 5 pre-existing NVIDIA 1M-view-heap-cap failures (also on main; see my reports on #2030 and #1940). Nothing introduced by this PR fails on this machine.
Calvix2k commented 2026-11-25 17:05:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T16:39:15Z.


Thanks — the same five NVIDIA heap-cap failures as on main, and nothing from this PR. Noted on the record.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7168324638 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1701#issuecomment-7168324638). Originally posted by [Calvix2k](https://github.com/Calvix2k) on 2026-11-25T16:39:15Z. --- Thanks — the same five NVIDIA heap-cap failures as on `main`, and nothing from this PR. Noted on the record.
fuzeofficlal commented 2026-11-26 01:04:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T00:46:32Z.


Code review and RTX 5090 + WARP verification at head fb27a56d0c09 merged cleanly onto main (63bcca43c6a0):

  • Code review (crates/victory-gpu/src/dxgi.rs:232-286):
    • parse_mode/mode_size accept VICTORY_MODE=<width>x<height> (case-insensitive x/X, trimmed), clamp both dimensions to 1..=16384, and fall back cleanly to (3840, 2160) on empty, malformed, out-of-range, or non-UTF-8 values. Verified no other hardcoded 3840/2160 remains in victory-gpu/src; refresh rate (60/1), format, scanline order, and swapchain sizing/HDR are untouched.
    • Note: mode_size() is active in both default and diagnostics builds (no #[cfg(feature = "diagnostics")] gate), while README.md:215 lists VICTORY_MODE under ## Debugging (purely a minor doc-placement note).
  • Verified (Windows 11, NVIDIA RTX 5090 + WARP, VICTORY_D3D12_DEBUG=1, Rust 1.98.1):
    • cargo xtask policy: 191 files ok; cargo clippy --locked -p victory-gpu --tests -- -D warnings (default + --features diagnostics): 0 warnings
    • dxgi::: 3/3 passed on default RTX 5090, --features diagnostics RTX 5090, and --features diagnostics WARP.

LGTM.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7179100552 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1701#issuecomment-7179100552). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T00:46:32Z. --- Code review and RTX 5090 + WARP verification at head `fb27a56d0c09` merged cleanly onto `main` (`63bcca43c6a0`): - **Code review (`crates/victory-gpu/src/dxgi.rs:232-286`)**: - `parse_mode`/`mode_size` accept `VICTORY_MODE=<width>x<height>` (case-insensitive `x`/`X`, trimmed), clamp both dimensions to `1..=16384`, and fall back cleanly to `(3840, 2160)` on empty, malformed, out-of-range, or non-UTF-8 values. Verified no other hardcoded `3840`/`2160` remains in `victory-gpu/src`; refresh rate (`60/1`), format, scanline order, and swapchain sizing/HDR are untouched. - Note: `mode_size()` is active in both default and `diagnostics` builds (no `#[cfg(feature = "diagnostics")]` gate), while `README.md:215` lists `VICTORY_MODE` under `## Debugging` (purely a minor doc-placement note). - **Verified (Windows 11, NVIDIA RTX 5090 + WARP, `VICTORY_D3D12_DEBUG=1`, Rust 1.98.1)**: - `cargo xtask policy`: `191 files ok`; `cargo clippy --locked -p victory-gpu --tests -- -D warnings` (default + `--features diagnostics`): 0 warnings - `dxgi::`: **3/3 passed** on default RTX 5090, `--features diagnostics` RTX 5090, and `--features diagnostics` WARP. LGTM.
pickles976 commented 2026-11-27 02:28:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pickles976 on 2026-11-27T02:28:33Z.


Mixed-stack Wine verification of the production mode change at fb27a56d0c09e1dca822aa0a8b89b344e78bf95c — not an exact-PR-head or gameplay result.

Our existing dirty RAM-tested stack (base 3ed7d725, scoped XMem + paging + #189) did not implement VICTORY_MODE; it silently retained hardcoded3840×2160. Ported this PR's mode parsing/enumeration and parser test, plus a local ignored probe through the actual output COM vtable (0xa8): count query then mode query, checking1920×1080,60Hz,progressive under VICTORY_MODE=1920x1080. cargo test -p victory-gpu --lib dxgi::tests:: -- --include-ignored --nocapture --test-threads=1: 4/4 pass, fresh correct-worktree compilation. Wrapper supplies locked Windows-MSVC target. Evidence verify-scoped-lighting-mode-20261127T021623Z/.

Machine: Linux6.17/Wine11, i7-13620H/16GiB, RTX4060 Laptop8GiB/NVIDIA590.48.01, Rust1.98.1. NVIDIA masking off; diagnostic-relaxed vkd3d2576c0b4adfae4a+, not stock certification.

Fresh diagnostics release42.46s. Bounded title startup30s and load180s retain all guards. The actual presentation swapchain remains3840×2160. FSR context reports render1280×720/output1920×1080; importantly, the pre-patch run already logged the same FSR dimensions. Thus the API-mode probe succeeds, but no title render-resolution or RAM reduction is attributable to this override here. The180s run reaches the prologue card, then black; no input-responsive world/FPS claim. Separately verified #2101 texture filter was also added, so not a single-variable title comparison.

Suggested follow-through: distinguish reported display mode from title-owned swapchain/render targets in docs/diagnostics; don't advertise a1920×1080 environment setting as proof all planes/resources use that size. Logs 20261127T021818Z-*, 20261127T022056Z-*, prior 20261127T004545Z-* retained locally. No assets/images published.

AI-assisted verification/report: omp/OpenAI GPT-6 Astra.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7208156633 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1701#issuecomment-7208156633). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-27T02:28:33Z. --- Mixed-stack Wine verification of the production mode change at `fb27a56d0c09e1dca822aa0a8b89b344e78bf95c` — **not an exact-PR-head or gameplay result**. Our existing dirty RAM-tested stack (base `3ed7d725`, scoped XMem + paging + #189) did not implement `VICTORY_MODE`; it silently retained hardcoded3840×2160. Ported this PR's mode parsing/enumeration and parser test, plus a local ignored probe through the actual output COM vtable (`0xa8`): count query then mode query, checking1920×1080,60Hz,progressive under `VICTORY_MODE=1920x1080`. `cargo test -p victory-gpu --lib dxgi::tests:: -- --include-ignored --nocapture --test-threads=1`: **4/4 pass**, fresh correct-worktree compilation. Wrapper supplies locked Windows-MSVC target. Evidence `verify-scoped-lighting-mode-20261127T021623Z/`. Machine: Linux6.17/Wine11, i7-13620H/16GiB, RTX4060 Laptop8GiB/NVIDIA590.48.01, Rust1.98.1. NVIDIA masking off; diagnostic-relaxed vkd3d2576c0b4adfae4a+, not stock certification. Fresh diagnostics release42.46s. Bounded title startup30s and load180s retain all guards. The actual presentation swapchain remains3840×2160. FSR context reports render1280×720/output1920×1080; importantly, **the pre-patch run already logged the same FSR dimensions**. Thus the API-mode probe succeeds, but no title render-resolution or RAM reduction is attributable to this override here. The180s run reaches the prologue card, then black; no input-responsive world/FPS claim. Separately verified #2101 texture filter was also added, so not a single-variable title comparison. Suggested follow-through: distinguish reported display mode from title-owned swapchain/render targets in docs/diagnostics; don't advertise a1920×1080 environment setting as proof all planes/resources use that size. Logs `20261127T021818Z-*`, `20261127T022056Z-*`, prior `20261127T004545Z-*` retained locally. No assets/images published. AI-assisted verification/report: omp/OpenAI GPT-6 Astra.
andrewpozdnakov7-jpg commented 2026-11-28 07:48:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T07:48:25Z.


Following up on the review question about release builds. The mode override is active in ordinary builds when VICTORY_MODE is set. The handler reads it without a diagnostics or debug-assertions gate.

I checked the exact handler from the integration in an optimized Windows CPU fixture with debug assertions disabled. It returned 1920×1080 with the override and 3840×2160 with the variable unset. Both passed the format and required-count checks from #3466. The optimized test exercised the handler in isolation.

I moved the README entry from Debugging to Commands to document that behavior. Documentation commit · Mode enumeration results

Please retain the Git author on cherry-pick or rebase. If folding the documentation change into another commit, please include:

Co-authored-by: andrewpozdnakov7-jpg [email protected]

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7236174281 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1701#issuecomment-7236174281). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T07:48:25Z. --- Following up on [the review question about release builds](https://github.com/Marvisak/VIctory/pull/1701#pullrequestreview-6048314218). The mode override is active in ordinary builds when `VICTORY_MODE` is set. The handler reads it without a diagnostics or debug-assertions gate. I checked the exact handler from the integration in an optimized Windows CPU fixture with debug assertions disabled. It returned 1920×1080 with the override and 3840×2160 with the variable unset. Both passed the format and required-count checks from #3466. The optimized test exercised the handler in isolation. I moved the README entry from Debugging to Commands to document that behavior. [Documentation commit](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/ee1dd44efbb37e44cc8a5e93646be63d9f29184c) · [Mode enumeration results](https://github.com/Marvisak/VIctory/pull/3466#issuecomment-7236151119) Please retain the Git author on cherry-pick or rebase. If folding the documentation change into another commit, please include: Co-authored-by: andrewpozdnakov7-jpg <[email protected]> AI-assisted with OpenAI Codex.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1701:upstream-pr/1701'
git switch 'upstream-pr/1701'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1701'
git switch 'upstream-pr/1701'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1701'
git switch 'upstream-pr/1701'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1701'
git switch 'main'
git merge --squash 'upstream-pr/1701'
git switch 'main'
git merge --ff-only 'upstream-pr/1701'
git switch 'main'
git merge 'upstream-pr/1701'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!1700
No description provided.