C++ Programming with No AI, LSP, or Debugger: Ep22 - Rectangles🎥Zed A. ShawWelcome to SwedenCpp
Latest blogs, videos, podcasts and releases in one stream
Monday, November 16, 2026
C++ Programming with No AI, LSP, or Debugger: Ep22 - Rectangles🎥Zed A. Shaw
MSVC Build Tools version 14.52 now generally availableMicrosoft C++ (MSVC) Build Tools version 14.52 is now generally available as a long-term support (LTS) release. It is available with Visual Studio 2026 version 18.12 on the Stable Channel and Visual Studio 2026 LTSC version 18.11, both released on November 10. With this release, C++23 is ready for production use through /std:c++23, and the […] The post MSVC Build Tools version 14.52 now generally available appeared first on C++ Team Blog .📝C++ Team Blog
Cognitive radiusThe most interesting change AI brings to software work is not faster coding. It is the expansion of context or range… what I call radius. For decades the job was defined by the limits of what one person could hold in their head. You tended to specialize. You got good at one or two systems, … Continue reading Cognitive radius📝Daniel Lemire's blog
C++ Weekly - Ep 559 - Computing Template Parameters🎥Jason Turner
C++26 Uncovered: Everything You Need to Know About the New Standard :: Inbal Levi🎥CoreCpp
Real-Time Control, Simulation, and Visualization in C++23 With CUDA and Unreal Engine - Kevin Gomez🎥CppCon
std::recursive_mutex Explained | C++ Multithreading #shorts🎥CppNuts
Constraining Templates Before and After C++20 - The What, the How, and the Why - Johannes Kalmbach🎥ACCUConf
Introducing Focusrite Group Japan - Takeshi Nishimoto & Kengo Shimizu - ADC Japan 2026🎥audiodevcon
::🎥CoreCpp
FFTs Part 3: Some Optimizations to the FFTThis is part 3 of a series of posts about FFTs and the specific algorithms that FFT-20XX uses. The Discrete Fourier Transform The Basics of the FFT Some Optimizations to the FFT (← you are here) The Inverse FFT The FFT-20XX Complex-Input Algorithm The FFT-20XX Real-Input Algorithm(s) In the last post we got to a basic implementation of the radix 2 decimation-in-time Cooley-Tukey algorithm . But there are still other additions and optimizations we can make before getting into the way FFT-20XX works. We’ll start by diving into the “radix 2” part of the algorithm: we can make improvements there. Butterflies Before we go into the specifics, I’m finally going to bring in a classic FFT diagram: the butterfly , an FFT data flow diagram. The most basic one is for a FFT of length 2, which has only a single step over two inputs. Here’s a diagram for the radix-2 decimation-in-time length-2 FFT (a 2-element version of the algorithm we derived in the previous post): Diagram of a 2-length FFT, showing the two inputs going into a single processing node, then back out to the two outputs. The second input node has a "0" representing the fact that it is unrotated. " 0 1 0 1 0 In this diagram, the inputs are on the left, each computation (just one, in this example) is represented as a small circle, and the outputs are on the right. The computation (for a decimation-in-time FFT) rotates its second input (the odd input, which is the bottom one in the diagram) by the given rotation value; in this diagram the rotation is just a 0 0 , but in general the value there will be some t t where the actual rotation angle is t / N t/N clockwise turns ( − 2 π t / N {-}2\pi t/N radians), where N N is the length of the FFT. Note The formatting of these butterfly diagrams is a little different than a standard butterfly diagram, which tend to look more like the following: A classic-style diagram of a 2-element FFT, with a "w" component on the second input showing it rotates 0/2 times, then gets added to the first input for the first output and subtracted from the the first input for the second output. w 0 2 -1 0 1 0 1 These diagrams are more comprehensive (the w N k w^k_N value makes the fraction of k / N k/N clockwise turns clear, where in my diagrams the “ / N / N ” is implied), it has a − 1 -1 multiplier on the lower input going into the sum circle (to signify that the bottom “sum” is a difference), and the sums are each on their own line as opposed to a central circle that represents the add/subtract pair, but in practice — especially on lower-resolution displays — my variant is, imo, less visually noisy. Plus, once you get into the higher radixes, even the standard diagrams start to be drawn more simply. Now here’s one for the decimation-in-time length-4 FFT (where the bit reverse is performed on the input): Diagram of a 4-element FFT, showing how the even inputs and odd inputs combine with each other in the same way the 2-element FFT's do, then how the results of those interleave to create the final outputs. 0 2 1 3 0 1 2 3 0 0 0 1 There are two “stages” in this radix-4 FFT (two runs of the outer loop of the code), which are separated via the vertical dotted lines. Really, though, this is four of the previous (length 2 FFT) butterflies bolted together, first with two separate 2-element computations (the first pass) followed by a single 4-element computation loop (the second pass, itself just two 2-element computations stacked on top of each other wearing a trench coat). Finally, here’s a butterfly diagram for a full 16-element FFT: A more complicated diagram of a 16-element FFT, showing the four "stages" of processing and how they interleave. 0 8 4 12 2 10 6 14 1 9 5 13 3 11 7 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 0 0 0 0 0 0 0 0 4 0 4 0 4 0 4 0 2 4 6 0 2 4 6 0 1 2 3 4 5 6 7 There are four stages in this one (since log 2 16 = 4 \log_2\,16 = 4 ), and note that you can still see the structure (discussed in the previous post) of eight 2-element computations in the first stage, then four 4-element computations in the next, then two 8-element computations, then a single 16-element computation. Also note the rotation angles in each stage: the last stage has rotations 0-7 (corresponding to 0 / 16 0/16 to 7 / 16 7/16 turns), the previous one has just the even numbers, the one before that just 0 and 4 (every other even value), down to no rotations in the first stage. This is true in general (and if you look at the code we derived in the previous post, you can see the same relationship) where the last iteration has the most rotations, the next-to-last has half as many, and so on. Now, here’s a diagram that we made in the previous post, showing a 16-element FFT in a sort of “index flow” way: A diagram from the previous post showing the way the indices interleave at each step as they flow through the FFT. 0 8 4 12 2 10 6 14 1 9 5 13 3 11 7 15 0 8 4 12 2 10 6 14 1 9 5 13 3 11 7 15 0 4 8 12 2 6 10 14 1 5 9 13 3 7 11 15 0 2 4 6 8 10 12 14 1 3 5 7 9 11 13 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Hopefully, the similarity between this diagram and the previous one is apparent: they’re diagramming the same process, but with different goals (the latter showing the indices flowing through the system, and the former showing the flow of values and the angles used to compute them). So, now that we (hopefully) have an understanding of these diagrams and what they represent, it’s time to move on to the first optimization: a higher radix. Doubling the Radix We went with a radix-2 breakdown in the last post because it’s the most straightforward, but there are others. The one we’re going to focus on here is radix-4 , which, in contrast to the above 16-element butterfly diagram, would instead look like the following (don’t worry about the specifics of the rotation values or what this four-in/four-out computation node is doing yet — we’ll get to that shortly): A diagram of the same 16-element FFT as before, except this time as a radix-4 transform, with every 4 inputs combining together, then those combining in a second pass to generate the final outputs. 0 8 4 12 2 10 6 14 1 9 5 13 3 11 7 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 0 0 0 0 0 0 0 0 0 0 0 0 2 4 6 0 1 2 3 0 3 6 9 The first things worth noticing here are that there are now half as many passes over the data, and each computation handles four values at a time instead of two. This will end up being more efficient in a couple different ways. The main efficiency gain is that doing half as many passes means it halves the number of reads from and writes to memory , which as the FFT lengths get larger can make a big difference in how often there are cache misses. Second, it is possible to reduce the number of rotations needed by 1 4 \frac{1}{4} , which can also make a difference on some CPUs (but not all, which we’ll get to). To derive a radix 4 solution, you could go back to the original equation, split the inputs into four interleaved sections (where k m o d 4 k\mod 4 is 0 0 , 1 1 , 2 2 , and 3 3 respectively), then split the outputs into quarters, and redo all of the rotation shenanigans that we did when deriving radix-2. Nah . I’m not doing all that. Instead, we’re going to start with the radix-2 diagram and build up to what that four-in/four-out computation looks like. Every pair of radix-2 passes can be turned into a single radix-4 pass, so let’s start by highlighting a couple such groupings in our radix-2 diagram: The diagram of the 16-element radix-2 FFT again, but this time with the first two stages for the first 4 inputs highlighted in blue, then last two stages corresponding to outputs 2, 6, 10, and 14 highlighted in red, showing them both as being topographically the same, despite the spacing difference. 0 8 4 12 2 10 6 14 1 9 5 13 3 11 7 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 0 0 0 0 0 0 0 0 4 0 4 0 4 0 4 0 2 4 6 0 2 4 6 0 1 2 3 4 5 6 7 Each of the groupings of “two pairs of radix-2 passes that all use the same 4 values” can be represented generically as: A diagram similar to the earlier 4-element radix-2 FFT one, showing that inputs 2 and 3 get rotated by 2t, then the outputs of the inputs 1 and 3 computation get rotated by t and t + N/4 respectively before going into their final passes. '0' '2' '1' '3' '0' '1' '2' '3' 2t 2t t t+ N ― 4 Note the similarity between this and the 4-element butterfly diagram we made earlier: this is essentially just a generalized version of that. The input/output indices are relative to the position in the FFT, but note that the middle two indices are in the opposite order as the output indices: this will always be true when we’ve done the bit reverse at the outset, and remains true no matter which intermediate step we’re on (i.e. it just automatically happens that way). Also note that the angles themselves are relative, too: there will be some base angle t t that the other angles are relative to, and we’ll set it as the first angle in the second radix-2 pass (the t t just to the right of the middle line). As examples, in the first highlighed group at input indices 0, 8, 4, and 12, t t is 0 0 , and in the second at output indices 2, 6, 10, and 14, t t is 2 2 . Both angles in the first radix-2 pass are double this t t value (both labeled 2 t 2t ), and the second angle in the last pass is always a quarter turn more than t t (labeled t + N 4 t + \frac{N}{4} ). To get from here to a full radix-4 computation, we can rearrange the angles a bit to get something equivalent: Diagram of the same transform as the previous one, but with the angles rearranged. This time inputs 1, 2, and 3 get rotated by t, 2t, and 3t respectively, then the second output of the 1 and 3 transform gets rotated a quarter turn. '0' '2' '1' '3' '0' '1' '2' '3' 2t t 3t N/4 The Math We do this by splitting the t + N 4 t + \frac{N}{4} apart at the addition, making it a rotate by t t then a separate rotation of N / 4 N/4 . We can then distribute the common rotation by t t back to the first stage and do them on inputs ‘1’ and ‘3’: input ‘1’ had no rotation so it ends up with a rotation of t t , and for input ‘3’ the t t combines with the 2 t 2t it already had to make a single rotation of 3 t 3t . The N / 4 N/4 turn (a 90-degree clockwise rotation) can be done without any sine/cosine multiplications at all (it transforms a + i b a + ib into b − i a b - ia ), so this is mathematically more efficient: it does 3 rotations on three inputs at the start of the process instead of 4 rotations split between the first and second inner radix-2 stages. The number of adds/subtractions remains the same, but that’s okay: there’s no way to reduce it any further. This, then, is what becomes the computation node of the radix-4 butterfly diagram we made above! Here is the equivalent radix-4 diagram to the previous diagram (which hides the internal complexities, including the effectively-free quarter turn): A 4-element radix-4 diagram showing the same t, 2t, and 3t rotations as the previous diagram, but instead as a single radix-4 process instead of 2 separate radix-2 passes. '0' '2' '1' '3' '0' '1' '2' '3' 2t t 3t Note An implementation detail worth mentioning here: on some systems using the first 4-element breakdown from above (the radix-2 one with the t + N 4 t + \frac{N}{4} term) can be more efficient! There are systems that have FMA instructions (the fused multiply-add ) which have a cost close to doing either a multiply or an add by itself (x64 CPUs with the FMA extension — like most with AVX2 instructions — have this property). Doing it that way (which is sometimes referred to as radix- 2 2 2^2 ), even with what seems like an extra complex multiply, can end up being cheaper due to less overall operations and one less required angle (the 3 t 3t angle isn’t required, using t t and 2 t 2t is sufficient). There’s a breakdown of this trick on The ryg blog: Notes on FFTs: for implementers . Here’s the 16-element radix-4 diagram we used earlier, with our same two radix-4 sections highlighted: Diagram of a 16-element radix-4 FFT with the same corresponding "blue" and "red" highlighted paths as in the earlier radix-2 diagram. 0 8 4 12 2 10 6 14 1 9 5 13 3 11 7 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 0 0 0 0 0 0 0 0 0 0 0 0 2 4 6 0 1 2 3 0 3 6 9 Note This formulation of radix-4 is slightly different than the canonical one, which has a different “scrambled” input or output order from the bit reverse that we’re using. In that case, the reordered indices are reversed pairs of bits: for instance, an 8-bit binary value with bits 01234567 would becomes 67452301 instead of 76543210 . Instead, we’ve kept the radix-2 style bit reverse, the consequence of which is the reversal of the middle 2 inputs in the above diagrams (with reversed bit pairs , those would be in proper order, and the angles would instead be t t , 2 t 2t , and 3 t 3t , respectively). Now, hopefully, it’s clear why the angle values are the way they are in this diagram. The first stage has no rotations (except for the effectively-free 90-degree rotation), and the second stage has four computations with increasing rotation values of the form 2 t 2t , t t , 3 t 3t . The only issue with using the radix-4 algorithm is that it only fully works on FFTs with power-of-four lengths (because it splits in fours each time, so it works for length 4 but not 8, 16 but not 32, etc). The good news is that the way we’ve formulated it (by effectively smooshing together two radix-2 passes into a single radix-4 pass), you can just put a single radix-2 pass in there to make up the difference … and it doesn’t even matter where! Here is a length-8 FFT where the first pass is still radix-2 but the second is radix-4: Diagram of an 8-element FFT where the first pass is done as radix-2 and the last is done as radix-4. 0 4 2 6 1 5 3 7 0 1 2 3 4 5 6 7 0 0 0 0 0 2 0 1 0 3 And here’s the same length-8 FFT the other way around: radix-4 then radix-2: Diagram of an 8-element FFT where the first pass is done as radix-4 and the last is done as radix-2 (the opposite ordering as the previous diagram). 0 4 2 6 1 5 3 7 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 1 2 3 For longer FFTs, the radix-2 pass can be anywhere in the middle, as well - whatever is most efficient for your implementation! I found it easiest to place it right after the very first radix-4 pass (i.e. like that last diagram), mostly for simplicity. Other Radix Flavors So if radix 4 is more efficient than radix 2, that raises the question: are there other, even more efficient radixes? radix-8? radix-16? How far is too far? Well, radix-4 is the largest power-of-two radix that has “free” rotations in the middle (that quarter turn). Radix-8 has some 45-degree-multiple rotations in the middle, which still require some multiplication. However, because both cosine and sine of 45 degrees (and related friends) are both 2 2 \frac{\sqrt{2}}{2} , the multiply can be done as a common factor so it still is somewhat more efficient. The problems with radix-8 tend to have to do with CPU register limits: you need to load 8 complex values (so 16 scalars), then (similar to how radix-2 needs 1 rotation and radix-4 needs 3) it tends to need 7 complex twiddles plus the 2 2 \frac{\sqrt{2}}{2} internal value (so another 15 scalars) and you tend to also need some scratch registers as well to do computations. AVX and AVX2 only have 16 SIMD registers so even before you get to the angles you’ve already run out of register space. AARCH64 has 32, so you could maybe squeeze in there, but it would be tight. Plus you’re going to be up against CPU cache associativity for systems with eight-way associative caches, because you’re loading from 8 locations but also need to be loading the angles from somewhere. Past radix-8, you’re out of register space, hitting CPU cache limits, and also have more internal rotations, so it’s going to perform way worse under most circumstances. Note One place where it’s really tempting to use radix-8, however, is on the very first decimation-in-time step, which has no twiddles (all seven of the twiddle angles are 0), and thus only has those nice-to-compute internal 45-degree rotations. However, the register limits are still an issue and, depending on how you have to load your values (i.e. for SIMD purposes you may want to do a deinterleave to separate the real and imaginary components), you may still not have enough register space. But it’s worth considering, if you can. There is another radix option worth mentioning: the split-radix FFT algorithm , which I’m not going to detail here (because it’s complex and weird). In terms of required math operations, the split-radix algorithm gets you to some of the lowest-known possible operation counts. Unfortunately, in practice, I found that it breaks up the nice regularity of using just a standard radix-4 algorithm and ultimately — at least in my attempts at implementing it — had worse performance overall. Okay, we’re through all of the radix shenanigans! Lookup Tables The last thing to touch on in this post is doing lookup tables for the angles . These tend to be exactly what they sound like: you precompute a table for your required FFT length that contains all of the sin/cos values needed for that length. The simplest lookup table is one where you have N 2 \frac{N}{2} cos/sin values ( 0 0 turns through N 2 − 1 \frac{N}{2} - 1 turns), in order. However, there are some potential ways to make the table a little more efficient (with size, cache-friendliness, or both): In many implementations, you don’t need both N 2 \frac{N}{2} cos \cos and N 2 \frac{N}{2} sin \sin values: because cos ( t ) = sin ( π 2 + t ) \cos(t) = \sin(\frac{\pi}{2} + t) , you can store 3 N 4 \frac{3N}{4} scalar values and start the cosine lookup partway into the table, and use 1 4 \frac{1}{4} less memory. If you’re doing radix-4, you can avoid storing the 3 t 3t angles and instead compute them using the t t and 2 t 2t rotations, which saves a bunch of table space. This may sound like you’re adding a complex multiply back in after eliminating it, but you can likely move that computation into an outer loop so it isn’t an issue. It can also be convenient — for SIMD loads and CPU cache-friendliness — to store not only the angles in order for size N N , but to store all of the table sizes from some minimum length (like 4 or 8) up to your max length. Doing this is nice because it means you can build a single table for your maximum required FFT length and it will perform just as well for any smaller FFT lengths as well. Also, the earlier passes of the algorithm can take advantage of these smaller tables (the second radix-2 pass only needs the angles for a length-4 FFT, and the next only needs the angles for a length-8 FFT, etc). Loading from them can help with CPU cache coherence (as all of the required angles at that level are contiguous), plus SIMD loading if you need multiple angles within a single pass. For FFT-20XX I found all of the above bullet points to be useful. What Now? No code this time, but using the above tricks (namely: using radix-4 instead of radix-2 where possible and switching to lookup tables for the rotations) gets you to a somewhat decent baseline FFT implementation! There are many more places to optimize: figuring out SIMD support and optimizing the bit reversal pass (or — spoiler alert — eliminating it altogether). We’ll get to those once we finally get into FFT-20XX’s algorithms. Before that, next time, we’ll touch on the decimation-in-frequency version of the algorithm on our way to finally talking about the inverse FFT and how to compute it!📝JoshJers' Ramblings
I'm joining Google!I have some exciting career news to share: I'm joining Google as a Staff Software Engineer, working on YNNPACK and Slinky ! If you haven't heard of them before, YNNPACK is Google's next-generation neural network inference engine (succeeding XNNPACK ), and Slinky is the Halide -inspired loop scheduling and dataflow runtime at its core. Where XNNPACK traditionally optimized whole operators one by one (across a large combinatorial space), YNNPACK schedules low-level microkernels with Slinky to automatically fuse loops across subgraph boundaries, improving memory locality and reducing synchronization overhead.📝Alex Reinking
C’s designated initializers give us named argumentsIn my previous post I talked about C++’s “relatively nerfed” form of designated initializers. This time I want to show you a neat thing you can do with C’s full-power designated initializers. I first saw this pattern in Ben Klemens’ book 21st Century C (2014), pages 226–228. (Godbolt.)📝Arthur O’Dwyer
How my friends and I play DoppelkopfOtto Dix, Die Skatspieler (1920). Neue Nationalgalerie, Berlin. Via Wikipedia. Alright, get it twisted, if you are for whatever reason reading this post without having read You should learn to play Doppelkopf , then you should rectify that immediately. This here is a follow-up that goes into the rules my friends and I play by. Each table has their own house rules (and that’s a good thing). This post will not teach you how trick-taking works . You should already understand trick-taking going into this! If you don’t, it’s going to be confusing. As in the last post: Doppelkopf (IPA: /ˈdɔpəlˌkɔpf/ , EN: ‘Double-Head’) is a German four-player trick-taking card game. Each card appears twice. Two players vs. two players (usually), with one team formed by the two players holding the Queens of Clubs. It also has a whole pile of bonus rules and complexity. In the following, I’ll go over the core rules that you need to play the game. I will try to introduce them in a way that makes sense. On the side, I will comment on the rules. If you ever think “Jeez, this Mond fellow is doing an awful job, this is so confusing,” please trust me when I say that most Doppelkopf tutorials online are worse. Card games are best learned in person . If you don’t have anyone who can teach you, Doppelkopf.club might be your best bet. Owned by an enthusiast, no sign-ups or other nonsense. Outline Complete Saxonian deck. Photo by Moddin, CC BY-SA 3.0, via Wikimedia Commons. In Doppelkopf all cards are dealt at the start of the game (this is normal for trick-taking games). To assemble a Doppelkopf deck, take two “standard” French decks of cards. Remove all number cards of value 8 or lower, and all jokers. That’s a Doppelkopf deck. Don’t play with German-suited cards , just use the French ones. Every player gets 12 cards, and unless a player has reservations, you are ready to start playing. No cards are ever drawn , so the game consists of exactly 12 tricks 1 . The outline of the game is the following: Gather 4 players. Shuffle the deck, and hand every player 12 cards. No cards should be left. Each player looks at their hand and decides whether they have “reservations” or they are “healthy”. This part you should completely ignore until you’ve played several normal rounds. “Reservations” are special conditions that depend on your hand and that alter how the game is played. The person to the left of the dealer plays a card, opening the first trick. The other players follow suit in order. The winner of the trick opens the next one. Team membership is determined by whether you have a Queen of Clubs or not. The two players holding the Queens of Clubs are the ‘ Re ’ team. The other two players are the ‘ Kontra ’ team. You do not know who is on which team until the Queens of Clubs have been played . After all 12 tricks have been played, each team scores all tricks they won. There are 240 points total. The team with more points wins. If it’s 120:120, the Kontra team wins. If you’re so inclined, you can keep track of ‘meta-points’ across multiple games. This only makes sense if you play regularly. This makes it reasonably simple. Once you know the rules, you just hand out the cards, and can immediately start playing. Announcing reservations is a form of bidding (i.e. you have the option to make the game harder for yourself, in return for more meta-points), but I recommend that you just ignore that completely. Are we bad at the game? Yes, probably. Are we having fun? Also yes. This is one of my pet drums, so forgive me for beating it: Social games like Doppelkopf are made to be fun. The play at our table is almost certainly not optimal, and other Doppelkopf players would probably disagree with our house rules. We like that it’s possible to just hand everyone 12 cards and jump straight into a game, without having to worry about cross-game scoring, or every player having to spend time evaluating how good their hand is. Other groups may disagree. The Game Once all cards are dealt, and players have announced whether they have any reservations, the trick-taking phase of the game starts. At this point, bless our stupid, whimsical hearts, my local group of players will start hollering and shouting all sorts of obscenities, and use language that’s decidedly non-standard. For example, ‘playing a Queen of Clubs’ reveals which team you are on. Consequently, my local group frequently dubs this act ‘coming out’. You can imagine how this would easily lead to a ‘gay’ and a ‘straight’ team, and we are using this terminology with nothing but whimsy and fondness in our hearts. Anyway. Let’s cover the numbers. As I said in my previous post , trick-taking games usually differ on 1) card ranking and trumps, 2) card scoring to determine the winner, 3) meta-points (i.e. how points are scored across games). You may hate what comes next. Doppelkopf is a European game. Worse, it’s German . As such, the scoring is ever so slightly more complex than it needs to be. (But trust me, it’s not nearly the worst of the bunch, and there are good reasons for it.) Before we start, internalize that: Whether a card “beats” another card is unrelated to the points the card scores at the end of the game. The points you score throughout the game are not the same as the meta-points you score between games. The game points determine whether you win the game. Meta-points are tracked separately, across games, to determine who wins across a season of Doppelkopf. Card Ranking In Doppelkopf (and Skat) Tens are ranked higher than Kings . So the order of, say, Spades, comes out to: Ace, Ten, King, and Nine . Next, let’s talk about trumps. Doppelkopf is a game with a lot of trumps . In fact, most of the cards are trump (this is funny, and part of what makes the game unique). The order of the trumps (high to low) is as follows: Ten of Hearts (‘Dulle’). All Queens, in order Clubs, Spades, Hearts, Diamonds. All Jacks, in order Clubs, Spades, Hearts, Diamonds. All remaining Diamonds ( Ace, Ten, King, Nine ). 20’s Love. We love the Ladies. Jackin’ off. Diamonds are Unbreakable. No Kings 2 . That’s how my friend remembers the order, anyway. At the start of the game I recommend sorting trumps separately, to make it easier to keep track of them. And yes, the Ten of Hearts and the Diamonds are “special”, in a sense. These are the trumps. This order is strict, i.e. any high trump beats any low trump. If we both play Jacks, the higher Jack wins. If we both play the same Jack, the first card beats the second 3 . This is true whether you’re playing the trump suit or a different suit. Of course, trumps always beat non-trumps. Scoring At the end of the game, look at all cards your team won. Then, add up the points according to the following list: Ace: Worth 11 points Ten: Worth 10 points King: Worth 4 points Queen: Worth 3 points Jack: Worth 2 points Nine: Worth no points In other words, Aces and Tens are valuable . Try to capture them. That’s how you win. In total, there are 240 = 2*4*(11+10+4+3+2) points. You win with 121 points. On a tie, the Kontra team wins. Often you just count the points of the team that obviously won fewer tricks. This sounds horribly annoying , but it’s really not that bad. Counting happens quite quickly once you’ve done it a few times. This is all you need to know to play the basic game of Doppelkopf. At this point, I would recommend doing exactly that, if you have someone to play with. What follows next is rules for what happens when someone is dealt both Queens of Clubs, special cases, house rules, and meta-scoring. Reservations & Weddings I’ll talk about the types of reservations we care about in my small, local group. Half a Chicken The most important reservation of all. If you hold the two Tens of Diamonds, you may announce half a chicken. Announcing half a chicken does absolutely nothing, but a true gentleman should do it regardless. When new players are introduced, it’s critical to haze them about not knowing what ‘half a chicken’ is. Schweinchen / Swine / Piglets If you hold the two Aces of Diamonds, you may announce Schweinchen. Announcing Schweinchen makes the Aces of Diamonds the highest-ranking trumps in the game. They become a new tier above the ‘Dullen’ (the Tens of Hearts). This is not balanced, and frankly, probably a bad rule. However, it is pretty funny, especially if you allow Double Swine (two Nines of Diamonds) and Triple Swine (two Tens of Diamonds), which may be announced by other players, and have to be announced in order. In other words, if you announce Swine, there is a risk that another player may announce Double Swine, making their trumps even stronger than yours. This is firmly in the category of house rules. House rules are part of what makes these games good. We’re still inventing our own. Weddings It’s possible that one player ends up holding both Queens of Clubs, making them their own partner. They have three options: Play a ‘silent solo’. No announcements, they just secretly play a solo against the other players. This is difficult, but the other players may be confused, giving them an advantage. Play a loud solo. They announce that they are going to play a solo game. This triples their meta-points , but is much harder. Announce a wedding. This is the default, and allows them to find a new partner. When a wedding is announced, the new partner is chosen as follows: The first player (other than the Re player, i.e. the player holding the two Queens of Clubs) to win a trick during the first three tricks becomes the new partner. If, however, no one else wins a trick, then the Re player is forced to play a solo. In other words, the other three players get the opportunity to deny the Re player by consistently making them win their first three tricks. However, each of the other players has an incentive to be this person’s partner. The two Queens of Clubs are strong trumps, and the Re player may already have won one or two tricks. The players may backstab each other to ‘marry’ the Re player. Tradeoffs! Everything up to this point has been ‘Doppelkopf-lite’, i.e. the version with no meta-scoring across games. Meta scoring doesn’t really matter unless you have a group you consistently play Doppelkopf with. If you really insist, Solos During the bidding / reservations phase, you are allowed to announce a solo. Solos are hard, so it’s only worth it if you have a strong hand. In the meta-scoring system, winning a solo nets you thrice as many points. Here are the solos you are allowed to announce: Jack solo: Only Jacks are trump. Queen solo: Only Queens are trump. “Meatless” solo: No trumps exist. Suit solo: Tens of Hearts, Queens, Jacks, and a suit of your choice are trump. A Diamond solo has the same trumps as the normal game. Scoring across Games Bavarian-pattern Tens. Photo by Bermicourt, CC BY-SA 4.0, via Wikimedia Commons. My local group doesn’t score points across games. I could take it upon myself to push them on it, but I’ve won a good number of games so far. Tracking a list of my own victories would not improve the experience. Besides, we try a lot of different games. Doppelkopf has been the best one so far, but it’s hard to tell if we’ll truly stick with it over, say, other card games, TTRPGs, or what have you. What I’m saying is, sorry, I don’t actually do the meta scoring as often as a True Doppelkopf player should! Let me do my best at explaining the scoring. I can give you the fundamentals, but you should look it up if you want to take this seriously. The rough idea of scoring is that Doppelkopf is zero sum . The winning party gains points, the losing party loses them. Therefore, if you win a solo, you’ll get thrice as many points. That makes solos worthwhile, even though your odds of winning are dramatically lower. You start with one point for a won game. If the Kontra party won, you add another point. Then, you get an additional point for each 30 points you are above 121. Taunting You get to taunt . The first taunt pre-announces that you expect to win. After that you pre-announce that the enemy team will receive fewer than X points. en the official rules, you taunt by announcing “Re” or “Kontra” (depending on team). This raises the stakes by two points. Any enemy may counter, raising the stakes by another two. Announcing “No 90”, “No 60”, “No 30”, or “Schwarz” raises the stakes by one point each, but also requires you to meet that bar . This means: You have to beat the opposing team, and they MUST have fewer than X points (or in case of Schwarz, win zero tricks). If you fail to achieve this, you lose the round. Taunting is an incredible mechanic. If you are confident, this increases your payout. If you are too confident, you will lose a lot more points than you otherwise would have. Taunting is only allowed early in the game, otherwise you’d just do it when you already know that you are going to win. “re/kontra” must be called while you’re still holding 11 cards. No 90 requires 10 cards, No 60 requires 9, etc. After you taunt, the opposing team always gets at least one more turn to respond. What I hate about taunting Taunting allows you to announce your team affiliation. This is morally wrong: The best part about Doppelkopf is that team affiliation is unknown, and only revealed when you play a Queen of Clubs . Calling Re or Kontra raises the stakes , so it has consequences on the game, but it still feels wrong to me. Ideally, you should be able to announce “my team is going to win” without declaring the name of the team. Of course, the problem is that (ideally) the opposing team responds by taunting back. Here this seems unlikely, since they don’t even know whether they are on your side or not! I am still trying to figure out if there is a way to resolve the conflict, or if it is a problem at all. If you have strong opinions on this, send me an e-mail. Currently I understand the rules as follows: If you track meta-points, you can taunt. Taunting announces your team membership, but it requires you to raise the stakes. You cannot announce membership otherwise. If you are not tracking meta-points, you are not allowed to taunt (or announce team membership). Bonus Points In Doppelkopf, we love our bonus rules. If you capture the enemy team’s fox (i.e. their Ace of Diamonds), the stakes are raised by another point. This can happen multiple times if the opposing team has both Aces of Diamonds. If you win a so-called “Doppelkopf” (40+ points in one trick), that’s another point. If you win the last trick of the game with the Jack of Clubs, that’s another point. Conclusion My local Doppelkopf group finds the game, and its pile of whimsical bonus rules, incredibly entertaining, but yes, that’s all just us being weird. I’d like more people to give these games a try (Doppelkopf, or Bridge if necessary). They are better than you’d think. They are social. Fun. Different. And it’s so easy to carry a deck of cards with you at all times. In my friend group we “stay strapped” (carry decks of cards at all times). Are you worried about an increasingly atomized society? Or the loss of third places after skimming ‘Bowling Alone’? Carry a deck of cards. Go grab coffee with your friends, then social-mog everyone by whipping it out and playing. Grab two or three friends and dress up nicely, go to a nearby jazz club, then invite strangers to play 4 . Be the change you want to see in the world. This is part of what makes these games work! Because no one ever draws new cards, you can learn when someone is “out of hearts”, and there’s no risk they’ll just draw a new heart. ↩︎ Other than the King of Diamonds. ↩︎ The best Doppelkopf includes plenty of house rules, and here we have one important exception: The second Ten of Hearts beats the first. This ‘balances’ the strongest trump in the game, and requires more tactical play. This house rule is then balanced out with another: The second Ten of Hearts beats the first except on the final trick of the game , ensuring people are careful about holding on to their card. ↩︎ This is on our to-do list. ↩︎📝MOND←TECH MAGAZINEIf this page is useful, please consider donating a coffee
Sunday, November 15, 2026
Lightning Talk: Our Most Treacherous Adversary - James McNellis - C++Now 2026🎥CppNow
What really kills C++The C++26 ballot failed, and everyone is arguing about contracts and the future of C++. I think we're worried about the wrong thing.📝Engineering the Craft
Can AI Make a Multiplayer Game?🎥The Cherno
You should learn to play DoppelkopfJosef Wagner-Höhenberg, Die Skatpartie (before 1939). Public domain, via Wikimedia Commons. Doppelkopf (IPA: /ˈdɔpəlˌkɔpf/ , EN: ‘Double-Head’) is a German 4 player trick-taking card game which you can play using two standard decks of cards. It’s a 2 vs. 2 player game, where one team is formed by the two players holding the Queens of Clubs (meaning that partnership is secret at the start of the game). What if one player holds both Queens of Clubs? Why, they get to play a solo, or they get to announce a ‘wedding’, which results in a prisoner’s dilemma auction to determine who becomes their partner (if anyone). This sounds complicated, but is actually incredibly funny. It is the best card game I ever played. Better than Uno, Oh Hell, Rummy, Cuttle, Schnapsen, Poker, Sheepshead, even Skat or Bridge 1 . The jury is still out on whether it’s better than 找朋友. You might ask “Why would anyone in their right mind learn how to play an obscure German two hundred year old card game? One that requires exactly four players, no less?” Because it’s good. The social component is delightful. The meta-scoring is great, if you are into that (you gather ‘meta-points’ across games, and benefit from raising the stakes to increase your payout). It’s whimsical (players may announce “half a chicken”, which does nothing other than give other players free information about your hand), and there’s a real difficulty of tracking the cards that have been played, and which the other players are holding. You might not have the right people in your life to play Doppelkopf with, but your life would almost certainly improve if you did. To get there, maybe consider taking the first step, and being the person who shows up strapped with a deck of cards to the local function. Doppelkopf or otherwise, you should learn how to play card games that are actually fun . Teaching Doppelkopf is, unfortunately, a bit tricky. It’s best taught in person. In this post, I will teach you how to play general trick-taking games like Bridge, Doppelkopf, or Skat. Trick-taking is the core gameplay loop. Once you understand trick-taking, the rest is meta progression and fluff. In ‘How my friends and I play Doppelkopf’ I explain how my friends and I actually play Doppelkopf. In the meantime, if you strictly want to learn Doppelkopf, I recommend Ham Vocke ’s project Doppelkopf.club . Ham is a programmer, presumably even more passionate about the game than I am, and Doppelkopf.club allows you to play against bots online. Trick-Taking Doppelkopf is a trick-taking game. This distinguishes it from shedding games (such as Uno). In shedding games, your goal is to shed all of your cards onto the discard pile. In trick-taking games, your goal is to score points by winning as many “tricks” as possible. A “trick” consists of a single round along the table. Each player puts down exactly one card (in order), following the suit of the first player, if they are able to . The highest-ranking card wins. The winning player then “takes” the cards and puts them face-down on their side of the table. They then open the next trick. How do you determine which card wins? Basically, the highest-ranking card is the highest-ranking trump (if a trump was played), and otherwise the highest-ranking card of the first player’s suit . By the way: The phrase “to follow suit” has its origin in card games. In all trick-taking games you “follow suit”, and the suit changes every trick. What if the first player opens with a trump card? Then everyone has to follow with trump, if they can. The right way to think of trumps is as “belonging to their own suit”. Doppelkopf has a lot of trumps, including all Queens and Jacks. As an example: If you have a 10 of Spades and a Jack of Spades and the first player opens with Spades, you are not allowed to play the Jack of Spades. Why not? Because it’s part of the trump suit. It doesn’t count as Spades. (Yes, that part is important, but also confusing.) Example 10 J A 9 A Q A 10 K B J 9 A K C Q 10 9 A D K 1 9 2 10 3 J 4 Player A opens the trick. They get to play any card they want. They play a King of Clubs . Player B has clubs, so they have to play clubs. They play a 9 of Clubs . This card ranks lower than the King of Clubs . Player C does not have any clubs . Therefore, they get to play a different suit. (This may be good or bad for them.) They play a 10 of Spades . This card is not a trump, and not a Club , so (in this trick!) it also ranks lower than the King of Clubs . Player D does not have any clubs . Therefore, they get to play a different suit. They play a Jack of Diamonds . In Doppelkopf and Skat all jacks are trump. Therefore, the Jack of Diamonds ranks higher than the King of Clubs , and Player D wins this trick. This is the core gameplay loop of many different games. This is most of what you need to understand. After every player played a card, the winning player (D, in our example) claims them. They all contribute to their score at the end of the game. Finally: The winner of the trick (D) is the person who gets to play the first card of the next trick. This loop repeats until everyone is out of cards. That’s it! That’s the whole game. “Every” trick-taking game follows exactly this format, with minor variations (such as which cards are trump, and how tricks are scored at the end of the game). Why is this a good core gameplay loop? Each time you play a card, you are gambling on which cards the other players have. However, as the game goes on, because players are required to follow suit, you are obtaining a lot of information about their hands. Through this the game rewards tracking which cards have been played, and which players are out of which suits. This then allows you to gauge whether you can safely win a trick or not. This will take some time to develop a feeling for. For the record: I don’t count cards! I do it by feelings and vibes. You can probably beat me! In Doppelkopf specifically, the hidden partnership makes this even more engaging. If you are winning a trick, you want your partner to “throw in points” 2 , such that your team can secure them. Here is a common tactic: At the very start of the game (if you’re leading), play an Ace of Spades. If every player has a Spade (reasonably likely), you win this trick by default, since the Ace of Spades is the highest Spade, and none of them can play a trump. This is fairly safe, and earns you a good amount of points. There’s just one problem: At the start of the game team membership is unknown, so your partner is not going to throw in any points. This is a tradeoff. This is good game design. What’s left? Once you understand trick-taking, it will be easy for you to pick up any trick-taking game. That includes Bridge or Skat or 找朋友. (Or Oh Hell!, but it’s not very good.) Now, the next part is where trick-taking games differ. First , trick-taking games disagree on which cards are trump (or more generally, on which cards “beat” which other cards). Second , trick-taking games disagree on how tricks are scored at the end of the game (i.e. how do you determine who wins). Third , trick-taking games disagree on the meta-scoring, i.e. on how points are counted across multiple games . This is only relevant if you repeatedly play with the same group of people. Each game will have slightly different opinions on each of these, on top of its own little quirks and oddities 3 . Bidding Finally, most trick-taking games have some sort of bidding process. Bidding happens after cards are dealt, but before trick taking starts. During bidding, the players estimate how good their hand is, and then compete for getting to play. (In Skat and Bridge, this is how the “attacker” is determined. In Doppelkopf, this is where solo games are declared.) The bidding process is completely inscrutable to new players, and widely considered to be the hardest part of the game. You need to be able to estimate how good your odds of winning are before you have even played the game . Your “bid” will allow you to choose which cards are trump, and influences how many meta-points you win (or lose!) at the end of the game. Content Warning: A Skat Reiztabelle Standard German Skat Bidding Table. You might be laughing nervously, but the chart follows a predictable pattern. It’s not as bad as it looks. tl;dr: Count how many consecutive jacks you have (or how many empty consecutive slots you have) starting from the first. Then, you add +1, and multiply the result with a ‘base value’ for the suit (or 24 for the ‘grand game’ which has no trumps other than Jacks). Still, it’s intimidating! If my case for trick-taking games was remotely compelling, and you’re now looking to learn a new card game, heed the following advice: Ignore the bidding and meta-scoring completely. The bidding phase is the hardest part of the game. While learning, just rotate who attacks. Play default games. Make the obvious decisions. It’s much, much easier that way. Bidding is the meta-game on top of the game. Think about it once you’ve played a few rounds without it. Then, go slowly: Many of these games have fancy rules for special types of sub-games (null games, playing with open hands, meatless solo games, Ramsch, etc.), most of which you should ignore until curiosity wins out. Conclusion Go and pick up a deck of cards. Carry it with you. There’s no aura loss. You can play dozens of games with it. Whip it out over coffee with your friends. Schnapsen is weird, but only requires two players. Skat requires three. Bridge and Doppelkopf require four. Sheepshead is for five. 找朋友 is… crazy and can be played with arbitrary larger groups, I think? Go and have fun! If, at this point, you’re wondering if I am talking about the same Bridge you most likely associate with retirement homes , then yes, I am! The boomers are absolutely right about Bridge being a great game. ↩︎ This is different from Bridge, where you just count the number of won tricks. In Doppelkopf, some tricks score more points than others. ↩︎ Bridge, for example, has what we lovingly call ’the cuck chair’. It’s a four player game, but each round one of the players has to watch. It’s unclear to me why anyone would think that is a good idea. ↩︎📝MOND←TECH MAGAZINESaturday, November 14, 2026
Linus Called C++ Horrible. So I Read Git.🎥DeepDiveDev
Pay Up, Nerds🎥Matt Godbolt
Reading JSON at 277 GB/s in PythonMany systems log their data as JSON, one record per line (NDJSON). GitHub, for example, publishes every public event on its site that way through GH Archive: about a gigabyte per hour. Suppose you want to know which repositories received the most stars over eight hours. That is 7.6 GB of JSON, 2.2 million events. … Continue reading Reading JSON at 277 GB/s in Python📝Daniel Lemire's blog
Thoughts on the AI usage in the C++ committee🎥MeetingCpp
How I made chess move generation 20x faster #programming #chessengine #coding🎥CppCon
C++ Programming with No AI, LSP, or Debugger: Ep21-- Images Finally Placed🎥Zed A. Shaw
std::mdspan in C++23 Explained | N-Dimensional Array Views in C++🎥CppNuts
Fearless Concurrency in C++ - Tristan Brindle - ACCU 2026🎥ACCUConf
Stop writing 'Funny Characters'‘Pizza Delivery’ is a masterclass in humor. As far as 90s-era undersea Italian-dish slapstick goes, it is the clear pinnacle of the genre. Even IMDb agrees, putting it as the 7th best Spongebob episode of all time 1 . Pizza Delivery, one of the more iconic Spongebob episodes. This frame perfectly encapsulates the entire story. Pizza Delivery In Pizza Delivery, our heroes Spongebob and Squidward are asked to deliver a pizza. They end up stuck in the wilderness without a car, and struggle to find their way back to civilization. Every single beat in the story exists to explore the contrast between Squidward’s cynicism and Spongebob’s naive cheer. Neither of the characters is “the joke character”, and neither of them would even have gotten themselves “in a situation like this” without the other’s involvement. This is to say, Spongebob is happy wandering the wilderness. He’s fine, and would manage to return to civilization on his own. He’s “the fool”, he’s too naive and too cheerful to be harmed. Squidward on the other hand. If he were on his own, Squidward would never have gotten into this situation in the first place, and even if he had, he’d “just leave” and abandon the mission with an “I don’t get paid enough for this” attitude (as seen by him wanting to eat the pizza as he gets hungry, while Spongebob insists on preserving it for the customer). He’s cynical. Neither Spongebob nor Squidward is a “joke character”. Rather, the story is an exploration of what happens when characters with different attitudes towards life are working together. Flanderization Flanderization is what happens when (across the seasons) characters in TV shows become “flat” and are phased out in favor of skinwalkers trying too hard not to break character. It’s what happens when you have “the smart character” and “the funny character”, and the writers start taking shortcuts, and view and write their characters fully in terms of these stereotypes. The character stops having nuance, and turns into a pastiche with the word “SMART” or “FUNNY” written onto it in bold red letters. Flanderization (credit: Winston Rowntree , CC BY-SA 4.0) (Basically ~everyone agrees that this is bad. Explaining how it happens is a different question.) If you set out to write a “joke character”, or even just a “funny character”, at worst you are flanderizing your character before they ever even got a chance to live and breathe. You are outsourcing “funniness” to a dedicated cardboard cutout that you drag onto the stage whenever you need a joke-shaped digression (to lighten the mood, fill the space, transition from one scene to another, or knock over a vase to kick off a story, because you could not think of a more natural way to get there). That’s bad. In Pizza Delivery, the humor exists in the interaction of two characters, neither of whom is particularly funny on their own. This is not a high bar! No, seriously! You may say “Oh, who cares! Just let people have fun! Look, I have seen ‘family guy funny moments compilation’ in your algorithm history, stop acting like you are better than us you art snob.” Fine, fine, but now look at this from the angle of trying to write a funny story . The comic relief character hurts your story because it is predictable. Humor benefits from unpredictability and novelty. The worst funny characters are always the same . They make the same themed puns, or act “stupidly”. None of their interactions depend on whom they interact with, and so every joke is predictable. The best characters have novel interactions with everyone and everything they encounter. Funniness arises as an intersection of their unique traits, and the novelty of what they are interacting with. If I show you “the stupid character” walking into a laboratory of expensive equipment where “the smart character” is working, you can see the joke coming from miles away. Boring! Against Against Funny Characters Okay, but seriously, comedy has no hard rules + playing at the very boundary of what’s allowed is also part of comedy. This is to say, if I say “DO NOT WRITE FUNNY CHARACTERS >:(” and this were to become a universal rule, then playing with what a “funny character” is, or explicitly putting them into media would in itself become more funny. You are doing a thing that you shouldn’t do, intentionally, for the bit. At this point the meta-commentary itself becomes the joke. This is different from what I am objecting to, which is lazy/thoughtless supposedly funny gag characters, especially in media that doesn’t require them. Likewise, “character studies” of a character that’s meant to be silly (in some form or another) are fine. tl;dr: writing rules are meant to be broken, and in comedy specifically, subverting expectations by making a joke that should not be made is a common pattern. See the Family Guy chicken. It’s not exactly a joke character. The running gag is that a human-sized anthropomorphic chicken shows up to interrupt an ongoing scene, and he and Peter Griffin start beating the crap out of each other. A Family Guy chicken fight scene. This is humor on multiple levels: It is completely unexpected. You were tricked into caring about something else, and suddenly, bam, all that gets thrown out. It requires the creation of complex, hard-to-animate fight sequences. i.e. it’s not cheap, it’s more expensive and difficult to produce. It becomes a running gag which is then referenced and subverted later. Yes, this is disgustingly meta , and meta is easy, but it still manages to be funny. Hades Hades is an award-winning video game by beloved studio Supergiant Games, previously known for shorter, linear and story-heavy experiences such as Bastion, Transistor and Pyre. Hades is an “action roguelite with a story”, which is to say, it’s segmented into individual thirty-minute “runs”. After each run you enter the hub area, where waiting characters may have a few new crumbs of dialogue 2 . Hypnos. Hypnos is a joke character. Hypnos’ “bit” is to deliver a single funny one-liner every single time your main character returns to the hub area of the game (usually after a death, which Hypnos will comment on). As an example: “So you got skewered by a Spike Trap out there, huh? Well, that’s too bad! Have you tried not standing there, like, when the spikes come out?” I hope you agree that this is bad dialogue, but you have to understand that Hypnos has well over forty fully voice-acted lines , and that all of them are exactly like this . This is all Hypnos is. Characters like him hurt my immersion to a degree that’s hard to overstate. It’s writers contorting themselves to add a joke where no joke was required 3 . He’s not a character, he’s uh, a lamp fixture. A piece of furniture. I suspect that the reason he exists is just to make the main hub area feel less empty. Whimsy At this point you, dear reader, are almost certainly convinced that I’m the least fun, least whimsical person alive, but nothing could be further from the truth. I brim with whimsy, to the point that it’s to my own detriment. The fear and loathing I have towards “funny” characters is downstream of the horrifying thought that, as we become older, more comfortable, more entrenched in our ways, all of us flanderize and turn into caricatures. I don’t like this thought. I don’t want to be seen as a clown-dressed caricature, as someone, or something that’s only wheeled onto the stage when a joke is necessary. As someone incapable of serious conversation, or incapable of human connection. When I see joke characters, it can feel dehumanizing. Don’t you understand that real human beings exist? Why are you writing… whatever this is, and acting as if it’s real? Show me a character with ambitions, someone who struggles with the human condition, someone capable of growth . Call me sentimental, sappy, or anti-nihilistic, but this is important to me. Do you need character growth? No. Many characters don’t need character growth. They are side characters, background characters, they are written from the perspective of another character, in one snapshot of time, and necessarily flat. This is fine. You are allowed to use characters as pawns , serving a larger purpose. You are also allowed to write stories about a deliberate lack of growth. Pessimistic ones, dark ones, about men failing to let go of their ways, or not even recognizing the problem. Just be aware that you are making a statement . The worst you can do is implicit nihilism, where each episode ends on a “this character never changes” note, just to get another deflated laugh in. If I knew how to draw the lines clearly, I’d be a much better writer, and I’d not be writing this post, so forgive me. Pizza Delivery: Redux Pizza Delivery’s ending is brilliant. After Spongebob and Squidward manage to escape the wilderness, they (finally) deliver the pizza to the customer. This is the moment that Spongebob and you (the viewer) have been waiting for. All this work, the long trek through the wastelands, the fight over whether they should eat the pizza to ensure their own survival is finally going to pay off. What happens next is that the customer claims that a drink is missing from their order. A heartbroken Spongebob tries to bargain, and argue that a drink wasn’t on the order, but to no avail. The customer refuses to accept the pizza, and slams the door in Spongebob’s face. Spongebob breaks down crying, and for the first time in this story, Squidward feels bad for him . Squidward grabs the pizza, marches to the door, knocks, and slams it into the customer’s face (“This one is on the house!”). POV: You are a customer rude to the delivery sponge. After a final gag (they were much closer to the customer’s house than they thought, so the whole trip was a waste of time), the episode ends. This works. It shows character growth, and depicts Squidward as a character more complex than at the start of the episode . He’s transcending his spite and frustration, to stand up for someone innocent. None of this is deep , but it’s character growth as presented through narrative. It’s kinship and warmth shown between two characters that couldn’t be more different, in a short character-driven narrative that fits within ten minutes. The difficulty with the format of sitcoms is of course that, in a sense, the characters must never change . If they grew, they’d lose their original archetype, to a degree that the character dynamics they exist to facilitate stop working. Take: I would be fine with that. Shows should end . The same archetypes should be interpreted and re-interpreted in other shows, and from other angles. Kill the Simpsons, etc. In the same sense in which we should grow as people, it’s fine if narratives go somewhere . Do not flanderize yourself, and don’t clap for another twenty seasons of the same characters acting out the same jokes you have already seen multiple times over. Spot one is Band Geeks, of course. ↩︎ You head to the factory for another shift, then come home in the evening and get another piece of dialogue from your husband, wife, or cat. Spread this out across twenty years and you discover that you’re going to get a divorce. That’s basically what it’s like. It’s repetitive, and an early conversation could’ve saved everyone a lot of time. (You may be able to tell that I thought Hades was too long-winded. I didn’t like it very much, mostly due to the expectations set by e.g. Transistor.) ↩︎ Many of Hades’ characters (~all Greek gods) are similarly flat, or have no meaningful dialogue beyond making puns. Part of this is just because Hades has a lot of characters, and (due to the roguelite format) is limited in the type of story it can tell. You have to cut it some slack for innovating. ↩︎📝MOND←TECH MAGAZINEFriday, November 13, 2026
ParaView 6.2.1 Release NotesBug fixes made since ParaView 6.2.0 are listed in this document. The full list of issues addressed by this patch release is available here. ParaView 6.2.1 is built with VTK 9.7.2, which contains additional bug fixes since VTK 9.7.1, which was used for ParaView 6.2.0. The bug fixes in VTK most relevant to ParaView are […]📝Kitware Inc
InsideC++ 26431: A New Show, Contracts as Clickbait🎥SwedenCpp
MSVC Build Tools Preview updates – November 2026The MSVC Build Tools Preview is updated regularly with the latest features and fixes from the MSVC development team. This post covers the last month’s updates of the Preview build tools, currently targeting the v14.53 release. This encompasses changes across the compiler frontend, backend, linker, standard library, and related tools. Although you can acquire the […] The post MSVC Build Tools Preview updates – November 2026 appeared first on C++ Team Blog .📝C++ Team Blog
CMake 4.5.0 available for downloadCMake 4.5 available for download📝Kitware Inc
Cleaning up after the Office 365 outageThis is a note to self and a link I can send to family… Microsoft had a major outage today and before I realised what was going on I had opened an excel sheet that I have on my OneDrive. I had opened this sheet from a machine that hadn’t been used to open this particular sheet for a while and the version that I ended up with was a few days old.📝Rambling Comments - Len Holgate's blog
Lightning Talk: Mixed-Mode Rings: io_uring_context for Kernel 7.x - Robert Leahy - C++Now 2026🎥CppNow
How can I make it easier to use the helper class that lets me pass more than one parameter to co_await?Remove the need to have to type out the name of the helper. The post How can I make it easier to use the helper class that lets me pass more than one parameter to co_await ? appeared first on The Old New Thing .📝The Old New Thing
C++ Programming with No AI, LSP, or Debugger: Ep19 -- Layout Can Image Part3🎥Zed A. Shaw
Optimizing Bishop, Rook, and Queen Move Generation in a Chess Engine - Aryan Naraghi - CppCon 2026🎥CppCon
Kitware Collaborates on PhySIC to Advance Full-Body Physiological ModelingKitware is part of an Applied Research Associates (ARA)-led team, alongside Aeris, AV, and Netrias, developing the Physiological Systems Integration and Computation (PhySIC) platform for the Defense Threat Reduction Agency/Joint Science and Technology Office (DTRA/JSTO).📝Kitware Inc
Talk to Your Synth - Sound Design as a Conversation - Aurnik - ADC Japan 2026🎥audiodevcon
New release cadence for Qt WebEngine and Qt PDFStarting with Qt 6.12, Qt WebEngine and Qt PDF are released as Qt Extensions modules, on their own schedule, separate from the Qt Framework releases. For you, this means Chromium security fixes reach your applications sooner, and newer Chromium versions arrive more often. Read on to learn about the new version numbers and how to pick the right release for your Qt version.📝Qt Blog
Meta Build Systems as Logic ProgramsMeta build systems such as CMake, Meson and Bazel derive command graphs from project descriptions, user choices and machine facts. Imperative scripts, search paths and special cases make routine decisions interact poorly: search order can choose compatible packages without an explicit project choice, packagers must patch author flag preferences, and cross-builds need annotations or nested build trees for tools run during the build.📝Alex Reinking
FFTs Part 2: The Basics of the FFTThis is part 2 of a series of posts about FFTs and the specific algorithms that FFT-20XX uses. The Discrete Fourier Transform The Basics of the FFT (← you are here) Some Optimizations to the FFT The Inverse FFT The FFT-20XX Complex-Input Algorithm The FFT-20XX Real-Input Algorithm(s) Part 1 went through the core of how the discrete Fourier transform (DFT) works to turn a series of samples in time into a set of samples in frequency, and ended up with the following algoritm: void CalculateDFT ( complex [ ] inputs , complex [ ] outputs , int length ) { for ( outIdx = 0 ; outIdx length ; outIdx ++ ) { // Start the sum at 0. float sum = 0 // This is the angular frequency (in radians/sample) for // the given output sample. float angularFreq = - 2 * pi * outIdx / length for ( inIdx = 0 ; inIdx length ; inIdx ++ ) { // Get the rotation value for the current input index // then use that to calculate the resulting rotation. float radians = inIdx * angularFreq complex rotation = cos ( radians ) + i * sin ( radians ) // A complex multiply with a unit complex vector is // a 2D rotation. sum += inputs [ inIdx ] * rotation } outputs [ outIdx ] = sum } } Note A reminder: we’re going to be talking about these values as complex numbers (of the form a + i b a + i b ), but if you prefer, just think of them as a 2D vector instead ( [ a , b ] [a, b] where a a is the x coordinate and b b is the y coordinate). We’ll be doing complex multiplication of these vectors with others, but in all cases a multiply like P ⋅ R P \cdot R will be a rotation of point P P by the angle that R R represents (where R = cos θ + i sin θ R = \cos\,\theta + i\,\sin\,\theta ). This algorithm is O ( N 2 ) O(N^2) , but there’s a much more efficient, O ( N log N ) O(N\,\log\,N) way: the fast Fourier transform (FFT) — and we’re going to derive it. Note The algorithm we end up deriving here is going to work specifically for FFT lengths that are powers of two , because it’s the easiest to implement (plus, to be honest, power-of-two lengths were sufficient for FFT-20XX so that’s all I implemented). The following techniques can be adapted for other lengths (i.e. if you need a length that is a mutliple of 3 or 5 or, I dunno, 97), plus there are ways to do this for arbitrary lengths (for instance: Bluestein’s algorithm ). This series isn’t going to touch on any of those. Halving the Work The first step of deriving the FFT algoritm is figuring out where we can halve the amount of work. Since the DFT boils down to “every output takes every input multiplied by a rotation”, we can visualize all of the rotations as a 2D grid, where each column is an input and each row is an output. Here’s a visualization of the rotations for an FFT of length 8 (adding a dividing line between the top and bottom halves, which should make sense in a moment): in[0] [0] in[1] [1] in[2] [2] in[3] [3] in[4] [4] in[5] [5] in[6] [6] in[7] [7] out O [0] = + + + + + + + out O [1] = + + + + + + + out O [2] = + + + + + + + out O [3] = + + + + + + + out O [4] = + + + + + + + out O [5] = + + + + + + + out O [6] = + + + + + + + out O [7] = + + + + + + + Each rotation (as per the above pseudocode) for a given input index n n and output index k k is n k / N n k/N turns (where N N is 8, the FFT length). But rotations are cyclical , and, for instance, turning a full turn (360 degrees) is equivalent to not turning at all. We can use this cyclicity to our advantage! If you look at the even inputs (columns indexed 0, 2, 4, and 6), you’ll note that the rotations in the bottom half are identical to the top half . For instance, with input 2, outputs 0 and 4 are both unrotated, outputs 1 and 5 both rotate a quarter turn, and so on. For the odd inputs (columns 1, 3, 5, 7), the angles aren’t the same. However, they’re still related: the bottom half rotations are always 180 degrees from the corresponding top half rotations. As an example, looking at the column for input 1, we see that output 4’s rotation is a half turn, where output 0 is unrotated — they’re facing away from each other. The other odd outputs are similar, with the bottom half rotations always pointing the opposite direction as their top-half counterparts. In other words, the bottom half rotations of the odd inputs are negated versions of the top half (because with 2D vector A , Rotate(A, 180 degrees) is the same as the 2D vector -A ). Let’s rearrange the columns of the diagram to group the even and odd inputs together (evens to the left, odds to the right): in[0] [0] in[2] [2] in[4] [4] in[6] [6] in[1] [1] in[3] [3] in[5] [5] in[7] [7] out O [0] = + + + + + + + out O [1] = + + + + + + + out O [2] = + + + + + + + out O [3] = + + + + + + + out O [4] = + + + + + + + out O [5] = + + + + + + + out O [6] = + + + + + + + out O [7] = + + + + + + + We can then rewrite the bottom-half odd inputs as negations of the top-half ones (note the minus signs in place of the usual plus signs): in[0] [0] in[2] [2] in[4] [4] in[6] [6] in[1] [1] in[3] [3] in[5] [5] in[7] [7] out O [0] = + + + + + + + out O [1] = + + + + + + + out O [2] = + + + + + + + out O [3] = + + + + + + + out O [4] = + + + - - - - out O [5] = + + + - - - - out O [6] = + + + - - - - out O [7] = + + + - - - - Now all of the corresponding top and bottom half outputs use the same corresponding rotations per input ; the only difference is that in the bottom half we subtract the rotated odd inputs instead of adding them. Our code, then, can switch to summing up all of the even and odd elements separately, then computing two outputs at once by doing evenSum + oddSum for the first (top) half of the outputs and evenSum - oddSum for the second (bottom) half, which means we’re now doing half the work as before! Note If you want this (and the next section) done algebraically instead of visually, the wiki page for the Cooley-Tukey algorithm has a fairly clear breakdown of the derivation of the whole thing. Here’s what the code looks like if we do that: void CalculateDFT ( complex [ ] inputs , complex [ ] outputs , int length ) { // NOTE: Now looping over half the length for ( outIdx = 0 ; outIdx length / 2 ; outIdx ++ ) { // Start the sums at 0. float evenSum = 0 float oddSum = 0 // angular frequency for the given output // (in radians/sample) float angularFreq = - 2 * pi * outIdx / length // NOTE: now incrementing by 2 to do odds and evens // separately. for ( inIdx = 0 ; inIdx length ; inIdx += 2 ) { // Get the rotation value for the current input index // then use that to calculate the resulting rotation. float evenRads = inIdx * angularFreq complex evenRot = cos ( radians ) + i * sin ( radians ) evenSum += inputs [ inIdx + 0 ] * evenRot // Do the same with the next index (inIdx + 1), for // the odd sum. float oddRads = ( inIdx + 1 ) * angularFreq complex oddRot = cos ( radians ) + i * sin ( radians ) oddSum += inputs [ inIdx + 1 ] * oddRot } // Computing 2 outputs in the same loop! outputs [ outIdx ] = evenSum + oddSum outputs [ outIdx + length / 2 ] = evenSum - oddSum } } If you compare this code to what we started with, it does half the rotations and (roughly) half the adds (counting subtractions) as the original: the inner loop does effectively the same amount of work in both, but the outer loop runs half as much. Unfortunately, it’s not quite to O ( N log N ) O(N\,\log\,N) yet, so we need a way to effectively do this halving of work recursively. Halving Work Again (and Again and…) Let’s look again at just the first half of the outputs from our 8-length example: in[0] [0] in[2] [2] in[4] [4] in[6] [6] in[1] [1] in[3] [3] in[5] [5] in[7] [7] out O [0] = + + + + + + + out O [1] = + + + + + + + out O [2] = + + + + + + + out O [3] = + + + + + + + If we look at just the even inputs for a moment, the pattern of rotations in that 4×4 block of the diagram ends up being the exact same pattern of rotations as for a standard 4-element FFT (half the size of our 8-element example): in[0] in[1] in[2] in[3] out[0] = + + + out[1] = + + + out[2] = + + + out[3] = + + + Math Alert! If you care about the algebra: this is because for each even rotation ( n k N \frac{n k}{N} ), k k is a multiple of 2. So if we say 2 m = k 2m = k , then the rotation becomes 2 n m N \frac{2 n m}{N} which is equivalent to n m N / 2 \frac{n m}{N/2} , which is exactly how the angles for an FFT of length N / 2 N/2 would be specified. This means that we can calculate the even sums recursively , computing the N / 2 N/2 even sums as if they were an N / 2 N/2 -length DFT, which means we can do the same even/odd dance to halve its work as well. That’s great for the even inputs, but what about the odd inputs? They have a similar pattern, but it’s not quite the same: in[1] in[3] in[5] in[7] odd[0] = + + + odd[1] = + + + odd[2] = + + + odd[3] = + + + The first row is the same as in the 4-element DFT: no rotation. The second row, however, is different: each angle in the row is 1/8th of a turn rotated relative to the corresponding row of the 4-element DFT. The third and fourth rows are also different, with an extra 2/8th and 3/8th turn added to the angles in each row, respectively. In other words, any given output k k ’s odd inputs will have their rotations be k / N k/N turns more than doing a standard N / 2 N/2 -length FFT with those inputs. Since “rotating every vector by t then summing” is the same as “summing then rotating by t ” (that is, Rotate(A, t) + Rotate(B, t) equals Rotate(A + B, t) ), we can calculate each odd sum by doing the work as a half-length DFT (like we can with the evens), then adjust each sum by rotating by its corresponding k / N k/N -turn angle (called a twiddle factor , which is a fun name to say), like so: in[1] in[3] in[5] in[7] odd[0] = × + + + odd[1] = × + + + odd[2] = × + + + odd[3] = × + + + Using that, we can now recursively calculate the even and odd sums using half-length FFTs, apply the twiddles, then do the add and subtract to get the final outputs. Let’s write this as code again, this time recursively! To do this, for now we’ll use some temporary storage for simplicity: // Helper function to build a complex // rotation value complex Twiddle ( int k , int len ) { float angularFreq = - 2 * pi * k / len return cos ( angularFreq ) + i * sin ( angularFreq ) } void CalculateDFT ( complex [ ] inputs , complex [ ] outputs , int len ) { if ( len == 1 ) { // To end the recursion, special-case // the 1-length FFT, which sums one input, // unrotated (i.e. it does nothing). outputs [ 0 ] = inputs [ 0 ] return } // Temp storage for the recursion complex [ length / 2 ] evens complex [ length / 2 ] odds // Separate the even and odd inputs for ( k = 0 ; k len / 2 ; k ++ ) { evens [ k ] = inputs [ 2 * k ] odds [ k ] = inputs [ 2 * k + 1 ] } // Recurse into the even and odd FFTs // (each using the same array as input and // output, which is fine here) CalculateDFT ( evens , evens , len / 2 ) CalculateDFT ( odds , odds , len / 2 ) for ( k = 0 ; k len / 2 ; k ++ ) { // Get the corresponding recursively-calcualted // sum from the relevant arrays. complex evenSum = evens [ k ] complex oddSum = odds [ k ] // The odd sum needs to be rotated by this // output's twiddle factor. oddSum *= Twiddle ( k , len ) // Now, as before, calculate two outputs from // these sums. outputs [ k ] = evenSum + oddSum outputs [ k + len / 2 ] = evenSum - oddSum } } This is now truly, algorithmically O ( N log N ) O(N\,\log\,N) ! We halve the work at each level of the FFT, which does way fewer rotations and adds than the initial DFT algorithm (for instance, the original algorithm for a 1024-length DFT would do around a million rotations, but this one does around five thousand). But it’s not ideal: it’s recursive, and uses temporary storage per recursion. We can do better! But now we get into the “fun” that is… Deinterleaving and Bit Reversal To do all of this without recursion or scratch space, we need a way to do each level of the FFT calculation in-place. So let’s look at how data is flowing through the system. Here’s a diagram of the routine (at a single recursion level) where, from left to right: The inputs are deinterleaved into evens and odds. Each of those two groups has a half-length sub-DFT performed on it (this is the recursion). Those results are then used in pairs by each step of the computation loop to write corresponding pairs of outputs. Diagram of the routine, which is laid out as described above. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 2 4 6 8 10 12 14 1 3 5 7 9 11 13 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Even DFT Odd DFT If you look at the flow through this diagram, what’s interesting is that in the box on the right (representing the loop) each computation (one of the circles) pulls in from the same row that it writes out to (ignoring the actual index numbers). For instance, the top circle pulls in from indices ‘0’ and ‘1’, which are lined up perfectly with its outputs at ‘0’ and ‘8’. This means that, theoretically , we could compute the entire FFT in-place (where the inputs and outputs are the same array), by doing the following: Deinterleave the data in-place (separating the evens and odds). Calculate the sub-DFTs recursively (again, in-place), using the first and last halves of the data as the even and odd sub-DFTs, respectively. Then, run the computation loop over the results, each iteration of which reads from and writes to the same elements, so no rearranging needs to take place. That would look like the following — very much like the above code, except without the temporary evens and odds storage: void CalculateDFTInPlace ( complex [ ] data , int len ) { if ( len == 1 ) return // A hypothetical function to do the // deinterleave. DeinterleaveInPlace ( data , len ) // Recurse into the even and odd FFTs // (first and last halves of our data) CalculateDFTInPlace ( data , len / 2 ) CalculateDFTInPlace ( data + len / 2 , len / 2 ) for ( k = 0 ; k len / 2 ; k ++ ) { var kOdd = k + len / 2 complex evenSum = data [ k ] complex oddSum = data [ kOdd ] oddSum *= Twiddle ( k , len ) // Note that we're writing to the same // array indices that we read from! data [ k ] = evenSum + oddSum data [ kOdd ] = evenSum - oddSum } } There’s one problem with this: it turns out, efficiently deinterleaving an array in-place is one of those problems that sounds like it would be super easy, but is instead kind of a nightmare ! Note There are ways to do it, of course, even O ( N ) O(N) ways - but they don’t have particularly nice memory access patterns and end up not performing particularly well at larger sizes. To try to avoid that, let’s keep investigating the pattern of data moves. We know that, in terms of data flow, the data into the last step comes in from two half-length sub-FFTs: Diagram showing the even and odd 8-element sub-FFTs of a 16-element FFT, writing out to even and odd intermediate values (respectively), which then feed into the final step labeled "combine" which represents the final combination step. 0 2 4 6 8 10 12 14 1 3 5 7 9 11 13 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Even DFT Odd DFT Combine If we were to track this pattern of deinterleaves all the way back to the lowest recursion level (the two-element FFTs), where the indices from right to left (from output to input) get deinterleaved at each step, here’s the ordering we end up with: Compact diagram showing the inputs (ordered 0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15) feeding into eight 2-element sub-FFTs, then those being fed in pairs into four 4-element sub-FFTs, each of which outputs the indices in a new order where the even/odd indices are interleaved. Each pair of those feeds into one of the two 8-element sub-FFTs which, again, outputs its input indices in interleaved order, then those two finally feed into the final 16-element FFT pass, which outputs the indices in the expected 0 to 15 sequential order. 0 8 4 12 2 10 6 14 1 9 5 13 3 11 7 15 0 8 4 12 2 10 6 14 1 9 5 13 3 11 7 15 0 4 8 12 2 6 10 14 1 5 9 13 3 7 11 15 0 2 4 6 8 10 12 14 1 3 5 7 9 11 13 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 At a glance, the pattern of inputs on the left isn’t particularly clear, but it turns out it’s straightforward: the values are the original indices with their bits reversed ! As an example, for a 16-element FFT (like the diagrams above), we have 4 bits worth of index (since log 2 16 ⟹ 4 \log_2 16 \implies 4 ), so here’s the table of reversals: 0 0000 ↔ 0000 0 1 000 1 ↔ 1 000 8 2 00 1 0 ↔ 0 1 00 4 3 00 11 ↔ 11 00 12 4 0 1 00 ↔ 00 1 0 2 5 0 1 0 1 ↔ 1 0 1 0 10 6 0 11 0 ↔ 0 11 0 6 7 0 111 ↔ 111 0 14 8 1 000 ↔ 000 1 1 9 1 00 1 ↔ 1 00 1 9 10 1 0 1 0 ↔ 0 1 0 1 5 11 1 0 11 ↔ 11 0 1 13 12 11 00 ↔ 00 11 3 13 11 0 1 ↔ 1 0 11 11 14 111 0 ↔ 0 111 7 15 1111 ↔ 1111 15 As you can see, the ordering on the right of this table (0, 8, 4, 12, etc) is the same as the input ordering from the previous diagram and, in their bit representations, you can see that each index is just the 4 bits of the other reversed. This is a much easier operation to perform than a deinterleave at each step, especially with separate input and output arrays! Here is a simple routine that does a bit-reversed copy from one array to another: void BitReverseCopy ( complex [ ] inputs , complex [ ] outputs , int len ) { for ( int k = 0 ; k len ; k ++ ) outputs [ k ] = inputs [ BitRev ( k , len ) ] } Note The above code doesn’t have an implementation of BitRev , because an efficient implementation on many systems isn’t particularly readable; it turns into a sequence of swapping increasingly-large groups of bits until you reach the size of the int . For a C++20 implementaton, here’s a compiler explorer link . Additionally, the above routine doesn’t work in-place, though it is totally possible to do so: a bit reversal can be written efficiently as a square matrix transpose (or two) if you get creative with the indexing of the “matrix” rows. However, the final FFT-20XX algorithms do not have an explicit bit reversal step, so I’m not going to go into those details. Sorry! Going Iterative We now have all of the pieces we need to assemble the final algorithm. Let’s go back to this earlier diagram of the data flow for a 16-element FFT: The same diagram of the flow of indices through a 16-element FFT that we saw earlier. 0 8 4 12 2 10 6 14 1 9 5 13 3 11 7 15 0 8 4 12 2 10 6 14 1 9 5 13 3 11 7 15 0 4 8 12 2 6 10 14 1 5 9 13 3 7 11 15 0 2 4 6 8 10 12 14 1 3 5 7 9 11 13 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Each column of boxes in this diagram corresponds to a level of recursion in our original code (recursing from right to left because the recursion is done before the computation): the last column (with the one tall box) is the top of our recursion stack, which then recurses into its two sub-DFTs (the next column to the left), and so on, until we reach the left-most column which is the lowest level of recursion. Each box represents a computation pass at its given recursion level (the loop in the above code). If the inputs have been pre-bit-reversed (so that they’re in the order specified on the left-hand side of the above diagram), then each of the boxes reads from and writes to the same element indices , so each computation (box) acts in isolation. Rather than doing this recursively, we can instead treat each of the columns of this diagram as a single pass through the data! More specifically for this diagram, it takes the inputs in what we now know to be bit-reversed order, and does four ( log 2 16 \log_2 16 ) passes on the inputs (where, again, each pass represents a level of recursion in our example code): The first pass does eight 2-element computation loops The next pass does four 4-element loops Next is two 8-element loops Lastly, a single 16-element loop to get the final outputs Note In each of the above passes, the number of computation loops multiplied by the number of elements in the loop is 16 ( 8 × 2 8\times2 , 4 × 4 4\times4 , 2 × 8 2\times8 , and 1 × 16 1\times16 ), which means each pass processes N N elements. Since there are log 2 N \log_2\,N passes of N N elements each, this algorithm — like the recursive one — is our target O ( N log N ) O(N\,\log\,N) . This process can (finally!) be done iteratively instead of recursively, by getting the elements into the expected bit-reversed order, then modifying each element in place, in passes: void CalculateDFT ( complex [ ] inputs , complex [ ] outputs , int len ) { if ( len == 1 ) { // Special case length 1. outputs [ 0 ] = inputs [ 0 ] return } // Do the bit reversal so we can do the rest // iteratively in the outputs, in-place. BitReverseCopy ( inputs , outputs , len ) // Outer loop iterates all of the subFFT lengths: // starting at 2, then doubling until we reach the // full length ... this is log2(len) iterations. // This is equivalent to each level of recursion in the // previous code example. for ( int subLen = 2 ; subLen len ; subLen *= 2 ) { // This loop iterates over each subsection, as the starting // index into the data (this is the individual sub-DFTs in // the previous example). for ( int subStart = 0 ; subStart len ; subStart += subLen ) { // The data for this subsection starts at subStart. var * data = & outputs [ subStart ] // Finally, do the computation loop for this subsection. // The logic here is unchanged from the previous code // examples, and, as with our deinterleave case, reads // and writes to the same pairs of elements. for ( int k = 0 ; k subLen / 2 ; k ++ ) { int kOdd = k + subLen / 2 complex evenSum = data [ k ] complex oddSum = data [ kOdd ] oddSum *= Twiddle ( k , subLen ) data [ k ] = evenSum + oddSum data [ kOdd ] = evenSum - oddSum } } } } Note The bit reversal does not necessarily have to come at the beginning: the algorithm could instead be written to take the inputs in natural order and end up with the outputs in bit-reversed order, then do the bit reversal in-place as the last step. The indexing within the passes would be different, but the algorithm would otherwise work the same. What we’ve ended up with is the radix-2 decimation in time Cooley-Tukey algorithm . It’s radix-2 because each “recursion” splits into two sub-FFTs, and it’s decimation in time because each pass deinterleaves the input, time domain samples. Note If you go back up to the rotation diagrams again, you might note that the rotations are diagonally symmetrical, which means you could instead split on even/odd output for the first and last half of the inputs (instead of the other way around, like we did). This will end up as a similar but different algorithm, and is the decimation in frequency version of an FFT, which we’ll get to in a later post. Room for Improvement While we’ve now gotten to the core FFT algorithm, this still isn’t anywhere near an optimal implementation, and there are a number of things we’ll want to do to get this even faster. For instance: As mentioned above, this is a radix-2 algorithm, but there are other radixes (such as radix-4 , where each FFT splits into 4 sub-FFTs ) that are more efficient and worth investigating. The sines and cosines could be done via a lookup table instead of calculating them at runtime, since for a given FFT length there are only so many unique angles that are required. Doing the bit reverse pass to get things into the correct order (either at the start or end) can be a sizeable chunk of time, and depending on implementation can wreak havoc on your CPU’s caches. And then there’s doing SIMD optimizations and otherwise trying to make the memory accesses CPU-cache-friendly. We’ll touch on the first couple of those next time! (thanks again to Neintonine for giving some feedback before it went live!)📝JoshJers' Ramblings
User-Schedulable Approximations for Quantized Tensor ProgramsQuantization lets language models run on edge devices, but it sharply increases the number of tensor kernels a library must maintain: every weight format must be paired with every activation format on every instruction set and GPU, with an encoder and a decoder that agree on the stored bytes. In GGML, the tensor library used by llama.cpp, these kernels are written by hand, and only 8 of the 54 weight-activation pairs it runs on our Arm CPU have a tiled matrix-multiplication kernel.📝Alex Reinking
chrono, chrono_literals, duration_cast, and this_thread::sleep_for | Modern Cpp Series Ep. 252🎥Mike ShahThursday, November 12, 2026
The Future of C++ in a Heterogeneous World: Lessons from Android OS at Scale :: Dori Exterman🎥CoreCpp
Terrible tips for a C++ developer: 2026 edition, Part 1We're introducing an updated edition of the terrible tips for a C++ developer book. We'll be posting it on our blog in parts. The book includes a total of 60 tips.📝from pvs-studio.com
C++ Programming with No AI, LSP, or Debugger: Ep18 -- Layout Engine Part2🎥Zed A. Shaw
C++ Dynamic Debugging is now generally availableIntroduction We are excited to announce that C++ Dynamic Debugging is now generally available in all Visual Studio 2026 channels and the Microsoft C++ (MSVC) Build Tools version 14.52. In the traditional workflow for games or large applications, switching to a debug build gives you access to debug symbols at the expense of performance. In contrast, when […] The post C++ Dynamic Debugging is now generally available appeared first on C++ Team Blog .📝C++ Team Blog
How can I pass more than one parameter to co_await?The co_await operator takes only one parameter, but it can be a big parameter. The post How can I pass more than one parameter to co_await ? appeared first on The Old New Thing .📝The Old New Thing
C++ Programming with No AI, LSP, or Debugger: Ep17 -- Layout Engine Part1🎥Zed A. Shaw
Everything new in C++26 #cpp #cplusplus #programming🎥CppCon
C++ Templates - Two-Phase Lookup - Amir Kirsh - ACCU 2026🎥ACCUConf
SwedenCpp talks without ad breaksOne coffee a month is enough to turn off mid-roll ads on SwedenCpp.📝Engineering the Craft
Webinar Recap: Agentic Debugging of Embedded Systems With CLion and TRACE32®CLion can now debug embedded targets through TRACE32 and let AI agents start and control debug sessions. JetBrains and Lauterbach presented the integration in a joint webinar, and this post recaps the session. You can also watch the demo presented at the webinar and browse the slides. How CLion and TRACE32 work together Moving from […]📝CLion : A Cross-Platform IDE for C and C++ | The JetBrains Blog
Don't be asocial: respect the user's build systemDon't be asocial: respect the user's build system You found the library, and now you just want to consume it. Except its CMake packaging is broken, or there is none at all, so using it means copying headers by hand, guessing at include paths, and fighting compiler flags it hardcoded over your own. There is no target to link against, and it drags in a home-grown dependency you have never heard of. To adopt it you would have to bend your build around its way of doing things, so you do what most people do: you reach for another library, or you write your own.📝mp-unitsWednesday, November 11, 2026
FFTs Part 1: The Discrete Fourier TransformBecause the world clearly doesn’t already have enough of them, I recently released a new FFT library: FFT-20XX . To the best of my ability to tell, it uses an algorithm that is at least slightly novel, and I thought it might be interesting to write about it. This is the first of a series of posts about FFTs and (eventually) the specific algorithms that FFT-20XX uses: The Discrete Fourier Transform (← you are here) The Basics of the FFT Some Optimizations to the FFT The Inverse FFT The FFT-20XX Complex-Input Algorithm The FFT-20XX Real-Input Algorithm(s) As a first step I thought it might be fun to start with “what even is the discrete Fourier transform ?” Fourier Transforms Any explanation of a Fourier transform would be remiss to not include a link to this fabulous 3Blue1Brown video that nicely illustrates how the Fourier transform works. I highly recommend watching it! This post, however, is specifically about the discrete Fourier transform (referred to as the DFT ), which is a Fourier transform that operates on sampled data (like, say, digital audio or images) instead of continuous data. The FFT (fast Fourier transform) is the standard algorithm used to compute the result of a DFT — we’ll get to it in the next post. What Does the DFT Even Do? Any periodic signal (i.e. a signal that repeats, such as looped audio) can be represented as the sum of a set of sine waves at different frequencies. Here is an example of a simple signal that can be broken down into three waves: Diagram of a somewhat complex wave, which is composed of the three following waves = Diagram of the lowest frequency and highest-amplitude wave that makes up the above complex wave. + Diagram of the middle frequency wave that makes up the above complex wave. It has an amplitude lower than the first component wave. + Diagram of the highest-frequency wave that makes up the above complex wave. It has a lower amplitude than the first two. This is true of any periodic signal whether it is analog or sampled — no matter how complex it may seem. The DFT answers a simple question: given a set of samples that represents a periodic signal, which frequencies are represented in that signal ? Note The “periodic signal” bit is important! The algorithm assumes that the block of samples it is processing repeats forever: Diagram showing a signal that repeating three times. However, this won’t be the case for all blocks, such as this one where there’s a hard discontinuity: Diagram showing a signal that repeats three times, however this time the wave in each signal do not line up properly at the edges, causing a discontinuity. This can cause noise in the resulting DFT output. There are a few tricks that can be done for cases like this (like windowing the signal) to effectively “pretend” that it is periodic when it’s not, but that’s out of scope for this post. To put it another way: the DFT converts a signal that is made up of samples in time (where each sample represents a point on the signal at a given time) into the same signal represented in frequency (where each sample represents the amplitude (how tall the wave is) and phase (the side-to-side position of the wave) of its corresponding frequency). These two representations are frequently referred to as time domain and frequency domain , and both encode the same signal in different ways. Note There is also an inverse DFT (the IDFT ) which converts the other way — from the frequency domain back to the time domain. Many signal processing applications convert from time to frequency space to do some operation, then use the inverse DFT to convert back. We’ll get to the inverse DFT in a later post. For a given repeating signal that is N samples long, the DFT returns contribution values for N frequencies, each with one more cycle than the previous. To put it a different way: for each frequency with index k (starting at 0 and ending at N - 1 ) there are k cycles of a wave (so index 0 has 0 cycles, index 1 has 1 cycle, etc). Here are the 8 waves for a DFT with 8 samples (the red wave with circles is the cosine and the green wave with squares is the sine): 0 Diagram of Frequency 0: all of the cosine values are '1' and all of the sine values are '0'. There are 8 points on each wave representing the samples (this is true for all subsequent waves as well). 1 Diagram of Frequency 1: there is a single up to down to up cycle of the cosine and sine waves. 2 Diagram of Frequency 2: there are two up to down to up cycles of the cosine and sine waves. 3 Diagram of Frequency 3: there are three up to down to up cycles of the cosine and sine waves. 4 Diagram of Frequency 4: there are four up to down to up cycles of the cosine and sine waves. Notably, the cosine samples alternate between '1' and '-1', and the sine samples are all '0'. 5 Diagram of Frequency 5: there are five up to down to up cycles of the cosine and sine waves. 6 Diagram of Frequency 6: there are six up to down to up cycles of the cosine and sine waves. 7 Diagram of Frequency 7: there are seven up to down to up cycles of the cosine and sine waves. Ultimately, a DFT will give you a set of values that tell you how much each of these frequencies contributes to the signal. Specifically, each frequency will have a value that represents both its amplitude and its phase . Note The frequency at index 0 always has cosine values of 1 and sine values of 0 , and this ends up measuring how “off-center” the signal is (relative to the x axis). This is known as the DC bias or DC offset . A signal with no DC bias. The wave is centered on the x axis No DC bias A signal with positive DC bias. The wave is above the x axis Positive DC bias A signal with negative DC bias. The wave is below the x axis Negative DC bias Let’s figure out how to calculate the DFT for a signal! Frequency Testing The first step of computing the DFT is to figure out how to get a single frequency out of a signal. Ignoring phase for a moment, this can be done in a surprisingly straightforward manner (to me, at least): if we multiply each sample in the signal by the cosine value of the test frequency and sum the results , you end up with a value that represents the contribution of that frequency to the signal (which is 0 if the frequency is not present in the signal). Here is an interactive example where you can set the signal and test frequencies and see the result of this process. For purposes of illustration, we’ll display the average instead of the final sum (as the sum would be too large to fit in the diagram): An interactive diagram that demonstrates how the signal and test waves are processed to detect frequencies. × Interactive diagram = avg → Signal Amplitude: 1.0 Signal Cycles: 2 Test Cycles: 2 Note that when the frequencies match (signal and test cycles), the resulting average scales with the amplitude of the signal , otherwise (with one exception we’ll touch on in a moment) it is 0 . This makes this sum effectively a frequency detector (again, ignoring phase for now)! This is still true even when there are multiple frequencies represented within the signal: this will result in a zero value for frequenices that are not in the signal and non-zero values for those that are . Math Time! If you’re interested in the math of how this works, here you go: The sum of all samples of a repeating cos x \cos\,x signal is 0 0 , as it has the same area above and below the x x axis, which cancels out in the sum. Now, if we multiply two such waves together: cos x ⋅ cos y \cos\,x \cdot \cos\,y , this can be rewritten (via trig identities ) as: 1 2 [ cos ( x − y ) + cos ( x + y ) ] \frac{1}{2}[\cos (x - y) + \cos(x + y)] If x x and y y don’t match, these are just two repeating cosines, and each of them sums to 0 0 over all of the samples (just like the single wave above). However if x = y x = y , this becomes: 1 2 [ cos ( x − x ) + cos ( x + x ) ] \frac{1}{2}[\cos (x - x) + \cos(x + x)] ⟹ 1 2 [ cos 0 + cos 2 x ] \implies \frac{1}{2}[\cos\,0 + \cos\,2x] ⟹ 1 2 + 1 2 cos 2 x \implies \frac{1}{2} + \frac{1}{2}\cos\,2x That remaining cos \cos term, over all of the samples, once again sums to 0, which leaves us with a constant 1 2 \frac{1}{2} in the average. As noted, there’s an exception here, where the multiply-and-sum seems to register a match when it shouldn’t. For example: if you set the Signal Cycles to 1 and the Test Cycles to 15 (or vice versa), it will have a non-zero average even though the frequencies don’t match. In fact, with the exception of frequencies 0 and 8 , there are two matches for every other frequency. Why is that? Well, now it’s time to talk about… Aliasing and Negative Frequencies Let’s take a closer look at the cosine values for our example frequencies of 1 and 15 cycles: 1 Diagram of the cosine for frequency 1 with sixteen samples. The wave has a single cycle. 15 Diagram of the cosine for frequency 15 with sixteen samples. The wave has fifteen cycles. The sample positions in this diagram are exactly the same as in the diagram of frequency 1. Note that while the waves are different frequencies, the cosine samples are the same! This is because of aliasing , which is where a frequency above the maximum representable frequency ends up sampling as if it were a different, lower frequency. The frequency above which aliasing occurs is called the Nyquist frequency , which is the highest frequency where there can be both a high and low sample for every cycle (you need both to represent a wave). In a signal with N samples, that frequency has N / 2 cycles. For example, with 16 samples the Nyquist frequency has 8 cycles (which you can see have a clear up then down pattern): Diagram of the cosine for frequency 8 with sixteen samples. The wave has eight cycles. Every sample on the cosine wave alternates between '1' and '-1' Above this frequency, the cosine samples end up aliasing to a lower frequency and cannot be differentiated anymore. Here are some more example pairs of aliased cosines from our 16-sample example: 2 Diagram of the cosine for frequency 2 with sixteen samples. The wave has two cycles. 14 Diagram of the cosine for frequency 14 with sixteen samples. The wave has fourteen cycles. The sample positions in this diagram are exactly the same as in the diagram of frequency 2. 3 Diagram of the cosine for frequency 3 with sixteen samples. The wave has three cycles. 13 Diagram of the cosine for frequency 13 with sixteen samples. The wave has thirteen cycles. The sample positions in this diagram are exactly the same as in the diagram of frequency 3. 7 Diagram of the cosine for frequency 7 with sixteen samples. The wave has seven cycles. 9 Diagram of the cosine for frequency 9 with sixteen samples. The wave has nine cycles. The sample positions in this diagram are exactly the same as in the diagram of frequency 7. Note that each pair has matching cosine samples , despite the different wave. Specifically: with a repeating sample count of N , any frequency with N − k N - k cycles has the same cosine values as the frequency with k k cycles (that is 1 matches 15 , 2 matches 14 , etc). Note This is just like the optical illusion where rapidly-spinning things like car wheels can appear to be rotating backwards . That’s neat! But it’s not the whole picture. We can’t just look at the cosine values, we need to look at what happens to the sine values as well: 1 Diagram of the sine for frequency 1 with sixteen samples. The wave has a single cycle. 15 Diagram of the sine for frequency 15 with sixteen samples. The wave has fifteen cycles. The sample positions in this diagram are like the ones in the diagram of frequency 1, but negated. 2 Diagram of the sine for frequency 2 with sixteen samples. The wave has two cycles. 14 Diagram of the sine for frequency 14 with sixteen samples. The wave has fourteen cycles. The sample positions in this diagram are like the ones in the diagram of frequency 2, but negated. 3 Diagram of the sine for frequency 3 with sixteen samples. The wave has three cycles. 13 Diagram of the sine for frequency 13 with sixteen samples. The wave has thirteen cycles. The sample positions in this diagram are like the ones in the diagram of frequency 3, but negated. 7 Diagram of the sine for frequency 7 with sixteen samples. The wave has seven cycles. 9 Diagram of the sine for frequency 9 with sixteen samples. The wave has nine cycles. The sample positions in this diagram are like the ones in the diagram of frequency 9, but negated. While the cosines are the same in these pairs of frequencies, the sines are negated and appear vertically flipped! This means that a given frequency with N − k N - k cycles has negated sine values from the frequency with k k cycles. The relationship here is that the aliased frequencies in each pair are negated versions of the other, since cos ( − a ) = cos ( a ) \cos({-}a) = \cos(a) and sin ( − a ) = − sin ( a ) \sin({-}a) = {-}\sin(a) . Thus, frequency N − k N - k has the same angle as the hypothetical frequency at − k {-}k : Cosines: -1 Diagram of the cosine for a hypothetical frequency -1 with sixteen samples. The wave has a single cycle. 15 Diagram of the cosine of frequency 15 with sixteen samples. The wave has fifteen cycles. The sample positions in this diagram match the ones in the cosine diagram for hypothetical frequency -1 exactly. Sines: -1 Diagram of the sine for a hypothetical frequency -1 with sixteen samples. The wave has a single cycle, negated vs a standard sine wave. 15 Diagram of the sine of frequency 15 with sixteen samples. The wave has fifteen cycles. The sample positions in this diagram match the ones in the sine diagram for hypothetical frequency -1 exactly. In practice, when computing the DFT, the frequencies above Nyquist are referred to via their negative indices instead of as the positive aliased ones. This explains why all of the frequencies in the above example (except DC and Nyquist) have two matches: the cosines match at both the positive and negative versions of the angle. This may seem redundant, but it isn’t always — we’ll get into why in a bit. Note It’s also worth noting that the multiply-then-average in the example diagram results in half the signal amplitude for each match, and when both are summed, the result represents the full amplitude! However, DC and Nyquist — because they each only have a single match — have an average that matches the amplitude exactly. Measuring Phase So far we have been looking at a signal that contains a cosine, comparing it with a test wave that is also a cosine, and getting an amplitude-relative result. But the original description of the DFT mentions both amplitude and phase as being represented, so what happens if we let the phase of the signal shift around relative to the test? An interactive diagram that demonstrates how adjusting the the signal phase affects the average. × = Interactive diagram avg → Signal Phase: 0.0 Oh no! Sliding the phase around causes the resulting average to oscillate ! While we get the expected 0.5 average when the phase is 0, it is -0.5 at a phase of 0.5 (a half-wavelength offset) and, even worse, 0 at phases of 0.25 and 0.75 (quarter- and three-quarter-wavelength offsets)! Clearly there is something else we need to consider here…and it turns out it’s the sine of the test frequency. Instead of just multiplying by the cosine of the test value, we can instead multiply by both cosine and sine to get two values per sample. If we then treat those two resulting values as a 2D coordinate (where cosine corresponds to x and sine to y ), we can average them all to get our final result, which will be at the origin for non-matching frequencies and at some non-origin position for matches. Note “Multiply by both sine and cosine” is a simplification for purposes of illustration. It works for now but is not the general form, which we’ll get to in a bit. An interactive diagram that demonstrates how adjusting the the signal and test waves affects a 2D average. × Interactive diagram = avg → Amp: 0.5 Phase: 0.00 Signal Phase: Signal Cycles: Test Cycles: Some observations from this diagram: If the cycle value magnitudes don’t match , the points are all evenly distributed around the center (and thus the average is at the origin). This makes it much easier to visualize why we end up with no measured amplitude for mismatched waves. If the cycle value magnitudes do match (i.e. a signal of 2 cycles with either 2 or -2 test cycles), the points are off-center , and thus their average is also off-center. Increasing the phase causes the resulting average to spin clockwise when the test cycle count is positive , but counter-clockwise when the test cycle count is negative . The magnitude of the average remains the same no matter the phase. At Nyquist (8 cycles), the resulting points always lie on the x axis, as the test wave’s sine values are all zeros. It turns out: a phase-shifted wave at Nyquist is indistinguishable from a non-shifted wave with scaled amplitude (because there is literally no way to represent such a phase shift with the given sample rate). This gives us a new way to think about this computation: rather than thinking of the operation as a multiplication, instead we can think of each sample of the signal being rotated by the angle of the test wave at that sample position to get a new 2D position. Those 2D positions are then summed to get a value that corresponds to the frequency’s contribution. The computed amplitude (the strength of this frequency’s contribution) is the magnitude of the resulting average (its length), and the phase is the angle of the average (computed, in this case, using atan2 ). 2D Coordinates and Complex Numbers Each result of this multiplication with cosine and sine ends up as a 2D coordinate . Canonically, the Fourier transform represents these as a complex number (of the form x + i ⋅ y x + i \cdot y ). Why complex numbers? Honestly I think it’s a hack to get a 2D coordinate that is simple to represent with standard math notation (mathemeticians, don’t @ me). Note If you, like me, prefer 2D vectors to complex numbers, just pretend that x + i y x + iy is the 2D vector [ x y ] [\,x\,\,\,y\,] as you read all of this: the real component is the x x coordinate and the imaginary component is the y y coordinate. To be fair, complex numbers do have a nice property that standard 2D vectors do not: they can be multiplied in a meaningful way. The specific complex multiplications done by the DFT (an input sample [ a + i b a + ib ] multiplied by a wave value [ c o s t + i s i n t cos\,t + i\,sin\,t ]) ends up rotating the input by the angle t t ! Note If you’re familiar with matrices and linear algebra, this complex multiply (with c c and s s representing the cosine and sine values): ( x + i y ) ⋅ ( c + i s ) (x + iy) \cdot (c + is) ⟹ ( x c − y s ) ⋅ i ( x s + y c ) \implies (xc - ys) \cdot i(xs + yc) …results in exactly the same operations as multiplying a 2D vector (x, y) with a 2x2 rotation matrix representing the same angle: [ x y ] ⋅ [ c s − s c ] \begin{bmatrix}x & y\end{bmatrix} \cdot \begin{bmatrix} c & s \\ -s & c \end{bmatrix} ⟹ [ x c − y s x s + y c ] \implies\begin{bmatrix} xc - ys && xs + yc \end{bmatrix} This also finally gives us an answer to the earlier question of why we need both the positive and negative versions of a given frequency: if the input samples are complex (i.e. 2D) instead of purely real-valued (1D), the contributions to these paired frequencies can be different, and both are needed to fully reconstruct the signal. For real-valued signals , however, the paired results will be complex conjugates , where the result ( a + i b a + ib ) for frequency k k is the conjugate of the result for frequency − k {-}k : ( a − i b a - ib ); they have the same real (x) term but opposite imaginary (y) terms. When summed, these values ( a + i b a + ib and a − i b a - ib ) become 2 a 2a as the imaginary components cancel out, which is how a signal made up of real cos \cos terms and imaginary sin \sin terms can be a purely real-valued signal. Note It’s worth pointing out something that shows up in the standard formula for the DFT: mathematical notation has an absolutely wild shorthand for cos t + i sin t \cos\,t + i\,\sin\,t : e i t e^{it} That’s right, taking the mathematical constant e e to an imaginary power is the same as a rotation around the origin. Why? Well, 3blue1brown has an explanation if you’re curious. Personally I don’t like this shorthand because it obscures the meaning of the equation, especially for non-mathemeticians (which is, if I’m doing my calculations right, most people ). Calculating the DFT Okay, we finally have all of the pieces of how to calculate a DFT, it’s time to put them together. A DFT takes a set of complex input samples in the time domain and produces the same number of complex output samples in the frequency domain, where the first output sample (at index 0 ) represents the DC offset, the middle one (at index N/2 ) represents the Nyquist frequency, and the rest are either the positive or negative angles in between. There are a couple minor (but important) differences in the value calculation done in the above interactive diagrams vs how the DFT does them: Typically the DFT rotates the opposite direction as the above diagrams (i.e. using sin ( − t ) \sin({-}t) instead of sin t \sin\,t ), so the rotations actually spin the opposite way (clockwise becomes counter-clockwise and vice versa). Rather than averaging the results of these rotations, the DFT simply sums them — no division by N is performed. Otherwise, the process described above can be used to get the contribution of any single frequency within the signal, so then we just need to do this process for every possible frequency in the signal. Thus, here we are, finally at some pseudocode to calculate the DFT: void CalculateDFT ( complex [ ] inputs , complex [ ] outputs , int length ) { for ( outIdx = 0 ; outIdx length ; outIdx ++ ) { // Start the sum at 0. float sum = 0 // This is the angular frequency (in radians/sample) for // the given output sample (the "test frequency" from the // earlier examples). float angularFreq = - 2 * pi * outIdx / length for ( inIdx = 0 ; inIdx length ; inIdx ++ ) { // Get the rotation value for the current input index // then use that to calculate the resulting rotation. float radians = inIdx * angularFreq // `i` here is the imaginary unit complex rotation = cos ( radians ) + i * sin ( radians ) // A complex multiply with a unit complex vector is // a rotation. sum += inputs [ inIdx ] * rotation } outputs [ outIdx ] = sum ; } } Note As mentioned in a previous note, the standard formulation of the DFT uses an exponential shorthand (which I do not like) to represent the rotation. Thus, the DFT is written in standard mathematical notation as: X k = ∑ n = 0 N − 1 x n ⋅ e − i 2 π k N n X_k = \displaystyle\sum_{n = 0}^{N - 1} x_n \cdot e^{-i2\pi\frac{k}{N}n} …which is equivalent to the above pseudocode. We’ve finally done it! We have some code we can use to calculate the DFT for a given signal. The above algorithm is O ( N 2 ) O(N^2) , which may seem like the best that can be done. However, there’s a bit of algorithmic trickery that can be done to get that down to O ( N log N ) O(N\,\log\,N) , which is considerably more efficient. That trickery is the fast Fourier transform (FFT) , and the next post will go into the details of how that works! (thanks to Neintonine , zerostride , and Chuck for giving me some great feedback on this before it went live!)📝JoshJers' Ramblings
C++ Programming with No AI, LSP, or Debugger: Ep16 -- Once Again Depth Tests🎥Zed A. Shaw
Understanding C++26 hazard pointersThe C++26 standard features a new header called and a new class with the same name, which, together with hazard_pointer_obj_base, provides safe memory reclamation for lock-free data structures. In this article, we’ll see how all this works. The memory reclamation problem To understand why hazard_pointer exists, we first need to look at what makes ... Read more The post Understanding C++26 hazard pointers first appeared on Marius Bancila's Blog .📝Marius Bancila's Blog
Arrays That Aren’t ThereIn my last blog, I said that to_numpy() on an implicit array computes the values into a fresh array, because an implicit array has no memory. It’s time to look at them properly. You have probably used one already without knowing it:📝Kitware Inc
I didn’t write a program with emoji, but I did use a control characterMy program was a fairly simple one. The post I didn’t write a program with emoji, but I did use a control character appeared first on The Old New Thing .📝The Old New Thing
C++ Programming with No AI, LSP, or Debugger: Ep15 -- Texture Units Duh🎥Zed A. Shaw
C++26: A Curated Tour of What's New - Marc Gregoire - CppCon 2026🎥CppCon
What C++29 profiles are and how they work🎥MeetingCpp
日本の電子楽器元年 - Fumio Mieda - ADC Japan 2026🎥audiodevcon
Lessons from 59 Linux Kernel Bug ReportsAt Microsoft’s FORGE Lab, we used codename MDASH to scan a subset of Linux kernel subsystems from late May to mid-June 2026. One full-time researcher and one intern led this three-month effort, which has so far produced 59 public upstream reports and 33 assigned CVEs . We confirmed working root privilege-escalation exploits for eight of those CVEs, and fixes for 38 of our reports have been merged into mainline. Finding the bugs was only part of the work. The initial scans produced 26,502 raw findings in about two weeks, but turning those results into reproducible bugs, upstream reports, and patches took months of expert investigation and collaboration with Linux maintainers.📝FORGE LabTuesday, November 10, 2026
Automatic MSBuild configuration for the Microsoft C++ Language Server in Copilot CLIAccurate C++ code intelligence starts with understanding how your project builds. Compiler options, include paths, and preprocessor definitions all affect how the language server interprets your source files. A compilation database, such as compile_commands.json, provides that context, so that tools such as go-to-definition and find-references can resolve symbols accurately. The Microsoft C++ Language Server now […] The post Automatic MSBuild configuration for the Microsoft C++ Language Server in Copilot CLI appeared first on C++ Team Blog .📝C++ Team Blog
Lightning Talk: Bool - Implicity Dangerous - Jeff Garland - C++Now 2026🎥CppNow
C++ Programming with No AI, LSP, or Debugger : Ep14 Images Part4🎥Zed A. Shaw
Microsoft employee price list from 1987The Microsoft product catalog. The post Microsoft employee price list from 1987 appeared first on The Old New Thing .📝The Old New Thing
How is this legal C?🎥Jacob Sorber
C++23 in MSVC: Get Ready for New Features (v14.52 Update)🎥CppCon
Telling your number parser what to expectOur fast_float library parses numbers such as -731.51 into binary floating-point values. It is part of GCC’s C++ standard library, among others. It is fast: often a few nanoseconds per number. Parsing a number means making decisions. Is there a sign? How many digits are there? Where is the decimal point? Is the processor rounding … Continue reading Telling your number parser what to expect📝Daniel Lemire's blog
Fun with designated initializersC++20 (via [P0329](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0329r4.pdf)) introduced a relatively nerfed form of designated-initializer (`.field = 42`) syntax. Unlike C, C++20 doesn't support out-of-order initializers, any mixture of designated and non-designated initializers, or array-element designators. Array-element designators like `[0] = 42` aren't supported by standard C++. Why not? Read the spoiler in [diff.dcl], or, consider Clang's behavior on the following program ([Godbolt](https://godbolt.org/z/f4Psq38j7)).📝Arthur O’Dwyer
BazelCon 2026 Recap: Recordings and NotesAnother edition of BazelCon has come to a close. We gathered to discuss what matters most in the world of Bazel, learn, network and spend some quality time with like-minded folks. If you couldn’t make it to the event or want a quick refresher on the key takeaways, we’ve put together a brief summary of the highlights. TL;DR - Recordings playlist , photo album , user survey Acknowledgments The success of this year’s event is entirely due to our incredible community. A huge thank you to our sponsors , whose support made it possible to host an event of this scale free of charge. Thank you to our speakers and trainers for delivering insightful presentations packed with knowledge that sparked many conversations throughout the week. And to our attendees - both in-person and online - for your questions, hallway discussions, and engagement that truly shape the spirit of BazelCon each year. We gathered a record number of 455 people, exceeding our expectations and giving us much to consider for next events. BUILD Foundation Kicking off Day 1 during the Keynote, Helen Altshuler and Chuck Grindel announced the launch of the BUILD Foundation. Governed by the Linux Foundation with initial members ASML, Canva, Datadog, EngFlow, Figma, and Spotify, the Foundation gives the Bazel ecosystem the leadership and sustained investment needed to take on challenges no single organization can solve alone. Key priorities for the initiative include improving technical documentation, funding maintainers for bazel-contrib repositories, launching developer training and certification, and enhancing software supply chain security. By formalizing this shared investment, the community aims to keep build times fast and dependable as engineering teams and codebases continue to scale. To discover more about the launch, explore the initial member perspectives, and find out how your organization can get involved, read the rest of the Linux Foundation press release and watch the Keynote . Bazel Community Survey 2026 To understand our users and their experiences, as well as to better guide the roadmap, the BUILD Foundation launched a survey to gather your feedback. Take the 2026 Survey More Recaps and Coverage Want to see the event through the eyes of the attendees? Check out these write-ups from other members of the community: BazelCon 2026: My Notes and Observations - by Adin Ćebić BazelCon 2026 recap - by Julio Merino A Bazel Bard - a summary of the BazelCon 2026 Hallway Track - by Son Luong Ngoc Recordings [Training Day] Tuesday, October 13th Bazel Bootcamp Advanced Bazel: Rules Authoring, Performance Tuning and Remote Execution rules_{js|ts}: JavaScript & TypeScript with Bazel Writing Bazel Rules Build File Generation Using AXL How Fast Should/Can My Build Be? A Journey to Understand Build Optimization rules_py: Python Builds with Bazel [Day 1] Wednesday, October 14th Keynote: Bazel Community Update State of the Union No Token Budget: Why Agentic Software Factories Need Bazel to Maintain Entropy One Content-Addressed Store, Zero Full Clones: Backing Bazel’s Cache and Remote Execution with Lore Content-Defined Chunking for Bazel Static types in Starlark Horapha: Your Personal Warm Bazel actiond: The quest for a better sandbox Type-checking Starlark without waiting for Bazel Taming Configurations Explosion 💥 Persistent Test Runners Where Bazel Clusters Break at Scale: Field Notes from Plaid and the EngFlow Fleet Taking Humans Out of the Build Loop bviz: Seeing What Your Bazel Build Is Actually Doing One Graph to Rule Them All: Scaling Incremental Target Graph Calculations in Monorepos More expressive platforms with platforms_contrib Stop Delivering Your Whole Fleet How Canva Runs Millions of Jest Tests with Bazel RunfilesGroupInfo: Turning *_binary Runfiles into Optimal Container Layers [Day 2] Thursday, October 15th Lessons learned building a zero-sysroot fully hermetic LLVM toolchain for Bazel rules_rs: {Fast, Hermetic, Ergonomic} - Pick 3 The Sandbox Is a Filesystem: Content-Addressed Bazel Builds on macOS with FSKit Proving Equivalence in any2bazel Build System Migrations AI development: Challenges and early learnings for Bazel Discovering and eliminating 20% of redundant build actions by tracing file system operations Diffing Millions of Screenshots a Day, Hermetically Zig Package Manager Integration, Hermetically No bytes left untracked - Bazel Supply Chain Security Pretty Python Packaging One Build, Many Configurations: Comparing Configuration Features in Bazel and Buck2 Building Uber’s Automated Migration Machine on Bazel Generate build files for new rule sets with Gazelle v2 Distributed hermetic CUDA Clang compilation using Bazel What Changed? - A Better Watch Protocol for Bazel Extend Gazelle in Starlark, not Go A py_binary Should Be Enough: Fast, Simple Python Images with Bazel Flexibility Is a Trap: How We Sealed Our Bazel Platform at Adobe Scale Closing Remarks BoF notes Remote Execution C++ Android + Android slides Bazel + IDEs Bzlmod Supply-Chain Apple Unconference notes: SkyCache (Remote Analysis Caching) + SkyCache deck Config Explosion Mitigation Notes 1 & Notes 2 E2E/SystemsTesting (Tests against hermetic environments) The Psychology of Migration (Organizational struggles & solutions) Agent Mode (How to improve Bazel for Agentic usage) Resources GitHub repository: https://github.com/bazelbuild/bazel Releases: https://github.com/bazelbuild/bazel/releases Slack chat: https://slack.bazel.build Google group: bazel-discuss@googlegroups.com Special Interest Groups (SIG): Reach out the email(s) listed below if you’d like to be added to the SIG calendar invites. SIG Meeting frequency Point of contact Rules authors Every two weeks bazel-contrib@googlegroups.com Android app development Monthly ahumesky@google.com Bazel plugin for IntelliJ Monthly en@jetbrains.com Remote execution API working group Monthly chiwang@google.com Supply chain security / SBOM Weekly fwe@google.com Interested in learning about SIGs or starting a new one? Find more information on our website . Want to get your SIG listed? Please add it to the Community repository . Ideas, feedback, and submissions are welcome! Thank you for reading this edition! Let us know if you’d like to see any new information or changes in future community updates by reaching out to product@bazel.build. We look forward to hearing from you. Thanks, Google Bazel team📝Bazel Blog