[HN Gopher] XORShift for Magic Bitboards
___________________________________________________________________
XORShift for Magic Bitboards
Author : chilipepperhott
Score : 38 points
Date : 2025-01-04 04:11 UTC (18 hours ago)
(HTM) web link (www.strydr.net)
(TXT) w3m dump (www.strydr.net)
| DennisL123 wrote:
| tl;dr: it's a fast and simple (~5 LOCs) PRNG that has garnered
| some attraction in the computer chess community.
| PaulHoule wrote:
| Was just reading about this because I am writing a chess engine.
| I am using somebody else's move generator, I am not sure how it
| works but it is not front of mind because it is spending most
| time evaluating and managing transposition tables according to
| the profiler, I can at least 5x those and maybe I will worry
| about another microoptimisation then. But really move ordering
| can make a 10x change and I am going to iterative deepening, pv,
| killer heuristic and such.
| flohofwoe wrote:
| Also generally known as LFSRs (Linear Feedback Shift Registers):
| https://en.wikipedia.org/wiki/Linear-feedback_shift_register. One
| advantange is that they can be easily implemented in hardware
| (and then very cheaply implemented in emulators). For instance
| the noise generators in audio chips of 80s home computers were
| typically an LFSR with around 16 bits of state.
| teo_zero wrote:
| Is there any particular reason why this straightforward
| implementation of a well-known PRNG (published by Marsaglia 20
| years ago) is worth being linked from HN's first page?
| sjmulder wrote:
| Might be because of the very similar PRNG used in Advent of
| Code two weeks ago: secret = (secret ^ secret
| << 6) & 0xFFFFFF; secret = (secret ^ secret >> 5) &
| 0xFFFFFF; secret = (secret ^ secret << 11) & 0xFFFFFF;
|
| https://adventofcode.com/2024/day/22
___________________________________________________________________
(page generated 2025-01-04 23:01 UTC)