Commit Graph
650 Commits
Author SHA1 Message Date
weaselbot d040ed63a4 Move aarch64 Node16 SIMD index loads into assembly
CI / release (arm64, , ubuntu-latest-arm64) (pull_request) Successful in 2m18s
CI / pre-commit (pull_request) Successful in 1m58s
CI / test (-DCMAKE_BUILD_TYPE=Debug -DMSAN_TOOLCHAIN_PATH=/opt/msan, debug) (pull_request) Successful in 3m47s
CI / test (-DCMAKE_CXX_FLAGS=-DUSE_64_BIT=1, 64-bit-versions) (pull_request) Successful in 3m16s
CI / test (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc) (pull_request) Successful in 3m12s
CI / test (-DUSE_SIMD_FALLBACK=ON, simd-fallback) (pull_request) Successful in 3m17s
CI / release (amd64, -DMSAN_TOOLCHAIN_PATH=/opt/msan, ubuntu-latest-amd64) (pull_request) Successful in 5m32s
CI / coverage (pull_request) Successful in 3m42s
The aarch64 NEON paths in getNodeIndex/getNodeIndexExists,
getChildGeq(Node16*), scan16, and checkMaxBetweenExclusiveImpl<Node16>
loaded the full 16-element Node16::index array (and the Node48
reverseIndex array via scan16) with NEON intrinsics, then masked the
result down to [0, numChildren). Only the in-use slots are initialized;
the unused bytes are indeterminate, so the wide loads were undefined
behavior in C++ (per [basic.indet]) even though the trailing lanes were
discarded. MSan reports this on x86-64; on aarch64 it is the same UB but
MSan's imprecise modeling doesn't flag it at -O0, so there is no red->green
test.

Mirror the existing x86-64 fix (commit 6fed133): implement the index
operations in file-level assembly, where loading and operating on
indeterminate values is well-defined. Add simd_aarch64.S with
find_eq_16, find_ge_16, and mask_in_range_16. AArch64 lacks pmovmskb, so
(like the prior NEON code) these return a 64-bit nibble mask rather than
a 16-bit bitmask; the C++ call sites keep their existing nibble-mask
arithmetic and only swap the inline NEON load/compare for the assembly
call. The childMaxVersion compares stay in C++ NEON intrinsics, matching
x86-64's compare16: those slots are always initialized to zero by the
allocator, so the wide loads are defined.

The assembly functions carry `bti c` landing pads and the same
aeabi_feature_and_bits attributes the compiler emits for
-mbranch-protection=standard, so the object stays BTI/PAC/GCS-compatible
(and warning-free under -z force-bti). CMakeLists.txt builds simd_aarch64.S
into the object library and the SIMD test/bench/fuzz targets on aarch64.

Closes #68
2026-08-02 23:48:28 -04:00
andrew 6fed133212 Remove UB from indeterminate value handling
Move SIMD operations on potentially-indeterminate Node16::index bytes
into file-level assembly, where loading and operating on indeterminate
values is well-defined (unlike C++). Restructure scalar fallback loops
to iterate [0, numChildren) instead of [0, kMaxNodes). Fix TrivialSpan
construction from indeterminate pointers in check::Job::init and
insertPointWritesOrSorted to only construct when end.len > 0.

Add MSan toolchain to the debug CI build to catch these issues going
forward.
2026-08-02 21:06:53 -04:00
andrew 9d15af772e Run msan in CI. Closes #66
CI / pre-commit (push) Successful in 2m5s
CI / release (arm64, , ubuntu-latest-arm64) (push) Successful in 2m20s
CI / test (-DCMAKE_BUILD_TYPE=Debug, debug) (push) Successful in 3m27s
CI / test (-DCMAKE_CXX_FLAGS=-DUSE_64_BIT=1, 64-bit-versions) (push) Successful in 3m20s
CI / test (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc) (push) Successful in 3m16s
CI / test (-DUSE_SIMD_FALLBACK=ON, simd-fallback) (push) Successful in 3m21s
CI / release (amd64, -DMSAN_TOOLCHAIN_PATH=/opt/msan, ubuntu-latest-amd64) (push) Successful in 5m47s
CI / coverage (push) Successful in 3m54s
2026-07-23 15:16:58 -04:00
weaselbot 63f9a139da Fix undefined behavior on empty input in strinc() and prefixRange()
CI / pre-commit (pull_request) Successful in 2m5s
CI / release (arm64, ubuntu-latest-arm64) (pull_request) Successful in 3m29s
CI / test (-DCMAKE_BUILD_TYPE=Debug, debug) (pull_request) Successful in 3m34s
CI / test (-DCMAKE_CXX_FLAGS=-DUSE_64_BIT=1, 64-bit-versions) (pull_request) Successful in 3m28s
CI / test (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc) (pull_request) Successful in 3m38s
CI / test (-DUSE_SIMD_FALLBACK=ON, simd-fallback) (pull_request) Successful in 3m27s
CI / release (amd64, ubuntu-latest-amd64) (pull_request) Successful in 4m51s
CI / coverage (pull_request) Successful in 3m37s
strinc() in ConflictSet.cpp used std::string_view::size() (size_t) and subtracted 1 without first checking for an empty string. For the root node, getSearchPath() returns the empty string, so every debug correctness check underflowed size_t and relied on implementation-defined conversion to signed int.

prefixRange() in Bench.cpp had the same loop shape. Although TrivialSpan::size() returns int, on an empty (or all-0xff) key the function then asserted and continued executing, allocating a zero-length buffer and writing before its start.

Changes:
- In strinc(), initialize index as signed int(str.size()) - 1 so the loop is skipped for empty input, and return ok=false cleanly.
- In prefixRange(), initialize index the same way and call std::abort() after the assert so invalid input cannot fall through to an out-of-bounds write.
- Replace C-style uint8_t casts with explicit static_casts.

Closes #59
2026-06-29 13:52:02 -04:00
weaselbotandandrew 4dc5f7f75c Fix self-move-assignment and leak in ConflictSet move-assignment
CI / release (arm64, ubuntu-latest-arm64) (pull_request) Successful in 3m23s
CI / pre-commit (pull_request) Successful in 2m5s
CI / test (-DCMAKE_BUILD_TYPE=Debug, debug) (pull_request) Successful in 3m36s
CI / test (-DCMAKE_CXX_FLAGS=-DUSE_64_BIT=1, 64-bit-versions) (pull_request) Successful in 3m28s
CI / test (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc) (pull_request) Successful in 3m38s
CI / test (-DUSE_SIMD_FALLBACK=ON, simd-fallback) (pull_request) Successful in 3m28s
CI / release (amd64, ubuntu-latest-amd64) (pull_request) Successful in 4m53s
CI / coverage (pull_request) Successful in 3m38s
The user-declared move-assignment operator overwrote `impl` without first
destroying the existing implementation object, leaking all memory and resources
owned by the left-hand side. Self-move-assignment also set `impl` to nullptr,
leaving the object invalid and leaking the old state.

Fix all three implementations (ConflictSet.cpp, SkipList.cpp, HashTable.cpp)
to guard against self-assignment and to destroy/free the old `impl` before
taking ownership of `other.impl`.
2026-06-22 14:08:59 -04:00
andrew 3a82d90914 Work around arm64 clang codegen issues breaking CI
CI / build-image (arm64, ubuntu-latest-arm64) (push) Successful in 22s
CI / build-image (amd64, ubuntu-latest-amd64) (push) Successful in 42s
CI / pre-commit (push) Successful in 34s
CI / release (arm64, ubuntu-latest-arm64) (push) Failing after 1m7s
CI / test (-DCMAKE_BUILD_TYPE=Debug, debug) (push) Successful in 2m35s
CI / test (-DCMAKE_CXX_FLAGS=-DUSE_64_BIT=1, 64-bit-versions) (push) Successful in 2m27s
CI / test (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc) (push) Successful in 2m35s
CI / test (-DUSE_SIMD_FALLBACK=ON, simd-fallback) (push) Successful in 2m27s
CI / release (amd64, ubuntu-latest-amd64) (push) Failing after 2m32s
CI / coverage (push) Failing after 2m20s
Disable preserve_none under ASan on aarch64: every clang tested (20,
21, trunk 22) miscompiles the continuation chains with that
combination, crashing ~97% of fuzz corpus tests. The chains still work
with the default calling convention. See #38.

Mark the masked Node3 scan results defined for valgrind on aarch64:
clang 21+ lowers the in-bounds tests through flags+csel, which
memcheck models imprecisely, tainting bits the mask provably clears.
See #39.

Skip valgrind tests in the arm64 release job, since -DNVALGRIND
compiles out the client requests the workaround relies on.

Both issues track filing upstream bugs.
2026-06-12 16:35:57 -04:00
andrew 2642d453dc Remove unnecessary branch for interleaved range writes
Tests / 64 bit versions total: 8331, passed: 8331
Tests / Debug total: 8329, passed: 8329
Tests / SIMD fallback total: 8331, passed: 8331
Tests / Release [clang] total: 8331, passed: 8331
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / gcc total: 8331, passed: 8331
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [clang,aarch64] total: 5520, passed: 5520
Tests / Coverage total: 5571, passed: 5571
Code Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 97.75% (3080/3151) * Branch Coverage: 41.81% (18260/43676) * Complexity Density: 0.00 * Lines of Code: 3151 #### Quality Gates Summary Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good
2024-12-11 21:53:44 -08:00
andrew 7166811387 Fix condition checking for erasing the root
Tests / 64 bit versions total: 8331, passed: 8331
Tests / Debug total: 8329, passed: 8329
Tests / SIMD fallback total: 8331, passed: 8331
Tests / Release [clang] total: 8331, passed: 8331
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / gcc total: 8331, passed: 8331
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [clang,aarch64] total: 5520, passed: 5520
Tests / Coverage total: 5571, passed: 5571
Code Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 97.75% (3081/3152) * Branch Coverage: 41.81% (18261/43674) * Complexity Density: 0.00 * Lines of Code: 3152 #### Quality Gates Summary Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good
2024-11-21 17:49:54 -08:00
andrew 81323972aa Remove "memcpy common section to next node"
Do it in a simpler, more robust/type safe way
2024-11-21 16:47:05 -08:00
andrew 8694ba8b6a Remove unused field 2024-11-21 16:35:10 -08:00
andrew 0cea5565b5 Add artificial root parent and stop plumbing impl everywhere 2024-11-21 16:32:13 -08:00
andrew 972f16ed8f Remove Node::endOfRange
This should simplify storing leaves directly
2024-11-21 11:55:30 -08:00
andrew 2412684316 childMaxVersion memory needs to be defined
Tests / 64 bit versions total: 8220, passed: 8220
Tests / Debug total: 8218, passed: 8218
Tests / SIMD fallback total: 8220, passed: 8220
Tests / Release [clang] total: 8220, passed: 8220
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / gcc total: 8220, passed: 8220
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [clang,aarch64] total: 5446, passed: 5446
Tests / Coverage total: 5497, passed: 5497
Code Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 97.73% (3061/3132) * Branch Coverage: 41.68% (17736/42552) * Complexity Density: 0.00 * Lines of Code: 3132 #### Quality Gates Summary Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good
Also remove some dead code, and only memset children to 0 for Node256.
Other nodes detect absence of children other ways.
2024-11-21 10:35:05 -08:00
andrew 8251631087 Fix some unintentional generic usages of getChildAndMaxVersion 2024-11-20 21:50:48 -08:00
andrew 90fb2a9542 Remove some usages of generic getFirstChild 2024-11-20 21:43:47 -08:00
andrew 7c01f8ba0f Remove some usages of maxVersion 2024-11-20 21:24:59 -08:00
andrew 0df2db7f8a Remove some bad unlikely annotations found by -Wmisexpect
Using a profile from server_bench
2024-11-20 19:06:50 -08:00
andrew e125b599b5 Remove freeList, min/max capacity tracking
The freelist doesn't seem to get a good hit rate. Policies other than
capacity = minCapacity did not improve the rate we were resizing nodes,
but did increase memory usage, so get rid of that too. Add a
nodes_resized_total counter.
2024-11-20 14:45:56 -08:00
andrew 3f4d3b685a More valgrind annotations 2024-11-20 13:36:30 -08:00
andrew 4198b8b090 Some prep for leafs-in-parents 2024-11-20 12:20:11 -08:00
andrew 8757d2387c Call prefetch within TaggedNodePointer::getType
Instead of at every call site
2024-11-20 12:07:32 -08:00
andrew 4a22b95d53 Remove state machine transitions "from" Node0
Those aren't used
2024-11-20 11:46:45 -08:00
andrew 03d6c7e471 Allocate maxCapacity instead of minCapacity 2024-11-19 16:13:57 -08:00
andrew ceecc62a63 Disable freelist for macos
Tests / 64 bit versions total: 8220, passed: 8220
Tests / Debug total: 8218, passed: 8218
Tests / SIMD fallback total: 8220, passed: 8220
Tests / Release [clang] total: 8220, passed: 8220
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / gcc total: 8220, passed: 8220
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [clang,aarch64] total: 5446, passed: 5446
Tests / Coverage total: 5497, passed: 5497
Code Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 97.69% (3168/3243) * Branch Coverage: 42.25% (19291/45654) * Complexity Density: 0.00 * Lines of Code: 3243 #### Quality Gates Summary Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good
It's faster on my mac m1 without the freelist
2024-11-19 14:28:15 -08:00
andrew e5b9c03e77 Restore change that hurt codegen
I don't understand, but this is necessary for good codegen somehow
2024-11-18 14:29:55 -08:00
andrew ee5a84cd7b Remove dead stores
Tests / 64 bit versions total: 8220, passed: 8220
Tests / Debug total: 8218, passed: 8218
Tests / SIMD fallback total: 8220, passed: 8220
Tests / Release [clang] total: 8220, passed: 8220
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / gcc total: 8220, passed: 8220
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [clang,aarch64] total: 5446, passed: 5446
Tests / Coverage total: 5497, passed: 5497
Code Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 97.69% (3165/3240) * Branch Coverage: 42.26% (19263/45585) * Complexity Density: 0.00 * Lines of Code: 3240 #### Quality Gates Summary Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good
2024-11-15 17:03:29 -08:00
andrew 77262ee2d3 Fix some grammar in a comment
Tests / 64 bit versions total: 8220, passed: 8220
Tests / Debug total: 8218, passed: 8218
Tests / SIMD fallback total: 8220, passed: 8220
Tests / Release [clang] total: 8220, passed: 8220
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / gcc total: 8220, passed: 8220
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [clang,aarch64] total: 5446, passed: 5446
Tests / Coverage total: 5497, passed: 5497
Code Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 97.69% (3167/3242) * Branch Coverage: 42.26% (19269/45597) * Complexity Density: 0.00 * Lines of Code: 3242 #### Quality Gates Summary Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good
2024-11-15 16:47:31 -08:00
andrew 2777e016ff Be more consistent about TaggedNodePointer vs Node* 2024-11-15 16:30:05 -08:00
andrew 661ffcd843 Explain purpose for prefetches in getFirstChild 2024-11-15 16:29:42 -08:00
andrew 3a34d3cecb Minor style improvements 2024-11-15 16:29:17 -08:00
andrew 189c73e3bd Reduce Node3 size by 8 2024-11-15 15:53:18 -08:00
andrew f5ec9f726a Remove getFirstChildExists
Once we know the type, for Node3 and higher we know the first child
exists anyway
2024-11-15 13:05:11 -08:00
andrew 552fc11c5d Prefetch second child to improve scan performance 2024-11-15 12:45:01 -08:00
andrew 08958d4109 Remove the reverse step for saving scan search path 2024-11-14 16:27:25 -08:00
andrew b78e817e24 Only set HAS_AVX for x86_64
Tests / 64 bit versions total: 8097, passed: 8097
Tests / Debug total: 8095, passed: 8095
Tests / SIMD fallback total: 8097, passed: 8097
Tests / Release [clang] total: 8097, passed: 8097
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / gcc total: 8097, passed: 8097
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [clang,aarch64] total: 5366, passed: 5366
Tests / Coverage total: 5414, passed: 5414
Code Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 97.67% (3149/3224) * Branch Coverage: 42.26% (19259/45578) * Complexity Density: 0.00 * Lines of Code: 3224 #### Quality Gates Summary Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good
2024-11-12 18:16:30 -08:00
andrew 665a9313a4 Valgrind annotations for new free list 2024-11-12 18:11:09 -08:00
andrew a92271a205 Build with -Wunused-variable 2024-11-12 17:50:27 -08:00
andrew 0dbfb4deae Detect simd headers in c++ instead of cmake 2024-11-12 17:50:27 -08:00
andrew b37feb58dd Require musttail and preserve_none for interleaved 2024-11-12 17:50:27 -08:00
andrew f85b92f8db Improve next{Physical,Logical} codegen
Tests / 64 bit versions total: 7949, passed: 7949
Tests / Debug total: 7947, passed: 7947
Tests / SIMD fallback total: 7949, passed: 7949
Tests / Release [clang] total: 7949, passed: 7949
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [gcc] total: 7949, passed: 7949
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [clang,aarch64] total: 5268, passed: 5268
Tests / Coverage total: 5315, passed: 5315
Code Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 97.67% (3139/3214) * Branch Coverage: 42.05% (18734/44548) * Complexity Density: 0.00 * Lines of Code: 3214 #### Quality Gates Summary Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good
2024-11-09 13:21:36 -08:00
andrew 3c44614311 Allocate from freelist with min/max capacity constraints 2024-11-08 21:35:13 -08:00
andrew 9c1ac3702e Move index closer to start of Node{3,16}
This should slightly improve cache hit rate
2024-11-08 20:54:00 -08:00
andrew 4494359ca2 Make insert_iterations for interleaved writes more closely match
Tests / 64 bit versions total: 7949, passed: 7949
Tests / Debug total: 7947, passed: 7947
Tests / SIMD fallback total: 7949, passed: 7949
Tests / Release [clang] total: 7949, passed: 7949
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [gcc] total: 7949, failed: 2, passed: 7947
Tests / Release [clang,aarch64] total: 5268, passed: 5268
Tests / Coverage total: 5315, passed: 5315
weaselab/conflict-set/pipeline/head There was a failure building this commit
2024-11-04 14:46:30 -08:00
andrew 4eaad39294 Maintain capacity invariant strictly 2024-11-04 13:43:02 -08:00
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 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