Skip to main content

Crate sharpebench_core

Crate sharpebench_core 

Source
Expand description

§sb-core — the SharpeBench scoring kernel

A pure, deterministic library that turns a set of agent trajectories (per-seed × per-window return series + decision traces) into a luck-robust, risk-adjusted score and leaderboard ranking.

Design invariants — these make a score reproducible for a pinned release and input:

  • Pure. No I/O, no system clock, no ambient randomness. Any randomness (the significance bootstrap) takes an explicit seed argument.
  • Deterministic. Plain f64 math, fixed reduction order, no parallel float sums. CI pins two committed golden fields on Linux, macOS, and Windows; that check does not cover every input or platform.
  • No unsafe.

The headline idea: an agent does not rank on raw return. It ranks only if its edge survives (a) deflation for the number of agents tested (deflated_sharpe), (b) reliability across every seed×window (pass_k), and (c) decision-process discipline (process). Raw return is reported but never the rank key — see composite.

Re-exports§

pub use allocation::check_weights;
pub use allocation::score_allocation;
pub use allocation::turnover;
pub use allocation::AllocationPolicy;
pub use allocation::AllocationReport;
pub use allocation::AllocationStep;
pub use allocation::AllocationTrajectory;
pub use allocation::WeightValidity;
pub use allocation::WeightViolation;
pub use briefing::audit_briefing;
pub use briefing::Briefing;
pub use briefing::BriefingAudit;
pub use briefing::BriefingPolicy;
pub use briefing::BriefingSection;
pub use briefing::BriefingViolation;
pub use budget_curve::budget_curve;
pub use budget_curve::BudgetCurveOpts;
pub use budget_curve::BudgetCurveReport;
pub use budget_curve::BudgetPoint;
pub use candidate_lineage::verify_candidate_lineage;
pub use candidate_lineage::CandidateAncestry;
pub use candidate_lineage::CandidateFamilyRobustness;
pub use candidate_lineage::CandidateLineageError;
pub use candidate_lineage::CandidateLineageLedger;
pub use candidate_lineage::CandidateLineageReport;
pub use candidate_lineage::CandidateLineageScore;
pub use certification::certify_lifecycle_v1;
pub use certification::rank_certified;
pub use certification::Certification;
pub use certification::CertificationGap;
pub use certification::RankMode;
pub use certification::RankModeError;
pub use certification::LIFECYCLE_CERTIFIED_V1;
pub use comparison_sets::comparison_set;
pub use comparison_sets::qualifies;
pub use comparison_sets::restrict_field;
pub use comparison_sets::restrict_to_shared;
pub use comparison_sets::ComparisonSet;
pub use comparison_sets::TaggedRun;
pub use comparison_sets::TaggedSubmission;
pub use composite::parse_declared_field;
pub use composite::per_period_sr_std;
pub use composite::per_run_passes;
pub use composite::per_run_psr_benchmark;
pub use composite::rank;
pub use composite::rank_declared;
pub use composite::score_agent;
pub use composite::score_agent_declared;
pub use composite::split_declarations;
pub use composite::AgentSubmission;
pub use composite::CompositeScore;
pub use composite::DeclaredSubmission;
pub use composite::DispersionLeverage;
pub use composite::Mandate;
pub use composite::MandateDeclarations;
pub use composite::MandateVerdict;
pub use composite::Run;
pub use composite::ScoreConfig;
pub use composite::TrialsSrStdSource;
pub use correlation::crowdedness;
pub use correlation::Crowdedness;
pub use decision_stability::decision_stability;
pub use decision_stability::observation_sha256;
pub use decision_stability::same_decision;
pub use decision_stability::DecisionStabilityError;
pub use decision_stability::DecisionStabilityReport;
pub use decision_stability::DifferingGroup;
pub use decision_stability::IdenticalReplicates;
pub use decision_stability::ObservedDecision;
pub use decision_stability::ReplicateRun;
pub use decision_stability::StabilityCounts;
pub use decision_stability::StabilityRate;
pub use decision_stability::StabilityUnavailable;
pub use decision_stability::WindowStability;
pub use disqualification::classify_disqualification;
pub use disqualification::rollup;
pub use disqualification::DisqualThresholds;
pub use disqualification::FailReason;
pub use econrationality::assess_rationality;
pub use econrationality::elicit_revealed_selection;
pub use econrationality::DominanceChoice;
pub use econrationality::EconRationalityReport;
pub use entrant_visibility::seal;
pub use entrant_visibility::seal_board;
pub use entrant_visibility::seal_score;
pub use entrant_visibility::EntrantView;
pub use entrant_visibility::SealReport;
pub use entrant_visibility::Visibility;
pub use entrant_visibility::VisibilityAllowlist;
pub use entrant_visibility::COMPOSITE_SCORE_VISIBILITY;
pub use entrants::atr_breakout;
pub use entrants::bounce_counter;
pub use entrants::distribution_days;
pub use entrants::follow_through_day;
pub use entrants::max_exposure_timeout;
pub use entrants::regime_rsi;
pub use entrants::signal_gate;
pub use entrants::AtrBreakoutParams;
pub use entrants::AtrBreakoutSignal;
pub use entrants::AtrBreakoutVerdict;
pub use entrants::BounceParams;
pub use entrants::BounceState;
pub use entrants::DistributionCount;
pub use entrants::DistributionParams;
pub use entrants::DistributionSeverity;
pub use entrants::ExposureDecision;
pub use entrants::ExposureState;
pub use entrants::FollowThroughParams;
pub use entrants::FollowThroughPhase;
pub use entrants::FollowThroughSignal;
pub use entrants::GateDecision;
pub use entrants::GateState;
pub use entrants::GateStatus;
pub use entrants::IndexBar;
pub use entrants::RegimeRsiParams;
pub use entrants::RegimeRsiSignal;
pub use entrants::RsiBands;
pub use entrants::Side;
pub use entrants::TrendRegime;
pub use evidence_coverage::Coverage;
pub use evidence_coverage::DigestId;
pub use evidence_coverage::EvidenceInventory;
pub use evidence_coverage::InventoryAudit;
pub use evidence_coverage::PreimageError;
pub use evidence_coverage::RunProvenance;
pub use evidence_coverage::COMPOSITE_SCORE_INVENTORY;
pub use evidence_coverage::REDACTED;
pub use evidence_coverage::RUN_PROVENANCE_INVENTORY;
pub use forecast::analyze_forecast_quality;
pub use forecast::analyze_forecast_quality_against_plan;
pub use forecast::parse_forecast_contract_plan;
pub use forecast::parse_forecast_evidence;
pub use forecast::AgentForecastSummary;
pub use forecast::AgentUnresolvedSupport;
pub use forecast::BinaryCalibration;
pub use forecast::CalibrationBin;
pub use forecast::CommonSupport;
pub use forecast::ConfidenceCalibration;
pub use forecast::ContractDigestEncodingMismatch;
pub use forecast::ContractDigestVersion;
pub use forecast::DistributionCalibration;
pub use forecast::ForecastAnalysisConfig;
pub use forecast::ForecastContractPlan;
pub use forecast::ForecastError;
pub use forecast::ForecastEvidence;
pub use forecast::ForecastQualityReport;
pub use forecast::MetricMean;
pub use forecast::PairwiseForecastComparison;
pub use forecast::SettlementStatusDisagreement;
pub use forecast::SupportGap;
pub use forecast::FAMILYWISE_SIZE_RULE;
pub use greeks::bs_greeks;
pub use greeks::bs_price;
pub use greeks::classify_greeks_risk;
pub use greeks::classify_payoff_tail;
pub use greeks::portfolio_greeks;
pub use greeks::Greeks;
pub use greeks::GreeksPolicy;
pub use greeks::GreeksRisk;
pub use greeks::Leg;
pub use greeks::OptionsError;
pub use greeks::PayoffTailRisk;
pub use oos::oos_decay;
pub use oos::OosDecayReport;
pub use pass_k::pass_k;
pub use pass_k::PassMode;
pub use percentile::percentile_of;
pub use percentile::BaselineBand;
pub use percentile::HumanBaseline;
pub use process::check_lifecycle;
pub use process::process_score_with_ordering;
pub use process::ClientOrderKey;
pub use process::LifecycleReport;
pub use process::LifecycleStep;
pub use process::OrderId;
pub use process::OrderingViolation;
pub use process::Phase;
pub use process::PhaseKind;
pub use process::ProcessEvent;
pub use process::ProcessScore;
pub use process::Subject;
pub use process::Trace;
pub use rediscovery::classify_rediscovery;
pub use rediscovery::clone_clusters;
pub use rediscovery::cosine_similarity;
pub use rediscovery::RediscoveryVerdict;
pub use rediscovery::CLONE_COLLAPSE_COSINE;
pub use rediscovery::DEFAULT_REDISCOVERY_THRESHOLD;
pub use regime_compare::compare_by_regime;
pub use regime_compare::RegimeCompareOpts;
pub use regime_compare::RegimeComparison;
pub use regime_compare::RegimeDistributionReport;
pub use regime_compare::ZagaSplit;
pub use roles::attribute_behavior_roles;
pub use roles::attribute_roles;
pub use roles::elicit_behavior_roles;
pub use roles::RoleContribution;
pub use rolling::rolling_sharpe;
pub use rolling::RollingSharpe;
pub use run_identity::parse_keyed_field;
pub use run_identity::KeyedField;
pub use run_identity::PeriodOverlap;
pub use run_identity::RunIdentity;
pub use run_identity::RunIdentityError;
pub use run_identity::RunKey;
pub use selfaudit::run_self_audit;
pub use selfaudit::SelfAuditReport;
pub use sharpe_diagnostics::sharpe_diagnostics;
pub use sharpe_diagnostics::MppmDiagnostic;
pub use sharpe_diagnostics::PsrDiagnostic;
pub use sharpe_diagnostics::SharpeDiagnostic;
pub use sharpe_diagnostics::SharpeDiagnostics;
pub use sharpe_diagnostics::TailRiskDiagnostic;
pub use suite_controls::bind_to_suite;
pub use suite_controls::control_preimage;
pub use suite_controls::evaluate_controls;
pub use suite_controls::ControlBinding;
pub use suite_controls::ControlDigest;
pub use suite_controls::ControlError;
pub use suite_controls::ControlObservation;
pub use suite_controls::ControlProperty;
pub use suite_controls::ControlRun;
pub use suite_controls::ControlShortfall;
pub use suite_controls::ControlVerdict;
pub use suite_controls::SuiteControlEvidence;
pub use suite_controls::UnboundField;
pub use suite_controls::ACCOUNTING_RESIDUAL_TOLERANCE;
pub use suite_controls::SUITE_CONTROL_INVENTORY;
pub use suite_evidence::suite_evidence;
pub use suite_evidence::SuiteEvidence;
pub use trial_census::attach_census;
pub use trial_census::census;
pub use trial_census::AgentCensus;
pub use trial_census::CensusError;
pub use trial_census::CensusGate;
pub use trial_census::CensusedScore;
pub use trial_census::CohortIdentity;
pub use trial_census::TrialCensus;
pub use trial_census::TrialOutcome;
pub use trial_census::TrialReport;
pub use trial_census::TrialRoster;

Modules§

allocation
Allocation-vector scoring contract + turnover penalty.
attribution
Performance attribution — separate skill (alpha) from market beta.
briefing
Briefing-neutrality / input-salience-bias audit.
budget_curve
Luck-robust performance-vs-budget curve: the honest, out-of-sample inversion of an in-distribution scaling law.
calibration
Confidence calibration — does the agent’s stated conviction predict its outcomes? An agent that knows when it doesn’t know is more trustworthy with capital than one with a marginally higher Sharpe and no self-knowledge. We score this with the Brier score (lower is better; 0 = perfect, 0.25 = the always-0.5 baseline).
candidate_lineage
Independent verification of SharpeArena generated-candidate lineage.
certification
Versioned, opt-in lifecycle certification beside the host rank.
comparison_sets
Benchmark Comparison Sets — cross-agent ranking fairness.
composite
The composite score + leaderboard ranking — where the gates compose.
correlation
Cross-agent correlation / crowdedness — how much an agent is just riding the same factor as everyone else. Two agents with identical Sharpe are not equally valuable: the one whose returns are uncorrelated with the field is diversifying skill; the one tracking the crowd is renting a common beta that will decay (and crash) for the whole field at once. We report each agent’s correlation with the rest of the board so crowded edges are visible.
decay
Edge decay — does the agent’s signal survive forward in time, or is it a one-regime fluke? We estimate the half-life of the absolute information coefficient by regressing ln|IC| on time. The half-life is reported on the composite so a fast-decaying edge is visible even when its average looks good; it is never read by the eligibility predicate and does not affect rank. (After QuantBench’s IC half-life.)
decision_stability
Decision stability: how often an agent decides differently when it saw the same observations.
deflated_sharpe
Sharpe ratio, Probabilistic Sharpe Ratio (PSR), and Deflated Sharpe Ratio (DSR).
disqualification
Disqualification-reason taxonomy — a legibility layer over the composite score.
econrationality
Economic-rationality litmus tests.
entrant_visibility
What an entrant or developer is allowed to read back, declared as an allowlist and enforced by one named seal.
entrants
Reference entrants: specified, deterministic signal primitives.
evidence_coverage
What the digest actually covers, declared in machine-readable form.
forecast
Strict ingestion and independent analysis of prospective forecast evidence.
greeks
Options pricing + Greeks-exposure risk scoring.
oos
Out-of-sample decay — how much does an agent’s edge erode after the window it was (implicitly) tuned on?
pass_k
pass^k reliability — does the agent clear the bar on every run, not on average? Stochastic agents (LLMs) can win once by luck; a benchmark that ranks the lucky single run is measuring noise. For safety-relevant suites use PassMode::All (after Sierra’s τ²-bench pass^k).
percentile
Legibility: a bare Deflated Sharpe number is illegible to outsiders.
process
Process-discipline scoring over a decision trace.
rediscovery
Rediscovery / strategy-recycling detection.
regime_compare
Regime-conditional distributional comparison: where does the edge actually live?
roles
Multi-agent role attribution — which role in a trading team adds skill?
rolling
Rolling-window Sharpe stability — is the deflated edge one lucky window?
run_identity
Typed run identity for a submitted field.
selection
Selection-axis luck control.
selfaudit
Benchmark self-audit — does SharpeBench resist being gamed?
sharpe_diagnostics
Opt-in Sharpe diagnostics for a scored board, computed beside it and never folded into it.
significance
Significance via a deterministic stationary bootstrap (Politis & Romano).
stats
Small, dependency-free, deterministic statistics helpers.
stylized_facts
Cont’s stylized facts — a deterministic realism validator for a return dataset.
suite_controls
Suite controls: what each control was for, and what it actually showed.
suite_evidence
What a suite declared it would run, what became of those trials, and what its controls showed: one record, published beside the board.
trial_census
Trial counts taken from the declared roster, published beside the score.

Structs§

RealismThresholds
Realism-gate thresholds. Defaults are deliberately permissive lower bounds — a dataset only has to clear each stylized fact, not match any particular market.
RealismVerdict
The certification verdict: the measured profile, the thresholds applied, whether every gated stylized fact held, and the specific failures if not.
SelectionRobustness
Deflated-Sharpe summary across a set of candidate return streams.
StylizedFactsReport
The measured stylized-facts profile of a return series. Each field is a plain statistic; the realism predicates (StylizedFactsReport::has_fat_tails …) compare them against a RealismThresholds.

Enums§

DeclaredMandate
The mandate an agent declares at submission: which reliability verdict it asks to be judged under. Opt-in and additive: a submission with no declaration is scored exactly as before.
RealismFailure
A single stylized fact a dataset failed to exhibit.

Functions§

selection_robustness
Compute selection robustness over candidate return streams. Each slice is one candidate strategy’s pooled returns; they are deflated with the same trial footprint and summarized. Empty input → all-zero.
stylized_facts
Measure the stylized-facts profile of a return series. Pure; deterministic.
validate_dataset
Certify a dataset against the default RealismThresholds.
validate_dataset_with
Certify a dataset against explicit thresholds.