user21577: I read about Looking for Magics for Magic Bitboard, they mentioned the method "Feeding in Randoms". 
As I understand, this method works like this:
label RETRY;
magic = random();//trial

for (all cases of current square: from first case to last case)
{
  if (magic fails at any case)
    go to label RETRY;//and error
}
//Passed all cases -> success! now we have the magic for square 1, 63 more squares to go

The author said

On my Core Duo 2.8 GHz, it takes less than a second to find magic numbers for rooks and bishops for all squares

If we successfully get magic numbers with this "Randoms" method, why not just save the magic numbers to disk and load it from disk instead of running the "Feeding in Randoms" code every time at startup (that the author cares about how fast this method, isn't it faster just read the magic from disk instead of trial and error with random. If load from disk, it doesn't matter if the method takes whole day to find magic)?
Maybe I misunderstand something about this. So I want to ask Why have to find magic instead of just loading from disk?

user825: Computing magics at statup is fine because it's done only once and not very slow.

https://github.com/official-stockfish/Stockfish/blob/master/src/bitboard.cpp

// init_magics() computes all rook and bishop attacks at startup. Magic
// bitboards are used to look up attacks of sliding pieces. As a reference see
// www.chessprogramming.org/Magic_Bitboards. In particular, here we use the so
// called "fancy" approach.

Stockfish did it. Leaving the constants in the code is also fine. It's all about implementation.

21577: <p>I read about <a href="https://www.chessprogramming.org/Looking_for_Magics" rel="nofollow noreferrer">Looking for Magics</a> for Magic Bitboard, they mentioned the method "Feeding in Randoms". </p>

<p>As I understand, this method works like this:</p>

<pre><code>label RETRY;
magic = random();//trial

for (all cases of current square: from first case to last case)
{
  if (magic fails at any case)
    go to label RETRY;//and error
}
//Passed all cases -&gt; success! now we have the magic for square 1, 63 more squares to go
</code></pre>

<p>The author said</p>

<blockquote>
  <p>On my Core Duo 2.8 GHz, it takes less than a second to find magic numbers for rooks and bishops for all squares</p>
</blockquote>

<p>If we successfully get magic numbers with this "Randoms" method, why not just save the magic numbers to disk and load it from disk instead of running the "Feeding in Randoms" code every time at startup (that the author cares about how fast this method, isn't it faster just read the magic from disk instead of trial and error with random. If load from disk, it doesn't matter if the method takes whole day to find magic)?</p>

<p>Maybe I misunderstand something about this. So I want to ask Why have to find magic instead of just loading from disk?</p>
 825: <p>Computing magics at statup is fine because it's done only once and not very slow.</p>

<blockquote>
  <p><a href="https://github.com/official-stockfish/Stockfish/blob/master/src/bitboard.cpp" rel="nofollow noreferrer">https://github.com/official-stockfish/Stockfish/blob/master/src/bitboard.cpp</a></p>
</blockquote>

<pre><code>// init_magics() computes all rook and bishop attacks at startup. Magic
// bitboards are used to look up attacks of sliding pieces. As a reference see
// www.chessprogramming.org/Magic_Bitboards. In particular, here we use the so
// called "fancy" approach.
</code></pre>

<p>Stockfish did it. Leaving the constants in the code is also fine. It's all about implementation.</p>
