Commit ce93a25
Feature/define visited places cache (#12)
* feat: implement Visited Places cache with initial project structure and dependencies; docs were updated to describe new VPC;
refactor: update benchmarks for cache performance evaluation;
refactor: refactor rebalance decision logic and diagnostics interface;
test: refactor unit tests for cache interaction and diagnostics;
chore: update project files for new cache implementation
* feat(visited-places): implement Visited Places cache with data generation helpers and test data sources;
chore: add project files for Visited Places cache and its tests;
refactor: remove unused caching references from various files
* refactor(eviction): unify just-stored segment handling and improve eviction logic;
refactor(evaluators): consolidate eviction count computation methods;
refactor(scheduler): enhance event channel capacity configuration options;
docs: update comments and documentation for clarity and accuracy;
* refactor(SnapshotAppendBufferStorage): move configuration value to settings
* refactor(eviction): update eviction policies and selectors for improved clarity and functionality;
feat(eviction): introduce new eviction selectors and policies for enhanced cache management;
docs: update documentation to reflect changes in eviction strategy and cache structure;
test: add unit tests for new eviction policies and selectors
* refactor(eviction): remove unnecessary statistics from CachedSegment initialization;
feat(eviction): introduce IEvictionMetadata interface for selector-owned metadata;
test: update tests to reflect changes in segment metadata handling;
docs: update documentation to describe new eviction metadata structure;
* refactor(eviction): update pressure classes to use nested types for clarity and consistency;
refactor(eviction): improve documentation for pressure produced by policies
* refactor(eviction): enhance SmallestFirstEvictionSelector with cached span metadata; add tests for metadata initialization and ordering fallback
* refactor(eviction): implement sampling-based eviction strategy for selectors; update selector interfaces and metadata handling
* refactor(eviction): update metadata handling in eviction selectors; simplify interface and clarify metadata requirements
* refactor(eviction): simplify pressure evaluation logic in BackgroundEventProcessor
* refactor(eviction): add TODO comment regarding sync method behavior with task-based scheduler
* refactor(visited-places-cache): update constructor parameters to suggest configuration in options
* refactor(visited-places-cache): update storage strategy options to use typed configuration objects;
refactor(visited-places-cache): simplify cache options handling for storage strategies;
refactor(visited-places-cache): remove unused using directives from cache-related files;
refactor(storage-strategy-options): introduce new storage strategy options classes for better configuration management;
refactor(tests): update tests to accommodate changes in storage strategy options
* refactor(visited-places-cache): update constructor documentation to clarify usage of builder API
* refactor(eviction): encapsulate eviction policy lifecycle and evaluation logic in a dedicated evaluator class;
refactor(eviction): simplify null checks using ArgumentNullException.ThrowIfNull;
refactor(eviction): update BackgroundEventProcessor to use the new EvictionPolicyEvaluator;
refactor(eviction): enhance MaxTotalSpanPolicy to implement stateful behavior;
refactor(eviction): improve documentation for eviction policies and their lifecycle methods;
refactor(eviction): add unit tests for EvictionPolicyEvaluator and stateful policies
* refactor(eviction): encapsulate eviction logic within a new EvictionEngine class; update BackgroundEventProcessor to utilize the engine for metadata management, policy evaluation, and eviction execution
* refactor(cache-normalization): rename BackgroundEventProcessor to CacheNormalizationExecutor; update related diagnostics and documentation
* chore: update xunit.runner.visualstudio package version to 2.8.2 in test projects
* refactor(eviction): improve XML documentation formatting in EvictionPolicyEvaluator and UserRequestHandler
* refactor(eviction): remove unnecessary timestamp parameters from metadata methods
* fix: ensure ThreadPool execution via Task.Yield() in ChainExecutionAsync;
docs: update documentation for clarity
* refactor(work-scheduler): remove unnecessary comments regarding Func usage
* refactor(diagnostics): rename ICacheDiagnostics to IVisitedPlacesCacheDiagnostics and update related references;
fix(diagnostics): ensure background operation failure events are correctly reported;
refactor: update diagnostics handling in various components to use new interface
* refactor(eviction): improve XML documentation formatting in EvictionEngine
* refactor(data-sources): replace List with Array for data generation methods;
refactor(diagnostics): remove unused using directives from diagnostics files;
* refactor(UserRequestHandler): optimize memory handling by using IEnumerable instead of IList
* refactor(UserRequestHandler): optimize memory usage by utilizing IEnumerable for segment assembly
* refactor(UserRequestHandler): improve data assembly by utilizing RangeData sources and optimizing memory usage
* refactor(UserRequestHandler): optimize data handling by replacing List with Array and improving memory allocation
* refactor(UserRequestHandler): optimize memory allocations by reducing array allocations in data processing
* refactor(UserRequestHandler): optimize memory allocations by utilizing ArrayPool for buffer management and replacing List with IEnumerable for gap computation
* feat(ttl): implement TTL expiration for cached segments with diagnostics;
refactor: enhance diagnostics for TTL events and segment removal;
refactor: update cache options to support segment TTL configuration;
test: add unit tests for TTL expiration behavior and idempotency
* docs: update diagnostics documentation with execution context and threading details;
refactor: improve diagnostic hooks implementation guidelines and context annotations
* refactor: rename TaskBasedWorkScheduler and ChannelBasedWorkScheduler to UnboundedSerialWorkScheduler and BoundedSerialWorkScheduler respectively; update documentation and references throughout the codebase
* feat(scheduler): implement bounded and unbounded serial work schedulers with backpressure control and task chaining;
test: add unit tests for ConcurrentWorkScheduler functionality and lifecycle
* refactor(TtlExpirationWorkItem): replace private cancellation token field with public property
* refactor(VisitedPlacesCache): replace cancellation token cancellation with asynchronous method
* refactor: diagnostics interfaces have been updated to include new caching infrastructure;
refactor: work scheduler interfaces have been introduced for serialization and supersession semantics;
refactor: caching classes have been modified to utilize new work scheduler interfaces;
* refactor(TtlEngine): encapsulate TTL subsystem and simplify CacheNormalizationExecutor integration; update diagnostics and disposal logic
* fix: update imports to include new scheduling infrastructure components
* refactor(CacheNormalizationExecutor): simplify eviction candidate selection logic; update policies to maintain internal state; enhance storage interaction in eviction selectors
* refactor: update segment removal methods to use TryRemove and TryGetRandomSegment; improve documentation for eviction logic
* refactor: extract common logic into SegmentStorageBase; simplify segment management in LinkedListStrideIndexStorage and SnapshotAppendBufferStorage
* refactor: improve segment intersection logic and enhance documentation for stride index operations; unify binary search accessors for segment retrieval
* feat: concrete eviction types have been made public; refactor: NoOp stubs have been removed from WasmValidation in favor of real implementations; ci: monolithic workflow has been split into SWC-specific and VPC-specific workflows; feat: VPC WasmValidation project has been added; docs: AGENTS.md has been updated to reflect public eviction API and dual CI/CD workflows
* docs: AGENTS.md has been updated with code style guidelines for braces and commit policy
* refactor: update paths for SlidingWindow and VisitedPlaces projects in CI/CD scripts and configuration files; improve local CI/CD testing script for clarity and organization
* docs: code comments have been enhanced for clarity and allocation notes;
refactor: lazy initialization has been implemented for result lists to reduce allocations;
refactor: memory allocation patterns have been optimized in various storage classes
* refactor: optimize gap computation logic to eliminate closure allocations; improve test strategy creation for clarity
* refactor: allocation strategy for hittingRangeData and merged sources has been optimized; ArrayPool usage has been removed for small arrays; documentation has been updated for clarity
* refactor: segment lifecycle notification methods have been updated for clarity and consistency; OnSegmentsRemoved has been replaced with OnSegmentRemoved for individual segment notifications
* refactor: improve linked list node unlinking logic for thread safety and clarity; enhance comments for better understanding
* refactor: code comments have been enhanced for clarity and consistency across multiple files
* refactor: improve package creation error handling and logging for clarity; update documentation references for VisitedPlaces
* refactor: remove core project build and pack steps from CI workflows; update project references to use PrivateAssets
* refactor: async methods have been updated to use BuildAsync for cache initialization; validation for bounded ranges has been added
* refactor: code comments have been improved for clarity and consistency in IEvictionMetadata
* docs: update diagnostics and glossary for VisitedPlaces cache; add architecture and test infrastructure documentation
* docs: architecture documentation has been updated for clarity and accuracy; glossary terms have been refined
* docs: architecture documentation has been enhanced for clarity and detail; cache behavior explanations have been refined;
refactor: code comments have been improved for consistency and clarity across multiple files; unnecessary remarks have been removed;
* docs: agent guidelines have been updated for clarity and conciseness; build and test commands have been streamlined
* docs: infrastructure and architecture documentation have been updated for clarity on task scheduling mechanisms; cache behavior explanations have been refined
* feat: shared infrastructure for data generation has been introduced; cache data extension service has been renamed to cache data extender; disposal state management has been refactored for concurrency safety
* refactor: unused using directives have been removed from several files; new test data sources have been introduced for boundary handling and exception testing
* refactor: eviction policy lifecycle has been clarified and improved for thread safety; cache layer initialization has been enhanced for better readability; exception handling during cache building has been refined
* refactor: activity counter management has been improved for thread safety; NaN checks have been added for cache size and threshold parameters; TOCTOU race conditions have been mitigated in caching mechanisms
* style: spacing in array spread syntax has been corrected
* feat(benchmarks): performance benchmarks for caching mechanisms have been introduced; benchmark runner has been implemented; synchronous and slow data sources have been added for testing; construction benchmarks for layered cache have been created
* feat(storage): AddRange method has been introduced for bulk segment insertion; CacheNormalizationRequest has been updated to support multiple fetched chunks; documentation for AddRange has been added; tests for AddRange functionality have been implemented
* feat(benchmarks): multiple gaps and single gap partial hit benchmarks have been introduced for VisitedPlaces cache; CacheMissBenchmarks have been updated for improved parameterization; README has been updated to reflect new benchmark files and cases
* feat(cache): TTL expiration handling has been integrated into normalization process; diagnostics for expired segments have been updated; time provider has been introduced for deterministic testing; documentation has been revised to reflect changes
* fix(cache): eviction logic has been corrected to ensure segments are only removed if present
* refactor(cache): CacheNormalizationExecutor has been simplified by removing the TDomain type parameter; related tests have been updated accordingly
* refactor(cache): expiration check logic has been streamlined to remove expired segments directly
* refactor(storage): Add and AddRange methods have been replaced with TryAdd and TryAddRange for overlap checks;
test: unit tests for TryAdd and TryAddRange methods have been updated accordingly
* refactor(cache): segment removal logic has been updated to use TryRemove; documentation has been clarified for segment storage invariants
* chore: benchmark tests for VPC have been planned; code formatting has been improved
* docs: documentation has been updated to reflect TryRemove semantics and TTL normalization changes; refactor(storage): segment removal logic has been updated to use TryRemove with idempotent removal; refactor(builder): Build method has been restricted to single use per builder instance; refactor: linked list storage synchronization has been clarified and structural mutations have been guarded; refactor: SnapshotReadStorage read path has been optimized for consistency; test: SlidingWindowCacheBuilder tests have been updated to verify single-use restriction; test: SegmentStorageBaseTests naming has been clarified for intra-batch overlap behavior
* docs: XML documentation has been streamlined for clarity and consistency;
refactor: parameter descriptions in various classes have been simplified;
refactor: remarks and comments have been cleaned up for better readability.
* refactor(cache): GetDataAndWaitForIdleAsync has been replaced with GetDataAsync for improved performance; documentation has been updated to clarify event channel capacity requirements
* feat(cache): FrozenDataSource and FrozenYieldingDataSource have been introduced for improved caching performance; learning pass has been implemented in benchmarks to ensure data sources are pre-learned before measurements.
* feat(benchmarks): benchmark classes have been renamed for clarity and consistency; new eventual and strong consistency benchmarks for cache hits and misses have been added
* refactor(benchmarks): layout constants and factory methods have been streamlined for clarity; learning pass logic has been centralized for improved maintainability; cache setup methods have been standardized across benchmark classes
* chore: old project with benchmarks was removed
* feat(benchmarks): new benchmark reports for layered and visited places caching scenarios have been added
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Mykyta Zotov <mykyta.zotov@ihsmarkit.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>1 parent af912bb commit ce93a25
337 files changed
Lines changed: 35311 additions & 13881 deletions
File tree
- .github
- workflows
- benchmarks/Intervals.NET.Caching.Benchmarks
- Benchmarks
- Infrastructure
- Layered
- Results
- SlidingWindow
- VisitedPlaces
- Base
- docs
- components
- sliding-window
- components
- visited-places
- components
- src
- Intervals.NET.Caching.SlidingWindow.WasmValidation
- Intervals.NET.Caching.SlidingWindow
- Core
- Planning
- Rebalance
- Decision
- Execution
- Intent
- State
- UserPath
- Infrastructure
- Adapters
- Storage
- Public
- Cache
- Configuration
- Extensions
- Instrumentation
- Intervals.NET.Caching.VisitedPlaces.WasmValidation
- Intervals.NET.Caching.VisitedPlaces
- Core
- Background
- Eviction
- Policies
- Pressure
- Selectors
- UserPath
- Infrastructure
- Adapters
- Storage
- Public
- Cache
- Configuration
- Extensions
- Instrumentation
- Intervals.NET.Caching.WasmValidation
- Intervals.NET.Caching
- Core
- Planning
- Rebalance/Execution
- State
- Dto
- Extensions
- Infrastructure
- Concurrency
- Diagnostics
- Scheduling
- Base
- Serial
- Supersession
- Storage
- Layered
- Public
- Cache
- Configuration
- Extensions
- Instrumentation
- tests
- Intervals.NET.Caching.SlidingWindow.Integration.Tests
- Intervals.NET.Caching.SlidingWindow.Invariants.Tests
- Intervals.NET.Caching.SlidingWindow.Tests.Infrastructure
- DataSources
- Helpers
- Intervals.NET.Caching.SlidingWindow.Unit.Tests
- Core/State
- Infrastructure
- Concurrency
- Extensions
- Storage
- TestInfrastructure
- Public
- Cache
- Configuration
- Extensions
- Instrumentation
- Intervals.NET.Caching.Unit.Tests
- Infrastructure/Concurrency
- Public/Cache
- Intervals.NET.Caching.VisitedPlaces.Integration.Tests
- Intervals.NET.Caching.VisitedPlaces.Invariants.Tests
- Intervals.NET.Caching.VisitedPlaces.Tests.Infrastructure
- DataSources
- Helpers
- Intervals.NET.Caching.VisitedPlaces.Unit.Tests
- Core
- Eviction
- Policies
- Pressure
- Selectors
- Public
- Cache
- Configuration
- Extensions
- Instrumentation
- Storage
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
16 | 25 | | |
17 | 26 | | |
18 | 27 | | |
19 | 28 | | |
20 | 29 | | |
21 | | - | |
| 30 | + | |
22 | 31 | | |
23 | | - | |
| 32 | + | |
24 | 33 | | |
25 | 34 | | |
26 | 35 | | |
| |||
30 | 39 | | |
31 | 40 | | |
32 | 41 | | |
33 | | - | |
| 42 | + | |
34 | 43 | | |
35 | | - | |
| 44 | + | |
36 | 45 | | |
37 | 46 | | |
38 | 47 | | |
| |||
41 | 50 | | |
42 | 51 | | |
43 | 52 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
49 | 70 | | |
50 | 71 | | |
51 | 72 | | |
52 | | - | |
| 73 | + | |
53 | 74 | | |
54 | 75 | | |
55 | 76 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
61 | 82 | | |
62 | 83 | | |
63 | 84 | | |
64 | | - | |
| 85 | + | |
65 | 86 | | |
66 | 87 | | |
67 | 88 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
73 | 94 | | |
74 | 95 | | |
75 | 96 | | |
76 | | - | |
| 97 | + | |
77 | 98 | | |
78 | 99 | | |
79 | 100 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
85 | 106 | | |
86 | 107 | | |
87 | 108 | | |
88 | | - | |
| 109 | + | |
89 | 110 | | |
90 | 111 | | |
91 | 112 | | |
92 | | - | |
93 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
94 | 151 | | |
95 | 152 | | |
96 | 153 | | |
| |||
103 | 160 | | |
104 | 161 | | |
105 | 162 | | |
106 | | - | |
107 | | - | |
| 163 | + | |
| 164 | + | |
108 | 165 | | |
109 | 166 | | |
110 | 167 | | |
111 | | - | |
112 | | - | |
113 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
114 | 171 | | |
115 | 172 | | |
116 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
117 | 179 | | |
118 | | - | |
| 180 | + | |
119 | 181 | | |
120 | 182 | | |
121 | 183 | | |
122 | 184 | | |
123 | 185 | | |
124 | 186 | | |
125 | | - | |
| 187 | + | |
126 | 188 | | |
127 | 189 | | |
128 | 190 | | |
| |||
135 | 197 | | |
136 | 198 | | |
137 | 199 | | |
138 | | - | |
139 | | - | |
| 200 | + | |
| 201 | + | |
140 | 202 | | |
141 | 203 | | |
Lines changed: 44 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
15 | | - | |
16 | | - | |
17 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
18 | 26 | | |
19 | 27 | | |
20 | 28 | | |
21 | 29 | | |
22 | 30 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
28 | 36 | | |
29 | 37 | | |
30 | 38 | | |
31 | 39 | | |
32 | | - | |
| 40 | + | |
33 | 41 | | |
34 | 42 | | |
35 | 43 | | |
36 | | - | |
| 44 | + | |
37 | 45 | | |
38 | 46 | | |
39 | 47 | | |
40 | 48 | | |
41 | | - | |
| 49 | + | |
42 | 50 | | |
43 | 51 | | |
44 | | - | |
| 52 | + | |
45 | 53 | | |
46 | 54 | | |
47 | | - | |
| 55 | + | |
48 | 56 | | |
49 | 57 | | |
50 | 58 | | |
51 | | - | |
| 59 | + | |
52 | 60 | | |
53 | | - | |
| 61 | + | |
54 | 62 | | |
55 | | - | |
| 63 | + | |
56 | 64 | | |
57 | 65 | | |
58 | | - | |
| 66 | + | |
59 | 67 | | |
60 | 68 | | |
61 | | - | |
| 69 | + | |
62 | 70 | | |
63 | 71 | | |
64 | | - | |
| 72 | + | |
65 | 73 | | |
66 | 74 | | |
67 | 75 | | |
| |||
76 | 84 | | |
77 | 85 | | |
78 | 86 | | |
79 | | - | |
| 87 | + | |
80 | 88 | | |
81 | 89 | | |
82 | 90 | | |
83 | | - | |
| 91 | + | |
84 | 92 | | |
85 | 93 | | |
86 | 94 | | |
87 | 95 | | |
88 | | - | |
| 96 | + | |
89 | 97 | | |
90 | | - | |
91 | | - | |
92 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
93 | 101 | | |
94 | | - | |
95 | | - | |
| 102 | + | |
| 103 | + | |
96 | 104 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
101 | 109 | | |
102 | 110 | | |
103 | 111 | | |
104 | | - | |
| 112 | + | |
105 | 113 | | |
0 commit comments