cover_buckets chose one level per pass, so an odd first whole bucket (half of all measurement ranges) never reached a level above 0 and folded every remaining bucket at level 0 -- 15624 entries for a 1e6-sample pyramid. Pick the largest aligned, in-range, materialised level at each cursor instead; the new cost test counts folded entries through a PLOT_PYRAMID_COUNT_COVERS-only hook (absent from normal builds) and fails on the old body. Ring slots are now relaxed std::atomic: overwrite-on-full means the producer reuses the slot of a snapshot's oldest sample while the consumer reads it, which was a data race, not just a stale value. copy_from loads explicitly instead of std::copy; push stays lock-free. A new producer/consumer case is the one TSan flags without this. Also extends the wrapped-window test with x0/bounds/pyramid/sum/sumsq/gather checks, and corrects the StreamSeries threading note to the sample-count bound.
33 lines
1.0 KiB
CMake
33 lines
1.0 KiB
CMake
cmake_minimum_required(VERSION 3.24)
|
|
project(plot VERSION 0.1.0 LANGUAGES CXX)
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
|
include(plot_options)
|
|
|
|
add_library(plot_core
|
|
src/core/status.cpp
|
|
src/math/transform.cpp
|
|
src/data/minmax_pyramid.cpp
|
|
src/data/series.cpp
|
|
src/data/array_series.cpp
|
|
src/data/stream_series.cpp
|
|
src/gl/loader.cpp
|
|
src/gl/handle.cpp
|
|
)
|
|
add_library(plot::core ALIAS plot_core)
|
|
|
|
target_include_directories(plot_core PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
|
target_compile_features(plot_core PUBLIC cxx_std_20)
|
|
target_link_libraries(plot_core PRIVATE ${CMAKE_DL_LIBS})
|
|
plot_apply_warnings(plot_core)
|
|
|
|
if(PLOT_BUILD_TESTS)
|
|
# Test-only: counts the pyramid's covering-decomposition entries so a test can
|
|
# pin its O(log n) cost, which no query answer reveals. Off in every non-test
|
|
# build (see include/plot/data/detail/cover_count.hpp).
|
|
target_compile_definitions(plot_core PRIVATE PLOT_PYRAMID_COUNT_COVERS)
|
|
|
|
enable_testing()
|
|
add_subdirectory(tests)
|
|
endif()
|