feat: new router and benchmark setup

This commit is contained in:
2026-04-16 14:23:53 +08:00
parent c86d931d8f
commit 996511f300
35 changed files with 1480 additions and 76 deletions

View File

@@ -59,39 +59,39 @@ pub struct CacheAffinityRouter {
}
impl CacheAffinityRouter {
pub fn new(load_alpha: f64) -> Self {
pub fn new(load_alpha: f64, fingerprint_k: usize) -> Self {
Self {
name: "cache_affinity",
load_alpha,
l0_gamma: 1.0,
meta_delta: 0.25,
fingerprint_k: 4,
fingerprint_k: fingerprint_k.max(1),
use_rendezvous: true,
}
}
/// Ablation: cache_score-style weights (γ=0.1, δ=0) but keep rendezvous
/// tiebreak. Isolates the contribution of deterministic sticky placement.
pub fn weak_with_rendezvous(load_alpha: f64) -> Self {
pub fn weak_with_rendezvous(load_alpha: f64, fingerprint_k: usize) -> Self {
Self {
name: "cache_affinity_weak_rend",
load_alpha,
l0_gamma: 0.1,
meta_delta: 0.0,
fingerprint_k: 4,
fingerprint_k: fingerprint_k.max(1),
use_rendezvous: true,
}
}
/// Ablation: strong cache weights (γ=1.0, δ=0.25) but first-found tiebreak
/// instead of rendezvous. Isolates the contribution of reweighting alone.
pub fn strong_no_rendezvous(load_alpha: f64) -> Self {
pub fn strong_no_rendezvous(load_alpha: f64, fingerprint_k: usize) -> Self {
Self {
name: "cache_affinity_strong_only",
load_alpha,
l0_gamma: 1.0,
meta_delta: 0.25,
fingerprint_k: 4,
fingerprint_k: fingerprint_k.max(1),
use_rendezvous: false,
}
}