Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
ca_update_scheme_test.cc File Reference

Phase 13 tests for the update-scheme strategies, the Async_Engine and the Block_Rule catalogue. More...

#include <array>
#include <cstdint>
#include <random>
#include <vector>
#include <gtest/gtest.h>
#include <ca-traits.H>
#include <tpl_ca_storage.H>
#include <tpl_ca_lattice.H>
#include <tpl_ca_neighborhood.H>
#include <tpl_ca_rule.H>
#include <tpl_ca_engine.H>
#include <tpl_ca_async_engine.H>
#include <tpl_ca_update_scheme.H>
#include <tpl_ca_block_rule.H>
Include dependency graph for ca_update_scheme_test.cc:

Go to the source code of this file.

Functions

 TEST (CAUpdateScheme, SynchronousUpdateMatchesSynchronousEngineOnGameOfLife)
 
 TEST (CAUpdateScheme, SynchronousUpdateMatchesSynchronousEngineOnWolfram90)
 
 TEST (CAUpdateScheme, SequentialUpdateRelaxesSandpile)
 
 TEST (CAUpdateScheme, SequentialUpdateUsesSingleBuffer)
 
 TEST (CAUpdateScheme, RandomAsynchronousUpdateIsReproducible)
 
 TEST (CAUpdateScheme, RandomAsynchronousUpdateChangesFewCellsPerStep)
 
 TEST (CAUpdateScheme, BlockSynchronousUpdateOnlyTouchesOneBlockPerStep)
 
 TEST (CAUpdateScheme, MargolusCrittersIsReversibleFor1000Steps)
 
 TEST (CAUpdateScheme, MargolusBBMIsReversibleFor1000Steps)
 
 TEST (CAUpdateScheme, MargolusTMGasIsReversibleFor1000Steps)
 
 TEST (CAUpdateScheme, MargolusCrittersConservesPopulationParity)
 
 TEST (CAUpdateScheme, MargolusBBMConservesParticleCount)
 
 TEST (CAUpdateScheme, MargolusTMGasConservesParticleCount)
 
 TEST (CAUpdateScheme, CellRuleAsBlockRuleAppliesCellRuleToEachCorner)
 
 TEST (CAUpdateScheme, AsyncEnginePreAndPostHooksFire)
 

Detailed Description

Phase 13 tests for the update-scheme strategies, the Async_Engine and the Block_Rule catalogue.

Coverage:

  • Synchronous_Update equivalence: Async_Engine + Synchronous_Update must produce frame-by-frame identical output to the legacy Synchronous_Engine on Game-of-Life and Wolfram rules (regression).
  • Sequential_Update on a sandpile-like relaxation rule: cell counts decay monotonically and the lattice eventually relaxes.
  • Random_Asynchronous_Update is reproducible across runs with the same master seed and visits cells in (statistically) the right distribution.
  • Block_Synchronous_Update updates exactly one block per step.
  • Margolus_Update with Critters_Rule, BBM_Rule and TM_Gas_Rule: forward(N) ∘ backward(N) = identity bit-by-bit on a 32×32 toroidal grid for N = 1000 (key Phase 13 acceptance test).

Definition in file ca_update_scheme_test.cc.

Function Documentation

◆ TEST() [1/15]

TEST ( CAUpdateScheme  ,
AsyncEnginePreAndPostHooksFire   
)

Definition at line 442 of file ca_update_scheme_test.cc.

References Aleph::CA::make_game_of_life_rule().

◆ TEST() [2/15]

TEST ( CAUpdateScheme  ,
BlockSynchronousUpdateOnlyTouchesOneBlockPerStep   
)

Definition at line 288 of file ca_update_scheme_test.cc.

References Aleph::and, Aleph::CA::make_game_of_life_rule(), and r.

◆ TEST() [3/15]

TEST ( CAUpdateScheme  ,
CellRuleAsBlockRuleAppliesCellRuleToEachCorner   
)

Definition at line 422 of file ca_update_scheme_test.cc.

References out.

◆ TEST() [4/15]

TEST ( CAUpdateScheme  ,
MargolusBBMConservesParticleCount   
)

Definition at line 389 of file ca_update_scheme_test.cc.

◆ TEST() [5/15]

TEST ( CAUpdateScheme  ,
MargolusBBMIsReversibleFor1000Steps   
)

Definition at line 357 of file ca_update_scheme_test.cc.

◆ TEST() [6/15]

TEST ( CAUpdateScheme  ,
MargolusCrittersConservesPopulationParity   
)

Definition at line 367 of file ca_update_scheme_test.cc.

References Aleph::size().

◆ TEST() [7/15]

TEST ( CAUpdateScheme  ,
MargolusCrittersIsReversibleFor1000Steps   
)

Definition at line 351 of file ca_update_scheme_test.cc.

◆ TEST() [8/15]

TEST ( CAUpdateScheme  ,
MargolusTMGasConservesParticleCount   
)

Definition at line 404 of file ca_update_scheme_test.cc.

◆ TEST() [9/15]

TEST ( CAUpdateScheme  ,
MargolusTMGasIsReversibleFor1000Steps   
)

Definition at line 362 of file ca_update_scheme_test.cc.

◆ TEST() [10/15]

TEST ( CAUpdateScheme  ,
RandomAsynchronousUpdateChangesFewCellsPerStep   
)

◆ TEST() [11/15]

TEST ( CAUpdateScheme  ,
RandomAsynchronousUpdateIsReproducible   
)

Definition at line 243 of file ca_update_scheme_test.cc.

References Aleph::CA::make_game_of_life_rule().

◆ TEST() [12/15]

TEST ( CAUpdateScheme  ,
SequentialUpdateRelaxesSandpile   
)

Definition at line 205 of file ca_update_scheme_test.cc.

References k.

◆ TEST() [13/15]

TEST ( CAUpdateScheme  ,
SequentialUpdateUsesSingleBuffer   
)

Definition at line 231 of file ca_update_scheme_test.cc.

◆ TEST() [14/15]

TEST ( CAUpdateScheme  ,
SynchronousUpdateMatchesSynchronousEngineOnGameOfLife   
)

Definition at line 117 of file ca_update_scheme_test.cc.

References Aleph::CA::make_game_of_life_rule().

◆ TEST() [15/15]