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

Merged
TheGeogeo merged 2 commits from upstream-pr/2775 into main 2026-11-30 23:13:49 +00:00
TheGeogeo commented 2026-11-30 18:09:17 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-30T18:09:17Z.


Claimed in the coordination issue as: D3D12-RUN-SETTINGS-LINE (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7287307317)

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

  • Three new unit tests in leonida::tests:

    • the line lists only LEONIDA_*, in order, and reads "no LEONIDA_ settings" when there are none;
    • Windows, UNC and Unix paths are hidden, and no user name appears;
    • a long value is cut, and the VICTORY_* origin is named.

    On main they do not build, because settings_line does not exist there.

  • cargo test -p leonida --locked --bin leonida leonida::: 6 passed.

  • The real binary: leonida.exe run on a missing exe, with four settings including a folder and an old VICTORY_* name, printed the line above before failing to read the exe.

  • cargo clippy -p leonida -p leonida-hle --all-targets --locked: nothing in the changed lines. git diff --check and check_no_game_data.py are clean.

  • git merge-tree: merges cleanly with #2643 and, on main.rs, with #2658. #2658's other conflict, leonida-loader/src/lib.rs, it already has with main.

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.)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5570982985 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2775). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-30T18:09:17Z. --- Claimed in the coordination issue as: D3D12-RUN-SETTINGS-LINE (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7287307317) ### 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\`: - Three new unit tests in `leonida::tests`: - the line lists only `LEONIDA_*`, in order, and reads "no LEONIDA_ settings" when there are none; - Windows, UNC and Unix paths are hidden, and no user name appears; - a long value is cut, and the `VICTORY_*` origin is named. On `main` they do not build, because `settings_line` does not exist there. - `cargo test -p leonida --locked --bin leonida leonida::`: 6 passed. - The real binary: `leonida.exe run` on a missing exe, with four settings including a folder and an old `VICTORY_*` name, printed the line above before failing to read the exe. - `cargo clippy -p leonida -p leonida-hle --all-targets --locked`: nothing in the changed lines. `git diff --check` and `check_no_game_data.py` are clean. - `git merge-tree`: merges cleanly with #2643 and, on `main.rs`, with #2658. #2658's other conflict, `leonida-loader/src/lib.rs`, it already has with `main`. GPUs tested: n/a (no GPU code; checked on Windows 11 Pro 10.0.26300). AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly. - [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.)
KelboLive commented 2026-11-30 18:14:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-11-30T18:14:47Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7287561833 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2775#issuecomment-7287561833). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-30T18:14:47Z. --- 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).
TheGeogeo commented 2026-11-30 18:32:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-30T18:32:20Z.


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

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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7287996129 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2775#issuecomment-7287996129). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-30T18:32:20Z. --- Added an integration test that fails on `main` by assertion, not only by not building (head 58db554c7). `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 commented 2026-11-30 20:54:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-30T20:54:54Z.


RUN (independent run on Windows, #2775 head 58db554c7, merged locally into main 8f41d7d01 with git merge --no-ff, no conflicts. The head still merges cleanly into main d8ca18240. 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 58db554c7, 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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7291647736 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2775#issuecomment-7291647736). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-30T20:54:54Z. --- RUN (independent run on Windows, #2775 head 58db554c7, merged locally into main 8f41d7d01 with `git merge --no-ff`, no conflicts. The head still merges cleanly into main d8ca18240. 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 58db554c7, `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 commented 2026-11-30 23:13:25 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-30T23:13:25Z.


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.

  • #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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7294859939 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2775#issuecomment-7294859939). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-30T23:13:25Z. --- 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. - **#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 commented 2026-11-30 23:13:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-30T23:13:46Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7294866995 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2775#issuecomment-7294866995). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-30T23:13:46Z. --- 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).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!2775
No description provided.