fix(ffx): normalize unsupported Series S render sizes before context creation #3022

Merged
maestroBR merged 1 commit from upstream-pr/3022 into main 2026-12-03 16:24:40 +00:00
maestroBR commented 2026-12-02 00:13:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by maestroBR on 2026-12-02T00:13:44Z.


Coordination: #2570. A claim has not yet been posted; update this line with the claim link before submission.

What and why

Fix context creation for intercepted FFX dispatch when a Series S profile requests a 960x540 render allocation with 1920x1080 output.

The previous normalization checked only the output dimensions. Because 1080p output already matched the shipped configuration, an unsupported render allocation reached the console FSR DLL unchanged. Context creation was rejected; the existing failure path can subsequently produce a zero jitter-phase count and an integer divide-by-zero after loading.

Normalize valid-looking descriptions when either the output or the render allocation is unsupported. Preserve both accepted render allocations (1280x720 tight and 1920x1080 legacy), invalid-input passthrough, and restoration of the caller's original description after context creation. The existing interception remains limited to stretch/DLSS dispatch; native FSR rendering is unchanged.

Regression assertions cover 960x540 and 1152x648 render allocations at 1080p output, plus the accepted legacy allocation. Only d3d12/crates/leonida-hle/src/modules/ffx.rs is included.

Tested

  • Red/green: the updated 960x540 assertion failed with the previous predicate, then passed with this change.
  • All five targeted FFX unit tests passed, including descriptor layout, unaligned accesses and restoration behavior.
  • Full leonida-hle library suite passed: 245 passed, 0 failed, 2 benchmark tests ignored.
  • Independent read-only review found no issues and independently reran the five FFX tests successfully.
  • Native NVIDIA diagnostic runtime and Americas adapter release build passed through the launcher's actual source junction.
  • Adapter dry run, git diff --check, and the no-game-data checker passed. The checker used an explicit installed Python interpreter because the default python command is a Microsoft Store alias.

Targeted command, from d3d12/ with the MSVC environment and NVIDIA SDK configured:

cargo test --locked --profile diag -p leonida-hle --lib modules::ffx::tests --features diagnostics,leonida-gpu/dlss,mimalloc -- --test-threads=1

The full library suite used the same command without the modules::ffx::tests filter.

GPUs tested: n/a for automated validation. The reported failure was observed locally on Windows with an NVIDIA RTX 5060 Ti 8 GB. Post-fix gameplay, frame rate and long-session stability have not been verified; this PR makes no performance guarantee.

AI-assisted: yes. Implementation and validation assisted by Codex (exact serving model identifier unavailable); independent read-only review by chatgpt/gpt-6.1-sol.

Checklist

  • GitHub comparison against upstream main reports Able to merge; one changed file, 12 additions and 5 deletions.
  • Local validation used checkout 2705632c56 with the identical final ffx.rs blob 3cc0e689f8.
  • One topic: FFX context allocation validation and its regression assertions.
  • No game data, keys, decryption code, crash dumps or raw game logs included.
  • Independent read-only review completed.
  • Translator contract update not applicable; no translator rule changed.
  • Coordination claim linked above before submission.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5597100510 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3022). Originally posted by [maestroBR](https://github.com/maestroBR) on 2026-12-02T00:13:44Z. --- Coordination: #2570. A claim has not yet been posted; update this line with the claim link before submission. ### What and why Fix context creation for intercepted FFX dispatch when a Series S profile requests a 960x540 render allocation with 1920x1080 output. The previous normalization checked only the output dimensions. Because 1080p output already matched the shipped configuration, an unsupported render allocation reached the console FSR DLL unchanged. Context creation was rejected; the existing failure path can subsequently produce a zero jitter-phase count and an integer divide-by-zero after loading. Normalize valid-looking descriptions when either the output or the render allocation is unsupported. Preserve both accepted render allocations (1280x720 tight and 1920x1080 legacy), invalid-input passthrough, and restoration of the caller's original description after context creation. The existing interception remains limited to stretch/DLSS dispatch; native FSR rendering is unchanged. Regression assertions cover 960x540 and 1152x648 render allocations at 1080p output, plus the accepted legacy allocation. Only d3d12/crates/leonida-hle/src/modules/ffx.rs is included. ### Tested - Red/green: the updated 960x540 assertion failed with the previous predicate, then passed with this change. - All five targeted FFX unit tests passed, including descriptor layout, unaligned accesses and restoration behavior. - Full leonida-hle library suite passed: 245 passed, 0 failed, 2 benchmark tests ignored. - Independent read-only review found no issues and independently reran the five FFX tests successfully. - Native NVIDIA diagnostic runtime and Americas adapter release build passed through the launcher's actual source junction. - Adapter dry run, git diff --check, and the no-game-data checker passed. The checker used an explicit installed Python interpreter because the default python command is a Microsoft Store alias. Targeted command, from d3d12/ with the MSVC environment and NVIDIA SDK configured: cargo test --locked --profile diag -p leonida-hle --lib modules::ffx::tests --features diagnostics,leonida-gpu/dlss,mimalloc -- --test-threads=1 The full library suite used the same command without the modules::ffx::tests filter. GPUs tested: n/a for automated validation. The reported failure was observed locally on Windows with an NVIDIA RTX 5060 Ti 8 GB. Post-fix gameplay, frame rate and long-session stability have not been verified; this PR makes no performance guarantee. AI-assisted: yes. Implementation and validation assisted by Codex (exact serving model identifier unavailable); independent read-only review by chatgpt/gpt-6.1-sol. ### Checklist - [x] GitHub comparison against upstream main reports Able to merge; one changed file, 12 additions and 5 deletions. - [x] Local validation used checkout 2705632c561ad9e176fcc05234b66d841aa66aa9 with the identical final ffx.rs blob 3cc0e689f8c375b6dfd5bf9400361c81570dcc65. - [x] One topic: FFX context allocation validation and its regression assertions. - [x] No game data, keys, decryption code, crash dumps or raw game logs included. - [x] Independent read-only review completed. - [x] Translator contract update not applicable; no translator rule changed. - [ ] Coordination claim linked above before submission.
andrew-ai commented 2026-12-02 00:15:28 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by andrew-ai on 2026-12-02T00:15:28Z.


Checked the 640x360 case mentioned in #3013 in addition to the two sizes in the regression test. I compiled sizes_to_stand_in and SHIPPED unchanged from the parent and 755833d88 on Windows. At 1920x1080 output, the parent passed through 640x360, 960x540 and 1152x648. The PR substitutes 1280x720 for all three. Both revisions leave the accepted 1280x720 and 1920x1080 allocations alone, as well as a zero-width control. This verifies the context size selection only. I did not run a scene or reproduce the reported crash. Codex-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7330330263 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3022#issuecomment-7330330263). Originally posted by [andrew-ai](https://github.com/andrew-ai) on 2026-12-02T00:15:28Z. --- Checked the 640x360 case mentioned in #3013 in addition to the two sizes in the regression test. I compiled sizes_to_stand_in and SHIPPED unchanged from the parent and 755833d88 on Windows. At 1920x1080 output, the parent passed through 640x360, 960x540 and 1152x648. The PR substitutes 1280x720 for all three. Both revisions leave the accepted 1280x720 and 1920x1080 allocations alone, as well as a zero-width control. This verifies the context size selection only. I did not run a scene or reproduce the reported crash. Codex-assisted.
limittox commented 2026-12-02 04:36:15 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by limittox on 2026-12-02T04:36:15Z.


Tested #3022 in game on an RTX 3060 Ti 8 GB: the crash is fixed, but the 3D scene is black at render scale 0.5

Applied 755833d88 on top of main 002bd88f8 (cherry-picked, nothing else changed), target\diag built with DLSS (diagnostics,dlss,mimalloc).

System: NVIDIA GeForce RTX 3060 Ti 8 GB, driver 610.88, Resizable BAR off, Intel Core i5-12600K, 32 GB RAM, Windows 11 Pro 26300.

scripts\play-d3d12.ps1 -Game <package> -SeriesS -Dlss performance -Log -More @{LEONIDA_FPS_CAP='30'; LEONIDA_TEXTURE_BUDGET_MB='3000'; LEONIDA_WINDOWS_BAR_MB='0'}

Scripted route from a save in the opening boat scene, about 6 minutes a run. Frame time is the median over in-world frame lines.

Setting Runs Crash Upscale context Picture Median frame
-Dlss performance (0.5) 3 none stood in: made_for=([1280, 720], [1920, 1080]) 3D scene black, HUD and subtitles draw 49.2 / 46.3 / 44.2 ms
-Dlss quality 2 none as asked, 1280x720 normal 45.3 / 45.0 ms
-NoDlss + LEONIDA_RENDER_SCALE=0.5 (stretch) 1 none stood in 3D scene black 43.7 ms

Before this PR, the same -Dlss performance start crashed every time on this PC with 0xc0000094 at title+0x28f03e8: 2 of 2 stock starts at f9f3ec4, plus 3 more with my own patch attempts (side note below). With it, none of the 3 runs crashed.

The black scene shows with DLSS and with the plain stretch alike, so it doesn't look DLSS-specific. DLSS logs feature made input=(960, 540) output=(1920, 1080), and the upscale dispatches carry colour_size=(960, 540), so the dispatch itself looks right. My guess is that the colour rendered at 960x540 is already black before the upscale, but I haven't checked that. DLSS quality on the same build is fine.

Side note from before this PR: noting the FidelityFX quality mode at +0x28ef69a and dropping the "FSR maximum = scaled size" patch both left the crash in place. That fits the context sizes being the cause, which is what this PR changes.

GPUs tested: NVIDIA GeForce RTX 3060 Ti 8 GB, driver 610.88, Windows 11 Pro 26300.

AI-assisted: the tests were run and this comment was written with Claude Opus 5.5 (Anthropic), and reviewed by me before posting.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7335074552 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3022#issuecomment-7335074552). Originally posted by [limittox](https://github.com/limittox) on 2026-12-02T04:36:15Z. --- **Tested #3022 in game on an RTX 3060 Ti 8 GB: the crash is fixed, but the 3D scene is black at render scale 0.5** Applied 755833d88 on top of `main` 002bd88f8 (cherry-picked, nothing else changed), `target\diag` built with DLSS (`diagnostics,dlss,mimalloc`). System: NVIDIA GeForce RTX 3060 Ti 8 GB, driver 610.88, Resizable BAR off, Intel Core i5-12600K, 32 GB RAM, Windows 11 Pro 26300. ```powershell scripts\play-d3d12.ps1 -Game <package> -SeriesS -Dlss performance -Log -More @{LEONIDA_FPS_CAP='30'; LEONIDA_TEXTURE_BUDGET_MB='3000'; LEONIDA_WINDOWS_BAR_MB='0'} ``` Scripted route from a save in the opening boat scene, about 6 minutes a run. Frame time is the median over in-world frame lines. | Setting | Runs | Crash | Upscale context | Picture | Median frame | |---|---|---|---|---|---| | `-Dlss performance` (0.5) | 3 | none | stood in: `made_for=([1280, 720], [1920, 1080])` | **3D scene black**, HUD and subtitles draw | 49.2 / 46.3 / 44.2 ms | | `-Dlss quality` | 2 | none | as asked, 1280x720 | normal | 45.3 / 45.0 ms | | `-NoDlss` + `LEONIDA_RENDER_SCALE=0.5` (stretch) | 1 | none | stood in | **3D scene black** | 43.7 ms | Before this PR, the same `-Dlss performance` start crashed every time on this PC with 0xc0000094 at title+0x28f03e8: 2 of 2 stock starts at f9f3ec4, plus 3 more with my own patch attempts (side note below). With it, none of the 3 runs crashed. The black scene shows with DLSS and with the plain stretch alike, so it doesn't look DLSS-specific. DLSS logs `feature made input=(960, 540) output=(1920, 1080)`, and the upscale dispatches carry `colour_size=(960, 540)`, so the dispatch itself looks right. My guess is that the colour rendered at 960x540 is already black before the upscale, but I haven't checked that. DLSS quality on the same build is fine. Side note from before this PR: noting the FidelityFX quality mode at +0x28ef69a and dropping the "FSR maximum = scaled size" patch both left the crash in place. That fits the context sizes being the cause, which is what this PR changes. GPUs tested: NVIDIA GeForce RTX 3060 Ti 8 GB, driver 610.88, Windows 11 Pro 26300. AI-assisted: the tests were run and this comment was written with Claude Opus 5.5 (Anthropic), and reviewed by me before posting.
MoonEyes commented 2026-12-02 12:37:01 +00:00 (Migrated from github.com)

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


This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).

Could you, or anyone with a working setup, post a run report on the current head merged onto current main:

  • the head SHA and the main SHA it was merged onto;
  • GPU, driver and OS;
  • at least 300 s in the world after loading;
  • device lost / crashes (count), and rendered fps (median) if you have them;
  • the same run on main alone for comparison, if you can.

Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7345605916 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3022#issuecomment-7345605916). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T12:37:01Z. --- This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists). Could you, or anyone with a working setup, post a run report on the **current head** merged onto current `main`: - the head SHA and the `main` SHA it was merged onto; - GPU, driver and OS; - at least 300 s in the world after loading; - device lost / crashes (count), and rendered fps (median) if you have them; - the same run on `main` alone for comparison, if you can. Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough. AI-assisted (Claude Code).
limittox commented 2026-12-02 18:06:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by limittox on 2026-12-02T18:06:56Z.


Run report for 755833d88 merged onto main: render scale 0.5 no longer crashes and the 3D scene draws (4 of 4 runs); main alone crashed in 3 of 3

  • Head 755833d883, merged with git merge onto main acc3507455 (no conflicts, nothing else changed). For comparison, main alone at the same acc3507455.

  • main has moved since (45dc41f95 when I posted this). None of the commits after acc3507455 touch ffx.rs or leonida-loader. They do change:

    • leonida-gpu (fg.rs, host.rs) and one shader-optimizer file;
    • the launchers: scripts/play-d3d12.ps1 now precompiles every recorded pipeline by default, and play-nvidia.ps1 has new default settings;
    • Python tools, tests and docs.

    The head still merges cleanly onto 45dc41f95 (git merge-tree), but I didn't rerun on it.

  • Both builds are target\diag (diagnostics,dlss,mimalloc).

  • System: NVIDIA GeForce RTX 3060 Ti 8 GB, driver 610.88, Resizable BAR off, Intel Core i5-12600K, 32 GB RAM, Windows 11 Pro 26300.

I used the launcher's default settings. The only extras are LEONIDA_KEYS and LEONIDA_KEYS_FILE, which drive my scripted route:

scripts\play-d3d12.ps1 -Game <package> -SeriesS -Log -Dlss performance   # or -Dlss quality
scripts\play-d3d12.ps1 -Game <package> -SeriesS -Log -NoDlss -More @{LEONIDA_UPSCALE='stretch'; LEONIDA_RENDER_SCALE='0.5'}

Each run loads one save in the opening boat scene and goes through three stretches, about 11 minutes in the world in all:

  1. It takes a few steps in the first two minutes.
  2. Over the next 3 minutes it takes 17 screenshots, one every 10 s, with no input.
  3. It then stands still for 5 more minutes.

The two builds took turns over 10 runs.

  • "In the world" runs from the first to the last frame line with more than 1,000 draws a frame.
  • fps is the median of the 5-second frame lines. It is computed twice: over all in-world lines, and over the 5 minutes standing.
Setting Build Runs Crashes Device lost In the world Median fps, in world Median fps, standing
-Dlss performance (0.5) main 2 2 0 0 s – –
PR 2 0 0 645, 649 s 24.7, 25.0 25.2, 25.2
stretch, LEONIDA_RENDER_SCALE=0.5 main 1 1 0 0 s – –
PR 1 0 0 649 s 25.3 25.7
-Dlss quality main 2 0 0 649, 644 s 24.5, 23.8 24.8, 24.0
PR 2 0 0 649, 644 s 24.6, 24.5 24.8, 24.8
  • The main crashes. All three are an unhandled 0xc0000094 at title+0x28f03e8, the same address as in my earlier report. Each came about 46 s after the runtime started, right after the title's first upscale dispatch. That is while loading, before the first world frame.
  • Faults. No device removals, panics or other faults in any PR run.
  • The upscale context. With the PR, both 0.5 settings log that the context was made for a supported size instead: render=[960, 540] upscale=[1920, 1080] made_for=([1280, 720], [1920, 1080]) flags=0x29 result=0. DLSS performance logs feature made input=(960, 540) output=(1920, 1080). -Dlss quality makes its context as asked, at 1280x720, on both builds.
  • The picture. In each run that reached the world, I took 17 screenshots after the steps. They stay local and aren't attached.
    • Every PR run averages 116 to 120 brightness out of 255, at 0.5 and at quality alike. The darkest shot in each run is 49 to 70.
    • Measured the same way, the black runs in my earlier report averaged 3 to 7, with 14 to 16 of their 17 shots at 0 or 1.
    • I also looked at one screenshot from a PR run at 0.5 with DLSS: the 3D scene draws normally.
  • -Dlss quality. This PR shouldn't change that path, and the PR and main stay within run-to-run spread: standing medians 24.8 and 24.8 fps against 24.8 and 24.0.

Why the scene is no longer black. This updates my earlier report. In that report, this PR on main 002bd88f8 left the 3D scene black at 0.5. On acc3507455 the scene draws.

To rule out my settings: the earlier runs added LEONIDA_FPS_CAP=30, LEONIDA_TEXTURE_BUDGET_MB=3000 and LEONIDA_WINDOWS_BAR_MB=0, and the runs above don't. I did one extra PR run on acc3507455 with -Dlss performance and those three settings, and it also drew normally:

  • brightness 117 on average (darkest shot 67);
  • no crash or faults;
  • 649 s in the world, median 24.8 fps.

So the settings don't explain the earlier black scene; the newer main does.

60 pull requests were merged between 002bd88f8 and acc3507455. Two of them change the render-scale patches in leonida-loader, and none touch ffx.rs:

  • #2756 turned the FidelityFX maximum-size patch off by default (591bd23a7). Its commit message describes the same symptom on Series X: the HUD over a black world at render scales below 1.0.
  • #2900 changed the Series S memory budgets. Its patch applies only above render scale 2/3, so it shouldn't matter at 0.5.

The logs fit #2756:

  • My earlier black runs logged hook applied what="render scale: FSR maximum = scaled size" (5 resolution levers applied).
  • These runs don't log it (4 levers).

So #2756 is the most likely fix. I haven't bisected it, though.

Not counted:

  • One start right after building. The first-run shader and pipeline precompile (about 8 minutes) threw off my scripted route.
  • One 6-minute warm-up with -Dlss quality. It didn't crash.

AI-assisted: Claude Opus 5.5 (Anthropic) scripted the runs and wrote this report while I was away. Two separate read-only reviewer agents rechecked the numbers against the raw logs and the wording against the project's rules. I haven't reviewed it myself yet.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7353959285 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3022#issuecomment-7353959285). Originally posted by [limittox](https://github.com/limittox) on 2026-12-02T18:06:56Z. --- **Run report for 755833d88 merged onto `main`: render scale 0.5 no longer crashes and the 3D scene draws (4 of 4 runs); `main` alone crashed in 3 of 3** - Head 755833d883dbe625278a7ba0d43cc9147a6e9d0e, merged with `git merge` onto `main` acc3507455ab10a38e5a49a2c4678a276fbcf31d (no conflicts, nothing else changed). For comparison, `main` alone at the same acc3507455. - `main` has moved since (45dc41f95 when I posted this). None of the commits after acc3507455 touch `ffx.rs` or `leonida-loader`. They do change: - `leonida-gpu` (`fg.rs`, `host.rs`) and one shader-optimizer file; - the launchers: `scripts/play-d3d12.ps1` now precompiles every recorded pipeline by default, and `play-nvidia.ps1` has new default settings; - Python tools, tests and docs. The head still merges cleanly onto 45dc41f95 (`git merge-tree`), but I didn't rerun on it. - Both builds are `target\diag` (`diagnostics,dlss,mimalloc`). - System: NVIDIA GeForce RTX 3060 Ti 8 GB, driver 610.88, Resizable BAR off, Intel Core i5-12600K, 32 GB RAM, Windows 11 Pro 26300. I used the launcher's default settings. The only extras are `LEONIDA_KEYS` and `LEONIDA_KEYS_FILE`, which drive my scripted route: ```powershell scripts\play-d3d12.ps1 -Game <package> -SeriesS -Log -Dlss performance # or -Dlss quality scripts\play-d3d12.ps1 -Game <package> -SeriesS -Log -NoDlss -More @{LEONIDA_UPSCALE='stretch'; LEONIDA_RENDER_SCALE='0.5'} ``` Each run loads one save in the opening boat scene and goes through three stretches, about 11 minutes in the world in all: 1. It takes a few steps in the first two minutes. 2. Over the next 3 minutes it takes 17 screenshots, one every 10 s, with no input. 3. It then stands still for 5 more minutes. The two builds took turns over 10 runs. - "In the world" runs from the first to the last frame line with more than 1,000 draws a frame. - fps is the median of the 5-second frame lines. It is computed twice: over all in-world lines, and over the 5 minutes standing. | Setting | Build | Runs | Crashes | Device lost | In the world | Median fps, in world | Median fps, standing | |---|---|---|---|---|---|---|---| | `-Dlss performance` (0.5) | `main` | 2 | **2** | 0 | 0 s | – | – | | | PR | 2 | 0 | 0 | 645, 649 s | 24.7, 25.0 | 25.2, 25.2 | | stretch, `LEONIDA_RENDER_SCALE=0.5` | `main` | 1 | **1** | 0 | 0 s | – | – | | | PR | 1 | 0 | 0 | 649 s | 25.3 | 25.7 | | `-Dlss quality` | `main` | 2 | 0 | 0 | 649, 644 s | 24.5, 23.8 | 24.8, 24.0 | | | PR | 2 | 0 | 0 | 649, 644 s | 24.6, 24.5 | 24.8, 24.8 | - **The `main` crashes.** All three are an unhandled 0xc0000094 at title+0x28f03e8, the same address as in my earlier report. Each came about 46 s after the runtime started, right after the title's first upscale dispatch. That is while loading, before the first world frame. - **Faults.** No device removals, panics or other faults in any PR run. - **The upscale context.** With the PR, both 0.5 settings log that the context was made for a supported size instead: `render=[960, 540] upscale=[1920, 1080] made_for=([1280, 720], [1920, 1080]) flags=0x29 result=0`. DLSS performance logs `feature made input=(960, 540) output=(1920, 1080)`. `-Dlss quality` makes its context as asked, at 1280x720, on both builds. - **The picture.** In each run that reached the world, I took 17 screenshots after the steps. They stay local and aren't attached. - Every PR run averages 116 to 120 brightness out of 255, at 0.5 and at quality alike. The darkest shot in each run is 49 to 70. - Measured the same way, the black runs in my earlier report averaged 3 to 7, with 14 to 16 of their 17 shots at 0 or 1. - I also looked at one screenshot from a PR run at 0.5 with DLSS: the 3D scene draws normally. - **`-Dlss quality`.** This PR shouldn't change that path, and the PR and `main` stay within run-to-run spread: standing medians 24.8 and 24.8 fps against 24.8 and 24.0. **Why the scene is no longer black.** This updates my [earlier report](https://github.com/ProjectLeonida/mandy/pull/3022#issuecomment-7335074552). In that report, this PR on `main` 002bd88f8 left the 3D scene black at 0.5. On acc3507455 the scene draws. To rule out my settings: the earlier runs added `LEONIDA_FPS_CAP=30`, `LEONIDA_TEXTURE_BUDGET_MB=3000` and `LEONIDA_WINDOWS_BAR_MB=0`, and the runs above don't. I did one extra PR run on acc3507455 with `-Dlss performance` and those three settings, and it also drew normally: - brightness 117 on average (darkest shot 67); - no crash or faults; - 649 s in the world, median 24.8 fps. So the settings don't explain the earlier black scene; the newer `main` does. 60 pull requests were merged between 002bd88f8 and acc3507455. Two of them change the render-scale patches in `leonida-loader`, and none touch `ffx.rs`: - #2756 turned the FidelityFX maximum-size patch off by default (591bd23a7). Its commit message describes the same symptom on Series X: the HUD over a black world at render scales below 1.0. - #2900 changed the Series S memory budgets. Its patch applies only above render scale 2/3, so it shouldn't matter at 0.5. The logs fit #2756: - My earlier black runs logged `hook applied what="render scale: FSR maximum = scaled size"` (5 resolution levers applied). - These runs don't log it (4 levers). So #2756 is the most likely fix. I haven't bisected it, though. Not counted: - One start right after building. The first-run shader and pipeline precompile (about 8 minutes) threw off my scripted route. - One 6-minute warm-up with `-Dlss quality`. It didn't crash. AI-assisted: Claude Opus 5.5 (Anthropic) scripted the runs and wrote this report while I was away. Two separate read-only reviewer agents rechecked the numbers against the raw logs and the wording against the project's rules. I haven't reviewed it myself yet.
MoonEyes commented 2026-12-02 18:12:09 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:12:09Z.


Reviewed #3022 (code review only, not built here: Windows-only). The change stops the 0xC0000094 crash, but the only in-game run reports a black 3D scene at render scale 0.5 with it, and that has not been answered.

Head 755833d883 (unchanged since 1 December)
Merge with main 45dc41f95c clean (git merge-tree); merge base 913b88b905, 313 commits behind
Changed d3d12/crates/leonida-hle/src/modules/ffx.rs
Switches registry on the merge python -I tools/d3d12_switches.py --check d3d12/docs/switches.md: exit 0

Review

  • sizes_to_stand_in (ffx.rs:241-246 on the head) now stands in the shipped 1280x720 -> 1920x1080 pair whenever the render size is neither 1280x720 nor 1920x1080, even when the output is already 1920x1080. That turns Series S 960x540 -> 1920x1080 (and 1152x648) from "context refused, title divides by zero" into "context made for other sizes". The unit test pins exactly that.
  • What the description and doc comment do not establish is that a context made for 1280x720 is harmless when the title renders 960x540. The doc comment says only the context's queries (jitter sequence) are used, but the jitter phase count FSR derives from the render/output ratio differs between 1.5x and 2x. A wrong phase count or jitter scale is a plausible cause of a broken picture.
  • limittox (RTX 3060 Ti, 2 December 04:36) measured exactly that kind of failure: crash gone in 3 of 3 runs, but 3D scene black with -Dlss performance and with the plain stretch at LEONIDA_RENDER_SCALE=0.5. -Dlss quality (1280x720, no stand-in) was normal. The black scene shows only where the stand-in is used, so this PR is the first suspect until shown otherwise.
  • MoonEyes' in-game gate request (2 December 12:37) has no run posted.

Verdict: defects. Before merging: explain or fix the black scene at 0.5 (for example, check that the jitter the title gets from the stand-in context matches what it gets for its own sizes), and post the in-game run. A crash that becomes a black screen is not yet a fix for Series S users.

AI-assisted: Claude Opus 5.5 (Claude Code), review only.

AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.


Generated by Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7354112643 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3022#issuecomment-7354112643). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T18:12:09Z. --- **Reviewed #3022 (code review only, not built here: Windows-only). The change stops the 0xC0000094 crash, but the only in-game run reports a black 3D scene at render scale 0.5 with it, and that has not been answered.** | | | |---|---| | Head | `755833d883` (unchanged since 1 December) | | Merge with `main` `45dc41f95c` | clean (`git merge-tree`); merge base `913b88b905`, 313 commits behind | | Changed | `d3d12/crates/leonida-hle/src/modules/ffx.rs` | | Switches registry on the merge | `python -I tools/d3d12_switches.py --check d3d12/docs/switches.md`: exit 0 | **Review** - `sizes_to_stand_in` (`ffx.rs:241-246` on the head) now stands in the shipped `1280x720 -> 1920x1080` pair whenever the render size is neither `1280x720` nor `1920x1080`, even when the output is already `1920x1080`. That turns Series S `960x540 -> 1920x1080` (and `1152x648`) from "context refused, title divides by zero" into "context made for other sizes". The unit test pins exactly that. - What the description and doc comment do not establish is that a context made for `1280x720` is harmless when the title renders `960x540`. The doc comment says only the context's queries (jitter sequence) are used, but the jitter phase count FSR derives from the render/output ratio differs between 1.5x and 2x. A wrong phase count or jitter scale is a plausible cause of a broken picture. - limittox (RTX 3060 Ti, 2 December 04:36) measured exactly that kind of failure: crash gone in 3 of 3 runs, but **3D scene black** with `-Dlss performance` and with the plain stretch at `LEONIDA_RENDER_SCALE=0.5`. `-Dlss quality` (1280x720, no stand-in) was normal. The black scene shows only where the stand-in is used, so this PR is the first suspect until shown otherwise. - MoonEyes' in-game gate request (2 December 12:37) has no run posted. **Verdict: defects.** Before merging: explain or fix the black scene at 0.5 (for example, check that the jitter the title gets from the stand-in context matches what it gets for its own sizes), and post the in-game run. A crash that becomes a black screen is not yet a fix for Series S users. AI-assisted: Claude Opus 5.5 (Claude Code), review only. AI-assisted verification: Claude Opus (Claude Code), separate agent per batch. --- _Generated by [Claude Code](https://claude.ai/code)_
fiestorra commented 2026-12-02 22:19:04 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T22:19:04Z.


VERIFY-3022 — Windows nativo: red then green, y el caso que cambia la lógica está en las aserciones que el PR actualiza

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

Ran

cargo test -p leonida-hle --lib ffx     5 passed; 0 failed
  modules::ffx::tests::a_context_of_other_sizes_is_made_with_the_shipped_ones ... ok

Negative control (synthetic): I put the exact old condition back ((size(render) && size(upscale) && upscale != SHIPPED.1).then_some(SHIPPED)) and rebuilt:

FAILED: a_context_of_other_sizes_is_made_with_the_shipped_ones      assertion `left == right` failed

The updated test bites on the logic the PR changes, not just on its own existence.

What the change is: the stand-in context now accepts a render size equal to the shipped output (render == SHIPPED.1) as well as the shipped render size, and rejects the case where only the output matches (upscale != SHIPPED.1 || !accepted_render). The comment says why: "Series S at 960x540 to 1920x1080 has the same failure: a shipped output size alone does not make its smaller render allocation valid" — 960x540 → 1920x1080 now gets the shipped pair, and 1920x1080 → 1920x1080 gets none.

What I could not test: the failure it fixes is a 0xC0000094 inside the title's own FFX context; the tests drive sizes_to_stand_in with sizes, and no title was run. A test-only change to a guard: red then green here, nothing more.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7360525752 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3022#issuecomment-7360525752). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T22:19:04Z. --- ## VERIFY-3022 — Windows nativo: `red then green`, y el caso que cambia la lógica está en las aserciones que el PR actualiza | | | |---|---| | Head | `(this PR)` | | Merge base | behind `main` `b41763227` | | Merged onto | `main` — `merge-tree` clean, `git merge --no-ff` clean | **Ran** ``` cargo test -p leonida-hle --lib ffx 5 passed; 0 failed modules::ffx::tests::a_context_of_other_sizes_is_made_with_the_shipped_ones ... ok ``` **Negative control (synthetic)**: I put **the exact old condition** back (`(size(render) && size(upscale) && upscale != SHIPPED.1).then_some(SHIPPED)`) and rebuilt: ``` FAILED: a_context_of_other_sizes_is_made_with_the_shipped_ones assertion `left == right` failed ``` **The updated test bites on the logic the PR changes**, not just on its own existence. **What the change is**: the stand-in context now accepts a **render size equal to the shipped output** (`render == SHIPPED.1`) as well as the shipped render size, and **rejects the case where only the output matches** (`upscale != SHIPPED.1 || !accepted_render`). The comment says why: *"Series S at 960x540 to 1920x1080 has the same failure: a shipped output size alone does not make its smaller render allocation valid"* — 960x540 → 1920x1080 now gets the shipped pair, and 1920x1080 → 1920x1080 gets none. **What I could not test**: the failure it fixes is a `0xC0000094` inside the title's own FFX context; the tests drive `sizes_to_stand_in` with sizes, and no title was run. **A test-only change to a guard: `red then green` here, nothing more.** Written with an AI assistant.
limittox commented 2026-12-02 23:23:58 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by limittox on 2026-12-02T23:23:58Z.


On the review: my run report (posted just before your review) covers the black scene, and at 0.5 the jitter repeats every 32 upscales (the 2x period), not every 18 (the stand-in's 1.5x)

The black scene. My run report went up five minutes before the review:

  • With this PR merged onto main acc3507455, render scale 0.5 drew the 3D scene in 4 of 4 runs, with no crash. One of the four used my earlier settings (FPS cap, texture budget, no BAR windows). main alone crashed in 3 of 3.
  • The earlier black scene most likely came from the FidelityFX maximum-size patch, which #2756 turned off by default. My black runs logged render scale: FSR maximum = scaled size; the new runs don't. I haven't bisected it.

The jitter. To check your concern, I logged what the title passes to each upscale with LEONIDA_UPSCALE_PROBE=1. The probe logs the first 12 upscales, then one in every 300.

  • Build: the same as in the report, head 755833d88 merged onto acc3507455.
  • System: RTX 3060 Ti 8 GB, driver 610.88, Windows 11 Pro 26300.
  • One run per setting, about 7.9 minutes in the world each.
Setting Render → output Context made for Upscales logged with jitter Distinct jitter values, one upscale in 300 Periods that fit every pair
-Dlss performance 960x540 → 1920x1080 1280x720 → 1920x1080 (the stand-in) 45 8 32 only
-Dlss quality 1280x720 → 1920x1080 as asked 45 3 18 only

"Periods that fit" lists each P from 2 to 128 for which any two upscales logged with jitter have the same jitter exactly when their upscale numbers are equal modulo P. The first 3 upscales, before the title's first reset, carry no jitter and are left out. FSR's phase count is 8 × (output / render)²: 32 at 2x and 18 at 1.5x.

  • If the stand-in's sizes had reached the title's phase-count query, the 0.5 run would repeat every 18, like the quality run. It repeats every 32.
  • With 300-upscale steps, a 32-phase sequence shows 8 values and an 18-phase one shows 3, which is what the two runs show.
  • Both runs log the same first 12 values. Only the length of the cycle differs.
  • The size of the jitter is the same in both runs. It is in render pixels, the unit FSR's dispatch takes, and stays within ±0.5 of a render pixel on each axis (largest 0.4902). At every phase both runs reach, the values are identical.

This fits the doc comment: the phase-count query names its own render and output widths, so the sizes the context was made for don't enter it.

Neither run had a crash, device removal, panic or other fault. The 0.5 run drew normally: 17 screenshots average 124 brightness out of 255. They stay local and aren't attached.

What this doesn't check: picture quality beyond "draws normally", or how DLSS uses the jitter. That code path is the same at quality, where no stand-in is involved.

AI-assisted: Claude Opus 5.5 (Claude Code) scripted the runs, wrote the period check and this reply. A separate read-only reviewer agent rechecked it against the raw logs.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7361944002 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3022#issuecomment-7361944002). Originally posted by [limittox](https://github.com/limittox) on 2026-12-02T23:23:58Z. --- **On the review: my run report (posted just before your review) covers the black scene, and at 0.5 the jitter repeats every 32 upscales (the 2x period), not every 18 (the stand-in's 1.5x)** **The black scene.** My [run report](https://github.com/ProjectLeonida/mandy/pull/3022#issuecomment-7353959285) went up five minutes before the review: - With this PR merged onto `main` acc3507455, render scale 0.5 drew the 3D scene in 4 of 4 runs, with no crash. One of the four used my earlier settings (FPS cap, texture budget, no BAR windows). `main` alone crashed in 3 of 3. - The earlier black scene most likely came from the FidelityFX maximum-size patch, which #2756 turned off by default. My black runs logged `render scale: FSR maximum = scaled size`; the new runs don't. I haven't bisected it. **The jitter.** To check your concern, I logged what the title passes to each upscale with `LEONIDA_UPSCALE_PROBE=1`. The probe logs the first 12 upscales, then one in every 300. - Build: the same as in the report, head 755833d88 merged onto acc3507455. - System: RTX 3060 Ti 8 GB, driver 610.88, Windows 11 Pro 26300. - One run per setting, about 7.9 minutes in the world each. | Setting | Render → output | Context made for | Upscales logged with jitter | Distinct jitter values, one upscale in 300 | Periods that fit every pair | |---|---|---|---|---|---| | `-Dlss performance` | 960x540 → 1920x1080 | 1280x720 → 1920x1080 (the stand-in) | 45 | 8 | 32 only | | `-Dlss quality` | 1280x720 → 1920x1080 | as asked | 45 | 3 | 18 only | "Periods that fit" lists each P from 2 to 128 for which any two upscales logged with jitter have the same jitter exactly when their upscale numbers are equal modulo P. The first 3 upscales, before the title's first reset, carry no jitter and are left out. FSR's phase count is 8 × (output / render)²: 32 at 2x and 18 at 1.5x. - If the stand-in's sizes had reached the title's phase-count query, the 0.5 run would repeat every 18, like the quality run. It repeats every 32. - With 300-upscale steps, a 32-phase sequence shows 8 values and an 18-phase one shows 3, which is what the two runs show. - Both runs log the same first 12 values. Only the length of the cycle differs. - The size of the jitter is the same in both runs. It is in render pixels, the unit FSR's dispatch takes, and stays within ±0.5 of a render pixel on each axis (largest 0.4902). At every phase both runs reach, the values are identical. This fits the doc comment: the phase-count query names its own render and output widths, so the sizes the context was made for don't enter it. Neither run had a crash, device removal, panic or other fault. The 0.5 run drew normally: 17 screenshots average 124 brightness out of 255. They stay local and aren't attached. What this doesn't check: picture quality beyond "draws normally", or how DLSS uses the jitter. That code path is the same at quality, where no stand-in is involved. AI-assisted: Claude Opus 5.5 (Claude Code) scripted the runs, wrote the period check and this reply. A separate read-only reviewer agent rechecked it against the raw logs.
MoonEyes commented 2026-12-03 09:37:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T09:37:50Z.


RUN (in game, before and after, RTX 4060 8 GB, driver 610.88, Windows 11). Series S, -Dlss performance (960x540 to 1920x1080) without the DLSS files, so the title's own FidelityFX upscaler path, frame generation 2x, LEONIDA_FG_LIMIT_FPS=30, -PrecompileUsed, the same walking route, 330 s.

main d9b618f10 alone main d9b618f10 + this head 755833d88 (git merge --no-ff)
Upscale context made for render 960x540, upscale 1920x1080, as asked made_for=([1280, 720], [1920, 1080]), result=0; the title's sizes put back
Integer divide by zero (0xC0000094) in the title image yes, right after the first upscale dispatch, about 2 s into the world none
Process alive at the end no yes, stopped by the time limit
Device lost / device removed 0 0
Rendered fps, last 240 s n/a median 19.1, mean 19.4 (48 samples)
Rendered fps, last 120 s n/a median 18.4
Time under 5 fps in the world n/a 0 %

The crash without this change is the one several players report as code 3221225620 with -SeriesS -Dlss performance; this reproduces it and shows it gone with this head.

Verdict: PASS for the in-game gate on this head, and the crash it targets is reproduced on main and absent with it.

Limits: one run each way. The DLSS files were absent, so the DLSS path itself was not exercised (the setting fell back to the title's upscaler, which is the path this change is about). Pictures were not checked for the upscale's quality. 1152x648 (the other size the change covers) was not tried. If this pull request changes its head, this run no longer covers it.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7373970737 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3022#issuecomment-7373970737). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-03T09:37:50Z. --- RUN (in game, before and after, RTX 4060 8 GB, driver 610.88, Windows 11). Series S, `-Dlss performance` (960x540 to 1920x1080) without the DLSS files, so the title's own FidelityFX upscaler path, frame generation 2x, `LEONIDA_FG_LIMIT_FPS=30`, `-PrecompileUsed`, the same walking route, 330 s. | | main `d9b618f10` alone | main `d9b618f10` + this head `755833d88` (`git merge --no-ff`) | |---|---|---| | Upscale context | made for render 960x540, upscale 1920x1080, as asked | `made_for=([1280, 720], [1920, 1080])`, `result=0`; the title's sizes put back | | Integer divide by zero (`0xC0000094`) in the title image | yes, right after the first upscale dispatch, about 2 s into the world | none | | Process alive at the end | no | yes, stopped by the time limit | | Device lost / device removed | 0 | 0 | | Rendered fps, last 240 s | n/a | median 19.1, mean 19.4 (48 samples) | | Rendered fps, last 120 s | n/a | median 18.4 | | Time under 5 fps in the world | n/a | 0 % | The crash without this change is the one several players report as code 3221225620 with `-SeriesS -Dlss performance`; this reproduces it and shows it gone with this head. Verdict: PASS for the in-game gate on this head, and the crash it targets is reproduced on `main` and absent with it. Limits: one run each way. The DLSS files were absent, so the DLSS path itself was not exercised (the setting fell back to the title's upscaler, which is the path this change is about). Pictures were not checked for the upscale's quality. 1152x648 (the other size the change covers) was not tried. If this pull request changes its head, this run no longer covers it. AI-assisted (Claude Code).
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!3022
No description provided.