gpu: the diagnostics profile compiles again (the missing mb, and timing's shadow) #2208

Open
Wazzabeee wants to merge 2 commits from upstream-pr/2208 into main
Wazzabeee commented 2026-11-29 10:33:50 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Wazzabeee on 2026-11-29T10:33:50Z.


What it changes

The documented diagnostics build (cargo build --locked --profile diag -p victory --features diagnostics, AGENTS.md) does not compile on main at 829188e (v2026.11.29.01): 9 errors in victory-gpu.

  • error[E0425]: cannot find function 'mb' in this scope — crates/victory-gpu/src/copystat.rs:1349 (and three more). Every memory line of the diagnostics reports formats its byte counts through mb() (94 call sites), which was never defined; git log -S 'fn mb(' finds no commit that ever had it. This PR defines it beside now_us: bytes in, mebibytes out, f64 for the {}/{:.0}/{:.2} of the report lines.
  • error[E0618]: expected function, found 'Option<SubmissionTiming>' — crates/victory-gpu/src/host.rs:9127, :9169, :9180, plus two E0277 size cascades after the :9169 one. submit() keeps an Option<SubmissionTiming> in a local named timing (release path), and the diagnostics blocks of the same function call timing() for the VICTORY_GPU_TIMING switch: the local shadows the fn. This PR renames the free fn to list_timing(), after relay_timing and submission_timing, which already name the switch they read. Six call sites updated.

No release-path change: the module is #[cfg(all(windows, feature = "diagnostics"))] and the blocks are #[cfg(feature = "diagnostics")], so the release build and the plain clippy gate stay green; only the diagnostics profile sees it.

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): NVIDIA GeForce RTX 5070 Ti 16 GB (driver 32.0.16.2124), Series X profile, 2560x1440 with DLSS quality, frame generation off, ray tracing off. AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 (10.0.26300), Rust 1.98.1-x86_64-pc-windows-msvc (pinned), cargo 1.100.1.
  • Before: cargo build --locked --profile diag -p victory --features diagnostics fails with the 9 errors above.
  • After: the same command builds clean; target/diag/victory.exe (21 MB) runs the title, and a VICTORY_D3D12_DEBUG=1 session logs normally (the named-command diagnostics this profile exists for).
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): n/a (no shader changes).
  • cargo test passed for the crates it touches: partly — cargo test -p victory-gpu --locked: 911 passed, 4 failed, 57 ignored. The failures are the ambient::tests ones (the_passes_compile, the_passes_build, raise_opt_in_chroma_scrub_filters_spikes_and_preserves_scene_tones_on_hardware_and_warp); they fail the same way on unmodified main at 829188e on this machine, and this test build compiles no diagnostics code at all (both changes sit behind #[cfg(feature = "diagnostics")]), so the tested code is identical to main's here.
  • The workspace gates are red on unmodified main on this machine as well, with and without this branch, none of it in the files this touches: cargo clippy --workspace --all-targets --locked -- -D warnings fails in victory-loader (a dead_code error); the --all-features variant also fails in victory-shader (three too_many_arguments on the lib, one more in lib test, a while_immutable_condition); cargo test --workspace --locked fails in victory-formats (the three bcpack::tests::oracle_parity_* tests, 80 passed 3 failed).

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5549870069 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2208). Originally posted by [Wazzabeee](https://github.com/Wazzabeee) on 2026-11-29T10:33:50Z. --- <!-- Thanks for the pull request. Please label it (pr-fix, pr-feature, pr-performance, pr-diagnostics, pr-refactor, pr-docs or pr-tests, plus the area labels), or put the label in the title, like [pr-fix]. --> ## What it changes The documented diagnostics build (`cargo build --locked --profile diag -p victory --features diagnostics`, `AGENTS.md`) does not compile on `main` at `829188e` (v2026.11.29.01): 9 errors in `victory-gpu`. - `error[E0425]: cannot find function 'mb' in this scope` — `crates/victory-gpu/src/copystat.rs:1349` (and three more). Every memory line of the diagnostics reports formats its byte counts through `mb()` (94 call sites), which was never defined; `git log -S 'fn mb('` finds no commit that ever had it. This PR defines it beside `now_us`: bytes in, mebibytes out, `f64` for the `{}`/`{:.0}`/`{:.2}` of the report lines. - `error[E0618]: expected function, found 'Option<SubmissionTiming>'` — `crates/victory-gpu/src/host.rs:9127`, `:9169`, `:9180`, plus two `E0277` size cascades after the `:9169` one. `submit()` keeps an `Option<SubmissionTiming>` in a local named `timing` (release path), and the diagnostics blocks of the same function call `timing()` for the `VICTORY_GPU_TIMING` switch: the local shadows the fn. This PR renames the free fn to `list_timing()`, after `relay_timing` and `submission_timing`, which already name the switch they read. Six call sites updated. No release-path change: the module is `#[cfg(all(windows, feature = "diagnostics"))]` and the blocks are `#[cfg(feature = "diagnostics")]`, so the release build and the plain clippy gate stay green; only the diagnostics profile sees it. ## How it was tested * GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): NVIDIA GeForce RTX 5070 Ti 16 GB (driver 32.0.16.2124), Series X profile, 2560x1440 with DLSS quality, frame generation off, ray tracing off. AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 (10.0.26300), Rust 1.98.1-x86_64-pc-windows-msvc (pinned), cargo 1.100.1. * Before: `cargo build --locked --profile diag -p victory --features diagnostics` fails with the 9 errors above. * After: the same command builds clean; `target/diag/victory.exe` (21 MB) runs the title, and a `VICTORY_D3D12_DEBUG=1` session logs normally (the named-command diagnostics this profile exists for). * For shader changes, the wave sizes tested (32 and/or 64 lanes): n/a (no shader changes). * `cargo test` passed for the crates it touches: partly — `cargo test -p victory-gpu --locked`: 911 passed, 4 failed, 57 ignored. The failures are the `ambient::tests` ones (`the_passes_compile`, `the_passes_build`, `raise_opt_in_chroma_scrub_filters_spikes_and_preserves_scene_tones_on_hardware_and_warp`); they fail the same way on unmodified `main` at `829188e` on this machine, and this test build compiles no diagnostics code at all (both changes sit behind `#[cfg(feature = "diagnostics")]`), so the tested code is identical to `main`'s here. * The workspace gates are red on unmodified `main` on this machine as well, with and without this branch, none of it in the files this touches: `cargo clippy --workspace --all-targets --locked -- -D warnings` fails in `victory-loader` (a dead_code error); the `--all-features` variant also fails in `victory-shader` (three `too_many_arguments` on the lib, one more in lib test, a `while_immutable_condition`); `cargo test --workspace --locked` fails in `victory-formats` (the three `bcpack::tests::oracle_parity_*` tests, 80 passed 3 failed). ## Checked for overlap * [x] I searched the open pull requests for the same issue and for the files this touches. <!-- the 0x80070057 reproducible command-list report, filed separately with the logs; the diagnostics run it asks for needs this profile to build -->
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/2208:upstream-pr/2208'
git switch 'upstream-pr/2208'

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/2208'
git switch 'upstream-pr/2208'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2208'
git switch 'upstream-pr/2208'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2208'
git switch 'main'
git merge --squash 'upstream-pr/2208'
git switch 'main'
git merge --ff-only 'upstream-pr/2208'
git switch 'main'
git merge 'upstream-pr/2208'
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
trustno1-coder/VIctory-NVIDIA!2208
No description provided.