Aleph-w 3.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   
)

◆ TEST() [2/15]

TEST ( CAUpdateScheme  ,
BlockSynchronousUpdateOnlyTouchesOneBlockPerStep   
)

◆ TEST() [3/15]

TEST ( CAUpdateScheme  ,
CellRuleAsBlockRuleAppliesCellRuleToEachCorner   
)

Definition at line 422 of file ca_update_scheme_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and out.

◆ TEST() [4/15]

TEST ( CAUpdateScheme  ,
MargolusBBMConservesParticleCount   
)

◆ TEST() [5/15]

TEST ( CAUpdateScheme  ,
MargolusBBMIsReversibleFor1000Steps   
)

◆ TEST() [6/15]

TEST ( CAUpdateScheme  ,
MargolusCrittersConservesPopulationParity   
)

◆ TEST() [7/15]

TEST ( CAUpdateScheme  ,
MargolusCrittersIsReversibleFor1000Steps   
)

◆ TEST() [8/15]

TEST ( CAUpdateScheme  ,
MargolusTMGasConservesParticleCount   
)

◆ TEST() [9/15]

TEST ( CAUpdateScheme  ,
MargolusTMGasIsReversibleFor1000Steps   
)

◆ TEST() [10/15]

TEST ( CAUpdateScheme  ,
RandomAsynchronousUpdateChangesFewCellsPerStep   
)

◆ TEST() [11/15]

TEST ( CAUpdateScheme  ,
RandomAsynchronousUpdateIsReproducible   
)

◆ TEST() [12/15]

TEST ( CAUpdateScheme  ,
SequentialUpdateRelaxesSandpile   
)

Definition at line 205 of file ca_update_scheme_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and k.

◆ TEST() [13/15]

TEST ( CAUpdateScheme  ,
SequentialUpdateUsesSingleBuffer   
)

◆ TEST() [14/15]

TEST ( CAUpdateScheme  ,
SynchronousUpdateMatchesSynchronousEngineOnGameOfLife   
)

◆ TEST() [15/15]

TEST ( CAUpdateScheme  ,
SynchronousUpdateMatchesSynchronousEngineOnWolfram90   
)