Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fuzz_utils #218

Merged
merged 1 commit into from
Aug 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions test/fuzz_play.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ fuzz_debug(;fun=tournament!,n_players=10,bank_roll=30,n_games=3788)
where `3788` was found from
fuzz(;fun=tournament!,n_players=10,bank_roll=30,n_games=10000)

players = (
Player(Bot5050(), 1; bank_roll=9),
Player(Bot5050(), 2; bank_roll=5),
Player(Bot5050(), 3; bank_roll=4),
)
fuzz_given_players_debug(;fun=play!, players, n_games=138)
fuzz_debug(; fun = tournament!, n_players = 2, bank_roll = 6, n_games = 1)
fuzz_debug(; fun = tournament!, n_players = 3, bank_roll = 6, n_games = 38)
fuzz_debug(; fun = play!, n_players = 3, bank_roll = 200, n_games = 2373)
Expand Down
10 changes: 7 additions & 3 deletions test/fuzz_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,15 @@ swap the logger to debug level for the
indices that fail.
=#
function fuzz_debug(;fun,n_players, n_games, bank_roll=200)
crashes = fuzz(;fun=fun,n_players=n_players, n_games=n_games, bank_roll=bank_roll)
Random.seed!(1234)
players = ntuple(i->Player(Bot5050(), i; bank_roll=bank_roll), n_players)
fuzz_given_players_debug(;fun,n_games, players)
end

function fuzz_given_players_debug(;fun,n_games, players)
crashes = fuzz_given_players(;fun=fun,players=deepcopy(players), n_games=n_games)
Random.seed!(1234)
@time begin
games = get_games(; n_games=n_games, crashes=crashes, players=players)
games = get_games(; n_games=n_games, crashes=crashes, players=deepcopy(players))
end
for n in 1:length(games)
try
Expand Down
Loading