Wine 11 rewrites how Linux runs Windows games at kernel with massive speed gains

https://www.xda-developers.com/wine-11-rewrites-linux-runs-windows-games-speed-gains/

Wine 11 rewrites how Linux runs Windows games at the kernel level, and the speed gains are massive

Wine 11 is the biggest jump for Linux gaming in years.

XDA
Reading these posts always make me feel like an imposter. People are dealing with such low level things, while i'm outta here building simple CRUDs.
All good. I tell people how to add another mailbox to their Outlook, "click here, now there". Not glorious. Necessary anyways.
The grass is always greener on the other side - many low-level programmers feel like an imposter when it comes to high-level systems such as CRUD apps.
They don't. The "simplicity" of using a "high-level" framework for someone who bit-shifts for a living is almost comical.
Really?
I know literal kernel developers who can handle drivers and race conditions any day of the week who can't wrap their mind around Outlook, let alone GUI updates.

Myself. Forth it's easy, 9front C it's manageable but POSIX it's hell and managing both Unix descendants are a piece of cake.

GUI interfaces for the enterprise came from Dante's hell themselves. I hate them, they are like the Madhouse from that Asterix movie making satire of the European bureucracy of the day. The often are oddly designed and they are not documented at all, you must guess the meaning by chance of with a senior tutoring you.

The same with anything corporate from Microsoft with AD roles/group policies and the like. Or anything coming from IBM.

Sure mate. And the guy who can do binary sums in his head would think of assembly as mere childsplay.

Jog on.

I met someone who bit shifts for life, uses opengl shaders for compute, but has no sql experience and is afraid of opening a tcp socket.

Trivial under plan9/9front. Under Win32/POSIX, run way.

On bit shifts, pick any Forth programmer and shaders will be almost like a toy for them. They are used to implement double numbers (and maybe floats) themselves by hand by just reusing the only integer numbers they have and writting custom commands to output these pairs of integer as double numbers. They can probably implement multithreading processing by hand in Forth and also know the IEEE standards for floats better than C programmers over 20 years.

Can confirm, my buddy who is someone I respect immensely, is an embedded programmer.

He will talk about OS events, or any low level concept and it makes me feel like I don’t know anything, but he acts like I’m a genius if I talk about JavaScript Runtimes, browser engines, anything frontend.

It’s cool he teaches me new things, I teach him some

Some people are exceptional at solving difficult but hard to explain problems while other are great solving direct business problems. No need to feel ashamed for both it’s just different work
You can probably learn to do these things too with enough determination, but don't sell yourself short. Some CRUD apps can get deceptively complicated. Businesses have a way of coming up with just the right requirements to completely invalidate your architecture if you don't know what you're doing.
I work on compilers, and have bounced several times off trying to write my own full stack crud app for a personal project (tried doing it in rails, phoenix and django at various times). I'm finally getting somewhere with claude's help, but it really is its own set of skills - easy to get started with but hard to do well.
Not only do the CRUDs have value but they're good for your sanity. I knew a guy back in the dot-com era. Very skilled coder. Backbone of the company. He pulled off miracles. Fulfilled impossible deadlines. Then one day, out of the blue, he quit. Took a job at a non-technical corp. They put him in a cubicle where he wrote Visual Basic CRUDs on an 8-5 schedule. No weird deadlines, no sleeping under the desk. He called it his paid vacation.

> Dirt 3 went from 110.6 FPS to 860.7 FPS

> Resident Evil 2 jumped from 26 FPS to 77 FPS

> Call of Juarez went from 99.8 FPS to 224.1 FPS

> Tiny Tina's Wonderlands saw gains from 130 FPS to 360 FPS

Amazing. I don't understand the low level details on how such a massive speed gain was ripe for the picking but I welcome!

I guess thanks Valve for pouring money into Proton.

Those benchmark numbers are slightly misleading, as they are a comparison of Wine+ntsync against Wine+nothing. There has been a somewhat fast "fsync" library built around Linux's futex and the gains over Wine+fsync are modest (just a few % in most cases).

That said, Wine+ntsync is still a win, just not a 8x improvement like the Dirt 3 benchmark suggests.

(And it case it's not clear, ntsync is https://docs.kernel.org/userspace-api/ntsync.html, which is a driver for Linux that offers syncronization primitives (mutex, semaphore, events) that more closely match the semantics of the Windows primitives. It's easier to do a direct implementation in Wine to support code compiled for Windows that expects to be talking to an NT kernel.)

NT synchronization primitive driver — The Linux Kernel documentation

> There has been a somewhat fast "fsync" library built around Linux's futex

The article actually goes into that in quite a bit of detail about that.

Yeah but to the commenter I was replying to, I don't think it was clear that detail was relevant to the benchmark numbers they were quoting.
Do they have any other usecase behind Wine? My guess would be MS SQL server, but is that correct?
Though like the article mentions, fsync doesn't work out of the box (requiring kernel patches).
* when not using esync nor fsync
So, what's the relationship between Wine and Proton? Is Proton just the SteamOS/Valve name for it, or is it actually it's own project?
It's a distribution of Wine with some extra stuff added, importantly DXVK (directx => vulkan layer) and a lot of game specific workarounds.
More or less Wine + some experimental patches not yet I twgrated in mainstream wine + a buch of DirectX translation libraries + close steam integration.

That makes sense. I thought they were entirely separate tbh but it makes sense that they'd share a lot of DNA.

I absolutely love my Ally running SteamOS. Incredible work by... everyone involved, really.

Though currently Proton has not yet shipped a release which uses Wine 11.

There's also Proton-GE [1], which is even more experimental and adds some bleeding edge fixes and features.

I've heard it's pretty good for fixing video playback/rendering (e.g. cutscene) issues if both the stable and the experimental branch of Proton can't make it work.

[1] https://github.com/GloriousEggroll/proton-ge-custom

GitHub - GloriousEggroll/proton-ge-custom: Compatibility tool for Steam Play based on Wine and additional components

Compatibility tool for Steam Play based on Wine and additional components - GloriousEggroll/proton-ge-custom

GitHub

Wine is a project that I've grown a near-infinite level of respect for.

I don't know for sure, but I suspect that a lot of the work for Wine is boring and thankless. Digging through and trying to get exact parity with both the documented and undocumented behavior of Windows for the past 30 years doesn't sound fun, but it's finding every little weird edge case that makes Wine a viable product.

The fact that Wine runs a lot of games better than Windows now (especially older games) shows a very strong attention to detail and a high tolerance for pain. I commend them for it.

ReactOS also deserves an honorary mention. A lot of knowledge from that project feeds into Wine.
And vice-versa. It's pretty interesting that the two projects haven't kind of merged despite all the collaboration.
Very different projects so I would not encourage a merge but sharing a code base? I can totally see that being a boon for both and other Windows emulation projects.
ReactOS periodically rebases some of it's libraries from Wine.
Wine has a lot of tests that are run across platforms to check conformance -- https://test.winehq.org/data/. These are a large part of why it has good compatibility.
Wine test runs

With this exact point in mind: I've recently written a pretty straight forward win32 c implementation of a utility with some context dependent window interactions and a tray icon to help monitor and facility reload of config file.

Is there any way I can use the Wine project to facilitate this compiling and running straight under x11/linux environment as a integrated project that doesn't require the end user to fiddle with Wine? I don't mind bundling shared code as needed. Help appreciated, I tried hard and failed at this endeavour priorly.

It is a superb project, and a hard thing to do.

It is a pity that the apps most business people use everyday, like Word and Excel and Outlook don't work in it (Excel 2010 is the last version that has Platinum status). It is interesting that these are harder to get working than games.

> It is interesting that these are harder to get working than games.

Games are mostly just doing their own thing, only interacting with the system for input & output. MS Office is using every single corner of Windows: every feature in the XML libraries, tons of .NET type stuff, all the OLE and COM and typelib and compound storage features, tons of Explorer integrations, auto-updating stuff via Windows patching mechanisms... there's almost no corner of the Windows OS that MS Office doesn't use.

You're onto something but that's not entirely true for all games. There's plenty of vintage games, made before DirectX standardized everything into the late 90s, that don't work well under wine because back in their day, they would try to bypass windows by "hacking" their way to the hardware via unsupported APIs and hooks, to squeeze every bit of performance from the hardware, and also because every hardware vendor back then from graphics to sound shipped their own APIs.
You mean dos games, just run them under a dos emulator then.
NO, I meant Windows games.
90s Windows ran inside of DOS, and you can run e.g. Windows 98 games (through Windows itself) in DOSBox. Look up exowin9x where they're trying to compile all of the necessary configs for one-click launchers.

Oh, no, before everything kind of converged to OpenGL and DirectX, there were oodles of different things trying to be the next graphics API.

There are the more obvious ones like 3DFX/Glide, but there was also stuff like the Diamond Edge 3D, which used Sega Saturn style "quads".

> Games are mostly just doing their own thing, only interacting with the system for input & output.

They should be trivial to port then, no?

Yes, they are easy to port a lot of the time. Especially now because you can use DXVK to translate DirectX calls into Vulkan, so you don't need to write a Vulkan renderer. Input is sometimes a trickier one to deal with but a lot of the time games are using cross-platform libraries for that already!

Despite all this the Unity engine has spotty Linux support. Some games run better under Wine vs. Unity's native Linux builds. It's Vulkan renderer has had a memory leak for a while now. Input has randomly decided to double keypresses on some distros.

The hard part of Linux ports isn't the first 90% (Using the Linux APIs). It's the second 90%.

Platform bugs, build issues, distro differences, implicitly relying on behavior of Windows. It's not just "use Linux API", there's a lot of effort to ship properly. Lots of effort for a tiny user base. There's more users now, but proton is probably a better target than native Linux for games.

Yeah but Windows is a more stable api to develop against than Linux (at least when it comes to stuff that games need to do) - it doesn't feel "pure", but pragmatically it's much better as a game developer to just make sure the Windows version works with proton than it is to develop a native Linux version that's liable to break the second you stop maintaining it.
As someone once said it best, Win32 is the only stable ABI on Linux: https://blog.hiler.eu/win32-the-only-stable-abi/
Win32 Is The Only Stable ABI on Linux

The killer for games tends to be the anti-cheat or anti-piracy layers.

I have a Windows game I can't run under CrossOver (aka Wine 11) or a VM, only because its anti-piracy layer doesn't accept those circumstances.

Parts of the OS were designed for Office. (Windows installer service, for example)
Office used to work well on WINE. It was the switch to a rolling release model that killed it.
So that's what's keeping Microsoft from just running WINE on an MS-flavored Linux or perhaps a clean slate kernel as their next OS. I've been wondering for a while, this is by far the best explanation.
The Windows Kernel (and arguably the Windows APIs) are the only good part of Windows; they should dump everything else and run Linux above it; wait they did do that and then changed it to a boring VM.
I don't know that they are. It's just there's more incentive to port stuff that has no direct alternative.

Steam and CodeWeavers contribute a lot of code to the Wine project, because it underpins their business models of supporting Windows games on non-Windows platforms.

Between them they make up the vast bulk of what actually gets attention and improvement in Wine, and neither one has any interest in supporting non-game applications.

I avoided using Wine (and Linux for gaming generally) for years on the sole basis that I assumed what they were trying to do was impossible to do well. Occasionally I’d try wine for some simple game and be impressed it worked at all, but refused to admit to myself that it was something I could rely on. (This was many years ago and I freely admit today that I was wrong.)
Valve's Proton (so Wine + DXVK + some other additions) revolutionized gaming on Linux. I play games both for fun and work, and for a solid 3+ years now, gaming on Linux has been an "it just works" experience for me, and should be for most games that don't use kernel-level anticheat.
I really is impressive. I wish publishers like EA and anti-cheat developers weren't so reluctant to support it. I hope Steam devices and SteamOS gain enough traction to force their hands.
EA Javelin Anticheat job listing mentions future support for Linux and Proton

One big issue with Linux / SteamOS gaming is a lack of anti-cheat support, and it seems Electronic Arts (EA) have future plans for supporting the platform.

GamingOnLinux