5,672 karma · joined December 22, 2019
Mind you, somebody who's sympathetic to the machine's needs can easily scrape most of that performance back by writing C/C++/Zig in a way that easily maps to the optimal assembly. The optimizer won't make your code drastically worse too often, so if you start with something nice then actually dropping down into assembly has limited use cases and usually limited benefits...if you know what you're doing and throw out every style guide as you do so.
As to this server in particular? At first blush it looks more like a learning exercise. You'll go a lot further with clever incremental routines and appropriately leveraging your OS's async API than you will by shaving a few instructions here and there.
As to servers in general? Your kernel is the real bottleneck. If you need all of its features then you don't have a lot of options, but if you're like most applications then you're leaving a ton of performance on the floor not going for kernel bypass (not that using your kernel for network is a _bad_ decision, but you are nevertheless incurring a 10x-50x performance hit as the cost). Assembly shenanigans literally don't matter in comparison.
Do they? Are they doing more work, or is the set of things they've chosen to be good at more stereotypically impressive than the set of things you've chosen to be good at?
> all the worldly churn
Surely all of that adds up to <1hr/day (assuming exercise does double-duty with other intellectual activities and general unwinding)? You could work a pretty intense schedule and still have plenty of time for personal development with that level of overhead, so long as you actually stuck with it and got everything done.
> food prep and washing
I'd be curious to hear more about what this looks like for you. I might have ideas.
You could push that all down to the accelerator, but if there are even a few such use cases you might want a dedicated DMA-capable implementation instead.
I don't have any concrete recommendations other than that one really good senior+ engineer is more important than a legion of juniors early on. Basic security doesn't require an extra hire; it requires somebody experienced enough to build your product right.
Also, so long as the function is non-negative for all inputs and positive for at least one you'll always get a valid probability distribution.
I don't think it's fully appreciated how much of the hard work of "synthesizing a new idea" is just combining existing ideas. LLMs have given me brand new algorithmic ideas with precious little in the way of a spark on my end to make that happen, and not just a few times either.
Mind you, that workflow is arduous and involves a huge amount of experimentation, screening through interesting but ultimately wrong ideas, screening through outright bad ideas the LLM can't help but spew out as well, and manually massaging the results into something useful. It exists though.
I'm not sure who "we" is in this story, but the _most_ optimistic of my peers pointed to typical MS projects of that scale having a little proper investment in interesting features and also taking at least a couple years to fail. HN sentiment wasn't positive either. The 99th percentile in favor of MS were fine with it, but the 90th percentile recognized the M&A for what it was, especially as specific features started showing their colours.
Lest this come across as a drive-by insult, I'm actually very curious who "we" is. Humanity is a very, very broad spectrum, and my intuition often doesn't appropriately capture the divers backgrounds of real people, despite spending large amounts of time with (usually from working alongside) deck-hands, captains, sanitation workers, bankers, pilots, jackhammer operators, semi drivers, farmers, programmers, mathematicians, and a host of other people. The gap I'm seeing is likely in my understanding (rather than, e.g., the post being mal-formed), so I'd like to correct that.
On the other hand, in economy on some planes I just literally don't fit in a forward direction because of femur length and cycling muscles, I don't fit in a sideways direction either because of broad shoulders and arm muscles, and I don't comfortably fit vertically on some planes with fixed-position headrests which push into the middle of my shoulder blades and have me hunched the whole flight.
I'm also not _that_ big. I'm 6'2" and have lived my life moderately actively. That's it. I'm biased, but I believe economy should be designed so that I can fit too.
If you agree with that premise, that'd leave plenty of space for most 250lb people too, and there'd be no reason to exclude them.
Recap: 1NN says that given a query Q you choose any pair (X,Y) from your learned "model" (a finite set of (X,Y) pairs) M minimizing |Q-X|. Your output is Y.
The following kind of argument works for linear interpolation too (you can even view 1NN as 1-point interpolation), but it's ever so slightly messier since definitions vary a fair bit, you potentially need to talk about the existence of >1 discrete "nearest" or "enclosing" set of neighbors, and proving that you can get away with fewer points than 1NN or have lower error than 1NN is itself also messier.
Pick your favorite compact-domain, continuous function embedded in some Euclidean space. For any target error you'd like to hit, the uniform continuity of that function guarantees that if your samples cover the domain well enough (no point in the domain is greater than some fixed distance, needing smaller distances for lower errors, from some point in your model) then the maximum error from a 1NN strategy is bounded by the associated error given by uniform continuity (which, again, you can make as small as you'd like by increasing the sampling resolution). The compact domain means you can physically achieve those error bounds with finite sample sizes.
For a simple example, imagine fitting more and more, smaller and smaller, line segments to y=x^2 on [-1,1].
So...T seconds have elapsed since your last frame, and you have a new data point you'd like to incorporate into your EMA (and, for this problem, that data point is T itself). You keep e^-(bT) of the old data, 1 minus that of the new data, and you're done. Alpha is indeed 1-e^-(b * cur_spf) for some constant b, just like the AI said.
Which b do you choose though? I usually prefer to think of it in terms of half lives. Let H be your desired half life, and set 1-e^-(bH) equal to 1/2. You get b=log(2)/H. That's similar to the AI answer, but it rescales window_secs into a parameter you can actually start to reason about. The AI answer gives you a 1/e life instead, which is a less comfortable constant to mentally process.
That answer also naturally generalizes to other "time" axes or denominators. Suppose you want to EMA using discrete events rather than wall-clock time. Replace T in your dynamic alpha with the discrete count of events you haven't updated the EMA with yet (e.g., if something happens every time tick you would usually take T=1, but you can increase that based on a few skipped frames or whatever if you'd like).
As a fun fact, you can tailor this sort of stateless solution to have almost any decay property you'd like. Start with your favorite ODE satisfying a few properties, and this equation falls out as the step a discrete solver would take to approximate the ODE.