d3d12: the DLSS build is asked for once NVIDIA's SDK is here, whatever the switches (D3D12-F1-DLSS-REBUILD) #2931

Merged
leonida/mandy
Mykolas009 merged 3 commits from d3d12/f1-dlss-rebuild into main 2026-12-02 01:14:41 +00:00

Pull request successfully merged and closed

Mykolas009 commented 2026-12-01 19:41:52 +00:00

Claimed in the coordination issue as: D3D12-F1-DLSS-REBUILD (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7322680830), from the finding https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7321028618

What and why

d3d12/scripts/play-nvidia.ps1 made the layer again with DLSS only when the start's own switches wanted DLSS ($wantDlss), and it decides that before it reads the F1 menu's saved settings. A DLSS choice the menu saved behind a replayed -Resolution (SAVE AND RESTART) therefore asked for no build: with a build noted as made without DLSS (built-with.txt without dlss) and NVIDIA's SDK installed afterwards, every such start fell back from DLSS. get-nvidia-sdks.ps1 ends with "The next start of scripts\play-nvidia.ps1 builds the layer with DLSS"; that held only for some switches. #2922 covers the handoff once the build has DLSS; this is the step before it.

The check now follows the SDK alone: a diag build noted as made without DLSS is made again when nvsdk_ngx_d.lib is here, unless -NoDlss. It stays the one check it was (no second one behind the menu).

Two things follow from asking more starts for that build, and are part of this change:

  • Without cargo such a start no longer stops with "No build and no cargo": it says DLSS waits for cargo and runs the build that is here. A start with no build at all still stops, as before.
  • A dry run, which builds nothing, says that a start builds first and prints the settings of the start after it. It printed the settings from before the build without a word.

The gate follows (second commit): scripts/game-gate.ps1 refuses to run without a build so that none is made inside a run. With the change above, a build noted as made without DLSS would be made again inside the run by starts that did not ask for it before (the gate's default Series X start among them), after the gate wrote down the exe's hash. The gate now refuses that run as well and names the build script; not with -NoDlss in -PlayArgs and not without cargo, when the play script makes no build. One sentence in docs/game_gate.md says so.

Tested

Windows 11 Pro (build 26300), Windows PowerShell 5.1, Python 3.14.3. No game files and no GPU involved.

  • python -I tests/test_play_nvidia_menu_choice.py: 16 pass with this change (on main ab374c7d5). The new test, test_the_dlss_build_is_asked_for_once_its_sdk_is_here_whatever_the_switches, is ten cases of launcher dry runs against a synthetic folder, with a stand-in cargo on a PATH filtered of any other so the PC's own does not decide, and one more run for a note whose exe is gone. On main's launcher six of the ten fail (the five that expect the build and the one without cargo); the four that describe behaviour this change leaves alone pass there.
  • A real start (not a dry run) against the same kind of folder, with a stand-in build-nvidia.ps1 that only writes the build's note: the launcher calls it, reads the note again and goes on with "Series S, DLSS"; with cargo off the PATH it says so and goes on with the build that is here. (By hand; the start then stops where it needs the real leonida.exe.)
  • tests/test_win_launchers.py and tests/test_leonida_launcher.py pass; tools/d3d12_switches.py --check is clean (no new switch); scripts/check_no_game_data.py on both files is clean.
  • The gate's guard, with PowerShell 7.7.0: its own lines against a synthetic folder in eleven cases (a build noted without DLSS, with the SDK and cargo: refused, also beside -NoDlss:$false or another switch; -NoDlss spelled out, shortened or with :$true, a build with DLSS, no SDK, no cargo, no note: let through), and the whole script twice: it refuses before anything starts (exit 1, no run folder), and with a build noted as made with DLSS it goes on as before (run.json carries built_with; the run ends at once with ERROR not_started, there being no game in the folder). tests/test_game_gate.py and the thirteen tests/test_docs_*.py pass.
  • Not tested: a real rebuild with NVIDIA's SDK through build-nvidia.ps1 (this PC does not have the SDK; the check calls the script exactly as before), and a gate run with the game.

GPUs tested: n/a (launcher logic). The PC: NVIDIA GeForce RTX 5060 8 GB, driver 610.88, Windows 11 Pro.

AI-assisted: yes. Written and tested with Claude Code (Claude Fable 5.2). The diff was audited by a separate read-only reviewer agent (Claude Fable 5.2), twice before opening and once more for the second commit; its first pass turned a second check behind the menu into this change of the one existing check, and the gate's guard is its second pass's point.

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.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (not applicable: no translator change)

🤖 Generated with Claude Code

Claimed in the coordination issue as: D3D12-F1-DLSS-REBUILD (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7322680830), from the finding https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7321028618 ### What and why `d3d12/scripts/play-nvidia.ps1` made the layer again with DLSS only when the start's own switches wanted DLSS (`$wantDlss`), and it decides that before it reads the F1 menu's saved settings. A DLSS choice the menu saved behind a replayed `-Resolution` (SAVE AND RESTART) therefore asked for no build: with a build noted as made without DLSS (`built-with.txt` without `dlss`) and NVIDIA's SDK installed afterwards, every such start fell back from DLSS. `get-nvidia-sdks.ps1` ends with "The next start of scripts\play-nvidia.ps1 builds the layer with DLSS"; that held only for some switches. #2922 covers the handoff once the build has DLSS; this is the step before it. The check now follows the SDK alone: a diag build noted as made without DLSS is made again when `nvsdk_ngx_d.lib` is here, unless `-NoDlss`. It stays the one check it was (no second one behind the menu). Two things follow from asking more starts for that build, and are part of this change: - Without cargo such a start no longer stops with "No build and no cargo": it says DLSS waits for cargo and runs the build that is here. A start with no build at all still stops, as before. - A dry run, which builds nothing, says that a start builds first and prints the settings of the start after it. It printed the settings from before the build without a word. The gate follows (second commit): `scripts/game-gate.ps1` refuses to run without a build so that none is made inside a run. With the change above, a build noted as made without DLSS would be made again inside the run by starts that did not ask for it before (the gate's default Series X start among them), after the gate wrote down the exe's hash. The gate now refuses that run as well and names the build script; not with `-NoDlss` in `-PlayArgs` and not without cargo, when the play script makes no build. One sentence in `docs/game_gate.md` says so. ### Tested Windows 11 Pro (build 26300), Windows PowerShell 5.1, Python 3.14.3. No game files and no GPU involved. - `python -I tests/test_play_nvidia_menu_choice.py`: 16 pass with this change (on `main` ab374c7d5). The new test, `test_the_dlss_build_is_asked_for_once_its_sdk_is_here_whatever_the_switches`, is ten cases of launcher dry runs against a synthetic folder, with a stand-in cargo on a PATH filtered of any other so the PC's own does not decide, and one more run for a note whose exe is gone. On `main`'s launcher six of the ten fail (the five that expect the build and the one without cargo); the four that describe behaviour this change leaves alone pass there. - A real start (not a dry run) against the same kind of folder, with a stand-in `build-nvidia.ps1` that only writes the build's note: the launcher calls it, reads the note again and goes on with "Series S, DLSS"; with cargo off the PATH it says so and goes on with the build that is here. (By hand; the start then stops where it needs the real `leonida.exe`.) - `tests/test_win_launchers.py` and `tests/test_leonida_launcher.py` pass; `tools/d3d12_switches.py --check` is clean (no new switch); `scripts/check_no_game_data.py` on both files is clean. - The gate's guard, with PowerShell 7.7.0: its own lines against a synthetic folder in eleven cases (a build noted without DLSS, with the SDK and cargo: refused, also beside `-NoDlss:$false` or another switch; `-NoDlss` spelled out, shortened or with `:$true`, a build with DLSS, no SDK, no cargo, no note: let through), and the whole script twice: it refuses before anything starts (exit 1, no run folder), and with a build noted as made with DLSS it goes on as before (`run.json` carries `built_with`; the run ends at once with ERROR `not_started`, there being no game in the folder). `tests/test_game_gate.py` and the thirteen `tests/test_docs_*.py` pass. - Not tested: a real rebuild with NVIDIA's SDK through `build-nvidia.ps1` (this PC does not have the SDK; the check calls the script exactly as before), and a gate run with the game. GPUs tested: n/a (launcher logic). The PC: NVIDIA GeForce RTX 5060 8 GB, driver 610.88, Windows 11 Pro. AI-assisted: yes. Written and tested with Claude Code (Claude Fable 5.2). The diff was audited by a separate read-only reviewer agent (Claude Fable 5.2), twice before opening and once more for the second commit; its first pass turned a second check behind the menu into this change of the one existing check, and the gate's guard is its second pass's point. ### 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. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (not applicable: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
KelboLive reviewed 2026-12-01 19:56:22 +00:00
KelboLive left a comment
No description provided.
Good fix: the rebuild is now keyed to the SDK lib alone (`play-nvidia.ps1:129-131`), with `-NoDlss` still the opt-out, and the no-SDK, `-NoDlss` and no-cargo paths fall back as before (the no-cargo case now continues with the existing build rather than stopping). The switch precedence is untouched — `$wantDlss` and the menu block at `:529-641` still decide runtime use, so a DLSS-capable binary does not mean DLSS runs. Red/green is solid: the new test fails **6/10** on `ab374c7d5` and the suite is **16/16** here, with the `-NoDlss` case failing when the `-not $NoDlss` conjunct is removed. Merge with current main (including #2922) is clean and green, and the launcher tests plus `switches.md` check pass. One thing before merge: `scripts/game-gate.ps1:125-136` records `exe_sha16`/`built_with` **before** launching, so this change can rebuild `leonida.exe` during a gate run and leave `run.json` describing the previous binary — the body already flags it. Either add the guard you mentioned or file it as a follow-up, but it should not be left implicit, since the gate is the thing we use to compare builds. Minor: the dry run reports the rebuild a real start would make, which is slightly optimistic if the build then fails — acceptable, just worth knowing.
merzleckeier commented 2026-12-01 20:00:42 +00:00

Measured launcher build and restart sequencing at 5586f9b0 on 99a29d10 with PowerShell 7.4.21 on Linux. I exercised the unmodified launcher outside -DryRun in 12 synthetic cases per tree. A stub build-nvidia.ps1 records its invocation and updates the build note, then a stub executable records the settings actually passed at launch.

  • Two saved-DLSS F1 restarts at -Resolution 720: main launched stretch twice without a build. The PR called the builder once before the first launch, then both launches selected dlss.
  • Typed -Resolution 720 still selected the own upscaler after the build. With no cargo and a usable existing executable, the PR printed its new warning and launched stretch. No SDK, -NoDlss, release build and already-featured build avoided unnecessary rebuilds. Missing runtime DLL still selected stretch after the stub build.
  • Combined with #2761 (8edf0c84), the actual Series X preset with explicit -MotionBlur:$false called the builder and launched at 2560×1440 with a 0.75 minimum scale and four motion-blur skips. Bare -MotionBlur preserved the same output/scale with zero skips.

The adapted stock menu suite ran 16 test methods per tree. Main failed six subtests in the new build-selection method, and the PR alone and combined passed all 16 methods. This checks launcher control flow and settings at synthetic boundaries. Real SDK compilation and the game gate were outside scope. AI-assisted (Codex).

Measured launcher build and restart sequencing at `5586f9b0` on `99a29d10` with PowerShell 7.4.21 on Linux. I exercised the unmodified launcher outside `-DryRun` in 12 synthetic cases per tree. A stub `build-nvidia.ps1` records its invocation and updates the build note, then a stub executable records the settings actually passed at launch. - Two saved-DLSS F1 restarts at `-Resolution 720`: main launched `stretch` twice without a build. The PR called the builder once before the first launch, then both launches selected `dlss`. - Typed `-Resolution 720` still selected the own upscaler after the build. With no cargo and a usable existing executable, the PR printed its new warning and launched `stretch`. No SDK, `-NoDlss`, release build and already-featured build avoided unnecessary rebuilds. Missing runtime DLL still selected `stretch` after the stub build. - Combined with #2761 (`8edf0c84`), the actual Series X preset with explicit `-MotionBlur:$false` called the builder and launched at 2560×1440 with a 0.75 minimum scale and four motion-blur skips. Bare `-MotionBlur` preserved the same output/scale with zero skips. The adapted stock menu suite ran 16 test methods per tree. Main failed six subtests in the new build-selection method, and the PR alone and combined passed all 16 methods. This checks launcher control flow and settings at synthetic boundaries. Real SDK compilation and the game gate were outside scope. AI-assisted (Codex).
Mykolas009 commented 2026-12-01 20:49:05 +00:00

Thanks for checking it. The guard is in now (218b0328b): scripts/game-gate.ps1 refuses a build noted as made without DLSS when NVIDIA's SDK is there (not with -NoDlss in -PlayArgs, not without cargo), with a sentence in docs/game_gate.md. Checked with PowerShell 7.7.0: eleven cases of the guard's own lines, and the whole script once refusing before anything starts and once going on. On the dry run: agreed, it shows the start that a build which succeeds leads to. AI-assisted (Claude Code).

Thanks for checking it. The guard is in now (218b0328b): `scripts/game-gate.ps1` refuses a build noted as made without DLSS when NVIDIA's SDK is there (not with `-NoDlss` in `-PlayArgs`, not without cargo), with a sentence in `docs/game_gate.md`. Checked with PowerShell 7.7.0: eleven cases of the guard's own lines, and the whole script once refusing before anything starts and once going on. On the dry run: agreed, it shows the start that a build which succeeds leads to. AI-assisted (Claude Code).
andrew-ai commented 2026-12-01 21:08:52 +00:00

The new gate check on 218b0328b rejects one valid spelling of the opt-out. With -PlayArgs '-NoDlss: $true' (space after the colon), PowerShell 7.6.9 binds the actual scripts/play-d3d12.ps1 switch to true, but the gate refuses the run and asks for a DLSS rebuild. Removing the space makes the same request pass. The guard at scripts/game-gate.ps1:65 looks for the colon immediately followed by the literal boolean.

I exercised the whole gate against a synthetic SDK marker, an existing diagnostics-only build stamp and cargo on PATH. A sentinel at the first process lookup stopped accepted cases before a run started. Separately, I ran the real play wrapper in dry-run mode with a stub inner launcher to record the forwarded switch. No game files were used.

PlayArgs NoDlss forwarded Gate on this head
empty false refused
-NoDlss, -NoD, or -NoDlss:$true true allowed
-NoDlss:$false or -NoDlss: $false false refused
-NoDlss: $true true refused

The preceding commit 5586f9b00 allowed all seven cases. All 16 tests in tests/test_play_nvidia_menu_choice.py passed on the current head. Please cover the spaced true and false forms in a gate regression test when adjusting the preflight. Coordination claim. AI-assisted with OpenAI Codex (GPT-6).

The new gate check on `218b0328b` rejects one valid spelling of the opt-out. With `-PlayArgs '-NoDlss: $true'` (space after the colon), PowerShell 7.6.9 binds the actual `scripts/play-d3d12.ps1` switch to true, but the gate refuses the run and asks for a DLSS rebuild. Removing the space makes the same request pass. The guard at `scripts/game-gate.ps1:65` looks for the colon immediately followed by the literal boolean. I exercised the whole gate against a synthetic SDK marker, an existing diagnostics-only build stamp and cargo on PATH. A sentinel at the first process lookup stopped accepted cases before a run started. Separately, I ran the real play wrapper in dry-run mode with a stub inner launcher to record the forwarded switch. No game files were used. | PlayArgs | NoDlss forwarded | Gate on this head | | --- | --- | --- | | empty | false | refused | | `-NoDlss`, `-NoD`, or `-NoDlss:$true` | true | allowed | | `-NoDlss:$false` or `-NoDlss: $false` | false | refused | | `-NoDlss: $true` | true | **refused** | The preceding commit `5586f9b00` allowed all seven cases. All 16 tests in `tests/test_play_nvidia_menu_choice.py` passed on the current head. Please cover the spaced true and false forms in a gate regression test when adjusting the preflight. [Coordination claim](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7325774390). AI-assisted with OpenAI Codex (GPT-6).
merzleckeier commented 2026-12-01 21:22:45 +00:00

The gate also treats a quoted adapter name as the DLSS opt-out. I reproduced this on 218b0328b merged into 1fff69129 with PowerShell 7.4.21 on Linux.

I ran the actual gate, generated launch.ps1, and both launcher scripts with a synthetic SDK marker, cargo on PATH and an existing diagnostics build. The gate refused -Adapter 'Fixture Adapter' as expected. With -Adapter 'Fixture -NoDlss Adapter', it wrote run.json, then the launcher invoked the builder. The result was the same with an actual -NoDlss:$false appended. Both cases repeated in fresh fixture directories.

In both accepted cases, run.json recorded e94908b2283560fd and diagnostics. The stub builder replaced the synthetic binary and updated the stamp to diagnostics,dlss. The process-start sentinel then saw e941749932f84722 and the full quoted string as the adapter name. Bare -NoDlss kept the original hash. The spaced-true opt-out exercises the converse mismatch.

The guard at scripts/game-gate.ps1:65 is matching the raw argument string. Please include a quoted argument containing -NoDlss in the gate regression test and make the preflight follow the switch that PowerShell binds.

Synthetic inputs only. The builder and final process start were replaced by test doubles. MEASURED, AI-assisted with OpenAI Codex and independent raw-log verification.

The gate also treats a quoted adapter name as the DLSS opt-out. I reproduced this on `218b0328b` merged into `1fff69129` with PowerShell 7.4.21 on Linux. I ran the actual gate, generated `launch.ps1`, and both launcher scripts with a synthetic SDK marker, cargo on PATH and an existing `diagnostics` build. The gate refused `-Adapter 'Fixture Adapter'` as expected. With `-Adapter 'Fixture -NoDlss Adapter'`, it wrote `run.json`, then the launcher invoked the builder. The result was the same with an actual `-NoDlss:$false` appended. Both cases repeated in fresh fixture directories. In both accepted cases, `run.json` recorded `e94908b2283560fd` and `diagnostics`. The stub builder replaced the synthetic binary and updated the stamp to `diagnostics,dlss`. The process-start sentinel then saw `e941749932f84722` and the full quoted string as the adapter name. Bare `-NoDlss` kept the original hash. The [spaced-true opt-out](https://github.com/ProjectLeonida/mandy/pull/2931#issuecomment-7325816476) exercises the converse mismatch. The guard at `scripts/game-gate.ps1:65` is matching the raw argument string. Please include a quoted argument containing `-NoDlss` in the gate regression test and make the preflight follow the switch that PowerShell binds. Synthetic inputs only. The builder and final process start were replaced by test doubles. MEASURED, AI-assisted with OpenAI Codex and independent raw-log verification.
merzleckeier commented 2026-12-01 22:13:10 +00:00

The revised preflight fixes the quoted-adapter and spaced-true cases in the full gate.

I reran the actual gate, generated launch.ps1, and both launcher scripts on 9fc7de03e3397516f12217e38c93db47c05bf8fc integrated onto main c4ca5761508f136c5530482093bb3053b0bad4fa, using PowerShell 7.4.21 on Linux. The fixture supplied an SDK marker, cargo, and an existing diagnostics build.

  • The gate refused -Adapter 'Fixture -NoDlss Adapter' both alone and with -NoDlss:$false. It also refused spaced false, a normal adapter name without the switch, and the empty case. All six refusals happened before run.json was written.
  • The six true opt-out cases reached the process-start sentinel. They included -NoDlss: $true, a case-insensitive abbreviation, Series S with spaced true, and the quoted adapter plus a real true switch. All six recorded the same executable hash and feature stamp that the attempted launch used.

The main control reached the sentinel in all 12 cases. None of the 24 cases invoked the stub builder. The stock gate test file passed 24/24 on main and 26/26 on the PR. This covers the selected literal argument forms, with synthetic inputs and a test double at the final process start.

AI-assisted local testing, independently checked against the raw data.

The revised preflight fixes the quoted-adapter and spaced-true cases in the full gate. I reran the actual gate, generated `launch.ps1`, and both launcher scripts on `9fc7de03e3397516f12217e38c93db47c05bf8fc` integrated onto main `c4ca5761508f136c5530482093bb3053b0bad4fa`, using PowerShell 7.4.21 on Linux. The fixture supplied an SDK marker, cargo, and an existing `diagnostics` build. - The gate refused `-Adapter 'Fixture -NoDlss Adapter'` both alone and with `-NoDlss:$false`. It also refused spaced false, a normal adapter name without the switch, and the empty case. All six refusals happened before `run.json` was written. - The six true opt-out cases reached the process-start sentinel. They included `-NoDlss: $true`, a case-insensitive abbreviation, Series S with spaced true, and the quoted adapter plus a real true switch. All six recorded the same executable hash and feature stamp that the attempted launch used. The main control reached the sentinel in all 12 cases. None of the 24 cases invoked the stub builder. The stock gate test file passed 24/24 on main and 26/26 on the PR. This covers the selected literal argument forms, with synthetic inputs and a test double at the final process start. AI-assisted local testing, independently checked against the raw data.
Sign in to join this conversation.
No description provided.