Search found 285 matches

by Sesse
Fri May 14, 2021 9:25 pm
Forum: Computer Chess Club: General Topics
Topic: LC0: support for windows mimalloc #1561
Replies: 3
Views: 1598

Re: LC0: support for windows mimalloc #1561

The Windows allocator is notoriously bad, especially at high concurrency. That said, it's a bit odd you'd need to allocate so much in the first place.

I've had good success with jemalloc on Windows in the past; haven't heard of mimalloc.
by Sesse
Sun Apr 11, 2021 11:03 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Subroutines, shared variables, etc.
Replies: 10
Views: 4312

Re: Subroutines, shared variables, etc.

In general: Don't micro-optimize until you have gotten down your large-scale structure first. Making your program uglier by trying to send fewer variables to subroutines (functions) might save you 5% CPU time (just to say a number; take it with a grain of salt), and will easily cause bugs costing yo...
by Sesse
Sat Apr 10, 2021 12:33 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: PERFT transposition table funny?!
Replies: 5
Views: 1622

Re: PERFT transposition table funny?!

Check performance counters, but it sounds like a case of TLB trashing (ie., your hash table is so large that the CPU can no longer keep efficiently track of where its memory pages are). Huge pages would help if that's the issue, but I have no idea whether such an old CPU supports it.
by Sesse
Tue Mar 30, 2021 7:57 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Setting up Stockfish on a server
Replies: 11
Views: 4057

Re: Setting up Stockfish on a server

Do note that Stockfish is not robust against malicious input, so if you're allowing untrusted FENs (or worse, untrusted UCI), you're at the risk of opening up a security hole.
by Sesse
Tue Mar 23, 2021 8:02 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Compiling question?
Replies: 6
Views: 1459

Re: Compiling question?

Ryzens have both AVX2 and BMI2, although the current generations (1xxx, 2xxx(?), 3xxx) have terrible support for PEXT/PDEP, which are two of the eight instructions in the set, and are the ones most likely to be explicitly used by an engine. The current generation Ryzen is 5xxx (Zen 3), which has fa...
by Sesse
Sat Mar 20, 2021 3:13 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: FEN compression
Replies: 21
Views: 9204

Re: FEN compression

Nitpick: if you assume that positions are legal, then you can reduce the cnt(candidates), in cases where you can infer that the double push would have been illegal. You can also infer turn when there is a check on the board. All this complicates code for negligible benefit in reducing avg(bits), so...
by Sesse
Sun Mar 14, 2021 10:14 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Stockfish licensing question
Replies: 12
Views: 2745

Re: Stockfish licensing question

PS: If the GPL makes your head spin, try to understand the Microsoft EULA once =)
by Sesse
Sun Mar 14, 2021 10:04 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Stockfish licensing question
Replies: 12
Views: 2745

Re: Stockfish licensing question

What Ras said, with one caveat: This is assuming Stockfish is running on your servers, not included in the client-side code (e.g. via JavaScript, or otherwise run locally on the phone).
by Sesse
Mon Mar 08, 2021 6:37 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: C++ code for board[8][8] representation
Replies: 7
Views: 2299

Re: C++ code for board[8][8] representation

You can't do what you want with std::vector, unless you write the entire initializer list out. But you can with std::array, if you're on C++17 or higher: #include <array> constexpr std::array<int, 128> init() { std::array<int, 128> ret{0}; ret['K'] = 1; ret['Q'] = 2; return ret; } constexpr std::arr...