logoalt Hacker News

coldstartopsyesterday at 9:34 AM1 replyview on HN

Hi ogig, funilly enough I was also running this boids experiment a few months ago. Managed to get around 8k at 60 fps on 1 thread on my cpu, using golang.

My goal for this experiment was to encode the optimal cache data structures into meta programming generators such that claude can write high level DSL and generate down to this level of simulations. I am curious if you had such an approach also.


Replies

ogigyesterday at 10:25 AM

That's very interesting, thanks for commenting. Not my approach, I have a multithreaded Rust kernel (SoA, spatial hash, bounded-kNN, rayon on some passes). The agents sit on top of several diffuse fields, an econ layer and combat logic, all of it needing bit-determinism for the netcode.

I do use some metaprogramming, but as safety rather than generation: a declarative macro derives the modifier struct, defaults, parsing and wire order from a single list, and feeds hash/save/resync so I can add mechanics at a high level without being able to desync the sim. Also a set of probes help me test for correctness and speed after a change. So seems like I'm taking an iteration speed approach with safeguards, checking after the fact, while yours is optimizing beforehand by trying to encode optimal structs. That's fascinating, it will probably occupy my head for a good portion of the day, thanks again.