Skip to content

Commit

Permalink
Merge pull request #630 from thompsonbry/art-iterator-ready-for-merge
Browse files Browse the repository at this point in the history
Adds scan support.
  • Loading branch information
laurynas-biveinis authored Jan 13, 2025
2 parents f896f77 + fe313aa commit 8acb4fb
Show file tree
Hide file tree
Showing 61 changed files with 5,668 additions and 353 deletions.
14 changes: 7 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ jobs:
- run:
name: Build
working_directory: build
command: make -j2
command: make -j2 -k
- run:
name: Examples
working_directory: build
command: make examples
command: make -k examples
- run:
name: Correctness test
working_directory: build
Expand All @@ -125,7 +125,7 @@ jobs:
- run:
name: Benchmark correctness test
working_directory: build
command: make quick_benchmarks
command: make -k quick_benchmarks
- when:
condition:
not:
Expand All @@ -139,7 +139,7 @@ jobs:
working_directory: build
command: |
sudo NEEDRESTART_MODE=a apt-get install -y valgrind
make valgrind
make -k valgrind
build-macos:
parameters:
Expand Down Expand Up @@ -187,11 +187,11 @@ jobs:
- run:
name: Build
working_directory: build
command: make -j3
command: make -j3 -k
- run:
name: Examples
working_directory: build
command: make examples
command: make -k examples
- run:
name: Correctness test
working_directory: build
Expand All @@ -206,7 +206,7 @@ jobs:
- run:
name: Benchmark correctness test
working_directory: build
command: make quick_benchmarks
command: make -k quick_benchmarks

workflows:
build:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -416,19 +416,19 @@ jobs:
- name: Build
working-directory: ${{github.workspace}}/build
run: make -j3
run: make -j3 -k
if: env.STATIC_ANALYSIS != 'ON' || env.COMPILER != 'clang'

- name: clang static analysis
working-directory: ${{github.workspace}}/build
run: |
/usr/bin/scan-build-19 --status-bugs -stats -analyze-headers \
--force-analyze-debug-code make -j3;
--force-analyze-debug-code make -j3 -k;
if: env.STATIC_ANALYSIS == 'ON' && env.COMPILER == 'clang'

- name: Examples
working-directory: ${{github.workspace}}/build
run: make examples
run: make -k examples
if: env.STATIC_ANALYSIS != 'ON' && env.COVERAGE != 'ON'

- name: Correctness test
Expand All @@ -438,20 +438,20 @@ jobs:

- name: Benchmark correctness test
working-directory: ${{github.workspace}}/build
run: make quick_benchmarks
run: make -k quick_benchmarks
if: env.STATIC_ANALYSIS != 'ON' && env.COVERAGE != 'ON'

- name: DeepState 1 minute fuzzing
working-directory: ${{github.workspace}}/build
run: make -j2 deepstate_1m
run: make -j2 -k deepstate_1m
if: >
env.STATIC_ANALYSIS != 'ON' && env.COVERAGE != 'ON'
&& (runner.os != 'macOS'
|| (env.SANITIZE_ADDRESS == 'OFF' && env.SANITIZE_THREAD == 'OFF'))
- name: DeepState libfuzzer 1 minute fuzzing
working-directory: ${{github.workspace}}/build
run: make -j2 deepstate_lf_1m
run: make -j2 -k deepstate_lf_1m
if: >
env.STATIC_ANALYSIS != 'ON' && env.COVERAGE != 'ON'
&& env.COMPILER == 'clang' && env.BUILD_TYPE != 'Release'
Expand All @@ -462,7 +462,7 @@ jobs:
run: |
sudo apt-get install -y libc6-dbg
sudo snap install --classic valgrind
make valgrind
make -k valgrind
if: >
env.SANITIZE_ADDRESS != 'ON' && env.SANITIZE_THREAD != 'ON'
&& env.SANITIZE_UB != 'ON' && env.STATIC_ANALYSIS != 'ON'
Expand All @@ -471,7 +471,7 @@ jobs:
- name: Gather coverage data
working-directory: ${{github.workspace}}/build
run: |
make -j3 coverage
make -j3 -k coverage
if: env.COVERAGE == 'ON'

- name: Upload coverage data
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/experimental-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ jobs:
- name: Build
working-directory: ${{github.workspace}}/build
run: make -j3
run: make -j3 -k
continue-on-error: true
8 changes: 4 additions & 4 deletions .github/workflows/old-compilers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -528,26 +528,26 @@ jobs:
- name: Build
working-directory: ${{github.workspace}}/build
run: make -j3
run: make -j3 -k

- name: Examples
working-directory: ${{github.workspace}}/build
run: make examples
run: make -k examples

- name: Correctness test
working-directory: ${{github.workspace}}/build
run: ctest -j3 -V

- name: Benchmark correctness test
working-directory: ${{github.workspace}}/build
run: make quick_benchmarks
run: make -k quick_benchmarks

- name: Valgrind test
working-directory: ${{github.workspace}}/build
run: |
sudo apt-get install -y libc6-dbg
sudo snap install --classic valgrind
make valgrind
make -k valgrind
if: >
env.SANITIZE_ADDRESS != 'ON' && env.SANITIZE_THREAD != 'ON'
&& env.SANITIZE_UB != 'ON'
8 changes: 4 additions & 4 deletions .github/workflows/ubuntu-20.04.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,26 +230,26 @@ jobs:
- name: Build
working-directory: ${{github.workspace}}/build
run: make -j3
run: make -j3 -k

- name: Examples
working-directory: ${{github.workspace}}/build
run: make examples
run: make -k examples

- name: Correctness test
working-directory: ${{github.workspace}}/build
run: ctest -j3 -V

- name: Benchmark correctness test
working-directory: ${{github.workspace}}/build
run: make quick_benchmarks
run: make -k quick_benchmarks

- name: Valgrind test
working-directory: ${{github.workspace}}/build
run: |
sudo apt-get install -y libc6-dbg
sudo snap install --classic valgrind
make valgrind
make -k valgrind
if: >
env.SANITIZE_ADDRESS != 'ON' && env.SANITIZE_THREAD != 'ON'
&& env.SANITIZE_UB != 'ON'
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,9 @@
# MSVC
/.vs
/out

**/*~
**/*#*

run-cmake.sh
loop-test.sh
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,11 @@ All the declarations live in the `unodb` namespace, which is omitted in the
descriptions below.

The only currently supported key type is `std::uint64_t`, aliased as `key`. To
add new key types, instantiate `art_key` type with the desired type, and
specialize `art_key::make_binary_comparable` according to the ART paper.
add a new simple key type, instantiate `art_key` type with the desired type, and
specialize `art_key::make_binary_comparable` according to the ART paper. Compound
keys or Unicode data should be handled by specifying gsl::span<std::byte> as the
key type. In this case, the application must provide a span suitably encoded for
lexicographic comparisons (that is, one which is already binary compatible).

Values are treated opaquely. For `unodb::db`, they are passed as non-owning
objects of `value_view` (a `gsl::span<std::byte>`), and insertion copies them
Expand All @@ -144,6 +147,11 @@ All ART classes share the same API:
* `clear()` empties the tree. For `olc_db`, it must be called from a
single-threaded context.
* `bool empty()` returns whether the tree is empty.
* `template <FN> scan(), scan_from(...), scan_range()` a family of
scan methods, including forward and reverse scans and scans with a
from_key and an exclusive upper bound to_key where fn is a lambda
accepting a visitor and returning a bool indicating whether the scan
should halt (bool halt). See `examples/examples_art.cpp`.
* `void dump(std::ostream &)` outputs the tree representation.
* Several getters provide tree info, such as current memory use, and internal
operation counters (e.g. number of times Node4 grew to Node16, key prefix was
Expand Down
Loading

0 comments on commit 8acb4fb

Please sign in to comment.