124 Commits

Author SHA1 Message Date
96765c480f launcher, play-nvidia: a new card is no player change; -CardMask survives SAVE AND RESTART; cache tests per platform; Advanced cache dir
merzleckeier's review of 4b64ba9e4:
- Two Clear shader cache tests expected Windows' cache-2 while calling the
  platform default, so they failed on Linux (CI's linux-python-and-viewer).
  They pass windows=True now (clear_shader_cache takes `windows`).
- After an NVIDIA PLAY, choosing the AMD card made -Chosen name Adapter, Dlss,
  FrameGen, NoDlss and SmoothMotion: -Chosen compared for_card's output with
  last_switches, so the card filter looked like the player's edits and the
  F1 merge dropped the saved DLSS, frame generation and Smooth Motion. Now
  -Chosen compares the player's own switches (switch_args of the saved
  settings, -Log for a diagnostic start) and last_switches keeps those too
  (launch_snapshot, still taken with the queued command); the card's part
  goes as -CardMask only.
- play-nvidia.ps1's LEONIDA_MENU_ARGS (the F1 menu's SAVE AND RESTART)
  carries -CardMask, so a masked LEONIDA_FRAME_GEN=2 stays masked on the
  restarted start.
- Clear shader cache clears a LEONIDA_CACHE_DIR typed in the Advanced
  options, the cache PLAY uses on both systems, instead of the default.

Tests: test_a_new_card_is_no_change_of_the_players (NVIDIA PLAY then AMD:
-Chosen is Adapter only, -CardMask the three); the snapshot test now expects
the player's switches; test_an_advanced_cache_dir_is_the_one_cleared;
test_win_launchers runs the generated restart command (-CardMask in it,
LEONIDA_FRAME_GEN masked, the upscale the stretch). Launcher suite 139 OK on
Windows and 139 OK (2 skipped) under Linux (WSL Ubuntu, Python 3.12), where
the old tests fail on the two cache tests as in CI; test_win_launchers 12 OK.
Counter-tests: the old snapshot/chosen and no Advanced lookup fail 3 of 3;
no -CardMask in the restart arguments fails the restart case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 04:33:10 +01:00
c8baf9b741 Merge fork/feat/launcher-fgrt-follows-play (FidelityFX fetch, per-card install, FSR 3) into the review fixes
Conflicts: docs/launcher.md keeps the card-mask text with FSR 3's name;
tests/test_leonida_launcher.py keeps both sides' new classes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 04:17:38 +01:00
f1e9718e95 launcher, play scripts: review fixes of #3272 (card mask kept out of the F1 file, -Adapter for auto FG, Linux cache and binds, clear-cache race, unreadable binds kept)
merzleckeier's reviews at 02:35, 02:47 and 02:58 and DeadlyChirp's 02:46 note:
1. The AMD/Intel card filter named NoDlss, NoFrameGen and SmoothMotion in
   -Chosen, so a real PLAY rewrote leonida-settings.txt without the F1
   menu's DLSS, DLSS frame generation and Smooth Motion. The launcher now
   passes -CardMask (card_mask) instead; play-d3d12.ps1 hands it over and
   play-nvidia.ps1 leaves those settings out of this start only, keeping
   them in the menu file (and says so); the menu's FSR stays.
2. play-nvidia.ps1's automatic DLSS frame generation looked at every card:
   with -Adapter it now judges the cards whose name holds it (all when none
   does), so an AMD card chosen beside an RTX 4070 gets none; the card
   mask's NoFrameGen also keeps it off.
3. Clear shader cache on Linux looked under the Windows data folder: it now
   uses play-linux.sh's LEONIDA_CACHE_DIR or ${XDG_DATA_HOME:-~/.local/share}
   /leonida/cache.
4. After the confirmation, clear_cache asks game_running() again, not only
   its own process.
5. Linux PLAY passes the extra variables (the Controls page's binds, the
   advanced options, Advanced winning) in play-linux.sh's environment
   (`env NAME=value sh play-linux.sh ...`); none were passed before.
6. The Controls page keeps entries it cannot read beside its rows
   (split_kbm_binds) and writes them back after them: adding a row no longer
   drops a saved list with an unknown entry. Its note called t() with a
   `text=` value, which crashed the page as soon as it showed one: the
   placeholder is {entries} now, in de/es/fr/pt too.

Tests: test_card_mask_leaves_the_menus_nvidia_values_out_and_in_the_file
(dry runs, a real start with Start-Process stubbed keeping the menu file,
AMD + RTX 4070 with -Adapter each way and with the mask); card_mask and
-CardMask in play_command; LinuxPlayTests; SplitBindsTests with a guard
that no t() call passes text=. Launcher suite OK (1 skip), win launchers
12 OK, docs links, line endings, check_no_game_data. Counter-tests: the
mask ignored, the adapter filter off, the Linux env/cache, split and
card_mask reverted each fail their tests; the guard regex matches the old
source. Real window (isolated APPDATA): the game started during the
confirmation leaves the cache and says close the game first; adding H to
`both:G=Square;vehicle:N=FutureAction` saves G, H and the unknown entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 04:15:54 +01:00
14b3748832 Merge remote-tracking branch 'fork/feat/launcher-fgrt-follows-play' into feat/launcher-fgrt-follows-play 2026-12-03 04:03:50 +01:00
78a810cea0 launcher: PLAY fetches the files the card needs (DLSS or AMD's FSR 3 DLLs); Tools fetches AMD FidelityFX; "FSR 3"
- d3d12/scripts/get-amd-fidelityfx.ps1 (and Get-AMD-FidelityFX.cmd): AMD's
  two signed DLLs FSR 3 frame generation needs, amd_fidelityfx_loader_dx12.dll
  (39 184 bytes) and amd_fidelityfx_framegeneration_dx12.dll (29 679 376), from
  FidelityFX SDK v2.4.0's Kits/FidelityFX/signedbin on AMD's GitHub (the SDK
  whose structure versions fsr.rs speaks: frame generation 4.0.2, its DX12
  swap chain 4.0.0) into amd-sdk\FidelityFX\bin, the folder play-nvidia.ps1
  reads. Each is kept only with its pinned size and git blob hash and a valid
  Authenticode signature of Advanced Micro Devices, both or neither; AMD's
  licence (docs/license.md) is saved beside them. amd-sdk/ is git-ignored.
- Tools > Fetch AMD FidelityFX files, with a confirmation naming the size.
- needed_files(card): the DLSS fetch on an NVIDIA RTX card without NVIDIA's
  files, the FidelityFX fetch on a card DLSS frame generation does not run on
  (not an RTX 40 or 50, play-nvidia.ps1's own test) without AMD's DLLs; none
  for an unread card or off Windows, none once the files are there. With the
  new setting "Download the files my card needs" (on by default, Picture),
  PLAY runs those fetches first in the Output panel, then the game, also when
  one failed (the script starts without DLSS or FSR 3 then). Stop during a
  fetch ends the start. card_facts now names the judged cards.
- Frame generation's mode reads "FSR 3"; with it chosen and AMD's DLLs
  missing, a note says PLAY downloads them first, or where Tools does.

New texts in de/es/fr/pt; docs/launcher.md says it.

Tests: NeededFilesTests (every card kind with nothing there, nothing once
the files are, a half set fetched again, no card or off Windows, the RTX
40/50 test and the folder are the script's, the note, the setting, the
fetcher's pins and signature check and that its two names and fsr.rs's
versions agree; a real run of the fetcher on files that are not AMD's keeps
nothing, and an unpinned tag is refused). 130 OK, test_win_launchers OK.
Counter-tests: needed_files and the note doing nothing fail 3 of 3; the
fetcher without its checks keeps the fake DLLs and fails. Real window (AMD
card stubbed): "FSR 3" fits, the note shows, the Tools button; PLAY with
stubbed commands runs the fetch then the game after a failed fetch, and
only the game with the setting off. No real download was made.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 04:03:48 +01:00
7809f10bf7 play-nvidia, launcher: a VRAM size is an integer or exactly eight bytes; one bad adapter skips only itself
Review of beb149402 (merzleckeier, ecox982745):
- Parity on malformed values: the launcher's card_memory took byte arrays
  of 1 to 8 bytes, the script's decode took 8 or more and cast strings, so
  a 5-byte, 9-byte or string value greyed frame generation on one side and
  not the other. Both now read only an integer (REG_QWORD/REG_DWORD) or
  exactly eight little-endian bytes; anything else is no size.
- A terminating error reading one adapter (Get-ItemProperty, now with
  -ErrorAction Stop inside the per-adapter try) and an error while listing
  the class (-ErrorAction SilentlyContinue, a foreach over what was listed)
  no longer stop the walk before a later adapter's size.

Tests: test_nvidia_frame_generation_with_ray_tracing gains seven cases
(5-byte, 9-byte and string values; an 8 GB integer followed by a 5-byte or
9-byte 24 GB value; an adapter whose read throws before an 8 GB one; a
listing that reports an error before an 8 GB adapter); card_memory's test
gains the 5-byte and 9-byte arrays. tests/test_win_launchers.py 11 OK and
tests/test_leonida_launcher.py OK in Windows PowerShell 5.1; on the
previous script the new cases fail (9-byte and string values, 8 GB + 9-byte
24 GB, the throwing adapter and the listing error).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 03:20:45 +01:00
beb1494023 play-nvidia: an eight-byte qwMemorySize is decoded, not cast (D3D12-VRAM-BYTES)
$vram, the largest HardwareInformation.qwMemorySize of the display class,
cast the value straight to [uint64]. Some drivers write it as eight
little-endian bytes (REG_BINARY); the cast then threw inside the walk's one
try, so the walk stopped there. With the Series X 20 GB rule for frame
generation with ray tracing, an 8 GB card written as bytes kept 2x, and an
integer 8 GB followed by a 24 GB card in bytes left it off, while the
launcher's card_facts (which decodes the bytes) said the opposite
(merzleckeier's review on #3272).

The value is now decoded with [BitConverter]::ToUInt64 when it is a byte
array of eight or more bytes, and each adapter has its own try, so an odd
value skips that adapter only.

Tests: test_nvidia_frame_generation_with_ray_tracing's registry stub takes
several adapters, each an integer or a byte array; four new cases (8 GB and
24 GB as bytes, integer 8 GB + 24 GB bytes, and the reverse order). All 11
tests of tests/test_win_launchers.py pass in Windows PowerShell 5.1; on the
unpatched script the new cases fail exactly as reported (8 GB bytes keeps 2x,
8 GB int + 24 GB bytes leaves it off).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 03:08:05 +01:00
36f5ddbd73 Merge remote-tracking branch 'origin/main' into feat/fg-with-rt
# Conflicts:
#	tests/test_win_launchers.py
2026-12-03 01:14:59 +01:00
092a069579 d3d12 play-nvidia: no automatic frame generation with ray tracing (software or hardware)
The automatic 2x of RTX 40/50 cards (with -Resolution or -Lowest, the Series X default) came along with
-HardwareRT once ray tracing stopped removing frame generation. Turning ray tracing on must not turn frame
generation on: with ray tracing it runs only when asked for (-FrameGen, the F1 menu, LEONIDA_FRAME_GEN). The
dry-run test gains three automatic cases (hardware RT, software RT, none); it fails without the condition.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 01:08:21 +01:00
4f344387b3 d3d12 play-nvidia: frame generation with ray tracing on Series X from 20 GB of video memory, not 12
A player's RTX 5080 (16 GB), Series X, hardware RT, DLSS quality, frame generation 2x with LEONIDA_FG_WITH_RT=1,
7 minutes: frames generated, then about 5 minutes in the process passed the card's budget (13.0 of 12.95 GB, up to
14.2), Streamline reported eWarnOutOfVRAM and frames over 100 ms went from 8-15 to 46-53 a minute. A 3090 reached
18.6 GB on the same profile. 20 GB is just above: 16 GB cards keep it on Series S, and on Series X with
LEONIDA_FG_WITH_RT=1. The dry-run test gains a 24 GB case; 16 GB on Series X is now off (fails at 12 GB).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 00:52:50 +01:00
3e5887f651 play-nvidia: SAVE AND RESTART keeps the start's -More values
The F1 menu's SAVE AND RESTART starts play-nvidia.ps1 again with LEONIDA_MENU_ARGS, which listed the switches but
not -More. The launcher's frame limit, advanced options and crash tracing, and a LEONIDA_FG_WITH_RT=1 given by hand,
were gone after the restart (with ray tracing on, frame generation was then turned off again).

The table now goes into LEONIDA_MENU_ARGS as a PowerShell literal (the menu runs it with -Command), every quote
doubled. On that restart a value the menu saved for the same setting wins over the replayed -More, since it was
chosen after it; a normal start keeps -More over the menu as before.

Test: tests/test_win_launchers.py test_nvidia_menu_restart_replays_more (dry run, then the replayed command);
it fails without either change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 23:13:29 +01:00
97eefdee4a d3d12 play-nvidia: say the 12 GB threshold is a guess (review of #3230)
The comment now gives the RTX 3090 24 GB run (frames generated on both profiles, at most 14.4 GB used on
Series X), says 12 GB sits between the 8 GB card that ran out and the 16 GB one that did not, with 10-12 GB
cards untested, and quotes this head's own 300 s run without -More. Comment only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 22:31:03 +01:00
eafa1af149 d3d12 play-nvidia: frame generation with ray tracing, except Series X under 12 GB (D3D12-FG-WITH-RT)
Frame generation (DLSS's, FSR 3's and the automatic 2x on RTX 40/50) was left off whenever ray tracing was on
("0.1 frames a second", a measure of the software walk from before this renderer). It now runs with ray tracing,
software or hardware, except on the Series X profile with under 12 GB of video memory, where it is left off with
a message; unknown video memory does not block. When kept, LEONIDA_FG_WITH_RT=1 is set so the runtime's own guard
(fg.rs) starts it; -More LEONIDA_FG_WITH_RT='1' forces it everywhere, '0' keeps it off.

Measured on an RTX 4070 Laptop 8 GB, main 45dc41f95, 2026-12-02, 240 s walks, one run each:
- Series S, -HardwareRT -FrameGen 2: 21 rendered / 43 shown fps once warm, frames generated, no device lost.
- Series S, -RayTracing -FrameGen 2: 10-11 rendered / 21 shown.
- Series X, -HardwareRT -Dlss quality -FrameGen 2: 5 fps, no generated frame, Streamline eWarnOutOfVRAM.
- A player's 16 GB card, Series X, same switches: no out-of-memory warning, frames generated part of the time.

DryRun checked (settings against origin/main): runs without ray tracing are identical; Series S with RT and
-FrameGen 2 gains LEONIDA_FRAME_GEN=2 and LEONIDA_FG_WITH_RT=1; Series X with RT on this 8 GB card leaves it off
with the message; video memory forced to 16, 12 and 0 GB keeps it, 11 GB leaves it off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 22:01:57 +01:00
917cb9e323 Report failures through the Series X 2160p preset 2026-12-02 14:23:02 -05:00
7fcf8f6b5b Preserve Windows D3D12 runtime exit status
Keep native status in both log modes and report explicit heights above the console output as failures. Verify both launch entry points with a synthetic Windows executable.
2026-12-02 14:13:40 -05:00
45dc41f95c Merge pull request #3172 from ProjectLeonida/codex/full-precompile-default
Default to full D3D12 shader and pipeline precompilation
2026-12-02 16:55:29 +00:00
0413012fac Explain host memory use during full pipeline warm-up 2026-12-02 11:31:59 -05:00
e71aa0ef15 Default to full D3D12 shader and pipeline precompilation 2026-12-02 11:17:09 -05:00
c155111b77 Merge remote-tracking branch 'origin/main' into feat/fg-limit-follows-rate 2026-12-02 16:09:32 +01:00
83046a713f Merge pull request #3076 from OreoFR/feat/submit-sender-on
d3d12 launcher: prepared lists sent by a thread of their own (D3D12-SUBMIT-SENDER-ON)
2026-12-02 14:48:57 +00:00
bebdd4cbfb d3d12 launcher: prepared lists sent by a thread of their own (D3D12-SUBMIT-SENDER-ON)
LEONIDA_SUBMIT_SENDER=1 is in main, off by default, and no measurement of it
was on record. With it, the lists of a prepared submission go to the queue
from a thread of their own (host.rs, send_late, sender, after foxhound
662ed95), and the submitting thread, the frame's wall, prepares the next
submission meanwhile.

Measured on 2026-12-02: RTX 4070 Laptop, Core Ultra 7 155H, Series S,
walking after the lift, main 229d352ee, in turns of 8 s, two runs of 37
and 38 pairs.
- The frame's median: -0.79 +-1.81 and -1.96 +-1.27 ms (of 34 to 36).
- The submitting thread: -1.27 +-1.29 and -2.47 +-0.89.
- The card idle: -1.28 +-0.77 and -1.85 +-1.84.
- No panic and no device lost.

The launcher turns it on. -More @{LEONIDA_SUBMIT_SENDER='0'} turns it off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 10:25:40 +01:00
2ce2bafe3c d3d12 launcher: renderer port #7 (the write watch's journal in parts) on (D3D12-PORT-JOURNAL-ON)
LEONIDA_PORT_JOURNAL=1 is in main, off by default. It notes the write
watch's journal in parts with locks of their own, so the threads that read
it stop waiting for those that note in it. The 2026-11-27 measurement that
left it off was made on a six-core PC standing in Series X, with 22
phases, before ports 1 to 6.

Measured again on 2026-12-02: RTX 4070 Laptop, Core Ultra 7 155H,
Series S, walking after the lift, main 229d352ee, in turns of 8 s, two
runs of 38 pairs. The frame's median was -1.43 +-1.96 and -1.38 +-1.29 ms
(of 37 to 38); the submitting thread was -1.29 +-1.65 and -0.79 +-1.03.

The launcher turns it on, as it does port #6. -More
@{LEONIDA_PORT_JOURNAL='0'} turns it off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 09:04:52 +01:00
69d30852c3 d3d12 fg: the followed limit is the default whenever frames are generated
OreoFR: it has to be the default when frame generation is on. Until now
only the launcher's automatic generation got a limit; -FrameGen and the
F1 menu ran with none. LEONIDA_FG_LIMIT_FPS unset now means the followed
limit, the same as auto. A number still fixes the frames shown a second,
and 0 removes the limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 08:39:37 +01:00
94e8e5b91d d3d12 fg: the frame limit follows the rendered rate (D3D12-FG-LIMIT-FOLLOWS-RATE)
The launcher fixed LEONIDA_FG_LIMIT_FPS=28 with frame generation. It was
measured where the title rendered 14 to 15 frames a second (Series X, 1080
lines, RTX 4060 Ti). Wherever the title renders more, it held the shown
frames at 28: Series S on an RTX 4070 Laptop renders about 25 a second.

LEONIDA_FG_LIMIT_FPS=auto (fg.rs, Follow): every window of 2 s and 20
rendered frames, the limit is set a little under the median rendered
interval (x 1.06). While frames all come at the limit, it is tried 5 %
faster after 3 such windows; if frames then come later, it goes back and
waits 10 windows. Moves under 3 % are left out, and rendered frames stay
between 10 and 60 a second. Reflex gets it in shown frames (rendered x
(1 + generated)). A number keeps the fixed limit, as before.

The launcher's default becomes auto. Five unit tests cover the rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 08:37:00 +01:00
daf7242f2e Merge remote-tracking branch 'origin/main' into carry/hwrt-2972
# Conflicts:
#	d3d12/scripts/play-nvidia.ps1
#	scripts/play-d3d12.ps1
2026-12-02 06:57:33 +01:00
0ae5a2664b Merge pull request #2986 from TheStonedGamer/precompile-all
d3d12: opt-in precompile of every known pipeline (-PrecompileAll); never-drawn pipelines stay out of the library
2026-12-02 05:13:18 +00:00
4b67b07045 Merge pull request #2931 from Mykolas009/d3d12/f1-dlss-rebuild
d3d12: the DLSS build is asked for once NVIDIA's SDK is here, whatever the switches (D3D12-F1-DLSS-REBUILD)
2026-12-02 00:48:23 +00:00
535308fe48 Merge pull request #2761 from merzleckeier/fix/1080-1440p-motion-blur-switch
d3d12: preserve explicit MotionBlur values in the 1080p–1440p preset
2026-12-02 00:47:52 +00:00
32f0fe3ad9 leonida warm: only pipelines drawn with go into the pipeline library
With -PrecompileAll every known pipeline is made (some 88,000 against 4,000
drawn with). Those never drawn with now stay in the driver's cache alone and
are kept out of the pipeline library: the driver checks an entry of its own
cache against the pipeline asked for and compiles again where they differ,
while a library entry is taken as it was stored.

With them in the library (1.5 GB, 91,525 entries) the device was removed
twice during a burst of first loads in a new place (RTX 3060, driver 621.40):
no hang, no page fault, the library file whole. With them kept out, a run of
the same settings stayed up. The cause inside the driver is not known.

The rule is into_library(), with a unit test that fails without it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 17:30:37 -05:00
c6f253705d Launcher: option to precompile every known pipeline (-PrecompileAll)
The precompile makes only the pipelines earlier runs drew with (warm --used).
-PrecompileAll (launcher: "Precompile every pipeline", off by default) makes
every pipeline the title has created, as foxhound's launcher does: fewer
stalls in places not drawn in yet, at the cost of an hour or more and
gigabytes the first time. Kept across the F1 menu's restart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 17:30:37 -05:00
3fdfbaa46f d3d12: hardware ray tracing on DXR 1.1 (LEONIDA_HW_RT, off: a trial)
In place of -RayTracing (the title's structure builder and software traversal as translated
shaders): the title's XboxBvhBuilder calls become host DXR 1.1 bottom and top levels, and the
traversal loops of its trace programs become inline ray queries.

Ported from trustno1-coder/VIctory-NVIDIA (its #3706; from Leslie-d-a/VIctory-NVIDIA-HWRT 61e389e0
and 5f55bca8, original by dakisback2 ecc49d5b and 72f8316a), GPL-3.0, and fitted to this tree:

- leonida-shader: emit/rayquery.rs wired into lower.rs (the plan, the handles, TLAS root SRVs
  t230..t241, the analyses that leave the lifted loops out). A program in the paired form is not
  lifted. With LEONIDA_HW_RT=1 the node test of a loop left unlifted misses every node
  (emit/intersect.rs bvh_miss): the console structures are never written then.
- leonida-gpu: hwrt.rs (and dxr.rs for its records); list::external with a LEONIDA_THIN op for the
  structure work at its place in a title list; the TLAS views in the descriptor heaps;
  Deferred::held; the ray queries in the shader cache's entries; counters in the frame log.
- leonida-hle: modules/xboxbvh.rs replaces the exports of the title's XboxBvhBuilder.dll when on.
- With it on the light stand-in stands aside and the passes left out without structures run.
  Shader writes are not all copied back as VIctory-NVIDIA does (LEONIDA_HW_RT_COPY_BACK=1 asks for
  it): here that stretched and flickered textures and cost 30 to 45 ms a frame.
- F1: HARDWARE RAY TRACING (TRIAL); play scripts: -HardwareRT (frame generation left off with it,
  as with -RayTracing); launcher: a checkbox. Docs: fork-ray-tracing.md, README.md, switches.md.

One PC (RTX 4070 12 GB, driver 621.40, Series X profile, no frame generation): 22 to 25 frames a
second against 6 with -RayTracing; the run ended after six minutes with the card's memory full.

Co-authored-by: dakisback2 <90546900+dakisback2@users.noreply.github.com>
Co-authored-by: Leslie-d-a <70692092+Leslie-d-a@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-12-01 23:04:12 +01:00
5586f9b003 d3d12: the DLSS build is asked for once NVIDIA's SDK is here, whatever the switches (D3D12-F1-DLSS-REBUILD)
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 (the menu's SAVE AND RESTART) therefore asked for no build: with
a build noted as made without DLSS and NVIDIA's SDK installed afterwards,
every such start fell back from DLSS. get-nvidia-sdks.ps1 says the next
start builds the layer with DLSS; that held only for some switches.

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:
- 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.

Test: tests/test_play_nvidia_menu_choice.py, ten cases of launcher dry runs
against a synthetic folder with a stand-in cargo on the PATH (no game files,
no GPU), and one more run for a note whose exe is gone. On main six of the
ten fail (the five that expect the build and the one without cargo); with
this change all pass.

Not in this change: scripts/game-gate.ps1 refuses to run without a build so
that none is made inside a run. A build noted as made without DLSS, with the
SDK there, is now made again by starts that did not ask for it before (the
gate's default Series X start among them), inside the run. A guard there is
a follow-up: the gate needs PowerShell 7, which the PC this was written on
does not have.

Found by ubiquitarianism (ProjectLeonida/mandy#2570, 1 Dec 2026).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-12-01 21:38:29 +02:00
0b1f6b5887 d3d12: preserve explicit render scale on F1 restart 2026-12-01 13:47:17 -05:00
ebb9ecb983 d3d12: honor saved DLSS at stock Series S resolution 2026-12-01 13:30:30 -05:00
8e1d4000a8 d3d12: -More's values in the menu report, -Dlss replaces the lowest scale, a tidier menu file write
Review of 3a3f38325 (aslan2142):

- The values -More sets were not in what the menu was compared with. A replaced value printed "-> (unset)", a value
  equal to the menu's was reported as replaced, and an empty menu value set by -More was not reported. They are
  overlaid now.
- -Dlss now also sets LEONIDA_RENDER_SCALE_MIN and LEONIDA_OUTPUT in $switchSettings, as -Resolution and -Lowest do,
  so a typed DLSS mode replaces a saved lowest scale.
- play-d3d12.ps1's -SmoothMotion is named -SmoothMotion/-NoSmoothMotion in the report, as -SeriesS is.
- The menu file is not read again to tell whether a value left it. After a failed write, only a temporary file this
  start wrote is removed; whatever already stood at that name is left alone.

Tests: 14. With the launcher of 3a3f38325, 4 fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 13:48:08 -03:00
3a3f383250 d3d12: a typed frame generation replaces the menu's other one; the restart replays -NoFrameGen
Review of cf15c2c6e (merzleckeier, full launcher with the final start mocked):

- A saved LEONIDA_FSR_FRAMEGEN=1 undid a typed -FrameGen 2. The launcher keeps FSR 3's frame generation when both are
  set and drops DLSS's. The two are one choice, so -FrameGen now also sets LEONIDA_FSR_FRAMEGEN and -FsrFrameGen also
  sets LEONIDA_FRAME_GEN in $switchSettings. A typed one replaces the menu's other.
- LEONIDA_MENU_ARGS left -NoFrameGen out, as main does, so SAVE AND RESTART turned frame generation on. It is
  replayed now.

Tests: 12 (two new). With the launcher of cf15c2c6e, the two new ones fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 13:09:20 -03:00
cf15c2c6ed d3d12: a typed switch wins over the F1 menu, not a value that changed (D3D12-MENU-LAST-CHOICE-WINS)
Review of the first version: a value that differs from the last start's command line was taken for the user's new
choice. That lost an explicit flag on the first start after an upgrade, never let the same flag typed again win, and
dropped a menu value the command line never mentioned when leonida-launch.txt lacked the key. The menu file was also
rewritten before the history, so a failed history write had already lost a saved choice.

Now the rule follows what the user typed:
- A switch typed for this start wins over the menu's saved value of each setting it makes. The menu file drops that
  value, so F1 shows the command line's. scripts\play-d3d12.ps1 passes the switches typed there as -Typed, so its
  Series X default and -Lowest 1080 leave the menu's choice standing. A start by hand counts its own switches, and
  -More wins like a typed switch.
- Every other setting keeps the menu's value.
- The menu's SAVE AND RESTART adds -MenuRestart to the switches it replays (LEONIDA_MENU_ARGS), so there the menu's
  values, saved after those switches, win.

leonida-launch.txt is gone. The menu file is written to a temporary file and moved over the old one, and only when a
value leaves it. If that fails, the start runs with the command line's values and the file stays whole.

Tests: 10 cases, among them the same switch typed again, an untyped default, a setting no switch makes, the restart,
a start by hand, -More and a menu file that cannot be written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:20:54 -03:00
c8eea9466f d3d12: the last choice wins between the command line and the F1 menu (D3D12-MENU-LAST-CHOICE-WINS)
play-nvidia.ps1 applied leonida-settings.txt (what F1 saved) over the command line at every start. An empty value
there removed what the command line set, so a later -Resolution, -Dlss or -SeriesS was lost without a word.

Now leonida-launch.txt (git-ignored) keeps what the last start's command line made:
- A setting this command line makes otherwise than that start's did wins. The menu file drops its value, so F1
  shows and saves the new one.
- A setting it makes as before keeps the menu's value, the newer choice.
- Each start says which values came from the menu and which the command line replaced.
- A dry run writes neither file.

The F1 menu gets the native render scale (1, which -Resolution makes at the output's height) and the dynamic
resolution's lowest scale (LEONIDA_RENDER_SCALE_MIN, from -Lowest).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:16:56 -03:00
93e65d91ca launcher: enable water transmission
From #2617. Confirmed in Boat on the RX 6800.
2026-12-01 08:15:15 -05:00
d22cd3b6bb The precompile puts its pipelines into the pipeline library, which the game loads them from
The precompile (`leonida warm`) left the pipelines it made to the driver's own cache on disk, and the
game's runs did not take them from it: right after a precompile that had made them, 1,100 to 2,300
pipelines were "being made" in the first world frames (runs d257, d285, d286, d287), compiled again at
a few to thirty a second while frames took 2 to 10 s (the launcher waits up to 10 s a frame for a
pipeline), and in d287 none of the driver's cache files was written in the four minutes the game
compiled 1,700 pipelines. The game loads pipelines from the pipeline library (a run of 2026-11-27:
2,338 loaded, none made), which it writes only at a run's normal end, and the library on this PC was
last written on 2026-11-29: every change of the translator since meant minutes of compiling in the
world at the next start.

After making them, the precompile now puts those of this translation that are not in the library yet
into it, in one process of its own (`warm --store`): with the library and the static sampler list in
use before its device is made, as the game has them, each pipeline is loaded by the name the game looks
it up by or made (from the driver's cache the processes before filled) and stored; then the library is
written. They are noted in `library-done.txt` only once it is written; a store that fails leaves things
as they were. `LEONIDA_WARM_LIBRARY=0` leaves the library alone, as before.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: type-checked; checked in a run of the
game right after this commit (see the next one).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 00:51:55 -05:00
5b1bd688c5 Launcher: the driver-cache note keeps the files a precompile left alone
The launcher notes NVIDIA's cache files its precompile wrote, with their sizes, and makes every pipeline again when
one is gone or smaller at the next start. The note was replaced by the files each precompile touched: one with
nothing to make touched a single file, and a set moved aside since (the 4 GB file of one warm process was full, so
its 600 pipelines were compiled in the game at every start) was no longer looked for: the next start compiled all
4,875 in the game (run d278). Now the files written are noted at their sizes beside those noted before, and the old
note goes only after pipelines were made again.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: the script parses; run d279 found the moved set
by the restored note and made the pipelines again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 21:37:59 -05:00
cd9fe51a9c Merge pull request #2752 from alpfilho/d3d12/borderless-fullscreen
d3d12: Alt+Enter switches to borderless fullscreen instead of freezing the picture (D3D12-BORDERLESS-FULLSCREEN)
2026-11-30 18:53:54 -05:00
4929a0e99d Merge feat/live-prompts: button prompts follow a device switch during play 2026-11-30 18:48:36 -05:00
8d48f19239 Launcher: a driver shader cache emptied since the last precompile is told by size too
The precompile notes which of NVIDIA's cache files it wrote, and makes
every pipeline again when one of them is gone. After the full files were
moved aside, the driver made files of the same names anew, small, before
the precompile looked: nothing was made again, and the game compiled in the
world (run d256, frames of up to 5.9 s). The files are noted with their
sizes now, and one smaller than noted counts as emptied as well (lines
without a size, from before, are looked at by name as before).

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: the
launcher's next start in run d257.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 16:36:57 -05:00
2a880c31da Merge pull request #2612 from TheGeogeo/d3d12-bar-windows-warning
d3d12: LEONIDA_WINDOWS_BAR_MB says once that it does nothing without resizable BAR (D3D12-BAR-WINDOWS-WARNING)
2026-11-30 17:49:40 +01:00
d985409b61 d3d12: Alt+Enter switches to borderless fullscreen instead of freezing the picture (D3D12-BORDERLESS-FULLSCREEN)
Alt+Enter went to DXGI's own exclusive fullscreen, for which nothing here makes the buffers
again: the picture froze and the screen stayed black. The presenter now turns DXGI's Alt+Enter
off (MakeWindowAssociation with DXGI_MWA_NO_ALT_ENTER, on the swap chain's own factory), and
the title window's procedure in lifecycle.rs handles the key itself:

- Alt+Enter takes the title's window without its frame over the whole of its monitor, and the
  next one gives back its frame and its place. A held key's repeats do nothing, and the
  character it makes (a beep) does not reach the title.
- Going back gives back only the frame and edge styles, so a window made borderless before it
  was first shown stays shown.
- LEONIDA_FULLSCREEN=1 (the launchers' -Fullscreen, or FULLSCREEN (NO BORDER) in the F1 menu)
  makes the window borderless from the start.

The swap chain is not made again: its picture is scaled to the window as before
(LEONIDA_PRESENT_SCALE). Two tests send the keys to a window of their own.

The idea is VIctory's (trustno1-coder/VIctory-NVIDIA has a borderless fullscreen); the code is
written for leonida-hle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 13:38:40 -03:00
2b85ec1249 Merge commit 'a4ed2638981ff3e7b9590e618dddc382115952aa' into fix/1080-1440p-motion-blur-switch 2026-11-30 17:04:36 +01:00
ca191f633c Merge pull request #2626 from merzleckeier/codex/d3d12-motion-blur-f1
d3d12: preserve -MotionBlur across F1 restart
2026-11-30 16:59:10 +01:00
f5f80759fe d3d12: bind MotionBlur in the dynamic resolution preset 2026-11-30 16:08:17 +01:00
fc48622c2b A launcher for the title's dynamic resolution between 1080 and 1440 lines; the one-frame black floor was the camera
scripts\play-X-1080-1440p.ps1 starts Series X with -Lowest 1080: the title's own dynamic resolution picks the
height between 1080 and 1440 lines (output 1440p), about 13% shorter frames than play-X-1440p.ps1 on an
RTX 4060 Ti (57.0 and 59.6 ms against 66.0 and 67.9).

Findings: the one-frame dark cells of the recorded turns (d220, d226) are a dark wall crossing a cell between two
bright views in a fast turn, not a renderer fault; and frame generation's motion vectors on Series X are in the
units the title gives its own FidelityFX upscale (pixels, scale [1, 1], depth inverted, near 10,000, far 0.15).

AI-assisted (Claude). Tested on an RTX 4060 Ti (driver 616.64), Ryzen 5 7600X: the launcher parses; the findings
come from recorded runs d155, d174, d175, d194, d220 and d226.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 09:49:53 -05:00