lightspeed/ops/contention_harness
Deterministic durable-store contention profiling harness for M37.
Types
Tunable contention budget for one scenario.
pub type Budget {
Budget(
scenario: Scenario,
max_lease_window_p95_ms: Int,
max_checkpoint_window_events: Int,
max_replay_window_ms: Int,
max_queue_depth: Int,
max_retry_attempts: Int,
)
}
Constructors
-
Budget( scenario: Scenario, max_lease_window_p95_ms: Int, max_checkpoint_window_events: Int, max_replay_window_ms: Int, max_queue_depth: Int, max_retry_attempts: Int, )
Durable-store contention profile metrics.
pub type Metrics {
Metrics(
ownership_conflicts: Int,
split_brain_rejections: Int,
stale_owner_rejections: Int,
invalid_token_rejections: Int,
takeover_successes: Int,
lease_window_p95_ms: Int,
lease_queue_peak: Int,
takeover_queue_peak: Int,
retry_attempts: Int,
checkpoint_window_events: Int,
replay_window_ms: Int,
)
}
Constructors
-
Metrics( ownership_conflicts: Int, split_brain_rejections: Int, stale_owner_rejections: Int, invalid_token_rejections: Int, takeover_successes: Int, lease_window_p95_ms: Int, lease_queue_peak: Int, takeover_queue_peak: Int, retry_attempts: Int, checkpoint_window_events: Int, replay_window_ms: Int, )
Full M37 report.
pub type Report {
Report(
outcomes: List(ScenarioOutcome),
budget_results: List(BudgetResult),
failed_scenarios: Int,
nondeterministic_failures: Int,
invariant_failures: Int,
failed_budgets: Int,
)
}
Constructors
-
Report( outcomes: List(ScenarioOutcome), budget_results: List(BudgetResult), failed_scenarios: Int, nondeterministic_failures: Int, invariant_failures: Int, failed_budgets: Int, )
M37 contention-profiling scenarios.
pub type Scenario {
OwnershipFencingContention
LeaseRenewalContention
TakeoverQueueRetryPressure
CheckpointReplayWindows
}
Constructors
-
OwnershipFencingContention -
LeaseRenewalContention -
TakeoverQueueRetryPressure -
CheckpointReplayWindows
Values
pub fn budget_failures(results: List(BudgetResult)) -> Int
Count failing budget checks.
pub fn budget_results(report: Report) -> List(BudgetResult)
Report budget-results accessor.
pub const budget_version: Int
pub fn default_budget() -> List(Budget)
Default deterministic M37 contention budgets.
pub fn evaluate_budget(
outcomes: List(ScenarioOutcome),
budgets: List(Budget),
) -> List(BudgetResult)
Evaluate one outcome list against one budget profile.
pub fn nondeterministic_failures(report: Report) -> Int
Nondeterministic scenario count.
pub fn profile_metrics(outcome: ScenarioOutcome) -> Metrics
Scenario profile accessor.
pub fn run_matrix() -> Report
Run all M37 scenarios and evaluate default contention budgets.
pub fn run_scenario(scenario: Scenario) -> ScenarioOutcome
Run one M37 scenario twice and require deterministic parity.
pub fn snapshot_report_markdown() -> String
Deterministic markdown report for M37 fixture scripts.
pub fn snapshot_signature() -> String
Deterministic snapshot signature for M37 drift gates.
pub const snapshot_version: Int