FEX 2609 Tagged
“Kept you waiting, huh?” - Solid Snake, professional sneaky man.
We’re not going to sugar coat it, this last month was very busy and time just kept moving faster than expected. A ton of work landed this month so we’re going to just need to pick some of the highlights. Let’s hop in!
Jit work you say?
A bunch of random bug fixes and performance improvements landed this month. Primary things here are that there were various behaviour fixes for some instructions. Undefined and defined flag fixes that FEX was messing up, some deadlock fixes, handling more cases that were previously asserts. There was an optimization for the PMULHRSW instruction family that increased some Geekbench benchmark numbers. Surely some game uses it somewhere to notice the 2x perf uplift. We also made the “full” self-modifying-code detection faster, which is used for Unity games in some instances. So that’s nice. We also reduced some lock-contention in the JIT so multiple threads jitting code at the same time should block each other less frequently.
There’s more of course but come on we gotta go!
Removed hacky unixlib fallbacks
For Wine we had some fallbacks for when our unixlib helper library wasn’t installed. This last month we removed these fallbacks and require the unixlib for these features now. Currently all of these features technically are optional, so it isn’t a big deal if unixlib is missing. We also discovered when removing these that we would accidentally be doing Windows syscalls if someone was replacing XTAJIT/Prism with FEX. Oops! Well those fallbacks are removed so that won’t happen anymore at least.
Disk-cache as an option
Through an absolute flurry of commits this last month, disk caching of JIT code is in a place where we think it can be tinkered with more readily. What does disk caching mean for FEX? Once the configuration option is enabled; any code that FEX’s JIT generates is cached to the disk in a FOZ file format database. Then when FEX needs to JIT code subsequently, it will attempt to look up code from that FOZ database first before going through the work of actually jitting. This database lookup happens during the initial run but also subsequent runs of FEX to reduce JIT stutter when running games.
Some downsides today are that if the disk caching is enabled on applications that JIT code itself, then the cache can technically grow unbounded. We haven’t yet implemented any caching size limits or any way to remove stale cache entries. Additionally if any of the file contents change, there might be conflicts today where the cache doesn’t get invalidated in those instances. So there’s still some growing pains but we don’t think these are a showstopper for tinkering today. To give it a try you can set the `FEX_DISKCACHE=1` environment variable or the `“DiskCache”: “1”` json option to enable everything. This works with both the FEX linux interpreter program and also WINE, it maybe be a bit more stable in WINE for now. The cache files will end up in WINE’s %APPDATA% directory or $HOME/.cache/fex-emu/ by default. So if you are running out of space make sure to delete those directories to recover some space!
Let us know how it goes and if there are any games that completely break when this feature is enabled! We’ll be spending continued effort making this feature better as time goes on.
Oh right, the new logo
If you missed the random post, we got a new logo! You’ll find that it’s not dramatically different, but the rainbox gear has definitely changed!
See the 2609 Release Notes or the detailed change log in Github.
