#include "grouped.hpp" #include #include #include namespace sr=slime_research; namespace ns=normal_search; int main(){ std::mt19937_64 rng(2026101103); uint64_t qchecks=0,groups=0,partialSurvivors=0; for(int test=0;test<200000;++test){ sr::CellTerm cells[25]; int32_t x=int32_t(rng()%3750000)-1875000,z=int32_t(rng()%3750000)-1875000; const uint64_t anchor=sr::coordinateTerm(x,z); for(int i=0;i<25;++i)cells[i]={(sr::coordinateTerm(x+i%5,z+i/5)-anchor)&sr::kMask48,sr::kSlime}; uint32_t root=rng()&((1U<<18)-1); // Full-width random middle values also test carry and modulo behavior. uint32_t m=rng()&((1U<<17)-1); ns::Prepared p;ns::prepare(root,cells,p); for(int i=0;i<25;++i){ uint32_t expected=sr::nextStateFromTerm(root+(uint64_t(m)<<18),cells[i].term)>>17; if(ns::preparedQ(p,i,m)!=expected)throw std::runtime_error("q mismatch"); ++qchecks; } // groupMask matches the difference filter even on odd roots; final // solver parity checks remain responsible for discarding those roots. int count=1+test%25; uint32_t base=m&~240U,expected=0; for(uint32_t j=0;j<16;++j) if(full_search_experiment::differenceFilter(root+(uint64_t(base+16*j)<<18),cells,count))expected|=1U<>4)<<8)+(g&15),expected=0; for(uint32_t j=0;j<16;++j)if(full_search_experiment::differenceFilter(root+(uint64_t(base+16*j)<<18),cells,25))expected|=1U<