Programmer at SpaceX. Past lives: wrote the companion AI of The Last of Us Part II @ Naughty Dog, more flight software and computer vision stuff. DMs open.
@jhorstmann23@despair No, the lowest n bits. mov rax, -1; bzhi rax, rax, rdi works for any n <= 64 and is what ideally would be generated but isn't.
Let's measure. Attached, vs. OP.
Lines after preprocessor expansion: 31 vs. 63,240 (https://t.co/nGYtIbNVB0, https://t.co/sB73vWSw5K)
Why does that matter? Here's one reason - compile time: 52ms vs. 1156ms (over a second!) (clang, -O3)
Runtime: 8.8x faster (input {1, 2, 3, 4, 5, 6}) (clang, -O3)
Codegen with compile-time inputs: turned into 1 line (mov eax, 57) at compile-time, vs. 275 lines of runtime code (https://t.co/wAJWHLa59p, https://t.co/mVxd7lCB4y)
Dependencies: none, vs. STL, CRT, allocators
Requirements: any C++ version since '98, vs. C++23, gcc14+/clang19+ and still doesn't work with clang stdlib even on clang trunk.
Debugging: examples of common tasks would be to step through the loop to understand or demonstrate the algorithm; breakpoint a particular iteration; go back to and repeat a previous iteration; alter inputs at a particular iteration. These are trivial to apply to a for loop but nonstarters for ranges.
Control: unroll the inner loop 4x. Interleave two inner loops. Change the vectorization width. These are trivial to apply to a for loop (pragma clang loop...)
It compares unfavorably in every measure.
The modern C++/Rust people cannot be saved. But if you're learning, and you see stuff like this post, and it doesn't quite seem right but they sure seem confident and you feel like maybe it's you and you're missing something... I want to tell you that you're not.
I'm about to do something I think I've never done before, which is assert every bit of whatever authority I have as the person who discovered and wrote down the rules of open source.
After ten years of drama and idiocy, lots of people other than me are now willing to say in public that "Codes of Conduct" have been a disaster - a kind of infectious social insanity producing lots of drama and politics and backbiting, and negative useful work.
Here is my advice about codes of conduct:
1. Refuse to have one. If your project has one, delete it. The only actual function they have is as a tool in the hands of shit-stirrers.
2. If you're stuck with having one for bureaucratic reasons, replace it with the following sentence or some close equivalent: "If you are more annoying to work with than your contributions justify, you'll be ejected."
3. Attempts to be more specific and elaborate don't work. They only provide control surfaces for shit-stirrers to manipulate.
Yes, we should try to be kind to each other. But we should be ruthless and merciless towards people who try to turn "Be kind!" into a weapon. Indulging them never ends well.
SpaceX: "We plan to launch more than 400 additional @Starlink satellites to the polar inclination by the end of 2025 alone, which will more than double the capacity for Alaskan customers alone, as well as other high latitude locations. The first of these additional satellites have begun to serve Alaskan users already, nearly doubling median peak-hour download speeds over the past month."
Starlink is committed to its mission to connect the unconnected to high-speed, low-latency internet.
Over the past year, as millions of new users have been added to the network, speeds and latency continue to improve โ https://t.co/WHcd8jCjaT
World's first autonomous delivery of a car!
This Tesla drove itself from Gigafactory Texas to its new owner's home ~30min away โ crossing parking lots, highways & the city to reach its new owner
But we need a heat shield that can handle Mars atmospheric entry conditions with a heavy payload, so the ballistic coefficient will necessarily be high. Steel is unfortunately hopeless.
No one has ever made a truly reusable orbital heat shield, so this is an extremely tough problem. [As you know] The Shuttleโs shields required extensive rework between flights.
It will take many more design iterations for SpaceX to make the shield work well. We had to build the entire supply chain from glass and alumina to finished tiles, which is why the SpaceX heat shield factory at the Cape is shockingly enormous.
@rflaherty71 On real hardware, pshufb was slow on AMD <= Jaguar and Intel Merom.
In the LLVM scheduling model, it's overly pessimistic about the latency of the folded loads of the constants until AMD Zen1 and Intel Haswell.