News for hackers. Stuff that matters.
Re:A compact bitset implementation used in Ocarina of Time s... by orlp on Tuesday July 08, 2025 @12:42PM (#44501697)
> The most novel aspect of OoT bitsets is that the first 4 bits in the 16-bit coordinate IDs index which bit is set. For example, 0xA5 shows that the 5th bit is set in the 10th word of the array of 16-bit integers. This only works in the 16-bit representation! 32 bit words would need 5 bits to index the bit, which wouldn't map cleanly to a nibble for debugging.

There is nothing novel about this really. It's neat that it works with hexadecimal printing to directly read off the sub-limb index but honestly who cares about that.

Outside of that observation there's no advantage to 16-bit limbs and this is just a bog-standard bitset where the first k bits indicate the position within the 2^k bit limb, and the remaining bits give you the limb index.

Re:A compact bitset implementation used in Ocarina of Time s... by jb55 on Tuesday July 08, 2025 @01:04PM (#44501902)
Re:A compact bitset implementation used in Ocarina of Time s... by lpribis on Tuesday July 08, 2025 @01:44PM (#44502299)
Haha, good to take the classic HN condescension on the chin ;)
Re:A compact bitset implementation used in Ocarina of Time s... by TimorousBestie on Tuesday July 08, 2025 @03:31PM (#44503227)
For what it’s worth, I found it interesting. I like your verve.
Re:A compact bitset implementation used in Ocarina of Time s... by orlp on Tuesday July 08, 2025 @04:24PM (#44503757)
My comment was worded a bit too harshly, sorry about that, I certainly wouldn't have worded that way in a personal message.

As I mentioned the hexadecimal printing coincidence is a neat fact, I was just excited when clicking the link to find a novel bitset idea. In my disappointment to find the standard bitset (albeit with 16-bit limbs) I reacted a bit too harshly. And as per https://xkcd.com/1053/, just because something isn't new to me doesn't mean it's not new to anyone.