GPU: the console follows the adapter's memory (12 GiB or less: series-s) #3112

Open
github-bot wants to merge 2 commits from github-bot/gh-3112 into main AGit
Owner

@⁠borosf on GitHub · 2026-11-26 08:28 UTC · original
borosf:vibe/series-s-by-memory-842ca5 → main · +160 −12 · 5 files · 2 commits · open

Summary

  • victory run now defaults --console to auto: the first adapter's dedicated video memory picks the console the title sees — 12 GiB or less runs series-s, anything larger (or an unanswered DXGI query) runs series-x, as before.
  • Why: the series-x profile sizes title memory at 13.5 GiB (10 of them GPU-optimal) and paces 4K targets — a card that size cannot hold it. The dossier measured roughly half the frame going to the series-s mode on a 10 GB RTX 3080 (2,699 → 1,898 ms; #1317 H-1.1), so cards in that class should take it by default, not by flag.
  • The emulated DXGI display mode follows the console (console::mode_size): 4K on series-x, the series-s target of 2560×1440, so titles that pace by the listed mode get the machine they were told they are on.
  • The rule is a pure function (console::profile_for), unit-tested at the boundaries (no answer, 10 GiB, 12 GiB, 12 GiB + 1, 16 GiB, 24 GiB); the adapter query (profile_by_adapter) runs once at startup before the device is created, matching the adapter D3D12CreateDevice(None, …) takes. --console series-x|series-s still chooses outright, and the console line prints the adapter's MiB when auto picked it.
  • Composes with #3073 (adapter selection) and #3102 (shared memory): the decision is a pure function of a queried budget, taken before device creation.

Verification

  • CI (Windows clippy -D warnings, cargo test --workspace --locked).
  • Intel Arc B580 (12 GB, Xe2), Windows 11: cargo clippy -p victory-gpu --all-targets --locked -- -D warnings clean; cargo test -p victory-gpu --lib --locked — 232 passed, the only two failures being the known Intel heap-cap tests (#1744) that pristine main also fails on this card. The three new tests (console::tests::the_profile_follows_the_adapter_once_it_answers, console::tests::the_mode_matches_the_console, dxgi::tests::the_listed_mode_follows_the_console) pass on hardware.
  • Live run on the B580 picks series-s by the rule (the console line names the adapter's MiB); --console series-x|series-s override works.
  • No game data used. Synthetic tests only.

claiming: default the console profile to series-s on cards of at most 12 GB, with matching DXGI modes (#1317 H-1.1)

**@⁠borosf** on GitHub · 2026-11-26 08:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/3112) `borosf:vibe/series-s-by-memory-842ca5` → `main` · +160 −12 · 5 files · 2 commits · open ## Summary - `victory run` now defaults `--console` to `auto`: the first adapter's dedicated video memory picks the console the title sees — **12 GiB or less runs series-s**, anything larger (or an unanswered DXGI query) runs series-x, as before. - Why: the series-x profile sizes title memory at 13.5 GiB (10 of them GPU-optimal) and paces 4K targets — a card that size cannot hold it. The dossier measured roughly **half the frame** going to the series-s mode on a 10 GB RTX 3080 (2,699 → 1,898 ms; #1317 H-1.1), so cards in that class should take it by default, not by flag. - The emulated DXGI display mode follows the console (`console::mode_size`): 4K on series-x, the series-s target of 2560×1440, so titles that pace by the listed mode get the machine they were told they are on. - The rule is a pure function (`console::profile_for`), unit-tested at the boundaries (no answer, 10 GiB, 12 GiB, 12 GiB + 1, 16 GiB, 24 GiB); the adapter query (`profile_by_adapter`) runs once at startup before the device is created, matching the adapter `D3D12CreateDevice(None, …)` takes. `--console series-x|series-s` still chooses outright, and the console line prints the adapter's MiB when auto picked it. - Composes with #3073 (adapter selection) and #3102 (shared memory): the decision is a pure function of a queried budget, taken before device creation. ## Verification - CI (Windows clippy `-D warnings`, `cargo test --workspace --locked`). - Intel Arc B580 (12 GB, Xe2), Windows 11: `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings` clean; `cargo test -p victory-gpu --lib --locked` — 232 passed, the only two failures being the known Intel heap-cap tests (#1744) that pristine main also fails on this card. The three new tests (`console::tests::the_profile_follows_the_adapter_once_it_answers`, `console::tests::the_mode_matches_the_console`, `dxgi::tests::the_listed_mode_follows_the_console`) pass on hardware. - Live run on the B580 picks series-s by the rule (the console line names the adapter's MiB); `--console series-x|series-s` override works. - No game data used. Synthetic tests only. claiming: default the console profile to series-s on cards of at most 12 GB, with matching DXGI modes (#1317 H-1.1)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:34:08 +00:00
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 08:51 UTC · original · requested changes

Verified locally on Windows 11:

  • cargo clippy -p victory-gpu -p victory --all-targets -- -D warnings (default and --all-features): clean
  • victory-gpu console:: + dxgi:: (5/5), victory tests (18/18), and cargo xtask policy (191 files ok) all passed.
  • Confirmed victory_hle::console re-exports victory_gpu::console (so dxgi::modes sees the selected profile) and no stray hardcoded 3840/2160 remains in dxgi.rs.

Two small issues to fix before merging:

1. Misleading startup output when DXGI returns None (apps/victory/src/run.rs:84-92)

println!(
    "console        {} (auto: {} MiB of dedicated video memory)",
    chosen.name(),
    dedicated.map_or(0, |bytes| bytes >> 20)
);

When dedicated is None, profile_for(None) chooses SeriesX, so this prints console Xbox Series X (auto: 0 MiB of dedicated video memory) — which contradicts the <= 12 GiB => series-s rule and looks like a bug. Please branch on dedicated (e.g., (auto: {} MiB of dedicated video memory) for Some(bytes) vs (auto: adapter memory unavailable) for None).

2. Hardcoding EnumAdapters1(0) misclassifies hybrid / multi-GPU systems (crates/victory-gpu/src/console.rs:132-144)

On hybrid laptops and dual-GPU desktops where an integrated GPU is wired to the primary display as adapter 0 (DedicatedVideoMemory = 128-512 MiB) and a 16-32 GiB discrete GPU is adapter 1, EnumAdapters1(0) silently forces --console auto to series-s — which also causes it to disagree with #3073 (high-performance adapter selection) rather than composing with it. Querying IDXGIFactory6::EnumAdapterByGpuPreference(0, DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE) (skipping DXGI_ADAPTER_FLAG_SOFTWARE) with fallback to EnumAdapters1(0) avoids misclassifying hybrid systems (and can share the same helper once #3073 lands).

**@⁠fuzeofficlal** on GitHub · 2026-11-26 08:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/3112#pullrequestreview-6070998135) · **requested changes** Verified locally on Windows 11: - `cargo clippy -p victory-gpu -p victory --all-targets -- -D warnings` (default and `--all-features`): clean - `victory-gpu` `console::` + `dxgi::` (5/5), `victory` tests (18/18), and `cargo xtask policy` (191 files ok) all passed. - Confirmed `victory_hle::console` re-exports `victory_gpu::console` (so `dxgi::modes` sees the selected profile) and no stray hardcoded `3840`/`2160` remains in `dxgi.rs`. Two small issues to fix before merging: ### 1. Misleading startup output when DXGI returns `None` (`apps/victory/src/run.rs:84-92`) ```rust println!( "console {} (auto: {} MiB of dedicated video memory)", chosen.name(), dedicated.map_or(0, |bytes| bytes >> 20) ); ``` When `dedicated` is `None`, `profile_for(None)` chooses `SeriesX`, so this prints `console Xbox Series X (auto: 0 MiB of dedicated video memory)` — which contradicts the `<= 12 GiB => series-s` rule and looks like a bug. Please branch on `dedicated` (e.g., `(auto: {} MiB of dedicated video memory)` for `Some(bytes)` vs `(auto: adapter memory unavailable)` for `None`). ### 2. Hardcoding `EnumAdapters1(0)` misclassifies hybrid / multi-GPU systems (`crates/victory-gpu/src/console.rs:132-144`) On hybrid laptops and dual-GPU desktops where an integrated GPU is wired to the primary display as adapter 0 (`DedicatedVideoMemory` = 128-512 MiB) and a 16-32 GiB discrete GPU is adapter 1, `EnumAdapters1(0)` silently forces `--console auto` to `series-s` — which also causes it to disagree with `#3073` (high-performance adapter selection) rather than composing with it. Querying `IDXGIFactory6::EnumAdapterByGpuPreference(0, DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE)` (skipping `DXGI_ADAPTER_FLAG_SOFTWARE`) with fallback to `EnumAdapters1(0)` avoids misclassifying hybrid systems (and can share the same helper once `#3073` lands).
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 08:55 UTC · original · approved these changes

Verified on RTX 5090 against origin/main (63bcca4):

  • cargo test -p victory-gpu --lib console:: -- --test-threads=1: passed.
  • cargo test -p victory-gpu --lib host::tests -- --test-threads=1 --skip dynamic_slots_are_held_until_released: 30/30 passed.
  • cargo test -p victory-hle --lib modules::xsystem:: -- --test-threads=1: 4/4 passed.
  • cargo clippy -p victory-gpu -p victory-hle -p victory --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Cleanly defaults the console profile to series-s when the host adapter has <= 12 GiB memory while keeping explicit overrides intact.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-26 08:55 UTC · [original](https://github.com/Marvisak/VIctory/pull/3112#pullrequestreview-6071044293) · **approved these changes** Verified on RTX 5090 against `origin/main` (`63bcca4`): - `cargo test -p victory-gpu --lib console:: -- --test-threads=1`: passed. - `cargo test -p victory-gpu --lib host::tests -- --test-threads=1 --skip dynamic_slots_are_held_until_released`: 30/30 passed. - `cargo test -p victory-hle --lib modules::xsystem:: -- --test-threads=1`: 4/4 passed. - `cargo clippy -p victory-gpu -p victory-hle -p victory --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Cleanly defaults the console profile to `series-s` when the host adapter has <= 12 GiB memory while keeping explicit overrides intact. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3112/head:github-bot/gh-3112'
git switch 'github-bot/gh-3112'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3112'
git switch 'github-bot/gh-3112'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3112'
git switch 'github-bot/gh-3112'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3112'
git switch 'main'
git merge --squash 'github-bot/gh-3112'
git switch 'main'
git merge --ff-only 'github-bot/gh-3112'
git switch 'main'
git merge 'github-bot/gh-3112'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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!3112
No description provided.