Live data from Hacker News

Linux gaming is faster because Windows APIs are becoming Linux kernel features

xda-developers.com

611–620 of 694 posts

Re: Linux gaming is faster because Windows APIs are becoming Linux kernel features

#611
post #539

Earlier quoted context omitted.

Chess anti-cheat now relies on looking at your moves and spotting mistakes. Not even grandmasters play tactically perfect games so this works pretty well for finding cheaters. In theory FPS games could do the same to detect aimbotting.

I still don't understand why we aren't using server-side gameplay analysis for cheat detection. You can have some obvious inhuman-level gameplay heuristics for real time kicks/timeouts during matches and post-game analysis by AI to flag for review or outright automatically ban gameplay that deviates from normal high-level players.

Games very much are using server-side statistics analysis for cheat detection. Valve made a presentation about it and Epic has an API for feeding game state data to ML anticheat for aimbot detection (game-specific and in addition to their existing anticheat measures)

It’s just that it doesn’t work.

Re: Linux gaming is faster because Windows APIs are becoming Linux kernel features

#612

Earlier quoted context omitted.

I've been intrigued by the possibility of statically compiled games for Linux but I don't think they're the more compatible option. For typical games and players, the game needs to cooperate and interact with the window system. Even setting aside the X11 vs. Wayland issue, AFAIK neither have promised to maintain compatibility for static binaries.

Aren’t both wayland and X11 protocols? Sure there are toolkits, but they’re not hard requirements (based on the little I know).

I also don't know a whole lot, but yes, they both are ultimately implemented as families of client-server protocols over Unix domain sockets (X11 also supports TCP). Inasmuch as you are content with targeting a single version-set of those protocols, then that is sufficient to enable static compilation.

However, the real issue I'm getting at is the ability to run the same statically compiled binary many years later. That requires a dedication to compatibility (in this case, protocol compatibility). X11 was a bit all over the place on this, though it is probably stable enough now by dint of not getting much attention anymore. It seems like Wayland takes protocol compatibility pretty seriously [1] but there's an important caveat:

  [W]hen a protocol transitions from unstable to stable, one last breaking change is permitted.
  [ ... ]
  Note that many useful protocols are still unstable at the time of writing.
Though this itself may be out of date by now (I can't find a date of authorship in that book).

[1]: https://wayland-book.com/protocol-design/design-patterns.htm...

Re: Linux gaming is faster because Windows APIs are becoming Linux kernel features

#613

Feels like there is some real momentum on linux gaming now. I mostly play older games but I've gotten most of them working acceptably in proton on my old system 76 laptop (oryp5, with a nvidia 2060; ~7 years old). The laptop actually has plenty of power for the games I play, but I underclock to keep the heat/fan speeds down (been doing the same on the win10 install on the same system), still getting acceptable framer…

Thank you for sharing that last paragraph. It's nice to know I'm not the only one out there who feels let down by the trajectory Microsoft has taken.

I've likewise got a lifetime of experience on the Windows / MS stack, decades of custom tooling I've adapted or coded from scratch, etc. It's frustrating to see so many great advancements to core fundamentals like the kernel, tracing tools, I/O performance, etc. get completely overshadowed by such chronically user-hostile and frankly stupid business decisions.

I wish I could have the good bits without all the nasty cruft. I wish they stopped assigning junior devs who haven't even heard of Win32 to work on UI touched by millions of end users. I wish they hired back QA staff and rediscovered proper quality control methodologies like, say, regression testing. I remember a story from back in the day when they bought up one of every software title from the local tech store and had staff each pick one to dogfood on their prerelease OS. That passion to ensuring a good user experience.

I don't look forward to the time it will take to recreate all my infrastructure in Linux (including no doubt several detours tinkering into source codes to fix little issues and upstream little enhancements). But I fear Microsoft as a whole will never get their heads screwed on straight in time for me to avoid having to do so.

I would pay good money for something like ReactOS, Wine, or whatever, to offer the equivalent for business applications as Proton is for games. I applaud all the hard work done by people on those projects. I expect one day when kids have never heard of the word Microsoft, the code those heros wrote will still be in use by some grateful beneficiaries.

Anyway, that's the end of my rant. And in the meantime, just in case you haven't tried it yet... Windows 11 IoT Enterprise LTSC is the least offensive flavor I've found, and works as a daily driver.

Re: Linux gaming is faster because Windows APIs are becoming Linux kernel features

#614

Earlier quoted context omitted.

Yes, exactly. We used a set of INT instructions in well-known low memory addresses that all jumped to the same place. We had an ASM file that you linked with, that had sixteen different address combinations for each. The common entry point would look back on the stack and calculate from the return address which entry point had been called, and run the appropriate kernel call. We called it the CS:IP hack. In the conte…

Windows 95 used a related hack. Whenever a v8086 program asked to create a call to protected mode code ("please give me a real mode address to call to, in order to start executing the protected mode routine at address 0x123456"), Windows would store the entry point in a table and hand out real mode addresses like FFD0:0, FFCF:10, FFCE:20, FFCD:30, FFCC:40 that all point to the same instruction (because the segment pa…

Thanks! This is so interesting.

> It so happens that on the 80386 chip of that era, the fastest way to get from V86-mode into kernel mode was to execute an invalid instruction! Consequently, Windows/386 used an invalid instruction as its syscall trap.

I also read this part but I wonder how did they benchmark back then?

> Schulman’s Unauthorized Windows 95 describes a particularly unhinged one: in the hypervisor of Windows/386 (and subsequently 386 Enhanced Mode in Windows 3.0 and 3.1, as well as the only available mode in 3.11, 95, 98, and Me), a driver could dynamically register upcalls for real-mode guests (within reason), all without either exerting control over the guest’s memory map or forcing the guest to do anything except a simple CALL to access it. The secret was that all the far addresses returned by the registration API referred to the exact same byte in memory, a protected-mode-only instruction whose attempted execution would trap into the hypervisor, and the trap handler would determine which upcall was meant by which of the redundant encodings was used.

And if that’s not unhinged enough for you: the boot code tried to locate the chosen instruction inside the firmware ROM, because that will have to be mapped into the guest memory map anyway. It did have a fallback if that did not work out, but it usually succeeded. This time, the secret (the knowledge of which will not make you happier, this is your final warning) is that the instruction chosen was ARPL, and the encoding of ARPL r/m16, AX starts with 63 hex, also known as the ASCII code of the lowercase letter C. The absolute madmen put the upcall entry point inside the BIOS copyright string.

(Incidentally, the ARPL instruction, “adjust requested privilege level”, is very specific to the 286’s weird don’t-call-it-capability-based segmented architecture... But it’s has a certain cunning to it, like CPU-enforced __user tagging of unprivileged addresses at runtime.)

Re: Linux gaming is faster because Windows APIs are becoming Linux kernel features

#615

Earlier quoted context omitted.

I'd guess that the difference only matters if you have the latest most expensive gear pushed to the limit. I have a 2019 RX5700 XT and one of the DDR4 ryzen 5 cpus and all of my games run flawlessly on Linux with great performance. I've long since decided that buying the latest top end hardware is just spending a lot of money to be upset by buggy drivers or not being able to get 5000 fps in a benchmark but has no rea…

> I have a 2019 RX5700 XT So you have very old hardware, can barely play modern AAA games (if ever), and are still happy. Good for you. But your opinion is relevant to average gamer who enjoys playing games released in current year in the same way that someone drinking instant coffee can advise on coffee beens that it's all just caffeine in the end.

Which games will not run on a 5700xt? I’ve played a load of latest release games on a steam deck which is like 15% of the power of that GPU.

Re: Linux gaming is faster because Windows APIs are becoming Linux kernel features

#616

Earlier quoted context omitted.

Disagree. The word "native" in a software execution context has a very specific meaning—it means that the software is running on the target hardware with no emulation, translation layer or modification by any middleware. Games running through Proton/WINE will never be native, by definition.

x86 bytecode isn't the native instruction set on any real hardware you're running games on either, just one of the lowest-level publicly exposed interfaces.

if it's the lowest level available, then it's as close to "native" as we can get, so therefore it has to qualify, if we want to consider anything at all to be running "natively"

Re: Linux gaming is faster because Windows APIs are becoming Linux kernel features

#617

Earlier quoted context omitted.

I was excusing the difference in overhead caused by making the lock more flexible What are the two functions you're comparing and what is the actual difference in overhead that you're talking about? a lock that can be shared between processes versus a lock that can't be. This is a dramatic black and white difference, these would be used for two different things. In that case it's apple and oranges, one would be for i…

> What are the two functions you're comparing Go ask this comment, because I'm continuing their comparison: https://news.ycombinator.com/item?id=48125795 > In that case it's apple and oranges, one would be for interprocess communication and one wouldn't. The whole point of the complaint was wtallis claiming the inter-process-capable lock was being used for locks that don't need it! That's the foundation of this conve…

Basic coding knowledge and an assumption of competency.

This is just saying "I just know", but what specific function and basic timings are you going off of? If you don't know, why are you so sure of the numbers?

The whole point of the complaint was wtallis claiming the inter-process-capable lock was being used for locks that don't need it! That's the foundation of this conversation!

They were saying it's rare to need IPC lock for video games and I don't think that's true, then I gave a scenario where you would use one.

Re: Linux gaming is faster because Windows APIs are becoming Linux kernel features

#618
post #241

Earlier quoted context omitted.

Which brings up a point I've been wondering over the years. Where are the hordes of kids like us back then who were content with the afternoons, evenings and wee early morning hours of endless fiddling? What I realize now is those years spent fiddling sharpened our debugging senses in both ineffable and tractable ways. A larger proportion of the juniors I see coming through the corporate halls these days than I remem…

I've seen the sentiment come up a lot, and I've talked about it with a buddy a lot. For all the issues people claim to have with iOS or Android, they really "just work" compared to the shit we had to deal with back in the day. And I don't even mean bugs, but UX just wasn't as sleek. I can find a pdf of the TTRPG I'm playing that's hidden deep in an iCloud drive by simply opening spotlight an typing the approximate na…

That's a fair point. The equivalent in my day was when the PDP-11 with punched paper tape for offline storage could run BASIC (and lots else), but as soon as most kids saw it couldn't drive Asteroids, their attention waned after the first few weeks. I was church mouse poor, and didn't have the cash for the coinop arcades, much less for a microcomputer back then. I took what I could get.

So the bar to clear to get to gaming is much lower now, and it makes sense fewer kids get to the point where they must tinker to get at those games.

Re: Linux gaming is faster because Windows APIs are becoming Linux kernel features

#619

Feels like there is some real momentum on linux gaming now. I mostly play older games but I've gotten most of them working acceptably in proton on my old system 76 laptop (oryp5, with a nvidia 2060; ~7 years old). The laptop actually has plenty of power for the games I play, but I underclock to keep the heat/fan speeds down (been doing the same on the win10 install on the same system), still getting acceptable framer…

How is ESO these days? Wondering if it's worth getting into from a solo (or finding some random party) gameplay/questing perspective.

Re: Linux gaming is faster because Windows APIs are becoming Linux kernel features

#620
post #311

What excites me is that the kernel gets better not only for windows games but can also get benefits that can be more general purpose, such as what the article writes about: program able to wait for multiple events at once. It will be interesting to see how native Linux games differ in what fancy under the hood kernel or syscall features they use.

There will never be native games that use unique Linux kernel features because no studio will waste their time spending those development resources on an OS with even 10% market share, which Linux is nowhere near. The exception would be if, say, Playstation switches to Linux from BSD, which they will never do, as GNU licensing in essentially fatally incompatible with copy protection and anti-cheat functions.

I doubt it, if Linux can consistently prove to be more performant and easy to use compared to windows and have decent marketshare, it will see adoption by serious game studios.

Sure it might take at least 20 years I assume.

But definitely a possibility.

Post reply on HN