Differential random games: main's page and this checkout's play the same seeded game move for move
scripts/route-fuzz.js plays many random games (every mode: presets, sandbox, scenarios, the weekly, puzzles, architect runs, or a save) on two pages in one process and compares all of R, R.fl, R.ef, the PNI lists and S after every move and every day, and routing with the kept tables against routing without them. tests/route-fuzz.test.js plays four.
This commit is contained in:
parent
8b0c624b21
commit
640b65ce9a
5 changed files with 471 additions and 0 deletions
|
|
@ -146,6 +146,8 @@ built from (the live graph with its weights; every exit with what it reaches and
|
|||
the events that move routes), so most days, when only demand changes, they are reused, and any other change rebuilds
|
||||
them. Only indices are kept: exits, lists and paths are made fresh every call, because routing writes on them.
|
||||
`tests/route-cache.test.js` checks the keys, and the equivalence tests route with and without the kept tables.
|
||||
`scripts/route-fuzz.js` plays hundreds of random seeded games on main's page and this checkout's at once, comparing all
|
||||
of R and S after every move and day, with the kept tables and without (`tests/route-fuzz.test.js` plays a few).
|
||||
|
||||
Each loop of `compute()` runs in a function of its own (the stages are closures, the busiest is `rankPass`;
|
||||
the money is `computeMoney()`). V8 optimises a small function quickly and keeps it; `compute()` as one 33 KB function
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue