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

Coverage tests for Aleph::CA::Parallel_Synchronous_Engine (Phase 5). More...

#include <array>
#include <cstdint>
#include <random>
#include <vector>
#include <gtest/gtest.h>
#include <thread_pool.H>
#include <ca-tiling.H>
#include <ca-traits.H>
#include <tpl_ca_concepts.H>
#include <tpl_ca_bit_storage.H>
#include <tpl_ca_engine.H>
#include <tpl_ca_ghost_lattice.H>
#include <tpl_ca_lattice.H>
#include <tpl_ca_neighborhood.H>
#include <tpl_ca_parallel_engine.H>
#include <tpl_ca_rule.H>
#include <tpl_ca_storage.H>
Include dependency graph for tpl_ca_parallel_engine_test.cc:

Go to the source code of this file.

Functions

 TEST (CATiling, SplitRangeBalancedExactDivision)
 
 TEST (CATiling, SplitRangeBalancedRemainder)
 
 TEST (CATiling, SplitRangeBalancedEdgeCases)
 
 TEST (CATiling, RowPartitionCoversEveryIndexExactlyOnce)
 
 TEST (CATiling, BlockPartition2DCoversEveryCellOnce)
 
 TEST (CATiling, MortonEncodeRoundTripBits)
 
 TEST (CATiling, ShouldRunSequentialBelowThreshold)
 
template<typename L >
static void seed_random (L &lat, std::uint32_t seed, double density=0.4)
 
template<typename L >
static bool frames_equal (const L &a, const L &b)
 
template<typename Lattice , typename Rule , typename Neighborhood >
static void expect_engine_equivalence (const Lattice &seed, Rule rule, Neighborhood nh, std::size_t steps, std::size_t partitions, std::size_t min_cells=0)
 
 TEST (CAParallelEngine, GameOfLifeToroidalEquivalence)
 
 TEST (CAParallelEngine, GameOfLifeOpenBoundaryEquivalence)
 
 TEST (CAParallelEngine, GameOfLifeReflectiveEquivalence)
 
 TEST (CAParallelEngine, GameOfLifeConstantBoundaryEquivalence)
 
 TEST (CAParallelEngine, GameOfLifeNeumannEquivalence)
 
 TEST (CAParallelEngine, GhostLatticeToroidalEquivalence)
 
 TEST (CAParallelEngine, GhostLatticeReflectiveEquivalence)
 
 TEST (CAParallelEngine, TotalisticVonNeumannRadius2Equivalence)
 
 TEST (CAParallelEngine, TileOrderEquivalence)
 
 TEST (CAParallelEngine, Wolfram1DEquivalence)
 
 TEST (CAParallelEngine, ThreeDOuterTotalisticEquivalence)
 
 TEST (CAParallelEngine, SequentialFallbackBelowThreshold)
 
 TEST (CAParallelEngine, HookFiringSemantics)
 
 TEST (CAParallelEngine, CustomThreadPoolInjection)
 
 TEST (CAParallelEngine, DeterminismAcrossRepeatedRuns)
 
 TEST (CAParallelEngine, GliderTrajectoryIsExact)
 
 TEST (CAParallelEngine, BlinkerOscillatesUnderEveryPartitionCount)
 
 TEST (CAParallelEngine, RankOneEquivalenceSmallLattice)
 
 TEST (CAParallelEngine, BitCellStorageRunsConcurrentlyWithoutDataRaces)
 

Detailed Description

Coverage tests for Aleph::CA::Parallel_Synchronous_Engine (Phase 5).

Scope:

  • Tiling primitives (split_range_balanced, Row_Partition, Block_Partition_2D, Morton helpers).
  • Bit-for-bit equivalence between the parallel and sequential engines under multiple thread counts (1, 2, 4, 8) for:
    • 2D Game of Life on Lattice (toroidal, open, reflective, constant, neumann boundaries).
    • 2D Game of Life on Ghost_Lattice (toroidal & reflective).
    • 2D totalistic rule with Von_Neumann<2,2> neighbourhood.
    • 2D Tile<W,H> iteration order.
    • 1D Wolfram rule 30 / 110 evolution.
    • 3D outer-totalistic rule.
  • Determinism across repeated runs and across pool sizes.
  • Sequential fallback when the workload is below the threshold.
  • Pre / post hook firing semantics.
  • Custom ThreadPool injection.

Definition in file tpl_ca_parallel_engine_test.cc.

Function Documentation

◆ expect_engine_equivalence()

◆ frames_equal()

template<typename L >
static bool frames_equal ( const L &  a,
const L &  b 
)
static

◆ seed_random()

template<typename L >
static void seed_random ( L &  lat,
std::uint32_t  seed,
double  density = 0.4 
)
static

◆ TEST() [1/26]

◆ TEST() [2/26]

◆ TEST() [3/26]

◆ TEST() [4/26]

◆ TEST() [5/26]

TEST ( CAParallelEngine  ,
GameOfLifeConstantBoundaryEquivalence   
)

◆ TEST() [6/26]

TEST ( CAParallelEngine  ,
GameOfLifeNeumannEquivalence   
)

◆ TEST() [7/26]

TEST ( CAParallelEngine  ,
GameOfLifeOpenBoundaryEquivalence   
)

◆ TEST() [8/26]

TEST ( CAParallelEngine  ,
GameOfLifeReflectiveEquivalence   
)

◆ TEST() [9/26]

TEST ( CAParallelEngine  ,
GameOfLifeToroidalEquivalence   
)

◆ TEST() [10/26]

TEST ( CAParallelEngine  ,
GhostLatticeReflectiveEquivalence   
)

◆ TEST() [11/26]

TEST ( CAParallelEngine  ,
GhostLatticeToroidalEquivalence   
)

◆ TEST() [12/26]

◆ TEST() [13/26]

◆ TEST() [14/26]

TEST ( CAParallelEngine  ,
RankOneEquivalenceSmallLattice   
)

◆ TEST() [15/26]

◆ TEST() [16/26]

TEST ( CAParallelEngine  ,
ThreeDOuterTotalisticEquivalence   
)

◆ TEST() [17/26]

◆ TEST() [18/26]

TEST ( CAParallelEngine  ,
TotalisticVonNeumannRadius2Equivalence   
)

◆ TEST() [19/26]

TEST ( CAParallelEngine  ,
Wolfram1DEquivalence   
)

◆ TEST() [20/26]

TEST ( CATiling  ,
BlockPartition2DCoversEveryCellOnce   
)

◆ TEST() [21/26]

TEST ( CATiling  ,
MortonEncodeRoundTripBits   
)

◆ TEST() [22/26]

TEST ( CATiling  ,
RowPartitionCoversEveryIndexExactlyOnce   
)

◆ TEST() [23/26]

TEST ( CATiling  ,
ShouldRunSequentialBelowThreshold   
)

◆ TEST() [24/26]

TEST ( CATiling  ,
SplitRangeBalancedEdgeCases   
)

◆ TEST() [25/26]

TEST ( CATiling  ,
SplitRangeBalancedExactDivision   
)

◆ TEST() [26/26]

TEST ( CATiling  ,
SplitRangeBalancedRemainder   
)