Merge solver code with static interface
- Breaks backwards compat solver code with last version. Concurrent broke backwards compat because of race conditions with rng, but single is now broken too, despite it being 2x faster (!!!!) - Literally twice as fast as Rust now in single thread - Concurrent doesn't work yet, deadlocks somewhere..?
This commit is contained in:
@@ -9,10 +9,17 @@ public struct NodeScores
|
||||
public float MaxScore;
|
||||
public int Visits;
|
||||
|
||||
public void Visit(float score)
|
||||
public void VisitConcurrent(float score)
|
||||
{
|
||||
Intrinsics.CASAdd(ref ScoreSum, score);
|
||||
Intrinsics.CASMax(ref MaxScore, score);
|
||||
Interlocked.Increment(ref Visits);
|
||||
}
|
||||
|
||||
public void Visit(float score)
|
||||
{
|
||||
ScoreSum += score;
|
||||
MaxScore = Math.Max(MaxScore, score);
|
||||
Visits++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user