Repository navigation
Fix the offline code cache on WoW64 and ship the offline compilers - #7
utkarshdalal wants to merge 3 commits into
Conversation
The code map capture worked on a 32-bit game, but every cache the offline compiler produced was corrupt and the WoW64 loader faulted while patching the read-only file mapping. Four patches fix the relocation rebasing, the WoW64 load path, a compiler startup crash and process-all quoting. The .wcp now also carries FEXOfflineCompiler32/64.exe so caches can be built inside the prefix on the device.
|
Device result with the patched 2610 build (hash 4706b291) on the Poco F6, 32-bit Blazing Chrome: the regenerated cache is now well formed (relocation offsets span the whole code buffer, sorted; no stale host pointers; guest addresses follow the SerializedBase rule), so 0008 does what it says. But the game still exits silently about 2 s after "Cache load: 41844 blocks" with validation on or off, before any window, same as the unpatched build. 0010 is therefore not sufficient for WoW64 on its own. Looking at the WoW64 load path further before this is ready; do not merge yet. |
…ter validation, log cache load phases
|
Device result with the full series (through 0013, hash 8a3f34dd) on the Poco F6, 32-bit Blazing Chrome, Proton 11.0-2-arm64ec-9. Cache regenerated with the matching compiler from a 126 KB code map taken on a cold run (3,394 units, 41,844 entry points, 18.7 MB). With Timing from the final guest environment (both runs after the one-time prefix build):
Part of the start-up gain is the warm page cache, not only the FEX cache. The warm run still wrote an 86 KB code map (misses), against 127 KB cold, so coverage of one play session is far from complete. Open items, both left as is:
|
|
Second game, 64-bit this time: Balatro (LÖVE) on the same device with the full series.
One thing worth knowing for anyone building caches for Wine's own DLLs: the code map's file id is the exact PE (name, timestamp, size) the game ran with. When the offline compiler is pointed at a Wine builtin by its real name, Wine substitutes its own copy of that DLL, so the compiler silently maps a different image and the cache comes out with invalid instructions. Compiling from renamed copies with the builtin marker patched out gave matching ids and clean caches. The compiler should probably refuse an image whose file id does not match the map. |
Tried FEX's offline AOT code cache (
FEX_ENABLECODECACHINGWIP=1) on a 32-bit game (Blazing Chrome) on a Poco F6 with 2610-gn-4. Capture works, but a compiled cache kills the game the moment it loads, and the 64-bit caches crash winhandler. Two bugs in FEX-2610, neither fixed upstream yet:Plus two compiler fixes found on the way: 0007 (reads
SilentLogbefore loading config, crashes at startup) and 0009 (process-allpasses child arguments unquoted, breaks on "blazing chrome.exe").The package now also ships
FEXOfflineCompiler32.exe/64.exein system32 so caches can be generated inside the prefix on the device. They only matter when the cache flag is on. The cache header hash is the tree hash, so compilers and DLLs from one build go together.Tested so far: a cache built from a 126 KB code map with the old binaries parsed clean but was corrupt as described. The fixed binaries are being tried on the device now; result to follow here.
All four go upstream after this.