Skip to content

feat(gpu/streamline): VICTORY_FRAMEGEN_OFF as a VICTORY_AB switch, to measure inside one run what frame generation costs the rendered frame (diagnostics) - #333

Open
PiloteCode wants to merge 1 commit into
Androtim:mainfrom
PiloteCode:pr/framegen-ab

Conversation

@PiloteCode

Copy link
Copy Markdown

Summary

Frame generation's cost on the rendered frame is hard to measure across runs: the scene, the crowd and the camera differ from run to run by more than the effect. Named in VICTORY_AB, VICTORY_FRAMEGEN_OFF turns frame generation (DLSS's or FSR 3's: both read framegen_wanted()) off in the phases where that switch is on and leaves it as asked in the others, so one run measures both, place for place. Nothing changes outside VICTORY_AB or in release builds.

Changes

  • crates/victory-gpu/src/streamline.rs: framegen_off_by_phase() (diagnostics only; false otherwise), checked first in framegen_wanted(). 21 lines.

What we measured with it (our fork, RTX 5090)

Run big-fg-1: Series X, 2560x1440 output, DLSS quality, DLSS frame generation 4x, a busy crowded street area; VICTORY_AB=10,VICTORY_FRAMEGEN_OFF,VICTORY_SUBMIT_FRAMES, 46 phases of 10 s (24 pairs), drift fitted.

Metric (rendered frames) FG 4x on vs off
Frame median (~58 ms) +1.35 +- 0.58 ms
Frame mean +0.83 +- 0.81 ms (n.s.)
Frame p90 -0.67 +- 1.18 ms (n.s.)
Submitting thread +2.17 +- 0.71 ms
Card busy +4.6 +- 0.4 points

So on that card 4x costs the rendered frame about 2 %: its ~12 ms present call on our submitting thread is mostly a wait that happens anyway (1-2 ms without FG). Same run, same method: VICTORY_SUBMIT_FRAMES=2 gave median -1.4 ms but p90 +9.3 +- 1.2 ms (left at 1).

Rig Specs / Settings

  • i9-14900KF (32 threads), RTX 5090 32 GB, 128 GB, Windows 11 (driver not recorded); diagnostics build; RT off.

Verification

  • Automated checks on this branch (rebased on main 3230974; offline, --locked, toolchain 1.98.1-msvc):
    • cargo clippy --workspace --all-targets --locked -- -D warnings
    • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
    • cargo test (not run by us on this tree)
    • cargo xtask policy (not run; 21 lines in one file)

Limits

  • One run, one card (RTX 5090), DLSS FG 4x only. On an 8 GB card the GPU share of FG is likely larger; that is exactly what this switch lets MiniVI measure on its own target cards. The FSR 3 path goes through the same function but was not run by us.

… measure inside one run what frame generation costs the rendered frame (diagnostics)
@Androtim

Androtim commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Read-only security & triage review on 34a8ac8a (external author PiloteCode — awaiting manual owner approval per repository security allowlist policy; not built/executed locally and not auto-merged):

  • Security / Supply-Chain / Clean-Room: Clean. Touches only crates/victory-gpu/src/streamline.rs (+21/-0); no Cargo.toml, build.rs, .github/workflows/, binaries, shell/network calls, or clean-room violations.
  • Architecture note: Diagnostics-only VICTORY_AB helper (VICTORY_FRAMEGEN_OFF) with zero effect in plain --release builds. Left open for manual owner approval.

@Androtim

Androtim commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

Automated triage for the maintainers (not an approval).

Verdict: merge-candidate · CI (check): passing

Review Summary

Small, self-contained diagnostics addition (+21 lines in crates/victory-gpu/src/streamline.rs) that hooks VICTORY_FRAMEGEN_OFF into the existing VICTORY_AB A/B phase framework.

Verification

  • API & phase integration: framegen_off_by_phase() caches crate::ab::bit("VICTORY_FRAMEGEN_OFF") in a OnceLock<Option<u32>> and queries crate::ab::on, matching the pub(crate) fn bit(&str) -> Option<u32> and pub(crate) fn on(u32) -> bool signatures in crates/victory-gpu/src/ab.rs (L38–L45).
  • Toggle safety: Returning 0 from framegen_wanted() feeds directly into the existing live-toggle path in present_begins (crates/victory-gpu/src/streamline.rs L1786–L1831), which calls set_options with DLSSG_RETAIN_RESOURCES_WHEN_OFF when on != calls.framegen_on and resets FG_PER to 1 when off. Transition frames are naturally excluded from phase stats by the 1-second warmup in ab::presented (ab.rs L88).
  • Zero default/release impact: Compiles to a constant false when feature = "diagnostics" is disabled, and is a no-op in diagnostics builds unless VICTORY_FRAMEGEN_OFF is explicitly listed in VICTORY_AB.
  • CI: Passing.

No issues found; looks ready as a merge candidate pending maintainer review.


Generated with Antigravity CLI (agy).

@Androtim Androtim added triage: merge candidate Security & logic checks passed; ready for maintainer merge review area: gpu D3D12 host, descriptors, memory, or rendering labels Dec 2, 2026
@Androtim

Androtim commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Allowlist & Architect Deep Review (PiloteCode is now on the trusted allowlist; CI 46881394832 is GREEN):

  • Clean +21/-0 diagnostics-only VICTORY_AB helper (VICTORY_FRAMEGEN_OFF); compiles to false without --features diagnostics (zero impact on plain --release builds). Ready to merge once diagnostics smoke / merge wave is approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: gpu D3D12 host, descriptors, memory, or rendering triage: merge candidate Security & logic checks passed; ready for maintainer merge review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants