From 8621662d3c68484725e9d5f5ea4bd64e924276b8 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Sat, 10 Oct 2026 13:58:58 -0400 Subject: [PATCH] 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. --- ConflictSet.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/ConflictSet.cpp b/ConflictSet.cpp index 153286d..553fb11 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -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);