6 ms·
DXGI debugging: Microsoft put me on a list
- Jare 1y ago> Of course it’s the goddamn filename. Cue in a few dozen oldschool game developers thinking, right from the first paragraph, "did he name his game game.exe"?
- wheybags 1y agoHe should try quack.exe
- Pannoniae 1y agoThe title is a bit clickbait but nice article ;) This is widespread in API-level software, from OSes to GPU drivers. I'm not sure how documented this is but you can find interesting stuff by renaming your exe to Quake, or FIFA, or Minecraft or whatever.
- HeliumHydride 1y agoTrickNvidiaDriversForPerformance_javaw.exe.minecraft.exe
- Pannoniae 1y agoHey, that was the Intel driver! ;)
- georgemcbay 1y agoIts also not surprising to anyone who spent time reading Raymond Chen's The Old New Thing blog posts back in the day, a lot of them were about these rather absurd hoops Microsoft was always jumping through to increase backward and forward compatibility with these sorts of tricks. It may have lead to an unfortunate situation for this developer in this one very niche corner case, but overall it has been wildly beneficial for users over the years (decades even) to have most software Just Work regardless of how deprecated the underlying APIs they were built on are now.
- Dwedit 1y agoBack in 2001, ATI got in some hot water after it was revealed that they intentionally blurred all textures (used a lower resolution mipmap) if you were running Quake 3 Arena. Changing all strings from "Quake" to "Quack" (including renaming the executable) disabled the degraded mipmaps, and improved the graphics (and reduced framerates). https://web.archive.org/web/20190728022442/https://techreport.com/review/3089/how-atis-drivers-optimize-quake-iii/ https://web.archive.org/web/20190728022442/https://techrepor...
- flohofwoe 1y agoMeanwhile today, graphics driver tweaks for specific games has become a regular feature and is advertised in the driver release notes (and I guess that's one reason why graphics drivers have become so massively big).
- typpilol 1y agoI can't remember where I heard this from but I remember a talk from some guy from the DirectX team and he said that so many games use completely illegal and unsupported/weird API options and calls. He said that's what 99% of the game optimizations are. Putting stuff in place to fix broken API stuff.
- skocznymroczny 1y agoThis is true. I am a graphics driver developer and part of my job is to debug rendering issues in games and we often encounter spec violations in the game. Especially so in the era of DirectX12/Vulkan explicit APIs which shift the responsibilities to the developer. Most common culprits are missing resource barriers (image transitions in Vulkan) and uninitialized resources (color/depth resources for the most part require explicit initialization). The thing about those issues is that they are likely to work on one vendor's GPUs, the one that the game developer is using, but break more or less catastrophically on another vendor's GPU. Also it's not easy to get them fixed in the game, because of the realities of engine update cycles and things like console certification process. Unless you report the issue several months before release, there is a slim chance you will get a fix in the game.
- VectorLock 1y agoSounds pretty click-baity but if a company put the name of my software on an opaque list that ships with the OS that makes my software behave differently than I expect it to and didn't even TELL ME about it I'd be way WAY more pissed than this guy is.
- Yeask 1y agoDrivers do this to every single videogame. And it is good, otherwise those game would not run in every consumer 3d card.
- VectorLock 1y agoI'm sure the driver devs have at least some interaction with the game devs when they do this.
- ramijames 1y agoWhen I read about stuff like this it makes me feel lucky never having had to do Windows development.
- pjmlp 1y agoNo worries, the same experience can be done with OpenGL or Vulkan, depending on the specific OS flavour and OEM drivers.
- jsheard 1y agoVulkan even made this kind of targeted hack into a first class citizen by letting the application specify the name and version number of itself and its engine during initialization. There's no reason for that besides enabling per-app driver shenanigans.
- kg 1y agoVulkan layers being system-wide feels like it's specifically asking for this class of bug. If you're lucky every system-wide layer ships with PDBs... but they probably don't. I've yet to find a bug in a layer, at least, but I've wasted time ruling it out.
- gmueckl 1y agoSystem-wide Vulkan layers definitely cause chaos. I remember unit tests for our renderer crashing on some machines and not on other nearly identical ones. The culprit was a Vulkan layer installed by a video capture software. It had a hard limit of 16 Vulkan instances that it could keep track of before overflowing an array and crashing. But our tests would recreate the Vulkan environment from scratch for each test, which is fairly unusual for a Vulkan application, to be fair. In the end, we added the list of loaded Vulkan layers to the diagnostic log of our software to help customer support spot fishy ones.
- delta_p_delta_x 1y agoI never understand these drive-by comments. It's not like developing on/for the competition is any easier or less convoluted. The author is debugging a cross-language (both managed and native), cross-architecture video game with a variety of third-party libraries. Turns out that the Windows graphics stack is complicated (mainly because it needs to support a variety of closed-source programs that never saw maintenance after initial release), so compatibility layers meant to optimise for certain programs (an easy optimisation, frankly) accidentally caught the author's program in the master list, too.
- toast0 1y ago> It only happens when the program is called SS14.Loader.exe. Could you have a SS14.Loader.arm.exe for arm? Then the exe name wouldn't match and it woildn't trigger the crash?
- gregschlom 1y agoYou could. The fix is easy. The problem was the painfully long debugging in order to find the root cause of the issue.
- toast0 1y agoI understand and aprechiate the writeup, I just don't see why the conclusion is to delay the release until the detour bug is fixed, when it's easy to work around it once it has been understood? I suspect that the fix to the detour bug will be unevenly distributed as well, so avoiding it would help user experience regardless.
- tuetuopay 1y agoUntil microsoft ships the .arm.exe name in the list. pretty much a ticking time bomb.
- toast0 1y agoMicrosoft has done a lot of bad releases since they eliminated engineering in test, but it seems a little bit above and beyond to expect them to specifically add an arm executable to a list of executables to patch with x86(64) code and then not confirm that it does what it's supposed to do. The current situation is derpy, but understandable. The patching system was ported with the rest of the arm stuff, and the executable for arm matches the name list so it makes sense to do the patch, but nobody ported the patch data. Whoops.
- formerly_proven 1y agoY'know it would be nice if stuff would log it somewhere when it applies patches like this.
- Avamander 1y agoI would like to disable these compatibility lists on Windows and to actually be able to report any issues and crashes to devs. But this might be a very Linux mindset thing for me to want.
- estimator7292 1y agoThe Linux kernel contains biiiig piles of hacks for individual motherboards, systems, devices. It's like this at every level everywhere, unfortunately. I mean, it was only very recently that your 64 core CPU stopped pretending to be an 8086 during initial boot
- leeter 1y ago> it was only very recently that your 64 core CPU stopped pretending to be an 8086 during initial boot Still Does[1]: >> After a RESET or INIT, the processor is operating in 16-bit real mode. Normally within real mode, the code-segment base-address is formed by shifting the CS-selector value left four bits. The base address is then added to the value in EIP to form the physical address into memory. As a result, the processor can only address the first 1 Mbyte of memory when in real mode. The UEFI hands off the boot CPU to the OS loader (GRUB/NTLoader etc) in long mode. But when the OS brings up any CPU that is not the initial bootstrap CPU via the interprocessor interrupt... that CPU comes up in 16bit* real mode. [1]: https://docs.amd.com/v/u/en-US/40332-PUB_4.08 https://docs.amd.com/v/u/en-US/40332-PUB_4.08 (the intel one says the same thing last I checked, Intel has discussed changing this... but AFAIK has not yet) * This is a lie... note how the quote references EIP and not IP? That's because it's actually booting up in Unreal mode. Hence the initial instruction run is actually at 0xFFFF_FFF0 IIRC https://en.wikipedia.org/wiki/Unreal_mode https://en.wikipedia.org/wiki/Unreal_mode
- codedokode 1y agoAs I remember, for 10 or 20 years on x86 execution starts at 32-bit address like 0xffff_0000:0000, not 0xffff:0000 which was used in 8086, am I wrong? Stumbled upon this when tried to disassemble BIOS.
- ack_complete 1y agoThis is due to an overall odd strategy by the DirectX graphics team, which is to implement many of the optimization and enhancement features by Detour-ing API calls in the OS. Essentially, the Windows OS is patching itself to implement features. Unfortunately, this is being done without core OS assistance like the AppCompat system, so it comes with similar problems to unassisted regular user-space patching. In this case, the Detours code used by DXGI is unable to support the current PAC-enabled function prologues in the current version of Windows 11 ARM64. It isn't limited to just the OP's scenario; attempting to enable Auto Super Resolution (AutoSR) on any native ARM64 program using DirectX will also currently crash in a similar manner in EnumDisplaySettings(). The full screen optimization that is mentioned also has some history. It's well intentioned to remove an entire full-screen copy per frame and increase performance/efficiency, but had some problems. When it was originally implemented in Windows 10, it broke full screen mode for some DirectX 9 apps because it made some incorrect assumptions about the window handle supplied by the application for focus tracking. But it was frustrating to deal with, because the mechanism was nearly undocumented and had no opt-out besides a manual user compatibility checkbox. It took me a couple of days of tearing apart the core windowing guts of my program to figure out what Microsoft had done and how to work around it, and it took several months for the Windows team to fix it on their end.
- pjmlp 1y agoThat strategy is described here, and comes from game developers wanting DirectX to be untied from OS versions as it used to be. https://devblogs.microsoft.com/directx/gettingstarted-dx12agility/ https://devblogs.microsoft.com/directx/gettingstarted-dx12ag...
- deleted 1y ago[deleted]
- ack_complete 1y agoThe Agility SDK is unrelated to what is being discussed here. It is a delivery mechanism for the Direct3D 12 runtime instead of DXGI, it is opt-in from the application side, and is done through a more stable loader stage in the core OS instead of hot-patching. It does, however, give insight into the situation that the DirectX team is in. The in-box version of D3D12Core in the latest version of Windows 11 is SDK version 612. This can be compared against the released Agility SDK versions: https://devblogs.microsoft.com/directx/gettingstarted-dx12agility/ https://devblogs.microsoft.com/directx/gettingstarted-dx12ag... SDK version 612 is just before the 613 Agility SDK release on 3/11/2024. This means that the version of DirectX 12 they are able to ship in the main OS is a year and a half behind the latest released version.
- VectorLock 1y agoMan I gotta give this person props, that is a LOT of effort to get your game to run native ARM64 on Windows. How many people out there are trying to game on ARM64 Windows devices?
- sunshowers 1y agoI played Silksong recently on my Surface Pro 11, it worked fine. 2D game with minimal graphics requirements so it's a different case, though.
- VectorLock 1y agoSpace Station 14 is the same though but it might use some 3d stuff for rendering based on the comments in the blog about issues with OpenGL (or might just use OpenGL's 2D stuff) I know it has some 3d-ish things for visibility shadows but those might just be done in 2D, and from what I've tried SS14 (and SS13) is a 2D game.
- gary_0 1y agoOpenGL doesn't really have "2D stuff" (at least not in any version from the last 20 years). It's all a programmable 3D pipeline, which you can do 2D in by just not using the Z coordinate in the shader. However, doing 2D graphics like this tends to be simple enough code that you're less likely to trigger any driver or performance issues.
- ZeWaka 1y agoWe get a lot of people wanting to run the game on ChromeOS school laptops, which is also ARM-based.
- VectorLock 1y agoI don't think that would contribute to much demand to run it on Windows ARM64.
- badsectoracula 1y ago> It only happens when the program is called SS14.Loader.exe This isn't something only Microsoft does but also graphics drivers, etc. TBH sometimes i consider using using GUIDs in exe names at build time to avoid such lists :-P.
- anonymars 1y agoIt goes both ways! https://devblogs.microsoft.com/oldnewthing/20040211-00/?p=40663 https://devblogs.microsoft.com/oldnewthing/20040211-00/?p=40...
- matt3210 1y agoIf you’re on a list for an app you haven’t released and you didn’t know, what kinds of spyware do you have on your machine? Oh, windows…
- trenchpilgrim 1y agoRead the article; the list is based on EXE filenames. They developer was trying to port an existing application from AMD64 to ARM64.
- DHowett 1y agoThe author of the post indicated that they are releasing an update to an existing game, which we can presume has the same executable filename.
- b800h 1y agoIt seems incredible to me that Microsoft would alter the execution of programs based on the filename of the executable. For all we know, there was another game with the same filename and this game has been caught in the crossfire. This is crazy stuff.
- IAmLiterallyAB 1y agoI don't know if it was filename exactly, but a similar story: > Jon Ross, who wrote the original version of SimCity for Windows 3.x, told me that he accidentally left a bug in SimCity where he read memory that he had just freed. Yep. It worked fine on Windows 3.x, because the memory never went anywhere. Here’s the amazing part: On beta versions of Windows 95, SimCity wasn’t working in testing. Microsoft tracked down the bug and added specific code to Windows 95 that looks for SimCity. If it finds SimCity running, it runs the memory allocator in a special mode that doesn’t free memory right away. That’s the kind of obsession with backward compatibility that made people willing to upgrade to Windows 95. https://www.joelonsoftware.com/2000/05/24/strategy-letter-ii-chicken-and-egg-problems/ https://www.joelonsoftware.com/2000/05/24/strategy-letter-ii...
- Arnavion 1y agoDoing things based on exe filename is quite standard in Windows land. There's literally a registry key called "Image File Execution Options" where you can add a subkey with the name of the exe and then add values to control things like what interpreter to launch it under by default. Similar to Linux's binfmt registration, but based on filename rather than magic bytes. Very useful for attaching debuggers to specific subprocesses that you can't launch manually, as long as the process is named sufficiently uniquely. https://techcommunity.microsoft.com/blog/askperf/two-minute-drill-configuring-a-debugger-using-image-file-execution-options/373478 https://techcommunity.microsoft.com/blog/askperf/two-minute-...
- Joe_Cool 1y agoRenaming anything (without a manifest) setup.exe will cause Windows to ask for UAC elevation. The user cannot opt-out. There are a few other hard coded strings like "install" that cause this AFAIR. You can also use its_a_setup_mr_bond.exe for example.
- nahumba 1y agoYou are a unique person. You have detailedknowlage of graphics assembly and windows api. And you have the creativity to write games. Which need the side ability of drawing. This insane amount of knowlage is rare. And the ability to write about it is also not common. You are very talented and hard working person. I am in awe.
- jicksaw 1y agoNot only that, he also does sysadmin for the game's infrastructure and administrates the drama-prone community. And whatever else happens behind the scenes. Honestly one of the greatest developers I've seen.
- codedokode 1y ago> I’d rather just spend the brain power on ditching OpenGL, rather than trying to continue working with this broken API Is "this broken API" responsible for a library monkey patching? Also, we are lucky that linux libraries generally don't use such hacks. That's really bad style of programming. Also legacy games probably would run just fine with a bitblt if they were running fine on older software.
- Ygg2 1y agoKnowing the author it can only mean OpenGL/EGL and similar. They ranted/vented about OpenGL sucking and DirectX being best thing since butter on toast was invented.
- chris_wot 1y agoWhat, Microsoft is still doing this?!? Back in the day Windows 95 developers went the extra mile to ensure compatibility with SimCity and a bunch of other games: https://news.ycombinator.com/item?id=34138028 https://news.ycombinator.com/item?id=34138028