Fix build
All checks were successful
Tests / Clang total: 1533, passed: 1533
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Debug total: 1531, passed: 1531
Tests / SIMD fallback total: 1533, passed: 1533
Tests / Release [gcc] total: 1533, passed: 1533
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [gcc,aarch64] total: 1144, passed: 1144
Tests / Coverage total: 1151, passed: 1151
Code Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 98.71% (1680/1702) * Branch Coverage: 64.50% (1508/2338) * Complexity Density: 0.00 * Lines of Code: 1702 #### Quality Gates Summary Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good

This commit is contained in:
2024-07-12 14:52:42 -07:00
parent f6edde0e50
commit cecfcc0da7

View File

@@ -1715,17 +1715,17 @@ struct SearchStepWise {
}
};
void onPointRead(ConflictSet::Impl *impl);
void onPrefixRead(ConflictSet::Impl *impl);
void onRangeRead(ConflictSet::Impl *impl);
void onCheckMaxBetween(ConflictSet::Impl *impl);
thread_local double accume_point_read = 0;
thread_local double accume_prefix_read = 0;
thread_local double accume_range_read = 0;
thread_local double accume_max_between = 0;
// Logically this is the same as performing firstGeq and then checking against
// point or range version according to cmp, but this version short circuits as
// soon as it can prove that there's no conflict.
bool checkPointRead(Node *n, const std::span<const uint8_t> key,
InternalVersionT readVersion, ConflictSet::Impl *impl) {
onPointRead(impl);
++accume_point_read;
#if DEBUG_VERBOSE && !defined(NDEBUG)
fprintf(stderr, "Check point read: %s\n", printable(key).c_str());
#endif
@@ -1803,7 +1803,7 @@ downLeftSpine:
// short circuits as soon as it can prove that there's no conflict.
bool checkPrefixRead(Node *n, const std::span<const uint8_t> key,
InternalVersionT readVersion, ConflictSet::Impl *impl) {
onPrefixRead(impl);
++accume_prefix_read;
#if DEBUG_VERBOSE && !defined(NDEBUG)
fprintf(stderr, "Check prefix read: %s\n", printable(key).c_str());
#endif
@@ -2045,6 +2045,7 @@ scan16(const InternalVersionT *vs, int begin, int end,
template <bool kAVX512>
bool checkMaxBetweenExclusive(Node *n, int begin, int end,
InternalVersionT readVersion) {
++accume_max_between;
assume(-1 <= begin);
assume(begin <= 256);
assume(-1 <= end);
@@ -2319,7 +2320,6 @@ bool checkRangeStartsWith(Node *n, std::span<const uint8_t> key, int begin,
#endif
auto remaining = key;
if (remaining.size() == 0) {
onCheckMaxBetween(impl);
return checkMaxBetweenExclusive<kAVX512>(n, begin, end, readVersion);
}
@@ -2416,7 +2416,6 @@ template <bool kAVX512> struct CheckRangeLeftSide {
}
if (searchPathLen >= prefixLen) {
onCheckMaxBetween(impl);
if (!checkMaxBetweenExclusive<kAVX512>(n, remaining[0], 256,
readVersion)) {
ok = false;
@@ -2547,7 +2546,6 @@ template <bool kAVX512> struct CheckRangeRightSide {
return true;
}
onCheckMaxBetween(impl);
if (!checkMaxBetweenExclusive<kAVX512>(n, -1, remaining[0],
readVersion)) {
ok = false;
@@ -2645,7 +2643,7 @@ template <bool kAVX512>
bool checkRangeReadImpl(Node *n, std::span<const uint8_t> begin,
std::span<const uint8_t> end,
InternalVersionT readVersion, ConflictSet::Impl *impl) {
onRangeRead(impl);
++accume_range_read;
int lcp = longestCommonPrefix(begin.data(), end.data(),
std::min(begin.size(), end.size()));
if (lcp == int(begin.size()) && end.size() == begin.size() + 1 &&
@@ -3060,11 +3058,6 @@ Node *firstGeqPhysical(Node *n, const std::span<const uint8_t> key) {
}
}
thread_local double accume_point_read = 0;
thread_local double accume_prefix_read = 0;
thread_local double accume_range_read = 0;
thread_local double accume_max_between = 0;
struct __attribute__((visibility("hidden"))) ConflictSet::Impl {
void check(const ReadRange *reads, Result *result, int count) {
@@ -3369,11 +3362,6 @@ InternalVersionT maxVersion(Node *n, ConflictSet::Impl *impl) {
}
}
void onPointRead(ConflictSet::Impl *impl) { ++impl->accume_point_read; }
void onPrefixRead(ConflictSet::Impl *impl) { ++impl->accume_prefix_read; }
void onRangeRead(ConflictSet::Impl *impl) { ++impl->accume_range_read; }
void onCheckMaxBetween(ConflictSet::Impl *impl) { ++impl->accume_max_between; }
void setMaxVersion(Node *n, ConflictSet::Impl *impl, InternalVersionT newMax) {
int index = n->parentsIndex;
n = n->parent;