Skip to content

Commit

Permalink
Merge branch 'main' into PackedKState
Browse files Browse the repository at this point in the history
  • Loading branch information
rokicki committed Aug 22, 2023
2 parents cc7dadb + 9af29e4 commit f498747
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/cpp/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ int scramblemoves = 1 ;
void timingtest(puzdef &pd) {
stacksetval p1(pd), p2(pd) ;
pd.assignpos(p1, pd.solved) ;
const int NUMRAND = 4096 ;
const int NUMRAND = 65536 ;
unsigned short randpool[NUMRAND] ;
for (int i=0; i<NUMRAND; i++)
randpool[i] = myrand(pd.moves.size()) ;
Expand All @@ -16,7 +16,7 @@ void timingtest(puzdef &pd) {
for (int i=0; i<cnt; i += 2) {
int rmv = randpool[i & (NUMRAND-1)] ;
pd.mul(p1, pd.moves[rmv].pos, p2) ;
rmv = randpool[i & (NUMRAND-1)] ;
rmv = randpool[1 + (i & (NUMRAND-1))] ;
pd.mul(p2, pd.moves[rmv].pos, p1) ;
}
double tim = duration() ;
Expand All @@ -29,7 +29,7 @@ void timingtest(puzdef &pd) {
int rmv = randpool[i & (NUMRAND-1)] ;
pd.mul(p1, pd.moves[rmv].pos, p2) ;
sum += fasthash(pd.totsize, p2) ;
rmv = randpool[i & (NUMRAND-1)] ;
rmv = randpool[1 + (i & (NUMRAND-1))] ;
pd.mul(p2, pd.moves[rmv].pos, p1) ;
sum += fasthash(pd.totsize, p1) ;
}
Expand Down Expand Up @@ -60,7 +60,7 @@ void timingtest(puzdef &pd) {
int rmv = randpool[i & (NUMRAND-1)] ;
pd.mul(p1, pd.moves[rmv].pos, p2) ;
sum += pt.lookup(p2, &looktmp) ;
rmv = randpool[i & (NUMRAND-1)] ;
rmv = randpool[1 + (i & (NUMRAND-1))] ;
pd.mul(p2, pd.moves[rmv].pos, p1) ;
sum += pt.lookup(p1, &looktmp) ;
}
Expand Down Expand Up @@ -93,7 +93,7 @@ void timingtest(puzdef &pd) {
sum += pt.lookuphindexed(tgo[i&mask]) ;
tgo[i&mask] = pt.indexhash(pd.totsize, p2) ;
pt.prefetchindexed(tgo[i&mask]) ;
rmv = randpool[i & (NUMRAND-1)] ;
rmv = randpool[1 + (i & (NUMRAND-1))] ;
pd.mul(p2, pd.moves[rmv].pos, p1) ;
sum += pt.lookuphindexed(tgo[1+(i&mask)]) ;
tgo[1+(i&mask)] = pt.indexhash(pd.totsize, p1) ;
Expand Down

0 comments on commit f498747

Please sign in to comment.