Repository navigation
feat(reputation): un-saturate the speed sub-score + half-life decay for large-file selection (#1658) - #1661
Conversation
…no longer saturated (#1658)
… half-life (default 3d) (#1658)
…urve + review nits (#1658) The node reactive-topup speed regression still derived its threshold from the retired linear speed curve. Recalibrate to the log-normalized curve, preserving the test's intent (a throttled post-top-up delivery scores meaningfully lower than a saturated one) and updating its stale doc-comment. Also address the batch of final-review minors: remove an unreachable guard in speed_score_from_bps, reword the SECONDS_PER_WEEK doc comment, fix a stale idle-age test comment, and split two multi-clause ADR 008 sentences for ASD-STE100. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…he log-curve semantics (#1658) Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Warning Review limit reached
Next review available in: 39 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (4)
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Coverage reportTotal: 80.44% (was 80.46%, ▼ 0.02%) — 62432/77610 lines
History
|
There was a problem hiding this comment.
Pull request overview
Updates the in-crate reputation model (ADR 008) to better differentiate high-throughput peers for large-file delivery, and to decay stale scores on a sub-weekly timescale without changing the higher-level node-selection formula (ADR 001).
Changes:
- Replace linear, baseline-saturating speed scoring with a log-normalized speed sub-score parameterized by
reference_bps. - Replace fixed weekly decay with a configurable half-life idle-score decay (
decay_half_life_secs, default 3 days;0disables). - Rename
expected_bps→reference_bps, recalibrate tests, and update ADR 008 to match the new semantics.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/reputation/src/local.rs | Renames speed baseline config to reference_bps and switches idle decay to half-life-based decay. |
| crates/reputation/src/interaction.rs | Implements the log-normalized speed scoring function and updates unit tests for monotonicity/non-saturation vs. the old baseline. |
| crates/node/tests/node_origin_pull.rs | Recalibrates the post-top-up delivery speed regression test to the new log speed curve and renamed config field. |
| adr/008-reputation.md | Updates ADR 008 to document log speed normalization and half-life decay semantics/examples. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Closes #1658.
What & why
Node selection was blind to throughput above ~80 Mbps. Reputation's speed component was
min(1, actual_bps / expected_bps)with an 80 Mbps baseline, so an 80 Mbps node and a 10 Gbps node both scored1.0— indistinguishable. For large-file delivery (the model-delivery wedge) transfer time is throughput-dominated (10 GB is ~1000 s at 80 Mbps vs ~8 s at 10 Gbps), so the score was optimizing the near-irrelevant variable (RTT) and blind to the one that matters.This change stays inside
crates/reputation(ADR 008) — the ADR 001 selection formularate × rtt × (1/rep²)is untouched; speed still rides through the existing1/rep²term.Changes
speed = clamp(ln(1+actual_bps) / ln(1+reference_bps), 0, 1), reference default 1 GiB/s. Throughput above the old baseline is no longer saturated: a materially faster node scores strictly higher. A normal 10 MiB/s node now converges to ~0.91 instead of trivially reaching 1.0; a ~1 GiB/s node reaches ~1.0.0disables). Sub-weekly recovery returns transiently-dinged nodes to selection in days and stops incumbents coasting on stale reputation — both widen the serving set and favour decentralization. Reachability failures ride this decay as ordinary negative samples (no hard crater).expected_bps→reference_bpsrename (field, default const, error variant) to match the new log-reference semantics.Scope notes / decisions
0.4/0.4/0.2weights are unchanged — a deliberate "current model carries us, just retune" call rather than a structural gate.BudgetPacermeasurement confound; the size-aware transfer-time model. This is a single-source improvement and is not a prerequisite for multi-source (ADR 039: rewrite leaner as the single multi-source home, then implement the scheduler #1164), which measures per-source throughput live.Verification
cargo nextest run -p decdn-reputation— 27/27 passcargo nextest run -p decdn-node a_slow_post_topup_delivery_scores_slow_not_instant— 1/1 pass (recalibrated; threshold 0.90 separates the honest 0.867 case from the bugged 0.932 case, derived from the log formula)cargo clippy -p decdn-reputation -p decdn-node --all-targets— cleancargo fmt -- --check— clean🤖 Generated with Claude Code