OMC-24 v3.0.0 — remove PredictiveDictionary, QueueDictionary, DequeDictionary - #15
Conversation
…e.Build, 43x Digest.Quantile
…queDictionary
Three Hybrid types whose value-props don't justify their existence after
the v2.x curation pass:
- PredictiveDictionary (259 LOC): n-gram pattern recognition + caller-
driven PrefetchLikely. Even after the scope-narrowing in v2.0, the
value prop remained fuzzy — caller still had to wire prefetch with a
factory, and any workload predictable enough to benefit can be served
by `Dictionary<K,V>` + a domain-specific predictor.
- QueueDictionary: thin wrapper over `Queue<KeyValuePair<K,V>>` +
`Dictionary<K,V>` synchronized. The library was saving consumers ~30
lines of bookkeeping. Not load-bearing capability.
- DequeDictionary: same shape — wrapper over `LinkedList<T>` +
`Dictionary<K, LinkedListNode<T>>`. Same cost/value profile as
QueueDictionary.
What remains (29 types, 6 Hybrid):
Hybrid: BoundedDictionary, LinkedDictionary, CounterDictionary (LFU),
GraphDictionary, LinkedMultiMap, ConcurrentLinkedDictionary
Other categories: Linear (6), Spatial (6), Probabilistic (5),
Grid (3), Reactive (2), Temporal (1)
Public API breaking change → major version bump v2.1.1 -> v3.0.0.
Files removed:
- src/Omni.Collections.Hybrid/{PredictiveDictionary,QueueDictionary}/*
- src/Omni.Collections.Hybrid/DequeDictionary.cs
- src/Omni.Collections.Tests/Hybrid/{Predictive,Queue,Deque}DictionaryTests.cs
- src/Omni.Collections.Benchmarks/Hybrid/{Predictive,Queue,Deque}DictionaryBenchmarks.cs
- 84 lines from src/Omni.Collections.Hybrid/PublicAPI.Shipped.txt
README updates:
- Header tagline: 32 -> 29 types
- Hybrid section: 9 -> 6 types, list updated
- 3 per-type subsections removed
- §5 Complexity reference: 3 rows removed
- New "v2.x -> v3.0 migration" section with drop-in replacements
Tests: 1374 net8 / 1345 net6 (was 1526/1497; -152 from cut tests).
All green.
There was a problem hiding this comment.
Code Review
This pull request marks the release of version 3.0.0 by removing three hybrid collection types: PredictiveDictionary, QueueDictionary, and DequeDictionary. The update includes a migration guide in the README and the removal of all associated source code, benchmarks, and unit tests. Feedback was provided to improve the migration guide's accuracy by correctly specifying the generic types for the recommended DequeDictionary replacement.
| |---|---| | ||
| | `PredictiveDictionary<K,V>` | `Dictionary<K,V>` + your own n-gram predictor (the v2.x type was 259 LOC of pattern bookkeeping over a plain dict, with no automatic prefetch — the predictor logic is small enough to inline where you need it) | | ||
| | `QueueDictionary<K,V>` | `Queue<KeyValuePair<K,V>>` + `Dictionary<K,V>` kept in sync (≈30 lines of wrapper) | | ||
| | `DequeDictionary<K,V>` | `LinkedList<T>` + `Dictionary<K, LinkedListNode<T>>` kept in sync (≈30 lines of wrapper) | |
There was a problem hiding this comment.
The replacement description for DequeDictionary<K,V> uses an undefined generic parameter T. To maintain consistency with the QueueDictionary entry above and accurately describe the BCL types required for a performant keyed deque replacement (where the dictionary maps to list nodes to allow O(1) removal), it should use KeyValuePair<K,V>.
| | `DequeDictionary<K,V>` | `LinkedList<T>` + `Dictionary<K, LinkedListNode<T>>` kept in sync (≈30 lines of wrapper) | | |
| | `DequeDictionary<K,V>` | `LinkedList<KeyValuePair<K,V>>` + `Dictionary<K, LinkedListNode<KeyValuePair<K,V>>>` kept in sync (≈30 lines of wrapper) | |
) Gemini flagged the v2->v3 migration row for DequeDictionary using a bare 'T' where K/V were the actual generic parameters. Updated to 'LinkedList<KeyValuePair<K,V>>' + 'Dictionary<K, LinkedListNode<KeyValuePair<K,V>>>' matching the QueueDictionary row's style, with a note that the dictionary maps to list nodes for O(1) removal.
|
Fixed in |
Summary
v3.0.0 cull. Removes three Hybrid types whose value-props didn't justify their existence after the v2.x curation pass:
PredictiveDictionary,QueueDictionary,DequeDictionary.Library count: 32 → 29. Hybrid: 9 → 6.
What's removed and why
PrefetchLikely(context, factory). Any workload predictable enough to benefit can be served byDictionary<K,V>+ a domain-specific predictor. The value prop remained fuzzy even after the v2.0 scope-narrowing.Queue<KeyValuePair<K,V>>+Dictionary<K,V>synchronized. Saves consumers ~30 lines of bookkeeping. Not load-bearing capability — convenience layer that doesn't earn a top-level type.LinkedList<T>+Dictionary<K, LinkedListNode<T>>synchronized. Same cost/value profile.What remains (Hybrid, 6 types)
Each has a distinct, defensible value prop with no BCL equivalent:
BoundedDictionary— bounded eviction (FIFO order)LinkedDictionary— LRU access-orderCounterDictionary— LFU frequency tracking + top-KGraphDictionary— graph topology + value storeLinkedMultiMap— multi-value (one key → ordered list)ConcurrentLinkedDictionary— thread-safe LRUMigration
PredictiveDictionary<K,V>Dictionary<K,V>+ your own n-gram predictorQueueDictionary<K,V>Queue<KeyValuePair<K,V>>+Dictionary<K,V>(≈30 lines of wrapper)DequeDictionary<K,V>LinkedList<T>+Dictionary<K, LinkedListNode<T>>(≈30 lines of wrapper)If anyone needs the v2.x source as a starting point, it's preserved in git history under
phase-8-cull-3~1.No other public-API changes between v2.1.x and v3.0.0.
What changed
Test status
Down from 1526/1497 — the 152 deletions are tests for the cut types. No regressions elsewhere.
Targeting
Base =
dev/omni-collections-v2, mirroring prior pattern. After merge: bump already inDirectory.Build.props, merge dev → main, tagv3.0.0, push tag → publish workflow auto-fires.