redknightlois
## Goal Workload implementations that define what operations the benchmark generates, and key distribution strategies that control access patterns. ## Global invariants - This epic inherits the systemic architectural invariants from #13. - **Critical for this epic: SI-06 (mix sums to 100), SI-07 (fail fast on empty keyspace), SI-12 (atomic key generation), SI-14 (vector search requires Corax)** ## Related epics - #14 Load Generation Engine — the engine calls workloads in the hot path - #15 Transport Abstraction — workloads produce operation types consumed by transports - #18 Dataset Import Pipeline — dataset providers seed the keyspace that read/query workloads require - #20 Vector Datasets — vector workloads depend on pre-loaded vector data and metadata ## Architectural invariants - Every workload returns an operation subtype from `NextOperation`. The method is called from the load generator's hot path. - `WorkloadMix` enforces reads + writes + updates = 100 at construction using largest-remainder normalization. - Mixed workload falls through to a write when the keyspace is empty and a read/update is selected. - Read and query workloads reject construction with an empty keyspace — this is a client misconfiguration, not a server problem. - Vector search workload validates metadata, query vectors, topK, and similarity bounds at construction. - Three key distributions: uniform, zipfian (favors older keys), latest (80/20 hot-tail). All guard against empty keyspace. - Invalid profile-to-workload combinations are rejected at startup with the list of supported profiles.