Skip to content

Commit 8a74449

Browse files
committed
fix engine ratings
1 parent 2b74ce1 commit 8a74449

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

src/Engines/GarboChess.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2099,19 +2099,24 @@ end
20992099
--------------------------------------------------------------------------------
21002100

21012101
function M:GetEloRange()
2102-
return { 1400, 2200 }
2102+
return { 1100, 2200 }
21032103
end
21042104

21052105
function M:GetAverageCpuTime(elo)
21062106
-- Estimated CPU time in ms based on ELO (deeper search at higher ELO)
21072107
-- Always faster than sunfish and fruit
21082108
-- Faster than zugzug at depth 4+, slower at depths 1-3
2109+
local factor = 1
2110+
if elo >= 1800 then
2111+
factor = 3
2112+
end
2113+
21092114
local range = self:GetEloRange()
21102115
local t = (elo - range[1]) / math.max(1, range[2] - range[1])
21112116
-- At low ELO (depth 1-3): ~200ms (slower than zugzug at depths 1-3)
21122117
-- At high ELO (depth 4+): ~700ms (faster than zugzug at depth 4)
21132118
-- Always faster than sunfish/fruit
2114-
return 200 + t * 500 -- 200ms to 700ms
2119+
return 200 + t * 500 * factor -- 200ms to 700ms
21152120
end
21162121

21172122
--- Map state.elo to search depth (weaker = shallower, stronger = deeper). Uses state.ply_limit when set.

src/Engines/Sunfish.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ end
804804
-- Engine interface
805805
--------------------------------------------------------------------------------
806806
function M:GetEloRange()
807-
return {1200, 2000}
807+
return {600, 1500}
808808
end
809809

810810
--- Node limit from state.node_limit when set, else from state.elo.
@@ -828,10 +828,10 @@ function M:GetAverageCpuTime(elo)
828828
local nodeCount = 500 + t * 3500
829829
if nodeCount < 2000 then
830830
-- Below 2000 nodes: sunfish is faster, so lower time
831-
return math.floor(250 + t * 250) -- 250ms to 450ms
831+
return math.floor(400 + t * 250) -- 250ms to 450ms
832832
else
833833
-- Above 2000 nodes: fruit is faster, so sunfish time increases more
834-
return math.floor(450 + (t - 0.43) * 1300) -- 450ms to 1300ms
834+
return math.floor(600 + (t - 0.43) * 1800) -- 450ms to 1300ms
835835
end
836836
end
837837

src/Engines/Zugzug.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ function M:GetAverageCpuTime(elo)
2929
-- depth 1: ~40ms, depth 2: ~150ms, depth 3: ~600ms, depth 4: ~2800ms
3030
-- At depth 4, zugzug becomes slower than garbochess at equivalent ELO
3131
if elo <= 400 then return 40 end -- depth 1 (faster than garbochess)
32-
if elo <= 700 then return 150 end -- depth 2 (faster than garbochess)
33-
if elo <= 850 then return 600 end -- depth 3 (faster than garbochess)
32+
if elo <= 700 then return 600 end -- depth 2 (faster than garbochess)
33+
if elo <= 850 then return 800 end -- depth 3 (faster than garbochess)
3434
return 2800 -- depth 4 (slower than garbochess at equivalent ELO)
3535
end
3636

0 commit comments

Comments
 (0)