mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:50:52 +01:00
[PR #115] runtime: unified loader/OS perf pack (console paths, per-DLL import cache, SHA-NI, lock-free registry) #166
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#166
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/115
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:old-pr/9849📝 Commits (5)
0886b92file_system: parse console paths without copying the path or the roots3af273dpe_loader: probe the game folder and load the host DLL once per imported DLL, not once per importa676e12pe_loader: only cache successful bundled/host probes so failed probes remain retryable7bffe8eruntime: sha256_hex hashes in place, unrolled, with the x86 SHA extensions (4.6-7.0x)f41a8ffregistry: an unimplemented import's repeat call takes no lock and does no lookup📊 Changes
12 files changed (+1792 additions, -109 deletions)
View changed files
📝
runtime/CMakeLists.txt(+27 -0)📝
runtime/shims/file_system.cpp(+60 -34)📝
runtime/shims/registry.cpp(+25 -26)➕
runtime/shims/unimplemented_import.h(+32 -0)➕
runtime/src/lazy.h(+41 -0)📝
runtime/src/pe_loader.cpp(+51 -9)📝
runtime/src/pe_loader.h(+3 -0)📝
runtime/src/shader_library.h(+157 -40)➕
runtime/test/file_system_parse_test.cpp(+208 -0)➕
runtime/test/pe_loader_import_cache_test.cpp(+611 -0)➕
runtime/test/sha256_hex_test.cpp(+251 -0)➕
runtime/test/unimplemented_import_test.cpp(+326 -0)📄 Description
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):Consolidated C++ runtime startup, path-parsing, SHA-256, and lock-free unimplemented-import performance pack replacing closed PRs
#8045,#8340,#8358, and#8439(all previously independently verified on Windows MSVC, Linux GCC + ASan/UBSan, and real executable loading).What this combines
#8045): cuts allocations (7 -> 1onG:,11 -> 3onT:) and-84%CPU; preserveswin32_io_path()long-path handling onmain.#8340): probes game dir and loads host DLL once per imported DLL instead of once per import (~36xfaster,725 -> 12exists/LoadLibraryExAcalls), caching only successful non-null probes (rt::Lazy::get_if_truthy) so failed probes stay retryable; preservesresolve_compatonmain.sha256_hexwith x86 SHA-NI (was#8358):4.6x–7.0xfaster (237 -> 33.9 uson 64 KiB) with portable fallback.#8439): no mutex or map lookup on repeat calls (51x–81xfaster).Testing
-std=c++20 -O2 -Wall -Wextra -Werror, 0 new warnings) on Windows 11 (Ryzen 9 5900X):-DLEONIDA_BUILD_WINDOWS_RUNTIME=OFF):shader_library,sha256_hex(x86 SHA extensions path), andunimplemented_import(81.0x speedup) — 3/3 pass.pe_loader_import_cache_test --reps 3: ok (2,000 random tables + dynamic retry case, 36.47x speedup).file_system_parse_test: 272/272 checks pass.git diff --checkandscripts/check_no_game_data.pyclean. No game data used.AI-assisted (Claude Opus 5.5).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.