GPU/HLE: add hybrid CPU core preferences and VICTORY_NULL_MAGENTA diagnostic #171

Closed
github-bot wants to merge 1 commit from gh-pr/171/head into gh-pr/171/base
Owner

@⁠dutch2005 on GitHub · 2026-11-25 18:43 UTC · original
feat/fast-cores-and-null-magenta → main · +598 −0 · 5 files · 1 commits · closed without merging

GPU/HLE: pin timeline watcher to fast cores, optional slow cores for dstorage workers, and VICTORY_NULL_MAGENTA

Backports two independent runtime/diagnostics utilities:

  1. Hybrid CPU core preference helpers (VICTORY_FAST_CORES=0 opt-out, VICTORY_DISK_CORES=slow opt-in; ported from fxceless/victory-fork into standalone crates/victory-gpu/src/cores.rs to avoid conflicting with framelog.rs):

    • Parses GetSystemCpuSetInformation records into efficiency classes and uses SetThreadSelectedCpuSets on hybrid CPUs.
    • Keeps victory-queues (timeline.rs) on performance cores by default (VICTORY_FAST_CORES=0 disables), and optionally routes dstorage workers to efficiency cores when VICTORY_DISK_CORES=slow and >= 8 slow logical processors are present.
  2. Missing 2D colour texture diagnostic (VICTORY_NULL_MAGENTA=1, diagnostics feature; ported from myokex/victory-amd):

    • In descriptor/host.rs, substitutes a 1x1 magenta [255, 0, 255, 255] SRV for null View::Placed(false, _, desc) 2D colour views (BC1..BC3, BC7, 8-bit RGBA/BGRA) when enabled under VICTORY_NULL_MAGENTA=1.

Verification (RUST_TEST_THREADS=1):

  • victory-gpu --lib --locked -- --test-threads=1 --skip written_pages_are_reported_to_every_asker: 114 passed, 0 failed, 4 ignored (skipped pre-existing #102 flake).
  • victory-gpu --lib --features diagnostics --locked -- --test-threads=1 --skip written_pages_are_reported_to_every_asker: 118 passed, 0 failed, 4 ignored.
  • victory-hle --lib --locked modules::dstorage::tests -- --test-threads=1: 14 passed, 0 failed.
  • cargo clippy -p victory-gpu -p victory-hle --lib --tests --no-deps (default & --all-features): 0 warnings on touched lines.
  • cargo xtask policy --staged: 5 files ok.
  • cargo mutants --in-diff:
    • descriptor/host.rs (--features diagnostics): 27 mutants tested — 26 caught, 1 unviable, 0 missed.
    • victory-hle (modules::dstorage::tests): 6 mutants tested — 5 caught, 1 timeout (work -> ()), 0 missed.
    • Prior full GPU diff run before removing redundant MipLevels: 1 field (--features diagnostics): 85 tested — 80 caught, 1 unviable, 2 timeouts (parse_cpu_sets), 2 missed (the now-eliminated MipLevels mutant + cores::keep_on_slow_cores -> false, which is equivalent on homogeneous CPUs like this Ryzen 9 5900X).
**@⁠dutch2005** on GitHub · 2026-11-25 18:43 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/171) `feat/fast-cores-and-null-magenta` → `main` · +598 −0 · 5 files · 1 commits · closed without merging GPU/HLE: pin timeline watcher to fast cores, optional slow cores for dstorage workers, and VICTORY_NULL_MAGENTA Backports two independent runtime/diagnostics utilities: 1. Hybrid CPU core preference helpers (`VICTORY_FAST_CORES=0` opt-out, `VICTORY_DISK_CORES=slow` opt-in; ported from `fxceless/victory-fork` into standalone `crates/victory-gpu/src/cores.rs` to avoid conflicting with `framelog.rs`): - Parses `GetSystemCpuSetInformation` records into efficiency classes and uses `SetThreadSelectedCpuSets` on hybrid CPUs. - Keeps `victory-queues` (`timeline.rs`) on performance cores by default (`VICTORY_FAST_CORES=0` disables), and optionally routes `dstorage` workers to efficiency cores when `VICTORY_DISK_CORES=slow` and >= 8 slow logical processors are present. 2. Missing 2D colour texture diagnostic (`VICTORY_NULL_MAGENTA=1`, `diagnostics` feature; ported from `myokex/victory-amd`): - In `descriptor/host.rs`, substitutes a 1x1 magenta `[255, 0, 255, 255]` SRV for null `View::Placed(false, _, desc)` 2D colour views (`BC1..BC3`, `BC7`, 8-bit `RGBA`/`BGRA`) when enabled under `VICTORY_NULL_MAGENTA=1`. Verification (`RUST_TEST_THREADS=1`): - `victory-gpu --lib --locked -- --test-threads=1 --skip written_pages_are_reported_to_every_asker`: 114 passed, 0 failed, 4 ignored (skipped pre-existing #102 flake). - `victory-gpu --lib --features diagnostics --locked -- --test-threads=1 --skip written_pages_are_reported_to_every_asker`: 118 passed, 0 failed, 4 ignored. - `victory-hle --lib --locked modules::dstorage::tests -- --test-threads=1`: 14 passed, 0 failed. - `cargo clippy -p victory-gpu -p victory-hle --lib --tests --no-deps` (default & `--all-features`): 0 warnings on touched lines. - `cargo xtask policy --staged`: 5 files ok. - `cargo mutants --in-diff`: - `descriptor/host.rs` (`--features diagnostics`): 27 mutants tested — 26 caught, 1 unviable, 0 missed. - `victory-hle` (`modules::dstorage::tests`): 6 mutants tested — 5 caught, 1 timeout (`work -> ()`), 0 missed. - Prior full GPU diff run before removing redundant `MipLevels: 1` field (`--features diagnostics`): 85 tested — 80 caught, 1 unviable, 2 timeouts (`parse_cpu_sets`), 2 missed (the now-eliminated `MipLevels` mutant + `cores::keep_on_slow_cores -> false`, which is equivalent on homogeneous CPUs like this Ryzen 9 5900X).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:37:08 +00:00
github-bot closed this pull request 2026-11-26 03:37:08 +00:00
Author
Owner

@⁠KernelSmoker on GitHub · 2026-11-25 18:47 UTC · original

Verification on PR head b99d33a (x86_64-pc-windows-gnu, Rust 1.98.1):

  • cargo check --workspace --all-targets --all-features --locked --target x86_64-pc-windows-gnu: passed with no new warnings in touched files.
  • Under GE-Proton 10-34 / Wine 10.0 (--test-threads=1):
    • victory-hle modules::dstorage::tests: 14 passed, 0 failed (including disk_cores_slow_switch_requires_slow_value with child-process re-exec).
    • victory-gpu cores::tests: parses_cpu_sets_and_respects_boundaries_and_groups and partitions_fast_and_slow_sets_only_for_hybrid_cpus_with_enough_slow_cores passed. (env_switch_and_apply_helpers_handle_opt_out_pin_success_and_failure hit Wine's SetThreadSelectedCpuSets stub returning TRUE for u32::MAX, and null_magenta_colors_missing_2d_color_srvs_when_enabled hit Wine's builtin d3dcompiler_47 SM 5.1 [RootSignature] crash—both Wine-side environment limits, not native Windows failures.)

Two small code notes:

  1. crates/victory-gpu/src/timeline.rs:259: crate::cores::keep_on_fast_cores("victory-queues"); is ungated while mod cores; (lib.rs:25) and the dstorage.rs:456 call are #[cfg(windows)]. Adding #[cfg(windows)] at timeline.rs:259 keeps victory-gpu clean for non-Windows builds (e.g. if #165 merges).
  2. crates/victory-gpu/src/cores.rs:40-41: adding if bytes == 0 { return Vec::new(); } after the size query avoids a redundant second GetSystemCpuSetInformation call when the first query fails or returns 0 bytes.
**@⁠KernelSmoker** on GitHub · 2026-11-25 18:47 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/171#issuecomment-7171403197) Verification on PR head `b99d33a` (`x86_64-pc-windows-gnu`, Rust 1.98.1): - `cargo check --workspace --all-targets --all-features --locked --target x86_64-pc-windows-gnu`: passed with no new warnings in touched files. - Under GE-Proton 10-34 / Wine 10.0 (`--test-threads=1`): - `victory-hle` `modules::dstorage::tests`: **14 passed, 0 failed** (including `disk_cores_slow_switch_requires_slow_value` with child-process re-exec). - `victory-gpu` `cores::tests`: `parses_cpu_sets_and_respects_boundaries_and_groups` and `partitions_fast_and_slow_sets_only_for_hybrid_cpus_with_enough_slow_cores` passed. (`env_switch_and_apply_helpers_handle_opt_out_pin_success_and_failure` hit Wine's `SetThreadSelectedCpuSets` stub returning `TRUE` for `u32::MAX`, and `null_magenta_colors_missing_2d_color_srvs_when_enabled` hit Wine's builtin `d3dcompiler_47` SM 5.1 `[RootSignature]` crash—both Wine-side environment limits, not native Windows failures.) Two small code notes: 1. **`crates/victory-gpu/src/timeline.rs:259`**: `crate::cores::keep_on_fast_cores("victory-queues");` is ungated while `mod cores;` (`lib.rs:25`) and the `dstorage.rs:456` call are `#[cfg(windows)]`. Adding `#[cfg(windows)]` at `timeline.rs:259` keeps `victory-gpu` clean for non-Windows builds (e.g. if #165 merges). 2. **`crates/victory-gpu/src/cores.rs:40-41`**: adding `if bytes == 0 { return Vec::new(); }` after the size query avoids a redundant second `GetSystemCpuSetInformation` call when the first query fails or returns 0 bytes.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.