HackerTrans
TopNewTrendsCommentsPastAskShowJobs

kh9000

no profile record

Submissions

Happy Voluntary Lobotomy Day, Microsoft

uplevel.pro
2 points·by kh9000·9 дней назад·1 comments

July Xbox layoffs rumored to be 'largest in gaming history'

xcancel.com
6 points·by kh9000·11 дней назад·1 comments

comments

kh9000
·11 дней назад·discuss
Normally I don’t give much attention to online layoff rumors, but George is very credible and allegedly has some inside sources. I do wonder if this will be a tipping point for gaming industry unions.
kh9000
·22 дня назад·discuss
And yet they can’t build a TUI that scrolls without flickering or uses a reasonable amount of memory
kh9000
·3 месяца назад·discuss
I assume this voluntary retirement offer will be something like 2 weeks of pay per year of service, plus maybe 16 weeks. And you get to keep your unvested stock. If that's not too far off, you'd expect a principal engineer's gross expected value to be something like 800k from such a move. It seems like the net opportunity cost of accepting the VR would play out like:

1) you lose 1 or 2 million net, in the scenario where you would've otherwise stayed working 4 more years. 2) you lose ~200k net, in the scenario where you get another comparable job, but the job search takes 9 months. 3) you come out ahead if you were about to retire/get laid off anyway.

So, I don't think this plan is going to eliminate a random sampling of senior folks. The folks who accept this offer will tend to be ones that don't super enjoy the work itself, or ones that anticipate bad rewards or impending layoff.

In other words, I doubt it will be a sweet enough deal to entice the already-rich, high performing principal engineers, or the passionate nerds who are just there because they want to be.
kh9000
·3 месяца назад·discuss
The graph API gets you 60% of the way there, but sadly, some core functionality is missing, like calls. And even the chat part of the API is throttled aggressively. If the teams graph API were better, we'd have a bunch of nice, lightweight 3p teams clients by now probably. I really wish this were the case, given that I find teams regularly using multiple gigabytes of memory. Even on a beefy dev machine, that's significant. The C++ linker runs out of memory sometimes even on my 96GB workstation, which fails the build. No kidding, the internally documented solution is to terminate your memory-hungry apps (such as teams, edge, vscode) and try again. Or bump your page file size up to something crazy like 100GB, which ends up cutting into the already tiny 250GB C drives we've provided with. Which means your C drive will fill up every 3 weeks and you have to go babysit it by deleting all the bloat folders.
kh9000
·3 месяца назад·discuss
In terms of speed, anecdotally, it seems like it can go either way. Some programs run faster, some run slower. Usage patterns of malloc/free are so varied that it's probably impossible to optimize for one without hurting others.
kh9000
·3 месяца назад·discuss
Not nearly often enough, because most veteran Windows deverlopers don't even know what segment heap is, or that they have a choice. VS code, for example, is still on NT Heap. It is heartbreaking how under-utilized and under-publicized segment heap is. Raymond Chen needs to make a public service announcement or something.

For the question of how to do "segment heap on globally, with a list of exceptions that are still on NT Heap", I believe the "Image File Execution Options" regkey takes precedence over the global one. And the IFEO one lets you explicitly opt out. If you read the whitepaper from Mark Yason's 2016 talk at black hat, they explain how to use these registry keys.
kh9000
·3 месяца назад·discuss
It takes effect on executable launch.
kh9000
·3 месяца назад·discuss
This is a great idea, honestly. PowerToys is open source. There's a decent change that they would be open to such a contribution.

It is a crime that segment heap is over a decade old and still so underutilized. Gamers in particular go to such great lengths to tweak and optimize their windows machines for perf, but I still haven't seen that crowd discussing segment heap anywhere. It's more important than ever with the recent explosion in RAM cost.
kh9000
·3 месяца назад·discuss
It's complicated. It's not always a straightforward space vs time tradeoff. For chromium's allocation patterns, it sounds like segment heap was slower. But BinaryNinja reported the opposite! See https://github.com/Vector35/binaryninja-api/issues/2778

Side note on the Chromium topic: Google Chrome decided NT Heap is still best for their usage, but Microsoft Edge, which is also built on the Chromium, uses segment heap. Not sure what Firefox uses. You can check by attaching WinDbg and doing !heap. Note that not every heap will be segment heap, even if you globally opt into segment heap. Some code paths explicitly create their own heaps as NT heaps.

At the very least, using fewer pages to allocate the same amount of data improves memory locality slightly. Folks should test and see what works best in their applications.

Another benefit of segment heap that we haven't discussed yet is that it's more strict and proactive about detecting problems and terminating. From what I understand, heap metadata is now stored separately from heap data, and they use guard pages. So heap buffer overruns don't overwrite the heap manager's bookkeeping. With NT heap, crashes due to use-after-free might manifest much later and more indirectly. Like, maybe it overwrote the free list, or it overwrote some newer allocation that landed on the same address. So, the crash is usually in some unlucky 'innocent bystander' call stack that worked with the corrupted region. With segment heap, you tend to get earlier, more actionable, specific crashing call stacks, closer to the site of the original bug. So, if you're an engineer who looks at a lot of difficult windows crash dumps involving memory corruption, segment heap makes the challenge slightly more surmountable.
kh9000
·3 месяца назад·discuss
It's a combinination of bit flags. The lowest bit controls whether segment heap is on or off. The 2nd lowest bit bit controls some additional optimizations that go along with it, something about multithreading. A value of 3 (both flags set) gives you identical behavior to what specifying <heapType>SegmentHeap</heapType> in your application manifest does.

Using the application manifest approach is the right way to ship software that opts into segment heap. The registry thing is just a convenience for local testing.
kh9000
·3 месяца назад·discuss
Windows developer here. After reading this post, my gut instinct is that this is due to something called 'segment heap'.

A bit of backstory: there are two, totally independent implementations behind the Windows heap allocation APIs (i.e. the implementation code behind RtlHeapAlloc and RtlHeapFree, which are called by malloc/free). The older of the two, developed uring the Dave Cutler era, is known as the "NT heap". The newer implementation, developed in the 2010s, is known as "segment heap". This is all documented online if anyone wants to read more. When development on segment heap was completed, it was known to be superior to the NT heap in many ways. In particular, it was more efficient in terms of memory footprint, due to lower fragmentation-related waste. Segment heap was smarter about reusing small allocations slots that were recently free'd. But, as ever, Windows was very serious about legacy app compat. Joel Spolsky calls this the 'Raymond Chen camp'. So, they didn't want to turn segment heap on universally. It was known that a small portion of legacy software would misbehave and do things like, rely on doing a bit of use-after-free as a treat. Or worse, it took dependencies on casting addresses to internal NT heap data structures. So, the decision at the time was to make segment heap the default for packaged executables. At that time, Windows Phone still existed, and Microsoft was pushing super hard on the Universal platform being the new, recommended way to make apps on Windows. So they thought we'd see a gradual transition from unpackaged executables to packaged, and thus, a gradual transition from NT heap to segment heap. The dream of UWP died, and the Windows framework landscape is more fragmented than ever. Most important software on Windows is still unpackaged, and most of it runs on x64.

Why does this matter? Because segment heap is also enabled by default on arm. Same logic as the packaged vs unpackaged decision. Arm64 binaries on Windows are guaranteed not to be ancient, unmaintained legacy code. Arm64 windows devices have been a big success, and users widely report that they feel more responsive than x64 devices.

A not insignificant part of why Windows feels better on arm is because segment heap is enabled by default on arm.

I'd be interested to see how this test turns out if you force segment heap on x64. You can do it on a per-executable basis via creating a DWORD value named FrontEndHeapDebugOptions under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\<myExeName>.exe, and giving it a value of 8.

You can turn it on globally for all processes by creating a DWORD value named "Enabled" under HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Segment Heap, and giving it a value of 3. I do this on my dev machine and have encountered zero problems. The memory footprint savings are pretty crazy. About 15% in my testing.
kh9000
·4 месяца назад·discuss
Nothing to add other than that I agree, and this is a easy to understand, correct way of framing the problem. But the framing probably won't convince exuberant AI folks. These tools are incredibly powerful, but they can only take you faster in the direction you were already going. Using them responsibly requires discipline, and not everyone has it, and we're about to undertake a grand social experiment in seeing how it plays out.

Unnecessary complexity was already a big problem in software prior to LLMs, and I think we're about to see it become, unbelievably, a much much bigger problem than before. My personal belief is that there are a lot of exponential harms that stack up as complexity increases:

1) Difficulty of understandinga codebase rises expontentially with code size. A 100kLOC codebase is more than 10x harder to understand than a 10kLOC codebase. 2) Large codebases get larger faster, classic snowball effect. Implementing a given feature against a larger codebase requires a larger change, even if it's the ideal, perfect change. Plus, ast shortcuts and bad abstractions make future shortcuts and bad abstractions much more likely. 3) Team size increases with codebase size, larger team size triggers Brooks law: number of communication paths grows quadratically with team size.

Prior to LLMs, the world already had large codebases that had essentially become emergent organisms that became so complex, the organizations that created them completely lost control of the ability to work in them effectively. Visual Studio and MSBuild, or Microsoft Teams come to mind. But historically, it was very expensive to get to this point. Now it's going to be much easier
kh9000
·5 месяцев назад·discuss
The section coding.pdf has their code style guidelines, colloquially known as Cutler Normal Form, CNF for short. I'm conflicted on it. Definitely overly verbose, but you can't argue with the results of the NT team. Such a rigid style guide almost feels like the technical version of a dress code. And there's an idea called "enclothed cognition" which is like, if you wear a business suit to work, it exerts a subconscious influence that results in you taking the work more seriously, focusing your attention, etc: https://en.wikipedia.org/wiki/Enclothed_cognition
kh9000
·8 месяцев назад·discuss
I imagine it would be frustrating to be the windows shell dev who has to investigate the torrent of bizarre memory corruption bugs that inevitably occur on Windhawk users’ machines after major OS updates. There’s really no avoiding it when you detour unstable “implementation detail” sort of functions across the taskbar/systray/start/etc. especially now that c++ coroutines are in widespread usage therein.

But to be fair, I understand the demand for products like this, because of several painful feature takebacks between 10 -> 11. It would be nice if cleaner approaches like wholesale shell replacement were still as straightforward as they were prior to windows 8. The “immersive shell” infra running in explorer + the opaque nature of enumerating installed UWPs + a bunch of other things make that almost impossible today.
kh9000
·10 месяцев назад·discuss
Using the UIA tree as the currency for LLMs to reason over always made more sense to me than computer vision, screenshot based approaches. It’s true that not all software exposes itself correctly via UIA, but almost all the important stuff does. VS code is one notable exception (but you can turn on accessibility support in the settings)