fix(gpu/streamline, app): scene sides behind DLSS/FSR made multiples of 8 so the title draws its clouds (VICTORY_FFX_RENDER_ALIGN) #332

Merged
PiloteCode merged 1 commit from upstream-pr/332 into main 2026-12-02 17:04:10 +00:00
PiloteCode commented 2026-12-02 12:28:03 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by PiloteCode on 2026-12-02T12:28:03Z.


Summary

Behind DLSS (or FSR 3 frame generation), prepare_upscaler gives the title Mode::scale() of its output, and the title truncates: MiniVI's default (--res 1440 --dlss quality) draws a 1706x960 scene, Series S at DLSS performance 960x540. At exactly those two sizes we found that the title does not draw its clouds: the compute programs of its cloud pass are never bound (its own code skips them; nothing of ours is refused in the logs). At 1280x720 (the size its own upscalers use) the clouds are there.

This PR picks, for the output at hand, the largest scale at most the mode's (and no less than 85 % of it) whose scene has both sides multiples of 8, and gives that to the title: 1664x936 for 2560x1440 at quality, 952x536 for 1920x1080 at performance, 1480x832 for 1440p balanced, 840x472 for 1440p ultra performance; sizes already aligned (4K quality 2560x1440, 4K performance 1920x1080, 1080p quality 1280x720) keep the mode's own scale. Every aligned size still picks the same DLSS mode in pick_mode (tested). VICTORY_FFX_RENDER_ALIGN=<n> (2-64) changes the alignment, =1 turns it off (the mode's exact scale, as before).

Our fork has shipped it since 2 Dec; there the same scale is written by its 1440p profile code.

Changes

  • crates/victory-gpu/src/streamline/plan.rs: Mode::scale_for(output), Mode::render_size_for(output), render_align(), sizes(), aligned_scale() (pure math, single-precision as the title computes, exact float found by stepping ULPs); test aligned_scales_give_aligned_scenes (all modes x 1440p/4K/1080p x alignments 2-16, bounds, and that each aligned 1440p size picks its own DLSS mode).
  • apps/victory/src/native_1440p.rs: prepare_upscaler(image, mode, output) writes mode.scale_for(output) where it wrote mode.scale(); at quality the stock constant is still used when it already gives aligned sides (4K). No new addresses, hashes or bytes: only the value written changes. The env-gated image test follows.
  • apps/victory/src/run.rs: passes the output (2560x1440 after the 1440p patch; else Series S 1920x1080, Series X the reported display mode, 3840x2160 by default) and prints the scene size actually drawn.

Rig Specs Tested On (our fork, not this tree)

  • CPU / GPU / RAM: i9-14900KF, RTX 5090 32 GB, 128 GB; also 12-thread / 8 GB stand-ins at 1080p
  • OS: Windows 11; driver not recorded

Run Settings & Profile

  • Profiles: Series X 2560x1440 output with DLSS quality (1706x960 before, 1664x936 after), FG 4x; Series S 1080p with DLSS performance (960x540) and quality (1280x720)
  • Scene: a saved game in a busy, crowded street area by day, clear sky; frames captured at fixed points plus the log of every program's first bind

Measurements & Verification

Run Scene size Clouds in the picture Cloud-pass programs bound (of the 12 seen only in runs with clouds)
big-fox-3, -6, -8 1280x720 yes (they define the set)
big-fox-4, -7, -9 960x540 no 0
big-fox-1, a play session before this change 1706x960 no 5
big-fg-1 (this change) 1664x936 yes 10
  • big-fox-8 vs big-fox-4 differ only by the DLSS mode at 1080p (quality 1280x720 vs performance 960x540): clouds vs none, so it is the size, not DLSS. Three compute programs were bound in every run with clouds and in none without.
  • Cost: none measured; 1664x936 is 5 % fewer pixels than 1706x960 (a sharpness trade at quality).
  • 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; no new addresses, hashes or byte runs)

Limits

  • Our evidence is the scene sizes listed above; other unaligned sizes (balanced at any output) are aligned on the same reasoning, not each tested.
  • MiniVI's DLSS path differs from ours in places; we checked by reading that pick_mode still chooses the same mode, and that the patched image is rewritten when the scale changes (write_if_changed), but this branch was not run in the game.
<!-- greyfinch-sync:Androtim/MiniVI:issue:5606376815 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/332). Originally posted by [PiloteCode](https://github.com/PiloteCode) on 2026-12-02T12:28:03Z. --- ## Summary Behind DLSS (or FSR 3 frame generation), `prepare_upscaler` gives the title `Mode::scale()` of its output, and the title truncates: MiniVI's **default** (`--res 1440 --dlss quality`) draws a **1706x960** scene, Series S at DLSS performance **960x540**. At exactly those two sizes we found that the title **does not draw its clouds**: the compute programs of its cloud pass are never bound (its own code skips them; nothing of ours is refused in the logs). At 1280x720 (the size its own upscalers use) the clouds are there. This PR picks, for the output at hand, the largest scale at most the mode's (and no less than 85 % of it) whose scene has both sides multiples of 8, and gives that to the title: **1664x936** for 2560x1440 at quality, 952x536 for 1920x1080 at performance, 1480x832 for 1440p balanced, 840x472 for 1440p ultra performance; sizes already aligned (4K quality 2560x1440, 4K performance 1920x1080, 1080p quality 1280x720) keep the mode's own scale. Every aligned size still picks the same DLSS mode in `pick_mode` (tested). `VICTORY_FFX_RENDER_ALIGN=<n>` (2-64) changes the alignment, `=1` turns it off (the mode's exact scale, as before). Our fork has shipped it since 2 Dec; there the same scale is written by its 1440p profile code. ## Changes - `crates/victory-gpu/src/streamline/plan.rs`: `Mode::scale_for(output)`, `Mode::render_size_for(output)`, `render_align()`, `sizes()`, `aligned_scale()` (pure math, single-precision as the title computes, exact float found by stepping ULPs); test `aligned_scales_give_aligned_scenes` (all modes x 1440p/4K/1080p x alignments 2-16, bounds, and that each aligned 1440p size picks its own DLSS mode). - `apps/victory/src/native_1440p.rs`: `prepare_upscaler(image, mode, output)` writes `mode.scale_for(output)` where it wrote `mode.scale()`; at quality the stock constant is still used when it already gives aligned sides (4K). No new addresses, hashes or bytes: only the value written changes. The env-gated image test follows. - `apps/victory/src/run.rs`: passes the output (2560x1440 after the 1440p patch; else Series S 1920x1080, Series X the reported display mode, 3840x2160 by default) and prints the scene size actually drawn. ## Rig Specs Tested On (our fork, not this tree) - **CPU / GPU / RAM:** i9-14900KF, RTX 5090 32 GB, 128 GB; also 12-thread / 8 GB stand-ins at 1080p - **OS:** Windows 11; driver not recorded ## Run Settings & Profile - **Profiles:** Series X 2560x1440 output with DLSS quality (1706x960 before, 1664x936 after), FG 4x; Series S 1080p with DLSS performance (960x540) and quality (1280x720) - **Scene:** a saved game in a busy, crowded street area by day, clear sky; frames captured at fixed points plus the log of every program's first bind ## Measurements & Verification | Run | Scene size | Clouds in the picture | Cloud-pass programs bound (of the 12 seen only in runs with clouds) | |---|---|---|---:| | big-fox-3, -6, -8 | 1280x720 | yes | (they define the set) | | big-fox-4, -7, -9 | 960x540 | **no** | 0 | | big-fox-1, a play session before this change | 1706x960 | **no** | 5 | | big-fg-1 (this change) | **1664x936** | **yes** | **10** | - big-fox-8 vs big-fox-4 differ only by the DLSS mode at 1080p (quality 1280x720 vs performance 960x540): clouds vs none, so it is the size, not DLSS. Three compute programs were bound in every run with clouds and in none without. - Cost: none measured; 1664x936 is 5 % fewer pixels than 1706x960 (a sharpness trade at quality). - **Automated checks on this branch** (rebased on `main` `3230974`; offline, `--locked`, toolchain 1.98.1-msvc): - [x] `cargo clippy --workspace --all-targets --locked -- -D warnings` - [x] `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` - [ ] `cargo test` (not run by us on this tree) - [ ] `cargo xtask policy` (not run; no new addresses, hashes or byte runs) ## Limits - Our evidence is the scene sizes listed above; other unaligned sizes (balanced at any output) are aligned on the same reasoning, not each tested. - MiniVI's DLSS path differs from ours in places; we checked by reading that `pick_mode` still chooses the same mode, and that the patched image is rewritten when the scale changes (`write_if_changed`), but this branch was not run in the game.
Androtim commented 2026-12-02 12:49:05 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T12:49:05Z.


Read-only security & triage review on c062035e (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 apps/victory/src/{native_1440p.rs,run.rs} and crates/victory-gpu/src/streamline/plan.rs (+159/-15); no Cargo.toml, build.rs, .github/workflows/, binaries, shell/network calls, or clean-room violations.
  • Architecture note: Clean visual fix aligning DLSS/FSR internal render dimensions to multiples of 8 (VICTORY_FFX_RENDER_ALIGN=8 default, =1 off) so volumetric cloud passes render properly. Needs manual owner approval to run CI + real-GPU visual PNG & plain---release verification.
<!-- greyfinch-sync:Androtim/MiniVI:comment:7345927662 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/332#issuecomment-7345927662). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-02T12:49:05Z. --- Read-only security & triage review on `c062035e` (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 `apps/victory/src/{native_1440p.rs,run.rs}` and `crates/victory-gpu/src/streamline/plan.rs` (`+159/-15`); no `Cargo.toml`, `build.rs`, `.github/workflows/`, binaries, shell/network calls, or clean-room violations. - **Architecture note:** Clean visual fix aligning DLSS/FSR internal render dimensions to multiples of 8 (`VICTORY_FFX_RENDER_ALIGN=8` default, `=1` off) so volumetric cloud passes render properly. Needs manual owner approval to run CI + real-GPU visual PNG & plain-`--release` verification.
Androtim commented 2026-12-02 13:05:21 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T13:05:21Z.


Automated triage for the maintainers (not an approval).

Verdict: needs-gpu-test · CI (check): passing

Review Summary

CI is passing, static checks are clean, and the implementation is well-scoped and sound. Because this changes the default DLSS/FSR render resolution on 1440p Quality (1706x960 -> 1664x936) and Series S Performance (960x540 -> 952x536)—and the branch has not yet been run in-game on MiniVI's DLSS path—this warrants a quick real-GPU smoke test before merging.

What Was Verified

  • crates/victory-gpu/src/streamline/plan.rs: aligned_scale, sizes, render_align, Mode::scale_for, and Mode::render_size_for cleanly search downward in single-precision ULP steps for the largest <= scale yielding both dimensions divisible by align (default 8, configurable 2..=64, 1 to disable). Confirmed against pick_mode / pick_mode_by that the aligned 1440p and 1080p render sizes still map to their intended sl::DLSSMode. Unit test aligned_scales_give_aligned_scenes covers 1080p/1440p/4K across all modes and alignments 2..=16.
  • apps/victory/src/native_1440p.rs: prepare_upscaler now takes output: [u32; 2] and patches NATIVE_LOAD + 4 / SCALED_LOAD + 4 whenever mode != Mode::Quality || scale != mode.scale(), keeping the stock UPSCALER_SCALE (2/3) untouched when already aligned (e.g. 4K Quality). No new binary offsets, hashes, or byte patterns are introduced.
  • apps/victory/src/run.rs: title_output(console) resolves 1920x1080 for Series S and VICTORY_DISPLAY_MODE (defaulting to 3840x2160) for Series X when native_1440p is off, and startup output prints the actual aligned render size.

Minor Non-Blocking Notes

  • In render_align(), setting VICTORY_FFX_RENDER_ALIGN="" (or an unparseable value) falls back to 1 (disabled) rather than the default 8.
  • lowest = (h as f32 * scale * 0.85) as u32 truncates, so on unusual aspect ratios where the first aligned height equals lowest, the returned scale could sit slightly below scale * 0.85 (not hit for standard 16:9 outputs).

Verdict

needs-gpu-test: Ready for a local real-GPU smoke test on MiniVI's DLSS/FSR path to confirm clouds render at 1664x936 (1440p Quality) and no Streamline/DLSS sizing regressions occur.


Generated with Antigravity CLI (agy).

<!-- greyfinch-sync:Androtim/MiniVI:comment:7346331977 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/332#issuecomment-7346331977). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-02T13:05:21Z. --- <!-- minivi-triage v1 head=c062035e960496bc3489bf29eeb021ae66232837 verdict=needs-gpu-test ci=passing at=2026-12-02T14:06:14Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-gpu-test` · **CI (`check`):** `passing` ### Review Summary CI is passing, static checks are clean, and the implementation is well-scoped and sound. Because this changes the default DLSS/FSR render resolution on 1440p Quality (`1706x960` -> `1664x936`) and Series S Performance (`960x540` -> `952x536`)—and the branch has not yet been run in-game on MiniVI's DLSS path—this warrants a quick real-GPU smoke test before merging. ### What Was Verified - **`crates/victory-gpu/src/streamline/plan.rs`**: `aligned_scale`, `sizes`, `render_align`, `Mode::scale_for`, and `Mode::render_size_for` cleanly search downward in single-precision ULP steps for the largest `<= scale` yielding both dimensions divisible by `align` (default `8`, configurable `2..=64`, `1` to disable). Confirmed against `pick_mode` / `pick_mode_by` that the aligned 1440p and 1080p render sizes still map to their intended `sl::DLSSMode`. Unit test `aligned_scales_give_aligned_scenes` covers 1080p/1440p/4K across all modes and alignments `2..=16`. - **`apps/victory/src/native_1440p.rs`**: `prepare_upscaler` now takes `output: [u32; 2]` and patches `NATIVE_LOAD + 4` / `SCALED_LOAD + 4` whenever `mode != Mode::Quality || scale != mode.scale()`, keeping the stock `UPSCALER_SCALE` (`2/3`) untouched when already aligned (e.g. 4K Quality). No new binary offsets, hashes, or byte patterns are introduced. - **`apps/victory/src/run.rs`**: `title_output(console)` resolves `1920x1080` for Series S and `VICTORY_DISPLAY_MODE` (defaulting to `3840x2160`) for Series X when `native_1440p` is off, and startup output prints the actual aligned render size. ### Minor Non-Blocking Notes - In `render_align()`, setting `VICTORY_FFX_RENDER_ALIGN=""` (or an unparseable value) falls back to `1` (disabled) rather than the default `8`. - `lowest = (h as f32 * scale * 0.85) as u32` truncates, so on unusual aspect ratios where the first aligned height equals `lowest`, the returned scale could sit slightly below `scale * 0.85` (not hit for standard 16:9 outputs). ### Verdict `needs-gpu-test`: Ready for a local real-GPU smoke test on MiniVI's DLSS/FSR path to confirm clouds render at `1664x936` (1440p Quality) and no Streamline/DLSS sizing regressions occur. --- _Generated with Antigravity CLI (`agy`)._
Androtim commented 2026-12-02 13:18:20 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T13:18:20Z.


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

Code audit (crates/victory-gpu/src/streamline/plan.rs, apps/victory/src/native_1440p.rs, apps/victory/src/run.rs):

  • Clean, zero unsafe, mathematically exact single-precision aligned_scale() (ULP search bounded, height >= lowest.max(align) prevents underflow, zero/invalid dimensions guarded, both VICTORY_FFX_RENDER_ALIGN=1 and =0 cleanly disable).
  • 1440p Quality (1706x960 -> 1664x936, exact 16:9, multiples of 8) and 1080p Performance (960x540 -> 952x536) are aligned while already-aligned modes (4K Quality 2560x1440, 4K Performance 1920x1080, 1440p Performance 1280x720, 1080p Quality 1280x720) stay untouched. prepare_upscaler adds no new binary addresses/hashes.

Next step (triage: needs gpu test): Because this changes the default 1440p DLSS Quality render resolution to restore clouds, it needs --features diagnostics visual PNG before/after verification (1706x960 vs 1664x936) plus a plain --release A/B check on main (b0842d93+).

<!-- greyfinch-sync:Androtim/MiniVI:comment:7346665044 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/332#issuecomment-7346665044). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-02T13:18:20Z. --- Allowlist & Architect Deep Review (`PiloteCode` is now on the trusted allowlist; CI `46881385348` is **GREEN**): **Code audit (`crates/victory-gpu/src/streamline/plan.rs`, `apps/victory/src/native_1440p.rs`, `apps/victory/src/run.rs`):** - Clean, zero `unsafe`, mathematically exact single-precision `aligned_scale()` (ULP search bounded, `height >= lowest.max(align)` prevents underflow, zero/invalid dimensions guarded, both `VICTORY_FFX_RENDER_ALIGN=1` and `=0` cleanly disable). - `1440p` Quality (`1706x960` -> `1664x936`, exact 16:9, multiples of 8) and `1080p` Performance (`960x540` -> `952x536`) are aligned while already-aligned modes (`4K` Quality `2560x1440`, `4K` Performance `1920x1080`, `1440p` Performance `1280x720`, `1080p` Quality `1280x720`) stay untouched. `prepare_upscaler` adds no new binary addresses/hashes. **Next step (`triage: needs gpu test`):** Because this changes the default `1440p` DLSS Quality render resolution to restore clouds, it needs `--features diagnostics` visual PNG before/after verification (`1706x960` vs `1664x936`) plus a plain `--release` A/B check on `main` (`b0842d93`+).
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
Androtim/MiniVI!332
No description provided.