New memory layout for voice instancing
Captain's Log: Stardate 77872.5
I got a fair bit more work done on voice instancing today. Most of the CPU code for writing instances into the new memory layout is working. I haven't started the GPU code changes, and there's still a bunch of CPU code needed for routing MIDI note events to the right instances, etc. But some of the trickiest/largest refactors are out of the way, which is nice.
I'd again like to extol the virtues of goldens tests. I don't know how I would have made these changes so far without them. Making these kinds of sweeping refactors to how the memory is organized, especially for the memory that's communicated between the CPU and GPU which is inherently unsafe, would be so difficult without good tests. And even if I had better unit tests for this code (which I don't, because I knew this giant refactor was coming and didn't want to write unit tests until later), I'd have to make substantial changes to them for each variant of the memory layout that I try.
Whereas with the golden tests, because they are completely black-box, I can make huge changes to the simulator code and the tests tell me whether it still works. I broke lots of tests over the last couple of days, and it was relatively easy to figure out what I broke based on which tests failed, and listening to the golden output to hear what was wrong. And at each git commit, I am making sure the goldens all pass, so I always have somewhere safe to revert to if I make some bad changes. So cool.
Captain's Log: Supplemental I figured I'd mention now that devlog updates from me for the next couple of weeks might be kind of sparse. I'm getting ready to go to an intensive 10-day powered paragliding training course, where I'll be working hard from before dawn to about noon, and then a few more hours in the late afternoon, every day.
I don't really expect to get much work done, since I'll probably be super-exhausted during the downtime. But in case I do have some time where I'm feeling energized enough, my plan is to bring the M1 Macbook I bought, and to get Anukari building on it. This will be the first time that I've tried to build it on a Mac. For the first pass, I plan to aggressively #ifdef out any code that doesn't compile, and just get as much working as possible. There's a chance that I might even be able to get it working -- both OpenGL and OpenCL are deprecated on MacOS, but from what I've heard, they still should work. (I'm definitely not going to try working on the voice-instancing code. It is way too brain-intensive for sneaking into some breaks while I'm tired.)
I'm extremely excited to learn how to fly a PPG. It's something that I've wanted to do for a very long time; I probably heard about them something like 20 years ago. But it always seemed a bit too scary, or too out of reach, or whatever. In that time, though, I've acclimated myself to several other risky activities -- rock climbing, auto racing, motorcycling, dirt biking. And now, flying a PPG no longer seems crazy. We'll see if I still feel that way in a couple of weeks. 😄