Native mod DLLs (experimental): load them and call victory_on_title_mapped #3144

Open
Korothi wants to merge 2 commits from upstream-pr/3144 into main
Korothi commented 2026-12-02 13:54:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Korothi on 2026-12-02T13:54:20Z.


What and why

Adds experimental support for native mod DLLs, which the runtime had no way to load (Lua mods are the only mods today).

Before the title starts, every .dll in %LOCALAPPDATA%\leonida\native-mods\ (or the folder LEONIDA_NATIVE_MODS names) is loaded, in name order. Each one that exports victory_on_title_mapped(const TitleInfo *) is called once, after the title is mapped and before any title code runs, with the image base, size and the absolute exe path.

  • A DLL that fails to load is logged and left out.
  • A DLL that loads but has no such export stays loaded (its DllMain has run) and is not called.
  • A DLL whose callback returns nonzero stays loaded and the value is logged.
  • The title runs on in every case.

Start-up output starts with Mods: none or the list of loaded DLLs (a DLL without the export counts as loaded).

A mod's own dependencies are found by LoadLibraryW's standard search order (the runtime's folder, the system folders, the current folder, PATH), not in the mod's folder; docs/native-mods.md says so.

The contract (when it is called, return value, how the struct may grow under a new version) is in the new docs/native-mods.md, which marks the callback as experimental and says a fault seen with a native mod has to be reproduced without it before it is reported. The change is in d3d12/apps/leonida/src/run.rs: the folder choice, the file filter and the loader, and one call. The folder choice and the file filter are small pure functions with unit tests; the title's own folder is never a default. d3d12/docs/switches.md is regenerated for LEONIDA_NATIVE_MODS. Lua mods and the trainer menu are untouched.

It lets a script-hook style DLL start (I used ScriptHook VI's shvi_core.dll).

Open question for maintainers: whether the runtime should support native DLL mods at all. The code only notifies DLLs it loaded itself.

Tested

On Windows, built with build-nvidia.ps1, with ScriptHook VI's core DLL in the native-mods folder and its plugin files next to the title's exe: the Mods: line names the DLL, the callback returns 0 and the mod's menu opens in game. With the folder empty or absent the output says Mods: none and nothing else changes. Repeated after the review follow-up with the same result. Not tested: other mods, other builds, Linux/Proton.

  • cargo test -p leonida passes, including the new unit tests for the folder choice and the file filter.
  • python -I tests/test_d3d12_switches.py passes (20/20) and scripts/check_no_game_data.py passes.

GPUs tested: NVIDIA GeForce RTX 5090, driver 621.40, Windows 11

AI-assisted: yes

The first version was written with Claude Sonnet 5.5, which is below the model list CONTRIBUTING.md gives for new code. It was reviewed by a separate read-only agent that also ran on Claude Sonnet 5.5; its findings were fixed. The follow-up that answers the maintainer's review (helpers and tests, wording, dependency note, regenerated switches page) was also written with Claude Sonnet 5.5.

The whole change was then re-reviewed in a separate read-only session on Astra: no blocking findings and no memory-safety defect found. Optional nits (empty and relative override semantics, case-sensitive sort order, wording of the dependency search order) were not applied.

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, including in logs or reports quoted here (scripts/check_no_game_data.py passes).
  • A new translator rule: not applicable.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5607852292 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3144). Originally posted by [Korothi](https://github.com/Korothi) on 2026-12-02T13:54:20Z. --- ## What and why Adds experimental support for native mod DLLs, which the runtime had no way to load (Lua mods are the only mods today). Before the title starts, every `.dll` in `%LOCALAPPDATA%\leonida\native-mods\` (or the folder `LEONIDA_NATIVE_MODS` names) is loaded, in name order. Each one that exports `victory_on_title_mapped(const TitleInfo *)` is called once, after the title is mapped and before any title code runs, with the image base, size and the absolute exe path. - A DLL that fails to load is logged and left out. - A DLL that loads but has no such export stays loaded (its `DllMain` has run) and is not called. - A DLL whose callback returns nonzero stays loaded and the value is logged. - The title runs on in every case. Start-up output starts with `Mods: none` or the list of loaded DLLs (a DLL without the export counts as loaded). A mod's own dependencies are found by `LoadLibraryW`'s standard search order (the runtime's folder, the system folders, the current folder, `PATH`), not in the mod's folder; `docs/native-mods.md` says so. The contract (when it is called, return value, how the struct may grow under a new `version`) is in the new `docs/native-mods.md`, which marks the callback as experimental and says a fault seen with a native mod has to be reproduced without it before it is reported. The change is in `d3d12/apps/leonida/src/run.rs`: the folder choice, the file filter and the loader, and one call. The folder choice and the file filter are small pure functions with unit tests; the title's own folder is never a default. `d3d12/docs/switches.md` is regenerated for `LEONIDA_NATIVE_MODS`. Lua mods and the trainer menu are untouched. It lets a script-hook style DLL start (I used ScriptHook VI's `shvi_core.dll`). Open question for maintainers: whether the runtime should support native DLL mods at all. The code only notifies DLLs it loaded itself. ## Tested On Windows, built with `build-nvidia.ps1`, with ScriptHook VI's core DLL in the native-mods folder and its plugin files next to the title's exe: the `Mods:` line names the DLL, the callback returns 0 and the mod's menu opens in game. With the folder empty or absent the output says `Mods: none` and nothing else changes. Repeated after the review follow-up with the same result. Not tested: other mods, other builds, Linux/Proton. - `cargo test -p leonida` passes, including the new unit tests for the folder choice and the file filter. - `python -I tests/test_d3d12_switches.py` passes (20/20) and `scripts/check_no_game_data.py` passes. GPUs tested: NVIDIA GeForce RTX 5090, driver 621.40, Windows 11 ## AI-assisted: yes The first version was written with Claude Sonnet 5.5, which is below the model list CONTRIBUTING.md gives for new code. It was reviewed by a separate read-only agent that also ran on Claude Sonnet 5.5; its findings were fixed. The follow-up that answers the maintainer's review (helpers and tests, wording, dependency note, regenerated switches page) was also written with Claude Sonnet 5.5. The whole change was then re-reviewed in a separate read-only session on Astra: no blocking findings and no memory-safety defect found. Optional nits (empty and relative override semantics, case-sensitive sort order, wording of the dependency search order) were not applied. ## 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, including in logs or reports quoted here (`scripts/check_no_game_data.py` passes). - [x] A new translator rule: not applicable.
Kal0s-design commented 2026-12-02 15:16:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-02T15:16:44Z.


Ran natively on Windows 11, head 776a6c0d3 merged into current main (43fc605ed, merges cleanly), toolchain 1.98.1 from rust-toolchain.toml, --locked.

Check Result
cargo test -p leonida --locked 50 + 2 + 2 + 1 passed, 0 failed (the 7 new native_mod_tests included)
cargo clippy -p leonida --tests --locked nothing in leonida; the one unused_mut in leonida-gpu/src/host.rs is already on main
python -I tests/test_d3d12_switches.py / tools/d3d12_switches.py --check / scripts/check_no_game_data.py pass

No title was run. To exercise load_native_mods itself I added a throwaway #[ignore] test (not pushed) that calls it with a dummy base/size and a fake exe path, one process per case, with LOCALAPPDATA and LEONIDA_NATIVE_MODS pointed at scratch folders. The mod DLLs are tiny cdylibs built for this. So "the exe's folder" below is the test binary's folder, not the runtime's.

Case Outcome
Default folder absent, no override Mods: none
Default folder holds a DLL, no override set loaded and called, returned 0. Nothing else enables it: the folder existing is the switch
LEONIDA_NATIVE_MODS= (empty) Mods: none (does not fall back to the default folder)
DLL without the export DllMain ran, listed in Mods:, "not called" line, as documented
0-byte .dll "did not load (... os error 193)", run continues
Same DLL copied under two names both loaded as separate modules, callback called twice
Export declared as returning void logged as returned 1 (whatever is left in rax), i.e. reported as declined
Non-ASCII folder and file name loads, called, exe_path correct
Path of 417 characters loads and is called (long paths are enabled on this machine)
struct_size / version seen by the mod 32 / 1

Things that look worth a change:

  1. A relative LEONIDA_NATIVE_MODS can load a different file than the one listed. read_dir resolves the relative folder against the current folder, but LoadLibraryW gets the relative path (relmods\x.dll) and, for a relative path, uses the standard search, which starts in the executable's folder. With relmods\x.dll in both places (two different DLLs), the one listed came from the current folder but the one loaded and run was the one beside the exe. With the copy beside the exe removed, the current-folder one loaded. LEONIDA_NATIVE_MODS=. loads every DLL in the current folder, and LEONIDA_NATIVE_MODS=0 (the usual "off" value in switches.md) names a folder 0 in the current folder instead of turning it off. Making the folder absolute (std::path::absolute) before listing would make the listed and the loaded file the same.

  2. A mod's dependencies come from the current folder and PATH. A mod importing moddep.dll:

    moddep.dll placed Result
    only in the mods folder the mod fails with os error 126, and moddep.dll is then loaded as a mod of its own (listed in Mods:, "no export")
    only in the current folder the mod loads and gets the current folder's copy
    only in a folder on PATH the mod loads and gets the PATH copy
    in the mods folder and on PATH the PATH copy is used, and the mods-folder copy is loaded a second time as a "mod"

    This matches what docs/native-mods.md says, so it is a design choice rather than a bug, but the repo already loads a third-party DLL differently: leonida-gpu/src/fsr.rs uses LoadLibraryExW(path, NULL, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_SYSTEM32), which takes dependencies from the DLL's own folder and System32 and never from the current folder or PATH. The same flags here would remove the current-folder/PATH lookup and make "put the dependency next to the mod" work. Dependencies would still be listed as mods unless they go in a sub-folder.

  3. A mod that faults leaves no Mods: line. The Mods: line and the per-mod lines are collected and printed only after the loop. With a_good.dll, b_crash.dll (writes to address 8 in the callback) and c_good.dll, the process ends with 0xc0000005. With the runtime's report_crashes() installed first, as run() does, the report names b_crash.dll+0x14b4, but nothing in the output says that a_good.dll was loaded and called, and c_good.dll is never loaded. A fault in a mod's DllMain would look the same. Printing each line as it happens (or the Mods: line before the callbacks) would keep "this run was modded" in the log the docs ask reporters to include.

Calling convention: x64 only, where extern "C" and extern "system" are the same, so a __stdcall export behaves the same. Not a separate test. DLLs are never unloaded (FreeLibrary is not called), as the docs say.

Not checked: a real title run, any real mod, the non-diagnostics/diagnostics feature split, Linux/Proton builds, a mod that starts threads or hooks before returning.

GPUs tested: n/a (CPU-only tests).

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7350052801 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3144#issuecomment-7350052801). Originally posted by [Kal0s-design](https://github.com/Kal0s-design) on 2026-12-02T15:16:44Z. --- Ran natively on Windows 11, head `776a6c0d3` merged into current `main` (`43fc605ed`, merges cleanly), toolchain 1.98.1 from `rust-toolchain.toml`, `--locked`. | Check | Result | |---|---| | `cargo test -p leonida --locked` | 50 + 2 + 2 + 1 passed, 0 failed (the 7 new `native_mod_tests` included) | | `cargo clippy -p leonida --tests --locked` | nothing in `leonida`; the one `unused_mut` in `leonida-gpu/src/host.rs` is already on main | | `python -I tests/test_d3d12_switches.py` / `tools/d3d12_switches.py --check` / `scripts/check_no_game_data.py` | pass | No title was run. To exercise `load_native_mods` itself I added a throwaway `#[ignore]` test (not pushed) that calls it with a dummy base/size and a fake exe path, one process per case, with `LOCALAPPDATA` and `LEONIDA_NATIVE_MODS` pointed at scratch folders. The mod DLLs are tiny `cdylib`s built for this. So "the exe's folder" below is the test binary's folder, not the runtime's. | Case | Outcome | |---|---| | Default folder absent, no override | `Mods: none` | | Default folder holds a DLL, no override set | loaded and called, `returned 0`. Nothing else enables it: the folder existing is the switch | | `LEONIDA_NATIVE_MODS=` (empty) | `Mods: none` (does not fall back to the default folder) | | DLL without the export | `DllMain` ran, listed in `Mods:`, "not called" line, as documented | | 0-byte `.dll` | "did not load (... os error 193)", run continues | | Same DLL copied under two names | both loaded as separate modules, callback called twice | | Export declared as returning `void` | logged as `returned 1` (whatever is left in `rax`), i.e. reported as declined | | Non-ASCII folder and file name | loads, called, `exe_path` correct | | Path of 417 characters | loads and is called (long paths are enabled on this machine) | | `struct_size` / `version` seen by the mod | 32 / 1 | Things that look worth a change: 1. **A relative `LEONIDA_NATIVE_MODS` can load a different file than the one listed.** `read_dir` resolves the relative folder against the current folder, but `LoadLibraryW` gets the relative path (`relmods\x.dll`) and, for a relative path, uses the standard search, which starts in the executable's folder. With `relmods\x.dll` in both places (two different DLLs), the one listed came from the current folder but the one loaded and run was the one beside the exe. With the copy beside the exe removed, the current-folder one loaded. `LEONIDA_NATIVE_MODS=.` loads every DLL in the current folder, and `LEONIDA_NATIVE_MODS=0` (the usual "off" value in `switches.md`) names a folder `0` in the current folder instead of turning it off. Making the folder absolute (`std::path::absolute`) before listing would make the listed and the loaded file the same. 2. **A mod's dependencies come from the current folder and `PATH`.** A mod importing `moddep.dll`: | `moddep.dll` placed | Result | |---|---| | only in the mods folder | the mod fails with os error 126, and `moddep.dll` is then loaded as a mod of its own (listed in `Mods:`, "no export") | | only in the current folder | the mod loads and gets the current folder's copy | | only in a folder on `PATH` | the mod loads and gets the `PATH` copy | | in the mods folder and on `PATH` | the `PATH` copy is used, and the mods-folder copy is loaded a second time as a "mod" | This matches what `docs/native-mods.md` says, so it is a design choice rather than a bug, but the repo already loads a third-party DLL differently: `leonida-gpu/src/fsr.rs` uses `LoadLibraryExW(path, NULL, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_SYSTEM32)`, which takes dependencies from the DLL's own folder and System32 and never from the current folder or `PATH`. The same flags here would remove the current-folder/`PATH` lookup and make "put the dependency next to the mod" work. Dependencies would still be listed as mods unless they go in a sub-folder. 3. **A mod that faults leaves no `Mods:` line.** The `Mods:` line and the per-mod lines are collected and printed only after the loop. With `a_good.dll`, `b_crash.dll` (writes to address 8 in the callback) and `c_good.dll`, the process ends with `0xc0000005`. With the runtime's `report_crashes()` installed first, as `run()` does, the report names `b_crash.dll+0x14b4`, but nothing in the output says that `a_good.dll` was loaded and called, and `c_good.dll` is never loaded. A fault in a mod's `DllMain` would look the same. Printing each line as it happens (or the `Mods:` line before the callbacks) would keep "this run was modded" in the log the docs ask reporters to include. Calling convention: x64 only, where `extern "C"` and `extern "system"` are the same, so a `__stdcall` export behaves the same. Not a separate test. DLLs are never unloaded (`FreeLibrary` is not called), as the docs say. Not checked: a real title run, any real mod, the non-diagnostics/diagnostics feature split, Linux/Proton builds, a mod that starts threads or hooks before returning. GPUs tested: n/a (CPU-only tests). AI-assisted: yes (Claude Code).
fiestorra commented 2026-12-02 16:04:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T16:04:49Z.


Verified on the surface this pull request has, which is code plus documentation and no end-to-end test: it builds, its own test passes, and the repository's documentation checks pass on it.

git worktree at 776a6c0d3 (head)

cargo build -p leonida --all-targets              exit 0
cargo test -p leonida --bins native_mods
  run::native_mod_tests::the_default_folder_is_leonida_native_mods_under_local_app_data ... ok
python -I tools/d3d12_switches.py --check d3d12/docs/switches.md    exit 0
python -m unittest discover -s tests -p "test_docs_*.py"             Ran 57 tests, OK

And the three things I would look at in review, all of which are right:

  • native_mods_dir prefers LEONIDA_NATIVE_MODS and falls back to %LOCALAPPDATA%\leonida\native-mods, and the title's own folder is never a default - the comment says why ("its DLLs are the title's, not mods"), and that is the decision that keeps a mod folder from becoming an arbitrary DLL load;
  • docs/README.md links native-mods.md and switches.md names LEONIDA_NATIVE_MODS, so the switch is documented where the repository's own check looks for it;
  • load_native_mods is called before any title code runs, with the mapped base and SizeOfImage, which is the only moment a mod can hook something.

What I could not test, and it is the whole of the experimental feature: loading a DLL and calling victory_on_title_map - that needs a real mod DLL and a title mapped, and this machine cannot run the title. The code path load_native_mods itself is not exercised by the test above, only the folder decision is.

AI-assisted: yes - DeepSeek v4.1 (flash).

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7351402909 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3144#issuecomment-7351402909). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T16:04:49Z. --- **Verified on the surface this pull request has, which is code plus documentation and no end-to-end test: it builds, its own test passes, and the repository's documentation checks pass on it.** ``` git worktree at 776a6c0d3 (head) cargo build -p leonida --all-targets exit 0 cargo test -p leonida --bins native_mods run::native_mod_tests::the_default_folder_is_leonida_native_mods_under_local_app_data ... ok python -I tools/d3d12_switches.py --check d3d12/docs/switches.md exit 0 python -m unittest discover -s tests -p "test_docs_*.py" Ran 57 tests, OK ``` **And the three things I would look at in review, all of which are right:** - **`native_mods_dir` prefers `LEONIDA_NATIVE_MODS` and falls back to `%LOCALAPPDATA%\leonida\native-mods`, and the title's own folder is never a default** - the comment says why ("its DLLs are the title's, not mods"), **and that is the decision that keeps a mod folder from becoming an arbitrary DLL load**; - **`docs/README.md` links `native-mods.md`** and **`switches.md` names `LEONIDA_NATIVE_MODS`**, so the switch is documented where the repository's own check looks for it; - **`load_native_mods` is called before any title code runs**, with the mapped base and `SizeOfImage`, which is the only moment a mod can hook something. **What I could not test**, and it is the whole of the experimental feature: **loading a DLL and calling `victory_on_title_map`** - that needs a real mod DLL and a title mapped, and this machine cannot run the title. **The code path `load_native_mods` itself is not exercised by the test above**, only the folder decision is. **AI-assisted:** yes - DeepSeek v4.1 (flash). Written with an AI assistant.
MoonEyes commented 2026-12-02 18:02:03 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:02:03Z.


Code review only, not built (Windows-only leonida binary). The code is sound, but whether to ship it is a maintainer decision.

  • Head: 776a6c0d3, merge base 72d143c45, 46 behind current main 45dc41f95. A trial merge is clean.
  • CI: the CI, D3D12 runtime and No Game Data runs on this head are waiting for maintainer approval (action_required).
  • Already run on Windows on this head: Kal0s-design (15:16) and fiestorra (16:04). Nothing has been pushed since.

Review of d3d12/apps/leonida/src/run.rs:

  • The pure helpers (native_mods_dir, is_native_mod_dll, native_mod_paths) are tested, including that the title's folder is never a default and that sub-folders are ignored.
  • load_native_mods runs after imports are bound and before spawn_main, as documented. exe_w is leaked deliberately so the pointer outlives the call, and TitleInfo carries struct_size and version for growth.
  • The callback is cast to extern "C", which is the same as system on x64.

Points for the maintainer decision:

  1. On by default. Every .dll in %LOCALAPPDATA%\leonida\native-mods is loaded with no opt-in. Any process running as the user can drop a DLL there and have it injected into every run. An opt-in, such as requiring LEONIDA_NATIVE_MODS or a launcher toggle, would close that. Folder trust is the reason I would gate it.
  2. No crash containment. A fault or a Rust-visible panic inside a mod's DllMain or callback takes the runtime down before the Mods: line prints, because the line is printed after the loop. Printing each mod's name before calling it would make crash reports attributable.
  3. Scope. CONTRIBUTING.md's clean-room rules are not affected: no game data, and the DLL is user-supplied.

Verdict: ready on code. Whether native DLL mods are supported, and whether loading is opt-in, is for a maintainer to decide.

AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.


Generated by Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7353879247 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3144#issuecomment-7353879247). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T18:02:03Z. --- **Code review only, not built (Windows-only `leonida` binary). The code is sound, but whether to ship it is a maintainer decision.** - Head: `776a6c0d3`, merge base `72d143c45`, 46 behind current `main` `45dc41f95`. A trial merge is clean. - CI: the CI, D3D12 runtime and No Game Data runs on this head are waiting for maintainer approval (`action_required`). - Already run on Windows on this head: Kal0s-design (15:16) and fiestorra (16:04). Nothing has been pushed since. **Review of `d3d12/apps/leonida/src/run.rs`:** - The pure helpers (`native_mods_dir`, `is_native_mod_dll`, `native_mod_paths`) are tested, including that the title's folder is never a default and that sub-folders are ignored. - `load_native_mods` runs after imports are bound and before `spawn_main`, as documented. `exe_w` is leaked deliberately so the pointer outlives the call, and `TitleInfo` carries `struct_size` and `version` for growth. - The callback is cast to `extern "C"`, which is the same as `system` on x64. **Points for the maintainer decision:** 1. **On by default.** Every `.dll` in `%LOCALAPPDATA%\leonida\native-mods` is loaded with no opt-in. Any process running as the user can drop a DLL there and have it injected into every run. An opt-in, such as requiring `LEONIDA_NATIVE_MODS` or a launcher toggle, would close that. Folder trust is the reason I would gate it. 2. **No crash containment.** A fault or a Rust-visible panic inside a mod's `DllMain` or callback takes the runtime down before the `Mods:` line prints, because the line is printed after the loop. Printing each mod's name before calling it would make crash reports attributable. 3. **Scope.** CONTRIBUTING.md's clean-room rules are not affected: no game data, and the DLL is user-supplied. Verdict: **ready** on code. Whether native DLL mods are supported, and whether loading is opt-in, is for a maintainer to decide. AI-assisted verification: Claude Opus (Claude Code), separate agent per batch. --- _Generated by [Claude Code](https://claude.ai/code)_
MoonEyes commented 2026-12-02 22:00:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T22:00:55Z.


This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).

Could you, or anyone with a working setup, post a run report on the current head merged onto current main:

  • the head SHA and the main SHA it was merged onto;
  • GPU, driver and OS;
  • at least 300 s in the world after loading;
  • device lost / crashes (count), and rendered fps (median) if you have them;
  • the same run on main alone for comparison, if you can.

Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7360102686 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3144#issuecomment-7360102686). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T22:00:55Z. --- This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists). Could you, or anyone with a working setup, post a run report on the **current head** merged onto current `main`: - the head SHA and the `main` SHA it was merged onto; - GPU, driver and OS; - at least 300 s in the world after loading; - device lost / crashes (count), and rendered fps (median) if you have them; - the same run on `main` alone for comparison, if you can. Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough. AI-assisted (Claude Code).
fiestorra commented 2026-12-03 00:25:15 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T00:25:15Z.


VERIFY-3144 — Windows nativo: red then green en las pruebas de los mods nativos

Own commit 776a6c0d3 — apps/leonida/src/run.rs (+177), docs/switches.md (5)

Ran at the head (the binary's own tests: -p leonida, not --lib, which finds nothing for a binary crate)

cargo test -p leonida native_mod_tests
  run::native_mod_tests::the_default_folder_is_leonida_native_mods_under_local_app_data ... ok
  run::native_mod_tests::the_environment_override_wins_over_the_default ... ok
  run::native_mod_tests::no_override_and_no_local_app_data_is_no_folder ... ok
  run::native_mod_tests::the_titles_folder_is_never_the_default ... ok
  run::native_mod_tests::only_dll_names_count_in_any_case ... ok

Negative control (synthetic): I made native_mods_dir ignore the environment (from_env.filter(|_| false)), rebuilt and ran:

FAILED: the_environment_override_wins_over_the_default
assertion `left == right` failed

It bites.

What the change is, and the review points it answers are the right ones:

  • native_mods_dir(from_env, local_app_data) takes its two inputs as arguments — so the default folder, the override and "neither" are all testable without setting a variable;
  • the_titles_folder_is_never_the_default — the one that matters: a mod folder inside the title's own directory would be deleted or overwritten by a game update, and the test pins that it is not chosen;
  • is_native_mod_dll — .dll in any case, because a mod authored on a case-insensitive filesystem says .DLL.

And a detail worth crediting: the tests are #[cfg(any(windows, test))], so the helpers exist on non-Windows too for the tests' sake — the same seam #3164 was missing tonight.

What I could not test

  • A real native mod being loaded: it needs the title; the tests drive folder choice and name filtering.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7363170350 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3144#issuecomment-7363170350). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-03T00:25:15Z. --- ## VERIFY-3144 — Windows nativo: `red then green` en las pruebas de los mods nativos | | | |---|---| | Own commit | `776a6c0d3` — `apps/leonida/src/run.rs` (+177), `docs/switches.md` (5) | **Ran at the head** (the binary's own tests: `-p leonida`, not `--lib`, which finds nothing for a binary crate) ``` cargo test -p leonida native_mod_tests run::native_mod_tests::the_default_folder_is_leonida_native_mods_under_local_app_data ... ok run::native_mod_tests::the_environment_override_wins_over_the_default ... ok run::native_mod_tests::no_override_and_no_local_app_data_is_no_folder ... ok run::native_mod_tests::the_titles_folder_is_never_the_default ... ok run::native_mod_tests::only_dll_names_count_in_any_case ... ok ``` **Negative control (synthetic)**: I made `native_mods_dir` ignore the environment (`from_env.filter(|_| false)`), rebuilt and ran: ``` FAILED: the_environment_override_wins_over_the_default assertion `left == right` failed ``` **It bites.** **What the change is, and the review points it answers are the right ones**: - **`native_mods_dir(from_env, local_app_data)`** takes its two inputs **as arguments** — **so the default folder, the override and "neither" are all testable without setting a variable**; - **`the_titles_folder_is_never_the_default`** — **the one that matters**: a mod folder inside the title's own directory **would be deleted or overwritten by a game update**, **and the test pins that it is not chosen**; - **`is_native_mod_dll`** — **`.dll` in any case**, **because a mod authored on a case-insensitive filesystem says `.DLL`**. **And a detail worth crediting**: **the tests are `#[cfg(any(windows, test))]`**, **so the helpers exist on non-Windows too for the tests' sake** — **the same seam `#3164` was missing tonight.** ## What I could not test - **A real native mod being loaded**: it needs the title; the tests drive folder choice and name filtering. Written with an AI assistant.
MoonEyes commented 2026-12-03 07:01:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T07:01:26Z.


This pull request has a merge conflict with current main (d9b618f10), so it can't be run in game or merged as it is. Could you merge the latest main into it (or rebase onto it) and resolve the conflict? Once the head is updated, the in-game gate run can be done on the new head.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7370503974 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3144#issuecomment-7370503974). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-03T07:01:26Z. --- This pull request has a merge conflict with current `main` (`d9b618f10`), so it can't be run in game or merged as it is. Could you merge the latest `main` into it (or rebase onto it) and resolve the conflict? Once the head is updated, the in-game gate run can be done on the new head. AI-assisted (Claude Code).
fiestorra commented 2026-12-03 09:29:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T09:29:46Z.


Tres más, estas de dos commits cada una, rebasadas contra d9b618f10 y empujadas

El resolvedor funcionó igual, porque el conflicto de cada commit es la misma línea del recuento (el while resuelve y sigue hasta que el rebase termina, en vez de asumir un solo bloque):

#3144  3adefc60d   5 files, +278/−2    → 685/645   1 .rs    gpu 715/1
#3171  09dbec1c5   5 files, +118/−24   → 685/645   3 .rs    gpu 716/1
#3248  a48d691f0   4 files,  +79/−1    → 685/645   3 .rs    gpu 716/1

Las tres: 0 marcadores, pytest tests/test_d3d12_switches.py 20 passed, y cargo test -p leonida-gpu --lib con el fallo de la iGPU de siempre.

Y el desglose de tests, que es lo que separa estas tres de #3009 y #3126:

PR líneas .rs tests nuevos en leonida-gpu
#3144 1 0 (715 = main)
#3171 3 1 (716)
#3248 3 1 (716)

O sea que de las cinco rebasadas hoy, tres no añaden tests (#3009, #3126, #3144) y dos sí (#3171, #3248) — y todas tocan código de runtime. Quien fusione tiene ahora el dato delante en vez de descubrirlo después.

Ramas pr-3144-rebased, pr-3171-rebased y pr-3248-rebased en el fork.

Lo que esto ya permite decir: de los 22 conflictos, seis están resueltos y empujados (#3009, #3126, #3140, #3144, #3171, #3248) más los cuatro de antes (#3233, #3253, #3269, #3289) más #3225 y #3308 — doce en total, y todos con el mismo patrón: una línea del recuento que se recalcula contando el fichero.

Lo que no he resuelto: los que chocan en un .rs (#2567, #2856, #3115, #3197) y los de varios commits con código (#2580, #3124, #3130, #3209, #3214) — esos no son una línea y no los toco sin leer el cambio.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7373751099 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3144#issuecomment-7373751099). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-03T09:29:46Z. --- ## Tres más, estas de dos commits cada una, rebasadas contra `d9b618f10` y empujadas **El resolvedor funcionó igual, porque el conflicto de cada commit es la misma línea del recuento** (**el `while` resuelve y sigue hasta que el rebase termina, en vez de asumir un solo bloque**): ``` #3144 3adefc60d 5 files, +278/−2 → 685/645 1 .rs gpu 715/1 #3171 09dbec1c5 5 files, +118/−24 → 685/645 3 .rs gpu 716/1 #3248 a48d691f0 4 files, +79/−1 → 685/645 3 .rs gpu 716/1 ``` **Las tres: 0 marcadores, `pytest tests/test_d3d12_switches.py` 20 passed, y `cargo test -p leonida-gpu --lib` con el fallo de la iGPU de siempre.** **Y el desglose de tests, que es lo que separa estas tres de `#3009` y `#3126`**: | PR | líneas .rs | tests nuevos en `leonida-gpu` | |---|---|---| | **`#3144`** | 1 | **0** (715 = main) | | **`#3171`** | 3 | **1** (716) | | **`#3248`** | 3 | **1** (716) | **O sea que de las cinco rebasadas hoy, tres no añaden tests** (`#3009`, `#3126`, `#3144`) **y dos sí** (`#3171`, `#3248`) — **y todas tocan código de runtime.** **Quien fusione tiene ahora el dato delante en vez de descubrirlo después.** **Ramas `pr-3144-rebased`, `pr-3171-rebased` y `pr-3248-rebased` en el fork.** **Lo que esto ya permite decir**: **de los 22 conflictos, seis están resueltos y empujados** (`#3009`, `#3126`, `#3140`, `#3144`, `#3171`, `#3248`) **más los cuatro de antes** (`#3233`, `#3253`, `#3269`, `#3289`) **más `#3225` y `#3308`** — **doce en total, y todos con el mismo patrón: una línea del recuento que se recalcula contando el fichero.** **Lo que no he resuelto**: **los que chocan en un `.rs`** (`#2567`, `#2856`, `#3115`, `#3197`) **y los de varios commits con código** (`#2580`, `#3124`, `#3130`, `#3209`, `#3214`) — **esos no son una línea y no los toco sin leer el cambio.**
Korothi commented 2026-12-03 11:34:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Korothi on 2026-12-03T11:34:54Z.


Rebased onto current main (b053a1813); head is now c40c78673. Only the generated switches.md conflicted, regenerated. cargo test -p leonida and the switches tests pass.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7376896919 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3144#issuecomment-7376896919). Originally posted by [Korothi](https://github.com/Korothi) on 2026-12-03T11:34:54Z. --- Rebased onto current main (b053a1813); head is now c40c78673. Only the generated switches.md conflicted, regenerated. cargo test -p leonida and the switches tests pass.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3144:upstream-pr/3144'
git switch 'upstream-pr/3144'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3144'
git switch 'upstream-pr/3144'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3144'
git switch 'upstream-pr/3144'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3144'
git switch 'main'
git merge --squash 'upstream-pr/3144'
git switch 'main'
git merge --ff-only 'upstream-pr/3144'
git switch 'main'
git merge 'upstream-pr/3144'
git push origin 'main'
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!3144
No description provided.