From 37f2d92fccf8fe386a90c1367fdb0e804f4a3c7c Mon Sep 17 00:00:00 2001 From: Ujjwal Shekhar Date: Mon, 17 Jun 2024 13:43:39 +0530 Subject: [PATCH 1/6] Path testing started. For now the tree chunks are 0-indexed. - Will wrap the each of the data points in an optional. - Make MIN_SHORT_DEL as proxy for "unfilled" short delta [can do later too] --- hhds/tree.cpp | 137 +++++++++++++------------------------------------- hhds/tree.hpp | 89 ++++++++++++++++++++++++++------ 2 files changed, 108 insertions(+), 118 deletions(-) diff --git a/hhds/tree.cpp b/hhds/tree.cpp index 9d6c0b7..55783a8 100644 --- a/hhds/tree.cpp +++ b/hhds/tree.cpp @@ -1,116 +1,47 @@ -#include -#include +// test.cpp +#include "tree.hpp" -#include -#include - -#include -#include -#include -#include -#include -#include -#include -using namespace std; - -using Tree_pos = uint64_t; - -static constexpr Tree_pos INVALID = 0; // ROOT ID -static constexpr Tree_pos ROOT = 0; // ROOT ID -static constexpr short CHUNK_BITS = 43; // Number of chunks in a tree node -static constexpr short SHORT_DELTA = 21; // Amount of short delta allowed -static constexpr short MAX_OFFSET = 3; // The number of bits in a chunk offset -static constexpr short CHUNK_SIZE = 1 << MAX_OFFSET; // Size of a chunk in bits -static constexpr short CHUNK_MASK = CHUNK_SIZE - 1; // Mask for chunk offset -static constexpr uint64_t MAX_TREE_SIZE = 1LL << CHUNK_BITS; // Maximum number of nodes in the tree - -struct __attribute__((packed)) Tree_pointers { - // We only store the exact ID of parent - Tree_pos parent : CHUNK_BITS + MAX_OFFSET; - Tree_pos next_sibling : CHUNK_BITS; - Tree_pos prev_sibling : CHUNK_BITS; - - // Long child pointers - Tree_pos first_child_l : CHUNK_BITS; - Tree_pos last_child_l : CHUNK_BITS; - - // Short (delta) child pointers - struct __attribute__((packed)) short_child { - Tree_pos delta : SHORT_DELTA; - } first_child_s[CHUNK_SIZE - 1], last_child_s[CHUNK_SIZE - 1]; - - // Gives 70 bits - // struct __attribute__((packed)) short_child { - // Tree_pos delta : SHORT_DELTA; - // } first_child_s[CHUNK_SIZE - 1], last_child_s[CHUNK_SIZE - 1]; +int main() { + using namespace hhds; - // Short deltas - // These give 64 bit alignment - // Tree_pos first_child_s_0 : SHORT_DELTA; - // Tree_pos first_child_s_1 : SHORT_DELTA; - // Tree_pos first_child_s_2 : SHORT_DELTA; - // Tree_pos first_child_s_3 : SHORT_DELTA; - // Tree_pos first_child_s_4 : SHORT_DELTA; - // Tree_pos first_child_s_5 : SHORT_DELTA; - // Tree_pos first_child_s_6 : SHORT_DELTA; + // Create a tree of integers + tree my_tree; - // Tree_pos last_child_s_0 : SHORT_DELTA; - // Tree_pos last_child_s_1 : SHORT_DELTA; - // Tree_pos last_child_s_2 : SHORT_DELTA; - // Tree_pos last_child_s_3 : SHORT_DELTA; - // Tree_pos last_child_s_4 : SHORT_DELTA; - // Tree_pos last_child_s_5 : SHORT_DELTA; - // Tree_pos last_child_s_6 : SHORT_DELTA; + // Add root node with data 10 + Tree_pos root = my_tree.add_root(10); + std::cout << "Root node added with data: " << my_tree.get_data(root) << std::endl; - // Gives 70 bytes, 3 for each arr - // std::array first_child_s; - // std::array last_child_s; + // Add children to root node + Tree_pos child1 = my_tree.add_child(root, 20); + std::cout << "Child 1 added with data: " << 20 << std::endl; - // Gives - // uint_32t first_child_s[CHUNK_MASK] : SHORT_DELTA; - // uint_32t last_child_s[CHUNK_MASK] : SHORT_DELTA; + Tree_pos child2 = my_tree.add_child(root, 30); + Tree_pos child3 = my_tree.add_child(root, 40); + std::cout << "Child 3 added with data: " << my_tree.get_data(child3) << std::endl; - Tree_pointers() - : parent(MAX_TREE_SIZE), next_sibling(0), prev_sibling(0), - first_child_l(0), last_child_l(0) { + // Check if child1 is the first child + bool is_first = my_tree.is_first_child(child1); + std::cout << "Is child1 the first child? " << (is_first ? "Yes" : "No") << std::endl; - // Fill first_child_s and last_child_s - // for (int i = 0; i < CHUNK_SIZE - 1; i++) { - // first_child_s[i].delta = 0; - // last_child_s[i].delta = 0; - // } + // Check if child3 is the last child + bool is_last = my_tree.is_last_child(child3); + std::cout << "Is child3 the last child? " << (is_last ? "Yes" : "No") << std::endl; - // std::fill(first_child_s.begin(), first_child_s.end(), short_child{0}); - // std::fill(last_child_s.begin(), last_child_s.end(), short_child{0}); - - // first_child_s_0 = 0; - // first_child_s_1 = 0; - // first_child_s_2 = 0; - // first_child_s_3 = 0; - // first_child_s_4 = 0; - // first_child_s_5 = 0; - // first_child_s_6 = 0; + // // Get the next sibling of child1 + // Tree_pos next_sibling = my_tree.get_sibling_next(child1); + // std::cout << "Next sibling of child1 has data: " << my_tree.get_data(next_sibling) << std::endl; - // last_child_s_0 = 0; - // last_child_s_1 = 0; - // last_child_s_2 = 0; - // last_child_s_3 = 0; - // last_child_s_4 = 0; - // last_child_s_5 = 0; - // last_child_s_6 = 0; + // // Get the previous sibling of child3 + // Tree_pos prev_sibling = my_tree.get_sibling_prev(child3); + // std::cout << "Previous sibling of child3 has data: " << my_tree.get_data(prev_sibling) << std::endl; - // for (int i = 0; i < CHUNK_MASK; i++) { - // first_child_s[i] = 0; - // last_child_s[i] = 0; - // } - } -}; + // // Get the first child of root + // Tree_pos first_child = my_tree.get_first_child(root); + // std::cout << "First child of root has data: " << my_tree.get_data(first_child) << std::endl; -int main() { - - Tree_pointers test; - cout << sizeof(test) << endl; - // cout << sizeof(test.first_child_s[0]) << endl; + // // Get the last child of root + // Tree_pos last_child = my_tree.get_last_child(root); + // std::cout << "Last child of root has data: " << my_tree.get_data(last_child) << std::endl; return 0; -} \ No newline at end of file +} diff --git a/hhds/tree.hpp b/hhds/tree.hpp index fdae368..e244d5d 100644 --- a/hhds/tree.hpp +++ b/hhds/tree.hpp @@ -52,8 +52,8 @@ static constexpr short NUM_SHORT_DEL = CHUNK_MASK; // Numbe static constexpr uint64_t MAX_TREE_SIZE = 1LL << CHUNK_BITS; // Maximum number of nodes in the tree -static constexpr Short_delta MIN_SHORT_DELTA = -(1 << SHORT_DELTA); // Minimum value for short delta -static constexpr Short_delta MAX_SHORT_DELTA = (1 << SHORT_DELTA) - 1; // Maximum value for short delta +static constexpr Short_delta MIN_SHORT_DELTA = -(1 << (SHORT_DELTA - 1)); // Minimum value for short delta +static constexpr Short_delta MAX_SHORT_DELTA = (1 << (SHORT_DELTA - 1)) - 1; // Maximum value for short delta class __attribute__((packed, aligned(64))) Tree_pointers { private: @@ -210,9 +210,12 @@ class __attribute__((packed, aligned(64))) Tree_pointers { return false; } } - return parent == other.parent && next_sibling == other.next_sibling && - prev_sibling == other.prev_sibling && first_child_l == other.first_child_l && - last_child_l == other.last_child_l; + + return parent == other.parent && + next_sibling == other.next_sibling && + prev_sibling == other.prev_sibling && + first_child_l == other.first_child_l && + last_child_l == other.last_child_l; } constexpr bool operator!=(const Tree_pointers& other) const { return !(*this == other); } @@ -234,7 +237,7 @@ class tree { /* Special functions for sanity */ [[nodiscard]] bool _check_idx_exists(const Tree_pos &idx) const noexcept { - return idx >= 0 && idx < static_cast(pointers_stack.size()); + return idx >= 0 && idx < static_cast((pointers_stack.size()) << CHUNK_SHIFT) + CHUNK_MASK; } [[nodiscard]] bool _contains_data(const Tree_pos &idx) const noexcept { /* CHANGE THE SECOND CONDITION @@ -253,7 +256,7 @@ class tree { // Make space for CHUNK_SIZE number of entries at the end data_stack.emplace_back(data); - for (int i = 0; i < CHUNK_OFFSET; i++) { + for (int i = 0; i < CHUNK_MASK; i++) { data_stack.emplace_back(); } @@ -391,6 +394,26 @@ class tree { */ Tree_pos append_sibling(const Tree_pos& sibling_id, const X& data); Tree_pos add_child(const Tree_pos& parent_index, const X& data); + Tree_pos add_root(const X& data); + + /** + * Data access API + */ + X get_data(const Tree_pos& idx) { + if (!_check_idx_exists(idx)) { + throw std::out_of_range("Index out of range"); + } + + return data_stack[idx]; + } + + void set_data(const Tree_pos& idx, const X& data) { + if (!_check_idx_exists(idx)) { + throw std::out_of_range("Index out of range"); + } + + data_stack[idx] = data; + } // :public }; // tree class @@ -498,7 +521,7 @@ bool tree::is_last_child(const Tree_pos& self_index) { // Now, to be the last child, all entries after this should be invalid for (short offset = self_chunk_offset; offset < NUM_SHORT_DEL; offset++) { - const auto last_child_s_i = pointers_stack[self_chunk_id].get_last_child_s_at(offset); + // const auto last_child_s_i = pointers_stack[self_chunk_id].get_last_child_s_at(offset); if (_contains_data((self_chunk_id << CHUNK_SHIFT) + offset)) { return false; } @@ -632,7 +655,9 @@ Tree_pos tree::append_sibling(const Tree_pos& sibling_id, const X& data) { const auto sibling_chunk_id = (sibling_id >> CHUNK_SHIFT); const auto sibling_parent_id = pointers_stack[sibling_chunk_id].get_parent(); const auto sib_parent_chunk_id = (sibling_parent_id >> CHUNK_SHIFT); - const auto last_sib_chunk_id = get_last_child(sibling_parent_id); + const auto last_sib_chunk_id = get_last_child(sibling_parent_id) >> CHUNK_SHIFT; + + std::cout << "hiihihih2 last : " << last_sib_chunk_id << std::endl; // Can fit the sibling in the same chunk for (short offset = 0; offset < NUM_SHORT_DEL; offset++) { @@ -654,9 +679,12 @@ Tree_pos tree::append_sibling(const Tree_pos& sibling_id, const X& data) { pointers_stack[sib_parent_chunk_id].set_last_child_l(new_sib_chunk_id); } else { // Try to fit the delta in the short delta pointers + const auto delta = new_sib_chunk_id - sib_parent_chunk_id; if (_fits_in_short_del(sibling_parent_id, new_sib_chunk_id)) { - pointers_stack[sib_parent_chunk_id].set_last_child_s_at((sibling_parent_id & CHUNK_MASK) - 1, - static_cast(delta)); + pointers_stack[sib_parent_chunk_id].set_last_child_s_at( + (sibling_parent_id & CHUNK_MASK) - 1, + static_cast(delta) + ); } else { // Break the parent chunk from the parent id const auto new_parent_chunk_id = _break_chunk_from(sibling_parent_id); @@ -669,6 +697,32 @@ Tree_pos tree::append_sibling(const Tree_pos& sibling_id, const X& data) { return new_sib_chunk_id << CHUNK_SHIFT; } +/** + * @brief Add a root node to the tree. + * + * @param data The data to be stored in the root node. + * + * @return Tree_pos The absolute ID of the root node. + * @throws std::logic_error If the tree is not empty + */ +template +Tree_pos tree::add_root(const X& data) { + if (!pointers_stack.empty()) { + throw std::logic_error("Tree is not empty"); + } + + // Make space for CHUNK_SIZE number of entries at the end + data_stack.emplace_back(data); + for (int i = 0; i < CHUNK_MASK; i++) { + data_stack.emplace_back(); + } + + // Add the single pointer node for all CHUNK_SIZE entries + pointers_stack.emplace_back(MAX_TREE_SIZE); + + return (data_stack.size() - CHUNK_SIZE) >> CHUNK_SHIFT; +} + /** * @brief Add a chlid to a node at the end of all it's children. * @@ -704,10 +758,15 @@ Tree_pos tree::add_child(const Tree_pos& parent_index, const X& data) { // Try to fit the delta in the short delta pointers const auto delta = child_chunk_id - parent_chunk_id; if (_fits_in_short_del(parent_index, child_chunk_id)) { - pointers_stack[parent_chunk_id].set_first_child_s_at(parent_chunk_offset - 1, - static_cast(delta)); - pointers_stack[parent_chunk_id].set_last_child_s_at(parent_chunk_offset - 1, - static_cast(delta)); + pointers_stack[parent_chunk_id].set_first_child_s_at( + parent_chunk_offset - 1, + static_cast(delta) + ); + + pointers_stack[parent_chunk_id].set_last_child_s_at( + parent_chunk_offset - 1, + static_cast(delta) + ); } else { // Break the parent chunk from the parent id const auto new_parent_chunk_id = _break_chunk_from(parent_index); From 30034886db252c8913585e978f966de0c330f8aa Mon Sep 17 00:00:00 2001 From: Ujjwal Shekhar Date: Mon, 17 Jun 2024 13:54:25 +0530 Subject: [PATCH 2/6] Wrapped data in optional - We can always add 1 more bit to check if the first member of chunk is occupied, rest can be checked by assigning MIN_SHORT_DEL as special for not occupied and 0 for occupied but unused pointer. [We can discuss later] --- hhds/tree.hpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/hhds/tree.hpp b/hhds/tree.hpp index e244d5d..015adcd 100644 --- a/hhds/tree.hpp +++ b/hhds/tree.hpp @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -232,18 +233,15 @@ template class tree { private: /* The tree pointers and data stored separately */ - std::vector pointers_stack; - std::vector data_stack; + std::vector pointers_stack; + std::vector> data_stack; /* Special functions for sanity */ [[nodiscard]] bool _check_idx_exists(const Tree_pos &idx) const noexcept { return idx >= 0 && idx < static_cast((pointers_stack.size()) << CHUNK_SHIFT) + CHUNK_MASK; } [[nodiscard]] bool _contains_data(const Tree_pos &idx) const noexcept { - /* CHANGE THE SECOND CONDITION - CAN USE STD::OPTIONAL WRAPPING AROUND THE - TEMPLATE OF X */ - return (idx < data_stack.size() && data_stack[idx]); + return (idx < data_stack.size() && data_stack[idx].has_value()); } /* Function to add an entry to the pointers and data stack (typically for add/append)*/ @@ -400,11 +398,11 @@ class tree { * Data access API */ X get_data(const Tree_pos& idx) { - if (!_check_idx_exists(idx)) { - throw std::out_of_range("Index out of range"); + if (!_check_idx_exists(idx) || !data_stack[idx].has_value()) { + throw std::out_of_range("Index out of range or no data at index"); } - return data_stack[idx]; + return data_stack[idx].value(); } void set_data(const Tree_pos& idx, const X& data) { From ea63f9fea1510673c6d21f1ee878c73f2997ef99 Mon Sep 17 00:00:00 2001 From: Ujjwal Shekhar Date: Mon, 17 Jun 2024 14:33:56 +0530 Subject: [PATCH 3/6] Finished basic testing. Will continue with stronger tests. --- hhds/tree.cpp | 27 +++++++++++++++------------ hhds/tree.hpp | 18 ++++++++++-------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/hhds/tree.cpp b/hhds/tree.cpp index 55783a8..8159eba 100644 --- a/hhds/tree.cpp +++ b/hhds/tree.cpp @@ -19,6 +19,7 @@ int main() { Tree_pos child3 = my_tree.add_child(root, 40); std::cout << "Child 3 added with data: " << my_tree.get_data(child3) << std::endl; + std::cout << "Indices of children: " << child1 << " " << child2 << " " << child3 << std::endl; // Check if child1 is the first child bool is_first = my_tree.is_first_child(child1); std::cout << "Is child1 the first child? " << (is_first ? "Yes" : "No") << std::endl; @@ -27,21 +28,23 @@ int main() { bool is_last = my_tree.is_last_child(child3); std::cout << "Is child3 the last child? " << (is_last ? "Yes" : "No") << std::endl; - // // Get the next sibling of child1 - // Tree_pos next_sibling = my_tree.get_sibling_next(child1); - // std::cout << "Next sibling of child1 has data: " << my_tree.get_data(next_sibling) << std::endl; + // Get the next sibling of child1 + std::cout << "gottem "; + Tree_pos next_sibling = my_tree.get_sibling_next(child1); + std::cout << "gottem "; + std::cout << "Next sibling of child1 has data: " << my_tree.get_data(next_sibling) << std::endl; - // // Get the previous sibling of child3 - // Tree_pos prev_sibling = my_tree.get_sibling_prev(child3); - // std::cout << "Previous sibling of child3 has data: " << my_tree.get_data(prev_sibling) << std::endl; + // Get the previous sibling of child3 + Tree_pos prev_sibling = my_tree.get_sibling_prev(child3); + std::cout << "Previous sibling of child3 has data: " << my_tree.get_data(prev_sibling) << std::endl; - // // Get the first child of root - // Tree_pos first_child = my_tree.get_first_child(root); - // std::cout << "First child of root has data: " << my_tree.get_data(first_child) << std::endl; + // Get the first child of root + Tree_pos first_child = my_tree.get_first_child(root); + std::cout << "First child of root has data: " << my_tree.get_data(first_child) << std::endl; - // // Get the last child of root - // Tree_pos last_child = my_tree.get_last_child(root); - // std::cout << "Last child of root has data: " << my_tree.get_data(last_child) << std::endl; + // Get the last child of root + Tree_pos last_child = my_tree.get_last_child(root); + std::cout << "Last child of root has data: " << my_tree.get_data(last_child) << std::endl; return 0; } diff --git a/hhds/tree.hpp b/hhds/tree.hpp index 015adcd..fe71945 100644 --- a/hhds/tree.hpp +++ b/hhds/tree.hpp @@ -238,7 +238,7 @@ class tree { /* Special functions for sanity */ [[nodiscard]] bool _check_idx_exists(const Tree_pos &idx) const noexcept { - return idx >= 0 && idx < static_cast((pointers_stack.size()) << CHUNK_SHIFT) + CHUNK_MASK; + return idx >= 0 && idx < static_cast(data_stack.size()); } [[nodiscard]] bool _contains_data(const Tree_pos &idx) const noexcept { return (idx < data_stack.size() && data_stack[idx].has_value()); @@ -580,8 +580,9 @@ Tree_pos tree::get_sibling_next(const Tree_pos& sibling_id) { // Check if the next sibling is within the same chunk, at idx + 1 const auto curr_chunk_id = (sibling_id >> CHUNK_SHIFT); const auto curr_chunk_offset = (sibling_id & CHUNK_MASK); - if (curr_chunk_offset < CHUNK_MASK and _contains_data(curr_chunk_id + curr_chunk_offset + 1)) { - return static_cast(curr_chunk_id + curr_chunk_offset + 1); + if (curr_chunk_offset < CHUNK_MASK and + _contains_data((curr_chunk_id << CHUNK_SHIFT) + curr_chunk_offset + 1)) { + return static_cast((curr_chunk_id << CHUNK_SHIFT) + curr_chunk_offset + 1); } // Just jump to the next sibling chunk, or returns invalid @@ -595,6 +596,8 @@ Tree_pos tree::get_sibling_next(const Tree_pos& sibling_id) { * @return Tree_pos The absolute ID of the prev sibling, INVALID if none * * @throws std::out_of_range If the sibling index is out of range + * @todo handle when the prev or next could be within same chunk but more than 1 offset away + * happens if someone is deleted from the middle */ template Tree_pos tree::get_sibling_prev(const Tree_pos& sibling_id) { @@ -607,11 +610,12 @@ Tree_pos tree::get_sibling_prev(const Tree_pos& sibling_id) { return INVALID; } - // Check if the prev sibling is within the same chunk, at idx + 1 + // Check if the prev sibling is within the same chunk, at idx - 1 const auto curr_chunk_id = (sibling_id >> CHUNK_SHIFT); const auto curr_chunk_offset = (sibling_id & CHUNK_MASK); - if (curr_chunk_offset > 0 and _contains_data(curr_chunk_id + curr_chunk_offset - 1)) { - return static_cast(curr_chunk_id + curr_chunk_offset - 1); + if (curr_chunk_offset > 0 and + _contains_data((curr_chunk_id << CHUNK_SHIFT) + curr_chunk_offset - 1)) { + return static_cast((curr_chunk_id << CHUNK_SHIFT) + curr_chunk_offset - 1); } // Just jump to the next sibling chunk, or returns invalid @@ -655,8 +659,6 @@ Tree_pos tree::append_sibling(const Tree_pos& sibling_id, const X& data) { const auto sib_parent_chunk_id = (sibling_parent_id >> CHUNK_SHIFT); const auto last_sib_chunk_id = get_last_child(sibling_parent_id) >> CHUNK_SHIFT; - std::cout << "hiihihih2 last : " << last_sib_chunk_id << std::endl; - // Can fit the sibling in the same chunk for (short offset = 0; offset < NUM_SHORT_DEL; offset++) { if (!_contains_data((last_sib_chunk_id << CHUNK_SHIFT) + offset)) { From a641ba89abd8f68536d82bfb367dd9f8cc7afffd Mon Sep 17 00:00:00 2001 From: Ujjwal Shekhar Date: Tue, 18 Jun 2024 18:25:35 +0530 Subject: [PATCH 4/6] Safety commit before PR --- hhds/testing.cpp | 88 +++++++++++++++++++++++++++++++++++++++--------- hhds/tree.hpp | 25 +++++++++++++- 2 files changed, 96 insertions(+), 17 deletions(-) diff --git a/hhds/testing.cpp b/hhds/testing.cpp index b4bf41e..8cb84f2 100644 --- a/hhds/testing.cpp +++ b/hhds/testing.cpp @@ -1,25 +1,81 @@ +// test.cpp +#include "tree.hpp" #include +#include -class MyClass { -private: - void privateFunction() { - std::cout << "Private function called" << std::endl; - // Calling a public member function from a private member function - publicFunction(); - } -public: - void publicFunction() { - std::cout << "Public function called" << std::endl; +int main() { + // Create a tree of integers + hhds::tree my_tree; + + // Add root node with data 10 + hhds::Tree_pos root = my_tree.add_root(10); + std::cout << "Root node added with data: " << my_tree.get_data(root) << std::endl; + + // Add initial children to root node + hhds::Tree_pos child1 = my_tree.add_child(root, 20); + hhds::Tree_pos child2 = my_tree.add_child(root, 30); + hhds::Tree_pos child3 = my_tree.add_child(root, 40); + + std::cout << "Initial children added to root." << std::endl; + + // Add a million children to root + const int num_children = 18; + for (int i = 0; i < num_children; ++i) { + my_tree.add_child(root, i); } + std::cout << "Added " << num_children << " children to the root." << std::endl; + my_tree.print_tree(); + + // // Verify the structure of the tree by checking a few nodes + // try { + // std::cout << "Root node data: " << my_tree.get_data(root) << std::endl; + // std::cout << "First child of root data: " << my_tree.get_data(my_tree.get_first_child(root)) << std::endl; + // std::cout << "Last child of root data: " << my_tree.get_data(my_tree.get_last_child(root)) << std::endl; + // } catch (const std::out_of_range& e) { + // std::cerr << "Error: " << e.what() << std::endl; + // } - void callPrivateFunction() { - privateFunction(); + // Find child3 using next_sibling calls + hhds::Tree_pos current_sibling = my_tree.get_first_child(root); + std::cout << "First child of root: " << my_tree.get_data(current_sibling) << " at " << current_sibling << std::endl; + for (int i = 1; i < 3; ++i) { + break; + current_sibling = my_tree.get_sibling_next(current_sibling); } -}; -int main() { - MyClass obj; - obj.callPrivateFunction(); // This will call the private function indirectly + // Add a million children to child3 of root + // for (int i = 0; i < num_children; ++i) { + // my_tree.add_child(current_sibling, i + num_children); + // } + // std::cout << "Added " << num_children << " children to child3 of the root." << std::endl; + + // // Verify the structure of the tree by checking a few nodes + // try { + // std::cout << "Child3 data: " << my_tree.get_data(current_sibling) << std::endl; + // std::cout << "First child of child3 data: " << my_tree.get_data(my_tree.get_first_child(current_sibling)) << std::endl; + // std::cout << "Last child of child3 data: " << my_tree.get_data(my_tree.get_last_child(current_sibling)) << std::endl; + // } catch (const std::out_of_range& e) { + // std::cerr << "Error: " << e.what() << std::endl; + // } + + // // Add a million children to child2 of root + // current_sibling = my_tree.get_first_child(root); + // current_sibling = my_tree.get_sibling_next(current_sibling); + + // for (int i = 0; i < num_children; ++i) { + // my_tree.add_child(current_sibling, i + 2 * num_children); + // } + // std::cout << "Added " << num_children << " children to child2 of the root." << std::endl; + + // // Verify the structure of the tree by checking a few nodes + // try { + // std::cout << "Child2 data: " << my_tree.get_data(current_sibling) << std::endl; + // std::cout << "First child of child2 data: " << my_tree.get_data(my_tree.get_first_child(current_sibling)) << std::endl; + // std::cout << "Last child of child2 data: " << my_tree.get_data(my_tree.get_last_child(current_sibling)) << std::endl; + // } catch (const std::out_of_range& e) { + // std::cerr << "Error: " << e.what() << std::endl; + // } + return 0; } diff --git a/hhds/tree.hpp b/hhds/tree.hpp index fe71945..e32d8df 100644 --- a/hhds/tree.hpp +++ b/hhds/tree.hpp @@ -412,6 +412,28 @@ class tree { data_stack[idx] = data; } + + /** + * Debug API (Temp) + */ + void print_tree() { + for (size_t i = 0; i < pointers_stack.size(); i++) { + std::cout << "Index: " << i << " Parent: " << pointers_stack[i].get_parent() << " Data: "; + std::cout << "First Child: " << pointers_stack[i].get_first_child_l() << " "; + std::cout << "Last Child: " << pointers_stack[i].get_last_child_l() << " "; + std::cout << "Next Sibling: " << pointers_stack[i].get_next_sibling() << " "; + std::cout << "Prev Sibling: " << pointers_stack[i].get_prev_sibling() << std::endl; + std::cout << std::endl; + } + + for (size_t i = 0; i < data_stack.size(); i++) { + if (data_stack[i].has_value()) { + std::cout << "Index: " << i << " Data: " << data_stack[i].value() << ", "; + } else { + std::cout << "Index: " << i << " Data: NULL" << ", "; + } + } + } // :public }; // tree class @@ -660,7 +682,7 @@ Tree_pos tree::append_sibling(const Tree_pos& sibling_id, const X& data) { const auto last_sib_chunk_id = get_last_child(sibling_parent_id) >> CHUNK_SHIFT; // Can fit the sibling in the same chunk - for (short offset = 0; offset < NUM_SHORT_DEL; offset++) { + for (short offset = 0; offset < CHUNK_SIZE; offset++) { if (!_contains_data((last_sib_chunk_id << CHUNK_SHIFT) + offset)) { // Put the data here and update bookkeeping data_stack[(last_sib_chunk_id << CHUNK_SHIFT) + offset] = data; @@ -779,4 +801,5 @@ Tree_pos tree::add_child(const Tree_pos& parent_index, const X& data) { return child_chunk_id << CHUNK_SHIFT; } + } // hhds namespace \ No newline at end of file From 01d7223e480fe23ee17c4fe883cec6a02a297a99 Mon Sep 17 00:00:00 2001 From: Ujjwal Shekhar Date: Thu, 27 Jun 2024 12:15:54 +0530 Subject: [PATCH 5/6] bazel for bench up and running. - Note: I have commented out the compilation of `*graph*.{h/c}cpp` since the files seem to be incomplete. --- MODULE.bazel | 6 + MODULE.bazel.lock | 1632 ++++++++++++++++++++++++++++++++++++++ hhds/BUILD | 79 +- hhds/lhtree.hpp | 1338 +++++++++++++++++++++++++++++++ hhds/tests/tree_test.cpp | 27 +- hhds/tree.cpp | 76 +- 6 files changed, 3065 insertions(+), 93 deletions(-) create mode 100644 MODULE.bazel create mode 100644 MODULE.bazel.lock create mode 100644 hhds/lhtree.hpp diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 0000000..00bb183 --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,6 @@ +############################################################################### +# Bazel now uses Bzlmod by default to manage external dependencies. +# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. +# +# For more details, please check https://github.com/bazelbuild/bazel/issues/18958 +############################################################################### diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock new file mode 100644 index 0000000..1558a0c --- /dev/null +++ b/MODULE.bazel.lock @@ -0,0 +1,1632 @@ +{ + "lockFileVersion": 6, + "moduleFileHash": "0e3e315145ac7ee7a4e0ac825e1c5e03c068ec1254dd42c3caaecb27e921dc4d", + "flags": { + "cmdRegistries": [ + "https://bcr.bazel.build/" + ], + "cmdModuleOverrides": {}, + "allowedYankedVersions": [], + "envVarAllowedYankedVersions": "", + "ignoreDevDependency": false, + "directDependenciesMode": "WARNING", + "compatibilityMode": "ERROR" + }, + "localOverrideHashes": { + "bazel_tools": "1ae69322ac3823527337acf02016e8ee95813d8d356f47060255b8956fa642f0" + }, + "moduleDepGraph": { + "": { + "name": "", + "version": "", + "key": "", + "repoName": "", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + } + }, + "bazel_tools@_": { + "name": "bazel_tools", + "version": "", + "key": "bazel_tools@_", + "repoName": "bazel_tools", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@local_config_cc_toolchains//:all", + "@local_config_sh//:local_sh_toolchain" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@bazel_tools//tools/cpp:cc_configure.bzl", + "extensionName": "cc_configure_extension", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 18, + "column": 29 + }, + "imports": { + "local_config_cc": "local_config_cc", + "local_config_cc_toolchains": "local_config_cc_toolchains" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_tools//tools/osx:xcode_configure.bzl", + "extensionName": "xcode_configure_extension", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 22, + "column": 32 + }, + "imports": { + "local_config_xcode": "local_config_xcode" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@rules_java//java:extensions.bzl", + "extensionName": "toolchains", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 25, + "column": 32 + }, + "imports": { + "local_jdk": "local_jdk", + "remote_java_tools": "remote_java_tools", + "remote_java_tools_linux": "remote_java_tools_linux", + "remote_java_tools_windows": "remote_java_tools_windows", + "remote_java_tools_darwin_x86_64": "remote_java_tools_darwin_x86_64", + "remote_java_tools_darwin_arm64": "remote_java_tools_darwin_arm64" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_tools//tools/sh:sh_configure.bzl", + "extensionName": "sh_configure_extension", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 36, + "column": 39 + }, + "imports": { + "local_config_sh": "local_config_sh" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_tools//tools/test:extensions.bzl", + "extensionName": "remote_coverage_tools_extension", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 40, + "column": 48 + }, + "imports": { + "remote_coverage_tools": "remote_coverage_tools" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_tools//tools/android:android_extensions.bzl", + "extensionName": "remote_android_tools_extensions", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 43, + "column": 42 + }, + "imports": { + "android_gmaven_r8": "android_gmaven_r8", + "android_tools": "android_tools" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@buildozer//:buildozer_binary.bzl", + "extensionName": "buildozer_binary", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 47, + "column": 33 + }, + "imports": { + "buildozer_binary": "buildozer_binary" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "rules_cc": "rules_cc@0.0.9", + "rules_java": "rules_java@7.4.0", + "rules_license": "rules_license@0.0.7", + "rules_proto": "rules_proto@5.3.0-21.7", + "rules_python": "rules_python@0.22.1", + "buildozer": "buildozer@6.4.0.2", + "platforms": "platforms@0.0.7", + "com_google_protobuf": "protobuf@21.7", + "zlib": "zlib@1.3", + "build_bazel_apple_support": "apple_support@1.5.0", + "local_config_platform": "local_config_platform@_" + } + }, + "local_config_platform@_": { + "name": "local_config_platform", + "version": "", + "key": "local_config_platform@_", + "repoName": "local_config_platform", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.7", + "bazel_tools": "bazel_tools@_" + } + }, + "rules_cc@0.0.9": { + "name": "rules_cc", + "version": "0.0.9", + "key": "rules_cc@0.0.9", + "repoName": "rules_cc", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@local_config_cc_toolchains//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@bazel_tools//tools/cpp:cc_configure.bzl", + "extensionName": "cc_configure_extension", + "usingModule": "rules_cc@0.0.9", + "location": { + "file": "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel", + "line": 9, + "column": 29 + }, + "imports": { + "local_config_cc_toolchains": "local_config_cc_toolchains" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "platforms": "platforms@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz" + ], + "integrity": "sha256-IDeHW5pEVtzkp50RKorohbvEqtlo5lh9ym5k86CQDN8=", + "strip_prefix": "rules_cc-0.0.9", + "remote_patches": { + "https://bcr.bazel.build/modules/rules_cc/0.0.9/patches/module_dot_bazel_version.patch": "sha256-mM+qzOI0SgAdaJBlWOSMwMPKpaA9b7R37Hj/tp5bb4g=" + }, + "remote_patch_strip": 0 + } + } + }, + "rules_java@7.4.0": { + "name": "rules_java", + "version": "7.4.0", + "key": "rules_java@7.4.0", + "repoName": "rules_java", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "//toolchains:all", + "@local_jdk//:runtime_toolchain_definition", + "@local_jdk//:bootstrap_runtime_toolchain_definition", + "@remotejdk11_linux_toolchain_config_repo//:all", + "@remotejdk11_linux_aarch64_toolchain_config_repo//:all", + "@remotejdk11_linux_ppc64le_toolchain_config_repo//:all", + "@remotejdk11_linux_s390x_toolchain_config_repo//:all", + "@remotejdk11_macos_toolchain_config_repo//:all", + "@remotejdk11_macos_aarch64_toolchain_config_repo//:all", + "@remotejdk11_win_toolchain_config_repo//:all", + "@remotejdk11_win_arm64_toolchain_config_repo//:all", + "@remotejdk17_linux_toolchain_config_repo//:all", + "@remotejdk17_linux_aarch64_toolchain_config_repo//:all", + "@remotejdk17_linux_ppc64le_toolchain_config_repo//:all", + "@remotejdk17_linux_s390x_toolchain_config_repo//:all", + "@remotejdk17_macos_toolchain_config_repo//:all", + "@remotejdk17_macos_aarch64_toolchain_config_repo//:all", + "@remotejdk17_win_toolchain_config_repo//:all", + "@remotejdk17_win_arm64_toolchain_config_repo//:all", + "@remotejdk21_linux_toolchain_config_repo//:all", + "@remotejdk21_linux_aarch64_toolchain_config_repo//:all", + "@remotejdk21_macos_toolchain_config_repo//:all", + "@remotejdk21_macos_aarch64_toolchain_config_repo//:all", + "@remotejdk21_win_toolchain_config_repo//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@rules_java//java:extensions.bzl", + "extensionName": "toolchains", + "usingModule": "rules_java@7.4.0", + "location": { + "file": "https://bcr.bazel.build/modules/rules_java/7.4.0/MODULE.bazel", + "line": 19, + "column": 27 + }, + "imports": { + "remote_java_tools": "remote_java_tools", + "remote_java_tools_linux": "remote_java_tools_linux", + "remote_java_tools_windows": "remote_java_tools_windows", + "remote_java_tools_darwin_x86_64": "remote_java_tools_darwin_x86_64", + "remote_java_tools_darwin_arm64": "remote_java_tools_darwin_arm64", + "local_jdk": "local_jdk", + "remotejdk11_linux_toolchain_config_repo": "remotejdk11_linux_toolchain_config_repo", + "remotejdk11_linux_aarch64_toolchain_config_repo": "remotejdk11_linux_aarch64_toolchain_config_repo", + "remotejdk11_linux_ppc64le_toolchain_config_repo": "remotejdk11_linux_ppc64le_toolchain_config_repo", + "remotejdk11_linux_s390x_toolchain_config_repo": "remotejdk11_linux_s390x_toolchain_config_repo", + "remotejdk11_macos_toolchain_config_repo": "remotejdk11_macos_toolchain_config_repo", + "remotejdk11_macos_aarch64_toolchain_config_repo": "remotejdk11_macos_aarch64_toolchain_config_repo", + "remotejdk11_win_toolchain_config_repo": "remotejdk11_win_toolchain_config_repo", + "remotejdk11_win_arm64_toolchain_config_repo": "remotejdk11_win_arm64_toolchain_config_repo", + "remotejdk17_linux_toolchain_config_repo": "remotejdk17_linux_toolchain_config_repo", + "remotejdk17_linux_aarch64_toolchain_config_repo": "remotejdk17_linux_aarch64_toolchain_config_repo", + "remotejdk17_linux_ppc64le_toolchain_config_repo": "remotejdk17_linux_ppc64le_toolchain_config_repo", + "remotejdk17_linux_s390x_toolchain_config_repo": "remotejdk17_linux_s390x_toolchain_config_repo", + "remotejdk17_macos_toolchain_config_repo": "remotejdk17_macos_toolchain_config_repo", + "remotejdk17_macos_aarch64_toolchain_config_repo": "remotejdk17_macos_aarch64_toolchain_config_repo", + "remotejdk17_win_toolchain_config_repo": "remotejdk17_win_toolchain_config_repo", + "remotejdk17_win_arm64_toolchain_config_repo": "remotejdk17_win_arm64_toolchain_config_repo", + "remotejdk21_linux_toolchain_config_repo": "remotejdk21_linux_toolchain_config_repo", + "remotejdk21_linux_aarch64_toolchain_config_repo": "remotejdk21_linux_aarch64_toolchain_config_repo", + "remotejdk21_macos_toolchain_config_repo": "remotejdk21_macos_toolchain_config_repo", + "remotejdk21_macos_aarch64_toolchain_config_repo": "remotejdk21_macos_aarch64_toolchain_config_repo", + "remotejdk21_win_toolchain_config_repo": "remotejdk21_win_toolchain_config_repo" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "platforms": "platforms@0.0.7", + "rules_cc": "rules_cc@0.0.9", + "bazel_skylib": "bazel_skylib@1.3.0", + "rules_proto": "rules_proto@5.3.0-21.7", + "rules_license": "rules_license@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/rules_java/releases/download/7.4.0/rules_java-7.4.0.tar.gz" + ], + "integrity": "sha256-l27wi0nJKXQfIBeQ5Z44B8cq2B9CjIvJU82+/1/tFes=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "rules_license@0.0.7": { + "name": "rules_license", + "version": "0.0.7", + "key": "rules_license@0.0.7", + "repoName": "rules_license", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz" + ], + "integrity": "sha256-RTHezLkTY5ww5cdRKgVNXYdWmNrrddjPkPKEN1/nw2A=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "rules_proto@5.3.0-21.7": { + "name": "rules_proto", + "version": "5.3.0-21.7", + "key": "rules_proto@5.3.0-21.7", + "repoName": "rules_proto", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_skylib": "bazel_skylib@1.3.0", + "com_google_protobuf": "protobuf@21.7", + "rules_cc": "rules_cc@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz" + ], + "integrity": "sha256-3D+yBqLLNEG0heseQjFlsjEjWh6psDG0Qzz3vB+kYN0=", + "strip_prefix": "rules_proto-5.3.0-21.7", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "rules_python@0.22.1": { + "name": "rules_python", + "version": "0.22.1", + "key": "rules_python@0.22.1", + "repoName": "rules_python", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@bazel_tools//tools/python:autodetecting_toolchain" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@rules_python//python/extensions/private:internal_deps.bzl", + "extensionName": "internal_deps", + "usingModule": "rules_python@0.22.1", + "location": { + "file": "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel", + "line": 14, + "column": 30 + }, + "imports": { + "pypi__build": "pypi__build", + "pypi__click": "pypi__click", + "pypi__colorama": "pypi__colorama", + "pypi__importlib_metadata": "pypi__importlib_metadata", + "pypi__installer": "pypi__installer", + "pypi__more_itertools": "pypi__more_itertools", + "pypi__packaging": "pypi__packaging", + "pypi__pep517": "pypi__pep517", + "pypi__pip": "pypi__pip", + "pypi__pip_tools": "pypi__pip_tools", + "pypi__setuptools": "pypi__setuptools", + "pypi__tomli": "pypi__tomli", + "pypi__wheel": "pypi__wheel", + "pypi__zipp": "pypi__zipp", + "pypi__coverage_cp310_aarch64-apple-darwin": "pypi__coverage_cp310_aarch64-apple-darwin", + "pypi__coverage_cp310_aarch64-unknown-linux-gnu": "pypi__coverage_cp310_aarch64-unknown-linux-gnu", + "pypi__coverage_cp310_x86_64-apple-darwin": "pypi__coverage_cp310_x86_64-apple-darwin", + "pypi__coverage_cp310_x86_64-unknown-linux-gnu": "pypi__coverage_cp310_x86_64-unknown-linux-gnu", + "pypi__coverage_cp311_aarch64-unknown-linux-gnu": "pypi__coverage_cp311_aarch64-unknown-linux-gnu", + "pypi__coverage_cp311_x86_64-apple-darwin": "pypi__coverage_cp311_x86_64-apple-darwin", + "pypi__coverage_cp311_x86_64-unknown-linux-gnu": "pypi__coverage_cp311_x86_64-unknown-linux-gnu", + "pypi__coverage_cp38_aarch64-apple-darwin": "pypi__coverage_cp38_aarch64-apple-darwin", + "pypi__coverage_cp38_aarch64-unknown-linux-gnu": "pypi__coverage_cp38_aarch64-unknown-linux-gnu", + "pypi__coverage_cp38_x86_64-apple-darwin": "pypi__coverage_cp38_x86_64-apple-darwin", + "pypi__coverage_cp38_x86_64-unknown-linux-gnu": "pypi__coverage_cp38_x86_64-unknown-linux-gnu", + "pypi__coverage_cp39_aarch64-apple-darwin": "pypi__coverage_cp39_aarch64-apple-darwin", + "pypi__coverage_cp39_aarch64-unknown-linux-gnu": "pypi__coverage_cp39_aarch64-unknown-linux-gnu", + "pypi__coverage_cp39_x86_64-apple-darwin": "pypi__coverage_cp39_x86_64-apple-darwin", + "pypi__coverage_cp39_x86_64-unknown-linux-gnu": "pypi__coverage_cp39_x86_64-unknown-linux-gnu" + }, + "devImports": [], + "tags": [ + { + "tagName": "install", + "attributeValues": {}, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel", + "line": 15, + "column": 22 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@rules_python//python/extensions:python.bzl", + "extensionName": "python", + "usingModule": "rules_python@0.22.1", + "location": { + "file": "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel", + "line": 50, + "column": 23 + }, + "imports": { + "pythons_hub": "pythons_hub" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "platforms": "platforms@0.0.7", + "bazel_skylib": "bazel_skylib@1.3.0", + "rules_proto": "rules_proto@5.3.0-21.7", + "com_google_protobuf": "protobuf@21.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/rules_python/releases/download/0.22.1/rules_python-0.22.1.tar.gz" + ], + "integrity": "sha256-pWQP3dS+sD6MH95e1xYMC6a9R359BIZhwwwGk2om/WM=", + "strip_prefix": "rules_python-0.22.1", + "remote_patches": { + "https://bcr.bazel.build/modules/rules_python/0.22.1/patches/module_dot_bazel_version.patch": "sha256-3+VLDH9gYDzNI4eOW7mABC/LKxh1xqF6NhacLbNTucs=" + }, + "remote_patch_strip": 1 + } + } + }, + "buildozer@6.4.0.2": { + "name": "buildozer", + "version": "6.4.0.2", + "key": "buildozer@6.4.0.2", + "repoName": "buildozer", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [ + { + "extensionBzlFile": "@buildozer//:buildozer_binary.bzl", + "extensionName": "buildozer_binary", + "usingModule": "buildozer@6.4.0.2", + "location": { + "file": "https://bcr.bazel.build/modules/buildozer/6.4.0.2/MODULE.bazel", + "line": 7, + "column": 33 + }, + "imports": { + "buildozer_binary": "buildozer_binary" + }, + "devImports": [], + "tags": [ + { + "tagName": "buildozer", + "attributeValues": { + "sha256": { + "darwin-amd64": "d29e347ecd6b5673d72cb1a8de05bf1b06178dd229ff5eb67fad5100c840cc8e", + "darwin-arm64": "9b9e71bdbec5e7223871e913b65d12f6d8fa026684daf991f00e52ed36a6978d", + "linux-amd64": "8dfd6345da4e9042daa738d7fdf34f699c5dfce4632f7207956fceedd8494119", + "linux-arm64": "6559558fded658c8fa7432a9d011f7c4dcbac6b738feae73d2d5c352e5f605fa", + "windows-amd64": "e7f05bf847f7c3689dd28926460ce6e1097ae97380ac8e6ae7147b7b706ba19b" + }, + "version": "6.4.0" + }, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/buildozer/6.4.0.2/MODULE.bazel", + "line": 8, + "column": 27 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/fmeum/buildozer/releases/download/v6.4.0.2/buildozer-v6.4.0.2.tar.gz" + ], + "integrity": "sha256-k7tFKQMR2AygxpmZfH0yEPnQmF3efFgD9rBPkj+Yz/8=", + "strip_prefix": "buildozer-6.4.0.2", + "remote_patches": { + "https://bcr.bazel.build/modules/buildozer/6.4.0.2/patches/module_dot_bazel_version.patch": "sha256-gKANF2HMilj7bWmuXs4lbBIAAansuWC4IhWGB/CerjU=" + }, + "remote_patch_strip": 1 + } + } + }, + "platforms@0.0.7": { + "name": "platforms", + "version": "0.0.7", + "key": "platforms@0.0.7", + "repoName": "platforms", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "rules_license": "rules_license@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz" + ], + "integrity": "sha256-OlYcmee9vpFzqmU/1Xn+hJ8djWc5V4CrR3Cx84FDHVE=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "protobuf@21.7": { + "name": "protobuf", + "version": "21.7", + "key": "protobuf@21.7", + "repoName": "protobuf", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [ + { + "extensionBzlFile": "@rules_jvm_external//:extensions.bzl", + "extensionName": "maven", + "usingModule": "protobuf@21.7", + "location": { + "file": "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel", + "line": 22, + "column": 22 + }, + "imports": { + "maven": "maven" + }, + "devImports": [], + "tags": [ + { + "tagName": "install", + "attributeValues": { + "name": "maven", + "artifacts": [ + "com.google.code.findbugs:jsr305:3.0.2", + "com.google.code.gson:gson:2.8.9", + "com.google.errorprone:error_prone_annotations:2.3.2", + "com.google.j2objc:j2objc-annotations:1.3", + "com.google.guava:guava:31.1-jre", + "com.google.guava:guava-testlib:31.1-jre", + "com.google.truth:truth:1.1.2", + "junit:junit:4.13.2", + "org.mockito:mockito-core:4.3.1" + ] + }, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel", + "line": 24, + "column": 14 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_skylib": "bazel_skylib@1.3.0", + "rules_python": "rules_python@0.22.1", + "rules_cc": "rules_cc@0.0.9", + "rules_proto": "rules_proto@5.3.0-21.7", + "rules_java": "rules_java@7.4.0", + "rules_pkg": "rules_pkg@0.7.0", + "com_google_abseil": "abseil-cpp@20211102.0", + "zlib": "zlib@1.3", + "upb": "upb@0.0.0-20220923-a547704", + "rules_jvm_external": "rules_jvm_external@4.4.2", + "com_google_googletest": "googletest@1.11.0", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/protocolbuffers/protobuf/releases/download/v21.7/protobuf-all-21.7.zip" + ], + "integrity": "sha256-VJOiH17T/FAuZv7GuUScBqVRztYwAvpIkDxA36jeeko=", + "strip_prefix": "protobuf-21.7", + "remote_patches": { + "https://bcr.bazel.build/modules/protobuf/21.7/patches/add_module_dot_bazel.patch": "sha256-q3V2+eq0v2XF0z8z+V+QF4cynD6JvHI1y3kI/+rzl5s=", + "https://bcr.bazel.build/modules/protobuf/21.7/patches/add_module_dot_bazel_for_examples.patch": "sha256-O7YP6s3lo/1opUiO0jqXYORNHdZ/2q3hjz1QGy8QdIU=", + "https://bcr.bazel.build/modules/protobuf/21.7/patches/relative_repo_names.patch": "sha256-RK9RjW8T5UJNG7flIrnFiNE9vKwWB+8uWWtJqXYT0w4=", + "https://bcr.bazel.build/modules/protobuf/21.7/patches/add_missing_files.patch": "sha256-Hyne4DG2u5bXcWHNxNMirA2QFAe/2Cl8oMm1XJdkQIY=" + }, + "remote_patch_strip": 1 + } + } + }, + "zlib@1.3": { + "name": "zlib", + "version": "1.3", + "key": "zlib@1.3", + "repoName": "zlib", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.7", + "rules_cc": "rules_cc@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/madler/zlib/releases/download/v1.3/zlib-1.3.tar.gz" + ], + "integrity": "sha256-/wukwpIBPbwnUws6geH5qBPNOd4Byl4Pi/NVcC76WT4=", + "strip_prefix": "zlib-1.3", + "remote_patches": { + "https://bcr.bazel.build/modules/zlib/1.3/patches/add_build_file.patch": "sha256-Ei+FYaaOo7A3jTKunMEodTI0Uw5NXQyZEcboMC8JskY=", + "https://bcr.bazel.build/modules/zlib/1.3/patches/module_dot_bazel.patch": "sha256-fPWLM+2xaF/kuy+kZc1YTfW6hNjrkG400Ho7gckuyJk=" + }, + "remote_patch_strip": 0 + } + } + }, + "apple_support@1.5.0": { + "name": "apple_support", + "version": "1.5.0", + "key": "apple_support@1.5.0", + "repoName": "build_bazel_apple_support", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@local_config_apple_cc_toolchains//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@build_bazel_apple_support//crosstool:setup.bzl", + "extensionName": "apple_cc_configure_extension", + "usingModule": "apple_support@1.5.0", + "location": { + "file": "https://bcr.bazel.build/modules/apple_support/1.5.0/MODULE.bazel", + "line": 17, + "column": 35 + }, + "imports": { + "local_config_apple_cc": "local_config_apple_cc", + "local_config_apple_cc_toolchains": "local_config_apple_cc_toolchains" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_skylib": "bazel_skylib@1.3.0", + "platforms": "platforms@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/apple_support/releases/download/1.5.0/apple_support.1.5.0.tar.gz" + ], + "integrity": "sha256-miM41vja0yRPgj8txghKA+TQ+7J8qJLclw5okNW0gYQ=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "bazel_skylib@1.3.0": { + "name": "bazel_skylib", + "version": "1.3.0", + "key": "bazel_skylib@1.3.0", + "repoName": "bazel_skylib", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "//toolchains/unittest:cmd_toolchain", + "//toolchains/unittest:bash_toolchain" + ], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz" + ], + "integrity": "sha256-dNVE2W9KW7Yw1GXKi7z+Ix41lOWq5X4e2/F6brPKJQY=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "rules_pkg@0.7.0": { + "name": "rules_pkg", + "version": "0.7.0", + "key": "rules_pkg@0.7.0", + "repoName": "rules_pkg", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "rules_python": "rules_python@0.22.1", + "bazel_skylib": "bazel_skylib@1.3.0", + "rules_license": "rules_license@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz" + ], + "integrity": "sha256-iimOgydi7aGDBZfWT+fbWBeKqEzVkm121bdE1lWJQcI=", + "strip_prefix": "", + "remote_patches": { + "https://bcr.bazel.build/modules/rules_pkg/0.7.0/patches/module_dot_bazel.patch": "sha256-4OaEPZwYF6iC71ZTDg6MJ7LLqX7ZA0/kK4mT+4xKqiE=" + }, + "remote_patch_strip": 0 + } + } + }, + "abseil-cpp@20211102.0": { + "name": "abseil-cpp", + "version": "20211102.0", + "key": "abseil-cpp@20211102.0", + "repoName": "abseil-cpp", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "rules_cc": "rules_cc@0.0.9", + "platforms": "platforms@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/abseil/abseil-cpp/archive/refs/tags/20211102.0.tar.gz" + ], + "integrity": "sha256-3PcbnLqNwMqZQMSzFqDHlr6Pq0KwcLtrfKtitI8OZsQ=", + "strip_prefix": "abseil-cpp-20211102.0", + "remote_patches": { + "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/patches/module_dot_bazel.patch": "sha256-4izqopgGCey4jVZzl/w3M2GVPNohjh2B5TmbThZNvPY=" + }, + "remote_patch_strip": 0 + } + } + }, + "upb@0.0.0-20220923-a547704": { + "name": "upb", + "version": "0.0.0-20220923-a547704", + "key": "upb@0.0.0-20220923-a547704", + "repoName": "upb", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_skylib": "bazel_skylib@1.3.0", + "rules_proto": "rules_proto@5.3.0-21.7", + "com_google_protobuf": "protobuf@21.7", + "com_google_absl": "abseil-cpp@20211102.0", + "platforms": "platforms@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/protocolbuffers/upb/archive/a5477045acaa34586420942098f5fecd3570f577.tar.gz" + ], + "integrity": "sha256-z39x6v+QskwaKLSWRan/A6mmwecTQpHOcJActj5zZLU=", + "strip_prefix": "upb-a5477045acaa34586420942098f5fecd3570f577", + "remote_patches": { + "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/patches/module_dot_bazel.patch": "sha256-wH4mNS6ZYy+8uC0HoAft/c7SDsq2Kxf+J8dUakXhaB0=" + }, + "remote_patch_strip": 0 + } + } + }, + "rules_jvm_external@4.4.2": { + "name": "rules_jvm_external", + "version": "4.4.2", + "key": "rules_jvm_external@4.4.2", + "repoName": "rules_jvm_external", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [ + { + "extensionBzlFile": "@rules_jvm_external//:non-module-deps.bzl", + "extensionName": "non_module_deps", + "usingModule": "rules_jvm_external@4.4.2", + "location": { + "file": "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel", + "line": 9, + "column": 32 + }, + "imports": { + "io_bazel_rules_kotlin": "io_bazel_rules_kotlin" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@rules_jvm_external//:extensions.bzl", + "extensionName": "maven", + "usingModule": "rules_jvm_external@4.4.2", + "location": { + "file": "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel", + "line": 16, + "column": 22 + }, + "imports": { + "rules_jvm_external_deps": "rules_jvm_external_deps" + }, + "devImports": [], + "tags": [ + { + "tagName": "install", + "attributeValues": { + "name": "rules_jvm_external_deps", + "artifacts": [ + "com.google.cloud:google-cloud-core:1.93.10", + "com.google.cloud:google-cloud-storage:1.113.4", + "com.google.code.gson:gson:2.9.0", + "org.apache.maven:maven-artifact:3.8.6", + "software.amazon.awssdk:s3:2.17.183" + ], + "lock_file": "@rules_jvm_external//:rules_jvm_external_deps_install.json" + }, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel", + "line": 18, + "column": 14 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_skylib": "bazel_skylib@1.3.0", + "io_bazel_stardoc": "stardoc@0.5.1", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/rules_jvm_external/archive/refs/tags/4.4.2.zip" + ], + "integrity": "sha256-c1YC9QgT6y6pPKP15DsZWb2AshO4NqB6YqKddXZwt3s=", + "strip_prefix": "rules_jvm_external-4.4.2", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "googletest@1.11.0": { + "name": "googletest", + "version": "1.11.0", + "key": "googletest@1.11.0", + "repoName": "googletest", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "com_google_absl": "abseil-cpp@20211102.0", + "platforms": "platforms@0.0.7", + "rules_cc": "rules_cc@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/google/googletest/archive/refs/tags/release-1.11.0.tar.gz" + ], + "integrity": "sha256-tIcL8SH/d5W6INILzdhie44Ijy0dqymaAxwQNO3ck9U=", + "strip_prefix": "googletest-release-1.11.0", + "remote_patches": { + "https://bcr.bazel.build/modules/googletest/1.11.0/patches/module_dot_bazel.patch": "sha256-HuahEdI/n8KCI071sN3CEziX+7qP/Ec77IWayYunLP0=" + }, + "remote_patch_strip": 0 + } + } + }, + "stardoc@0.5.1": { + "name": "stardoc", + "version": "0.5.1", + "key": "stardoc@0.5.1", + "repoName": "stardoc", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_skylib": "bazel_skylib@1.3.0", + "rules_java": "rules_java@7.4.0", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/stardoc/releases/download/0.5.1/stardoc-0.5.1.tar.gz" + ], + "integrity": "sha256-qoFNrgrEALurLoiB+ZFcb0fElmS/CHxAmhX5BDjSwj4=", + "strip_prefix": "", + "remote_patches": { + "https://bcr.bazel.build/modules/stardoc/0.5.1/patches/module_dot_bazel.patch": "sha256-UAULCuTpJE7SG0YrR9XLjMfxMRmbP+za3uW9ONZ5rjI=" + }, + "remote_patch_strip": 0 + } + } + } + }, + "moduleExtensions": { + "@@apple_support~//crosstool:setup.bzl%apple_cc_configure_extension": { + "general": { + "bzlTransitiveDigest": "pMLFCYaRPkgXPQ8vtuNkMfiHfPmRBy6QJfnid4sWfv0=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_apple_cc": { + "bzlFile": "@@apple_support~//crosstool:setup.bzl", + "ruleClassName": "_apple_cc_autoconf", + "attributes": {} + }, + "local_config_apple_cc_toolchains": { + "bzlFile": "@@apple_support~//crosstool:setup.bzl", + "ruleClassName": "_apple_cc_autoconf_toolchains", + "attributes": {} + } + }, + "recordedRepoMappingEntries": [ + [ + "apple_support~", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@bazel_tools//tools/cpp:cc_configure.bzl%cc_configure_extension": { + "general": { + "bzlTransitiveDigest": "PHpT2yqMGms2U4L3E/aZ+WcQalmZWm+ILdP3yiLsDhA=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_cc": { + "bzlFile": "@@bazel_tools//tools/cpp:cc_configure.bzl", + "ruleClassName": "cc_autoconf", + "attributes": {} + }, + "local_config_cc_toolchains": { + "bzlFile": "@@bazel_tools//tools/cpp:cc_configure.bzl", + "ruleClassName": "cc_autoconf_toolchains", + "attributes": {} + } + }, + "recordedRepoMappingEntries": [ + [ + "bazel_tools", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@bazel_tools//tools/osx:xcode_configure.bzl%xcode_configure_extension": { + "general": { + "bzlTransitiveDigest": "Qh2bWTU6QW6wkrd87qrU4YeY+SG37Nvw3A0PR4Y0L2Y=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_xcode": { + "bzlFile": "@@bazel_tools//tools/osx:xcode_configure.bzl", + "ruleClassName": "xcode_autoconf", + "attributes": { + "xcode_locator": "@bazel_tools//tools/osx:xcode_locator.m", + "remote_xcode": "" + } + } + }, + "recordedRepoMappingEntries": [] + } + }, + "@@bazel_tools//tools/sh:sh_configure.bzl%sh_configure_extension": { + "general": { + "bzlTransitiveDigest": "hp4NgmNjEg5+xgvzfh6L83bt9/aiiWETuNpwNuF1MSU=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_sh": { + "bzlFile": "@@bazel_tools//tools/sh:sh_configure.bzl", + "ruleClassName": "sh_config", + "attributes": {} + } + }, + "recordedRepoMappingEntries": [] + } + }, + "@@rules_java~//java:extensions.bzl%toolchains": { + "general": { + "bzlTransitiveDigest": "0N5b5J9fUzo0sgvH4F3kIEaeXunz4Wy2/UtSFV/eXUY=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "remotejdk21_linux_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux//:jdk\",\n)\n" + } + }, + "remotejdk17_linux_s390x_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_s390x//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_s390x//:jdk\",\n)\n" + } + }, + "remotejdk17_macos_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos//:jdk\",\n)\n" + } + }, + "remotejdk21_macos_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk17_linux_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk21_macos_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "e8260516de8b60661422a725f1df2c36ef888f6fb35393566b00e7325db3d04e", + "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-macosx_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-macosx_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-macosx_aarch64.tar.gz" + ] + } + }, + "remotejdk17_linux_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux//:jdk\",\n)\n" + } + }, + "remotejdk17_macos_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "314b04568ec0ae9b36ba03c9cbd42adc9e1265f74678923b19297d66eb84dcca", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64.tar.gz" + ] + } + }, + "remote_java_tools_windows": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "fe2f88169696d6c6fc6e90ba61bb46be7d0ae3693cbafdf336041bf56679e8d1", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools_windows-v13.4.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools_windows-v13.4.zip" + ] + } + }, + "remotejdk11_win": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "43408193ce2fa0862819495b5ae8541085b95660153f2adcf91a52d3a1710e83", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-win_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-win_x64.zip", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-win_x64.zip" + ] + } + }, + "remotejdk11_win_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "54174439f2b3fddd11f1048c397fe7bb45d4c9d66d452d6889b013d04d21c4de", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-linux_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_aarch64.tar.gz" + ] + } + }, + "remotejdk17_linux": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "b9482f2304a1a68a614dfacddcf29569a72f0fac32e6c74f83dc1b9a157b8340", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-linux_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_x64.tar.gz" + ] + } + }, + "remotejdk11_linux_s390x_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_s390x//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_s390x//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux//:jdk\",\n)\n" + } + }, + "remotejdk11_macos": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "bcaab11cfe586fae7583c6d9d311c64384354fb2638eb9a012eca4c3f1a1d9fd", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-macosx_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_x64.tar.gz" + ] + } + }, + "remotejdk11_win_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "b8a28e6e767d90acf793ea6f5bed0bb595ba0ba5ebdf8b99f395266161e53ec2", + "strip_prefix": "jdk-11.0.13+8", + "urls": [ + "https://mirror.bazel.build/aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-windows-aarch64.zip" + ] + } + }, + "remotejdk17_macos": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "640453e8afe8ffe0fb4dceb4535fb50db9c283c64665eebb0ba68b19e65f4b1f", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-macosx_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_x64.tar.gz" + ] + } + }, + "remotejdk21_macos": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "3ad8fe288eb57d975c2786ae453a036aa46e47ab2ac3d81538ebae2a54d3c025", + "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-macosx_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-macosx_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-macosx_x64.tar.gz" + ] + } + }, + "remotejdk21_macos_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos//:jdk\",\n)\n" + } + }, + "remotejdk17_macos_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk17_win": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "192f2afca57701de6ec496234f7e45d971bf623ff66b8ee4a5c81582054e5637", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-win_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_x64.zip", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_x64.zip" + ] + } + }, + "remotejdk11_macos_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_ppc64le_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_ppc64le//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_ppc64le//:jdk\",\n)\n" + } + }, + "remotejdk21_linux": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "5ad730fbee6bb49bfff10bf39e84392e728d89103d3474a7e5def0fd134b300a", + "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-linux_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_x64.tar.gz" + ] + } + }, + "remote_java_tools_linux": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "ba10f09a138cf185d04cbc807d67a3da42ab13d618c5d1ce20d776e199c33a39", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools_linux-v13.4.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools_linux-v13.4.zip" + ] + } + }, + "remotejdk21_win": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "f7cc15ca17295e69c907402dfe8db240db446e75d3b150da7bf67243cded93de", + "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-win_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-win_x64.zip", + "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-win_x64.zip" + ] + } + }, + "remotejdk21_linux_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "ce7df1af5d44a9f455617c4b8891443fbe3e4b269c777d8b82ed66f77167cfe0", + "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-linux_aarch64", + "urls": [ + "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_aarch64.tar.gz", + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_aarch64.tar.gz" + ] + } + }, + "remotejdk11_linux_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_s390x": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "a58fc0361966af0a5d5a31a2d8a208e3c9bb0f54f345596fd80b99ea9a39788b", + "strip_prefix": "jdk-11.0.15+10", + "urls": [ + "https://mirror.bazel.build/github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.15_10.tar.gz", + "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.15_10.tar.gz" + ] + } + }, + "remotejdk17_linux_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "6531cef61e416d5a7b691555c8cf2bdff689201b8a001ff45ab6740062b44313", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64.tar.gz" + ] + } + }, + "remotejdk17_win_arm64_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win_arm64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win_arm64//:jdk\",\n)\n" + } + }, + "remotejdk11_linux": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "a34b404f87a08a61148b38e1416d837189e1df7a040d949e743633daf4695a3c", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-linux_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_x64.tar.gz" + ] + } + }, + "remotejdk11_macos_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos//:jdk\",\n)\n" + } + }, + "remotejdk17_linux_ppc64le_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_ppc64le//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_ppc64le//:jdk\",\n)\n" + } + }, + "remotejdk17_win_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "6802c99eae0d788e21f52d03cab2e2b3bf42bc334ca03cbf19f71eb70ee19f85", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-win_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_aarch64.zip", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_aarch64.zip" + ] + } + }, + "remote_java_tools_darwin_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "076a7e198ad077f8c7d997986ef5102427fae6bbfce7a7852d2e080ed8767528", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools_darwin_arm64-v13.4.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools_darwin_arm64-v13.4.zip" + ] + } + }, + "remotejdk17_linux_ppc64le": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "00a4c07603d0218cd678461b5b3b7e25b3253102da4022d31fc35907f21a2efd", + "strip_prefix": "jdk-17.0.8.1+1", + "urls": [ + "https://mirror.bazel.build/github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_ppc64le_linux_hotspot_17.0.8.1_1.tar.gz", + "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_ppc64le_linux_hotspot_17.0.8.1_1.tar.gz" + ] + } + }, + "remotejdk21_linux_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk11_win_arm64_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win_arm64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win_arm64//:jdk\",\n)\n" + } + }, + "local_jdk": { + "bzlFile": "@@rules_java~//toolchains:local_java_repository.bzl", + "ruleClassName": "_local_java_repository_rule", + "attributes": { + "java_home": "", + "version": "", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = {RUNTIME_VERSION},\n)\n" + } + }, + "remote_java_tools_darwin_x86_64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "4523aec4d09c587091a2dae6f5c9bc6922c220f3b6030e5aba9c8f015913cc65", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools_darwin_x86_64-v13.4.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools_darwin_x86_64-v13.4.zip" + ] + } + }, + "remote_java_tools": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "e025fd260ac39b47c111f5212d64ec0d00d85dec16e49368aae82fc626a940cf", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools-v13.4.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools-v13.4.zip" + ] + } + }, + "remotejdk17_linux_s390x": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "ffacba69c6843d7ca70d572489d6cc7ab7ae52c60f0852cedf4cf0d248b6fc37", + "strip_prefix": "jdk-17.0.8.1+1", + "urls": [ + "https://mirror.bazel.build/github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_s390x_linux_hotspot_17.0.8.1_1.tar.gz", + "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_s390x_linux_hotspot_17.0.8.1_1.tar.gz" + ] + } + }, + "remotejdk17_win_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_ppc64le": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "a8fba686f6eb8ae1d1a9566821dbd5a85a1108b96ad857fdbac5c1e4649fc56f", + "strip_prefix": "jdk-11.0.15+10", + "urls": [ + "https://mirror.bazel.build/github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.15_10.tar.gz", + "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.15_10.tar.gz" + ] + } + }, + "remotejdk11_macos_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "7632bc29f8a4b7d492b93f3bc75a7b61630894db85d136456035ab2a24d38885", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-macosx_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_aarch64.tar.gz" + ] + } + }, + "remotejdk21_win_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_win//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_win//:jdk\",\n)\n" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_java~", + "bazel_tools", + "bazel_tools" + ], + [ + "rules_java~", + "remote_java_tools", + "rules_java~~toolchains~remote_java_tools" + ] + ] + } + } + } +} diff --git a/hhds/BUILD b/hhds/BUILD index 442e945..4063a5f 100644 --- a/hhds/BUILD +++ b/hhds/BUILD @@ -17,12 +17,12 @@ cc_library( ) cc_library( - name = "hhds", + name = "core", srcs = glob( - ["*.cpp"], + ["tree.cpp"], exclude = ["*test*.cpp"], ), - hdrs = glob(["*.hpp"]), + hdrs = glob(["tree.hpp", "lhtree.hpp"],), copts = COPTS, defines = select({ ":use_profiling": [ @@ -44,42 +44,51 @@ cc_library( }), ) -cc_test( - name = "graph_bench", - srcs = [ - "tests/graph_bench.cpp", - ], - deps = [ - ":hhds", - "@com_google_benchmark//:benchmark", - "@com_google_absl//absl/container:flat_hash_map", - "@com_google_absl//absl/container:flat_hash_set", - ], -) +# cc_test( +# name = "graph_bench", +# srcs = [ +# "tests/graph_bench.cpp", +# ], +# deps = [ +# ":hhds", +# "@com_google_benchmark//:benchmark", +# "@com_google_absl//absl/container:flat_hash_map", +# "@com_google_absl//absl/container:flat_hash_set", +# ], +# ) -cc_test( - name = "graph_test", - srcs = ["tests/graph_test.cpp"], - deps = [ - ":hhds", - "@boost//:graph", - "@com_google_googletest//:gtest_main", - ], -) +# cc_test( +# name = "graph_test", +# srcs = ["tests/graph_test.cpp"], +# deps = [ +# ":hhds", +# "@boost//:graph", +# "@com_google_googletest//:gtest_main", +# ], +# ) + +# cc_test( +# name = "small_set_bench", +# srcs = [ +# "tests/small_set_bench.cpp", +# ], +# deps = [ +# ":rigtorp", +# "@fmt", +# "@iassert", +# "@emhash", +# "@com_google_benchmark//:benchmark", +# "@com_google_absl//absl/container:flat_hash_map", +# "@com_google_absl//absl/container:flat_hash_set", +# ], +# ) cc_test( - name = "small_set_bench", - srcs = [ - "tests/small_set_bench.cpp", - ], + name = "tree_test", + srcs = ["tests/tree_test.cpp"], deps = [ - ":rigtorp", - "@fmt", - "@iassert", - "@emhash", "@com_google_benchmark//:benchmark", - "@com_google_absl//absl/container:flat_hash_map", - "@com_google_absl//absl/container:flat_hash_set", + "@com_google_googletest//:gtest_main", + ":core", ], ) - diff --git a/hhds/lhtree.hpp b/hhds/lhtree.hpp new file mode 100644 index 0000000..1fbbc0c --- /dev/null +++ b/hhds/lhtree.hpp @@ -0,0 +1,1338 @@ +// This file is distributed under the BSD 3-Clause License. See LICENSE for details. +#pragma once + +// TODO: Decide order and fields. Best order: +// 01: ?? | 1 +// 02: ?? -── 1.1 +// 03: ?? ├── 1.2 +// 04: ?? │ -── 1.2.1 +// 05: ?? │ -── 1.2.1.1 +// 06: ?? │ ├── 1.2.1.2 +// 07: ?? ├── 1.3 +// 08: ?? │ -── 1.3.1 +// 09: ?? │ ├── 1.3.2 +// 10: ?? │ ├── 1.3.3 +// 11: ?? │ -── 1.3.1.1 +// 12: ?? │ |── 1.3.1.2 +// 13: ?? │ |── 1.2.1.3 +// 14: ?? │ -── 1.2.1.3.1 +// 15: ?? │ -── 1.2.1.3.2 +// 16: ?? ├── 1.4 +// 17: ?? │ -── 1.4.1 +// 18: ?? │ ├── 1.4.2 +// 19: ?? │ │ -── 1.4.2.1 +// 20: ?? │ ├── 1.4.3 +// 21: ?? │ │ -── 1.4.3.1 +// +// Vector n-ary tree implementation: +// +// 2 arrays: main and overflow +// +// mmap: overflow (under 32K entries continuous) : main array +// +// main array: +// +// * A int16_t per entry (<0 points to overflow), >0 is the tree level (0 deleted/unused) +// * Nodes in array using post-order, Entry is the level +// +// Capacity to print a bit like "tree" (but in post-order) +// Index: NextSibling: Level : Tree +// 00: +7, 2 -── 1.1 +// 01: +1, 4 │ -── 1.2.1.1 +// 02: +3, 4 │ ├── 1.2.1.2 +// 03: +1, 5 │ | -── 1.2.1.3.1 +// 04: +0, 5 │ | |── 1.2.1.3.2 +// 05: +0, 4 │ |── 1.2.1.3 +// 06: +0, 3 │ -── 1.2.1 +// 07: +6, 2 ├── 1.2 +// 08: +1, 4 │ -── 1.3.1.1 +// 09: +1, 4 │ |── 1.3.1.2 +// 0a: +1, 3 │ -── 1.3.1 +// 0b: +1, 3 │ ├── 1.3.2 +// 0c: +0, 3 │ ├── 1.3.3 +// 0d: +6, 2 ├── 1.3 +// 0e: +3, 3 │ -── 1.4.1 +// 0f: +1, 4 │ │ -── 1.4.2.1 +// 10: +0, 4 │ │ |── 1.4.2.2 +// 11: +1, 3 │ ├── 1.4.2 +// 12: +0, 3 │ ├── 1.4.3 +// 13: +0, 2 ├── 1.4 +// 14: +0, 1 | 1 +// +// API: find_siblings +// while(l[pos]level[self]) +// true when level[pos] == level[self] || level[pos] == level[self-1] +// +// API is_last_child() +// true when level[pos+1] == level[self] + 1 +// +// ------------------------------------------------------ +// BEST Possible order for LNAST "typical" traversal is post-order (first-case) +// Get children & get parent calls +// +// Index: level (2bytes) +// +// 01: 01 | 1 +// 02: 02 -── 1.1 +// 03: 02 ├── 1.2 +// 04: 03 │ -── 1.2.1 +// 05: 04 │ -── 1.2.1.1 +// 06: 04 │ ├── 1.2.1.2 +// 07: 02 ├── 1.3 +// 08: 03 │ -── 1.3.1 +// 09: 03 │ ├── 1.3.2 +// 10: 03 │ ├── 1.3.3 +// 11: 04 │ -── 1.3.1.1 +// 12: 04 │ |── 1.3.1.2 +// 13: 04 │ |── 1.2.1.3 +// 14: 05 │ -── 1.2.1.3.1 +// 15: 05 │ -── 1.2.1.3.2 +// 16: 02 ├── 1.4 +// 17: 03 │ -── 1.4.1 +// 18: 03 │ ├── 1.4.2 +// 19: 04 │ │ -── 1.4.2.1 +// 20: 03 │ ├── 1.4.3 +// 21: 04 │ │ -── 1.4.3.1 +// +// API: find_next_siblings +// ++pos; +// while(level[pos]<=level[self]) { +// if(level[pos]==level[self]) { +// return pos +// } +// ++pos; +// } +// +// API: find_prev_siblings +// Same traverse --pos +// +// API: find_parent +// Build to ID when traversing, but could be recomputed +// go back until level+1 is found +// +// API: find_children +// Similar find_next_siblings but continue adding +// +// API is_first_child() +// return level[self-1] == level[self]-1 +// +// API is_last_child() +// return level[self+1] >= level[self]-1 +// +// API: find_last_child() +// check older sibling that has children (fc[pos+1] if exist) +// sibling_fc-1 should be the last child +// +// API: insert_child_next_to +// insert after, keep same parent +// +// API: insert_first_child +// insert before fc[pos], update fc[pos]-- +// +// API: insert_last_child +// find last_child, insert after +// +// API: add_child (first child or insert_last_child) + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "iassert.hpp" + +namespace lh { +using Tree_level = int32_t; +using Tree_pos = int32_t; + +class __attribute__((packed)) Tree_index { +public: + Tree_level level; + Tree_pos pos; + + constexpr Tree_index() : level(-1), pos(-1){}; + constexpr Tree_index(Tree_level l, Tree_pos i) : level(l), pos(i) {} + constexpr Tree_index(const Tree_index &ti) : level(ti.level), pos(ti.pos) {} + + static constexpr Tree_index root() { return Tree_index(0, 0); } + + constexpr Tree_index &operator=(const Tree_index &o) { + level = o.level; + pos = o.pos; + return *this; + } + + constexpr bool operator==(const Tree_index &i) const { return level == i.level && pos == i.pos; } + constexpr bool operator!=(const Tree_index &i) const { return level != i.level || pos != i.pos; } + + constexpr bool is_invalid() const { return level == -1 || pos == -1; } + void invalidate() { + level = -1; + pos = -1; + } + constexpr bool is_root() const { return level == 0; } + + template + friend H AbslHashValue(H h, const Tree_index &s) { + return H::combine(std::move(h), s.level, s.pos); + }; + + constexpr inline uint64_t get_hash() const { + uint64_t at = level; + at <<= 32; + at |= pos; + + return at; + } +}; + +template +class tree { +protected: + struct Tree_pointers { + Tree_pointers(Tree_pos p) : parent(p), next_sibling(1) { + for (int i = 0; i < 4; ++i) { + first_child[i] = -1; + last_child[i] = -1; + } + } + Tree_pointers() : parent(0), next_sibling(0) { + for (int i = 0; i < 4; ++i) { + first_child[i] = -1; + last_child[i] = -1; + } + } + + Tree_pos parent; // Parent can change when shifting at insert + Tree_pos next_sibling; // 0 -> 4 children, 1 -> 1 children, 2 -> 2 children, 3 -> 3 children + + Tree_pos first_child[4]; + Tree_pos last_child[4]; + }; + + const std::string mmap_name; + const std::string mmap_path; + std::vector> data_stack; + std::vector> pointers_stack; + int pending_parent; // Must be signed + int pending_child; + + void adjust_to_level(Tree_level level); + + Tree_pos create_space(const Tree_index &parent, const X &data) { + auto &dsp = data_stack[parent.level + 1]; + + dsp.emplace_back(data); + dsp.emplace_back(); + dsp.emplace_back(); + dsp.emplace_back(); + + I(static_cast(parent.pos >> 2) < pointers_stack[parent.level].size()); + pointers_stack[parent.level + 1].emplace_back(parent.pos); + + I(pointers_stack[parent.level + 1].back().next_sibling == 1); + + return dsp.size() - 4; + } + + void adjust_parent_pointer(const Tree_index &child, Tree_pos current_pos, Tree_pos new_pos) { + auto &l = pointers_stack[child.level]; + auto shift_pos = child.pos >> 2; + + while (true) { + I(l[shift_pos].parent == current_pos); + l[shift_pos].parent = new_pos; + shift_pos = l[shift_pos].next_sibling >> 2; + if (shift_pos == 0) { + return; + } + } + } + + void make_space_after(const Tree_index &sibling, bool after = true) { + I((sibling.pos & 3) != 3); // no space to make if it is the last already + + auto &ptrs = pointers_stack[sibling.level][sibling.pos >> 2]; + + auto first_child = get_first_child(get_parent(sibling)); + I((first_child.pos & 3) == 0); + I(first_child.level == sibling.level); + + auto last_pos = ptrs.next_sibling & 3; + if (last_pos == 0) { + last_pos = 3; + } + + I((sibling.pos & 3) <= last_pos); + + auto first_pos = sibling.pos & 3; + if (after) { + first_pos++; + } + + for (int i = last_pos; i > first_pos; --i) { + data_stack[sibling.level][((sibling.pos >> 2) << 2) + i] = data_stack[sibling.level][((sibling.pos >> 2) << 2) + i - 1]; + + ptrs.first_child[i] = ptrs.first_child[i - 1]; + ptrs.last_child[i] = ptrs.last_child[i - 1]; + if (i != first_pos && ptrs.first_child[i] != -1) { + I(ptrs.last_child[i] != -1); + auto base = ((sibling.pos >> 2) << 2) + i - 1; + adjust_parent_pointer(Tree_index(sibling.level + 1, ptrs.first_child[i]), base, base + 1); + } + } + + ptrs.first_child[first_pos] = -1; + ptrs.last_child[first_pos] = -1; + } + + Tree_pos increase_size(const Tree_index &sibling) { + auto *next_sibling = ref_next_sibling_pos(sibling); + if (*next_sibling == 3) { + (*next_sibling) = ((*next_sibling) >> 2) << 2; + return ((sibling.pos >> 2) << 2) | 3; + } + unsigned char pos = *next_sibling; + (*next_sibling)++; + + return ((sibling.pos >> 2) << 2) | (pos & 3); + } + + void make_space_after(const Tree_index &younger, const Tree_index &older) { + I(older.level == younger.level); + I((older.pos & 3) == 0); // Insert beginning + I(get_parent(younger) == get_parent(older)); + + make_space_after(older, false); + + data_stack[older.level][older.pos] = data_stack[younger.level][younger.pos | 3]; // oldest there + pointers_stack[older.level][older.pos >> 2].first_child[0] = pointers_stack[younger.level][younger.pos >> 2].first_child[3]; + pointers_stack[older.level][older.pos >> 2].last_child[0] = pointers_stack[younger.level][younger.pos >> 2].last_child[3]; + + auto fc = pointers_stack[older.level][older.pos >> 2].first_child[0]; + if (fc != -1) { + adjust_parent_pointer(Tree_index(older.level + 1, fc), younger.pos | 3, older.pos); + } + make_space_after(younger); + } + + Tree_pos get_last_child_pos(const Tree_index &index) const { + I(index.level < (int)pointers_stack.size()); + I((index.pos >> 2) < (int)pointers_stack[index.level].size()); + + return pointers_stack[index.level][index.pos >> 2].last_child[index.pos & 3]; + } + + Tree_pos *ref_last_child_pos(const Tree_index &index) { + I(index.level < (int)pointers_stack.size()); + I((index.pos >> 2) < (int)pointers_stack[index.level].size()); + + return &pointers_stack[index.level][index.pos >> 2].last_child[index.pos & 3]; + } + + Tree_pos get_first_child_pos(const Tree_index &index) const { + I(index.level < (int)pointers_stack.size()); + I((index.pos >> 2) < (int)pointers_stack[index.level].size()); + + return pointers_stack[index.level][index.pos >> 2].first_child[index.pos & 3]; + } + + Tree_pos *ref_first_child_pos(const Tree_index &index) { + I(index.level < (int)pointers_stack.size()); + I((index.pos >> 2) < (int)pointers_stack[index.level].size()); + + return &pointers_stack[index.level][index.pos >> 2].first_child[index.pos & 3]; + } + + bool is_valid(const Tree_index &index) const { + I(index.level < (int)pointers_stack.size()); + I((index.pos >> 2) < (int)pointers_stack[index.level].size()); + + auto pos = pointers_stack[index.level][index.pos >> 2].next_sibling; + if ((pos & 3) > (index.pos & 3) || (pos & 3) == 0) { + return true; // Either the index is smaller than end or all the entries are used (pos==0) + } + + return false; + } + + Tree_pos get_next_sibling_pos(const Tree_index &index) const { + I(index.level < (int)pointers_stack.size()); + I((index.pos >> 2) < (int)pointers_stack[index.level].size()); + + return pointers_stack[index.level][index.pos >> 2].next_sibling; + } + + Tree_pos *ref_next_sibling_pos(const Tree_index &index) { + I(index.level < (int)pointers_stack.size()); + I((index.pos >> 2) < (int)pointers_stack[index.level].size()); + + return &pointers_stack[index.level][index.pos >> 2].next_sibling; + } + + bool is_last_next_sibling_chunk(const Tree_index &sibling) const { + const auto next_sibling = get_next_sibling_pos(sibling); + + return (next_sibling >> 2) == 0; + } + + bool has_next_sibling_space(const Tree_index &sibling) const { + I(data_stack.size() > (size_t)sibling.level); + I(data_stack[sibling.level].size() > (size_t)sibling.pos); + I(pointers_stack[sibling.level].size() > (size_t)sibling.pos >> 2); + + const auto next_sibling = get_next_sibling_pos(sibling); + + return (next_sibling & 3) != 0; + } + +public: + Tree_index get_last_child(const Tree_index &parent_index) const { + Tree_index child_index(parent_index.level + 1, get_last_child_pos(parent_index)); + + // GI(!child_index.is_invalid(), get_sibling_next(child_index).is_invalid()); + // Commented out by Abdullah + + return child_index; + } + + size_t max_size() const { + size_t sz = 0; + for (const auto &ent : pointers_stack) { + sz += ent.size(); + } + + return sz * 4; // WARNING: 4x because pointers stack has 4x pointer + } + + bool is_last_child(const Tree_index &self_index) const { return get_sibling_next(self_index) == invalid_index(); } + + bool is_first_child(const Tree_index &self_index) const { return get_first_child(get_parent(self_index)) == self_index; } + + Tree_index get_first_child(const Tree_index &parent_index) const { + Tree_index child_index(parent_index.level + 1, get_first_child_pos(parent_index)); + + return child_index; + } + + Tree_index get_sibling_next(const Tree_index &sibling) const { + const auto next_bucket_pos = get_next_sibling_pos(sibling); + const auto next_offset = next_bucket_pos & 3; + const auto sibling_offset = sibling.pos & 3; + + if (next_offset == 0 && sibling_offset != 3) { + return Tree_index(sibling.level, sibling.pos + 1); + } + + if (next_offset != 0 && next_offset > (sibling_offset + 1)) { + return Tree_index(sibling.level, sibling.pos + 1); + } + + if ((next_bucket_pos >> 2) == 0) { + return invalid_index(); // No more siblings + } + + return Tree_index(sibling.level, (next_bucket_pos >> 2) << 2); + } + + Tree_index get_sibling_prev(const Tree_index &sibling) const { + int pos = sibling.pos - 1; + if (pos >= 0) { + return Tree_index(sibling.level, pos); + } + + auto index = get_first_child(get_parent(sibling)); + Tree_index prev; + while (true) { + if (index == sibling) { + return prev; // Returns invalid if first chipd ast for prev + } + + prev = index; + + index.pos = get_next_sibling_pos(index); + } + + I(false); // Previous traversal should always hit + + return invalid_index(); + } + + class Tree_depth_preorder_iterator { + public: + class CTree_depth_preorder_iterator { + public: + CTree_depth_preorder_iterator(const Tree_index &_ti, const tree *_t) : ti(_ti), t(_t) { start_ti = _ti; } + CTree_depth_preorder_iterator operator++() { + CTree_depth_preorder_iterator i(ti, t); + + ti = t->get_depth_preorder_next(ti); + if (ti.level == start_ti.level && ti.pos > start_ti.pos) { + ti = invalid_index(); + } + return i; + }; + bool operator!=(const CTree_depth_preorder_iterator &other) { + I(t == other.t); + return ti != other.ti; + } + const Tree_index &operator*() const { return ti; } + + private: + Tree_index ti; + Tree_index start_ti; + const tree *t; + }; + + private: + protected: + Tree_index ti; + const tree *t; + + public: + Tree_depth_preorder_iterator() = delete; + explicit Tree_depth_preorder_iterator(const Tree_index &_b, const tree *_t) : ti(_b), t(_t) {} + + CTree_depth_preorder_iterator begin() const { return CTree_depth_preorder_iterator(ti, t); } + CTree_depth_preorder_iterator end() const { + return CTree_depth_preorder_iterator(Tree_index(-1, -1), t); + } // 0 is end index for iterator + }; + + class Tree_depth_postorder_iterator { + public: + class CTree_depth_postorder_iterator { + public: + CTree_depth_postorder_iterator(const Tree_index &_ti, const tree *_t) : ti(_ti), t(_t) {} + CTree_depth_postorder_iterator operator++() { + CTree_depth_postorder_iterator i(ti, t); + + ti = t->get_depth_postorder_next(ti); + + return i; + }; + bool operator!=(const CTree_depth_postorder_iterator &other) { + I(t == other.t); + return ti != other.ti; + } + const Tree_index &operator*() const { return ti; } + + private: + Tree_index ti; + const tree *t; + }; + + private: + protected: + Tree_index ti; + const tree *t; + + public: + Tree_depth_postorder_iterator() = delete; + explicit Tree_depth_postorder_iterator(const Tree_index &_b, const tree *_t) : ti(_b), t(_t) {} + + CTree_depth_postorder_iterator begin() const { return CTree_depth_postorder_iterator(ti, t); } + CTree_depth_postorder_iterator end() const { + return CTree_depth_postorder_iterator(Tree_index(-1, -1), t); + } // 0 is end index for iterator + }; + + class Tree_sibling_iterator { + public: + class CTree_sibling_iterator { + public: + CTree_sibling_iterator(const Tree_index &_ti, const tree *_t) : ti(_ti), t(_t) {} + CTree_sibling_iterator operator++() { + CTree_sibling_iterator i(ti, t); + + ti = t->get_sibling_next(ti); + + return i; + }; + bool operator==(const CTree_sibling_iterator &other) const { return !(ti != other.ti); } + + bool operator!=(const CTree_sibling_iterator &other) const { + I(t == other.t); + return ti != other.ti; + } + const Tree_index &operator*() const { return ti; } + + private: + Tree_index ti; + const tree *t; + }; + + private: + protected: + Tree_index ti; + const tree *t; + + public: + Tree_sibling_iterator() = delete; + explicit Tree_sibling_iterator(const Tree_index &_b, const tree *_t) : ti(_b), t(_t) {} + + CTree_sibling_iterator begin() const { return CTree_sibling_iterator(ti, t); } + CTree_sibling_iterator end() const { return CTree_sibling_iterator(invalid_index(), t); } + }; + + tree(); + tree(std::string_view _path, std::string_view _map_name); + + [[nodiscard]] inline std::string_view get_name() const { return mmap_name; } + [[nodiscard]] inline std::string_view get_path() const { return mmap_path; } + + void clear() { + pending_parent = -1; // Nobody pending + pending_child = -1; // Nobody pending + + data_stack.clear(); + pointers_stack.clear(); + } + + [[nodiscard]] bool empty() const { return data_stack.empty(); } + + // WARNING: can not return Tree_index & because future additions can move the pointer (vector realloc) + Tree_index add_child(const Tree_index &parent, const X &data); + bool delete_leaf(const Tree_index &child); + bool delete_subtree(const Tree_index &child); + Tree_index append_sibling(const Tree_index &sibling, const X &data); + Tree_index insert_next_sibling(const Tree_index &sibling, const X &data); + size_t get_tree_width(const Tree_level &level) const { + if (level >= data_stack.size()) { + return 0; + } + + return data_stack[level].size(); + } + + void set_data(const Tree_index &index, const X &data) { + I((int)data_stack.size() > index.level); + I((int)data_stack[index.level].size() > index.pos); + + data_stack[index.level][index.pos] = data; + } + + X *ref_data(const Tree_index &leaf) { + I((int)data_stack.size() > leaf.level); + I((int)data_stack[leaf.level].size() > leaf.pos); + + return &data_stack[leaf.level][leaf.pos]; + } + const X &get_data(const Tree_index &leaf) const { + I(data_stack.size() > leaf.level); + // I(data_stack[leaf.level].size() > leaf.pos); + // Commented out by Abdullah + // When deleting nodes, it became possible to have a higher pos value than + // the number of nodes at that level + + return data_stack[leaf.level][leaf.pos]; + } + + Tree_index get_depth_preorder_next(const Tree_index &child) const; + Tree_index get_depth_postorder_next(const Tree_index &child) const; + + Tree_index get_parent(const Tree_index &index) const { + I(index.level < (int)pointers_stack.size()); + I((index.pos >> 2) < (int)pointers_stack[index.level].size()); + + auto pos = pointers_stack[index.level][index.pos >> 2].parent; + auto level = index.level - 1; + if (level < 0) { + level = 0; // TODO: cleaner to return invalid_index() + } + + GI(index.level == 0, level == 0 && pos == 0); // parent of root is root + + return Tree_index(level, pos); + } + + static constexpr Tree_index invalid_index() { return Tree_index(-1, -1); } + void set_root(const X &data); + + // NOTE: not a typical depth first traversal, goes to bottom without touching + // parents first. It is also not a bottom-up traversal because it touches all + // the tree level before going to next level + void each_bottom_up_fast(std::function fn) const; + + void each_top_down_fast(std::function fn) const; + + // void each_bottom_up(std::function fn) const; + // void each_depth_first(const Tree_index &start_index, std::function fn) const + Tree_index get_child(const Tree_index &start_index) const; + + // tree traversals: https://en.wikipedia.org/wiki/Tree_traversal + Tree_depth_preorder_iterator depth_preorder(const Tree_index &start_index) const { + return Tree_depth_preorder_iterator(start_index, this); + } + + Tree_depth_preorder_iterator depth_preorder() const { return Tree_depth_preorder_iterator(Tree_index::root(), this); } + Tree_depth_postorder_iterator depth_postorder() const { + auto last_child = Tree_index::root(); + while (!is_leaf(last_child)) { + last_child = get_first_child(last_child); + } + return Tree_depth_postorder_iterator(last_child, this); + } + + Tree_sibling_iterator siblings(const Tree_index &start_index) const { return Tree_sibling_iterator(start_index, this); } + Tree_sibling_iterator children(const Tree_index &start_index) const { + if (is_leaf(start_index)) { + return Tree_sibling_iterator(invalid_index(), this); + } + + return Tree_sibling_iterator(get_first_child(start_index), this); + } + + bool is_leaf(const Tree_index &index) const { return (get_first_child_pos(index)) == -1; } + + bool is_root(const Tree_index &index) const { return index.is_root(); } + + bool has_single_child(const Tree_index &index) const { + auto fc_pos = get_first_child_pos(index); + + if (fc_pos == -1) { + return false; + } + + auto lc_index = get_last_child(index); + + return fc_pos == lc_index.pos; + } + + bool is_child_of(const Tree_index &child, const Tree_index &potential_parent) const { + auto level_stop_at = potential_parent.level; + // auto level = child.level - 1; + auto child_parent_chain = get_parent(child); + + while (child_parent_chain.level > level_stop_at) { + child_parent_chain = get_parent(child_parent_chain); + } + + return potential_parent == child_parent_chain; + } + + /* LCOV_EXCL_START */ + void dump() const { + for (const auto &index : depth_preorder()) { + std::string indent(index.level, ' '); + printf("%s l:%d p:%d\n", indent.c_str(), index.level, index.pos); + } + } + + void dump_data() const { + for (const auto &index : depth_preorder()) { + std::string indent(index.level, ' '); + printf("%s l:%d p:%d\t", indent.c_str(), index.level, index.pos); + std::cout << get_data(index) << std::endl; + } + } + + void check() const { + for (const auto &index : depth_preorder()) { + std::string indent(index.level, ' '); + printf("%s l:%d p:%d\n", indent.c_str(), index.level, index.pos); + if (index.level == 0) { // skip root + continue; + } + auto parent = get_parent(index); + auto pos = index.pos; + while (true) { + I(pointers_stack[index.level][pos >> 2].parent == parent.pos); + + pos = pointers_stack[index.level][pos >> 2].next_sibling; + if ((pos >> 2) == 0) { + if (pos == 0) { + I(pointers_stack[parent.level][parent.pos >> 2].last_child[parent.pos & 3] == 3); + } else { + I(pointers_stack[parent.level][parent.pos >> 2].last_child[parent.pos & 3] == pos - 1); + } + return; + } + } + } + } + + void dump_postorder() const { + for (const auto &index : depth_postorder()) { + std::string indent(index.level, ' '); + printf("%s l:%d p:%d\n", indent.c_str(), index.level, index.pos); + } + } + + void check_postorder() const { + for (const auto &index : depth_postorder()) { + std::string indent(index.level, ' '); + printf("%s l:%d p:%d\n", indent.c_str(), index.level, index.pos); + if (index.level == 0) { // skip root + continue; + } + auto parent = get_parent(index); + auto pos = index.pos; + while (true) { + I(pointers_stack[index.level][pos >> 2].parent == parent.pos); + + pos = pointers_stack[index.level][pos >> 2].next_sibling; + if ((pos >> 2) == 0) { + if (pos == 0) { + I(pointers_stack[parent.level][parent.pos >> 2].last_child[parent.pos & 3] == 3); + } else { + I(pointers_stack[parent.level][parent.pos >> 2].last_child[parent.pos & 3] == pos - 1); + } + return; + } + } + } + } + /* LCOV_EXCL_STOP */ +}; + +//--------------------- Template Implementation ---- + +template +void tree::adjust_to_level(Tree_level level) { + if (data_stack.size() > static_cast(level)) { + return; + } + + while (data_stack.size() <= static_cast(level)) { + data_stack.emplace_back(); + pointers_stack.emplace_back(); + } +}; + +template +tree::tree(std::string_view _path, std::string_view _map_name) + : mmap_path(_path.empty() ? "." : _path), mmap_name{std::string(_path) + std::string("/") + std::string(_map_name)} { + if (mmap_path != ".") { + struct stat sb; + if (stat(mmap_path.c_str(), &sb) != 0 || !S_ISDIR(sb.st_mode)) { + int e = mkdir(mmap_path.c_str(), 0755); + I(e >= 0); + } + } + + pending_parent = -1; // Nobody pending + pending_child = -1; // Nobody pending +} + +template +tree::tree() { + pending_parent = -1; // Nobody pending + pending_child = -1; // Nobody pending +}; + +template +bool tree::delete_leaf(const Tree_index &child) { + if (!is_leaf(child)) { + // std::cout << get_data(child) << " is not a leaf" << std::endl; + return false; + } + + auto parent = get_parent(child); + auto *parent_fc_pos = ref_first_child_pos(parent); + auto *parent_lc_pos = ref_last_child_pos(parent); + auto prev_sibling = get_sibling_prev(child); + + // std::cout << "next sibling of old: " << get_sibling_next(child).pos << std::endl; + + if (has_single_child(parent)) { + // std::cout << get_data(child) << " has a single child parent" << std::endl; + *parent_fc_pos = -1; + *parent_lc_pos = -1; + } else { + // std::cout << get_data(child) << " does not have a single child parent" << std::endl; + if (*parent_fc_pos == child.pos) { + // std::cout << "fc" << std::endl; + *parent_fc_pos = get_sibling_next(child).pos; + } + + if (*parent_lc_pos == child.pos) { + // std::cout << "lc" << std::endl; + // std::cout << "child pos: " << child.pos << std::endl; + // std::cout << "parent_lc_pos pointer: " << *parent_lc_pos << std::endl; + auto prev_sibling_pos = prev_sibling.pos; + + for (const auto &index : siblings(get_first_child(parent))) { + if (index.pos == prev_sibling_pos) { + *parent_lc_pos = index.pos; + break; + } + } + // std::cout << "parent_lc_pos pointer: " << *parent_lc_pos << std::endl; + } + } + + // std::cout << "DELETED: level " << child.level << ", pos " << child.pos << "\n----------" << std::endl; + + // std::cout << "DATA STACK: " << data_stack[child.level][child.pos] << std::endl; + // std::cout << "PTR STACK.parent: " << pointers_stack[child.level][child.pos >> 2].parent << std::endl; + // std::cout << "PTR STACK.next_sibling: " << pointers_stack[child.level][child.pos >> 2].next_sibling << std::endl; + + // data_stack[child.level][child.pos] = ""; + // data_stack[child.level].erase(data_stack[child.level].begin() + child.pos); + + pointers_stack[child.level][child.pos >> 2].first_child[child.pos & 3] = -1; + pointers_stack[child.level][child.pos >> 2].last_child[child.pos & 3] = -1; + // pointers_stack[child.level].erase(pointers_stack[child.level].begin() + (child.pos >> 2)); + + return true; +} + +template +bool tree::delete_subtree(const Tree_index &child) { + auto parent = get_parent(child); + auto *parent_lc_pos = ref_last_child_pos(parent); + + if (child.is_root()) { + // std::cout << "DELETED: subtree at level " << child.level << ", pos " << child.pos << std::endl; + clear(); + return true; + } + + Tree_index x = child; + bool done = false; + while (!done) { + if (is_leaf(child)) { + break; + } + + done = true; + auto fc = get_first_child(x).pos; + + while (fc != -1) { + x = get_first_child(x); + fc = get_first_child(x).pos; + } + + // std::cout << "Found next target: level " << x.level << ", pos " << x.pos << std::endl; + x = get_parent(x); + // std::cout << "Returned to parent: level " << x.level << ", pos " << x.pos << std::endl; + + done = !(delete_leaf(get_first_child(x))); + } + + delete_leaf(child); + + // std::cout << "DELETED: subtree at level " << child.level << ", pos " << child.pos << std::endl; + return true; +} + +template +Tree_index tree::add_child(const Tree_index &parent, const X &data) { + I((int)data_stack.size() > parent.level); + I((int)data_stack[parent.level].size() > parent.pos); + + const auto child_level = parent.level + 1; + + adjust_to_level(child_level); + + auto *parent_lc_pos = ref_last_child_pos(parent); + if (*parent_lc_pos != -1) { + Tree_index sibling(child_level, *parent_lc_pos); + return append_sibling(sibling, data); + } + + auto child_pos = create_space(parent, data); + auto *parent_fc_pos = ref_first_child_pos(parent); + *parent_fc_pos = child_pos; + *parent_lc_pos = child_pos; + + I(pending_parent != child_level); + I(pending_child != child_level); + + Tree_index child(child_level, child_pos); + I(get_next_sibling_pos(child) == 1); + + I(get_last_child(parent) == child); + I(is_leaf(child)); + I(has_single_child(parent)); + I(get_parent(child) == parent); + + return child; +}; + +template +Tree_index tree::append_sibling(const Tree_index &sibling, const X &data) { + I(sibling.level > 0); // No siblings to root + + auto parent = get_parent(sibling); + auto *parent_lc_pos = ref_last_child_pos(parent); + + Tree_index child(sibling.level, -1); + + if (has_next_sibling_space(sibling)) { + I(is_last_next_sibling_chunk(sibling)); + auto *next_sibling = ref_next_sibling_pos(sibling); + + assert(((*next_sibling) >> 2) == 0); + child.pos = ((sibling.pos >> 2) << 2) + *next_sibling; + + auto last_child_pos = increase_size(sibling); + I(last_child_pos == child.pos); + + set_data(child, data); + } else { + child.pos = create_space(parent, data); + auto *next_sibling = ref_next_sibling_pos(sibling); + *next_sibling = child.pos; + I(((*next_sibling) & 3) == 0); + + I(!is_leaf(parent)); // Add sibling, so already has child + } + + I(!child.is_invalid()); + I(is_leaf(child)); + if (*parent_lc_pos == sibling.pos) { // new child is the youngest now + *parent_lc_pos = child.pos; + } + + return child; +} + +template +Tree_index tree::insert_next_sibling(const Tree_index &sibling, const X &data) { + I(sibling.level > 0); // No siblings to root + + auto parent = get_parent(sibling); + auto *parent_lc_pos = ref_last_child_pos(parent); + + GI(get_first_child(parent).pos != -1, get_parent(get_first_child(parent)).pos == parent.pos); + + Tree_index child(sibling.level, -1); + + if (has_next_sibling_space(sibling)) { + I((sibling.pos & 3) != 3); // sibling can not be the last if there is space + I(is_last_next_sibling_chunk(sibling)); + + make_space_after(sibling); + + auto last_child_pos = increase_size(sibling); + I(data_stack[sibling.level].size() > sibling.pos); + + child.pos = sibling.pos + 1; + + set_data(child, data); + I(is_leaf(child)); + if (*parent_lc_pos >> 2 == sibling.pos >> 2) { // new child is the youngest now + *parent_lc_pos = last_child_pos; + } + + } else { + // WARNING: can not get ref, because the create can increse size and pointer is bogus + auto npos = get_next_sibling_pos(sibling); + + if ((npos >> 2) != 0) { + Tree_index next_bucket_child(sibling.level, (npos >> 2) << 2); + I(pointers_stack[sibling.level][sibling.pos >> 2].parent == pointers_stack[sibling.level][next_bucket_child.pos >> 2].parent); + if (has_next_sibling_space(next_bucket_child)) { // No need to re-alloc. + + if ((sibling.pos & 3) == 3) { // insert next bucket + make_space_after(next_bucket_child, false); + child.pos = next_bucket_child.pos; + } else { + make_space_after(sibling, next_bucket_child); + child.pos = sibling.pos + 1; + } + auto last_child_pos = increase_size(next_bucket_child); + set_data(child, data); + I(is_leaf(child)); + + if ((*parent_lc_pos) >> 2 == next_bucket_child.pos >> 2) { + *parent_lc_pos = last_child_pos; + } + + return child; + } + } + + Tree_index created_next_sibling(sibling.level, -1); + + if ((sibling.pos & 3) == 3) { // last sibling in bucket + created_next_sibling.pos = create_space(parent, data); + + child.pos = created_next_sibling.pos; + } else { + created_next_sibling.pos = create_space(parent, data_stack[sibling.level][sibling.pos | 3]); + auto &l = pointers_stack[created_next_sibling.level]; + l[created_next_sibling.pos >> 2].first_child[0] = l[sibling.pos >> 2].first_child[3]; + l[created_next_sibling.pos >> 2].last_child[0] = l[sibling.pos >> 2].last_child[3]; + auto fc = l[sibling.pos >> 2].first_child[3]; + if (fc != -1) { + adjust_parent_pointer(Tree_index(sibling.level + 1, fc), sibling.pos | 3, created_next_sibling.pos); + } + + make_space_after(sibling); + + child.pos = sibling.pos + 1; + + set_data(child, data); + I(is_leaf(child)); + } + I(pointers_stack[sibling.level][sibling.pos >> 2].parent + == pointers_stack[sibling.level][created_next_sibling.pos >> 2].parent); + + // insert created in the next chain (if last *next_sibling>>2 is zero) + auto *next_sibling = ref_next_sibling_pos(sibling); + I(((*next_sibling) & 3) == 0); + auto *next_next_sibling = ref_next_sibling_pos(created_next_sibling); + *next_next_sibling |= *next_sibling; + *next_sibling = created_next_sibling.pos; + + if ((*parent_lc_pos) >> 2 == sibling.pos >> 2) { // new child is the youngest now + *parent_lc_pos = created_next_sibling.pos; + } + + I(!is_leaf(parent)); // Add sibling, so already has child + } + + I(!child.is_invalid()); + I(is_leaf(child)); + + return child; +} + +template +Tree_index tree::get_depth_preorder_next(const Tree_index &child) const { + I(child.level < (int)pointers_stack.size()); + I((child.pos >> 2) < (int)pointers_stack[child.level].size()); + + auto fc = get_first_child_pos(child); + if (fc != -1) { + return Tree_index(child.level + 1, fc); + } + + I(is_leaf(child)); + + auto next = get_sibling_next(child); + if (!next.is_invalid()) { + return next; + } + + // It was leaf, without more siblings. Go to parent with sibling + auto parent = get_parent(child); + while (!parent.is_root()) { + auto parent_next = get_sibling_next(parent); + if (!parent_next.is_invalid()) { + return parent_next; + } + + parent = get_parent(parent); + } + + return invalid_index(); +} + +template +Tree_index tree::get_depth_postorder_next(const Tree_index &child) const { + auto next_child = get_sibling_next(child); + if (!next_child.is_invalid()) { + while (!is_leaf(next_child)) { + next_child = get_first_child(next_child); + } + return next_child; + } + if (is_root(child)) { + return invalid_index(); + } + + auto parent = get_parent(child); + return parent; +} + +template +void tree::set_root(const X &data) { + adjust_to_level(0); + + if (data_stack[0].empty()) { + pointers_stack[0].emplace_back(0); + } else { + I(pointers_stack[0][0].parent == 0); + data_stack[0].clear(); + } + + data_stack[0].emplace_back(data); +} + +template +void tree::each_bottom_up_fast(std::function fn) const { + auto sz = data_stack.size(); + for (int i = sz - 1; i >= 0; --i) { // WARNING: must be signed to handle -1 for loop exit + auto sz2 = data_stack[i].size(); + + for (size_t j = 0; j < sz2; j++) { + Tree_index ti(i, j); + if (!is_valid(ti)) { + continue; + } + + fn(ti, data_stack[i][j]); + } + } +} + +template +void tree::each_top_down_fast(std::function fn) const { + auto sz = data_stack.size(); + for (size_t i = 0; i < sz; i++) { + auto sz2 = data_stack[i].size(); + + for (size_t j = 0; j < sz2; j++) { + Tree_index ti(i, j); + if (!is_valid(ti)) { + continue; + } + + fn(ti, data_stack[i][j]); + } + } +} + +template +Tree_index tree::get_child(const Tree_index &top) const { + auto fc = get_first_child_pos(top); + if (fc == -1) { + return invalid_index(); + } + + return Tree_index(top.level + 1, fc); +} + +} // namespace lh diff --git a/hhds/tests/tree_test.cpp b/hhds/tests/tree_test.cpp index a83e1dd..48f7a2e 100644 --- a/hhds/tests/tree_test.cpp +++ b/hhds/tests/tree_test.cpp @@ -1,22 +1,9 @@ -// This file is distributed under the BSD 3-Clause License. See LICENSE for details. +#include +#include -#include -#include - -#include "fmt/format.h" -#include "gtest/gtest.h" - -#include "lhtree2.hpp" - - -class GTest1 : public ::testing::Test { -protected: - void SetUp() override {} -}; - - -TEST_F(GTest1, trivial) { - - // add ltree2 and check parents... -} +#include "../tree.hpp" +#include "../lhtree.hpp" +int main() { + return 0; +} \ No newline at end of file diff --git a/hhds/tree.cpp b/hhds/tree.cpp index 8159eba..ce7a3b2 100644 --- a/hhds/tree.cpp +++ b/hhds/tree.cpp @@ -1,50 +1,50 @@ -// test.cpp -#include "tree.hpp" +// // test.cpp +// #include "tree.hpp" -int main() { - using namespace hhds; +// int main() { +// using namespace hhds; - // Create a tree of integers - tree my_tree; +// // Create a tree of integers +// tree my_tree; - // Add root node with data 10 - Tree_pos root = my_tree.add_root(10); - std::cout << "Root node added with data: " << my_tree.get_data(root) << std::endl; +// // Add root node with data 10 +// Tree_pos root = my_tree.add_root(10); +// std::cout << "Root node added with data: " << my_tree.get_data(root) << std::endl; - // Add children to root node - Tree_pos child1 = my_tree.add_child(root, 20); - std::cout << "Child 1 added with data: " << 20 << std::endl; +// // Add children to root node +// Tree_pos child1 = my_tree.add_child(root, 20); +// std::cout << "Child 1 added with data: " << 20 << std::endl; - Tree_pos child2 = my_tree.add_child(root, 30); - Tree_pos child3 = my_tree.add_child(root, 40); - std::cout << "Child 3 added with data: " << my_tree.get_data(child3) << std::endl; +// Tree_pos child2 = my_tree.add_child(root, 30); +// Tree_pos child3 = my_tree.add_child(root, 40); +// std::cout << "Child 3 added with data: " << my_tree.get_data(child3) << std::endl; - std::cout << "Indices of children: " << child1 << " " << child2 << " " << child3 << std::endl; - // Check if child1 is the first child - bool is_first = my_tree.is_first_child(child1); - std::cout << "Is child1 the first child? " << (is_first ? "Yes" : "No") << std::endl; +// std::cout << "Indices of children: " << child1 << " " << child2 << " " << child3 << std::endl; +// // Check if child1 is the first child +// bool is_first = my_tree.is_first_child(child1); +// std::cout << "Is child1 the first child? " << (is_first ? "Yes" : "No") << std::endl; - // Check if child3 is the last child - bool is_last = my_tree.is_last_child(child3); - std::cout << "Is child3 the last child? " << (is_last ? "Yes" : "No") << std::endl; +// // Check if child3 is the last child +// bool is_last = my_tree.is_last_child(child3); +// std::cout << "Is child3 the last child? " << (is_last ? "Yes" : "No") << std::endl; - // Get the next sibling of child1 - std::cout << "gottem "; - Tree_pos next_sibling = my_tree.get_sibling_next(child1); - std::cout << "gottem "; - std::cout << "Next sibling of child1 has data: " << my_tree.get_data(next_sibling) << std::endl; +// // Get the next sibling of child1 +// std::cout << "gottem "; +// Tree_pos next_sibling = my_tree.get_sibling_next(child1); +// std::cout << "gottem "; +// std::cout << "Next sibling of child1 has data: " << my_tree.get_data(next_sibling) << std::endl; - // Get the previous sibling of child3 - Tree_pos prev_sibling = my_tree.get_sibling_prev(child3); - std::cout << "Previous sibling of child3 has data: " << my_tree.get_data(prev_sibling) << std::endl; +// // Get the previous sibling of child3 +// Tree_pos prev_sibling = my_tree.get_sibling_prev(child3); +// std::cout << "Previous sibling of child3 has data: " << my_tree.get_data(prev_sibling) << std::endl; - // Get the first child of root - Tree_pos first_child = my_tree.get_first_child(root); - std::cout << "First child of root has data: " << my_tree.get_data(first_child) << std::endl; +// // Get the first child of root +// Tree_pos first_child = my_tree.get_first_child(root); +// std::cout << "First child of root has data: " << my_tree.get_data(first_child) << std::endl; - // Get the last child of root - Tree_pos last_child = my_tree.get_last_child(root); - std::cout << "Last child of root has data: " << my_tree.get_data(last_child) << std::endl; +// // Get the last child of root +// Tree_pos last_child = my_tree.get_last_child(root); +// std::cout << "Last child of root has data: " << my_tree.get_data(last_child) << std::endl; - return 0; -} +// return 0; +// } From 83859b362fd8670d13ff33dc7770d03ff2ae02ff Mon Sep 17 00:00:00 2001 From: Ujjwal Shekhar Date: Thu, 27 Jun 2024 17:17:20 +0530 Subject: [PATCH 6/6] Started building the random tree benchmark. --- hhds/tests/tree_test.cpp | 52 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/hhds/tests/tree_test.cpp b/hhds/tests/tree_test.cpp index 48f7a2e..b639b7d 100644 --- a/hhds/tests/tree_test.cpp +++ b/hhds/tests/tree_test.cpp @@ -1,9 +1,53 @@ +// This file is distributed under the BSD 3-Clause License. See LICENSE for details. + #include -#include +#include +#include +#include +#include // Include the necessary headers for your tree data structures #include "../tree.hpp" #include "../lhtree.hpp" -int main() { - return 0; -} \ No newline at end of file +// Node structure example (replace with your actual node structure) +struct Node { + std::vector children; +}; + +// Function to generate a random tree with specified characteristics +Node generateRandomTree(std::default_random_engine& generator, int depth) { + Node node; + std::uniform_int_distribution numChildrenDist(4, 100); + std::uniform_int_distribution numLeafChildrenDist(4, 8); + + if (depth > 0) { + int numChildren = numChildrenDist(generator); + for (int i = 0; i < numChildren; ++i) { + node.children.push_back(generateRandomTree(generator, depth - 1)); + } + } else { + int numLeafChildren = numLeafChildrenDist(generator); + for (int i = 0; i < numLeafChildren; ++i) { + node.children.push_back(Node()); // Leaf node with children + } + } + + return node; +} + +static void BM_InsertRandomTree(benchmark::State& state) { + std::default_random_engine generator; + Node randomTree = generateRandomTree(generator, 3); // Adjust depth as needed + + while (state.KeepRunning()) { + // Insert nodes into the random tree + randomTree.children.push_back(Node()); + benchmark::DoNotOptimize(randomTree); // Prevent compiler optimizations + } +} + +// Register the benchmark +BENCHMARK(BM_InsertRandomTree); + +// Run the benchmark +BENCHMARK_MAIN();