James Berrow
banner
spacejames.bsky.social
James Berrow
@spacejames.bsky.social
C++/OpenCL/Binary Black Hole collisions. Space and astrophysics, with a side dish of cats

https://20k.github.io
I sunk some time into this recently! Sadly the naive approach of trying to directly use gaia parallax didn't pan out - I was a bit optimistic about its accuracy. Looks like a more sensible approach is to fit star distance based on proper velocities + radial profile I'd guess, so take 2!
May 28, 2025 at 5:38 PM
Now I have my favourite thing ever, which is a hardcoded table that looks like this:

std::vector<int> data_lengths{
7,12,12,10,10,11,12,11,11,7,7,8,8,1,3,3,7,11,12,11,11,3,8,6,19,6,12,5,12,5,11,9,10,9,6,2,1};

Still, hard to be anything other than happy the data exists for free and easily available
May 27, 2025 at 12:59 AM
Those byte offsets and type sizes (eg 220-221 + I2) should be much larger, which renders all the offsets later in the file broken as well. The joys of data processing
May 27, 2025 at 12:57 AM
On one hand, being on bsky instead of twitter has hurt me professionally

On the other hand, one of my friend's entire family tree was murdered by nazis, and they're the sole surviving branch of a giant tree of thousands of people

Its not an especially difficult choice. Here's a cat:
May 26, 2025 at 8:22 PM
"Industry built on crime would collapse if the law was enforced"
May 26, 2025 at 3:58 PM
I'm going to guess I might be able to guess the mass from the star's magnitude, seems fraught with errors though
May 25, 2025 at 7:17 PM
It looks like:

1. Distances for many stars comes from gaia
2. The z component of the velocity comes from omegacat I
3. I'll have to build an approximate model to fit the other stars roughly based on their proper motion + position

Absolutely no idea how to determine mass though
May 25, 2025 at 7:15 PM
More technically its a measure of the constraint error. This *can* be a useful measure of how inaccurate the simulation is (though its tricky to interpret it like that), but its a very good metric of whether or not the simulation is likely to stop functioning altogether
May 24, 2025 at 3:32 PM
The nuclear option would be to decouple the particle step rate from the grid step rate, which could probably push it up into ~1 billion with some tweaks. Do I need a billion stars? ..maybe
May 24, 2025 at 5:51 AM
Each star at the moment is discretised into a volume of 4x4x4 grid cells. While 1 grid cell is too few (and introduces systematic errors), you can in theory shrink the size to 2x2x2. That solves 50% of the next performance step up - the particle stepping would be the next big problem
May 24, 2025 at 5:46 AM
Top left is a measure of how unhappy the sim is. If it looks like a disco rave ball, that means things are going poorly
May 24, 2025 at 2:08 AM
I've always wanted to build a fully relativistic galaxy simulation. This is based on some particle dynamics I put together a few years ago that I found a few major mistakes in (as well as relying on a paper with bad equations), so fingers crossed that it all Magically Works™
May 23, 2025 at 1:48 AM
I clicked on *one* bike fork on amazon recently, and for 2 months I got nothing but bike fork ads. Apparently there was a 0% chance I wanted anything but a bike fork, which was now the sole object of desire in my life

People say that targeted ads are amazing, but seems remarkably poor marketing
May 22, 2025 at 3:13 PM
Yeah that's the intent! This kind of setup is working with 'collisionless particles', so this can represent any object with gravity which doesn't (meaningfully) interact with its surroundings
May 22, 2025 at 2:19 PM
This is a test case of a cloud of 200k stars collapsing. The initial velocity distribution and mass distribution isn't anything real though, I'm more just checking that this all works correctly

There's enough particles now to be able to put together a decent galaxy sim, or perhaps even a cluster!
May 22, 2025 at 12:08 PM