3 Commits
Author SHA1 Message Date
andrew ba781b8875 Spec that addWrites advances oldestVersion minimally
CI / pre-commit (push) Successful in 2m14s
CI / test (arm64, -DCMAKE_BUILD_TYPE=Debug -DMSAN_TOOLCHAIN_PATH=/opt/msan, 22, https://minio.weaselab.dev/public/aarch64/msan-toolchain-22.1.8.tar.zst, debug-arm64, ubuntu-latest-arm64) (push) Successful in 3m45s
CI / test (amd64, -DCMAKE_BUILD_TYPE=Debug -DMSAN_TOOLCHAIN_PATH=/opt/msan, 21, https://minio.weaselab.dev/public/x86_64/msan-toolchain-21.1.8.tar.zst, debug, ubuntu-latest-amd64) (push) Successful in 4m13s
CI / release (arm64, , ubuntu-latest-arm64) (push) Successful in 3m25s
CI / test (amd64, -DCMAKE_CXX_FLAGS=-DUSE_64_BIT=1, 21, , 64-bit-versions, ubuntu-latest-amd64) (push) Successful in 3m48s
CI / test (amd64, -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, 21, , gcc, ubuntu-latest-amd64) (push) Successful in 3m43s
CI / test (amd64, -DUSE_SIMD_FALLBACK=ON, 21, , simd-fallback, ubuntu-latest-amd64) (push) Successful in 3m48s
CI / release (amd64, -DMSAN_TOOLCHAIN_PATH=/opt/msan, ubuntu-latest-amd64) (push) Successful in 6m23s
CI / coverage (push) Successful in 4m41s
The old wording only gave the lower bound oldestVersion >= newestVersion -
two billion, which an implementation could satisfy by discarding more
readable versions than necessary. State that oldestVersion becomes the
larger of its previous value and newestVersion - two billion.
2026-10-10 14:04:17 -04:00
andrew 8621662d3c Don't poison Node48 reverseIndex
Follows the reasoning of "Remove redundant version update": a write can
never lower the logical max version of a key range, so there's no read that
didn't pass before that should pass after a write. The check stays exact
reading the physical childMaxVersion and reverseIndex of unused slots, so
scan16's whole-page reads of them are well-defined and intended. The client
requests only produced valgrind false positives. Keep the initialization,
drop the poisoning.
2026-10-10 13:58:58 -04:00
andrew 9c721bcdca Stop printing metrics from TestDriver
The per-corpus-file Prometheus dump was debug-only output that nothing
consumes. It also floods stdout well past ctest's failed-output cap, so the
real failure (e.g. a valgrind report) never made it into the CI summary.
2026-10-10 13:55:02 -04:00
3 changed files with 10 additions and 53 deletions

No files matched your search

+2 -12
View File
@@ -571,11 +571,7 @@ inline void Node48::copyChildrenAndKeyFrom(const Node16 &other) {
}
// The reverseIndex bytes beyond numChildren are initialized so that the
// SIMD loads of a full 16-byte page in scan16 are well-defined (reading
// indeterminate bytes is UB in C++). valgrind then treats them as undefined
// so that it can still flag any read that relies on them.
VALGRIND_MAKE_MEM_UNDEFINED(reverseIndex + numChildren,
sizeof(reverseIndex) -
numChildren * sizeof(reverseIndex[0]));
// indeterminate bytes is UB in C++).
}
inline void Node48::copyChildrenAndKeyFrom(const Node48 &other) {
@@ -626,11 +622,7 @@ inline void Node48::copyChildrenAndKeyFrom(const Node256 &other) {
memcpy(partialKey(), &other + 1, partialKeyLen);
// The reverseIndex bytes beyond numChildren are initialized so that the
// SIMD loads of a full 16-byte page in scan16 are well-defined (reading
// indeterminate bytes is UB in C++). valgrind then treats them as undefined
// so that it can still flag any read that relies on them.
VALGRIND_MAKE_MEM_UNDEFINED(reverseIndex + numChildren,
sizeof(reverseIndex) -
numChildren * sizeof(reverseIndex[0]));
// indeterminate bytes is UB in C++).
}
inline void Node256::copyChildrenAndKeyFrom(const Node48 &other) {
@@ -2024,8 +2016,6 @@ Node *erase(Node *self, WriteContext *writeContext, bool logical) {
}
VALGRIND_MAKE_MEM_UNDEFINED(parent48->children + lastChildrenIndex,
sizeof(parent48->children[0]));
VALGRIND_MAKE_MEM_UNDEFINED(parent48->reverseIndex + lastChildrenIndex,
sizeof(parent48->reverseIndex[0]));
if (needsDownsize(parent48)) {
downsize(parent48, writeContext);
-31
View File
@@ -35,36 +35,5 @@ int main(int argc, char **argv) {
break;
}
}
{
ConflictSet::MetricsV1 *metrics;
int metricsCount;
driver1.cs.getMetricsV1(&metrics, &metricsCount);
printf("#################### METRICS for ConflictSet 1 for %s "
"####################\n",
argv[i]);
for (int i = 0; i < metricsCount; ++i) {
printf("# HELP %s %s\n", metrics[i].name, metrics[i].help);
printf("# TYPE %s %s\n", metrics[i].name,
metrics[i].type == metrics[i].Counter ? "counter" : "gauge");
printf("%s %g\n", metrics[i].name, metrics[i].getValue());
}
puts("");
}
{
ConflictSet::MetricsV1 *metrics;
int metricsCount;
driver2.cs.getMetricsV1(&metrics, &metricsCount);
printf("#################### METRICS for ConflictSet 2 for %s "
"####################\n",
argv[i]);
for (int i = 0; i < metricsCount; ++i) {
printf("# HELP %s %s\n", metrics[i].name, metrics[i].help);
printf("# TYPE %s %s\n", metrics[i].name,
metrics[i].type == metrics[i].Counter ? "counter" : "gauge");
printf("%s %g\n", metrics[i].name, metrics[i].getValue());
}
puts("");
}
}
}
+8 -10
View File
@@ -84,11 +84,10 @@ struct __attribute__((__visibility__("default"))) ConflictSet {
* `WriteRange` (see its field documentation); `count >= 0`; `writeVersion >=
* newestVersion`.
* @post Writes (writes[i], writeVersion) are recorded for every i < count,
* and `newestVersion` becomes `writeVersion`. `oldestVersion` advances as
* needed so that `oldestVersion >= newestVersion - two billion`;
* `oldestVersion <= newestVersion` is preserved. Calling with `count == 0`
* adds no write; `newestVersion` (and possibly `oldestVersion`) still
* advance. */
* and `newestVersion` becomes `writeVersion`. `oldestVersion` advances only
* as far as necessary: it becomes the larger of its previous value and
* `newestVersion - two billion`. Calling with `count == 0` adds no write;
* `newestVersion` (and possibly `oldestVersion`) still advance. */
void addWrites(const WriteRange *writes, int count, int64_t writeVersion);
/** Reads where readVersion < `oldestVersion` will result in `TooOld`.
@@ -231,11 +230,10 @@ void ConflictSet_check(const ConflictSet *cs,
* `ConflictSet_WriteRange` (see its field documentation); `count >= 0`;
* `writeVersion >= newestVersion`.
* @post Writes (writes[i], writeVersion) are recorded for every i < count,
* and `newestVersion` becomes `writeVersion`. `oldestVersion` advances as
* needed so that `oldestVersion >= newestVersion - two billion`;
* `oldestVersion <= newestVersion` is preserved. Calling with `count == 0`
* adds no write; `newestVersion` (and possibly `oldestVersion`) still
* advance. */
* and `newestVersion` becomes `writeVersion`. `oldestVersion` advances only
* as far as necessary: it becomes the larger of its previous value and
* `newestVersion - two billion`. Calling with `count == 0` adds no write;
* `newestVersion` (and possibly `oldestVersion`) still advance. */
void ConflictSet_addWrites(ConflictSet *cs,
const ConflictSet_WriteRange *writes, int count,
int64_t writeVersion);