5820 Commits

Author SHA1 Message Date
0f66375920 Launcher: add "Copy info for a bug report" button
Puts a short plain-text block (25 lines at most) on the clipboard: the
Leonida commit, Windows version, the card the newest d3d12 play log names,
the play settings in effect and up to 10 scrubbed error lines of that log.
The block builder and the scrub (home folder, hex runs, 0x values, hex-like
names after shader stage words, program/shader/pipeline/pso/hash values,
200-character cut) are pure functions in tools/bug_report_info.py. The
driver version and, mostly, the video memory are not in the runtime's log
and read "not in the log". No game data, no paths.

Claim: LAUNCHER-COPY-REPORT (#3312)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 11:48:42 +01:00
fb80a4adc0 docs: fix stale agent rules and pages a repository audit found
- AGENTS.md: agents never merge their own pull request, as CONTRIBUTING.md says; the cargo test command no longer
  skips depth_bounds_pipeline_loads_and_filters_draws, which d3d12.yml runs and passes.
- The switches page said no CI job keeps it current; tests/test_d3d12_switches.py runs --check on it in the required
  check job. Fixed in the generator and the page.
- docs/design.md carried "PAL stage descriptors" twice, byte for byte; the second copy is gone.
- port_status.md and port_plan.md describe the Vulkan base and victory/, which no longer exists: a banner says so and
  points to d3d12/, and the index lists them under a historical heading instead of "Start here".

Claim: DOCS-STALE-AGENT-RULES (#3312)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 11:04:55 +01:00
192a1eec6d Merge remote-tracking branch 'origin/main' into HEAD 2026-12-03 04:27:24 +01:00
4b64ba9e41 Merge remote-tracking branch 'fork/feat/launcher-fgrt-follows-play' into HEAD 2026-12-03 04:19:38 +01:00
b4d0f54ea3 launcher: downloads follow the chosen modes; PLAY records what it passed; no control bytes in the docs
merzleckeier's review of 14b374883:
- needed_files planned from the card only: an RTX 4070 with FSR 3 chosen
  fetched NVIDIA's files and started -FsrFrameGen without AMD's DLLs (the
  script then left FSR 3 off). It now takes PLAY's settings too: FSR 3
  chosen fetches AMD's DLLs on any card (also when no card was read); an
  NVIDIA RTX card fetches DLSS only when DLSS or DLSS frame generation is in
  use. A card without DLSS frame generation still gets AMD's whatever is
  chosen. The Frame generation note promises the download only when that
  same plan has it.
- With downloads first, start_game recorded last_switches from the settings
  as they were after them, so a mode saved meanwhile counted as passed and
  was left out of the next -Chosen. launch_snapshot takes the normal
  launch's switches with the command; start_game records that.
- docs/launcher.md had a BEL and a BS in place of two backslashes of
  d3d12\amd-sdk\FidelityFX\bin (a Python string's \a and \b): fixed.
  NoControlCharactersTests fails on any control byte but tab, LF and CR in
  docs/*.md, the READMEs, the launcher and its translations.

Tests: test_the_chosen_modes_count, test_the_options_recorded_are_those_passed,
NoControlCharactersTests; 133 OK (one skipped). Counter-tests: needed_files
ignoring the modes, start_game recording the live settings, and a BEL
appended to docs/launcher.md each fail their test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 04:19:30 +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
516c9eaabf Merge pull request #3276 from OreoFR/feat/kbm-binds
d3d12 gameinput: LEONIDA_KBM_BINDS remaps keyboard and mouse binds without a rebuild (D3D12-KBM-BINDS)
2026-12-03 03:04:15 +00: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
f9b9f7c624 Merge origin/main (#3279) into the launcher follow-ups; docs link without #3276's anchor, test escape
- Conflict in tests/test_leonida_launcher.py: #3279's 5-byte and 9-byte
  card_memory cases kept, with this branch's "vram" key.
- docs/launcher.md linked gameinput.md#your-own-binds-leonida_kbm_binds, an
  anchor that exists only with #3276: the link goes to gameinput.md and names
  the section (test_docs_links failed on main without it).
- A "D:\G" literal in a test raised SyntaxWarning: escaped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 04:03:11 +01:00
efa45bab9a launcher: a Controls page writes the keyboard and mouse binds (LEONIDA_KBM_BINDS)
A Controls page between Settings and Mods:
- the main default keys in short (docs/gameinput.md has them all);
- the player's binds as rows: where (Both / On foot / In a vehicle, a
  Segmented), the key (its button reads "Press a key…" and takes the next key
  or the left or right mouse button, Tk keysyms mapped to kbm.rs's names; Esc
  cancels), the pad input (Cross, Circle, Square, Triangle, shoulders,
  triggers, stick clicks and pushes, d-pad, View, Menu, or Nothing), and a
  cross to remove it; Add bind, and Reset to defaults after a confirmation;
- F1, F3, F4, F8, F9, Alt, Caps Lock and keys kbm.rs cannot read are refused
  at capture with a red line (the runtime skips them anyway).

Every change is saved at once as the new setting kbm_binds, in kbm.rs's
syntax (scope:key=action;...), and PLAY passes it as LEONIDA_KBM_BINDS
through -More (extra_variables), so the Play page's options line and Copy my
info show it. A LEONIDA_KBM_BINDS in Settings' advanced options wins, and
the page says so; a saved value the page cannot read is kept whole and
shown as it is. The runtime reads the variable once #3276
(D3D12-KBM-BINDS) is merged; until then it is passed and ignored.

New texts in de/es/fr/pt; docs/launcher.md has a Controls entry.

Tests: ControlsTests (round trip of the string and the rows, any case and
kbm.rs's other names; keysyms of letters, digits, F keys, the keypad with
Num Lock on and off, arrows, Space/Enter/Esc/Tab/Backspace, shifts, ctrls,
mouse buttons, and keys refused; the reserved keys; normalise;
extra_variables, -More and Copy my info; Advanced wins) and a guard that
every scope, key and action the page writes is one kbm.rs reads, with the
names taken from kbm.rs's key_named/action_named/entry/RESERVED text
(LEONIDA_KBM_RS points it at #3276's file; skipped while main's kbm.rs has
no LEONIDA_KBM_BINDS). The i18n test now covers the action labels and the
default keys' lines. 120 tests OK (1 skipped: that guard; run against
#3276's kbm.rs it passes). Counter-tests: no LEONIDA_KBM_BINDS passed, a
wrong keysym, a name kbm.rs does not read and a short reserved list each
fail their test. Real window (isolated APPDATA): the empty page, F1 refused
with the red line while capture goes on, G/R/V captured by key events into
both:G=Square;both:R=none;foot:V=RB, saved to launcher.json, and the Play
page's options line showing LEONIDA_KBM_BINDS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 03:49:05 +01:00
636e61f942 launcher: Tools > Clear shader cache deletes the data folder's cache-2, never the saves
Players ask how to clear the cache. Tools gains Clear shader cache: it
deletes the data folder's cache-2 (scripts/play-d3d12.ps1's
LEONIDA_CACHE_DIR: translated shaders, pipelines, the title's prepared
images), after a confirmation that names the folder and its size; refused
while the game runs (started here or not); the saves in <data>/data and
anything else in the data folder are not touched; the next start makes it
again. shader_cache_dir follows a custom Data folder.

New texts in de/es/fr/pt; docs/launcher.md's Tools line says it.

Tests: ClearShaderCacheTests (only cache-2 goes, a read-only file
included, the saves and leonida-settings.txt stay, a second clear says
already empty; refused while running; the default data folder; size_text;
the name is play-d3d12.ps1's). 114 OK; a clear that deletes the whole data
folder fails them. Real window (isolated APPDATA, fake 8 MB cache): the
button on Tools, the confirmation with the folder and "8.0 MB", the cache
gone and the saves kept, then "already empty".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 03:37:16 +01:00
daa7490869 launcher: on an AMD or Intel card the F1 menu's DLSS, DLSS FG and Smooth Motion stay off; a hidden 1440p stays out
merzleckeier's review of 6d9a22f58:
- for_card only changed the command line: with nothing changed since the
  last PLAY (or none yet), -Chosen none left the F1 menu file's
  LEONIDA_FRAME_GEN=2 and LEONIDA_MENU_SMOOTH_MOTION=1 (and a saved
  LEONIDA_UPSCALE=dlss) in effect on AMD and Intel. card_chosen adds NoDlss,
  NoFrameGen and SmoothMotion to -Chosen there, so play-nvidia.ps1 drops the
  menu's values for them as for a typed switch ($switchSettings); the menu's
  FSR frame generation stays. The menu file itself is not touched, so an
  NVIDIA start later finds them.
- Series S with DLSS Quality and a saved 1440 (left out by the mode): on AMD
  -NoDlss -Resolution 1440 stopped the script (Series S outputs 1080 lines).
  for_card keeps such a resolution out; 1080 or less, Series X, or one that
  was passed already, is unchanged.

Tests: ForCardTests gains card_chosen (AMD adds the three once, NVIDIA and
an unread card unchanged, play_command's -Chosen carries them) and the
resolution cases; test_win_launchers gains a dry run of play-nvidia.ps1 with
an AMD card and a menu file (LEONIDA_UPSCALE=dlss, LEONIDA_FRAME_GEN=2,
Smooth Motion 1; FSR 1): the menu's 2x wins without the names, and with them
the upscale is the stretch, frame generation and Smooth Motion off, FSR kept;
and checks each name maps to a $switchSettings entry. 111 + 12 tests OK;
with card_chosen and for_card as before, both new launcher tests fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 03:30:16 +01:00
db005c4350 launcher: without an NVIDIA card PLAY passes DLSS and Smooth Motion off (-NoDlss)
An AMD player (RX 9070) saw DLSS greyed but still on: the greying only
changed the controls, so a saved DLSS choice stayed in PLAY's switches
(no -NoDlss, and -Dlss <mode>, -FrameGen N, -SmoothMotion when saved). On the
Series S profile that asks play-nvidia.ps1 for DLSS on a card that cannot
run it.

for_card(settings, card) gives the settings PLAY passes: without an NVIDIA
card (one read, none NVIDIA) DLSS, its mode, DLSS frame generation's
multiplier and Smooth Motion are off; FSR frame generation and frame
generation Off stay. PLAY, its last_switches and the Play page's options line
use it; the saved settings keep their values, so choosing an NVIDIA card
brings them back. The DLSS and Smooth Motion switches are drawn off while
greyed for the card (Toggle.show_off), and Resolution stays live there
(settings_rules: DLSS's mode only leaves it out on an NVIDIA card).

Tests: ForCardTests (AMD: -NoDlss, no -Dlss/-FrameGen/-SmoothMotion,
-Resolution passed again, saved settings unchanged; FSR and Off kept; NVIDIA
and an unread card unchanged; Resolution live on AMD, greyed on NVIDIA with a
DLSS mode). 106 tests OK; on the launcher before this commit all 5 fail. A
real-window check with a stubbed AMD card: options line "-SeriesS -NoDlss",
both switches greyed and drawn off, the saved DLSS value kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 03:14:09 +01:00
c22cd85edb launcher: a missing game folder is a box on the Play page with Choose game folder
Without a game folder holding game_scarlett_master.exe, the Play card showed
one muted line ("Choose your game folder in Settings") that players missed.
It is now a box under the state, outlined in the warning colour: "Where is
your game?", what to pick, and a Choose game folder button. The picker's
folder is saved at once (the same field as Settings' Game folder); one
without the executable says so in the box in red and changes nothing. PLAY
without a folder opens the same picker instead of a warning and a jump to
Settings, and starts once a folder with the game is chosen.

New texts in de/es/fr/pt; the two old ones removed. docs/launcher.md says it.

Tests: tests/test_leonida_launcher.py (87 OK), test_text_write_line_endings;
a real-window check (isolated APPDATA, patched picker): the box shows with no
folder, a wrong folder shows the error and saves nothing, a right one is
saved to launcher.json and in Settings' field, and the box goes away.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 02:56:33 +01:00
de2358e0bd launcher: Update Mandy makes a zip copy a git clone, installing Git when it is missing (LAUNCHER-ZIP-TO-CLONE)
A copy downloaded as a zip has no .git, so the launcher could only tell the
player to clone instead. Now the Updates card shows Update Mandy on a zip
copy too, and --update turns the folder into a clone in place
(zip_to_clone):
- git init, origin set to https://github.com/ProjectLeonida/mandy.git,
  a fetch of main, and a local main that follows it. The index is set to
  main, with the files left as they are.
- Every tracked file that differs (the zip's older version or the
  player's own edit: they cannot be told apart) is first copied to
  %LOCALAPPDATA%\Leonida\zip-copy-backup-<date>-<time>. Then main's
  version is checked out over the tracked files.
- Untracked files (builds, caches, game_path.txt) are not touched.
- The usual rebuild follows when d3d12/ changed.
- On any failure the new .git is removed, so the next start finds a zip
  copy again, never half a clone.

Without Git, the question before the update says that Git is installed
first with winget (Git.Git, silent). The window passes --install-git; a
console asks [y/N]. find_git also looks where Git for Windows puts
git.exe, since the running launcher's PATH is older than the install, and
_git uses it. Without winget, and on Linux or macOS, the launcher says how
to install Git and changes nothing.

Tests:
- find_git, install_git and the ask / --install-git paths, with stubs.
- With the real git against a bare origin: an older "zip" with an edited
  file, an added file and an ignored build becomes a clean clone at
  origin/main. The differing files are backed up, the others are kept,
  and the next run_update pulls a new commit.
- A failed download leaves the zip copy as it was.
- The texts are in de/es/fr/pt; docs/launcher.md is updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 02:56:18 +01:00
94950d4a57 d3d12 gameinput: LEONIDA_KBM_BINDS, keyboard and mouse binds without a rebuild (D3D12-KBM-BINDS)
`LEONIDA_KBM_BINDS=scope:key=action;...` (scope foot, vehicle or both; key a
letter, digit or name such as Space, LShift, Numpad8, F5, MouseLeft; action a
pad input such as A, Square, RB, LT, DpadUp, LeftY+, or none) changes the
GTA V layout's two tables. An entry replaces every default bind of its key in
its scope; several keys may give one action. The tables are built once
(LazyLock) from the consts plus the entries, and the stand-in pad, `outputs`
and the hand-over rule (`changes`) all read the built tables, so a remapped key
that ends up another input in a vehicle than on foot waits for a fresh press
after a change of table.

Entries that do not read, and the runtime's own keys (F1 settings menu, F3
numbers panel, F4 trainer menu, F8 ped dump, F9 frame capture, Left/Right Alt,
Caps Lock), are skipped with one warning each naming the entry; nothing
panics. Unset, the tables are the consts bind for bind (tested over all 256
keys); LEONIDA_KBM=classic does not read the variable.

Tests: cargo test -p leonida-hle (257 passed, 2 ignored), clippy -p
leonida-hle --all-targets -D warnings clean; a counter-test that keeps the
default binds of a named key fails 3 of the new tests, one that runs the
hand-over on the default tables fails the remapped hand-over test.
docs/gameinput.md documents the syntax; d3d12/docs/switches.md regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 02:21:32 +01:00
671d0c0faa launcher: frame generation with hardware ray tracing follows play-nvidia.ps1 (#3230), DLSS greyed without an NVIDIA card
Settings no longer greys frame generation whenever hardware ray tracing is on. As #3230's play script decides it:
on the Series X profile (the one the next PLAY runs, F1 menu included) with under 20 GB of video memory the mode,
multiplier and limit are greyed with the reason, unless LEONIDA_FG_WITH_RT=1 in Advanced (then live, with the
unlocked note); LEONIDA_FG_WITH_RT=0 greys them everywhere; otherwise they stay live and, with DLSS and the multiplier
on Auto, a muted note says to choose 2x (the automatic 2x never comes with ray tracing). The video memory is
HardwareInformation.qwMemorySize of the display adapter class, the largest, or the chosen card's; unknown holds
nothing back. The launcher never adds LEONIDA_FG_WITH_RT.

Without an NVIDIA card (this PC's, or the one chosen in Graphics card) DLSS, the DLSS mode, DLSS frame generation
and Smooth Motion are greyed with a note; FSR stays and a saved DLSS choice is kept. Ray tracing is never greyed; an
AMD or Intel card gets a "not tested" note. Off Windows or with nothing read, nothing is greyed. PLAY's command is
unchanged: only controls are greyed. Translations fr/es/pt/de, docs/launcher.md, and pure tests of the rule matrix
with the registry stubbed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 01:31:34 +01:00
33869133e5 launcher: Import saves puts saves from another PC, an older install or a kept copy back in this PC's saves folder
The Saves page gets an "Import saves ..." button (and a one-line hint) for saves this runtime wrote elsewhere. The
source is a ZIP or a folder, chosen in a small dialog with a button for each: a launcher backup, a ZIP or folder
holding saves at any level (7952987A\saves, the user folder, a configuration folder, one <Name>~<hash> container),
or a whole old data folder. Every <Name>~<16 hex> folder with a v<N> whose manifest reads is imported; the rest is
ignored and the skipped ones are counted.

Each container goes to saves\0009000000000001\<configuration>\<folder>: the user folder is the runtime's constant
xuser::XUID (a test reads it from xuser.rs); the configuration is the one the source's path names, else this PC's
only one. The runtime names that folder after the id the title passes to XGameSaveInitializeProvider, not after a
constant, so with neither the launcher asks the player to start the game once and invents no name. A list (name,
newest version, date, new or replaced) comes first; a replacement backs up all the current saves (before-import).
Containers are staged in import.new and moved in with one rename; a ZIP's entries get zip_containers' checks.
Refused while the game runs, like the other save actions. "Restore ..." becomes "Restore a backup ...".

Tests: every source shape, configuration from the path / this PC / missing, replacement after a backup, path
traversal, non-save folders, this PC's own saves. Translations in fr, es, pt and de; docs/launcher.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 00:59:25 +01:00
c33166faac launcher: the Advanced mode's filters say what they keep (Only what I set, Only those the play script sets), with tooltips
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 00:38:47 +01:00
ff1b78ce3b launcher: Advanced mode window with every LEONIDA_* variable of switches.md
A secondary "Advanced mode..." button beside Settings' Advanced field opens a second window (one at a time) listing
the 682 variables of d3d12/docs/switches.md, read from the repository when it opens by a small parser (sections,
the &lt;/&gt;/&amp; and \| escapes, backticks dropped; a missing file is said in the window). It opens with the
file's own warning that it is not a list of recommended settings, and a link to d3d12/docs/findings.md.

Search over names and comments, a section filter, Only set and Only the launcher's (column L). The list is virtual:
only the rows on screen exist and are filled again on scroll, so it opens in about 100 ms and filters in under
15 ms. A toggle for the on/off kinds, a text otherwise; the code's comment in two lines with the rest in a tooltip.
Hover only recolours widgets.

It edits the same store as the field (settings["advanced"], parse_advanced): Apply or Close merges the changed
names into it (merge_advanced: add, update in place, remove; unknown pairs and other parts kept as typed; " and ;
refused), so check_advanced and apply_rules (the FG + RT unlock) run as if typed. Nothing is set by default and
PLAY's default command is unchanged. New texts translated in fr, es, pt and de.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 00:38:47 +01:00
018567d691 launcher: frame generation multiplier, window shape and graphics card in Settings
frame_gen, aspect + present_scale and adapter were already settings that
switch_args passed, but no control showed them: a frame_gen 2 saved by the
older launcher could only be changed in launcher.json.

- Frame generation: a Multiplier list, Auto (nothing passed, the script's
  own choice) or 2x to 6x (-FrameGen n, play-nvidia.ps1's 2..6). 3x and up
  are marked RTX 50: the scripts pass any of them whatever the card and the
  runtime makes no more than the card does (fg.rs), 2x on an RTX 40. Greyed
  with FSR or Off and, as the mode, with hardware ray tracing unless
  LEONIDA_FG_WITH_RT=1; -FrameGen still goes with DLSS's only.
- Picture: Window shape (-Aspect: Default, your screen's, 21:9, 32:9,
  16:10; another saved shape is kept) and Picture in the window
  (-PresentScale Fit/Stretch), greyed while the shape is Default.
- General: Graphics card (-Adapter), the display class's DriverDesc read
  with winreg (about 10 ms cold, under 1 ms warm), software and non-PCI
  adapters and duplicates left out; Default only off Windows.
- fr/es/pt/de texts, docs/launcher.md, pure tests (registry stub, switches,
  the old frame_gen 2, the default command unchanged).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 00:37:31 +01:00
64a2c0184e launcher: batched output pump; the low-commit warning follows the F1 menu's console
Two review findings by merzleckeier on #3182.

Output pump (on dafad4ca9): the window's pump drained the whole output queue and
appended once per line, so a run that floods the pipe (the runtime's stderr with
-Log off, #3175) could freeze the window. Ported the design and names of #3192
by 1mshy: OUTPUT_BATCH = 2000, OUTPUT_RESUME_MS = 10 and a pure take_output()
that joins each run of one process's lines into one ("lines", proc, [...]) item,
keeps exit/update/info/rail items in order and leaves the rest queued; one
insert per run, rescheduled after 10 ms while more is queued. The overhaul's
info, rail and finished() handling is kept. #3192's two OutputPumpTests ported
(with info and rail items), plus 10,001 lines = one insert a turn and a check
that the pump goes through take_output.

Low-commit warning (on 7768d10c3): the Play card's warning took the profile from
the launcher's settings alone, while play-d3d12.ps1 -Chosen / play-nvidia.ps1
("What the F1 menu saved") let the F1 menu's LEONIDA_MENU_CONSOLE win when the
launcher's profile has not changed since the last PLAY (and at the first PLAY,
-Chosen none). New pure effective_console(settings, menu) with that order; the
Play card's line uses it and is refreshed when the F1 file is read again (focus,
finished()). The Settings note keeps following the live control; the existing
"F1 menu: Series X" note under the profile says when the menu holds another.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 00:21:03 +01:00
5ee2cb1470 launcher: warn when Windows' commit limit is too low for the Series X profile
The Series X profile commits about 59 GB (58.8 GB measured, d3d12/docs/windows-memory.md). On a PC whose commit
limit (RAM + page file) sits under that, the run spends most of its time near the limit: long frames, and DLSS
frame generation cutting in and out. Series X and ray tracing stay allowed; the launcher now says so instead.

- commit_limit_bytes / physical_memory_bytes: GlobalMemoryStatusEx through ctypes (ullTotalPageFile,
  ullTotalPhys); None off Windows or on failure.
- memory_note(series_x, commit_limit, total_phys): a note under 64 GiB (SERIES_X_COMMIT_BYTES) with Series X
  only, naming the RAM and limit and suggesting Series S or a fixed page file of about 80 GB in all.
- Settings: a warning-coloured note under Profile that follows the profile control live; Play: one short line
  while the saved profile is Series X. Both show the page-file steps (with a size for this PC) on hover.
- Copy my info: the RAM and the commit limit.
- PLAY and its command line are unchanged. fr/es/pt/de translations, tests, docs/launcher.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 23:46:18 +01:00
2152ab8c95 launcher: show what the F1 menu saved; FG greying honours LEONIDA_FG_WITH_RT
The F1 menu's d3d12/leonida-settings.txt wins over every launcher option that was not changed since the last PLAY,
so the launcher could show one value while the game started with another.

- read_menu_settings / clear_menu_settings: the file read as play-nvidia.ps1 reads it (LEONIDA_*=value, comments
  and blank lines skipped, last value per name, an empty value is unset); clear deletes only that file, and only
  when it is a regular file.
- Play card: a "Saved in the F1 menu" section (label: value, names from menu.rs ITEMS, what wins in one muted line,
  a quiet "Clear F1 settings" with a confirmation; "Nothing saved in the F1 menu" when empty). Read again when the
  window gets the focus and when a run ends.
- Settings: "F1 menu: <value>" under frame generation, DLSS, ray tracing, the profile and Smooth Motion when the
  file holds the same setting.
- Frame generation is no longer greyed under hardware ray tracing when Advanced has LEONIDA_FG_WITH_RT=1 (the
  scripts start it then); the note says it is unlocked, and the greying follows the field as it is typed.
- i18n for fr, es, pt, de; tests for the parsing and the clear; docs/launcher.md says which one wins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 23:29:09 +01:00
dafad4ca9d Merge remote-tracking branch 'origin/main' into feat/launcher-overhaul
# Conflicts:
#	docs/launcher.md
2026-12-02 23:11:00 +01:00
540baab862 launcher: polish pass (neutral night palette, one accent, no icon tiles)
A design pass with the unslop skill by @heydamir (CC BY 4.0), in polish mode:
the layout, behaviour, rules and play command stay as they were.

Direction
- product: a desktop launcher for the player's own copy of GTA VI on Mandy's DX12 runtime
- character: nocturne, direct, a little playful
- world: a coastal city at night seen from a car's dashboard; the mockup's indigo taken
  toward neutral, violet and pink kept for what matters
- moments: the violet-to-pink PLAY pill (the one bright element, its gradient kept) and
  the "What is new" list, PR numbers in mono like a log
- signature: the coloured status dot (green up to date, amber updates, red failed) with
  the last-check time, the same in the Updates card and the rail

Changes
- palette: bg #14121f, panels #1b1829/#221f33, rail #100e19, hairlines #2a2738; text
  roles primary #ecebf3, secondary #a9a6bd (7.3:1 on a panel), faint #7d7a93; semantic
  #4cc38a / #d9a441 / #e5484d
- no gradient but PLAY's: switches solid violet when on; Save and Update Mandy are a
  solid off-white PrimaryButton; "Mandy" wordmark in primary text, Segoe UI Semibold
- accent only on PLAY, the rail mark and switches: segmented choice raised with a
  hairline and primary text; combobox and tree selections neutral
- card titles text-only (symbol tiles removed); weights 400 and 600 (Segoe UI
  Semibold) for titles only; no bold buttons
- 4 px grid: card gutters 24/8, heads 16, rail insets 16, segments 12/4, rows 6
- no trailing period on one-line captions, labels and status lines (12 keys renamed
  in fr/es/pt/de)
- "What is new": PR number in Consolas in its own column, title in Segoe UI, still cut
  to the card's width
- one status_dot/dot_colour for the Updates card and the rail
- the NVIDIA tip: neutral raised box, secondary text, only "NVIDIA:" in amber

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 22:50:10 +01:00
fa0491296e launcher: frame generation greyed again whenever hardware ray tracing is on
Reverts e9b947b80 (greyed only on Series X under 12 GB). A player (RTX 5080, Series X) reports the game
running too fast with frame generation and hardware RT together, never with frame generation alone, so
#3230 (which lifts the script's lock) is back to draft and the launcher follows main's script: with
hardware RT, frame generation is off, its controls greyed with the note 'Off with ray tracing for now.'

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 22:32:30 +01:00
5143858788 launcher: the update check runs at every start
Players whose old launcher saved 'Check for updates at start' unticked saw 'Not checked yet' and never
heard of an update. The check now runs at every start whatever launcher.json says (it runs off the
window's thread; without git or network the Updates card says so), and the Settings switch is gone.
Checked in a window with check_updates false in launcher.json: the check runs (the previous code: it
does not).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 22:15:26 +01:00
bc20b75ba7 Merge pull request #3179 from eipastel/lua-memory-limit-per-mod
leonida-lua: each mod gets a Lua state of its own, so its memory limit is its own (D3D12-LUA-MEMORY-LIMIT-IS-STATE-WIDE)
2026-12-02 21:15:03 +00:00
372bc71cde Merge pull request #3189 from RussianSanta12/fix/d3d12-lua-write-file-dangling-link
d3d12 lua: a link to nothing is not written through (D3D12-LUA-WRITE-FILE-DANGLING-LINK)
2026-12-02 21:14:55 +00:00
fe365665c0 Merge origin/main into feat/launcher-overhaul
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 22:06:53 +01:00
e9b947b804 launcher: frame generation greyed with ray tracing only on Series X under 12 GB of video memory
The rule the d3d12 scripts take (D3D12-FG-WITH-RT): frame generation runs with ray tracing, except on
the Series X profile with a card of under 12 GB, where an 8 GB RTX 4070 Laptop ran out of video memory
(5 fps, no generated frame; Series S on the same card: 21 rendered / 43 shown fps). video_memory_mb()
reads HardwareInformation.qwMemorySize from the registry as play-nvidia.ps1 does, once at start;
unknown memory greys nothing. The profile now re-applies the rules too.
Checked in a real window: hw+X+8 GB greyed with the note; hw+S+8 GB, hw+X+16 GB, hw+X+unknown and
off+X+8 GB enabled; the other rules and clicks as before; the launch command unchanged over 288
combinations vs 00a35d6d6 (which fails the five new rule-1 cases).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 22:00:38 +01:00
00a35d6d68 launcher: greyed controls where another choice makes them pointless
UI only (switch_args and play_command unchanged; 288 control combinations give the same switches and
variables as before). A greyed control keeps its value and ignores clicks and the space bar; undoing
the other choice brings it back:
- hardware ray tracing greys frame generation's mode and limit, with a note (the scripts leave frame
  generation off with ray tracing; LEONIDA_FG_WITH_RT=1 in the advanced options overrides);
- DLSS off greys the DLSS mode; DLSS with a mode greys the resolution (left out of the command then);
- frame generation off greys its limit;
- every pipeline precompiled keeps shader preparation on and greyed (it needs it).
Toggle and Segmented get enabled(); a disabled drop-down looks muted. Checked in a real window: each
rule both ways, clicks on greyed controls change nothing, and the same check fails on the previous
commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 21:43:33 +01:00
8877be372b Merge pull request #3079 from Leo02261/docs/launcher-update-accuracy
docs/launcher: Update rebuilds the runtime only on Windows; what the bar shows instead of an update (DOCS-LAUNCHER-UPDATE-PLATFORMS)
2026-12-02 20:43:31 +00:00
be65367a77 launcher: the DLSS mode back in the Picture card
On the Series X profile DLSS makes the picture only with a mode (-Dlss); without a control for it
a player with Series X and DLSS ticked got the game's own upscaler (a player's log: own upscaler at
0.6, no LEONIDA_UPSCALE). Auto passes nothing, so the default launch is unchanged. Checked in a real
window: Auto -> no switch, Series X + Quality -> -Dlss quality, a saved mode shown and kept, back to
Auto -> none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 21:02:27 +01:00
ab3bf6ecee Uncap D3D12 rendering and use measured simulation steps 2026-12-02 14:05:38 -05:00
a269b42675 launcher: Capture back in the diagnostics card; a diagnostic start does not count -Log as chosen next time
From the old-vs-new check of every page: -Capture had lost its control (a saved true could not be
turned off), and a diagnostic PLAY stored its own -Log as the last options, so the next normal PLAY
passed -Chosen Log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 19:52:47 +01:00
661b4502e5 launcher: the Play page in cards, with the updates and what is new; no screenshot backdrop
- Play page as the mockup's cards: Play (the gradient PLAY pill, the state, the game folder and the
  options PLAY passes), Updates (up to date / n updates / why it cannot tell, the last check with
  Check now, what is new and Update Mandy), Output (the log with diagnostic mode and Copy my info).
- What is new: update_status reads `git log --first-parent HEAD..@{u}` (50 at most) and
  parse_changes names a merged pull request "#N <its title>" (the first line of the merge's body);
  six lines shown, cut to the card's width, then "+ n more". A failed log leaves it empty.
- The rail's state follows the same check: up to date, n updates, checking, not checked, zip copy,
  git not installed, no branch to follow, check failed; "Checked HH:MM" under it.
- The screenshot behind PLAY is gone with its search (newest_picture, hero_candidate and their
  tests); Tools still opens the screenshots folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 18:40:32 +01:00
48593f5456 d3d12 lua: a link to nothing is not written through (D3D12-LUA-WRITE-FILE-DANGLING-LINK)
`manifest::inside` checked the deepest part of the path that exists, found
with `Path::exists`. That follows links, so a link inside the mod's folder
whose target is missing counted as absent: the walk went on to the folder
holding it, which is inside, and `leonida.write_file` then made the link's
target, which may be out of the mod's folder.

- The walk now stops at the deepest entry `symlink_metadata` finds, so a
  link counts as there even when its target is missing (also as a folder
  part of the path). Canonicalising a link to nothing fails, and that is
  now a refusal that names the path: "`out.txt` cannot be resolved inside
  the mod's folder (...)".
- Test: a file link to a missing file and a junction (Unix: a folder link)
  to a missing folder; neither write goes through and neither target is
  made. Without the fix the file write returns true and makes outside.txt.
- docs/lua-modding.md: a link that leads to nothing is refused too.

Not reachable from Lua today (no API makes links): hardening.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 12:38:59 -05:00
9257c340e2 Merge origin/main into feat/launcher-overhaul (full precompilation by default, e71aa0ef1)
Keeps main's new default: precompile_all on, -PrecompileUsed when it is turned off with the
preparation on. The overhauled Settings page drives the same setting; docs/launcher.md says so.
PLAY's command is identical to current main's on 903 settings combinations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 18:29:40 +01:00
3565b4ed15 launcher: fixes from the agent review of #3182
- The mouse wheel over a drop-down only scrolls the page: Tk's Combobox binding stepped a read-only
  list's value (Frame limit Auto -> 30 while scrolling), which PLAY then passed.
- ps_quote doubles PowerShell's typographic single quotes (U+2018-U+201B) too: a folder or value with
  one ended the -Command string (checked: no command runs out of it any more).
- Linux: the profile follows play-linux.sh (Series S unless --series-x) and Series X sets series_x.
- A hover tip pending on a page rebuilt after a language change does nothing; the new language is
  loaded only with the rebuilt window (not while the game runs).
- docs/launcher.md: closing the window does not save; PLAY does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 18:28:05 +01:00
83668f06cd docs/launcher.md: no path outside the repository for the mockup
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 18:20:24 +01:00
0e275a0ac5 launcher: the Settings page, rail and colours exactly as in the mockup
Cards in two columns (Picture, Frame generation, Ray tracing, Shaders; General, diagnostics &
advanced), the mockup's rows and lines, hover tips for the longer texts, the NVIDIA tip box, the
advanced field under its label, Save in the violet-to-pink gradient with the legend under the
buttons, MANDY in the gradient and the state, branch, commit, card and driver in the rail. Frame
generation: DLSS / FSR (-FsrFrameGen) / Off and a frame limit (LEONIDA_FG_LIMIT_FPS via -More,
Auto = nothing passed). Ray tracing: Off / Hardware. The game folders sit in a card under them.
Nothing passed changes for settings left at their defaults.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 18:20:13 +01:00
5287ec6cae launcher: the look of #3064 (Mandy name, palette, rail picture, generated hero) and hardware ray tracing only
Ports MoonEyes' LAUNCHER-MANDY-LOOK (#3064) onto the overhaul: the palette read off assets/mandy.png,
the picture at the top of the rail, the gradient hero with glow and palm fronds, pink PLAY, the
Mandy name (MANDY in the hero in place of the game's name). Software ray tracing is no longer
offered (OreoFR's call); a software choice saved by an older launcher is dropped at the next save.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 18:15:59 +01:00
46dd3c1d43 launcher: a full overhaul of the Python launcher (LAUNCHER-OVERHAUL)
- Sharp text: the process says it is DPI-aware, and every size in pixels follows the screen's scale.
- No white window at start: the newest screenshot is looked for off the window's thread, one over
  12 MB or not a PNG is skipped, and an error in a button's code goes to the output box.
- Settings in sections (Game, Picture, Frame generation, Ray tracing, Shaders, General,
  Diagnostics and advanced) with switches and segmented choices, in a scrolling page; frame
  generation gets Off (-NoFrameGen) beside Auto and 2x-6x.
- English, French, Spanish, Portuguese and German, following Windows' display language
  (tools/launcher_i18n/<code>.json), with a Language setting over it.
- Advanced options (LEONIDA_*=value) and crash tracing (LEONIDA_D3D12_DRED=1) reach the runtime
  through play-d3d12.ps1 -More, via powershell -Command with single-quoted arguments.
- Run in diagnostic mode (-Log and DRED, then the logs folder) and Copy my info (commit, cards and
  drivers with NVIDIA's own number, Python/Tk/Windows, options; no folder names).
- Launcher.bat looks for a Python 3.12+ that has Tcl/Tk and offers to install Python 3.12 for the
  user (winget, else the pinned python.org installer Build.bat uses, with Tcl/Tk).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 18:06:59 +01:00
057cc94d8a leonida-lua: Runtime::new cannot fail any more; comments and docs say each mod has its own state 2026-12-02 13:48:13 -03:00
2d2ae41b9d leonida-lua: each mod gets a Lua state of its own, so its memory limit is its own (D3D12-LUA-MEMORY-LIMIT-IS-STATE-WIDE)
One Lua state held every mod, so the 128 MiB limit was one budget for all
of them: a mod holding memory made another's ordinary allocation fail, and
collectgarbage("count") reported the other mods' memory too. Each mod now
loads into its own state (one shared time guard, since one call runs at a
time), with the same 128 MiB limit.
2026-12-02 13:43:28 -03:00
e71aa0ef15 Default to full D3D12 shader and pipeline precompilation 2026-12-02 11:17:09 -05:00