While this post has a good amount of substance, I found it rather hard to understand due to small mistakes (or hidden assumptions, or something else?). All of which seem easily fixed/clarified, but these sorts of things are unnecessary friction for readers. Edit: Thanks to Jasper for stating the big hidden assumption made by the author - that he is only considering the case of being blocked by enemy pieces, not one's…
> - max of 9 relevant occupancy bits for a bishop - how? A bishop on e4 for example would have to check b1,c2,d3,f5,g6,h7 and a8,b7,c6,d5,f3,g2,h1 for a total of 13 bits. Similar mistake for a the rook. If I'm understanding correctly: it's trivial to use a mask with the occupancy bitmap for white/black to eliminate moves atop your own pieces, and generate captures for moves atop your opponent's pieces. The sliding mo…
Blowing up my compile times for dubious benefits
11–20 of 28 posts
Re: Blowing up my compile times for dubious benefits
#12Re: Blowing up my compile times for dubious benefits
#13Re: Blowing up my compile times for dubious benefits
#14IIRC, it's using the miri interpreter, which is indeed very slow.
Re: Blowing up my compile times for dubious benefits
#15Mathematical representation of A-bar / A' - this is the complement of the set A? That should probably be `~A` and not `!A` for the bitboard operation. The logical negation would not give you the desired results, instead you want the bitwise negation (`~A`).
Re: Blowing up my compile times for dubious benefits
#16Re: Blowing up my compile times for dubious benefits
#17Re: Blowing up my compile times for dubious benefits
#18> to make all the constants known at compile time, everything has to be written in a const function. This means: No allocations [...] No for loops These constants are relatively unchanging relative to the rest of your program. Why not write a code generator (without the above weird restrictions) to compute them once and save the result?
Well, "better". "Industry practice" might be more accurate. Also "necessary" if your build system is garbage and/or your team is frighted of code generators but not meta-programming.
Re: Blowing up my compile times for dubious benefits
#19Earlier quoted context omitted.
I was also confused by this. I was wondering if he was going to use #embed or something of the like.
I’m not a Rustacean, but it seems much easier to pre compute, store in a file, then load the file at startup
Re: Blowing up my compile times for dubious benefits
#20Earlier quoted context omitted.
I was also confused by this. I was wondering if he was going to use #embed or something of the like.
I’m not a Rustacean, but it seems much easier to pre compute, store in a file, then load the file at startup
But honestly, the const code for generating the values doesn't look thaaat bad. It's bad by rust standards, but not far from what equivalent C code would look like.