Skip to content

d3d12: a run logs the LEONIDA_ settings it starts with (D3D12-RUN-SETTINGS-LINE) - #2775

Merged
MoonEyes merged 2 commits into
ProjectLeonida:mainfrom
TheGeogeo:d3d12-run-settings-line
Nov 30, 2026
Merged

MoonEyes merged 2 commits into
ProjectLeonida:mainfrom
TheGeogeo:d3d12-run-settings-line

Conversation

@TheGeogeo

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: D3D12-RUN-SETTINGS-LINE (#2570 (comment))

What and why

Testers asked for this: after an A/B, one of them could not show from the run's log that the switch under test was on. The play script clears and sets LEONIDA_* variables, the F1 settings file adds more, and old VICTORY_* names still map to LEONIDA_*. A run's log so far did not say what it ran with.

leonida run now logs one line at start, under its own target settings:

INFO settings: 4 LEONIDA_ settings: LEONIDA_CAPTURE=<hidden, 18 chars> LEONIDA_EARLY_DEPTH=1 (from VICTORY_EARLY_DEPTH) LEONIDA_KEYS=5:Enter,10-20:W LEONIDA_RELAY=2
  • Every LEONIDA_* variable present, sorted, as NAME=value.
  • A value with any character other than letters, digits, space and ._,:+=*- shows only its length. That covers folders (which name the user), files and command lines, so a log that gets posted carries no path.
  • A value longer than 120 characters is cut.
  • A name that came from an older VICTORY_* name says so (apply_settings_names now returns the names it set).
  • LEONIDA_LOG=warn,settings=info keeps the line on its own.

It says what a run was started with, not that the code read each setting. The function is pure (leonida::settings_line) and is called once in the Run arm. The log call goes through leonida_hle::runtime::log_settings, because the app crate has no tracing dependency, and adding one would change Cargo.lock, which is part of the translator's cache key.

Tested

On Windows 11, from d3d12\:

GPUs tested: n/a (no GPU code; checked on Windows 11 Pro 10.0.26300).

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly.
  • 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.)

…TINGS-LINE)

A tester could not show from a run's log that a switch was on. `leonida
run` now logs one line, under the `settings` target, with every LEONIDA_
variable present, sorted, as NAME=value. A value with any character other
than letters, digits, space and ._,:+=*- (a folder, which names the user,
a file, a command line) shows only its length, so posted logs carry no
path; one longer than 120 characters is cut. Names that came from an older
VICTORY_ name say so. `LEONIDA_LOG=warn,settings=info` keeps the line on
its own.

It says what a run was started with, not that the code read it.
@KelboLive

Copy link
Copy Markdown

Independent check on Windows (not the author), at 4d18c0d3b.

  • cargo test --locked -p leonida-gpu -p leonida-hle --lib: 579 gpu tests + 222 hle tests, 0 failed (1 doctest; 52 ignored).
  • The first run was alongside two other cargo suites and hit the known load-sensitive descriptor::tests::records_copied_as_bytes... flake; rerun alone is clean.

Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711, NVIDIA RTX 4070 Ti SUPER (driver 621.01), Rust 1.98.1 pinned.

AI-assisted: yes (opencode).

…view)

The unit tests of settings_line could only fail on main by not building.
This one runs the built binary on a title that does not exist, with two
LEONIDA_ settings, one a folder, and reads its log: on main there is no
settings line and it fails by assertion; with the change the line names
both settings and shows the folder only by its length.
@TheGeogeo

Copy link
Copy Markdown
Contributor Author

Added an integration test that fails on main by assertion, not only by not building (head 58db554).

apps/leonida/tests/settings_line.rs runs the built leonida run on a title that does not exist. The run gets two settings, one of them a folder, and the test reads the log:

  • on main it fails with no settings line;
  • with the change it passes: the line names both settings, shows the folder only as <hidden, 23 chars>, and the user name never reaches the log.

cargo test -p leonida --locked --test settings_line --bin leonida: 43 passed. clippy: nothing in the new test.

@enlight3d

Copy link
Copy Markdown
Contributor

RUN (independent run on Windows, #2775 head 58db554, merged locally into main 8f41d7d with git merge --no-ff, no conflicts. The head still merges cleanly into main d8ca182. CI on the head: all checks pass.)

Commands, in d3d12/, target x86_64-pc-windows-msvc, toolchain 1.98.1, all with --locked, at low priority:

  • cargo test -p leonida --no-fail-fast (the app): main 43 passed / 0 failed; merge 47 / 0. The 3 new unit tests and the new integration test a_run_logs_the_settings_it_starts_with pass.
  • cargo test -p leonida-hle --no-fail-fast: 223 / 0 / 2 on main and on the merge.
  • cargo clippy -p leonida -p leonida-hle --all-targets (without -D warnings, which already fails on main in leonida-shader and leonida-lua), on main and on the merge: no warning in the four files the PR touches.
  • Red, by assertion: on main with only tests/settings_line.rs added, cargo test -p leonida --test settings_line fails with "no settings line". The real leonida run on a missing title writes no such line on main.
  • Red, behavioural, by mutation:
    • Masking removed (every value shown as it is): the_settings_line_hides_folders_and_files and the integration test both fail. The folders and the user name then appear in the line, which is what the tests guard.
    • Cut removed (values over 120 characters shown whole): the_settings_line_cuts_long_values_and_names_older_names fails.

In-game check on the RTX 3090 (leonida.exe built from 58db554, scripts/play-d3d12.ps1 -SeriesS -NoDlss -NoFrameGen with four settings passed through -More, one of them the keys file path; 180 s, world reached at 83 s, no device loss): the settings line is written once at start, lists 65 LEONIDA_* variables sorted by name, including the four passed through -More and the ones the launcher sets. The keys file path is masked (only its length shown), folder variables are masked too, and no path or user name appears anywhere in the line.

No runtime/ C++ or Python in this PR, so no link or import check applies.
Machine: Windows 11 Pro 26300, i9-13900K, 64 GB, RTX 3090 24 GB, NVIDIA 621.40.

@MoonEyes

Copy link
Copy Markdown
Collaborator

RUN - VERIFY-2775-RTX4060 - by MoonEyes (another person than the author) on head 58db554c7, with #2775 (58db554c7), #2777 (aec6998a9) and #2779 (4c36dba7c) merged together into main 407f71a23 (clean).

  • Machine: RTX 4060 8 GB, Windows 11, diag profile, features diagnostics,mimalloc, Series S, -FrameGen 2 (frame generation files absent, so off), BAR window off, texture budget 1024 MB.

  • In-game, standing in the prologue cell, 480 s asked each: 2 runs, 0 device lost, 0 panics, 0 exceptions, alive at the time limit. About 500 s in the world each. Frame rate median 18.7 (first start: shaders retranslated and pipelines made, 955 s) and 18.6 (warm, 167 s). p5 11.0 and 11.6. The lowest lines are the load and the window's end.

  • Tests on main eec86d0fa + the three (Windows): leonida 47, leonida-hle 223, leonida-gpu 582, leonida-shader 403, 0 failed.

  • d3d12: a run logs the LEONIDA_ settings it starts with (D3D12-RUN-SETTINGS-LINE) #2775 in the run: the settings line is written once at the start, folders shown only as <hidden, N chars>.

Limits: one card, the character standing still, a session that did not reach the open world. Values only, no game data.

AI-assisted (Claude Code).

@MoonEyes

Copy link
Copy Markdown
Collaborator

Merging. Head 58db554c7 merges cleanly with main 9dffbe721 and does not force a rebase of #2566. CI green on this head. Red/green by enlight3d (and KelboLive, OreoFR where they posted) on it; in-game run on the RTX 4060 posted above (2 runs, 0 device lost, about 500 s in the world); leonida, leonida-hle, leonida-gpu and leonida-shader tests pass on main + the three. Merged by MoonEyes.

AI-assisted (Claude Code).

@MoonEyes
MoonEyes merged commit e5d896f into ProjectLeonida:main Nov 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants