fix(data): level-per-emission pyramid cover, relaxed-atomic ring slots
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.
This commit is contained in:
1 parent
138fa478c3
commit
d9909f2115
8 files changed
+190
-38
No files matched your search
@@ -22,6 +22,11 @@ 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()
|
||||
Reference in new issue
Block a user