52 Commits

Author SHA1 Message Date
andrew d6269c5b7c Use interleaved even if preserve_none is missing
Tests / 64 bit versions total: 7157, passed: 7157
Tests / Debug total: 7155, passed: 7155
Tests / SIMD fallback total: 7157, passed: 7157
Tests / Release [clang] total: 7157, passed: 7157
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [gcc] total: 7157, passed: 7157
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [clang,aarch64] total: 4742, passed: 4742
Tests / Coverage total: 4786, passed: 4786
Code Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 97.62% (3112/3188) * Branch Coverage: 41.88% (18791/44869) * Complexity Density: 0.00 * Lines of Code: 3188 #### Quality Gates Summary Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good
2024-11-01 15:12:59 -07:00
andrew faacdff2d9 Add to corpus
Tests / 64 bit versions total: 7157, passed: 7157
Tests / Debug total: 7155, passed: 7155
Tests / SIMD fallback total: 7157, passed: 7157
Tests / Release [clang] total: 7157, passed: 7157
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [gcc] total: 7157, passed: 7157
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [clang,aarch64] total: 4742, passed: 4742
Tests / Coverage total: 4786, passed: 4786
Code Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 97.62% (3112/3188) * Branch Coverage: 41.88% (18791/44869) * Complexity Density: 0.00 * Lines of Code: 3188 #### Quality Gates Summary Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good
2024-11-01 14:11:43 -07:00
andrew 821179b8de Remove dead code 2024-11-01 13:48:32 -07:00
andrew 681a961289 Dispatch on type pairs for end iter 2024-11-01 13:45:41 -07:00
andrew c73a3da14c Dispatch on type pairs for begin iter 2024-11-01 12:46:36 -07:00
andrew 5153d25cce Dispatch on type pairs for common prefix iter 2024-11-01 12:06:48 -07:00
andrew d2ec4e7fae Fix use of wrong member in endIter 2024-11-01 11:17:26 -07:00
andrew c7e2358746 Add memcmp to aarch64 imports
Tests / 64 bit versions total: 6074, passed: 6074
Tests / Debug total: 6072, passed: 6072
Tests / SIMD fallback total: 6074, passed: 6074
Tests / Release [clang] total: 6074, passed: 6074
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [gcc] total: 6074, passed: 6074
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [clang,aarch64] total: 4022, passed: 4022
Tests / Coverage total: 4063, passed: 4063
Code Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 97.12% (3104/3196) * Branch Coverage: 46.76% (13216/28261) * Complexity Density: 0.00 * Lines of Code: 3196 #### Quality Gates Summary Output truncated.
weaselab/conflict-set/pipeline/head There was a failure building this commit
2024-10-31 15:36:19 -07:00
andrew ec1c1cf43f Run gc less frequently
But still run it to account for the version potentially increasing
2024-10-31 15:35:00 -07:00
andrew eaad0c69a7 Store Result* pointer instead of index
Tests / 64 bit versions total: 6074, passed: 6074
Tests / Debug total: 6072, passed: 6072
Tests / SIMD fallback total: 6074, passed: 6074
Tests / Release [clang] total: 6074, passed: 6074
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [gcc] total: 6074, passed: 6074
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [clang,aarch64] total: 4022, failed: 2, passed: 4020
Tests / Coverage total: 4063, passed: 4063
weaselab/conflict-set/pipeline/head There was a failure building this commit
2024-10-31 12:59:36 -07:00
andrew 309e6ab816 Dispatch on pair of types 2024-10-30 22:59:00 -07:00
andrew 12b82c1be5 Fix accidentally-checked-in debug change 2024-10-30 16:44:00 -07:00
andrew 0cce9df8a8 Use constexpr int instead of sizeof 2024-10-30 15:36:46 -07:00
andrew 0df09743da Don't assign to nextRangeWrite twice 2024-10-30 15:33:40 -07:00
andrew c4b0aa1085 Skip over point writes in phase 3 2024-10-30 15:08:27 -07:00
andrew 051bfb05fe Fix up DEBUG_VERBOSE 2024-10-30 14:50:34 -07:00
andrew 7e1bcbf9be Follow forwarding pointers for end before addWriteRange 2024-10-30 14:26:37 -07:00
andrew 4e685bbc3b Use deferred release instead of hacky dontInvalidate logic 2024-10-30 14:16:36 -07:00
andrew b6bfc6f48d Remove redundant int conversions 2024-10-30 11:48:55 -07:00
andrew 3b858551f3 Switch std::span<const uint8_t> to TrivialSpan 2024-10-30 11:45:56 -07:00
andrew 2c1c26bc88 Enable interleaved range writes 2024-10-30 11:01:23 -07:00
andrew 958ee15cfc Use forwarding pointers instead of beginIsPrefix 2024-10-29 20:43:58 -07:00
andrew 9015b555de Allow passing two roots to addWriteRange 2024-10-29 17:24:10 -07:00
andrew 7aac73ee80 Process acceptable subranges interleaved 2024-10-29 14:41:42 -07:00
andrew c06afeb81e Add to corpus
Tests / 64 bit versions total: 6074, passed: 6074
Tests / Debug total: 6072, passed: 6072
Tests / SIMD fallback total: 6074, passed: 6074
Tests / Release [clang] total: 6074, passed: 6074
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [gcc] total: 6074, passed: 6074
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [clang,aarch64] total: 4022, passed: 4022
Tests / Coverage total: 4063, passed: 4063
Code Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 96.84% (2878/2972) * Branch Coverage: 48.98% (10647/21739) * Complexity Density: 0.00 * Lines of Code: 2972 #### Quality Gates Summary Output truncated.
weaselab/conflict-set/pipeline/head There was a failure building this commit
2024-10-29 11:59:36 -07:00
andrew b015711b7c Fix write metrics for interleaved implementation 2024-10-29 10:42:22 -07:00
andrew f27ca6d6af Better support a lack of musttail and preserve_none
Tests / 64 bit versions total: 5794, passed: 5794
Tests / Debug total: 5792, passed: 5792
Tests / SIMD fallback total: 5794, passed: 5794
Tests / Release [clang] total: 5794, passed: 5794
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [gcc] total: 5794, passed: 5794
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [clang,aarch64] total: 3836, passed: 3836
Tests / Coverage total: 3876, passed: 3876
Code Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 96.83% (2871/2965) * Branch Coverage: 48.98% (10630/21703) * Complexity Density: 0.00 * Lines of Code: 2965 #### Quality Gates Summary Output truncated.
weaselab/conflict-set/pipeline/head There was a failure building this commit
2024-10-28 22:40:52 -07:00
andrew c0bb175b7e Remove interleaved_insert::begin 2024-10-28 22:17:52 -07:00
andrew 6a6fe5738a Improve "complete" codegen for interleaved state machines 2024-10-28 22:15:05 -07:00
andrew dc16eccf06 Use stack allocation for small counts 2024-10-28 21:51:20 -07:00
andrew 3f15db7e82 Avoid longestCommonPrefix if partialKeyLen == 0 2024-10-28 21:44:16 -07:00
andrew e8a8b5aef1 Implement phase 2 2024-10-28 16:30:06 -07:00
andrew b8fefff3ba Remove accidentally-checked-in debug print 2024-10-28 16:20:51 -07:00
andrew 2706b2f65e Implement "phase 1" of interleaved point writes 2024-10-28 16:02:56 -07:00
andrew f1292efe41 Add getChildUpdatingMaxVersion 2024-10-28 15:31:00 -07:00
andrew a2d3d269ec Add check namespace
Prepare to add write namespace
2024-10-28 13:57:56 -07:00
andrew 8ff7a112b7 Add forwarding pointers + deferred release 2024-10-28 12:34:20 -07:00
andrew cf25b8626c Change server bench to point write heavy workload
Tests / 64 bit versions total: 5794, passed: 5794
Tests / Debug total: 5792, passed: 5792
Tests / SIMD fallback total: 5794, passed: 5794
Tests / Release [clang] total: 5794, passed: 5794
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [gcc] total: 5794, passed: 5794
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [clang,aarch64] total: 3836, passed: 3836
Tests / Coverage total: 3876, passed: 3876
Code Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 97.23% (2667/2743) * Branch Coverage: 48.95% (9913/20253) * Complexity Density: 0.00 * Lines of Code: 2743 #### Quality Gates Summary Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good
2024-10-27 22:28:03 -07:00
andrew e025f934d8 Fix gc-too-slow issue
Previously, with a finite set of keys, latest_extant_version could fall all the way behind so that a call to addWrites would have to do O(n) work eventually.
2024-10-27 21:13:27 -07:00
andrew e5452c0f7d Only check against sequential if we interleaved
Tests / 64 bit versions total: 5794, passed: 5794
Tests / Debug total: 5792, passed: 5792
Tests / SIMD fallback total: 5794, passed: 5794
Tests / Release [clang] total: 5794, passed: 5794
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [gcc] total: 5794, passed: 5794
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [clang,aarch64] total: 3836, passed: 3836
Tests / Coverage total: 3876, passed: 3876
Code Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 97.23% (2666/2742) * Branch Coverage: 48.95% (9912/20251) * Complexity Density: 0.00 * Lines of Code: 2742 #### Quality Gates Summary Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good
2024-10-17 16:17:21 -07:00
andrew 66fc526a55 Add to corpus 2024-10-17 16:07:15 -07:00
andrew 21f08b9f88 Avoid assigning to continuation where unnecessary 2024-10-17 13:16:29 -07:00
andrew 10c2f06199 Mix type dispatch and interleaving for down left spine 2024-10-17 13:13:16 -07:00
andrew 5cf04e9718 Add to corpus 2024-10-17 10:58:02 -07:00
andrew 707b220fbc Improve next{Physical,Logical} codegen more 2024-10-17 09:52:03 -07:00
andrew fd39065498 Add to corpus
Tests / 64 bit versions total: 5601, passed: 5601
Tests / Debug total: 5599, passed: 5599
Tests / SIMD fallback total: 5601, passed: 5601
Tests / Release [clang] total: 5601, passed: 5601
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [gcc] total: 5601, passed: 5601
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [clang,aarch64] total: 3708, passed: 3708
Tests / Coverage total: 3747, passed: 3747
Code Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 97.32% (2648/2721) * Branch Coverage: 48.99% (9942/20293) * Complexity Density: 0.00 * Lines of Code: 2721 #### Quality Gates Summary Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good
2024-10-16 16:38:56 -07:00
andrew b963d481c9 Improve codegen for nextLogical 2024-10-16 15:54:05 -07:00
andrew e7ed47e288 Assert that interleaved and sequential report same metrics
Tests / 64 bit versions total: 5514, passed: 5514
Tests / Debug total: 5512, passed: 5512
Tests / SIMD fallback total: 5514, passed: 5514
Tests / Release [clang] total: 5514, passed: 5514
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [gcc] total: 5514, passed: 5514
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [clang,aarch64] total: 3650, passed: 3650
Tests / Coverage total: 3689, passed: 3689
Code Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 97.31% (2637/2710) * Branch Coverage: 48.98% (9933/20279) * Complexity Density: 0.00 * Lines of Code: 2710 #### Quality Gates Summary Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good
2024-10-15 20:58:13 -07:00
andrew 04f138109b Rename variables from tls 2024-10-15 20:45:11 -07:00
andrew a0d07dd40c Remove no-longer-necessary GCOVR_EXCL_LINE
Now that we exclude noncode lines (why isn't that the default?)
2024-10-15 18:33:40 -07:00
andrew 7fb408b466 Remove tailcall test
Tests / 64 bit versions total: 5514, passed: 5514
Tests / Debug total: 5512, passed: 5512
Tests / SIMD fallback total: 5514, passed: 5514
Tests / Release [clang] total: 5514, passed: 5514
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [gcc] total: 5514, passed: 5514
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [clang,aarch64] total: 3650, passed: 3650
Tests / Coverage total: 3689, passed: 3689
Code Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 97.27% (2604/2677) * Branch Coverage: 48.98% (9897/20207) * Complexity Density: 0.00 * Lines of Code: 2677 #### Quality Gates Summary Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good
We no longer rely on tail call optimization happening where musttail is
not supported
2024-10-15 17:47:36 -07:00
andrew 6d265acfc7 Install llvm-cov 2024-10-15 17:47:01 -07:00
554 changed files with 1487 additions and 583 deletions
+16 -22
View File
@@ -17,26 +17,26 @@ constexpr int kPrefixLen = 0;
constexpr int kMvccWindow = 100000; constexpr int kMvccWindow = 100000;
std::span<const uint8_t> makeKey(Arena &arena, int index) { TrivialSpan makeKey(Arena &arena, int index) {
auto result = uint8_t *buf = new (arena) uint8_t[4 + kPrefixLen];
std::span<uint8_t>{new (arena) uint8_t[4 + kPrefixLen], 4 + kPrefixLen}; auto result = TrivialSpan{buf, 4 + kPrefixLen};
index = __builtin_bswap32(index); index = __builtin_bswap32(index);
memset(result.data(), 0, kPrefixLen); memset(buf, 0, kPrefixLen);
memcpy(result.data() + kPrefixLen, &index, 4); memcpy(buf, &index, 4);
return result; return result;
} }
ConflictSet::ReadRange singleton(Arena &arena, std::span<const uint8_t> key) { ConflictSet::ReadRange singleton(Arena &arena, TrivialSpan key) {
auto r = uint8_t *buf = new (arena) uint8_t[key.size() + 1];
std::span<uint8_t>(new (arena) uint8_t[key.size() + 1], key.size() + 1); auto r = TrivialSpan(buf, key.size() + 1);
memcpy(r.data(), key.data(), key.size()); memcpy(buf, key.data(), key.size());
r[key.size()] = 0; buf[key.size()] = 0;
return {{key.data(), int(key.size())}, {r.data(), int(r.size())}, 0}; return {{key.data(), int(key.size())}, {r.data(), int(r.size())}, 0};
} }
ConflictSet::ReadRange prefixRange(Arena &arena, std::span<const uint8_t> key) { ConflictSet::ReadRange prefixRange(Arena &arena, TrivialSpan key) {
int index; int index;
for (index = key.size() - 1; index >= 0; index--) for (index = key.size() - 1; index >= 0; index--)
if ((key[index]) != 255) if ((key[index]) != 255)
@@ -48,9 +48,10 @@ ConflictSet::ReadRange prefixRange(Arena &arena, std::span<const uint8_t> key) {
assert(false); assert(false);
} }
auto r = std::span<uint8_t>(new (arena) uint8_t[index + 1], index + 1); uint8_t *buf = new (arena) uint8_t[index + 1];
memcpy(r.data(), key.data(), index + 1); auto r = TrivialSpan(buf, index + 1);
r[r.size() - 1]++; memcpy(buf, key.data(), index + 1);
buf[r.size() - 1]++;
return {{key.data(), int(key.size())}, {r.data(), int(r.size())}, 0}; return {{key.data(), int(key.size())}, {r.data(), int(r.size())}, 0};
} }
@@ -81,14 +82,7 @@ void benchConflictSet() {
++version; ++version;
} }
// I don't know why std::less didn't work /shrug auto points = set<TrivialSpan, std::less<>>(arena);
struct Less {
bool operator()(const std::span<const uint8_t> &lhs,
const std::span<const uint8_t> &rhs) const {
return lhs < rhs;
}
};
auto points = set<std::span<const uint8_t>, Less>(arena);
while (points.size() < kOpsPerTx * 2 + 1) { while (points.size() < kOpsPerTx * 2 + 1) {
// TODO don't use rand? // TODO don't use rand?
+1408 -512
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -45,7 +45,7 @@ RUN curl -Ls https://sourceware.org/pub/valgrind/valgrind-3.22.0.tar.bz2 -o valg
# Recent clang # Recent clang
RUN wget https://apt.llvm.org/llvm.sh && chmod +x ./llvm.sh && ./llvm.sh 20 RUN wget https://apt.llvm.org/llvm.sh && chmod +x ./llvm.sh && ./llvm.sh 20
RUN apt-get install clang RUN apt-get -y install clang llvm
# Set after building valgrind, which doesn't build with clang for some reason # Set after building valgrind, which doesn't build with clang for some reason
ENV CC=clang ENV CC=clang
+48 -10
View File
@@ -26,9 +26,38 @@ using namespace weaselab;
#define DEBUG_VERBOSE 0 #define DEBUG_VERBOSE 0
#define SHOW_MEMORY 0 #define SHOW_MEMORY 0
[[nodiscard]] inline auto // std::span is not trivially constructible. We want a span that leaves its
operator<=>(const std::span<const uint8_t> &lhs, // members uninitialized for performance reasons.
const std::span<const uint8_t> &rhs) noexcept { struct TrivialSpan {
TrivialSpan() = default;
TrivialSpan(const uint8_t *begin, int len) : begin(begin), len(len) {}
uint8_t back() const {
assert(len > 0);
return begin[len - 1];
}
uint8_t front() const {
assert(len > 0);
return begin[0];
}
uint8_t operator[](int i) const {
assert(0 <= i);
assert(i < len);
return begin[i];
}
int size() const { return len; }
TrivialSpan subspan(int offset, int len) { return {begin + offset, len}; }
const uint8_t *data() const { return begin; }
private:
const uint8_t *begin;
int len;
};
static_assert(std::is_trivial_v<TrivialSpan>);
[[nodiscard]] inline auto operator<=>(const TrivialSpan &lhs,
const TrivialSpan &rhs) noexcept {
int cl = std::min<int>(lhs.size(), rhs.size()); int cl = std::min<int>(lhs.size(), rhs.size());
if (cl > 0) { if (cl > 0) {
if (auto c = memcmp(lhs.data(), rhs.data(), cl) <=> 0; c != 0) { if (auto c = memcmp(lhs.data(), rhs.data(), cl) <=> 0; c != 0) {
@@ -38,7 +67,7 @@ operator<=>(const std::span<const uint8_t> &lhs,
return lhs.size() <=> rhs.size(); return lhs.size() <=> rhs.size();
} }
[[nodiscard]] inline auto operator<=>(const std::span<const uint8_t> &lhs, [[nodiscard]] inline auto operator<=>(const TrivialSpan &lhs,
const ConflictSet::Key &rhs) noexcept { const ConflictSet::Key &rhs) noexcept {
int cl = std::min<int>(lhs.size(), rhs.len); int cl = std::min<int>(lhs.size(), rhs.len);
if (cl > 0) { if (cl > 0) {
@@ -46,7 +75,18 @@ operator<=>(const std::span<const uint8_t> &lhs,
return c; return c;
} }
} }
return lhs.size() <=> size_t(rhs.len); return lhs.size() <=> rhs.len;
}
[[nodiscard]] inline auto operator<=>(const ConflictSet::Key &lhs,
const ConflictSet::Key &rhs) noexcept {
int cl = std::min<int>(lhs.len, rhs.len);
if (cl > 0) {
if (auto c = memcmp(lhs.p, rhs.p, cl) <=> 0; c != 0) {
return c;
}
}
return lhs.len <=> rhs.len;
} }
// This header contains code that we want to reuse outside of ConflictSet.cpp or // This header contains code that we want to reuse outside of ConflictSet.cpp or
@@ -569,7 +609,7 @@ inline std::string printable(const Key &key) {
return printable(std::string_view((const char *)key.p, key.len)); return printable(std::string_view((const char *)key.p, key.len));
} }
inline std::string printable(std::span<const uint8_t> key) { inline std::string printable(TrivialSpan key) {
return printable(std::string_view((const char *)key.data(), key.size())); return printable(std::string_view((const char *)key.data(), key.size()));
} }
@@ -677,10 +717,8 @@ struct TestDriver {
arbitrary->randomBytes(begin + prefixLen, keyLen - prefixLen); arbitrary->randomBytes(begin + prefixLen, keyLen - prefixLen);
writes[i].end.len = keyLen; writes[i].end.len = keyLen;
writes[i].end.p = begin; writes[i].end.p = begin;
auto c = auto c = TrivialSpan(writes[i].begin.p, writes[i].begin.len) <=>
std::span<const uint8_t>(writes[i].begin.p, TrivialSpan(writes[i].end.p, writes[i].end.len);
writes[i].begin.len) <=>
std::span<const uint8_t>(writes[i].end.p, writes[i].end.len);
if (c > 0) { if (c > 0) {
using std::swap; using std::swap;
swap(writes[i].begin, writes[i].end); swap(writes[i].begin, writes[i].end);
+12 -32
View File
@@ -1,5 +1,6 @@
#include <atomic> #include <atomic>
#include <cstdint> #include <cstdint>
#include <cstdlib>
#include <errno.h> #include <errno.h>
#include <netdb.h> #include <netdb.h>
#include <stdio.h> #include <stdio.h>
@@ -37,41 +38,20 @@ std::string makeKey(int64_t num, int suffixLen) {
void workload(weaselab::ConflictSet *cs) { void workload(weaselab::ConflictSet *cs) {
int64_t version = kWindowSize; int64_t version = kWindowSize;
for (int i = 0; i < kNumPrefixes; ++i) { constexpr int kNumWrites = 16;
for (int j = 0; j < 50; ++j) {
weaselab::ConflictSet::WriteRange wr;
auto k = makeKey(i, j);
wr.begin.p = (const uint8_t *)k.data();
wr.begin.len = k.size();
wr.end.len = 0;
cs->addWrites(&wr, 1, version);
}
}
++version;
for (int i = 0; i < kNumPrefixes; ++i) {
weaselab::ConflictSet::WriteRange wr;
auto k = makeKey(i, 50);
wr.begin.p = (const uint8_t *)k.data();
wr.begin.len = k.size();
wr.end.len = 0;
cs->addWrites(&wr, 1, version);
}
constexpr int kNumReads = 1;
std::vector<weaselab::ConflictSet::Result> results(kNumReads);
for (;; transactions.fetch_add(1, std::memory_order_relaxed)) { for (;; transactions.fetch_add(1, std::memory_order_relaxed)) {
std::vector<std::string> keys(kNumReads); std::vector<std::string> keys;
for (auto &k : keys) { std::vector<weaselab::ConflictSet::WriteRange> writes;
k = makeKey(rand() % kNumPrefixes, 49); for (int i = 0; i < kNumWrites; ++i) {
keys.push_back(makeKey(rand() % kNumPrefixes, rand() % 50));
} }
std::vector<weaselab::ConflictSet::ReadRange> reads(kNumReads); for (int i = 0; i < kNumWrites; ++i) {
for (int i = 0; i < reads.size(); ++i) { writes.push_back({{(const uint8_t *)keys[i].data(), int(keys[i].size())},
reads[i].begin.p = (const uint8_t *)(keys[i].data()); {nullptr, 0}});
reads[i].begin.len = keys[i].size();
reads[i].end.len = 0;
reads[i].readVersion = version - 1;
} }
cs->check(reads.data(), results.data(), kNumReads); cs->addWrites(writes.data(), writes.size(), version);
cs->setOldestVersion(version - kWindowSize);
++version;
} }
} }
+1
View File
@@ -5,6 +5,7 @@ __stack_chk_guard@GLIBC_2.17
abort@GLIBC_2.17 abort@GLIBC_2.17
free@GLIBC_2.17 free@GLIBC_2.17
malloc@GLIBC_2.17 malloc@GLIBC_2.17
memcmp@GLIBC_2.17
memcpy@GLIBC_2.17 memcpy@GLIBC_2.17
memmove@GLIBC_2.17 memmove@GLIBC_2.17
memset@GLIBC_2.17 memset@GLIBC_2.17
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More