diff --git a/python_tests/test_issues_11.py b/python_tests/test_issues_11.py index ea67633c..36c0bb7f 100644 --- a/python_tests/test_issues_11.py +++ b/python_tests/test_issues_11.py @@ -11,7 +11,7 @@ def test_wide_lock_badaddr_issue(db0_slab_size): db0.set_cache_size(8 << 30) all_blobs = db0.list() - append_count = 300289 + append_count = 500000 # append large blobs to force wide locks for count in range(append_count): all_blobs.append(MemoBlob(24 << 10)) @@ -20,6 +20,22 @@ def test_wide_lock_badaddr_issue(db0_slab_size): db0.commit() print(f"Appended {count} blobs") - # faulty operation - all_blobs.append(MemoBlob(24 << 10)) - \ No newline at end of file + +@pytest.mark.stress_test +@pytest.mark.parametrize("db0_slab_size", [{"slab_size": 64 << 20, "autocommit": False}], indirect=True) +def test_wide_lock_badaddr_issue2(db0_slab_size): + """ + Issue: test segfaults with low cache size (on close) + Resolution: + """ + db0.set_cache_size(128 << 20) + all_blobs = db0.list() + append_count = 200000 + # append large blobs to force wide locks + for count in range(append_count): + all_blobs.append(MemoBlob(24 << 10)) + if count % 10000 == 0: + print("Commit...") + db0.commit() + print(f"Appended {count} blobs") + print(f"Prefix size: {db0.get_storage_stats()['prefix_size']}") \ No newline at end of file diff --git a/src/dbzero/bindings/python/PyHash.cpp b/src/dbzero/bindings/python/PyHash.cpp index c32031b6..54542e82 100644 --- a/src/dbzero/bindings/python/PyHash.cpp +++ b/src/dbzero/bindings/python/PyHash.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include namespace db0::python diff --git a/src/dbzero/core/collections/SGB_Tree/SGB_Key.hpp b/src/dbzero/core/collections/SGB_Tree/SGB_Key.hpp new file mode 100644 index 00000000..ba79b178 --- /dev/null +++ b/src/dbzero/core/collections/SGB_Tree/SGB_Key.hpp @@ -0,0 +1,68 @@ +#pragma once + +#include +#include "sgb_tree_node.hpp" +#include "sgb_types.hpp" + +namespace db0 + +{ + + // This is a generic wrapper over a simple type key + // it demonstrates the SGB_Tree key's requirements and is mostly used for testing purposes +DB0_PACKED_BEGIN + template + struct DB0_PACKED_ATTR SGB_KeyT + { + TypeT m_value; + + inline SGB_KeyT(TypeT value) : m_value(value) {} + inline SGB_KeyT() = default; + + inline operator TypeT() const { + return m_value; + } + + static inline TypeT getKey(TypeT value) { + return value; + } + + // assignment operator + inline SGB_KeyT &operator=(const SGB_KeyT &other) { + m_value = other.m_value; + return *this; + } + + template + inline bool operator==(T other) const { + return m_value == other; + } + + template + inline bool operator!=(T other) const { + return m_value != other; + } + + template + inline bool operator<(T other) const { + return m_value < other; + } + + template + inline bool operator<=(T other) const { + return m_value <= other; + } + + template + inline bool operator>(T other) const { + return m_value > other; + } + + template + inline bool operator>=(T other) const { + return m_value >= other; + } + }; +DB0_PACKED_END + +} \ No newline at end of file diff --git a/src/dbzero/core/collections/SGB_Tree/SGB_Tree.hpp b/src/dbzero/core/collections/SGB_Tree/SGB_Tree.hpp index 012796f1..eef6eadb 100644 --- a/src/dbzero/core/collections/SGB_Tree/SGB_Tree.hpp +++ b/src/dbzero/core/collections/SGB_Tree/SGB_Tree.hpp @@ -3,6 +3,7 @@ #include #include "sgb_tree_node.hpp" #include "sgb_types.hpp" +#include "SGB_Key.hpp" namespace db0 @@ -65,9 +66,9 @@ namespace db0 : parent_t(it.first, it.second) { } - - inline operator bool() const { - return this->first != nullptr; + + inline bool isEnd() const { + return this->first == nullptr; } inline unsigned int getIndex() const { @@ -133,15 +134,14 @@ namespace db0 if (super_t::empty()) { return this->emplace_to_empty(std::forward(args)...); } - - super_t::modify().m_sgb_size++; - // assume key is the first element in the args pack - // finding an existing node which can hold the new item - auto node = super_t::lower_equal_bound(std::get<0>(std::make_tuple(args...))); + + ++super_t::modify().m_sgb_size; + // NOTE: assume getKey exists to extract key from construction args + auto node = super_t::lower_equal_bound(ItemT::getKey(std::forward(args)...)); if (node == super_t::end()) { node = super_t::begin(); } - + if (node->isFull()) { // erase the max element and create the new node auto max_item_ptr = node->find_max(m_heap_comp); @@ -173,7 +173,7 @@ namespace db0 if (!node.modify().erase(std::forward(args)..., m_heap_comp)) { return { false, NodeT() }; } - super_t::modify().m_sgb_size--; + --super_t::modify().m_sgb_size; if (node->empty()) { // delete the entire node super_t::erase(node); diff --git a/src/dbzero/core/crdt/CRDT_Allocator.cpp b/src/dbzero/core/crdt/CRDT_Allocator.cpp index f1e5d781..204bf329 100644 --- a/src/dbzero/core/crdt/CRDT_Allocator.cpp +++ b/src/dbzero/core/crdt/CRDT_Allocator.cpp @@ -23,7 +23,7 @@ namespace db0 { auto hint = &m_hints[0]; for (auto &alloc : m_cache) { - if (alloc && alloc.first->m_stride == size) { + if (!alloc.isEnd() && alloc.first->m_stride == size) { // the const_cast is safe because we store mutated items auto result = const_cast(alloc.first)->tryAllocUnit(addr_bound, hint->first, hint->second); if (!result || alloc.first->isFull()) { @@ -42,7 +42,7 @@ namespace db0 auto hint = &m_hints[0]; auto new_hint = new_alloc.first->getHint(); for (auto &alloc : m_cache) { - if (!alloc) { + if (alloc.isEnd()) { alloc = new_alloc; *hint = new_hint; return; @@ -522,7 +522,7 @@ namespace db0 assert(!redZone()); // merge with the neighboring blank if such exists std::optional b1; - if (alloc_window[2]) { + if (!alloc_window[2].isEnd()) { // right neighbor exists auto &right = *alloc_window[2].first; auto b1_size = right.m_address - alloc.m_address - old_size; @@ -616,7 +616,7 @@ namespace db0 // we need to remove the alloc entry since it's empty std::optional b0, b1; - if (alloc_window[0]) { + if (!alloc_window[0].isEnd()) { // left neighbor exists auto &left = *alloc_window[0].first; auto b0_size = alloc.m_address - left.m_address - left.size(); @@ -629,7 +629,7 @@ namespace db0 } } - if (alloc_window[2]) { + if (!alloc_window[2].isEnd()) { // right neighbor exists auto &right = *alloc_window[2].first; auto b1_size = right.m_address - alloc.m_address - alloc.size(); @@ -677,7 +677,7 @@ namespace db0 std::size_t CRDT_Allocator::getAllocSize(std::uint64_t address) const { auto alloc = m_allocs.lower_equal_bound(address); - if (!alloc) { + if (alloc.isEnd()) { THROWF(db0::BadAddressException) << "Invalid address: " << address; } return alloc.first->getAllocSize(address); @@ -686,7 +686,7 @@ namespace db0 bool CRDT_Allocator::isAllocated(std::uint64_t address, std::size_t *size_of_result) const { auto alloc = m_allocs.lower_equal_bound(address); - if (!alloc) { + if (alloc.isEnd()) { return false; } return alloc.first->isAllocated(address, size_of_result); @@ -761,7 +761,7 @@ namespace db0 // max_addr must be updated before any updates to allocator's metadata m_max_addr = std::max(m_max_addr, blank->m_address + min_size); // NOTE: has_stripe flag is set here - auto alloc = m_allocs.emplace(blank->m_address, stride, count, true); + auto alloc = m_allocs.emplace((std::uint32_t)blank->m_address, stride, count, true); auto result = alloc.first->allocUnit(); assert(alloc.first->endAddr() <= m_max_addr); assert(!redZone()); @@ -830,7 +830,7 @@ namespace db0 last_stripe_units = 0; auto stripe_ptr = m_stripes.lower_equal_bound(size); assert(stripe_ptr.validate()); - if (!stripe_ptr || stripe_ptr.first->m_stride != size) { + if (stripe_ptr.isEnd() || stripe_ptr.first->m_stride != size) { return std::nullopt; } diff --git a/src/dbzero/core/crdt/CRDT_Allocator.hpp b/src/dbzero/core/crdt/CRDT_Allocator.hpp index 7ad84b45..c221a0c6 100644 --- a/src/dbzero/core/crdt/CRDT_Allocator.hpp +++ b/src/dbzero/core/crdt/CRDT_Allocator.hpp @@ -9,7 +9,6 @@ namespace db0 { -DB0_PACKED_BEGIN namespace crdt @@ -66,6 +65,7 @@ DB0_PACKED_BEGIN // higher values allow eliminating "bind spots" in the allocator, but may incur storage & performance overhead static constexpr std::uint32_t ALIGNED_INDEX_THRESHOLD = 4; +DB0_PACKED_BEGIN struct DB0_PACKED_ATTR FillMap { // the low 1 - 56 bits are used to encode unit allocations @@ -139,13 +139,16 @@ DB0_PACKED_BEGIN return m_data & (crdt::HAS_STRIPE_BIT | crdt::LOST_STRIPE_BIT); } }; +DB0_PACKED_END - struct Stripe; - struct Blank; + struct DB0_PACKED_ATTR Stripe; + struct DB0_PACKED_ATTR Blank; +DB0_PACKED_BEGIN // 16-byte allocation record struct DB0_PACKED_ATTR Alloc { + // primary key std::uint32_t m_address = 0; std::uint32_t m_stride = 0; FillMap m_fill_map; @@ -153,6 +156,15 @@ DB0_PACKED_BEGIN Alloc() = default; Alloc(std::uint32_t address, std::uint32_t stride, std::uint32_t size, bool has_stripe); + static inline std::uint32_t getKey(const Alloc &alloc) { + return alloc.m_address; + } + + // Extract key from construction args + static inline std::uint32_t getKey(std::uint32_t address, std::uint32_t, std::uint32_t, bool) { + return address; + } + struct CompT { inline bool operator()(const Alloc &lhs, const Alloc &rhs) const { @@ -273,15 +285,28 @@ DB0_PACKED_BEGIN // Get total capacity std::uint32_t capacity() const; }; - - struct Blank +DB0_PACKED_END + +DB0_PACKED_BEGIN + struct DB0_PACKED_ATTR Blank { + // primary key std::uint32_t m_size; + // secondary key std::uint32_t m_address; Blank() = default; Blank(std::uint32_t size, std::uint32_t address); + static inline Blank getKey(const Blank &blank) { + return blank; + } + + // Extract key from construction args + static inline Blank getKey(std::uint32_t size, std::uint32_t address) { + return { size, address }; + } + // Get first aligned address within the blank (must satisfy aligned size > 0) std::uint32_t getAlignedAddress(std::uint32_t mask, std::uint32_t page_size) const; @@ -334,14 +359,27 @@ DB0_PACKED_BEGIN } }; }; - - struct Stripe +DB0_PACKED_END + +DB0_PACKED_BEGIN + struct DB0_PACKED_ATTR Stripe { + // primary key std::uint32_t m_stride; + // secondary key std::uint32_t m_address; Stripe(std::uint32_t stride, std::uint32_t address); + static inline Stripe getKey(const Stripe &stripe) { + return stripe; + } + + // Extract key from construction args + static inline Stripe getKey(std::uint32_t stride, std::uint32_t address) { + return { stride, address }; + } + // Note that the Stripe comparison used both fields: size & address // but also by-size only comparison and equality check are allowed struct CompT @@ -380,7 +418,8 @@ DB0_PACKED_BEGIN } }; }; - +DB0_PACKED_END + using AllocSetT = db0::SGB_Tree; using BlankSetT = db0::SGB_Tree; using AlignedBlankSetT = db0::SGB_Tree; @@ -581,7 +620,7 @@ DB0_PACKED_BEGIN // note that for aligned blanks the size will represent the aligned size auto blank_ptr = index.upper_equal_bound(Blank(min_size, 0)); // no blank of sufficient size (or aligned size) exists - if (!blank_ptr) { + if (blank_ptr.isEnd()) { return std::nullopt; } @@ -640,7 +679,6 @@ DB0_PACKED_BEGIN return blank.m_address; } -DB0_PACKED_END } namespace std diff --git a/src/dbzero/core/memory/MetaAllocator.cpp b/src/dbzero/core/memory/MetaAllocator.cpp index 9996c23e..af056aca 100644 --- a/src/dbzero/core/memory/MetaAllocator.cpp +++ b/src/dbzero/core/memory/MetaAllocator.cpp @@ -557,7 +557,8 @@ namespace db0 auto slab_id = item.m_cap_item.m_slab_id; if (item.m_final_remaining_capacity != item.m_cap_item.m_remaining_capacity) { auto it = m_capacity_items.find_equal(item.m_cap_item); - // register under a modified key + assert(!it.isEnd()); + // register under a modified key m_capacity_items.erase(it); m_capacity_items.emplace( item.m_final_remaining_capacity, item.m_final_lost_capacity, slab_id diff --git a/src/dbzero/core/memory/MetaAllocator.hpp b/src/dbzero/core/memory/MetaAllocator.hpp index 99ac7a56..2f523a36 100644 --- a/src/dbzero/core/memory/MetaAllocator.hpp +++ b/src/dbzero/core/memory/MetaAllocator.hpp @@ -15,11 +15,11 @@ namespace db0 { -DB0_PACKED_BEGIN class SlabRecycler; class SlabManager; +DB0_PACKED_BEGIN struct DB0_PACKED_ATTR o_realm: public o_fixed { Address m_slab_defs_ptr; @@ -28,7 +28,9 @@ DB0_PACKED_BEGIN o_realm() = default; o_realm(const std::pair &); }; +DB0_PACKED_END +DB0_PACKED_BEGIN struct DB0_PACKED_ATTR o_meta_header: public o_fixed { // NOTE: when needed, this values can be changed to 4 (or 8?) or 1 (no realms) @@ -41,6 +43,7 @@ DB0_PACKED_BEGIN o_meta_header(std::uint32_t page_size, std::uint32_t slab_size); }; +DB0_PACKED_END class MetaAllocator: public Allocator { @@ -62,10 +65,13 @@ DB0_PACKED_BEGIN */ static void formatPrefix(std::shared_ptr prefix, std::size_t page_size, std::size_t slab_size); +DB0_PACKED_BEGIN struct DB0_PACKED_ATTR CapacityItem { + // primary key std::uint32_t m_remaining_capacity; std::uint32_t m_lost_capacity; + // secondary key std::uint32_t m_slab_id; CapacityItem() = default; @@ -77,6 +83,23 @@ DB0_PACKED_BEGIN { } + static std::uint64_t getKey(const CapacityItem &item) { + return ((std::uint64_t)item.m_remaining_capacity << 32) | item.m_slab_id; + } + + // Construct key from construction args + static std::uint64_t getKey(std::uint32_t remaining_capacity, std::uint32_t, std::uint32_t slab_id) { + return ((std::uint64_t)remaining_capacity << 32) | slab_id; + } + + inline static std::uint32_t first(std::uint64_t key) { + return static_cast(key >> 32); + } + + inline static std::uint32_t second(std::uint64_t key) { + return static_cast(key & 0xFFFFFFFF); + } + // note descending order of comparisons struct CompT { @@ -86,12 +109,16 @@ DB0_PACKED_BEGIN return rhs.m_remaining_capacity < lhs.m_remaining_capacity; } - inline bool operator()(const CapacityItem &lhs, std::uint32_t rhs) const { - return rhs < lhs.m_remaining_capacity; + inline bool operator()(const CapacityItem &lhs, std::uint64_t rhs) const { + if (lhs.m_remaining_capacity == first(rhs)) + return lhs.m_slab_id < second(rhs); + return first(rhs) < lhs.m_remaining_capacity; } - inline bool operator()(std::uint32_t lhs, const CapacityItem &rhs) const { - return rhs.m_remaining_capacity < lhs; + inline bool operator()(std::uint64_t lhs, const CapacityItem &rhs) const { + if (first(lhs) == rhs.m_remaining_capacity) + return second(lhs) < rhs.m_slab_id; + return rhs.m_remaining_capacity < first(lhs); } }; @@ -101,18 +128,21 @@ DB0_PACKED_BEGIN return lhs.m_remaining_capacity == rhs.m_remaining_capacity && lhs.m_slab_id == rhs.m_slab_id; } - inline bool operator()(const CapacityItem &lhs, std::uint32_t rhs) const { - return lhs.m_remaining_capacity == rhs; + inline bool operator()(const CapacityItem &lhs, std::uint64_t rhs) const { + return lhs.m_remaining_capacity == first(rhs) && lhs.m_slab_id == second(rhs); } - - inline bool operator()(std::uint32_t lhs, const CapacityItem &rhs) const { - return lhs == rhs.m_remaining_capacity; + + inline bool operator()(std::uint64_t lhs, const CapacityItem &rhs) const { + return first(lhs) == rhs.m_remaining_capacity && second(lhs) == rhs.m_slab_id; } }; }; +DB0_PACKED_END +DB0_PACKED_BEGIN struct DB0_PACKED_ATTR SlabDef { + // primary key std::uint32_t m_slab_id; std::uint32_t m_remaining_capacity; std::uint32_t m_lost_capacity; @@ -124,6 +154,15 @@ DB0_PACKED_BEGIN { } + static inline std::uint32_t getKey(const SlabDef &item) { + return item.m_slab_id; + } + + // Extract key from construction args + static inline std::uint32_t getKey(std::uint32_t slab_id, std::uint32_t, std::uint32_t) { + return slab_id; + } + struct CompT { inline bool operator()(const SlabDef &lhs, const SlabDef &rhs) const { @@ -154,6 +193,7 @@ DB0_PACKED_BEGIN } }; }; +DB0_PACKED_END using CapacityTreeT = SGB_Tree; using SlabTreeT = SGB_Tree; @@ -326,9 +366,10 @@ DB0_PACKED_BEGIN std::optional
tryAllocImpl(std::size_t size, std::uint32_t slot_num, bool aligned, bool unique, std::uint16_t &instance_id, unsigned char realm_id); }; - -DB0_PACKED_END -}namespace std + +} + +namespace std { diff --git a/src/dbzero/core/storage/DiffIndex.cpp b/src/dbzero/core/storage/DiffIndex.cpp index 2eb95a7b..f7de2ad2 100644 --- a/src/dbzero/core/storage/DiffIndex.cpp +++ b/src/dbzero/core/storage/DiffIndex.cpp @@ -174,7 +174,7 @@ namespace db0 DI_Item DiffIndex::findUpper(PageNumT page_num, StateNumT state_num) const { auto it = super_t::findLower(page_num, state_num); - if (it) { + if (!it.isEnd()) { auto item = it.second->header().uncompress(*it.get()); if (item.m_page_num == page_num && item.findUpper(state_num)) { return item; diff --git a/src/dbzero/core/utils/hash_func.cpp b/src/dbzero/core/utils/hash_func.cpp new file mode 100644 index 00000000..80f0a199 --- /dev/null +++ b/src/dbzero/core/utils/hash_func.cpp @@ -0,0 +1,54 @@ +#include "hash_func.hpp" + +namespace db0 + +{ + + std::uint64_t murmurhash64A(const void* key, std::size_t len, std::uint64_t seed) + { + const std::uint64_t m = 0xc6a4a7935bd1e995ULL; + const int r = 47; + + std::uint64_t h = seed ^ (len * m); + + const std::uint64_t* data = (const std::uint64_t*)key; + const std::uint64_t* end = data + (len / 8); + + //---------- + // Body: process 8 bytes (64 bits) at a time + while (data != end) { + std::uint64_t k = *data++; + + k *= m; + k ^= k >> r; + k *= m; + + h ^= k; + h *= m; + } + + //---------- + // Tail: handle remaining bytes (less than 8) + const unsigned char* tail = (const unsigned char*)data; + + switch (len & 7) { + case 7: h ^= (std::uint64_t)tail[6] << 48; + case 6: h ^= (std::uint64_t)tail[5] << 40; + case 5: h ^= (std::uint64_t)tail[4] << 32; + case 4: h ^= (std::uint64_t)tail[3] << 24; + case 3: h ^= (std::uint64_t)tail[2] << 16; + case 2: h ^= (std::uint64_t)tail[1] << 8; + case 1: h ^= (std::uint64_t)tail[0]; + h *= m; + }; + + //---------- + // Finalization mix + h ^= h >> r; + h *= m; + h ^= h >> r; + + return h; + } + +} \ No newline at end of file diff --git a/src/dbzero/core/utils/hashes.hpp b/src/dbzero/core/utils/hash_func.hpp similarity index 50% rename from src/dbzero/core/utils/hashes.hpp rename to src/dbzero/core/utils/hash_func.hpp index 38ee33a3..61a04911 100644 --- a/src/dbzero/core/utils/hashes.hpp +++ b/src/dbzero/core/utils/hash_func.hpp @@ -4,6 +4,9 @@ #include namespace db0 + { -uint64_t murmurhash64A(const void* key, size_t len, uint64_t seed = 0); + + std::uint64_t murmurhash64A(const void* key, size_t len, std::uint64_t seed = 0); + } \ No newline at end of file diff --git a/src/dbzero/core/utils/hashes.cpp b/src/dbzero/core/utils/hashes.cpp deleted file mode 100644 index d77ffffe..00000000 --- a/src/dbzero/core/utils/hashes.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#pragma once -#include "hashes.hpp" - -namespace db0 - -{ - uint64_t murmurhash64A(const void* key, size_t len, uint64_t seed) - { - const uint64_t m = 0xc6a4a7935bd1e995ULL; - const int r = 47; - - uint64_t h = seed ^ (len * m); - - const uint64_t* data = (const uint64_t*)key; - const uint64_t* end = data + (len / 8); - - //---------- - // Body: process 8 bytes (64 bits) at a time - while (data != end) { - uint64_t k = *data++; - - k *= m; - k ^= k >> r; - k *= m; - - h ^= k; - h *= m; - } - - //---------- - // Tail: handle remaining bytes (less than 8) - const unsigned char* tail = (const unsigned char*)data; - - switch (len & 7) { - case 7: h ^= (uint64_t)tail[6] << 48; - case 6: h ^= (uint64_t)tail[5] << 40; - case 5: h ^= (uint64_t)tail[4] << 32; - case 4: h ^= (uint64_t)tail[3] << 24; - case 3: h ^= (uint64_t)tail[2] << 16; - case 2: h ^= (uint64_t)tail[1] << 8; - case 1: h ^= (uint64_t)tail[0]; - h *= m; - }; - - //---------- - // Finalization mix - h ^= h >> r; - h *= m; - h ^= h >> r; - - return h; - } - -} \ No newline at end of file diff --git a/src/dbzero/object_model/enum/EnumValue.cpp b/src/dbzero/object_model/enum/EnumValue.cpp index 05b02a3c..25c571e9 100644 --- a/src/dbzero/object_model/enum/EnumValue.cpp +++ b/src/dbzero/object_model/enum/EnumValue.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include namespace db0::object_model diff --git a/tests/unit_tests/CapacityTreeTest.cpp b/tests/unit_tests/CapacityTreeTest.cpp new file mode 100644 index 00000000..f6c89407 --- /dev/null +++ b/tests/unit_tests/CapacityTreeTest.cpp @@ -0,0 +1,84 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +namespace tests + +{ + + using namespace db0; + + class CapacityTreeTests: public testing::Test + { + public: + CapacityTreeTests() + : m_memspace(m_workspace.getMemspace("my-test-prefix_1")) + // configure bitspace to use the entire 4kb page - i.e. 0x8000 bits + , m_bitspace(m_memspace.getPrefixPtr(), Address::fromOffset(0), page_size) + { + } + + virtual void SetUp() override { + m_bitspace.clear(); + } + + virtual void TearDown() override { + m_bitspace.clear(); + } + + protected: + db0::TestWorkspace m_workspace; + static constexpr std::size_t page_size = 4096; + db0::Memspace m_memspace; + db0::BitSpace<0x8000> m_bitspace; + }; + + TEST_F( CapacityTreeTests , testCreateEmptyCapacityTree ) + { + using CapacityTreeT = typename db0::MetaAllocator::CapacityTreeT; + CapacityTreeT cut(m_bitspace, page_size); + ASSERT_TRUE(cut.getAddress() != 0); + } + + TEST_F( CapacityTreeTests , testCapacityTreeInsertEraseIssue1 ) + { + using CapacityTreeT = typename db0::MetaAllocator::CapacityTreeT; + using CapacityItem = typename db0::MetaAllocator::CapacityItem; + + std::vector realms; + realms.emplace_back(m_bitspace, page_size); + realms.emplace_back(m_bitspace, page_size); + auto data = db0::tests::getCPData(); + for (const auto &item: data) { + assert(item.size() == 4); + // process line + unsigned int op_code = std::get<0>(item); + unsigned int realm_id = std::get<1>(item); + unsigned int capacity = std::get<2>(item); + unsigned int slab = std::get<3>(item); + auto &cut = realms[realm_id]; + if (op_code == 0) { + // insert + cut.insert(CapacityItem { capacity, 0, slab }); + } else if (op_code == 1) { + // erase + CapacityItem item { capacity, 0, slab }; + auto it = cut.find_equal(item); + ASSERT_FALSE(it.isEnd()); + cut.erase(it); + } else if (op_code == 2) { + // emplace + cut.emplace(capacity, 0, slab); + } + } + } + +} \ No newline at end of file diff --git a/tests/unit_tests/DRAMSpaceTest.cpp b/tests/unit_tests/DRAMSpaceTest.cpp index 77cfd89a..14993120 100644 --- a/tests/unit_tests/DRAMSpaceTest.cpp +++ b/tests/unit_tests/DRAMSpaceTest.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -65,8 +66,8 @@ namespace tests TEST_F( DRAMSpaceTest, testDRAMSpaceCanHostSGBTree ) { - auto cut = DRAMSpace::create(m_page_size); - db0::SGB_Tree sgb_tree(cut, m_page_size); + auto cut = DRAMSpace::create(m_page_size); + db0::SGB_Tree > sgb_tree(cut, m_page_size); // let's insert 100 items for (std::uint64_t i = 0; 100 < 3; ++i) { sgb_tree.insert(i); @@ -84,7 +85,7 @@ namespace tests const std::size_t large_page_size = 16 * 1024; auto cut = DRAMSpace::create(large_page_size); // Using std::uint32_t as capacity type to handle large page size - using SGB_TreeT = db0::SGB_Tree, std::equal_to, std::uint32_t>; + using SGB_TreeT = db0::SGB_Tree, std::less, std::equal_to, std::uint32_t>; SGB_TreeT sgb_tree(cut, large_page_size); srand(814142564u); diff --git a/tests/unit_tests/SGBLookupTreeTest.cpp b/tests/unit_tests/SGBLookupTreeTest.cpp index 1e318b55..9e9f2ba2 100644 --- a/tests/unit_tests/SGBLookupTreeTest.cpp +++ b/tests/unit_tests/SGBLookupTreeTest.cpp @@ -70,7 +70,9 @@ namespace tests auto base_addr = Address::fromOffset(0); db0::BitSpace<0x8000>::create(memspace().getPrefixPtr(), base_addr, default_page_size); db0::BitSpace<0x8000> bitspace(memspace().getPrefixPtr(), base_addr, default_page_size); - db0::SGB_LookupTree cut(bitspace, default_page_size, AccessType::READ_WRITE, {}, {}, {}, sort_threshold); + db0::SGB_LookupTree > cut( + bitspace, default_page_size, AccessType::READ_WRITE, {}, {}, {}, sort_threshold + ); // insert 1000 random elements for (int i = 0; i < 1000; ++i) { cut.insert(rand() % 10000); @@ -89,16 +91,16 @@ namespace tests for (int i = 0; i < sort_threshold + 1; ++i) { cut.lower_equal_bound(value); } - + // make sure the 1st node was sorted - std::uint32_t last_value = 0; + std::uint64_t last_value = 0; auto step_ = first_node->step(); for (auto it = first_node->cbegin(); it != first_node->cend(); it += step_) { - ASSERT_TRUE(*it >= last_value); + ASSERT_TRUE(static_cast(*it) >= last_value); last_value = *it; } } - + TEST_F( SGB_LookupTreeTest , testSGBLookupTreeCanLookupInSortedNodes ) { srand(212319451u); @@ -106,7 +108,9 @@ namespace tests auto base_addr = Address::fromOffset(0); db0::BitSpace<0x8000>::create(memspace().getPrefixPtr(), base_addr, default_page_size); db0::BitSpace<0x8000> bitspace(memspace().getPrefixPtr(), base_addr, default_page_size); - db0::SGB_LookupTree cut(bitspace, default_page_size, AccessType::READ_WRITE, {}, {}, {}, sort_threshold); + db0::SGB_LookupTree > cut( + bitspace, default_page_size, AccessType::READ_WRITE, {}, {}, {}, sort_threshold + ); // insert 1000 random elements for (int i = 0; i < 1000; ++i) { cut.insert(rand() % 10000); @@ -134,7 +138,9 @@ namespace tests auto base_addr = Address::fromOffset(0); db0::BitSpace<0x8000>::create(memspace().getPrefixPtr(), base_addr, default_page_size); db0::BitSpace<0x8000> bitspace(memspace().getPrefixPtr(), base_addr, default_page_size); - db0::SGB_LookupTree cut(bitspace, default_page_size, AccessType::READ_WRITE, {}, {}, {}, sort_threshold); + db0::SGB_LookupTree > cut( + bitspace, default_page_size, AccessType::READ_WRITE, {}, {}, {}, sort_threshold + ); // insert 1000 random elements for (int i = 0; i < 1000; ++i) { cut.insert(rand() % 10000); @@ -167,7 +173,9 @@ namespace tests auto base_addr = Address::fromOffset(0); db0::BitSpace<0x8000>::create(memspace(page_size).getPrefixPtr(), base_addr, page_size); BitSpace<0x8000> bitspace(memspace(page_size).getPrefixPtr(), base_addr, page_size); - db0::SGB_LookupTree cut(bitspace, page_size, AccessType::READ_WRITE, {}, {}, {}, sort_threshold); + db0::SGB_LookupTree > cut( + bitspace, page_size, AccessType::READ_WRITE, {}, {}, {}, sort_threshold + ); srand(9376412u); std::vector values; @@ -228,9 +236,9 @@ namespace tests auto base_addr = Address::fromOffset(0); db0::BitSpace<0x8000>::create(memspace().getPrefixPtr(), base_addr, default_page_size); db0::BitSpace<0x8000> bitspace(memspace().getPrefixPtr(), base_addr, default_page_size); - SGB_LookupTree cut(bitspace, default_page_size, AccessType::READ_WRITE); + SGB_LookupTree > cut(bitspace, default_page_size, AccessType::READ_WRITE); cut.insert(1); ASSERT_TRUE(cut.cbegin_nodes()->is_sorted()); } - + } diff --git a/tests/unit_tests/SGB_TreeTests.cpp b/tests/unit_tests/SGB_TreeTests.cpp index c523e8d7..115085ce 100644 --- a/tests/unit_tests/SGB_TreeTests.cpp +++ b/tests/unit_tests/SGB_TreeTests.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include using namespace std; @@ -45,7 +46,7 @@ namespace tests TEST_F( SGB_TreeTests , testSGBTreeCanCreateRootNodeOnTheSamePageAsHeadNode ) { - db0::SGB_Tree cut(m_bitspace, page_size); + db0::SGB_Tree > cut(m_bitspace, page_size); cut.insert(0); // make sure there was only a single node created ASSERT_EQ(m_bitspace.span(), 1); @@ -53,7 +54,7 @@ namespace tests TEST_F( SGB_TreeTests , testSGBTreeCanFitMultipleItemsInASingleAllocatedBlock ) { - db0::SGB_Tree cut(m_bitspace, page_size); + db0::SGB_Tree > cut(m_bitspace, page_size); // let's insert 10 items for (std::uint64_t i = 0; i < 10; ++i) { cut.insert(i); @@ -64,7 +65,7 @@ namespace tests TEST_F( SGB_TreeTests , testSGBTreeCanBeIterated ) { - db0::SGB_Tree cut(m_bitspace, page_size); + db0::SGB_Tree > cut(m_bitspace, page_size); // let's insert 10 items for (std::uint64_t i = 0; i < 10; ++i) { cut.insert(i); @@ -80,7 +81,7 @@ namespace tests { // validate pre-condition ASSERT_EQ(m_bitspace.span(), 0); - db0::SGB_Tree cut(m_bitspace, page_size); + db0::SGB_Tree > cut(m_bitspace, page_size); // let's insert 800 items to make sure te utilized capacity is more than one page size for (std::uint64_t i = 0; i < 800; ++i) { cut.insert(i); @@ -91,7 +92,7 @@ namespace tests TEST_F( SGB_TreeTests , testSGBTreeCanSortRadomlyInsertedItems ) { - db0::SGB_Tree cut(m_bitspace, page_size); + db0::SGB_Tree > cut(m_bitspace, page_size); std::vector items_to_add = { 5, 6, 1, 2, 0, 4, 3, 7, 8 }; for (auto item : items_to_add) { cut.insert(item); @@ -105,7 +106,7 @@ namespace tests TEST_F( SGB_TreeTests , testSGBTreeCanProperlyBalanceBlocks ) { - db0::SGB_Tree cut(m_bitspace, page_size); + db0::SGB_Tree > cut(m_bitspace, page_size); // insert items until the 1st block is full unsigned int item = 1000; @@ -129,7 +130,7 @@ namespace tests TEST_F( SGB_TreeTests , testSGBTreeCanDeleteItems ) { - db0::SGB_Tree cut(m_bitspace, page_size); + db0::SGB_Tree > cut(m_bitspace, page_size); std::set items; // fill 10 pages with elements @@ -162,47 +163,47 @@ namespace tests TEST_F( SGB_TreeTests , testSGBTreeCanFindLowerEqualBound ) { - db0::SGB_Tree cut(m_bitspace, page_size); + db0::SGB_Tree > cut(m_bitspace, page_size); for (std::uint64_t i = 0; i < 10; ++i) { cut.insert(i * 3); } auto result_1 = cut.lower_equal_bound(7); ASSERT_TRUE(result_1.first); - ASSERT_EQ(*result_1.first, 6); + ASSERT_EQ(*result_1.first, 6u); auto result_2 = cut.lower_equal_bound(6); ASSERT_TRUE(result_2.first); - ASSERT_EQ(*result_2.first, 6); + ASSERT_EQ(*result_2.first, 6u); auto result_3 = cut.lower_equal_bound(17); ASSERT_TRUE(result_3.first); - ASSERT_EQ(*result_3.first, 15); + ASSERT_EQ(*result_3.first, 15u); } TEST_F( SGB_TreeTests , testSGBTreeCanFindUpperEqualBound ) { - db0::SGB_Tree cut(m_bitspace, page_size); + db0::SGB_Tree > cut(m_bitspace, page_size); for (std::uint64_t i = 0; i < 10; ++i) { cut.insert(i * 3); } auto result_1 = cut.upper_equal_bound(7); ASSERT_TRUE(result_1.first); - ASSERT_EQ(*result_1.first, 9); + ASSERT_EQ(*result_1.first, 9u); auto result_2 = cut.upper_equal_bound(6); ASSERT_TRUE(result_2.first); - ASSERT_EQ(*result_2.first, 6); + ASSERT_EQ(*result_2.first, 6u); auto result_3 = cut.upper_equal_bound(17); ASSERT_TRUE(result_3.first); - ASSERT_EQ(*result_3.first, 18); + ASSERT_EQ(*result_3.first, 18u); } TEST_F( SGB_TreeTests , testSGBTreeCanEraseItemsByIteratorPair ) { - db0::SGB_Tree cut(m_bitspace, page_size); + db0::SGB_Tree > cut(m_bitspace, page_size); for (std::uint64_t i = 0; i < 10; ++i) { cut.insert(i * 3); } @@ -232,6 +233,7 @@ namespace tests struct ComplexItem { + // primary key std::uint32_t m_key; float m_value; @@ -241,6 +243,15 @@ namespace tests { } + static std::uint32_t getKey(const ComplexItem &item) { + return item.m_key; + } + + // Extracts key from construction args + static std::uint32_t getKey(std::uint32_t key, float) { + return key; + } + struct CompT { bool operator()(const ComplexItem &lhs, const ComplexItem &rhs) const { return lhs.m_key < rhs.m_key; @@ -296,12 +307,13 @@ namespace tests TEST_F( SGB_TreeTests , testSGBTreeCanFindLowerEqualWindow ) { - db0::SGB_Tree cut(m_bitspace, page_size); + using SGB_TreeT = db0::SGB_Tree >; + SGB_TreeT cut(m_bitspace, page_size); for (std::uint64_t i = 0; i < 50; ++i) { cut.insert(i * 3); } - db0::SGB_Tree::WindowT window; + SGB_TreeT::WindowT window; cut.lower_equal_window(7, window); ASSERT_TRUE(window[1].first); ASSERT_EQ(*window[1].first, 6); @@ -324,7 +336,9 @@ namespace tests TEST_F( SGB_TreeTests , testSGBTreeFindLowerEqualFromTwoNodes ) { - db0::SGB_Tree cut(m_bitspace, page_size); + using SGB_TreeT = db0::SGB_Tree >; + + SGB_TreeT cut(m_bitspace, page_size); std::uint64_t value = 0; // add elements until the 2nd node is created while (m_bitspace.span() < 2) { @@ -335,7 +349,7 @@ namespace tests // Identify min / max from nodes auto last_node = --cut.cend_nodes(); auto max_item = last_node->find_max({}); - db0::SGB_Tree::WindowT window; + SGB_TreeT::WindowT window; cut.lower_equal_window(*max_item + 10, window); ASSERT_TRUE(window[1].first); ASSERT_EQ(*window[1].first, *max_item); @@ -359,7 +373,7 @@ namespace tests TEST_F( SGB_TreeTests , testSGBTreeCanMultipleIdenticalKeys ) { - db0::SGB_Tree cut(m_bitspace, page_size); + db0::SGB_Tree > cut(m_bitspace, page_size); unsigned int size = 0; for (std::uint64_t i = 0; i < 50; ++i) { cut.insert(i * 3); @@ -384,7 +398,7 @@ namespace tests TEST_F( SGB_TreeTests , testSGBTreeCanBeIteratedUnsorted ) { - db0::SGB_Tree cut(m_bitspace, page_size); + db0::SGB_Tree > cut(m_bitspace, page_size); for (std::uint64_t i = 0; i < 200; ++i) { cut.insert(i * 3); } @@ -400,7 +414,7 @@ namespace tests TEST_F( SGB_TreeTests , testSGBTreeCanRetrieveUpperSlice ) { - db0::SGB_Tree cut(m_bitspace, page_size); + db0::SGB_Tree > cut(m_bitspace, page_size); for (std::uint64_t i = 0; i < 200; ++i) { cut.insert(i * 3); } @@ -427,7 +441,7 @@ namespace tests TEST_F( SGB_TreeTests , testSGBTreeNodesCanBeRebalanced ) { - using NodeT = typename db0::SGB_Tree::NodeT; + using NodeT = typename db0::SGB_Tree>::NodeT; NodeT node_1(m_bitspace, 0, page_size); std::vector values_1 { 5, 6, 7, 3, 4, 8, 9, 1, 2 }; for (auto value : values_1) { @@ -453,7 +467,7 @@ namespace tests { // this test checks how much of additional storage is required, on average // to store a single element when elements are added in random order - db0::SGB_Tree cut(m_bitspace, page_size); + db0::SGB_Tree > cut(m_bitspace, page_size); srand(123622u); // NOTE: change to 1M for testing at limits for (int i = 0; i < 100000; ++i) { @@ -472,16 +486,18 @@ namespace tests TEST_F( SGB_TreeTests , testSGBTreeCanLowerEqualWindowLookupTest ) { + using SGB_TreeT = db0::SGB_Tree >; + srand(893752u); - db0::SGB_Tree cut(m_bitspace, page_size); + SGB_TreeT cut(m_bitspace, page_size); std::vector values; for (std::uint64_t i = 0; i < 100; ++i) { auto value = rand() % 1000; cut.insert(value); values.push_back(value); } - - db0::SGB_Tree::WindowT window; + + SGB_TreeT::WindowT window; std::sort(values.begin(), values.end()); for (int i = 0;i < 100;++i) { @@ -534,7 +550,10 @@ namespace tests auto base_addr = Address::fromOffset(0); db0::BitSpace<0x8000> bitspace(memspace.getPrefixPtr(), base_addr, large_page_size); // Note: CapacityT need to be upgraded to 32 bits to support large page sizes - db0::SGB_Tree, std::equal_to, std::uint32_t> cut(bitspace, large_page_size); + db0::SGB_Tree, std::less, std::equal_to, std::uint32_t> cut( + bitspace, large_page_size + ); + // let's insert 10 items for (std::uint64_t i = 0; i < 10; ++i) { cut.insert(i); @@ -550,7 +569,8 @@ namespace tests TEST_F( SGB_TreeTests , testSGBTreeWorksWithNonNodeHeaders ) { - db0::SGB_Tree, std::equal_to, std::uint16_t, std::uint32_t, o_test_header> + db0::SGB_Tree, std::less, std::equal_to, + std::uint16_t, std::uint32_t, o_test_header> cut(m_bitspace, page_size); // let's insert 10 items for (std::uint64_t i = 0; i < 1000; ++i) { @@ -578,14 +598,16 @@ namespace tests ASSERT_EQ(*it, index); } } - + TEST_F( SGB_TreeTests , testLowerEqualBoundFailingCase ) { - db0::SGB_Tree, std::equal_to, std::uint16_t, std::uint32_t, o_test_header> + db0::SGB_Tree, std::less, std::equal_to, + std::uint16_t, std::uint32_t, o_test_header> + cut(m_bitspace, page_size); - ASSERT_FALSE(cut.lower_equal_bound(0)); + ASSERT_TRUE(cut.lower_equal_bound(0).isEnd()); cut.insert(0); - ASSERT_TRUE(cut.lower_equal_bound(0)); + ASSERT_FALSE(cut.lower_equal_bound(0).isEnd()); } - + } \ No newline at end of file diff --git a/tests/utils/cp_data_1.cpp b/tests/utils/cp_data_1.cpp new file mode 100644 index 00000000..0b1b3b36 --- /dev/null +++ b/tests/utils/cp_data_1.cpp @@ -0,0 +1,1324 @@ +#include "cp_data_1.hpp" + +namespace db0::tests + +{ + + // op-code, realm_id, capacity, slab id + std::vector > getCPData() + { + return { + {0,0,0,2}, + {0,0,0,4}, + {0,1,66965504,1}, + {0,0,66965504,6}, + {0,0,66965504,8}, + {0,0,66965504,10}, + {0,0,66965504,12}, + {0,0,66965504,14}, + {0,0,66965504,16}, + {0,0,66965504,18}, + {0,0,66965504,20}, + {0,0,66965504,22}, + {0,0,66965504,24}, + {0,0,66965504,26}, + {0,0,66965504,28}, + {0,0,66965504,30}, + {0,0,66965504,32}, + {0,0,66965504,34}, + {0,0,66965504,36}, + {0,0,66965504,38}, + {0,0,66965504,40}, + {0,0,66965504,42}, + {0,0,66965504,44}, + {0,0,66965504,46}, + {0,0,66965504,48}, + {0,0,66965504,50}, + {0,0,66965504,52}, + {0,0,66965504,54}, + {0,0,66965504,56}, + {0,0,66965504,58}, + {0,0,66965504,60}, + {0,0,66965504,62}, + {0,0,66965504,64}, + {0,0,66965504,66}, + {0,0,66965504,68}, + {0,0,66965504,70}, + {0,0,66965504,72}, + {0,0,66965504,74}, + {0,0,66965504,76}, + {0,0,66965504,78}, + {0,0,66965504,80}, + {0,0,66965504,82}, + {0,0,66965504,84}, + {0,0,66965504,86}, + {0,0,66965504,88}, + {0,0,66965504,90}, + {0,0,66965504,92}, + {0,0,66965504,94}, + {0,0,66965504,96}, + {0,0,66965504,98}, + {0,0,66965504,100}, + {0,0,66965504,102}, + {0,0,66965504,104}, + {0,0,66965504,106}, + {0,0,66965504,108}, + {0,0,66965504,110}, + {0,0,66965504,112}, + {0,0,66965504,114}, + {0,0,66965504,116}, + {0,0,66965504,118}, + {0,0,66965504,120}, + {0,0,66965504,122}, + {0,0,66965504,124}, + {0,0,66965504,126}, + {0,0,66965504,128}, + {0,0,66965504,130}, + {0,0,66965504,132}, + {0,0,66965504,134}, + {0,0,66965504,136}, + {0,0,66965504,138}, + {0,0,66965504,140}, + {0,0,66965504,142}, + {0,0,66965504,144}, + {0,0,66965504,146}, + {0,0,66965504,148}, + {0,0,66965504,150}, + {0,0,66965504,152}, + {0,0,66965504,154}, + {0,0,66965504,156}, + {0,0,66965504,158}, + {0,0,66965504,160}, + {0,0,66965504,162}, + {0,0,66965504,164}, + {0,0,66965504,166}, + {0,0,66965504,168}, + {0,0,66965504,170}, + {0,0,66965504,172}, + {0,0,66965504,174}, + {0,0,66965504,176}, + {0,0,66965504,178}, + {0,0,66965504,180}, + {0,0,66965504,182}, + {0,0,66965504,184}, + {0,0,66965504,186}, + {0,0,66965504,188}, + {0,0,66965504,190}, + {0,0,66965504,192}, + {0,0,66965504,194}, + {0,0,66965504,196}, + {0,0,66965504,198}, + {0,0,66965504,200}, + {0,0,66965504,202}, + {0,0,66965504,204}, + {0,0,66965504,206}, + {0,0,66965504,208}, + {0,0,66965504,210}, + {0,0,66965504,212}, + {0,0,66965504,214}, + {0,0,66965504,216}, + {0,0,66965504,218}, + {0,0,66965504,220}, + {0,0,66965504,222}, + {0,0,66965504,224}, + {0,0,66965504,226}, + {0,0,66965504,228}, + {0,0,66965504,230}, + {0,0,66965504,232}, + {0,0,66965504,234}, + {0,0,66965504,236}, + {0,0,66965504,238}, + {0,0,66965504,240}, + {0,0,66965504,242}, + {0,0,66965504,244}, + {0,0,66965504,246}, + {0,0,66965504,248}, + {0,0,66965504,250}, + {0,0,66965504,252}, + {0,0,66965504,254}, + {0,0,66965504,256}, + {0,0,66965504,258}, + {0,0,66965504,260}, + {0,0,66965504,262}, + {0,0,66965504,264}, + {0,0,66965504,266}, + {0,0,66965504,268}, + {0,0,66965504,270}, + {0,0,66965504,272}, + {0,0,66965504,274}, + {0,0,66965504,276}, + {0,0,66965504,278}, + {0,0,66965504,280}, + {0,0,66965504,282}, + {0,0,66965504,284}, + {0,0,66965504,286}, + {0,0,66965504,288}, + {0,0,66965504,290}, + {0,0,66965504,292}, + {0,0,66965504,294}, + {0,0,66965504,296}, + {0,0,66965504,298}, + {0,0,66965504,300}, + {0,0,66965504,302}, + {0,0,66965504,304}, + {0,0,66965504,306}, + {0,0,66965504,308}, + {0,0,66965504,310}, + {0,0,66965504,312}, + {0,0,66965504,314}, + {0,0,66965504,316}, + {0,0,66965504,318}, + {0,0,66965504,320}, + {0,0,66965504,322}, + {0,0,66965504,324}, + {0,0,66965504,326}, + {0,0,66965504,328}, + {0,0,66965504,330}, + {0,0,66965504,332}, + {0,0,66965504,334}, + {0,0,66965504,336}, + {0,0,66965504,338}, + {0,0,66965504,340}, + {0,0,66965504,342}, + {0,0,66965504,344}, + {0,0,66965504,346}, + {0,0,66965504,348}, + {0,0,66965504,350}, + {0,0,66965504,352}, + {0,0,66965504,354}, + {0,0,66965504,356}, + {0,0,66965504,358}, + {0,0,66965504,360}, + {0,0,66965504,362}, + {0,0,66965504,364}, + {0,0,66965504,366}, + {0,0,66965504,368}, + {0,0,66965504,370}, + {0,0,66965504,372}, + {0,0,66965504,374}, + {0,0,66965504,376}, + {0,0,66965504,378}, + {0,0,66965504,380}, + {0,0,66965504,382}, + {0,0,66965504,384}, + {0,0,66965504,386}, + {0,0,66965504,388}, + {0,0,66965504,390}, + {0,0,66965504,392}, + {0,0,66965504,394}, + {0,0,66965504,396}, + {0,0,66965504,398}, + {0,0,66965504,400}, + {0,0,66965504,402}, + {0,0,66965504,404}, + {0,0,66965504,406}, + {0,0,66965504,408}, + {0,0,66965504,410}, + {0,0,66965504,412}, + {0,0,66965504,414}, + {0,0,66965504,416}, + {0,0,66965504,418}, + {0,0,66965504,420}, + {0,0,66965504,422}, + {0,0,66965504,424}, + {0,0,66965504,426}, + {0,0,66965504,428}, + {0,0,66965504,430}, + {0,0,66965504,432}, + {0,0,66965504,434}, + {0,0,66965504,436}, + {0,0,66965504,438}, + {0,0,66965504,440}, + {0,0,66965504,442}, + {0,0,66965504,444}, + {0,0,66965504,446}, + {0,0,66965504,448}, + {0,0,66965504,450}, + {0,0,66965504,452}, + {0,0,66965504,454}, + {0,0,66965504,456}, + {0,0,66965504,458}, + {0,0,66965504,460}, + {0,0,66965504,462}, + {0,0,66965504,464}, + {0,0,66965504,466}, + {0,0,66965504,468}, + {0,0,66965504,470}, + {0,0,66965504,472}, + {0,0,66965504,474}, + {0,0,66965504,476}, + {0,0,66965504,478}, + {0,0,66965504,480}, + {0,0,66965504,482}, + {0,0,66965504,484}, + {0,0,66965504,486}, + {0,0,66965504,488}, + {0,0,66965504,490}, + {0,0,66965504,492}, + {0,0,66965504,494}, + {0,0,66965504,496}, + {0,0,66965504,498}, + {0,0,66965504,500}, + {0,0,66965504,502}, + {0,0,66965504,504}, + {0,0,66965504,506}, + {0,0,66965504,508}, + {0,0,66965504,510}, + {0,0,66965504,512}, + {0,0,66965504,514}, + {0,0,66965504,516}, + {1,0,66965504,6}, + {2,0,54580772,6}, + {0,0,66965504,518}, + {1,0,66965504,8}, + {2,0,54580772,8}, + {0,0,66965504,520}, + {1,0,66965504,10}, + {2,0,54580772,10}, + {0,0,66965504,522}, + {1,0,66965504,12}, + {2,0,54580772,12}, + {0,0,66965504,524}, + {1,0,66965504,14}, + {2,0,54580772,14}, + {0,0,66965504,526}, + {1,0,66965504,16}, + {2,0,54580772,16}, + {0,0,66965504,528}, + {1,0,66965504,18}, + {2,0,54580772,18}, + {0,0,66965504,530}, + {1,0,66965504,20}, + {2,0,54580772,20}, + {0,0,66965504,532}, + {1,0,66965504,22}, + {2,0,54580772,22}, + {0,0,66965504,534}, + {1,0,66965504,24}, + {2,0,54580772,24}, + {0,0,66965504,536}, + {1,0,66965504,26}, + {2,0,54580772,26}, + {0,0,66965504,538}, + {1,0,66965504,28}, + {2,0,54580772,28}, + {0,0,66965504,540}, + {1,0,66965504,30}, + {2,0,54580772,30}, + {0,0,66965504,542}, + {1,0,66965504,32}, + {2,0,54580772,32}, + {0,0,66965504,544}, + {1,0,66965504,34}, + {2,0,54580772,34}, + {0,0,66965504,546}, + {1,0,66965504,36}, + {2,0,54580772,36}, + {0,0,66965504,548}, + {1,0,66965504,38}, + {2,0,54580772,38}, + {0,0,66965504,550}, + {1,0,66965504,40}, + {2,0,54580772,40}, + {0,0,66965504,552}, + {1,0,66965504,42}, + {2,0,54580772,42}, + {0,0,66965504,554}, + {1,0,66965504,44}, + {2,0,54580772,44}, + {0,0,66965504,556}, + {1,0,66965504,46}, + {2,0,54580772,46}, + {0,0,66965504,558}, + {1,0,66965504,48}, + {2,0,54580772,48}, + {0,0,66965504,560}, + {1,0,66965504,50}, + {2,0,54580772,50}, + {0,0,66965504,562}, + {1,0,66965504,52}, + {2,0,54580772,52}, + {0,0,66965504,564}, + {1,0,66965504,54}, + {2,0,54580772,54}, + {0,0,66965504,566}, + {1,0,66965504,56}, + {2,0,54580772,56}, + {0,0,66965504,568}, + {1,0,66965504,58}, + {2,0,54580772,58}, + {0,0,66965504,570}, + {1,0,66965504,60}, + {2,0,54583076,60}, + {0,0,66965504,572}, + {1,0,66965504,62}, + {2,0,54580772,62}, + {0,0,66965504,574}, + {1,0,66965504,64}, + {2,0,54580772,64}, + {0,0,66965504,576}, + {1,0,66965504,66}, + {2,0,54580772,66}, + {0,0,66965504,578}, + {1,0,66965504,68}, + {2,0,54580772,68}, + {0,0,66965504,580}, + {1,0,66965504,70}, + {2,0,54580772,70}, + {0,0,66965504,582}, + {1,0,66965504,72}, + {2,0,54580772,72}, + {0,0,66965504,584}, + {1,0,66965504,74}, + {2,0,54580772,74}, + {0,0,66965504,586}, + {1,0,66965504,76}, + {2,0,54580772,76}, + {0,0,66965504,588}, + {1,0,66965504,78}, + {2,0,54580772,78}, + {0,0,66965504,590}, + {1,0,66965504,80}, + {2,0,54580772,80}, + {0,0,66965504,592}, + {1,0,66965504,82}, + {2,0,54580772,82}, + {0,0,66965504,594}, + {1,0,66965504,84}, + {2,0,54580772,84}, + {0,0,66965504,596}, + {1,0,66965504,86}, + {2,0,54580772,86}, + {0,0,66965504,598}, + {1,0,66965504,88}, + {2,0,54576676,88}, + {0,0,66965504,600}, + {1,0,66965504,90}, + {2,0,54580772,90}, + {0,0,66965504,602}, + {1,0,66965504,92}, + {2,0,54580772,92}, + {0,0,66965504,604}, + {1,0,66965504,94}, + {2,0,54580772,94}, + {0,0,66965504,606}, + {1,0,66965504,96}, + {2,0,54580772,96}, + {0,0,66965504,608}, + {1,0,66965504,98}, + {2,0,54580772,98}, + {0,0,66965504,610}, + {1,0,66965504,100}, + {2,0,54580772,100}, + {0,0,66965504,612}, + {1,0,66965504,102}, + {2,0,54580772,102}, + {0,0,66965504,614}, + {1,0,66965504,104}, + {2,0,54580772,104}, + {0,0,66965504,616}, + {1,0,66965504,106}, + {2,0,54580772,106}, + {0,0,66965504,618}, + {1,0,66965504,108}, + {2,0,54580772,108}, + {0,0,66965504,620}, + {1,0,66965504,110}, + {2,0,54580772,110}, + {0,0,66965504,622}, + {1,0,66965504,112}, + {2,0,54580772,112}, + {0,0,66965504,624}, + {1,0,66965504,114}, + {2,0,54580772,114}, + {0,0,66965504,626}, + {1,0,66965504,116}, + {2,0,54583076,116}, + {0,0,66965504,628}, + {1,0,66965504,118}, + {2,0,54580772,118}, + {0,0,66965504,630}, + {1,0,66965504,120}, + {2,0,54580772,120}, + {0,0,66965504,632}, + {1,0,66965504,122}, + {2,0,54580772,122}, + {0,0,66965504,634}, + {1,0,66965504,124}, + {2,0,54580772,124}, + {0,0,66965504,636}, + {1,0,66965504,126}, + {2,0,54580772,126}, + {0,0,66965504,638}, + {1,0,66965504,128}, + {2,0,54580772,128}, + {0,0,66965504,640}, + {1,0,66965504,130}, + {2,0,54580772,130}, + {0,0,66965504,642}, + {1,0,66965504,132}, + {2,0,54580772,132}, + {0,0,66965504,644}, + {1,0,66965504,134}, + {2,0,54580772,134}, + {0,0,66965504,646}, + {1,0,66965504,136}, + {2,0,54580772,136}, + {0,0,66965504,648}, + {1,0,66965504,138}, + {2,0,54580772,138}, + {0,0,66965504,650}, + {1,0,66965504,140}, + {2,0,54580772,140}, + {0,0,66965504,652}, + {1,0,66965504,142}, + {2,0,54580772,142}, + {0,0,66965504,654}, + {1,0,66965504,144}, + {2,0,54580772,144}, + {0,0,66965504,656}, + {1,0,66965504,146}, + {2,0,54580772,146}, + {0,0,66965504,658}, + {1,0,66965504,148}, + {2,0,54580772,148}, + {0,0,66965504,660}, + {1,0,66965504,150}, + {2,0,54580772,150}, + {0,0,66965504,662}, + {1,0,66965504,152}, + {2,0,54580772,152}, + {0,0,66965504,664}, + {1,0,66965504,154}, + {2,0,54580772,154}, + {0,0,66965504,666}, + {1,0,66965504,156}, + {2,0,54580772,156}, + {0,0,66965504,668}, + {1,0,66965504,158}, + {2,0,54580772,158}, + {0,0,66965504,670}, + {1,0,66965504,160}, + {2,0,54580772,160}, + {0,0,66965504,672}, + {1,0,66965504,162}, + {2,0,54580772,162}, + {0,0,66965504,674}, + {1,0,66965504,164}, + {2,0,54580772,164}, + {0,0,66965504,676}, + {1,0,66965504,166}, + {2,0,54580772,166}, + {0,0,66965504,678}, + {1,0,66965504,168}, + {2,0,54580772,168}, + {0,0,66965504,680}, + {1,0,66965504,170}, + {2,0,54580772,170}, + {0,0,66965504,682}, + {1,0,66965504,172}, + {2,0,54580772,172}, + {0,0,66965504,684}, + {1,0,66965504,174}, + {2,0,54583076,174}, + {0,0,66965504,686}, + {1,0,66965504,176}, + {2,0,54580772,176}, + {0,0,66965504,688}, + {1,0,66965504,178}, + {2,0,54580772,178}, + {0,0,66965504,690}, + {1,0,66965504,180}, + {2,0,54580772,180}, + {0,0,66965504,692}, + {1,0,66965504,182}, + {2,0,54580772,182}, + {0,0,66965504,694}, + {1,0,66965504,184}, + {2,0,54580772,184}, + {0,0,66965504,696}, + {1,0,66965504,186}, + {2,0,54580772,186}, + {0,0,66965504,698}, + {1,0,66965504,188}, + {2,0,54580772,188}, + {0,0,66965504,700}, + {1,0,66965504,190}, + {2,0,54580772,190}, + {0,0,66965504,702}, + {1,0,66965504,192}, + {2,0,54580772,192}, + {0,0,66965504,704}, + {1,0,66965504,194}, + {2,0,54580772,194}, + {0,0,66965504,706}, + {1,0,66965504,196}, + {2,0,54580772,196}, + {0,0,66965504,708}, + {1,0,66965504,198}, + {2,0,54580772,198}, + {0,0,66965504,710}, + {1,0,66965504,200}, + {2,0,54580772,200}, + {0,0,66965504,712}, + {1,0,66965504,202}, + {2,0,54580772,202}, + {0,0,66965504,714}, + {1,0,66965504,204}, + {2,0,54580772,204}, + {0,0,66965504,716}, + {1,0,66965504,206}, + {2,0,54580772,206}, + {0,0,66965504,718}, + {1,0,66965504,208}, + {2,0,54580772,208}, + {0,0,66965504,720}, + {1,0,66965504,210}, + {2,0,54580772,210}, + {0,0,66965504,722}, + {1,0,66965504,212}, + {2,0,54580772,212}, + {0,0,66965504,724}, + {1,0,66965504,214}, + {2,0,54580772,214}, + {0,0,66965504,726}, + {1,0,66965504,216}, + {2,0,54580772,216}, + {0,0,66965504,728}, + {1,0,66965504,218}, + {2,0,54580772,218}, + {0,0,66965504,730}, + {1,0,66965504,220}, + {2,0,54580772,220}, + {0,0,66965504,732}, + {1,0,66965504,222}, + {2,0,54580772,222}, + {0,0,66965504,734}, + {1,0,66965504,224}, + {2,0,54580772,224}, + {0,0,66965504,736}, + {1,0,66965504,226}, + {2,0,54580772,226}, + {0,0,66965504,738}, + {1,0,66965504,228}, + {2,0,54580772,228}, + {0,0,66965504,740}, + {1,0,66965504,230}, + {2,0,54583076,230}, + {0,0,66965504,742}, + {1,0,66965504,232}, + {2,0,54580772,232}, + {0,0,66965504,744}, + {1,0,66965504,234}, + {2,0,54580772,234}, + {0,0,66965504,746}, + {1,0,66965504,236}, + {2,0,54580772,236}, + {0,0,66965504,748}, + {1,0,66965504,238}, + {2,0,54580772,238}, + {0,0,66965504,750}, + {1,0,66965504,240}, + {2,0,54580772,240}, + {0,0,66965504,752}, + {1,0,66965504,242}, + {2,0,54580772,242}, + {0,0,66965504,754}, + {1,0,66965504,244}, + {2,0,54580772,244}, + {0,0,66965504,756}, + {1,0,66965504,246}, + {2,0,54580772,246}, + {0,0,66965504,758}, + {1,0,66965504,248}, + {2,0,54580772,248}, + {0,0,66965504,760}, + {1,0,66965504,250}, + {2,0,54580772,250}, + {0,0,66965504,762}, + {1,0,66965504,252}, + {2,0,54580772,252}, + {0,0,66965504,764}, + {1,0,66965504,254}, + {2,0,54580772,254}, + {0,0,66965504,766}, + {1,0,66965504,256}, + {2,0,54580772,256}, + {0,0,66965504,768}, + {1,0,66965504,258}, + {2,0,54580772,258}, + {0,0,66965504,770}, + {1,0,66965504,260}, + {2,0,54580772,260}, + {0,0,66965504,772}, + {1,0,66965504,262}, + {2,0,54580772,262}, + {0,0,66965504,774}, + {1,0,66965504,264}, + {2,0,54580772,264}, + {0,0,66965504,776}, + {1,0,66965504,266}, + {2,0,54580772,266}, + {0,0,66965504,778}, + {1,0,66965504,268}, + {2,0,54580772,268}, + {0,0,66965504,780}, + {1,0,66965504,270}, + {2,0,54580772,270}, + {0,0,66965504,782}, + {1,0,66965504,272}, + {2,0,54580772,272}, + {0,0,66965504,784}, + {1,0,66965504,274}, + {2,0,54580772,274}, + {0,0,66965504,786}, + {1,0,66965504,276}, + {2,0,54580772,276}, + {0,0,66965504,788}, + {1,0,66965504,278}, + {2,0,54580772,278}, + {0,0,66965504,790}, + {1,0,66965504,280}, + {2,0,54580772,280}, + {0,0,66965504,792}, + {1,0,66965504,282}, + {2,0,54580772,282}, + {0,0,66965504,794}, + {1,0,66965504,284}, + {2,0,54580772,284}, + {0,0,66965504,796}, + {1,0,66965504,286}, + {2,0,54583076,286}, + {0,0,66965504,798}, + {1,0,66965504,288}, + {2,0,54580772,288}, + {1,0,66965504,290}, + {2,0,54580772,290}, + {1,0,66965504,292}, + {2,0,54580772,292}, + {1,0,66965504,294}, + {2,0,54580772,294}, + {1,0,66965504,296}, + {2,0,54580772,296}, + {1,0,66965504,298}, + {2,0,54580772,298}, + {1,0,66965504,300}, + {2,0,54580772,300}, + {1,0,66965504,302}, + {2,0,54580772,302}, + {1,0,66965504,304}, + {2,0,54580772,304}, + {1,0,66965504,306}, + {2,0,54580772,306}, + {1,0,66965504,308}, + {2,0,54580772,308}, + {1,0,66965504,310}, + {2,0,54580772,310}, + {1,0,66965504,312}, + {2,0,54580772,312}, + {1,0,66965504,314}, + {2,0,54580772,314}, + {1,0,66965504,316}, + {2,0,54580772,316}, + {1,0,66965504,318}, + {2,0,54580772,318}, + {1,0,66965504,320}, + {2,0,54580772,320}, + {1,0,66965504,322}, + {2,0,54580772,322}, + {1,0,66965504,324}, + {2,0,54580772,324}, + {1,0,66965504,326}, + {2,0,54580772,326}, + {1,0,66965504,328}, + {2,0,54580772,328}, + {1,0,66965504,330}, + {2,0,54580772,330}, + {1,0,66965504,332}, + {2,0,54580772,332}, + {1,0,66965504,334}, + {2,0,54580772,334}, + {1,0,66965504,336}, + {2,0,54580772,336}, + {1,0,66965504,338}, + {2,0,54580772,338}, + {1,0,66965504,340}, + {2,0,54580772,340}, + {1,0,66965504,342}, + {2,0,54580772,342}, + {1,0,66965504,344}, + {2,0,54583076,344}, + {1,0,66965504,346}, + {2,0,54580772,346}, + {1,0,66965504,348}, + {2,0,54580772,348}, + {1,0,66965504,350}, + {2,0,54580772,350}, + {1,0,66965504,352}, + {2,0,54580772,352}, + {1,0,66965504,354}, + {2,0,54580772,354}, + {1,0,66965504,356}, + {2,0,54580772,356}, + {1,0,66965504,358}, + {2,0,54580772,358}, + {1,0,66965504,360}, + {2,0,54580772,360}, + {1,0,66965504,362}, + {2,0,54580772,362}, + {1,0,66965504,364}, + {2,0,54580772,364}, + {1,0,66965504,366}, + {2,0,54580772,366}, + {1,0,66965504,368}, + {2,0,54580772,368}, + {1,0,66965504,370}, + {2,0,54580772,370}, + {1,0,66965504,372}, + {2,0,54580772,372}, + {1,0,66965504,374}, + {2,0,54580772,374}, + {1,0,66965504,376}, + {2,0,54580772,376}, + {1,0,66965504,378}, + {2,0,54580772,378}, + {1,0,66965504,380}, + {2,0,54580772,380}, + {1,0,66965504,382}, + {2,0,54580772,382}, + {1,0,66965504,384}, + {2,0,54580772,384}, + {1,0,66965504,386}, + {2,0,54580772,386}, + {1,0,66965504,388}, + {2,0,54580772,388}, + {1,0,66965504,390}, + {2,0,54580772,390}, + {1,0,66965504,392}, + {2,0,54580772,392}, + {1,0,66965504,394}, + {2,0,54580772,394}, + {1,0,66965504,396}, + {2,0,54580772,396}, + {1,0,66965504,398}, + {2,0,54580772,398}, + {1,0,66965504,400}, + {2,0,54583076,400}, + {1,0,66965504,402}, + {2,0,54580772,402}, + {1,0,66965504,404}, + {2,0,54580772,404}, + {1,0,66965504,406}, + {2,0,54580772,406}, + {1,0,66965504,408}, + {2,0,54580772,408}, + {1,0,66965504,410}, + {2,0,54580772,410}, + {1,0,66965504,412}, + {2,0,54580772,412}, + {1,0,66965504,414}, + {2,0,54580772,414}, + {1,0,66965504,416}, + {2,0,54580772,416}, + {1,0,66965504,418}, + {2,0,54580772,418}, + {1,0,66965504,420}, + {2,0,54580772,420}, + {1,0,66965504,422}, + {2,0,54580772,422}, + {1,0,66965504,424}, + {2,0,54580772,424}, + {1,0,66965504,426}, + {2,0,54580772,426}, + {1,0,66965504,428}, + {2,0,54580772,428}, + {1,0,66965504,430}, + {2,0,54580772,430}, + {1,0,66965504,432}, + {2,0,54580772,432}, + {1,0,66965504,434}, + {2,0,54580772,434}, + {1,0,66965504,436}, + {2,0,54580772,436}, + {1,0,66965504,438}, + {2,0,54580772,438}, + {1,0,66965504,440}, + {2,0,54580772,440}, + {1,0,66965504,442}, + {2,0,54580772,442}, + {1,0,66965504,444}, + {2,0,54580772,444}, + {1,0,66965504,446}, + {2,0,54580772,446}, + {1,0,66965504,448}, + {2,0,54580772,448}, + {1,0,66965504,450}, + {2,0,54580772,450}, + {1,0,66965504,452}, + {2,0,54580772,452}, + {1,0,66965504,454}, + {2,0,54580772,454}, + {1,0,66965504,456}, + {2,0,54580772,456}, + {1,0,66965504,458}, + {2,0,54583076,458}, + {1,0,66965504,460}, + {2,0,54580772,460}, + {1,0,66965504,462}, + {2,0,54580772,462}, + {1,0,66965504,464}, + {2,0,54580772,464}, + {1,0,66965504,466}, + {2,0,54580772,466}, + {1,0,66965504,468}, + {2,0,54580772,468}, + {1,0,66965504,470}, + {2,0,54580772,470}, + {1,0,66965504,472}, + {2,0,54580772,472}, + {1,0,66965504,474}, + {2,0,54580772,474}, + {1,0,66965504,476}, + {2,0,54580772,476}, + {1,0,66965504,478}, + {2,0,54580772,478}, + {1,0,66965504,480}, + {2,0,54580772,480}, + {1,0,66965504,482}, + {2,0,54580772,482}, + {1,0,66965504,484}, + {2,0,54580772,484}, + {1,0,66965504,486}, + {2,0,54580772,486}, + {1,0,66965504,488}, + {2,0,54580772,488}, + {1,0,66965504,490}, + {2,0,54580772,490}, + {1,0,66965504,492}, + {2,0,54580772,492}, + {1,0,66965504,494}, + {2,0,54580772,494}, + {1,0,66965504,496}, + {2,0,54580772,496}, + {1,0,66965504,498}, + {2,0,54580772,498}, + {1,0,66965504,500}, + {2,0,54580772,500}, + {1,0,66965504,502}, + {2,0,54580772,502}, + {1,0,66965504,504}, + {2,0,54580772,504}, + {1,0,66965504,506}, + {2,0,54580772,506}, + {1,0,66965504,508}, + {2,0,54580772,508}, + {1,0,66965504,510}, + {2,0,54580772,510}, + {1,0,66965504,512}, + {2,0,54580772,512}, + {1,0,66965504,514}, + {2,0,54583076,514}, + {1,0,66965504,516}, + {2,0,54580772,516}, + {1,0,66965504,518}, + {2,0,54580772,518}, + {1,0,66965504,520}, + {2,0,54580772,520}, + {1,0,66965504,522}, + {2,0,54580772,522}, + {1,0,66965504,524}, + {2,0,54568484,524}, + {1,0,66965504,526}, + {2,0,54580772,526}, + {1,0,66965504,528}, + {2,0,54580772,528}, + {1,0,66965504,530}, + {2,0,54580772,530}, + {1,0,66965504,532}, + {2,0,54580772,532}, + {1,0,66965504,534}, + {2,0,54580772,534}, + {1,0,66965504,536}, + {2,0,54580772,536}, + {1,0,66965504,538}, + {2,0,54580772,538}, + {1,0,66965504,540}, + {2,0,54580772,540}, + {1,0,66965504,542}, + {2,0,54580772,542}, + {1,0,66965504,544}, + {2,0,54580772,544}, + {1,0,66965504,546}, + {2,0,54580772,546}, + {1,0,66965504,548}, + {2,0,54580772,548}, + {1,0,66965504,550}, + {2,0,54580772,550}, + {1,0,66965504,552}, + {2,0,54580772,552}, + {1,0,66965504,554}, + {2,0,54580772,554}, + {1,0,66965504,556}, + {2,0,54580772,556}, + {1,0,66965504,558}, + {2,0,54580772,558}, + {1,0,66965504,560}, + {2,0,54580772,560}, + {1,0,66965504,562}, + {2,0,54580772,562}, + {1,0,66965504,564}, + {2,0,54580772,564}, + {1,0,66965504,566}, + {2,0,54580772,566}, + {1,0,66965504,568}, + {2,0,54580772,568}, + {1,0,66965504,570}, + {2,0,54580772,570}, + {1,0,66965504,572}, + {2,0,54583076,572}, + {1,0,66965504,574}, + {2,0,54580772,574}, + {1,0,66965504,576}, + {2,0,54580772,576}, + {1,0,66965504,578}, + {2,0,54580772,578}, + {1,0,66965504,580}, + {2,0,54580772,580}, + {1,0,66965504,582}, + {2,0,54580772,582}, + {1,0,66965504,584}, + {2,0,54580772,584}, + {1,0,66965504,586}, + {2,0,54580772,586}, + {1,0,66965504,588}, + {2,0,54580772,588}, + {1,0,66965504,590}, + {2,0,54580772,590}, + {1,0,66965504,592}, + {2,0,54580772,592}, + {1,0,66965504,594}, + {2,0,54580772,594}, + {1,0,66965504,596}, + {2,0,54580772,596}, + {1,0,66965504,598}, + {2,0,54580772,598}, + {1,0,66965504,600}, + {2,0,54580772,600}, + {1,0,66965504,602}, + {2,0,54580772,602}, + {1,0,66965504,604}, + {2,0,54580772,604}, + {1,0,66965504,606}, + {2,0,54580772,606}, + {1,0,66965504,608}, + {2,0,54580772,608}, + {1,0,66965504,610}, + {2,0,54580772,610}, + {1,0,66965504,612}, + {2,0,54580772,612}, + {1,0,66965504,614}, + {2,0,54580772,614}, + {1,0,66965504,616}, + {2,0,54580772,616}, + {1,0,66965504,618}, + {2,0,54580772,618}, + {1,0,66965504,620}, + {2,0,54580772,620}, + {1,0,66965504,622}, + {2,0,54580772,622}, + {1,0,66965504,624}, + {2,0,54580772,624}, + {1,0,66965504,626}, + {2,0,54580772,626}, + {1,0,66965504,628}, + {2,0,54583076,628}, + {1,0,66965504,630}, + {2,0,54580772,630}, + {1,0,66965504,632}, + {2,0,54580772,632}, + {1,0,66965504,634}, + {2,0,54580772,634}, + {1,0,66965504,636}, + {2,0,54580772,636}, + {1,0,66965504,638}, + {2,0,54580772,638}, + {1,0,66965504,640}, + {2,0,54580772,640}, + {1,0,66965504,642}, + {2,0,54580772,642}, + {1,0,66965504,644}, + {2,0,54580772,644}, + {1,0,66965504,646}, + {2,0,54580772,646}, + {1,0,66965504,648}, + {2,0,54580772,648}, + {1,0,66965504,650}, + {2,0,54580772,650}, + {1,0,66965504,652}, + {2,0,54580772,652}, + {1,0,66965504,654}, + {2,0,54580772,654}, + {1,0,66965504,656}, + {2,0,54580772,656}, + {1,0,66965504,658}, + {2,0,54580772,658}, + {1,0,66965504,660}, + {2,0,54580772,660}, + {1,0,66965504,662}, + {2,0,54580772,662}, + {1,0,66965504,664}, + {2,0,54580772,664}, + {1,0,66965504,666}, + {2,0,54580772,666}, + {1,0,66965504,668}, + {2,0,54580772,668}, + {1,0,66965504,670}, + {2,0,54580772,670}, + {1,0,66965504,672}, + {2,0,54580772,672}, + {1,0,66965504,674}, + {2,0,54580772,674}, + {1,0,66965504,676}, + {2,0,54580772,676}, + {1,0,66965504,678}, + {2,0,54580772,678}, + {1,0,66965504,680}, + {2,0,54580772,680}, + {1,0,66965504,682}, + {2,0,54580772,682}, + {1,0,66965504,684}, + {2,0,54580772,684}, + {1,0,66965504,686}, + {2,0,54583076,686}, + {1,0,66965504,688}, + {2,0,54580772,688}, + {1,0,66965504,690}, + {2,0,54580772,690}, + {1,0,66965504,692}, + {2,0,54580772,692}, + {1,0,66965504,694}, + {2,0,54580772,694}, + {1,0,66965504,696}, + {2,0,54580772,696}, + {1,0,66965504,698}, + {2,0,54580772,698}, + {1,0,66965504,700}, + {2,0,54580772,700}, + {1,0,66965504,702}, + {2,0,54580772,702}, + {1,0,66965504,704}, + {2,0,54580772,704}, + {1,0,66965504,706}, + {2,0,54580772,706}, + {1,0,66965504,708}, + {2,0,54580772,708}, + {1,0,66965504,710}, + {2,0,54580772,710}, + {1,0,66965504,712}, + {2,0,54580772,712}, + {1,0,66965504,714}, + {2,0,54580772,714}, + {1,0,66965504,716}, + {2,0,54580772,716}, + {1,0,66965504,718}, + {2,0,54580772,718}, + {1,0,66965504,720}, + {2,0,54580772,720}, + {1,0,66965504,722}, + {2,0,54580772,722}, + {1,0,66965504,724}, + {2,0,54580772,724}, + {1,0,66965504,726}, + {2,0,54580772,726}, + {1,0,66965504,728}, + {2,0,54580772,728}, + {1,0,66965504,730}, + {2,0,54580772,730}, + {1,0,66965504,732}, + {2,0,54580772,732}, + {1,0,66965504,734}, + {2,0,54580772,734}, + {1,0,66965504,736}, + {2,0,54580772,736}, + {1,0,66965504,738}, + {2,0,54580772,738}, + {1,0,66965504,740}, + {2,0,54580772,740}, + {1,0,66965504,742}, + {2,0,54583076,742}, + {1,0,66965504,744}, + {2,0,54580772,744}, + {1,0,66965504,746}, + {2,0,54580772,746}, + {1,0,66965504,748}, + {2,0,54580772,748}, + {1,0,66965504,750}, + {2,0,54580772,750}, + {1,0,66965504,752}, + {2,0,54580772,752}, + {1,0,66965504,754}, + {2,0,54580772,754}, + {1,0,66965504,756}, + {2,0,54580772,756}, + {1,0,66965504,758}, + {2,0,54580764,758}, + {1,0,66965504,760}, + {2,0,54580772,760}, + {1,0,66965504,762}, + {2,0,54580772,762}, + {1,0,66965504,764}, + {2,0,54580772,764}, + {1,0,66965504,766}, + {2,0,54580772,766}, + {1,0,66965504,768}, + {2,0,54580772,768}, + {1,0,66965504,770}, + {2,0,54580772,770}, + {1,0,66965504,772}, + {2,0,54580772,772}, + {1,0,66965504,774}, + {2,0,54580772,774}, + {1,0,66965504,776}, + {2,0,54580772,776}, + {1,0,66965504,778}, + {2,0,54580772,778}, + {1,0,66965504,780}, + {2,0,54580772,780}, + {1,0,66965504,782}, + {2,0,54580772,782}, + {1,0,66965504,784}, + {2,0,54580772,784}, + {1,0,66965504,786}, + {2,0,54580772,786}, + {1,0,66965504,788}, + {2,0,54580772,788}, + {1,0,66965504,790}, + {2,0,54580772,790}, + {1,0,66965504,792}, + {2,0,54580772,792}, + {1,0,66965504,794}, + {2,0,54580772,794}, + {1,0,66965504,796}, + {2,0,54580772,796}, + {1,0,54580772,330}, + {2,0,54583076,330}, + {1,0,54580772,398}, + {2,0,54583076,398}, + {1,0,54580772,412}, + {2,0,54583076,412}, + {1,0,54580772,348}, + {2,0,54583076,348}, + {1,0,54580772,428}, + {2,0,54583076,428}, + {1,0,54580772,478}, + {2,0,54583076,478}, + {1,0,54580772,470}, + {2,0,54583076,470}, + {1,0,54568484,524}, + {2,0,54574884,524}, + {1,0,54580772,486}, + {2,0,54583076,486}, + {1,0,54580772,506}, + {2,0,54583076,506}, + {1,0,54580772,360}, + {2,0,54583076,360}, + {1,0,54580772,406}, + {2,0,54583076,406}, + {1,0,54580772,434}, + {2,0,54583076,434}, + {1,0,54580772,368}, + {2,0,54583076,368}, + {1,0,54580772,566}, + {2,0,54583076,566}, + {1,0,54580772,306}, + {2,0,54583076,306}, + {1,0,54580772,416}, + {2,0,54583076,416}, + {1,0,54580772,556}, + {2,0,54583076,556}, + {1,0,54580772,636}, + {2,0,54583076,636}, + {1,0,54580772,588}, + {2,0,54583076,588}, + {1,0,54580772,546}, + {2,0,54583076,546}, + {1,0,54580772,634}, + {2,0,54583076,634}, + {1,0,54580772,482}, + {2,0,54583076,482}, + {1,0,54580772,596}, + {2,0,54583076,596}, + {1,0,54580772,624}, + {2,0,54583076,624}, + {1,0,54580772,548}, + {2,0,54583076,548}, + {1,0,54580772,554}, + {2,0,54583076,554}, + {1,0,54580772,346}, + {2,0,54583076,346}, + {1,0,54580772,334}, + {2,0,54583076,334}, + {1,0,54580772,600}, + {2,0,54583076,600}, + {1,0,54580772,332}, + {2,0,54583076,332}, + {1,0,54580772,444}, + {2,0,54583076,444}, + {1,0,54580772,682}, + {2,0,54583076,682}, + {1,0,54580772,612}, + {2,0,54583076,612}, + {1,0,54580772,404}, + {2,0,54583076,404}, + {1,0,54580772,700}, + {2,0,54583076,700}, + {1,0,54580772,606}, + {2,0,54583076,606}, + {1,0,54580772,362}, + {2,0,54583076,362}, + {1,0,54580772,390}, + {2,0,54583076,390}, + {1,0,54580772,716}, + {2,0,54583076,716}, + {1,0,54580772,662}, + {2,0,54583076,662}, + {1,0,54580772,750}, + {2,0,54583076,750}, + {1,0,54580772,502}, + {2,0,54583076,502}, + {1,0,54580772,746}, + {2,0,54583076,746}, + {1,0,54580772,654}, + {2,0,54583076,654}, + {1,0,54580772,382}, + {2,0,54583076,382}, + {1,0,54580772,510}, + {2,0,54583076,510}, + {1,0,54580772,354}, + {2,0,54583076,354}, + {1,0,54580772,692}, + {2,0,54583076,692}, + {1,0,54580772,724}, + {2,0,54583076,724}, + {1,0,54580772,694}, + {2,0,54583076,694}, + {1,0,54580772,604}, + {2,0,54583076,604}, + {1,0,54580772,614}, + {2,0,54583076,614}, + {1,0,54580772,646}, + {2,0,54583076,646}, + {1,0,54580772,538}, + {2,0,54583076,538}, + {1,0,54580772,490}, + {2,0,54583076,490}, + {1,0,54580772,580}, + {2,0,54583076,580}, + {1,0,54580772,560}, + {2,0,54583076,560}, + // failing operation + {1,0,54580772,788}, + }; + } + +} \ No newline at end of file diff --git a/tests/utils/cp_data_1.hpp b/tests/utils/cp_data_1.hpp new file mode 100644 index 00000000..dc5988e7 --- /dev/null +++ b/tests/utils/cp_data_1.hpp @@ -0,0 +1,12 @@ +#pragma once + +#include + +namespace db0::tests + +{ + + // op-code, realm_id, capacity, slab id + std::vector > getCPData(); + +} \ No newline at end of file diff --git a/tests/utils/utils.cpp b/tests/utils/utils.cpp index 10201dc0..fb2b917e 100644 --- a/tests/utils/utils.cpp +++ b/tests/utils/utils.cpp @@ -3,8 +3,11 @@ #include #include #include +#include +#include +#include -namespace db0 { namespace tests +namespace db0::tests { @@ -49,5 +52,5 @@ namespace db0 { namespace tests } return _str.str(); } - -} } \ No newline at end of file + +} \ No newline at end of file diff --git a/tests/utils/utils.hpp b/tests/utils/utils.hpp index 7f4a95d2..cf73ce53 100644 --- a/tests/utils/utils.hpp +++ b/tests/utils/utils.hpp @@ -2,6 +2,7 @@ #include #include +#include namespace db0::tests