Skip to content

Commit

Permalink
Merge branch 'master' into SpatialJoinArea
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan24680 committed Feb 7, 2025
2 parents 4132701 + d7a70c7 commit d711586
Show file tree
Hide file tree
Showing 136 changed files with 5,701 additions and 3,249 deletions.
2 changes: 1 addition & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
skip = .git*,.codespellrc,*.pdf,generated
check-hidden = true
# Ignore mixedCase variables, lines with latin, lines with codespell-ignore pragma, etc
ignore-regex = \b([A-Z]*[a-z]+[A-Z][a-zA-Z]*)\b|.*(Lorem ipsum|eleifend|feugait|codespell-ignore).*
ignore-regex = \b([A-Z]*[a-z]+[A-Z][a-zA-Z]*)\b|.*(Lorem ipsum|eleifend|feugait|codespell-ignore).*|https?://\S+
# alph - is used frequently in tests, just ignore altogether
ignore-words-list = ser,alph,inbetween,interm
9 changes: 8 additions & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ jobs:
submodules: 'recursive'
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
# As of Jan, 28, 2025 the default value here (`binfmt:latest`)
# downloads a QEMU version that leads to segfaults in the compiler.
# We therefore fix a working version
# TODO<joka921> GitHub actions now has ARM runners,
# avoid cross-compilation completely
image : 'tonistiigi/binfmt:desktop-v8.1.5-44'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
Expand Down Expand Up @@ -56,7 +63,7 @@ jobs:
tags: adfreiburg/qlever:test

- name: E2E in Docker
run: |
run: |
sudo mkdir ${{github.workspace}}/e2e_data
sudo chmod a+rwx ${{github.workspace}}/e2e_data
sudo docker run -i --rm -v "${{github.workspace}}/e2e_data:/app/e2e_data/" --entrypoint e2e/e2e.sh adfreiburg/qlever:test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sparql-conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
echo ${{github.event.pull_request.head.sha}} > ./conformance-report/sha
mv ${{ github.workspace}}/qlever-test-suite/results/${{ github.sha }}.json.bz2 conformance-report/${{ github.event.pull_request.head.sha }}.json.bz2
- name: Upload coverage artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: conformance-report
path: conformance-report/
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
FetchContent_Declare(
ctre
GIT_REPOSITORY https://github.com/hanickadot/compile-time-regular-expressions.git
GIT_TAG b3d7788b559e34d985c8530c3e0e7260b67505a6 # v3.8.1
GIT_TAG eb9577aae3515d14e6c5564f9aeb046d2e7c1124 # v3.9.0
)

################################
Expand Down
12 changes: 6 additions & 6 deletions benchmark/GroupByHashMapBenchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ class GroupByHashMapBenchmark : public BenchmarkInterface {
} else {
firstColumn = generateRandomGroupVec(numInputRows, numGroups);
}
std::ranges::transform(
ql::ranges::transform(
firstColumn.begin(), firstColumn.end(), groupValues.begin(),
[](size_t value) {
return ValueId::makeFromInt(static_cast<int64_t>(value));
Expand All @@ -375,7 +375,7 @@ class GroupByHashMapBenchmark : public BenchmarkInterface {
auto localVocab = LocalVocab{};
if (valueTypes != ValueIdType::Strings) {
auto secondColumn = generateRandomDoubleVec(numInputRows);
std::ranges::transform(
ql::ranges::transform(
secondColumn.begin(), secondColumn.end(), otherValues.begin(),
[&](double value) {
if (valueTypes == ValueIdType::OnlyDouble)
Expand All @@ -396,10 +396,10 @@ class GroupByHashMapBenchmark : public BenchmarkInterface {
numInputRows, randomStringLength);
localVocab = std::move(newLocalVocab);

std::ranges::transform(indices.begin(), indices.end(),
otherValues.begin(), [&](LocalVocabIndex idx) {
return ValueId::makeFromLocalVocabIndex(idx);
});
ql::ranges::transform(indices.begin(), indices.end(), otherValues.begin(),
[&](LocalVocabIndex idx) {
return ValueId::makeFromLocalVocabIndex(idx);
});
}

std::vector<std::optional<Variable>> variables = {Variable{"?a"},
Expand Down
46 changes: 23 additions & 23 deletions benchmark/JoinAlgorithmBenchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ struct SetOfIdTableColumnElements {
*/
explicit SetOfIdTableColumnElements(
const std::span<const ValueId>& idTableColumnRef) {
std::ranges::for_each(idTableColumnRef, [this](const ValueId& id) {
ql::ranges::for_each(idTableColumnRef, [this](const ValueId& id) {
if (auto numOccurrencesIterator = numOccurrences_.find(id);
numOccurrencesIterator != numOccurrences_.end()) {
(numOccurrencesIterator->second)++;
Expand Down Expand Up @@ -190,7 +190,7 @@ static size_t createOverlapRandomly(IdTableAndJoinColumn* const smallerTable,
// Create the overlap.
ad_utility::HashMap<ValueId, std::reference_wrapper<const ValueId>>
smallerTableElementToNewElement{};
std::ranges::for_each(
ql::ranges::for_each(
smallerTableJoinColumnRef,
[&randomDouble, &probabilityToCreateOverlap,
&smallerTableElementToNewElement, &randomBiggerTableElement,
Expand Down Expand Up @@ -295,7 +295,7 @@ static size_t createOverlapRandomly(IdTableAndJoinColumn* const smallerTable,
size_t newOverlapMatches{0};
ad_utility::HashMap<ValueId, std::reference_wrapper<const ValueId>>
smallerTableElementToNewElement{};
std::ranges::for_each(
ql::ranges::for_each(
smallerTableJoinColumnSet.uniqueElements_,
[&randomBiggerTableElement, &wantedNumNewOverlapMatches,
&newOverlapMatches, &smallerTableElementToNewElement,
Expand Down Expand Up @@ -326,7 +326,7 @@ static size_t createOverlapRandomly(IdTableAndJoinColumn* const smallerTable,
});

// Overwrite the designated values in the smaller table.
std::ranges::for_each(
ql::ranges::for_each(
smallerTableJoinColumnRef, [&smallerTableElementToNewElement](auto& id) {
if (auto newValueIterator = smallerTableElementToNewElement.find(id);
newValueIterator != smallerTableElementToNewElement.end()) {
Expand Down Expand Up @@ -465,17 +465,17 @@ static std::vector<T> mergeSortedVectors(
std::vector<T> mergedVector{};

// Merge.
std::ranges::for_each(intervals, [&mergedVector](std::vector<T> elements) {
ql::ranges::for_each(intervals, [&mergedVector](std::vector<T> elements) {
if (mergedVector.empty() || elements.empty()) {
std::ranges::copy(elements, std::back_inserter(mergedVector));
ql::ranges::copy(elements, std::back_inserter(mergedVector));
return;
}
const size_t idxOldLastElem = mergedVector.size() - 1;
std::ranges::copy(elements, std::back_inserter(mergedVector));
ql::ranges::copy(elements, std::back_inserter(mergedVector));
if (mergedVector.at(idxOldLastElem) > mergedVector.at(idxOldLastElem + 1)) {
std::ranges::inplace_merge(
ql::ranges::inplace_merge(
mergedVector,
std::ranges::next(mergedVector.begin(), idxOldLastElem + 1));
ql::ranges::next(mergedVector.begin(), idxOldLastElem + 1));
}
});

Expand Down Expand Up @@ -935,7 +935,7 @@ class GeneralInterfaceImplementation : public BenchmarkInterface {
"' must be bigger than, or equal to, 0.")};
config.addValidator(
[](const benchmarkSampleSizeRatiosValueType& vec) {
return std::ranges::all_of(
return ql::ranges::all_of(
vec,
[](const benchmarkSampleSizeRatiosValueType::value_type ratio) {
return ratio >= 0.f;
Expand All @@ -961,7 +961,7 @@ class GeneralInterfaceImplementation : public BenchmarkInterface {
".")};
config.addValidator(
[](const benchmarkSampleSizeRatiosValueType& vec) {
return std::ranges::max(vec) <=
return ql::ranges::max(vec) <=
getMaxValue<benchmarkSampleSizeRatiosValueType::value_type>() -
1.f;
},
Expand Down Expand Up @@ -1056,9 +1056,9 @@ class GeneralInterfaceImplementation : public BenchmarkInterface {
},
descriptor, descriptor, option);
};
std::ranges::for_each(std::vector{minBiggerTableRows, maxBiggerTableRows,
minSmallerTableRows},
addCastableValidator);
ql::ranges::for_each(std::vector{minBiggerTableRows, maxBiggerTableRows,
minSmallerTableRows},
addCastableValidator);
}

/*
Expand Down Expand Up @@ -1303,7 +1303,7 @@ class GeneralInterfaceImplementation : public BenchmarkInterface {
ColumnNumWithType<float>{toUnderlying(TimeForMergeGallopingJoin)});

// Calculate, how much of a speedup the hash join algorithm has in
// comparison to the merge/galloping join algrithm.
// comparison to the merge/galloping join algorithm.
calculateSpeedupOfColumn(
table, {toUnderlying(JoinAlgorithmSpeedup)},
{toUnderlying(TimeForHashJoin)},
Expand Down Expand Up @@ -1684,7 +1684,7 @@ class BmOnlyBiggerTableSizeChanges final
static_cast<double>(getConfigVariables().minBiggerTableRows_) /
static_cast<double>(smallerTableNumRows)))};
auto growthFunction = createDefaultGrowthLambda<float>(
10.f, std::ranges::max(minRatio, 10.f),
10.f, ql::ranges::max(minRatio, 10.f),
generateNaturalNumberSequenceInterval(minRatio, 9.f));
ResultTable& table = makeGrowingBenchmarkTable(
&results, tableName, "Row ratio", alwaysFalse,
Expand Down Expand Up @@ -1742,8 +1742,8 @@ class BmOnlySmallerTableSizeChanges final
for (const float ratioRows : mergeSortedVectors<float>(
{generateNaturalNumberSequenceInterval(
getConfigVariables().minRatioRows_,
std::ranges::min(getConfigVariables().maxRatioRows_,
10.f)),
ql::ranges::min(getConfigVariables().maxRatioRows_,
10.f)),
generateExponentInterval(
10.f, getConfigVariables().minRatioRows_,
getConfigVariables().maxRatioRows_)})) {
Expand All @@ -1755,7 +1755,7 @@ class BmOnlySmallerTableSizeChanges final
// Returns the amount of rows in the smaller `IdTable`, used for the
// measurements in a given row.
auto growthFunction = createDefaultGrowthLambda(
10UL, std::ranges::max(
10UL, ql::ranges::max(
static_cast<size_t>(
static_cast<double>(
getConfigVariables().minBiggerTableRows_) /
Expand Down Expand Up @@ -1867,7 +1867,7 @@ class BmSampleSizeRatio final : public GeneralInterfaceImplementation {
BenchmarkResults runAllBenchmarks() override {
BenchmarkResults results{};
const auto& ratios{getConfigVariables().benchmarkSampleSizeRatios_};
const float maxSampleSizeRatio{std::ranges::max(ratios)};
const float maxSampleSizeRatio{ql::ranges::max(ratios)};

/*
We work with the biggest possible smaller and bigger table. That should make
Expand Down Expand Up @@ -2097,17 +2097,17 @@ class BmSmallerTableGrowsBiggerTableRemainsSameSize final
static_cast<double>(biggerTableNumRows) /
static_cast<double>(getConfigVariables().minSmallerTableRows_))};
std::vector<size_t> smallerTableRows;
std::ranges::transform(
ql::ranges::transform(
mergeSortedVectors<float>(
{generateNaturalNumberSequenceInterval(
1.f, std::ranges::min(10.f, biggestRowRatio)),
1.f, ql::ranges::min(10.f, biggestRowRatio)),
generateExponentInterval(10.f, 10.f, biggestRowRatio)}),
std::back_inserter(smallerTableRows),
[&biggerTableNumRows](const float ratio) {
return static_cast<size_t>(
static_cast<double>(biggerTableNumRows) / ratio);
});
std::ranges::reverse(smallerTableRows);
ql::ranges::reverse(smallerTableRows);
const size_t lastSmallerTableRow{smallerTableRows.back()};
auto growthFunction = createDefaultGrowthLambda(
10UL, lastSmallerTableRow + 1UL, std::move(smallerTableRows));
Expand Down
4 changes: 2 additions & 2 deletions benchmark/ParallelMergeBenchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ class IdTableCompressedWriterBenchmark : public BenchmarkInterface {
ad_utility::integerRange(numInputRows)) {
res.push_back(gen());
}
std::ranges::sort(res);
ql::ranges::sort(res);
return res;
};
std::vector<std::vector<size_t>> inputs;
inputs.resize(numInputs);
std::ranges::generate(inputs, generateRandomVec);
ql::ranges::generate(inputs, generateRandomVec);

auto run = [&inputs]() {
auto merger = ad_utility::parallelMultiwayMerge<size_t, false>(
Expand Down
16 changes: 8 additions & 8 deletions benchmark/infrastructure/BenchmarkMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static void writeBenchmarkClassAndBenchmarkResultsToJsonFile(
Print the configuration documentation of all registered benchmarks.
*/
static __attribute__((noreturn)) void printConfigurationOptionsAndExit() {
std::ranges::for_each(
ql::ranges::for_each(
BenchmarkRegister::getAllRegisteredBenchmarks(),
[](const BenchmarkInterface* bench) {
std::cerr << createCategoryTitle(
Expand Down Expand Up @@ -211,13 +211,13 @@ int main(int argc, char** argv) {
// Actually processing the arguments.
if (vm.count("print")) {
// Print the results and metadata.
std::ranges::for_each(benchmarkClassAndResults,
[](const auto& pair) {
std::cout << benchmarkResultsToString(pair.first,
pair.second)
<< "\n\n";
},
{});
ql::ranges::for_each(benchmarkClassAndResults,
[](const auto& pair) {
std::cout << benchmarkResultsToString(pair.first,
pair.second)
<< "\n\n";
},
{});
}

if (vm.count("write")) {
Expand Down
8 changes: 4 additions & 4 deletions benchmark/infrastructure/BenchmarkMeasurementContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void ResultTable::init(const std::string& descriptor,
descriptorForLog_ = std::move(descriptorForLog);
columnNames_ = columnNames;
entries_.resize(rowNames.size());
std::ranges::fill(entries_, std::vector<EntryType>(columnNames.size()));
ql::ranges::fill(entries_, std::vector<EntryType>(columnNames.size()));

// Setting the row names.
for (size_t row = 0; row < rowNames.size(); row++) {
Expand Down Expand Up @@ -287,10 +287,10 @@ ResultTable::operator std::string() const {
});

// Which of the entries is the longest?
columnMaxStringWidth.at(column) = std::ranges::max(stringWidthOfRow);
columnMaxStringWidth.at(column) = ql::ranges::max(stringWidthOfRow);

// Is the name of the column bigger?
columnMaxStringWidth.at(column) = std::ranges::max(
columnMaxStringWidth.at(column) = ql::ranges::max(
columnMaxStringWidth.at(column), columnNames_.at(column).length());
}

Expand Down Expand Up @@ -384,7 +384,7 @@ void ResultGroup::deleteEntryImpl(T& entry) {
}();

// Delete `entry`.
auto entryIterator{std::ranges::find(
auto entryIterator{ql::ranges::find(
vec, &entry, [](const ad_utility::CopyableUniquePtr<T>& pointer) {
return pointer.get();
})};
Expand Down
4 changes: 2 additions & 2 deletions benchmark/infrastructure/BenchmarkToJson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ static nlohmann::json transformIntoJsonArray(
*/
nlohmann::ordered_json jsonArray = nlohmann::ordered_json::array();

std::ranges::transform(vec, std::back_inserter(jsonArray),
translationFunction);
ql::ranges::transform(vec, std::back_inserter(jsonArray),
translationFunction);

return jsonArray;
}
Expand Down
4 changes: 2 additions & 2 deletions benchmark/util/ResultTableColumnOperations.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ requires(sizeof...(ColumnInputTypes) > 0) void generateColumnWithColumnInput(
// Using a column more than once is the sign of an error.
std::array<size_t, sizeof...(ColumnInputTypes)> allColumnNums{
{inputColumns.columnNum_...}};
std::ranges::sort(allColumnNums);
AD_CONTRACT_CHECK(std::ranges::adjacent_find(allColumnNums) ==
ql::ranges::sort(allColumnNums);
AD_CONTRACT_CHECK(ql::ranges::adjacent_find(allColumnNums) ==
allColumnNums.end());

// Fill the result column.
Expand Down
4 changes: 2 additions & 2 deletions src/ServerMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ int main(int argc, char** argv) {
optionFactory.getProgramOption<"cache-max-size-single-entry">(),
"Maximum size for a single cache entry. That is, "
"results larger than this will not be cached unless pinned.");
add("lazy-result-max-cache-size,E",
optionFactory.getProgramOption<"lazy-result-max-cache-size">(),
add("cache-max-size-lazy-result,E",
optionFactory.getProgramOption<"cache-max-size-lazy-result">(),
"Maximum size up to which lazy results will be cached by aggregating "
"partial results. Caching does cause significant overhead for this "
"case.");
Expand Down
4 changes: 2 additions & 2 deletions src/backports/algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
#include "backports/concepts.h"

// The following defines namespaces `ql::ranges` and `ql::views` that are almost
// drop-in replacements for `std::ranges` and `std::views`. In C++20 mode (when
// drop-in replacements for `ql::ranges` and `std::views`. In C++20 mode (when
// the `QLEVER_CPP_17` macro is not used), these namespaces are simply aliases
// for `std::ranges` and `std::views`. In C++17 mode they contain the ranges and
// for `ql::ranges` and `std::views`. In C++17 mode they contain the ranges and
// views from Erice Niebler's `range-v3` library. NOTE: `ql::ranges::unique`
// currently doesn't work, because the interface to this function is different
// in both implementations. NOTE: There might be other caveats which we are
Expand Down
2 changes: 1 addition & 1 deletion src/engine/AddCombinedRowToTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ class AddCombinedRowToIdTable {
// Only merge non-null vocabs.
auto range = currentVocabs_ | ql::views::filter(toBool) |
ql::views::transform(dereference);
mergedVocab_.mergeWith(std::ranges::ref_view{range});
mergedVocab_.mergeWith(ql::ranges::ref_view{range});
}
}
const IdTableView<0>& inputLeft() const {
Expand Down
2 changes: 1 addition & 1 deletion src/engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ add_library(engine
CartesianProductJoin.cpp TextIndexScanForWord.cpp TextIndexScanForEntity.cpp
TextLimit.cpp LazyGroupBy.cpp GroupByHashMapOptimization.cpp SpatialJoin.cpp
CountConnectedSubgraphs.cpp SpatialJoinAlgorithms.cpp PathSearch.cpp ExecuteUpdate.cpp
Describe.cpp)
Describe.cpp GraphStoreProtocol.cpp)
qlever_target_link_libraries(engine util index parser sparqlExpressions http SortPerformanceEstimator Boost::iostreams s2)
Loading

0 comments on commit d711586

Please sign in to comment.