From 946466ee7c1eed6f843d9c7437d1a9fcb06da8a1 Mon Sep 17 00:00:00 2001 From: "mmore500.login+git@gmail.com" Date: Fri, 28 May 2021 19:51:44 -0400 Subject: [PATCH 1/9] Bugfix: use correct direction for spawnsending log --- include/dish2/services/SpawnSendingService.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/dish2/services/SpawnSendingService.hpp b/include/dish2/services/SpawnSendingService.hpp index b11f45d345..294c746438 100644 --- a/include/dish2/services/SpawnSendingService.hpp +++ b/include/dish2/services/SpawnSendingService.hpp @@ -13,7 +13,7 @@ #include "../../../third-party/Empirical/include/emp/base/vector.hpp" #include "../../../third-party/signalgp-lite/include/sgpl/utility/ThreadLocalRandom.hpp" -#include "../cell/cardinal_iterators/GenomeNodeOutputWrapper.hpp" +#include "../cell/cardinal_iterators/IdentityWrapper.hpp" #include "../cell/cardinal_iterators/ResourceStockpileWrapper.hpp" #include "../cell/cardinal_iterators/SpawnArrestWrapper.hpp" #include "../cell/cardinal_iterators/SpawnCountWrapper.hpp" @@ -71,13 +71,13 @@ struct SpawnSendingService { if ( available_resource < 1 ) return; thread_local emp::vector< std::reference_wrapper< - typename dish2::GenomeNodeOutputWrapper::value_type + typename dish2::IdentityWrapper::value_type > > requested_outputs; requested_outputs.clear(); uitsl::copy_if( - cell.template begin>(), - cell.template end>(), + cell.template begin>(), + cell.template end>(), cell.template begin>(), cell.template begin>(), std::back_inserter( requested_outputs ), @@ -92,7 +92,7 @@ struct SpawnSendingService { ); // do the spawn send - requested_outputs[ idx ].get().Put( *cell.genome ); + requested_outputs[ idx ].get().genome_node_output.Put( *cell.genome ); available_resource -= 1; // record spawn send in spawn count @@ -104,7 +104,7 @@ struct SpawnSendingService { ); // record spawn event in running log - const auto& peripheral = cell.cardinals[idx].peripheral; + const auto& peripheral = requested_outputs[ idx ].get().peripheral; const size_t replev = peripheral.readable_state.template Get< dish2::RepLevRequest >().GetRepLev(); From b628032b5aad4e503150043e6bcbce499f1e13f9 Mon Sep 17 00:00:00 2001 From: "mmore500.login+git@gmail.com" Date: Fri, 28 May 2021 21:49:46 -0400 Subject: [PATCH 2/9] Enable exceptions in web debug mode Also optimize for size --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 4cec985201..8b7e96a3b0 100644 --- a/Makefile +++ b/Makefile @@ -46,10 +46,10 @@ CFLAGS_nat_profile := -pg -DNDEBUG $(OMP_FLAG) $(CFLAGS_all) # Emscripten compiler information CXX_web := emcc -OFLAGS_web_all := $(CXXFLAGS) -Wno-mismatched-tags -Wno-empty-body -s USE_ZLIB=1 -s USE_LIBLZMA=1 -s "EXTRA_EXPORTED_RUNTIME_METHODS=['ccall', 'cwrap']" -s TOTAL_MEMORY=671088640 --js-library $(EMP_DIR)/web/library_emp.js -s EXPORTED_FUNCTIONS="['_main', '_empCppCallback', '_empDoCppCallback']" -s DISABLE_EXCEPTION_CATCHING=1 -s NO_EXIT_RUNTIME=1 -s ABORTING_MALLOC=0 -I/usr/lib/x86_64-linux-gnu/openmpi/include/ +OFLAGS_web_all := $(CXXFLAGS) -Wno-mismatched-tags -Wno-empty-body -s USE_ZLIB=1 -s USE_LIBLZMA=1 -s "EXTRA_EXPORTED_RUNTIME_METHODS=['ccall', 'cwrap']" -s TOTAL_MEMORY=671088640 --js-library $(EMP_DIR)/web/library_emp.js -s EXPORTED_FUNCTIONS="['_main', '_empCppCallback', '_empDoCppCallback']" -s NO_EXIT_RUNTIME=1 -s ABORTING_MALLOC=0 -I/usr/lib/x86_64-linux-gnu/openmpi/include/ OFLAGS_web_pthread := -s USE_PTHREADS=1 -s PROXY_TO_PTHREAD=1 -OFLAGS_web := -O3 -DNDEBUG -OFLAGS_web_debug := -g4 -Wno-dollar-in-identifier-extension -s DEMANGLE_SUPPORT=1 -s ASSERTIONS=2 -s SAFE_HEAP=1 -s STACK_OVERFLOW_CHECK=2 -D_GLIBCXX_DEBUG -D_LIBCPP_DEBUG +OFLAGS_web := -O3 -DNDEBUG -s DISABLE_EXCEPTION_CATCHING=1 +OFLAGS_web_debug := -g4 -Oz -Wno-dollar-in-identifier-extension -s DEMANGLE_SUPPORT=1 -s ASSERTIONS=2 -s SAFE_HEAP=1 -s STACK_OVERFLOW_CHECK=2 -D_GLIBCXX_DEBUG -D_LIBCPP_DEBUG -fexceptions CFLAGS_web := $(CFLAGS_all) $(OFLAGS_web) $(OFLAGS_web_all) CFLAGS_web_pthread := $(CFLAGS_all) $(OFLAGS_web) $(OFLAGS_web_pthread) $(OFLAGS_web_all) From b8a6835ada8f3ae6ce02b8ab9f9e50769bd15867 Mon Sep 17 00:00:00 2001 From: "mmore500.login+git@gmail.com" Date: Sun, 30 May 2021 01:52:25 -0400 Subject: [PATCH 3/9] Fixup small bugs in data recording --- include/dish2/load/reconstitute_population_load.hpp | 1 - include/dish2/record/dump_genome_statistics.hpp | 3 ++- include/dish2/record/dump_spawn_log.hpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/dish2/load/reconstitute_population_load.hpp b/include/dish2/load/reconstitute_population_load.hpp index 0e2c7a02be..388818fe6d 100644 --- a/include/dish2/load/reconstitute_population_load.hpp +++ b/include/dish2/load/reconstitute_population_load.hpp @@ -16,7 +16,6 @@ #include "../../../third-party/Empirical/include/emp/tools/keyname_utils.hpp" #include "../../../third-party/Empirical/include/emp/tools/string_utils.hpp" -#include "../algorithm/seed_genomes_into.hpp" #include "../genome/Genome.hpp" #include "../utility/autoload.hpp" diff --git a/include/dish2/record/dump_genome_statistics.hpp b/include/dish2/record/dump_genome_statistics.hpp index 87d83df56c..b90c8eb82e 100644 --- a/include/dish2/record/dump_genome_statistics.hpp +++ b/include/dish2/record/dump_genome_statistics.hpp @@ -56,7 +56,8 @@ void dump_genome_statistics( file.AddVal( v, emp::to_string("Treatment ", k) ); } } - file.AddVal( "proc", emp::to_string( uitsl::get_proc_id() ) ); + file.AddVal( uitsl::get_proc_id(), "proc" ); + file.AddVal( dish2::thread_idx, "thread" ); const std::string slug = dish2::make_genome_slug( genome_filename ); file.AddVar(slug, "Genome Slug"); diff --git a/include/dish2/record/dump_spawn_log.hpp b/include/dish2/record/dump_spawn_log.hpp index 48301b430a..8fcb753874 100644 --- a/include/dish2/record/dump_spawn_log.hpp +++ b/include/dish2/record/dump_spawn_log.hpp @@ -5,12 +5,12 @@ #include #include +#include "../../../third-party/bxzstr/include/bxzstr.hpp" #include "../../../third-party/conduit/include/uitsl/algorithm/for_each.hpp" #include "../../../third-party/conduit/include/uitsl/mpi/comm_utils.hpp" #include "../../../third-party/Empirical/include/emp/data/DataFile.hpp" #include "../../../third-party/Empirical/include/emp/tools/keyname_utils.hpp" #include "../../../third-party/Empirical/include/emp/tools/string_utils.hpp" -#include "../../../third-party/header-only-gzstream/include/hogzstr/gzstream.hpp" #include "../../../third-party/signalgp-lite/include/sgpl/utility/CountingIterator.hpp" #include "../config/has_replicate.hpp" @@ -30,12 +30,12 @@ void dump_spawn_log( const dish2::ThreadWorld< Spec >& world ) { const auto& population = world.population; - const thread_local std::string out_filename = dish2::pare_keyname_filename( + const std::string out_filename = dish2::pare_keyname_filename( dish2::make_spawn_log_filename(), dish2::make_data_path() ); - thread_local bxz::ofstream out_stream( + bxz::ofstream out_stream( dish2::make_data_path( out_filename ), bxz::lzma, 6 ); emp::DataFile file( out_stream ); From c094664328884501ab1676e590609ea52930e53a Mon Sep 17 00:00:00 2001 From: "mmore500.login+git@gmail.com" Date: Sun, 30 May 2021 02:01:17 -0400 Subject: [PATCH 4/9] Remove excess attrs from asconfigured --- include/dish2/config/dump_config_csv.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/dish2/config/dump_config_csv.hpp b/include/dish2/config/dump_config_csv.hpp index b1b3d6160f..e165c2ca99 100644 --- a/include/dish2/config/dump_config_csv.hpp +++ b/include/dish2/config/dump_config_csv.hpp @@ -25,12 +25,9 @@ void dump_config_csv() { auto keyname_attributes = emp::keyname::unpack_t{ {"a", "asconfigured"}, {"proc", emp::to_string( uitsl::get_proc_id() ) }, - {"source", EMP_STRINGIFY(DISHTINY_HASH_)}, {"ext", ".csv"} }; - if ( dish2::get_repro() ) keyname_attributes[ "repro" ] = *dish2::get_repro(); - dish2::mkdir_exists_ok( "./outmeta" ); const std::string outname = dish2::pare_keyname_filename( @@ -39,6 +36,7 @@ void dump_config_csv() { const std::string outpath = emp::to_string("outmeta/", outname); emp::DataFile df( outpath ); + df.AddVal( EMP_STRINGIFY(DISHTINY_HASH_), "source" ); if ( dish2::get_repro() ) df.AddVal( *dish2::get_repro(), "Repro" ); if ( dish2::get_endeavor() ) df.AddVal( *dish2::get_endeavor(), "Endeavor" ); if ( dish2::get_slurm_job_id() ) df.AddVal( From 782e39e33d59df469352270c3ec6c7217c52a4d0 Mon Sep 17 00:00:00 2001 From: "mmore500.login+git@gmail.com" Date: Mon, 31 May 2021 19:58:22 -0400 Subject: [PATCH 5/9] Draft PhyloFingerprints and write rudimentary test --- include/dish2/genome/PhyloFingerprints.hpp | 134 +++++++++++++++++++++ include/dish2/polyfill/bit_floor.hpp | 17 +++ include/dish2/polyfill/bit_width.hpp | 19 +++ include/dish2/polyfill/countr_zero.hpp | 18 +++ tests/dish2/genome/Makefile | 1 + tests/dish2/genome/PhyloFingerprints.cpp | 117 ++++++++++++++++++ 6 files changed, 306 insertions(+) create mode 100644 include/dish2/genome/PhyloFingerprints.hpp create mode 100644 include/dish2/polyfill/bit_floor.hpp create mode 100644 include/dish2/polyfill/bit_width.hpp create mode 100644 include/dish2/polyfill/countr_zero.hpp create mode 100644 tests/dish2/genome/PhyloFingerprints.cpp diff --git a/include/dish2/genome/PhyloFingerprints.hpp b/include/dish2/genome/PhyloFingerprints.hpp new file mode 100644 index 0000000000..83841e8c7b --- /dev/null +++ b/include/dish2/genome/PhyloFingerprints.hpp @@ -0,0 +1,134 @@ +#pragma once +#ifndef DISH2_GENOME_PHYLOFINGERPRINTS_HPP_INCLUDE +#define DISH2_GENOME_PHYLOFINGERPRINTS_HPP_INCLUDE + +#include +#include + +#include "../polyfill/bit_floor.hpp" +#include "../polyfill/bit_width.hpp" +#include "../polyfill/countr_zero.hpp" + +// #include "../../../third-party/Empirical/include/emp/base/vector.hpp" +#include "../../../third-party/signalgp-lite/include/sgpl/utility/ThreadLocalRandom.hpp" + +namespace dish2 { + +class PhyloFingerprints { + + uint64_t generation_counter{}; + + // ordered from most ancient (index 0 / fingerprints.front()) + // to most recent (index n - 1 / fingerprints.back()) + std::vector fingerprints; + // absolute generation corresponding to each fingerprint + std::vector generations; + +// todo remove +public: + + // msb == most significant bit + static uint64_t clear_msb(const uint64_t v) { + return v - std::bit_floor(v); + } + + // lsb == lowest set bit + // aka (x & -x).set_width() + // not defined for x == 0 + // == https://oeis.org/A001511 - 1 + static uint64_t get_lsb_index(const uint64_t v) { + emp_assert(v); + return std::countr_zero(v); + } + + // 0 == no drop + // should generate sequence + // 0, 0, 1, 0, 1, 2, 1, 0, 1, 2, 1, 3, 1, 2, 1, 0, ... + // non-zero interludes are from https://oeis.org/A001511 + // zeros occur when index is an even power of two + static uint64_t calc_drop_idx(const uint64_t gen) { + const uint64_t leftover = clear_msb(gen); + if ( leftover ) return get_lsb_index(leftover) + 1; + else return 0; + } + + void append_fingerprint() { + fingerprints.push_back( + sgpl::tlrand.Get().GetUInt64() + ); + generations.push_back( + generation_counter + ); + } + + void maybe_drop_fingerprint(const size_t drop_idx) { + if ( drop_idx ) { + fingerprints.erase( + std::next( std::rbegin(fingerprints), drop_idx ).base() + ); + generations.erase( + std::next( std::rbegin(generations), drop_idx ).base() + ); + } + } + + void print() { + for ( auto& g : generations ) std::cout << generation_counter - g << " "; + std::cout << '\n'; + } + +public: + + PhyloFingerprints() { append_fingerprint(); ++generation_counter; } + + void ElapseGeneration() { + ++generation_counter; + + maybe_drop_fingerprint( calc_drop_idx(generation_counter) ); + + append_fingerprint(); + } + + size_t DivergedAtLeast( const PhyloFingerprints& other ) const { + const auto [our_mismatch, others_mismatch] = std::mismatch( + std::begin( fingerprints ), std::end( fingerprints ), + std::begin( other.fingerprints ) + ); + + const size_t num_divergent_fingerprints = std::distance( + our_mismatch, std::end( fingerprints ) + ); + + if ( num_divergent_fingerprints ) { + const size_t first_divergent_generation = generations[ + generations.size() - num_divergent_fingerprints + ]; + return generation_counter - first_divergent_generation; + } else return 0; + + } + + size_t DivergedLessThan( const PhyloFingerprints& other ) const { + const auto [our_mismatch, others_mismatch] = std::mismatch( + std::begin( fingerprints ), std::end( fingerprints ), + std::begin( other.fingerprints ) + ); + + const size_t num_common_fingerprints = std::distance( + std::begin( fingerprints ), our_mismatch + ); + + if ( num_common_fingerprints ) { + const size_t last_common_generation = generations[ + num_common_fingerprints - 1 + ]; + return generation_counter - last_common_generation; + } else return -1; + + } + +}; + +} // namespace dish2 + +#endif // #ifndef DISH2_GENOME_PHYLOFINGERPRINTS_HPP_INCLUDE diff --git a/include/dish2/polyfill/bit_floor.hpp b/include/dish2/polyfill/bit_floor.hpp new file mode 100644 index 0000000000..e4261273ec --- /dev/null +++ b/include/dish2/polyfill/bit_floor.hpp @@ -0,0 +1,17 @@ +#pragma once +#ifndef DISH2_POLYFILL_BIT_FLOOR_HPP_INCLUDE +#define DISH2_POLYFILL_BIT_FLOOR_HPP_INCLUDE + +#include "bit_width.hpp" + +namespace std { + + template< typename T > + T bit_floor(T x) { + if (x != 0) return T{1} << (std::bit_width(x) - 1); + else return 0; + } + +} // namespace std + +#endif // #ifndef DISH2_POLYFILL_BIT_FLOOR_HPP_INCLUDE diff --git a/include/dish2/polyfill/bit_width.hpp b/include/dish2/polyfill/bit_width.hpp new file mode 100644 index 0000000000..3dc97fdda0 --- /dev/null +++ b/include/dish2/polyfill/bit_width.hpp @@ -0,0 +1,19 @@ +#pragma once +#ifndef DISH2_POLYFILL_BIT_WIDTH_HPP_INCLUDE +#define DISH2_POLYFILL_BIT_WIDTH_HPP_INCLUDE + +namespace std { + + template< typename T > + size_t bit_width(T x) { + size_t res{}; + while (x) { + x >>= 1; + ++res; + } + return res; + } + +} // namespace std + +#endif // #ifndef DISH2_POLYFILL_BIT_WIDTH_HPP_INCLUDE diff --git a/include/dish2/polyfill/countr_zero.hpp b/include/dish2/polyfill/countr_zero.hpp new file mode 100644 index 0000000000..eed250e35f --- /dev/null +++ b/include/dish2/polyfill/countr_zero.hpp @@ -0,0 +1,18 @@ +#pragma once +#ifndef DISH2_POLYFILL_COUNTR_ZERO_HPP_INCLUDE +#define DISH2_POLYFILL_COUNTR_ZERO_HPP_INCLUDE + +namespace std { + + // adapted from https://johnmcfarlane.github.io/cnl/bit_8h_source.html + template< typename T > + size_t countr_zero(T x) { + return (x & 1) + ? 0 + : countr_zero(static_cast(x >> 1)) + 1 + ; + } + +} // namespace std + +#endif // #ifndef DISH2_POLYFILL_COUNTR_ZERO_HPP_INCLUDE diff --git a/tests/dish2/genome/Makefile b/tests/dish2/genome/Makefile index d72313deb8..4a6277a3ce 100644 --- a/tests/dish2/genome/Makefile +++ b/tests/dish2/genome/Makefile @@ -3,6 +3,7 @@ TARGET_NAMES += GenerationCounter TARGET_NAMES += Genome TARGET_NAMES += MutationCounter TARGET_NAMES += KinGroupID +TARGET_NAMES += PhyloFingerprints TARGET_NAMES += RootID TO_ROOT := $(shell git rev-parse --show-cdup) diff --git a/tests/dish2/genome/PhyloFingerprints.cpp b/tests/dish2/genome/PhyloFingerprints.cpp new file mode 100644 index 0000000000..a3f189cb0e --- /dev/null +++ b/tests/dish2/genome/PhyloFingerprints.cpp @@ -0,0 +1,117 @@ +#include + +#define CATCH_CONFIG_MAIN + +#include "Catch/single_include/catch2/catch.hpp" +#include "cereal/include/cereal/archives/binary.hpp" +#include "cereal/include/cereal/archives/json.hpp" +#include "conduit/include/uitsl/mpi/MpiGuard.hpp" + +#include "dish2/genome/PhyloFingerprints.hpp" +#include "dish2/spec/Spec.hpp" + +using Spec = dish2::Spec_default; + +const uitsl::MpiGuard guard; + +// TEST_CASE("Test Binary Serialization") { +// +// dish2::EventTags original{}; +// +// std::stringstream ss; +// +// { +// cereal::JSONOutputArchive oarchive(ss); // Create an output archive +// oarchive(original); // Write the data to the archive +// } // archive goes out of scope, ensuring all contents are flushed +// +// dish2::EventTags dup; +// { +// cereal::JSONInputArchive iarchive(ss); // Create an input archive +// iarchive(dup); +// } +// +// REQUIRE( original == dup ); +// +// } +// +// TEST_CASE("Test JSON Serialization") { +// +// dish2::EventTags original{}; +// +// std::stringstream ss; +// +// { +// cereal::JSONOutputArchive oarchive(ss); // Create an output archive +// oarchive(original); // Write the data to the archive +// } // archive goes out of scope, ensuring all contents are flushed +// +// dish2::EventTags dup; +// { +// cereal::JSONInputArchive iarchive(ss); // Create an input archive +// iarchive(dup); +// } +// +// REQUIRE( original == dup ); +// +// } + +TEST_CASE("get_lsb_index") { + + for (size_t gen{1}; gen < 100; ++gen) { + // std::cout + // << gen << " " + // << dish2::PhyloFingerprints::get_lsb_index(gen) + 1 + // << '\n'; + } + +} + +TEST_CASE("clear_msb") { + + for (size_t gen{}; gen < 100; ++gen) { + // std::cout + // << gen << " " + // << dish2::PhyloFingerprints::clear_msb(gen) + // << '\n'; + } + +} + +TEST_CASE("calc_drop_idx") { + + for (size_t gen{}; gen < 100; ++gen) { + // std::cout + // << gen << " " + // << dish2::PhyloFingerprints::calc_drop_idx(gen) + // << '\n'; + } + +} + +TEST_CASE("logrithmic growth") { + // TODO +} + +TEST_CASE("Deduction") { + + dish2::PhyloFingerprints parent; + + for (size_t gen{}; gen < 100; ++gen) parent.ElapseGeneration(); + + dish2::PhyloFingerprints offspring = parent; + + for (size_t gen{}; gen < 100; ++gen) { + std::cout + << "actualy diverged " << gen << " generations ago," + << "deduced between " + << parent.DivergedAtLeast( offspring ) + << " and " + << parent.DivergedLessThan( offspring ) + << " generations\n"; + + parent.ElapseGeneration(); + offspring.ElapseGeneration(); + } + +} From d00e07bc7b140589d1aa9c7b12bcafd31da024f9 Mon Sep 17 00:00:00 2001 From: "mmore500.login+git@gmail.com" Date: Mon, 31 May 2021 23:53:12 -0400 Subject: [PATCH 6/9] Replace size_t with uint64_t --- .../introspective_state/raw_introspective_state/Epoch.hpp | 4 ++-- .../raw_introspective_state/IncomingInterMessageCounter.hpp | 4 ++-- .../raw_introspective_state/IncomingIntraMessageCounter.hpp | 4 ++-- .../raw_introspective_state/KinGroupAge.hpp | 6 +++--- .../raw_introspective_state/KinGroupIDAncestorView.hpp | 4 ++-- .../raw_introspective_state/NumKnownQuorumBits.hpp | 4 ++-- .../raw_introspective_state/PhylogeneticRootView.hpp | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/Epoch.hpp b/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/Epoch.hpp index be793c1290..3dd8412f3e 100644 --- a/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/Epoch.hpp +++ b/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/Epoch.hpp @@ -7,9 +7,9 @@ namespace dish2 { -struct Epoch : public uitsl::PodLeafNode { +struct Epoch : public uitsl::PodLeafNode { // inherit constructors - using parent_t = uitsl::PodLeafNode; + using parent_t = uitsl::PodLeafNode; using parent_t::parent_t; }; diff --git a/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/IncomingInterMessageCounter.hpp b/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/IncomingInterMessageCounter.hpp index 04e49836a1..46f5560e00 100644 --- a/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/IncomingInterMessageCounter.hpp +++ b/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/IncomingInterMessageCounter.hpp @@ -7,9 +7,9 @@ namespace dish2 { -struct IncomingInterMessageCounter : public uitsl::PodLeafNode { +struct IncomingInterMessageCounter : public uitsl::PodLeafNode { // inherit constructors - using parent_t = uitsl::PodLeafNode; + using parent_t = uitsl::PodLeafNode; using parent_t::parent_t; }; diff --git a/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/IncomingIntraMessageCounter.hpp b/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/IncomingIntraMessageCounter.hpp index d9cebe7cc0..70a4fa667d 100644 --- a/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/IncomingIntraMessageCounter.hpp +++ b/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/IncomingIntraMessageCounter.hpp @@ -7,9 +7,9 @@ namespace dish2 { -struct IncomingIntraMessageCounter : public uitsl::PodLeafNode { +struct IncomingIntraMessageCounter : public uitsl::PodLeafNode { // inherit constructors - using parent_t = uitsl::PodLeafNode; + using parent_t = uitsl::PodLeafNode; using parent_t::parent_t; }; diff --git a/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/KinGroupAge.hpp b/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/KinGroupAge.hpp index 497e8a4165..9c4c2b31dc 100644 --- a/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/KinGroupAge.hpp +++ b/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/KinGroupAge.hpp @@ -10,13 +10,13 @@ namespace dish2 { template< typename Spec > -struct KinGroupAge : public uitsl::PodLeafNode< size_t, Spec::NLEV > { +struct KinGroupAge : public uitsl::PodLeafNode< uint64_t, Spec::NLEV > { // inherit constructors - using parent_t = uitsl::PodLeafNode; + using parent_t = uitsl::PodLeafNode; using parent_t::parent_t; void Refresh( - const size_t epoch, const dish2::KinGroupEpochStamps< Spec > stamps + const uint64_t epoch, const dish2::KinGroupEpochStamps< Spec > stamps ) { std::transform( std::begin( stamps.GetBuffer() ), diff --git a/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/KinGroupIDAncestorView.hpp b/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/KinGroupIDAncestorView.hpp index 3f8f1d977c..6a6edc1cc9 100644 --- a/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/KinGroupIDAncestorView.hpp +++ b/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/KinGroupIDAncestorView.hpp @@ -13,9 +13,9 @@ namespace dish2 { template< typename Spec > -struct KinGroupIDAncestorView : public uitsl::PodLeafNode< size_t, Spec::NLEV > { +struct KinGroupIDAncestorView : public uitsl::PodLeafNode< uint64_t, Spec::NLEV > { // inherit constructors - using parent_t = uitsl::PodLeafNode; + using parent_t = uitsl::PodLeafNode; using parent_t::parent_t; }; diff --git a/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/NumKnownQuorumBits.hpp b/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/NumKnownQuorumBits.hpp index 166fdc0ce1..33a435bf80 100644 --- a/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/NumKnownQuorumBits.hpp +++ b/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/NumKnownQuorumBits.hpp @@ -13,9 +13,9 @@ namespace dish2 { template< typename Spec > -struct NumKnownQuorumBits : public uitsl::PodLeafNode< size_t, Spec::NLEV > { +struct NumKnownQuorumBits : public uitsl::PodLeafNode< uint64_t, Spec::NLEV > { // inherit constructors - using parent_t = uitsl::PodLeafNode; + using parent_t = uitsl::PodLeafNode; using parent_t::parent_t; }; diff --git a/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/PhylogeneticRootView.hpp b/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/PhylogeneticRootView.hpp index e374b7d467..3abb5778d1 100644 --- a/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/PhylogeneticRootView.hpp +++ b/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/PhylogeneticRootView.hpp @@ -10,9 +10,9 @@ namespace dish2 { -struct PhylogeneticRootView : public uitsl::PodLeafNode< size_t > { +struct PhylogeneticRootView : public uitsl::PodLeafNode< uint64_t > { // inherit constructors - using parent_t = uitsl::PodLeafNode; + using parent_t = uitsl::PodLeafNode; using parent_t::parent_t; }; From cd59c7cf1727db95b49754c24ee98d12f71bba0c Mon Sep 17 00:00:00 2001 From: "mmore500.login+git@gmail.com" Date: Mon, 31 May 2021 23:53:29 -0400 Subject: [PATCH 7/9] Use uint64_t instead of char for counter --- .../raw_introspective_state/SpawnCount.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/SpawnCount.hpp b/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/SpawnCount.hpp index b18b53243a..5e4a13fab3 100644 --- a/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/SpawnCount.hpp +++ b/include/dish2/peripheral/readable_state/introspective_state/raw_introspective_state/SpawnCount.hpp @@ -7,8 +7,8 @@ namespace dish2 { -struct SpawnCount : public uitsl::PodLeafNode { - using parent_t = uitsl::PodLeafNode; +struct SpawnCount : public uitsl::PodLeafNode { + using parent_t = uitsl::PodLeafNode; using parent_t::parent_t; }; From 7db8286ba3a121e7ffac5197b1cdd112a9d74698 Mon Sep 17 00:00:00 2001 From: "mmore500.login+git@gmail.com" Date: Wed, 2 Jun 2021 14:51:56 -0400 Subject: [PATCH 8/9] Handle, don't discard, stacked reproductions --- include/dish2/services/BirthSetupService.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/dish2/services/BirthSetupService.hpp b/include/dish2/services/BirthSetupService.hpp index 47679a36c6..5ffa93ea67 100644 --- a/include/dish2/services/BirthSetupService.hpp +++ b/include/dish2/services/BirthSetupService.hpp @@ -40,7 +40,8 @@ struct BirthSetupService { fresh_input_idxs.clear(); for (size_t idx{}; idx < cell.cardinals.size(); ++idx) { - if ( cell.cardinals[idx].genome_node_input.Jump() ) { + const size_t num_entries = cell.cardinals[idx].genome_node_input.Jump(); + for ( size_t ticket{}; ticket < num_entries; ++ticket ) { fresh_input_idxs.push_back( idx ); } } From cb3dc7d2d0ea0fdf1dfc7f20ed0801551cd572d6 Mon Sep 17 00:00:00 2001 From: Matthew Andres Moreno Date: Sun, 31 Oct 2021 17:50:46 -0400 Subject: [PATCH 9/9] Add temporary interface for demo --- include/dish2/genome/PhyloFingerprints.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/dish2/genome/PhyloFingerprints.hpp b/include/dish2/genome/PhyloFingerprints.hpp index 83841e8c7b..0403ee138a 100644 --- a/include/dish2/genome/PhyloFingerprints.hpp +++ b/include/dish2/genome/PhyloFingerprints.hpp @@ -127,6 +127,17 @@ class PhyloFingerprints { } + [[deprecated("Temporary interface for Phylogenetic Fingerprints Demo.")]] + const std::vector& GetGenerations() const { return generations; } + + [[deprecated("Temporary interface for Phylogenetic Fingerprints Demo.")]] + const size_t GetGenerationCount() const { return generation_counter; } + + [[deprecated("Temporary interface for Phylogenetic Fingerprints Demo.")]] + const size_t GetFingerprint(const size_t idx) const { + return fingerprints[idx]; + } + }; } // namespace dish2