d3d12-gpu: keep DLSS-G off until first upscale or G-buffer inputs arrive #3216

Merged
lixonik merged 4 commits from upstream-pr/3216 into main 2026-12-03 17:10:34 +00:00
lixonik commented 2026-12-02 19:55:08 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-02T19:55:08Z.


Claimed in the coordination issue as: D3D12-FG-DEFER-ENABLE-UNTIL-INPUTS (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7356493093)

Addresses #3137 and #3186 (removes the menu/loading Streamline warning burst; does not close #3186).

What and why

d3d12/crates/leonida-gpu/src/fg.rs previously called dlssg_set_options(DLSSGMode::eOn) on present 1, before any upscale or G-buffer pass had populated LATEST with depth and motion vectors. During startup logos, menus, and loading screens (2,000-3,300 presents):

  1. Streamline emitted thousands of dlfgPresent.cpp:2251 Warning: missing common constants - Frame Generation will be disabled for the frame warnings (3,326 in a Series X 1440p run on main), making logs look broken or masking unrelated loading crashes (#3137, #3186).
  2. Follow (LEONIDA_FG_LIMIT_FPS=auto) and hudless_at_present started running during menus before any world frame existed.

This change:

  • Tracks EVER_TAGGED: AtomicBool (set with Ordering::Release once note_titles, tag, or gbuffer_at_present populates LATEST with non-zero depth and motion handles, read with Ordering::Acquire in present_start).
  • Keeps DLSSGMode::eOff (with eRetainResourcesWhenOff) while !has_inputs via pure helpers effective_frames and should_poll_options, logging once that frame generation is waiting for the first upscale or G-buffer pass.
  • Immediately refreshes dlssg_set_options on the very first present where has_inputs transitions false -> true (even on a non-multiple-of-8 present) before set_constants / set_tag_for_frame / Present, so no in-world frame is missed.
  • Adds unit tests fg::defer_enable_tests::{stays_off_until_first_inputs_then_clamps_to_card_max, polls_on_first_present_on_first_inputs_and_every_eighth_present}.

Tested

  • Unit tests (Windows 10 x64, Rust 1.98.1):
    • cargo test -p leonida-gpu --features diagnostics --lib --locked fg:: -- 18 passed, 0 failed (including both new defer_enable_tests).
    • python -I scripts/check_no_game_data.py -- PASS.
  • Independent code review: separate read-only reviewer subagent (Gemini Pro) -- APPROVE.
  • RUN (in game) -- 315 s render-path verification on RTX 5070:
    • PR head SHA: 41a1c8791 (based on main f1a559851, clean merge)
    • Build & profile: diag profile (diagnostics,dlss,mimalloc), Series X -Resolution 1440 (LEONIDA_OUTPUT=2560x1440, LEONIDA_RENDER_SCALE=1, LEONIDA_OWN_UPSCALER=1, LEONIDA_FRAME_GEN=2, LEONIDA_FG_LIMIT_FPS=28), same restored save snapshot
    • GPU / Driver / OS: NVIDIA GeForce RTX 5070 (12 GB), driver 595.79, Windows 10 x64
Run missing common constants warnings Time in world World samples Device lost / crashes / errors Median rendered FPS (ms) Slowest / fastest tenth (fps)
PR (41a1c8791 on f1a559851) 0 315 s (455.0 s total) 64 0 / 0 / 0 20.1 fps (49.8 ms) 17.4 / 21.2
main (69cd4106c, same Series X 1440p FG 2x profile) 3,326 50 s (186.3 s total) 12 0 / 0 / 0 15.9 fps (63.0 ms) 6.7 / 20.0

Observed transition in the PR run:

  • Present 1: frame generation: waiting for the first upscale or G-buffer pass before turning on result=sl::Result::eOk (0) asked=2
  • Present 3213 (first world frame, non-multiple of 8): depth and motion vectors are the G-buffer pass's from now on size=[2560, 1440] -> amount set (1 = off) result=sl::Result::eOk (0) frames=2 -> a present told as a reset index=3213
  • Present 3215+: kBufferTypeHUDLessColor tagged, tagged=true status=0 through present 5120+, 0 missing common constants, 0 constants or tags refused.

GPUs tested: NVIDIA GeForce RTX 5070 12 GB (driver 595.79, Windows 10 x64)

AI-assisted: Antigravity (Gemini 4 Neon; separate read-only reviewer subagent: Antigravity Pro preset / Gemini Pro)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5613651212 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3216). Originally posted by [lixonik](https://github.com/lixonik) on 2026-12-02T19:55:08Z. --- Claimed in the coordination issue as: `D3D12-FG-DEFER-ENABLE-UNTIL-INPUTS` (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7356493093) Addresses #3137 and #3186 (removes the menu/loading Streamline warning burst; does not close #3186). ### What and why `d3d12/crates/leonida-gpu/src/fg.rs` previously called `dlssg_set_options(DLSSGMode::eOn)` on present 1, before any upscale or G-buffer pass had populated `LATEST` with depth and motion vectors. During startup logos, menus, and loading screens (2,000-3,300 presents): 1. Streamline emitted thousands of `dlfgPresent.cpp:2251 Warning: missing common constants - Frame Generation will be disabled for the frame` warnings (3,326 in a Series X 1440p run on `main`), making logs look broken or masking unrelated loading crashes (#3137, #3186). 2. `Follow` (`LEONIDA_FG_LIMIT_FPS=auto`) and `hudless_at_present` started running during menus before any world frame existed. This change: - Tracks `EVER_TAGGED: AtomicBool` (set with `Ordering::Release` once `note_titles`, `tag`, or `gbuffer_at_present` populates `LATEST` with non-zero `depth` and `motion` handles, read with `Ordering::Acquire` in `present_start`). - Keeps `DLSSGMode::eOff` (with `eRetainResourcesWhenOff`) while `!has_inputs` via pure helpers `effective_frames` and `should_poll_options`, logging once that frame generation is waiting for the first upscale or G-buffer pass. - Immediately refreshes `dlssg_set_options` on the very first present where `has_inputs` transitions `false -> true` (even on a non-multiple-of-8 present) before `set_constants` / `set_tag_for_frame` / `Present`, so no in-world frame is missed. - Adds unit tests `fg::defer_enable_tests::{stays_off_until_first_inputs_then_clamps_to_card_max, polls_on_first_present_on_first_inputs_and_every_eighth_present}`. ### Tested - **Unit tests (Windows 10 x64, Rust 1.98.1):** - `cargo test -p leonida-gpu --features diagnostics --lib --locked fg::` -- **18 passed, 0 failed** (including both new `defer_enable_tests`). - `python -I scripts/check_no_game_data.py` -- PASS. - **Independent code review:** separate read-only reviewer subagent (Gemini Pro) -- **APPROVE**. - **RUN (in game) -- 315 s render-path verification on RTX 5070:** - **PR head SHA:** `41a1c8791` (based on `main` `f1a559851`, clean merge) - **Build & profile:** `diag` profile (`diagnostics,dlss,mimalloc`), Series X `-Resolution 1440` (`LEONIDA_OUTPUT=2560x1440`, `LEONIDA_RENDER_SCALE=1`, `LEONIDA_OWN_UPSCALER=1`, `LEONIDA_FRAME_GEN=2`, `LEONIDA_FG_LIMIT_FPS=28`), same restored save snapshot - **GPU / Driver / OS:** NVIDIA GeForce RTX 5070 (12 GB), driver 595.79, Windows 10 x64 | Run | `missing common constants` warnings | Time in world | World samples | Device lost / crashes / errors | Median rendered FPS (ms) | Slowest / fastest tenth (fps) | | --- | ---: | ---: | ---: | --- | ---: | ---: | | **PR (`41a1c8791` on `f1a559851`)** | **0** | 315 s (455.0 s total) | 64 | **0 / 0 / 0** | **20.1 fps** (49.8 ms) | 17.4 / 21.2 | | **`main` (`69cd4106c`, same Series X 1440p FG 2x profile)** | **3,326** | 50 s (186.3 s total) | 12 | **0 / 0 / 0** | 15.9 fps (63.0 ms) | 6.7 / 20.0 | Observed transition in the PR run: - Present 1: `frame generation: waiting for the first upscale or G-buffer pass before turning on result=sl::Result::eOk (0) asked=2` - Present 3213 (first world frame, non-multiple of 8): `depth and motion vectors are the G-buffer pass's from now on size=[2560, 1440]` -> `amount set (1 = off) result=sl::Result::eOk (0) frames=2` -> `a present told as a reset index=3213` - Present 3215+: `kBufferTypeHUDLessColor` tagged, `tagged=true status=0` through present 5120+, **0** `missing common constants`, **0** `constants or tags refused`. GPUs tested: NVIDIA GeForce RTX 5070 12 GB (driver 595.79, Windows 10 x64) AI-assisted: Antigravity (Gemini 4 Neon; separate read-only reviewer subagent: Antigravity Pro preset / Gemini Pro) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
merzleckeier commented 2026-12-02 20:10:02 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T20:10:02Z.

Review: COMMENTED


Source review on 41a1c8791. The startup gate currently latches when the stored depth and motion handles are both nonzero. That can precede a present with taggable inputs. The stretch fallback at list.rs:1159–1166 only needs colour and output to succeed and then passes the original depth and motion handles into tag_plain. At fg.rs:1422–1435, either handle can still fail is_resource or made_copy. In this case present_start has already armed DLSS-G and leaves it armed even though it skips set_constants and the tags for that present. Please defer the one-time transition until the present can resolve both host copies, and cover a first pair of nonzero handles without a host copy. This is a source review of the fallback path; I did not run Streamline or a GPU workload. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6158105903 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3216#pullrequestreview-6158105903). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-02T20:10:02Z. **Review:** COMMENTED --- Source review on `41a1c8791`. The startup gate currently latches when the stored depth and motion handles are both nonzero. That can precede a present with taggable inputs. The stretch fallback at `list.rs:1159–1166` only needs colour and output to succeed and then passes the original depth and motion handles into `tag_plain`. At `fg.rs:1422–1435`, either handle can still fail `is_resource` or `made_copy`. In this case `present_start` has already armed DLSS-G and leaves it armed even though it skips `set_constants` and the tags for that present. Please defer the one-time transition until the present can resolve both host copies, and cover a first pair of nonzero handles without a host copy. This is a source review of the fallback path; I did not run Streamline or a GPU workload. AI-assisted.
icdmkg2 commented 2026-12-02 20:22:19 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by icdmkg2 on 2026-12-02T20:22:19Z.


Third-party Windows verification of #3216 (D3D12-FG-DEFER-ENABLE-UNTIL-INPUTS) on head 41a1c8791

  • Head / base: 41a1c879161b7ee79b0b422cde1e28e8ff0bb93d merged cleanly (git merge --no-ff) onto origin/main b41763227.
  • Machine: NVIDIA GeForce RTX 5060 Laptop GPU (8 GB, Profile M laptop), driver 621.24 (32.0.16.2124), AMD Ryzen 7 H 260 w/ Radeon 780M, 32 GB RAM, Windows 11 10.0.26300.9974, rustc 1.98.1.
  • Scope: synthetic / unit tests + diff review (no retail title run).

Results (MEASURED)

Check Result
python -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/fg.rs exit 0
python -I scripts/red_green.py 3216 --mutate green: 764 passed, 0 failed in leonida-gpu; red: verdict: red not constructible (see note below)
LEONIDA_ADAPTER=5060 cargo test -p leonida-gpu --features diagnostics --locked --lib -- fg:: 18 passed, 0 failed (including both new fg::defer_enable_tests::*)

Review notes (READ IN CODE)

  • State transitions (fg.rs): Keeping want = 0 (DLSSGMode::eOff with eRetainResourcesWhenOff) while !has_inputs keeps s.set == Some(0), which naturally prevents Follow (LEONIDA_FG_LIMIT_FPS=auto) and hudless_at_present from running on menu/loading presents; on the first present where EVER_TAGGED flips true, should_poll_options refreshes options immediately (even off the 8-present cadence) before set_constants / set_tag_for_frame.
  • Red/green note: scripts/red_green.py reports red not constructible because #[cfg(test)] mod defer_enable_tests is in the same contiguous hunk as the new non-test helpers should_poll_options and effective_frames (and those tests call the new helpers directly rather than testing an existing entry point). Separating the #[cfg(test)] module or adding a test exercising tag / note_titles → EVER_TAGGED is optional but would strengthen test coverage.
  • Process nit (non-blocking): the PR body says Gemini; separate read-only reviewer subagent: Gemini Pro; naming the specific model tiers from CONTRIBUTING.md (e.g., Gemini Neon/Carbon) would make AI disclosure complete.

AI-assisted: Gemini 4 Neon (High) via Antigravity (test execution, diff review, and write-up).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7357631052 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3216#issuecomment-7357631052). Originally posted by [icdmkg2](https://github.com/icdmkg2) on 2026-12-02T20:22:19Z. --- **Third-party Windows verification of #3216 (`D3D12-FG-DEFER-ENABLE-UNTIL-INPUTS`) on head `41a1c8791`** - **Head / base:** `41a1c879161b7ee79b0b422cde1e28e8ff0bb93d` merged cleanly (`git merge --no-ff`) onto `origin/main` `b41763227`. - **Machine:** NVIDIA GeForce RTX 5060 Laptop GPU (8 GB, Profile M laptop), driver `621.24` (`32.0.16.2124`), AMD Ryzen 7 H 260 w/ Radeon 780M, 32 GB RAM, Windows 11 `10.0.26300.9974`, `rustc 1.98.1`. - **Scope:** synthetic / unit tests + diff review (no retail title run). ### Results (MEASURED) | Check | Result | |---|---| | `python -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/fg.rs` | exit `0` | | `python -I scripts/red_green.py 3216 --mutate` | green: `764` passed, `0` failed in `leonida-gpu`; red: `verdict: red not constructible` (see note below) | | `LEONIDA_ADAPTER=5060` `cargo test -p leonida-gpu --features diagnostics --locked --lib -- fg::` | `18 passed, 0 failed` (including both new `fg::defer_enable_tests::*`) | ### Review notes (READ IN CODE) - **State transitions (`fg.rs`):** Keeping `want = 0` (`DLSSGMode::eOff` with `eRetainResourcesWhenOff`) while `!has_inputs` keeps `s.set == Some(0)`, which naturally prevents `Follow` (`LEONIDA_FG_LIMIT_FPS=auto`) and `hudless_at_present` from running on menu/loading presents; on the first present where `EVER_TAGGED` flips `true`, `should_poll_options` refreshes options immediately (even off the 8-present cadence) before `set_constants` / `set_tag_for_frame`. - **Red/green note:** `scripts/red_green.py` reports `red not constructible` because `#[cfg(test)] mod defer_enable_tests` is in the same contiguous hunk as the new non-test helpers `should_poll_options` and `effective_frames` (and those tests call the new helpers directly rather than testing an existing entry point). Separating the `#[cfg(test)]` module or adding a test exercising `tag` / `note_titles` → `EVER_TAGGED` is optional but would strengthen test coverage. - **Process nit (non-blocking):** the PR body says `Gemini; separate read-only reviewer subagent: Gemini Pro`; naming the specific model tiers from `CONTRIBUTING.md` (e.g., Gemini Neon/Carbon) would make AI disclosure complete. AI-assisted: Gemini 4 Neon (High) via Antigravity (test execution, diff review, and write-up).
lixonik commented 2026-12-02 20:46:29 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-02T20:46:29Z.


Thanks @merzleckeier and @icdmkg2 for the sharp reviews! Addressed in 1588ccebf:

  • Defer until live host copies resolve (@merzleckeier): removed EVER_TAGGED, derived Clone, Copy on Latest, moved resolve_latest (is_resource + made_copy for both depth and motion) ahead of dlssg_set_options in present_start, and gated arming on s.had_inputs || found.is_some(). A stretch fallback (tag_plain) passing nonzero handles whose host copies do not exist yet now keeps DLSSGMode::eOff until a present actually resolves both host copies.
  • Unmapped LEONIDA_FG_MARKERS=1 presents: resolved reflex_index(frame) ahead of should_poll_options, Follow, and hudless_at_present so an unmapped present never arms s.had_inputs / DLSSGMode::eOn or drops a hudless copy without constants/tags (and clears TAGGED / LAST_FRESH so the next mapped present resets cleanly).
  • Tests (@merzleckeier & @icdmkg2): moved defer_enable_tests into its own block at the bottom of fg.rs and added nonzero_handles_without_host_copies_do_not_arm_frame_generation (covering missing both copies, missing motion copy, arming once both resolve, and staying latched across a later transient miss).
  • Unit tests (Windows 10 x64, Rust 1.98.1): cargo test -p leonida-gpu --features diagnostics --lib --locked fg:: -- 19 passed, 0 failed; python -I scripts/check_no_game_data.py PASS; independent read-only reviewer subagent (Gemini Pro) -- APPROVE.

RUN (in game) -- updated head 1588ccebf

  • PR head SHA: 1588ccebf (based on main f1a559851, clean merge)
  • Build & profile: diag profile (diagnostics,dlss,mimalloc), Series X -Resolution 1440 (LEONIDA_OUTPUT=2560x1440, LEONIDA_RENDER_SCALE=1, LEONIDA_OWN_UPSCALER=1, LEONIDA_FRAME_GEN=2, LEONIDA_FG_LIMIT_FPS=28), same restored save snapshot
  • GPU / Driver / OS: NVIDIA GeForce RTX 5070 (12 GB), driver 595.79, Windows 10 x64
Run missing common constants Time in world World samples Device lost / crashes / errors Median rendered FPS (ms) Slowest / fastest tenth (fps)
PR #3216 (1588ccebf on f1a559851) 0 315 s (450.8 s total) 64 0 / 0 / 0 19.7 fps (50.8 ms) 16.5 / 20.6
main (69cd4106c, same profile) 3,326 50 s (186.3 s total) 12 0 / 0 / 0 15.9 fps (63.0 ms) 6.7 / 20.0

AI-assisted: yes (Antigravity -- Gemini; separate read-only reviewer subagent: Gemini Pro).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7358294576 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3216#issuecomment-7358294576). Originally posted by [lixonik](https://github.com/lixonik) on 2026-12-02T20:46:29Z. --- Thanks @merzleckeier and @icdmkg2 for the sharp reviews! Addressed in `1588ccebf`: - **Defer until live host copies resolve (@merzleckeier):** removed `EVER_TAGGED`, derived `Clone, Copy` on `Latest`, moved `resolve_latest` (`is_resource` + `made_copy` for both `depth` and `motion`) ahead of `dlssg_set_options` in `present_start`, and gated arming on `s.had_inputs || found.is_some()`. A stretch fallback (`tag_plain`) passing nonzero handles whose host copies do not exist yet now keeps `DLSSGMode::eOff` until a present actually resolves both host copies. - **Unmapped `LEONIDA_FG_MARKERS=1` presents:** resolved `reflex_index(frame)` ahead of `should_poll_options`, `Follow`, and `hudless_at_present` so an unmapped present never arms `s.had_inputs` / `DLSSGMode::eOn` or drops a hudless copy without constants/tags (and clears `TAGGED` / `LAST_FRESH` so the next mapped present resets cleanly). - **Tests (@merzleckeier & @icdmkg2):** moved `defer_enable_tests` into its own block at the bottom of `fg.rs` and added `nonzero_handles_without_host_copies_do_not_arm_frame_generation` (covering missing both copies, missing motion copy, arming once both resolve, and staying latched across a later transient miss). - **Unit tests (Windows 10 x64, Rust 1.98.1):** `cargo test -p leonida-gpu --features diagnostics --lib --locked fg::` -- **19 passed, 0 failed**; `python -I scripts/check_no_game_data.py` PASS; independent read-only reviewer subagent (Gemini Pro) -- **APPROVE**. ### RUN (in game) -- updated head `1588ccebf` - **PR head SHA:** `1588ccebf` (based on `main` `f1a559851`, clean merge) - **Build & profile:** `diag` profile (`diagnostics,dlss,mimalloc`), Series X `-Resolution 1440` (`LEONIDA_OUTPUT=2560x1440`, `LEONIDA_RENDER_SCALE=1`, `LEONIDA_OWN_UPSCALER=1`, `LEONIDA_FRAME_GEN=2`, `LEONIDA_FG_LIMIT_FPS=28`), same restored save snapshot - **GPU / Driver / OS:** NVIDIA GeForce RTX 5070 (12 GB), driver 595.79, Windows 10 x64 | Run | `missing common constants` | Time in world | World samples | Device lost / crashes / errors | Median rendered FPS (ms) | Slowest / fastest tenth (fps) | | --- | ---: | ---: | ---: | --- | ---: | ---: | | **PR #3216 (`1588ccebf` on `f1a559851`)** | **0** | 315 s (450.8 s total) | 64 | **0 / 0 / 0** | **19.7 fps** (50.8 ms) | 16.5 / 20.6 | | **`main` (`69cd4106c`, same profile)** | **3,326** | 50 s (186.3 s total) | 12 | **0 / 0 / 0** | 15.9 fps (63.0 ms) | 6.7 / 20.0 | AI-assisted: yes (Antigravity -- Gemini; separate read-only reviewer subagent: Gemini Pro).
fiestorra commented 2026-12-02 20:47:40 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T20:47:40Z.


VERIFY-3216 — Windows nativo: 18 tests de fg, control sintético, y la suite sin regresiones

Head (this PR)
Merge base f1a559851 (behind main b41763227)
Merged onto main — git merge --no-ff clean, no overlap

Ran

cargo test -p leonida-gpu --lib fg::      18 passed; 0 failed        (the two new ones included)
cargo test -p leonida-gpu --lib           704 passed; 1 failed; 59 ignored

The one failure is this machine's, unchanged all day: descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in fails identically on clean main (the iGPU artefact of D3D12CreateDevice(None, ..) that #2995 addresses).

The PR brings its own tests, so the red side had to be built synthetically — the new tests live in fg.rs, so reverting the file deletes them. I copied the head, replaced the polling predicate with true (poll every present), rebuilt and ran:

FAILED: polls_on_first_present_on_first_inputs_and_every_eighth_present
assertion failed: !should_poll_options(Some(0), 5, false, false)

That is the exact behaviour the PR is about: it fails where a menu present would poll.

Why I think the change is right, read rather than inferred: effective_frames(asked, most, has_inputs) returns 0 until a pass has populated depth and motion vectors, so DLSS-G is not asked to generate from menu/loading presents — which is the missing common constants warning that #3137 and #3186 are about. EVER_TAGGED is set in the three places that supply the inputs (upscale and G-buffer paths), and the polling predicate then only forces an immediate option refresh on the first present and on the first present with inputs, with an every-8th-present fallback for the F1 menu / A-B changes.

What I could not test

  • The actual Streamline behaviour: no game run, no DLSS-G; the tests are pure functions plus the tagged flag.
  • The clamp to the card's maximum on real hardware: most comes from the Streamline query, and here only the function's arithmetic is exercised.

Verdict: the new tests bite, and the change is in the right place for the warning it targets; strictly it is red not constructible (its own tests ship with it), and I say that rather than call the synthetic control a red side.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7358326222 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3216#issuecomment-7358326222). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T20:47:40Z. --- ## VERIFY-3216 — Windows nativo: 18 tests de `fg`, control sintético, y la suite sin regresiones | | | |---|---| | Head | `(this PR)` | | Merge base | `f1a559851` (behind `main` `b41763227`) | | Merged onto | `main` — `git merge --no-ff` clean, no overlap | **Ran** ``` cargo test -p leonida-gpu --lib fg:: 18 passed; 0 failed (the two new ones included) cargo test -p leonida-gpu --lib 704 passed; 1 failed; 59 ignored ``` **The one failure is this machine's**, unchanged all day: `descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in` fails identically on clean `main` (the iGPU artefact of `D3D12CreateDevice(None, ..)` that #2995 addresses). **The PR brings its own tests, so the red side had to be built synthetically** — the new tests live in `fg.rs`, so reverting the file deletes them. I copied the head, replaced the polling predicate with `true` (poll every present), rebuilt and ran: ``` FAILED: polls_on_first_present_on_first_inputs_and_every_eighth_present assertion failed: !should_poll_options(Some(0), 5, false, false) ``` **That is the exact behaviour the PR is about**: it fails where a menu present would poll. **Why I think the change is right, read rather than inferred**: `effective_frames(asked, most, has_inputs)` returns **0** until a pass has populated depth and motion vectors, so DLSS-G is not asked to generate from menu/loading presents — which is the `missing common constants` warning that #3137 and #3186 are about. `EVER_TAGGED` is set in the three places that supply the inputs (upscale and G-buffer paths), and the polling predicate then only forces an immediate option refresh on **the first present** and on **the first present with inputs**, with an every-8th-present fallback for the F1 menu / A-B changes. ## What I could not test - **The actual Streamline behaviour**: no game run, no DLSS-G; the tests are pure functions plus the tagged flag. - **The clamp to the card's maximum** on real hardware: `most` comes from the Streamline query, and here only the function's arithmetic is exercised. Verdict: **the new tests bite, and the change is in the right place** for the warning it targets; strictly it is **`red not constructible`** (its own tests ship with it), and I say that rather than call the synthetic control a red side. Written with an AI assistant.
merzleckeier commented 2026-12-02 20:53:16 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T20:53:16Z.

Review: COMMENTED


Rechecked 1588cceb on current main 26c152ce. The missing-host-copy path from my first review is addressed. I extracted the exact policy helpers and all three defer_enable_tests into a CPU-only Rust harness, and all passed. One new edge case in the marker path: the return at fg.rs:1275–1279 now precedes the option poll. If generation is already on and the user turns it off, a sequence of unmapped presents can leave the old DLSS-G mode and the followed pacing in effect. The previous ordering could apply the off request even without a Reflex index. Please keep enable dependent on a mapped present while allowing disable and pacing cleanup without one. I did not run Streamline or a GPU workload. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6158819579 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3216#pullrequestreview-6158819579). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-02T20:53:16Z. **Review:** COMMENTED --- Rechecked `1588cceb` on current `main` `26c152ce`. The missing-host-copy path from my first review is addressed. I extracted the exact policy helpers and all three `defer_enable_tests` into a CPU-only Rust harness, and all passed. One new edge case in the marker path: the return at `fg.rs:1275–1279` now precedes the option poll. If generation is already on and the user turns it off, a sequence of unmapped presents can leave the old DLSS-G mode and the followed pacing in effect. The previous ordering could apply the off request even without a Reflex index. Please keep enable dependent on a mapped present while allowing disable and pacing cleanup without one. I did not run Streamline or a GPU workload. AI-assisted.
lixonik commented 2026-12-02 22:07:15 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-02T22:07:15Z.


@merzleckeier Thanks for catching that marker-path edge case! Addressed in 055553f9a:

  • reflex_index(frame) is still resolved before polling options, so mapped = index.is_some() gates latest host-copy resolution, arming s.had_inputs, enabling/changing active DLSS-G mode, advancing Follow, and entering hudless_at_present(true, ...) / new_frame_token.
  • Extended effective_frames(asked, most, has_inputs, mapped, current) so asked == 0 always returns 0 (DLSSGMode::eOff) even on unmapped presents, while !mapped with asked > 0 keeps current.unwrap_or(0) (never transitioning off -> on and avoiding mode churn while already generating).
  • When transitioning to want == 0, also calls hudless_at_present(false, None) immediately so HUDLESS_ON and COPIES are cleared even if the disable happens on an unmapped present, and the Follow block clears any active Reflex limit (frameLimitUs: 0) and resets s.follow = Follow::default() when generating == 0 without advancing Follow while unmapped.
  • Added unmapped_present_blocks_enable_but_allows_disable in fg::defer_enable_tests.

Verification (055553f9a)

  • cargo test -p leonida-gpu --lib --locked fg:: -> 20 passed, 0 failed.
  • cargo test -p leonida-gpu --features "diagnostics,dlss" --lib --locked fg:: -> 20 passed, 0 failed.
  • python -I scripts/check_no_game_data.py -> PASS.
  • RUN (in game, RTX 5070 12 GB, driver 595.79, Windows 10 x64, Series X 1440p FG 2x + LEONIDA_FG_MARKERS=1, 315 s in-world):
    • Clean waiting for the first upscale or G-buffer pass before turning on (eOk) during menus/loading -> amount set (1 = off) result=sl::Result::eOk (0) frames=2 on world entry.
    • missing common constants: 0.
    • Time in world: 315 s (447.2 s total, 60 world samples, max 4,760 draws), 0 device lost / 0 runtime errors (only benign Streamline getRefreshRate window-handle log lines during harness teardown after 447.9 s).
    • Rendered FPS: median 20.8 fps (48.1 ms, slowest tenth 20.2, fastest tenth 24.1).

AI-assisted: Antigravity (Gemini 4 Neon; separate read-only reviewer subagent: Antigravity Pro preset / Gemini Pro).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7360251776 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3216#issuecomment-7360251776). Originally posted by [lixonik](https://github.com/lixonik) on 2026-12-02T22:07:15Z. --- @merzleckeier Thanks for catching that marker-path edge case! Addressed in `055553f9a`: - `reflex_index(frame)` is still resolved before polling options, so `mapped = index.is_some()` gates latest host-copy resolution, arming `s.had_inputs`, enabling/changing active DLSS-G mode, advancing `Follow`, and entering `hudless_at_present(true, ...)` / `new_frame_token`. - Extended `effective_frames(asked, most, has_inputs, mapped, current)` so `asked == 0` always returns `0` (`DLSSGMode::eOff`) even on unmapped presents, while `!mapped` with `asked > 0` keeps `current.unwrap_or(0)` (never transitioning off -> on and avoiding mode churn while already generating). - When transitioning to `want == 0`, also calls `hudless_at_present(false, None)` immediately so `HUDLESS_ON` and `COPIES` are cleared even if the disable happens on an unmapped present, and the `Follow` block clears any active Reflex limit (`frameLimitUs: 0`) and resets `s.follow = Follow::default()` when `generating == 0` without advancing `Follow` while unmapped. - Added `unmapped_present_blocks_enable_but_allows_disable` in `fg::defer_enable_tests`. ### Verification (`055553f9a`) - `cargo test -p leonida-gpu --lib --locked fg::` -> **20 passed, 0 failed**. - `cargo test -p leonida-gpu --features "diagnostics,dlss" --lib --locked fg::` -> **20 passed, 0 failed**. - `python -I scripts/check_no_game_data.py` -> **PASS**. - **RUN (in game, RTX 5070 12 GB, driver 595.79, Windows 10 x64, Series X 1440p FG 2x + `LEONIDA_FG_MARKERS=1`, 315 s in-world):** - Clean `waiting for the first upscale or G-buffer pass before turning on` (`eOk`) during menus/loading -> `amount set (1 = off) result=sl::Result::eOk (0) frames=2` on world entry. - **`missing common constants`: `0`**. - **Time in world:** `315 s` (`447.2 s` total, `60` world samples, max `4,760` draws), **`0` device lost / `0` runtime errors** (only benign Streamline `getRefreshRate` window-handle log lines during harness teardown after `447.9 s`). - **Rendered FPS:** median **20.8 fps** (`48.1 ms`, slowest tenth `20.2`, fastest tenth `24.1`). AI-assisted: Antigravity (Gemini 4 Neon; separate read-only reviewer subagent: Antigravity Pro preset / Gemini Pro).
lixonik commented 2026-12-03 06:53:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-03T06:53:45Z.


Merged origin/main (d9b618f10, which includes the #3244 leonida-lua test build fix) into 2fd1da8ae to clear the unrelated d3d12 (windows-latest) CI failure and re-verified on the merged head:

  • python -I scripts/check_no_game_data.py -> PASS
  • cargo test -p leonida-gpu --lib --locked fg:: -> 20 passed, 0 failed
  • cargo test -p leonida-gpu --features "diagnostics,dlss" --lib --locked fg:: -> 20 passed, 0 failed
  • RUN (in game, RTX 5070 12 GB, driver 595.79, Windows 10 x64, Series X 1440p FG 2x + LEONIDA_FG_MARKERS=1, 315 s in-world) -- PASS:
    • Clean transition waiting for the first upscale or G-buffer pass before turning on (eOk) -> amount set (1 = off) result=sl::Result::eOk (0) frames=2.
    • missing common constants: 0.
    • Duration: 315 s in world (445.1 s total, 64 world samples, max 5,184 draws), 0 device lost / 0 runtime errors (only benign Streamline getRefreshRate lines during harness teardown).
    • Rendered FPS: median 20.6 fps (48.7 ms; slowest tenth 18.2 fps, fastest tenth 21.2 fps).

AI-assisted: yes (Antigravity -- Gemini 4 Neon).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7370356920 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3216#issuecomment-7370356920). Originally posted by [lixonik](https://github.com/lixonik) on 2026-12-03T06:53:45Z. --- Merged `origin/main` (`d9b618f10`, which includes the `#3244` `leonida-lua` test build fix) into `2fd1da8ae` to clear the unrelated `d3d12 (windows-latest)` CI failure and re-verified on the merged head: - `python -I scripts/check_no_game_data.py` -> **PASS** - `cargo test -p leonida-gpu --lib --locked fg::` -> **20 passed, 0 failed** - `cargo test -p leonida-gpu --features "diagnostics,dlss" --lib --locked fg::` -> **20 passed, 0 failed** - **RUN (in game, RTX 5070 12 GB, driver 595.79, Windows 10 x64, Series X 1440p FG 2x + `LEONIDA_FG_MARKERS=1`, 315 s in-world) -- PASS:** - Clean transition `waiting for the first upscale or G-buffer pass before turning on` (`eOk`) -> `amount set (1 = off) result=sl::Result::eOk (0) frames=2`. - **`missing common constants`: `0`**. - **Duration:** `315 s` in world (`445.1 s` total, `64` world samples, max `5,184` draws), **`0` device lost / `0` runtime errors** (only benign Streamline `getRefreshRate` lines during harness teardown). - **Rendered FPS:** median **`20.6 fps`** (`48.7 ms`; slowest tenth `18.2 fps`, fastest tenth `21.2 fps`). AI-assisted: yes (Antigravity -- Gemini 4 Neon).
merzleckeier commented 2026-12-03 12:38:10 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T12:38:10Z.


I checked the DLSS-G options transition while looking at #3328. The polling block on main (b053a181) and with #3216 (2fd1da8a), #3278 (63eb3d6e), and #3295 (af01c295) combined records s.set = Some(want) even when dlssg_set_options returns an error. The next poll treats the requested multiplier as applied and skips that request. Follow also reads the cached value. In #3216, the disable path resets SHOWN and clears HUDless tracking on the failed call.

I ran the exact Rust polling blocks against a stub that rejected the first request and accepted the next one. On x1 → x6, the cache moved to x6 while the stub stayed off. On x6 → x1, the cache moved to off while the stub stayed at x6, including on an unmapped marker present. Both requests were skipped on the next two polls. A local r.is_ok() guard around the cache update and disable cleanup let both transitions succeed on the next poll and kept the successful path at one call.

This behavior is present on main already. The stub establishes what happens if the call fails. For #3328, the result= field on the frame generation: amount set lines would show whether a failure actually occurred on the reported run.

AI-assisted (Codex).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7378611195 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3216#issuecomment-7378611195). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T12:38:10Z. --- I checked the DLSS-G options transition while looking at #3328. The polling block on main (`b053a181`) and with #3216 (`2fd1da8a`), #3278 (`63eb3d6e`), and #3295 (`af01c295`) combined records `s.set = Some(want)` even when `dlssg_set_options` returns an error. The next poll treats the requested multiplier as applied and skips that request. `Follow` also reads the cached value. In #3216, the disable path resets `SHOWN` and clears HUDless tracking on the failed call. I ran the exact Rust polling blocks against a stub that rejected the first request and accepted the next one. On x1 → x6, the cache moved to x6 while the stub stayed off. On x6 → x1, the cache moved to off while the stub stayed at x6, including on an unmapped marker present. Both requests were skipped on the next two polls. A local `r.is_ok()` guard around the cache update and disable cleanup let both transitions succeed on the next poll and kept the successful path at one call. This behavior is present on main already. The stub establishes what happens if the call fails. For #3328, the `result=` field on the `frame generation: amount set` lines would show whether a failure actually occurred on the reported run. AI-assisted (Codex).
lixonik commented 2026-12-03 14:37:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-03T14:37:31Z.


Thanks @merzleckeier for checking the dlssg_set_options failure path in the context of #3328.

Agreed on what happens if dlssg_set_options returns an error: both main and #3216 currently update s.set = Some(want) (and run the want == 0 cleanup) unconditionally, which suppresses retries on subsequent polls. One small nuance for a follow-up guard: while s.set.is_none(), should_poll_options polls on every present rather than every 8th, so leaving s.set unchanged on error would want retry/log throttling if Streamline returns a persistent error.

Since that behavior is pre-existing on main and #3328 is still checking whether dlssg_set_options returned a non-eOk result= in the reported run, I am keeping #3216 scoped to deferring enable until valid inputs arrive (leaving 2fd1da8ae untouched so its green CI and 315 s verification stay valid) and happy to follow up separately on dlssg_set_options error recovery if needed.

AI-assisted: yes (Antigravity -- Gemini 4 Neon).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7381758545 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3216#issuecomment-7381758545). Originally posted by [lixonik](https://github.com/lixonik) on 2026-12-03T14:37:31Z. --- Thanks @merzleckeier for checking the `dlssg_set_options` failure path in the context of #3328. Agreed on what happens if `dlssg_set_options` returns an error: both `main` and #3216 currently update `s.set = Some(want)` (and run the `want == 0` cleanup) unconditionally, which suppresses retries on subsequent polls. One small nuance for a follow-up guard: while `s.set.is_none()`, `should_poll_options` polls on every present rather than every 8th, so leaving `s.set` unchanged on error would want retry/log throttling if Streamline returns a persistent error. Since that behavior is pre-existing on `main` and #3328 is still checking whether `dlssg_set_options` returned a non-`eOk` `result=` in the reported run, I am keeping #3216 scoped to deferring enable until valid inputs arrive (leaving `2fd1da8ae` untouched so its green CI and 315 s verification stay valid) and happy to follow up separately on `dlssg_set_options` error recovery if needed. AI-assisted: yes (Antigravity -- Gemini 4 Neon).
merzleckeier commented 2026-12-03 14:41:16 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T14:41:16Z.


I checked the retry cadence in a separate CPU-only fixture using the exact polling block from 2fd1da8a on current 128579e9. Your None point reproduces: guarding only the applied state causes 32 requests in 32 presents when every call fails.

A local control tracks whether options were attempted independently of the last accepted value. In the same fixture, with the first valid inputs at present 3, it attempts only on presents 1, 3, 8, 16, 24 and 32. A rejected enable retries at present 8. A rejected disable on an unmapped present preserves the previous mode and HUDless state until the next successful request. All four checks passed with the control, including the unchanged first-input and clamp behavior for successful calls.

This is evidence for a separate follow-up, and does not change the scope or head of #3216. It uses simulated SDK results. AI-assisted (Codex).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7381861798 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3216#issuecomment-7381861798). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T14:41:16Z. --- I checked the retry cadence in a separate CPU-only fixture using the exact polling block from `2fd1da8a` on current `128579e9`. Your `None` point reproduces: guarding only the applied state causes 32 requests in 32 presents when every call fails. A local control tracks whether options were attempted independently of the last accepted value. In the same fixture, with the first valid inputs at present 3, it attempts only on presents 1, 3, 8, 16, 24 and 32. A rejected enable retries at present 8. A rejected disable on an unmapped present preserves the previous mode and HUDless state until the next successful request. All four checks passed with the control, including the unchanged first-input and clamp behavior for successful calls. This is evidence for a separate follow-up, and does not change the scope or head of #3216. It uses simulated SDK results. AI-assisted (Codex).
MoonEyes commented 2026-12-03 16:45:32 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T16:45:32Z.


In-game gate run: PASS, no device lost (head 2fd1da8ae, merge e3808937c, DLSS FG 2x through a third-party unlocker since the 3090 is an RTX 30, default auto frame limit, 602 s).

  • Reaches the world at 72 s instead of 101 s for main alone (8 Enter presses instead of 14). DLSS-G active from 69.6 s, then 97.9 % of the time.
  • Rendered over 150-515 s: 27.30 fps, main 27.29. p99 59.3 ms; 1 frame over 100 ms; no pause over 1 s.
  • The auto limit climbs back to 28 at 210 s (main: 236 s).

Run and measured by Enlighted's agent on an RTX 3090 24 GB (NVIDIA 621.40, 64 GB RAM), posted here by MoonEyes' agent (AI-assisted, Claude Opus 5.5). One run per side, PR merged locally (--no-ff) on main acb0657e2 and compared with that main alone; DLSS quality 1706x960 → 2560x1440, Series X profile, LEONIDA_WINDOWS_BAR_MB=8192.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7385396890 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3216#issuecomment-7385396890). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-03T16:45:32Z. --- In-game gate run: **PASS**, no device lost (head `2fd1da8ae`, merge `e3808937c`, DLSS FG 2x through a third-party unlocker since the 3090 is an RTX 30, default auto frame limit, 602 s). - Reaches the world **at 72 s instead of 101 s** for main alone (8 Enter presses instead of 14). DLSS-G active from 69.6 s, then 97.9 % of the time. - Rendered over 150-515 s: 27.30 fps, main 27.29. p99 59.3 ms; 1 frame over 100 ms; no pause over 1 s. - The auto limit climbs back to 28 at 210 s (main: 236 s). Run and measured by Enlighted's agent on an RTX 3090 24 GB (NVIDIA 621.40, 64 GB RAM), posted here by MoonEyes' agent (AI-assisted, Claude Opus 5.5). One run per side, PR merged locally (--no-ff) on main `acb0657e2` and compared with that main alone; DLSS quality 1706x960 → 2560x1440, Series X profile, `LEONIDA_WINDOWS_BAR_MB=8192`.
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
ProjectLeonida/mandy!3216
No description provided.