d3d12: DLSS is told the motion vectors carry the jitter only where the title's upscale context says so (D3D12-DLSS-MV-JITTER-FOLLOWS-TITLE) #3037

Closed
lucaspiro wants to merge 1 commit from upstream-pr/3037 into main
lucaspiro commented 2026-12-02 04:10:30 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lucaspiro on 2026-12-02T04:10:30Z.


Claimed in the coordination issue as: D3D12-DLSS-MV-JITTER-FOLLOWS-TITLE (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7334632023)

What and why

On the Series S profile with DLSS, every moving thing shook every frame: the characters of the pause menu's "Jason and Lucía" page, a car standing in the world, anything animated. Still things did not, and the picture stood still on the Series X profile with the title's own upscaler.

The title makes its FidelityFX upscale context with flags 0x29: high dynamic range, depth inverted and auto exposure, without FFX_UPSCALE_ENABLE_MOTION_VECTORS_JITTER_CANCELLATION (1<<2). Its motion vectors do not carry the camera's jitter. dlss.rs nevertheless made every DLSS feature with NVSDK_NGX_DLSS_Feature_Flags_MVJittered, so DLSS took a jitter out of vectors that never had it and moved every moving thing by it, a different way each frame.

The jitter itself is right: an upscale probe (LEONIDA_UPSCALE_PROBE=1) shows the title's sequence within half a pixel, as it queries it, and LEONIDA_DLSS_JITTER_SIGN=-1 changed nothing.

This change:

  • ffx.rs: create keeps the title's context flags (before the DLL sees the description, so the stand-in sizes path keeps them too), and each upscale says whether its vectors carry the jitter (vectors_jittered). With no context seen it stays as before: they do.
  • list.rs: the bit travels in Upscale (word 10, bit 2, beside reset and dlss, so it survives LEONIDA_THIN's words). The DLSS creation flags are built by a pure dlss_feature_flags, next to dlss_mode, so its test runs without the dlss feature.
  • dlss.rs: uses them; LEONIDA_DLSS_MV_JITTERED=0|1 overrides, like LEONIDA_DLSS_HDR and LEONIDA_DLSS_DEPTH_INVERTED; the DLSS: feature made line now says mv_jittered.
  • findings.md: the new finding, and a correction: the probe's flags 0x0 quoted as "no jitter cancellation" are the dispatch's flags; jitter cancellation is a context flag.
  • switches.md: regenerated for the new name (only its rows).

Not covered: DLSS frame generation still tags the vectors as jittered (fg.rs:959, motionVectorsJittered = eTrue). Same question, a second consumer; not changed here and not measured, posted as a finding: (same comment as the claim).

Tested

  • In game (Series S, DLSS Quality, 1280x720 → 1920x1080, frame generation 2x): with the flag off (DLSS: feature made ... mv_jittered=false) the shaking was gone on the pause menu's characters and in the world; with it on (main) it was back. The same runs log upscale context render=[1280, 720] upscale=[1920, 1080] flags=0x29. That was measured on a local build with the flag as a switch; this branch makes the same decision from the title's flags.
  • Red/green: the new tests (ffx.rs the_vectors_jitter_follows_the_titles_context, the strengthened a_creation_description_at_an_odd_address_is_read_and_written; list.rs dlss_is_told_of_jittered_vectors_only_where_they_are, an_upscale_keeps_its_numbers_through_its_words) fail with the old decision put back (always jittered) and pass with this change. On main they do not build (new field and functions).
  • cargo test --workspace --exclude xtask --locked -- --skip depth_bounds_pipeline_loads_and_filters_draws (CI's command): every suite that finished passed, among them leonida-gpu (658) and leonida-hle (249); leonida-shader's suite, which this change does not touch, was still running and was stopped. cargo build --locked --profile diag -p leonida --features diagnostics,dlss,mimalloc builds.
  • python -I tools/d3d12_switches.py --check d3d12/docs/switches.md and tests/test_d3d12_switches.py pass; python -I scripts/check_no_game_data.py on the changed files passes.

GPUs tested: NVIDIA GeForce RTX 5070, driver 617.14, Windows 11 Pro 26200.

AI-assisted: yes. Diagnosis and change with Claude Code (Claude Sonnet 5.5 and Claude Opus 5.5); independent read-only review by a separate Claude Opus 5.5 agent, whose findings (move the flags' test out of the dlss feature, test the create path with 0x29, cite the source, correct findings.md) are addressed here.

Checklist

  • Based on current main (2172c15) and merges cleanly.
  • One topic; the frame generation tag is a separate finding.
  • No game data, keys or decryption (check_no_game_data.py on the changed files).
  • A new translator rule is in the contract table of docs/design.md (n/a: no translator change).

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5599667751 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3037). Originally posted by [lucaspiro](https://github.com/lucaspiro) on 2026-12-02T04:10:30Z. --- Claimed in the coordination issue as: D3D12-DLSS-MV-JITTER-FOLLOWS-TITLE (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7334632023) ### What and why On the Series S profile with DLSS, every moving thing shook every frame: the characters of the pause menu's "Jason and Lucía" page, a car standing in the world, anything animated. Still things did not, and the picture stood still on the Series X profile with the title's own upscaler. The title makes its FidelityFX upscale context with flags `0x29`: high dynamic range, depth inverted and auto exposure, **without** `FFX_UPSCALE_ENABLE_MOTION_VECTORS_JITTER_CANCELLATION` (1<<2). Its motion vectors do not carry the camera's jitter. `dlss.rs` nevertheless made every DLSS feature with `NVSDK_NGX_DLSS_Feature_Flags_MVJittered`, so DLSS took a jitter out of vectors that never had it and moved every moving thing by it, a different way each frame. The jitter itself is right: an upscale probe (`LEONIDA_UPSCALE_PROBE=1`) shows the title's sequence within half a pixel, as it queries it, and `LEONIDA_DLSS_JITTER_SIGN=-1` changed nothing. This change: - `ffx.rs`: `create` keeps the title's context flags (before the DLL sees the description, so the stand-in sizes path keeps them too), and each upscale says whether its vectors carry the jitter (`vectors_jittered`). With no context seen it stays as before: they do. - `list.rs`: the bit travels in `Upscale` (word 10, bit 2, beside `reset` and `dlss`, so it survives `LEONIDA_THIN`'s words). The DLSS creation flags are built by a pure `dlss_feature_flags`, next to `dlss_mode`, so its test runs without the `dlss` feature. - `dlss.rs`: uses them; `LEONIDA_DLSS_MV_JITTERED=0|1` overrides, like `LEONIDA_DLSS_HDR` and `LEONIDA_DLSS_DEPTH_INVERTED`; the `DLSS: feature made` line now says `mv_jittered`. - `findings.md`: the new finding, and a correction: the probe's `flags 0x0` quoted as "no jitter cancellation" are the dispatch's flags; jitter cancellation is a context flag. - `switches.md`: regenerated for the new name (only its rows). Not covered: DLSS frame generation still tags the vectors as jittered (`fg.rs:959`, `motionVectorsJittered = eTrue`). Same question, a second consumer; not changed here and not measured, posted as a `finding:` (same comment as the claim). ### Tested - **In game** (Series S, DLSS Quality, 1280x720 → 1920x1080, frame generation 2x): with the flag off (`DLSS: feature made ... mv_jittered=false`) the shaking was gone on the pause menu's characters and in the world; with it on (main) it was back. The same runs log `upscale context render=[1280, 720] upscale=[1920, 1080] flags=0x29`. That was measured on a local build with the flag as a switch; this branch makes the same decision from the title's flags. - **Red/green:** the new tests (`ffx.rs` `the_vectors_jitter_follows_the_titles_context`, the strengthened `a_creation_description_at_an_odd_address_is_read_and_written`; `list.rs` `dlss_is_told_of_jittered_vectors_only_where_they_are`, `an_upscale_keeps_its_numbers_through_its_words`) fail with the old decision put back (always jittered) and pass with this change. On `main` they do not build (new field and functions). - `cargo test --workspace --exclude xtask --locked -- --skip depth_bounds_pipeline_loads_and_filters_draws` (CI's command): every suite that finished passed, among them leonida-gpu (658) and leonida-hle (249); leonida-shader's suite, which this change does not touch, was still running and was stopped. `cargo build --locked --profile diag -p leonida --features diagnostics,dlss,mimalloc` builds. - `python -I tools/d3d12_switches.py --check d3d12/docs/switches.md` and `tests/test_d3d12_switches.py` pass; `python -I scripts/check_no_game_data.py` on the changed files passes. GPUs tested: NVIDIA GeForce RTX 5070, driver 617.14, Windows 11 Pro 26200. AI-assisted: yes. Diagnosis and change with Claude Code (Claude Sonnet 5.5 and Claude Opus 5.5); independent read-only review by a separate Claude Opus 5.5 agent, whose findings (move the flags' test out of the `dlss` feature, test the create path with `0x29`, cite the source, correct `findings.md`) are addressed here. ### Checklist - [x] Based on current `main` (2172c15) and merges cleanly. - [x] One topic; the frame generation tag is a separate finding. - [x] No game data, keys or decryption (`check_no_game_data.py` on the changed files). - [ ] A new translator rule is in the contract table of `docs/design.md` (n/a: no translator change). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
lixonik commented 2026-12-02 06:59:18 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-02T06:59:18Z.


RUN

Independent verification of #3037 (a33a49cdf) merged cleanly onto main (f37c4a87d) on Windows 10 Pro 22H2 (build 19045), NVIDIA GeForce RTX 5070 12 GB (driver 621.40), MSVC toolchain (rust-toolchain.toml 1.98.1).

Offline checks

  • python -I scripts/check_no_game_data.py on all 5 changed files: PASS.
  • python -I tools/d3d12_switches.py --check d3d12/docs/switches.md: PASS.
  • cargo test -p leonida-hle --locked: 251 passed, 0 failed (including the_vectors_jitter_follows_the_titles_context and a_creation_description_at_an_odd_address_is_read_and_written).
  • cargo test -p leonida-gpu --locked --lib -- --skip depth_bounds_pipeline_loads_and_filters_draws: PASS (including list::tests::dlss_is_told_of_jittered_vectors_only_where_they_are and list::tests::an_upscale_keeps_its_numbers_through_its_words).
  • cargo build --locked --profile diag -p leonida --features diagnostics,dlss,mimalloc: PASS.

In-game verification (Series S, DLSS Quality, -NoFrameGen, warm cache, same save)

  1. Default (no LEONIDA_DLSS_MV_JITTERED override, LEONIDA_UPSCALE_PROBE=1):
    • Logged: upscale context render=[1280, 720] upscale=[1920, 1080] flags=0x29
    • Logged: DLSS: feature made input=(1280, 720) output=(1920, 1080) hdr=true depth_inverted=true auto_exposure=true mv_jittered=false quality=2 colour_format=10
    • Entered world cleanly (9 world samples, median 17.2 fps, 0.4 ms GPU wait, 0 errors, 0 device removals).
  2. Override (LEONIDA_DLSS_MV_JITTERED=1):
    • Logged the same flags=0x29 context and created DLSS with mv_jittered=true:
      DLSS: feature made input=(1280, 720) output=(1920, 1080) hdr=true depth_inverted=true auto_exposure=true mv_jittered=true quality=2 colour_format=10
    • Entered world cleanly (median 17.2 fps, 0 errors, 0 device removals).

Verdict: PASS.

AI-assisted: yes (Antigravity).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7337639707 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3037#issuecomment-7337639707). Originally posted by [lixonik](https://github.com/lixonik) on 2026-12-02T06:59:18Z. --- RUN Independent verification of `#3037` (`a33a49cdf`) merged cleanly onto `main` (`f37c4a87d`) on Windows 10 Pro 22H2 (build 19045), NVIDIA GeForce RTX 5070 12 GB (driver `621.40`), MSVC toolchain (`rust-toolchain.toml` `1.98.1`). ### Offline checks - `python -I scripts/check_no_game_data.py` on all 5 changed files: PASS. - `python -I tools/d3d12_switches.py --check d3d12/docs/switches.md`: PASS. - `cargo test -p leonida-hle --locked`: **251 passed, 0 failed** (including `the_vectors_jitter_follows_the_titles_context` and `a_creation_description_at_an_odd_address_is_read_and_written`). - `cargo test -p leonida-gpu --locked --lib -- --skip depth_bounds_pipeline_loads_and_filters_draws`: **PASS** (including `list::tests::dlss_is_told_of_jittered_vectors_only_where_they_are` and `list::tests::an_upscale_keeps_its_numbers_through_its_words`). - `cargo build --locked --profile diag -p leonida --features diagnostics,dlss,mimalloc`: PASS. ### In-game verification (Series S, DLSS Quality, `-NoFrameGen`, warm cache, same save) 1. **Default (no `LEONIDA_DLSS_MV_JITTERED` override, `LEONIDA_UPSCALE_PROBE=1`):** - Logged: `upscale context render=[1280, 720] upscale=[1920, 1080] flags=0x29` - Logged: `DLSS: feature made input=(1280, 720) output=(1920, 1080) hdr=true depth_inverted=true auto_exposure=true mv_jittered=false quality=2 colour_format=10` - Entered world cleanly (9 world samples, median `17.2 fps`, `0.4 ms` GPU wait, 0 errors, 0 device removals). 2. **Override (`LEONIDA_DLSS_MV_JITTERED=1`):** - Logged the same `flags=0x29` context and created DLSS with `mv_jittered=true`: `DLSS: feature made input=(1280, 720) output=(1920, 1080) hdr=true depth_inverted=true auto_exposure=true mv_jittered=true quality=2 colour_format=10` - Entered world cleanly (median `17.2 fps`, 0 errors, 0 device removals). **Verdict: PASS.** AI-assisted: yes (Antigravity).
MoonEyes commented 2026-12-02 12:19:35 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T12:19:35Z.


Closing: this pull request no longer applies to current main (merge conflict in d3d12/docs/switches.md), and open pull requests that have fallen out of step with main are being closed so the list stays workable. If you still want this change, rebase it on current main and reopen it (or open a new pull request); it will be looked at again.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7345171764 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3037#issuecomment-7345171764). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T12:19:35Z. --- Closing: this pull request no longer applies to current `main` (merge conflict in `d3d12/docs/switches.md`), and open pull requests that have fallen out of step with `main` are being closed so the list stays workable. If you still want this change, rebase it on current `main` and reopen it (or open a new pull request); it will be looked at again. AI-assisted (Claude Code).

Pull request closed

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!3037
No description provided.