|
PineForge HPO 1.11.0
Native hyperparameter optimization for PineForge strategies
|
Classes | |
| struct | AccountEquityPoint |
| One timestamped point on an account-level equity curve. More... | |
| struct | Allocation |
| Requested capital allocation to one strategy and market sleeve. More... | |
| struct | BacktestConfiguration |
| Immutable engine settings applied to every execution owned by a TrialExecutor. More... | |
| class | BooleanDimension |
Named dimension whose legal values are exactly false and true. More... | |
| struct | Candidate |
| Complete parameter assignment proposed by a sampler. More... | |
| class | CategoricalDimension |
| Named dimension backed by an ordered, non-empty set of scalar choices. More... | |
| struct | Constraint |
| Named scalar feasibility constraint with an absolute non-negative tolerance. More... | |
| class | Dataset |
| Immutable owned or file-mapped OHLCV input shared by independent trial executions. More... | |
| struct | DatasetView |
| Immutable, non-copying range of bars retaining its Dataset owner. More... | |
| class | DlibGlobalSampler |
Adaptive derivative-free optimizer backed by dlib::global_function_search. More... | |
| class | EngineError |
| An engine-owned failure whose optional metadata is forwarded without reclassification. More... | |
| struct | EngineVersion |
| Embedded runtime identity admitted for selected-window execution. More... | |
| struct | EquityPointsView |
Borrowed, strided view of an ordered array of records holding (time_ms, equity). More... | |
| class | ErrorArgument |
| A typed JSON scalar; strings in HPO-owned arguments use closed catalog vocabularies. More... | |
| struct | EvaluationPolicy |
| Policies controlling exceptional arithmetic during metric-expression evaluation. More... | |
| class | ExpressionError |
| Parse error raised while compiling a metric expression. More... | |
| struct | ExpressionEvaluation |
| Non-throwing result envelope returned by MetricExpression::evaluate(). More... | |
| class | GridSampler |
| Lazy exhaustive sampler over a finite SearchSpace in mixed-radix order. More... | |
| class | HpoError |
| Stable machine-readable failure metadata shared by the standard exception families. More... | |
| class | IntegerDimension |
| Named signed-integer dimension with inclusive bounds and a positive step. More... | |
| class | MetricExpression |
| Parsed metric expression that is compiled once and evaluated repeatedly. More... | |
| struct | ObjectiveResult |
| Objective values, constraints, and diagnostics produced for one observation. More... | |
| struct | PlanRequest |
| Owned request strings and fixed-width fields for the selected primary C planner. More... | |
| struct | PlanResult |
| Value copy of the complete 248-byte engine result, including planner refusals. More... | |
| struct | PortfolioObservation |
| Account-level observation supplied to a custom portfolio objective. More... | |
| class | Pruner |
| Coordinator-owned rung history. More... | |
| class | RandomSampler |
| Seeded independent sampler with replacement. More... | |
| class | RealDimension |
| Named binary64 dimension with inclusive bounds and an optional finite-grid step. More... | |
| struct | ReportSnapshot |
| Owning report snapshot detached from strategy and C-ABI report lifetimes. More... | |
| struct | ReturnBlockLayout |
| Block layout of one bar-return series: how many intervals each block holds and which curve point opens it. More... | |
| struct | ReturnBlockMoments |
| Moments of every block of one bar-return series, ascending block. More... | |
| struct | ReturnSeriesStats |
| All published fields of one series plus diagnostics. More... | |
| struct | ReturnStatsFields |
| Published fields of one return-statistics series, in wire order: count, skipped, periods_per_year, mean, std, sharpe_per_period, skew, kurt_raw, status. More... | |
| struct | ReturnStatsMetric |
| One of the eighteen metric names, decomposed. More... | |
| struct | ReturnStatsRequest |
| Selects the series to compute. A series that is not requested costs nothing. More... | |
| struct | ReturnStatsResult |
| The series that were requested; an absent series was not requested. More... | |
| class | Sampler |
| Minimal pull-based interface shared by candidate samplers. More... | |
| class | SearchSpace |
| Ordered product of named dimensions with validation and finite-space codecs. More... | |
| class | SelectedEvaluation |
| Dedicated one-shot OOS execution on a fresh handle using full report mode. More... | |
| struct | SelectedEvaluationResult |
| One fully checked selected run, detached from the engine handle and report. More... | |
| struct | SelectedExpectedCounts |
| Already-planned retained primary counts; no planning is performed by SelectedEvaluation. More... | |
| struct | SelectedPlan |
| One selected-window prediction and the immutable rows to supply to SelectedEvaluation. More... | |
| struct | SleeveSummary |
| Compact start/end summary for one independently evaluated portfolio sleeve. More... | |
| class | StrategyPlugin |
| RAII wrapper around one compiled PineForge strategy plugin. More... | |
| struct | SymbolData |
| Fixed other-symbol data installed into every fresh trial strategy. More... | |
| struct | SymbolFact |
| One catalog fact installed through strategy_set_symbol_facts. More... | |
| struct | SymbolFeed |
| Owned, immutable-after-loading bars for one exact request timeframe. More... | |
| struct | SymbolInfo |
| Optional instrument metadata applied after trial inputs and runtime overrides. More... | |
| class | TpeSampler |
| Independent, single-objective Tree-structured Parzen Estimator sampler. More... | |
| struct | TpeSamplerConfig |
| Tuning parameters for the native product-density TPE implementation. More... | |
| struct | TrialContext |
| Metadata supplied to a custom objective while evaluating one trial. More... | |
| struct | TrialExecutionResult |
| Result envelope returned by TrialExecutor::execute(). More... | |
| class | TrialExecutor |
| Deterministic one-shot adapter from serialized parameters to a detached report. More... | |
| class | TypedHpoError |
| Adds stable metadata while preserving a standard exception's catch compatibility. More... | |
| struct | ValidationIssue |
| One candidate-validation failure tied to a parameter name. More... | |
| struct | WarmStartObservation |
| One previously attempted candidate; only finite, feasible completed objectives are supplied. More... | |
| class | WarmStartSource |
| Immutable, ordered sampler observations, optionally backed by mapped binary columns. More... | |
| class | WindowPlanHelper |
| Owns a verified, privately snapshotted standalone planner library. More... | |
Typedefs | |
| using | ErrorArguments = std::map< std::string, ErrorArgument > |
| Deterministically ordered failure arguments. No strategy-computed value belongs here. | |
| using | MetricMap = std::unordered_map< std::string, double > |
| Metric values keyed by canonical objective path. | |
| template<typename Observation > | |
| using | ObjectiveFn = std::function< ObjectiveResult(const Observation &, const TrialContext &)> |
| Type-erased custom objective accepting an observation and immutable trial context. | |
| using | PortfolioObjectiveFn = ObjectiveFn< PortfolioObservation > |
| Custom objective function specialized for PortfolioObservation. | |
| using | Dimension = std::variant< IntegerDimension, RealDimension, BooleanDimension, CategoricalDimension > |
| Closed variant over every supported search-space dimension type. | |
| using | SymbolFeeds = std::vector< SymbolData > |
| Study-owned collection shared read-only by all trial workers. | |
| using | ParameterValues = std::map< std::string, std::string > |
| Serialized Pine input or runtime-override values keyed by strategy parameter name. | |
| using | ParameterValue = std::variant< std::int64_t, double, bool, std::string > |
| Scalar parameter value accepted by search spaces and the PineForge strategy ABI. | |
Enumerations | |
| enum class | BinaryVerification { Full , Sidecar } |
| Verification of a binary chart's sidecar and mapped bytes. More... | |
| enum class | FailureOrigin : std::uint8_t { Hpo , Engine } |
| Provenance of a failure, independent of its human-readable diagnostic. More... | |
| enum class | DivisionByZeroPolicy { Reject , Ieee754 } |
| Behavior when an objective expression divides by zero. More... | |
| enum class | NonFinitePolicy { Reject , Allow } |
| Behavior when a metric or expression result is not finite. More... | |
| enum class | EvaluationError { None , MissingMetric , NonFiniteMetric , DivisionByZero , NonFiniteResult } |
| Stable reason code for an invalid ExpressionEvaluation. More... | |
| enum class | ConstraintRelation { LessEqual , GreaterEqual , Equal } |
| Comparison relation applied by Constraint. More... | |
| enum class | PrunerKind { None , Median , Halving } |
| Prefix pruning policy; disabled by default in the native runner. More... | |
| enum class | ReturnSeries : std::uint8_t { Bar , Monthly } |
| Return frequency of one statistics series. More... | |
| enum class | ReturnStatistic : std::uint8_t { Count , Skipped , PeriodsPerYear , Mean , Std , SharpePerPeriod , Skew , KurtRaw , Status } |
| One published field of a series. Declaration order is the wire order of the metric names. More... | |
| enum class | ReturnStatsStatus : std::uint8_t { Ok = 0 , InsufficientCount = 1 , ZeroVariance = 2 , NonfiniteInput = 4 , PeriodUnavailable = 6 , UnsupportedTimezone = 7 , DerivedNonfinite = 8 } |
| Stable numeric status of one series. More... | |
| enum class | ReturnPeriodFailure : std::uint8_t { None , TooFewPoints , NonPositiveSpan , SpanOverflow , UtcRange } |
| Why the period or time basis of a series is unavailable. Diagnostic only; not on the wire. More... | |
| enum class | ReturnBlocksStatus : std::uint8_t { NotRequested = 0 , Ok = 1 , NonPositiveEquity = 2 , Nonfinite = 3 , UnusableCurve = 4 , UnusableLayout = 5 } |
| Status of one row's block moments. More... | |
| enum class | ObjectiveDirection { Maximize , Minimize } |
| Direction used to rank a scalar objective. More... | |
| enum class | CandidatePolicy { SamplerDefault , WithoutReplacement , Exhaustive } |
| Uniqueness and coverage contract applied to sampler proposals. More... | |
| enum class | DimensionKind { Integer , Real , Boolean , Categorical } |
| Concrete dimension category stored by Dimension. More... | |
| enum class | TrialExecutionStatus : std::uint8_t { kSucceeded = 0 , kEngineError = 1 } |
| Terminal status of one native strategy execution. More... | |
| enum class | ParameterType { Integer , Real , Boolean , String } |
| Runtime discriminator for a ParameterValue alternative. More... | |
| enum class | PlanStatus : std::int32_t { Ok = 0 , RequestInvalid = 1 , CalendarUnsupported = 2 , BoundaryUnaligned = 3 , FeedRangeInvalid = 4 , RowsUnordered = 5 , InternalError = 6 } |
| Planner status words, independent of the C bridge's negative call return codes. More... | |
Functions | |
| template<typename Record > | |
| EquityPointsView | make_equity_points_view (const Record *records, std::size_t count, std::int64_t Record::*time_ms, double Record::*equity) noexcept |
Builds an EquityPointsView over count records of type Record from pointers to its time_ms and equity members, for example &pf_equity_point_t::time_ms. | |
| ReturnStatsResult | compute_return_stats (const EquityPointsView &points, const ReturnStatsRequest &request) noexcept |
| Computes the requested return statistics from a borrowed equity curve. | |
| bool | is_utc_chart_timezone (std::string_view chart_timezone) noexcept |
True for the chart timezone names that select UTC bucketing: empty, UTC and Etc/UTC. | |
| std::string_view | return_stats_metric_name (ReturnSeries series, ReturnStatistic statistic) noexcept |
Returns the wire metric name, for example returns.bar.sharpe_per_period. | |
| std::optional< ReturnStatsMetric > | parse_return_stats_metric (std::string_view name) noexcept |
| Resolves a metric name; returns an empty value for every name outside the eighteen. | |
| bool | return_stats_contraction_free () noexcept |
| Sanity probe of this translation unit's build: true when a multiply followed by an add is evaluated as two rounded operations (no contraction) and explicit fma is fused. | |
| std::string_view | return_blocks_status_text (ReturnBlocksStatus status) noexcept |
Returns the wire text of a status: ok, non_positive_equity, non_finite, and empty for the statuses that are never published as a payload status. | |
| ReturnBlockLayout | compute_block_layout (const EquityPointsView &points, std::uint32_t blocks) |
Cuts the adjacent intervals of a curve into blocks (S) blocks, and reads the opening timestamp of every one of them from the borrowed curve. | |
| ReturnBlockMoments | reduce_return_blocks (const EquityPointsView &points, const ReturnBlockLayout &layout) |
| Reduces the bar returns of a curve into the blocks of its own layout. | |
| constexpr bool | return_stats_identity_bound () noexcept |
| True when this build's return-statistics identity is bound to the compile commands that the build system generated for the reducer translation units. | |
| constexpr std::string_view | return_stats_identity_unbound_reason () noexcept |
| Short code naming why the identity is unbound; empty when it is bound. | |
| constexpr std::string_view | return_stats_contract () noexcept |
| Contract string that was bound into this build's identity at configure time. | |
| constexpr std::string_view | return_stats_numeric_build_identity () noexcept |
| Opaque identity of the build that computes return statistics; empty when unbound. | |
| constexpr std::string_view | return_stats_identity_descriptor () noexcept |
| Exact descriptor text that the identity is the SHA-256 digest of. | |
| constexpr std::string_view | return_stats_source_digest () noexcept |
| SHA-256 digest, in lower-case hexadecimal, of the sorted reducer source and header entries; empty when unbound. | |
| const char * | candidate_policy_name (CandidatePolicy policy) noexcept |
Returns the stable StudySpec spelling of policy. | |
| std::uint64_t | continuation_seed (std::uint64_t seed, std::uint64_t warm_trials) noexcept |
| Derives a portable continuation RNG seed; an empty history preserves the original seed. | |
| DimensionKind | dimension_kind (const Dimension &dimension) noexcept |
Returns the concrete category stored in dimension. | |
| std::string_view | dimension_name (const Dimension &dimension) noexcept |
Returns the name of the concrete dimension. | |
| bool | dimension_contains (const Dimension &dimension, const ParameterValue &value) noexcept |
Dispatches a type-aware membership test to the concrete dimension. | |
| SelectedPlan | plan_selected_window (const WindowPlanHelper &helper, const DatasetView &tape, const PlanRequest &request) |
| Plans one window over a shared tape or prefix without copying or repacking any bars. | |
| bool | sobol_numeric_identity_bound () |
| True when this build's Sobol numeric identity is bound to the compile commands that the build system generated for the Sobol sources and the portable-math target. | |
| std::string_view | sobol_numeric_identity_unbound_reason () |
| Short code naming why the identity is unbound; empty when it is bound. | |
| std::string | sobol_numeric_build_identity () |
Numeric build identity of the floating-point Sobol mapper, starting with portable-sobol-v1. | |
| std::string_view | sobol_numeric_identity_descriptor () |
Exact descriptor text whose SHA-256 digest is the build_sha256 field of the identity. | |
| EngineVersion | validate_selected_engine_version (const std::optional< pf_version_t > &numbers, const std::optional< std::string > &full, const std::optional< std::string > &expected_manifest_version=std::nullopt) |
| Parses and cross-checks embedded metadata without loading a plugin or consulting build headers. | |
| void | require_return_stats_identity () |
| Refuses return statistics in a build whose identity is unbound. | |
| ParameterType | parameter_type (const ParameterValue &value) noexcept |
Returns the discriminator of value. | |
| const char * | parameter_type_name (ParameterType type) noexcept |
Returns a stable lowercase name for type. | |
| std::string | serialize_parameter_value (const ParameterValue &value) |
Produces the exact text passed to strategy_set_input or strategy_set_override. | |
Variables | |
| constexpr std::string_view | kReturnStatsContract = "pineforge-hpo-return-stats/v1" |
Contract string of the result-level return_stats object (legacy mode, version 1). | |
| constexpr std::string_view | kReturnBlocksContract = "pineforge-hpo-return-blocks/v1" |
Contract string of the per-row block_returns object and of the result-level return_blocks object that declares the layout its rows were reduced under (version 1, bar series). | |
| constexpr double | kReturnStatsRiskFreeAnnual = 0.02 |
| Fixed annual risk-free rate. | |
| constexpr std::int64_t | kReturnStatsUtcMinMs = -1099511627775000 |
| Earliest Unix millisecond timestamp whose UTC month can be derived (inclusive). | |
| constexpr std::int64_t | kReturnStatsUtcMaxMs = 1099511627775999 |
| Latest Unix millisecond timestamp whose UTC month can be derived (inclusive). | |
| constexpr std::size_t | kReturnStatisticCount = 9 |
| Number of published fields per series. | |
| constexpr std::size_t | kReturnStatsMetricCount = 18 |
| Number of metric names of this contract (two series times nine fields). | |
| using pineforge::hpo::Dimension = typedef std::variant<IntegerDimension, RealDimension, BooleanDimension, CategoricalDimension> |
Closed variant over every supported search-space dimension type.
Definition at line 135 of file search_space.hpp.
| using pineforge::hpo::ErrorArguments = typedef std::map<std::string, ErrorArgument> |
| using pineforge::hpo::MetricMap = typedef std::unordered_map<std::string, double> |
Metric values keyed by canonical objective path.
Definition at line 18 of file objective.hpp.
| using pineforge::hpo::ObjectiveFn = typedef std::function<ObjectiveResult(const Observation&, const TrialContext&)> |
Type-erased custom objective accepting an observation and immutable trial context.
Definition at line 162 of file objective.hpp.
| using pineforge::hpo::ParameterValue = typedef std::variant<std::int64_t, double, bool, std::string> |
| using pineforge::hpo::ParameterValues = typedef std::map<std::string, std::string> |
Serialized Pine input or runtime-override values keyed by strategy parameter name.
Definition at line 23 of file trial_executor.hpp.
| using pineforge::hpo::PortfolioObjectiveFn = typedef ObjectiveFn<PortfolioObservation> |
Custom objective function specialized for PortfolioObservation.
Definition at line 67 of file portfolio.hpp.
| using pineforge::hpo::SymbolFeeds = typedef std::vector<SymbolData> |
Study-owned collection shared read-only by all trial workers.
Definition at line 43 of file symbol_feeds.hpp.
|
strong |
Verification of a binary chart's sidecar and mapped bytes.
| Enumerator | |
|---|---|
| Full | |
| Sidecar | |
Definition at line 14 of file dataset.hpp.
|
strong |
Uniqueness and coverage contract applied to sampler proposals.
Finite policies require a positive step on every varying real dimension. Candidates are reserved before ask() returns, so pending, completed, and abandoned points all remain seen.
Definition at line 84 of file sampler.hpp.
|
strong |
Comparison relation applied by Constraint.
| Enumerator | |
|---|---|
| LessEqual | Require |
| GreaterEqual | Require |
| Equal | Require |
Definition at line 114 of file objective.hpp.
|
strong |
Concrete dimension category stored by Dimension.
| Enumerator | |
|---|---|
| Integer | Discrete signed-integer lattice. |
| Real | Continuous or stepped binary64 interval. |
| Boolean | The two values |
| Categorical | Explicit ordered set of scalar choices. |
Definition at line 16 of file search_space.hpp.
|
strong |
Behavior when an objective expression divides by zero.
| Enumerator | |
|---|---|
| Reject | Return an invalid ExpressionEvaluation. |
| Ieee754 | Permit IEEE-754 infinity or NaN, subject to the result policy. |
Definition at line 21 of file objective.hpp.
|
strong |
Stable reason code for an invalid ExpressionEvaluation.
Definition at line 43 of file objective.hpp.
|
strong |
|
strong |
Behavior when a metric or expression result is not finite.
| Enumerator | |
|---|---|
| Reject | Reject the non-finite value. |
| Allow | Preserve the non-finite value for the caller. |
Definition at line 27 of file objective.hpp.
|
strong |
Direction used to rank a scalar objective.
| Enumerator | |
|---|---|
| Maximize | Larger finite values are better. |
| Minimize | Smaller finite values are better. |
Definition at line 75 of file sampler.hpp.
|
strong |
|
strong |
Planner status words, independent of the C bridge's negative call return codes.
Definition at line 19 of file window_plan.hpp.
|
strong |
Prefix pruning policy; disabled by default in the native runner.
| Enumerator | |
|---|---|
| None | |
| Median | |
| Halving | |
Definition at line 10 of file pruner.hpp.
|
strong |
Status of one row's block moments.
A payload carrying moment arrays is published only with status Ok. The other two wire statuses, NonPositiveEquity and Nonfinite, are published status-only so the module refuses the row by name. That is what the executor needs: requesting blocks must never turn a successful trial into a failed one, because that would move the optimizer's history.
Definition at line 223 of file return_stats.hpp.
|
strong |
Why the period or time basis of a series is unavailable. Diagnostic only; not on the wire.
Definition at line 76 of file return_stats.hpp.
|
strong |
Return frequency of one statistics series.
| Enumerator | |
|---|---|
| Bar | Simple returns between adjacent curve points. |
| Monthly | Simple returns between consecutive last points of UTC calendar-month buckets. |
Definition at line 41 of file return_stats.hpp.
|
strong |
One published field of a series. Declaration order is the wire order of the metric names.
Definition at line 47 of file return_stats.hpp.
|
strong |
Stable numeric status of one series.
Codes 3 and 5 of the draft proposal are not used.
When several causes apply the first match in this order wins: NonfiniteInput, UnsupportedTimezone, DerivedNonfinite, PeriodUnavailable, InsufficientCount, ZeroVariance, Ok. Status Ok holds if and only if every numeric field of the series is finite; a skipped return or a tiny finite variance is data and never a status.
Definition at line 65 of file return_stats.hpp.
|
strong |
Terminal status of one native strategy execution.
| Enumerator | |
|---|---|
| kSucceeded | Backtest completed and a detached snapshot is available. |
| kEngineError | Strategy reported an error; no comparable snapshot is available. |
Definition at line 204 of file trial_executor.hpp.
|
noexcept |
Returns the stable StudySpec spelling of policy.
| ReturnBlockLayout pineforge::hpo::compute_block_layout | ( | const EquityPointsView & | points, |
| std::uint32_t | blocks | ||
| ) |
Cuts the adjacent intervals of a curve into blocks (S) blocks, and reads the opening timestamp of every one of them from the borrowed curve.
A pure function of the immutable curve view and S: it keeps no state, retains no pointer and reads the view only for its point count and its timestamps. An unusable view gives a layout that is not usable. No interval is ever dropped from K. An accepted request allocates S and S + 1 entries, which cannot exceed the point count of a curve the caller already holds.
References compute_block_layout().
Referenced by compute_block_layout().
|
noexcept |
Computes the requested return statistics from a borrowed equity curve.
A pure function: it allocates nothing, throws nothing, keeps no state and retains no pointer, so it is safe to call concurrently on shared immutable input. Operation order is fixed and sequential (ascending index, centred two-pass); the translation unit must be built with floating-point contraction and fast-math disabled. When neither series is requested no work is done and the view is not read. An unusable view (null records with a nonzero count, a layout that does not fit its stride, or more than 2^53 records) yields status 4 for the requested series instead of being read.
References compute_return_stats().
Referenced by compute_return_stats().
|
noexcept |
Derives a portable continuation RNG seed; an empty history preserves the original seed.
|
noexcept |
Dispatches a type-aware membership test to the concrete dimension.
|
noexcept |
Returns the concrete category stored in dimension.
|
noexcept |
Returns the name of the concrete dimension.
|
noexcept |
True for the chart timezone names that select UTC bucketing: empty, UTC and Etc/UTC.
References is_utc_chart_timezone().
Referenced by is_utc_chart_timezone().
|
noexcept |
Builds an EquityPointsView over count records of type Record from pointers to its time_ms and equity members, for example &pf_equity_point_t::time_ms.
Definition at line 101 of file return_stats.hpp.
|
noexcept |
Returns the discriminator of value.
|
noexcept |
Returns a stable lowercase name for type.
|
noexcept |
Resolves a metric name; returns an empty value for every name outside the eighteen.
References parse_return_stats_metric().
Referenced by parse_return_stats_metric().
| SelectedPlan pineforge::hpo::plan_selected_window | ( | const WindowPlanHelper & | helper, |
| const DatasetView & | tape, | ||
| const PlanRequest & | request | ||
| ) |
Plans one window over a shared tape or prefix without copying or repacking any bars.
Binary searches cut the input to F <= timestamp < E before calling the helper. Dataset construction and both loaders already enforce strictly increasing timestamps; the owner must remain immutable, including mapped bytes. The request's T/E/F/N, timeframes and clock are passed unchanged. Empty cuts (including a possibly null pointer with count zero) reach the planner unchanged. Its retained rows are exactly the tail after trim_index.
Cutting and checking row endpoints take O(log n) time and constant auxiliary storage; the engine planner walks the bounded rows. No allocation scales with the tape. The returned view keeps the Dataset alive. Concurrent calls are compatible with an immutable tape and a helper kept alive for every call. Mapped-file verification remains the owner's duty.
| helper | Already loaded, verified planner helper. |
| tape | Owner-retaining immutable primary input, possibly spanning several folds. |
| request | One unmodified engine planning request. |
| TypedHpoError<std::invalid_argument> | with hpo_walkforward_plan_refused and closed status/option arguments for a planner refusal. |
| HpoError | with hpo_invariant for inconsistent successful plan data. Helper bridge failures propagate unchanged, including reason window_plan_load. |
| ReturnBlockMoments pineforge::hpo::reduce_return_blocks | ( | const EquityPointsView & | points, |
| const ReturnBlockLayout & | layout | ||
| ) |
Reduces the bar returns of a curve into the blocks of its own layout.
A pure function of the immutable curve view and the layout: no worker, global or random state is read and nothing is retained except the returned vectors. The layout is accepted only when it equals the one compute_block_layout returns for the same curve and layout.blocks; anything else (including a layout marked usable that the rule would refuse) gives status UnusableLayout and no arrays. If both a skipped interval and a non-finite value occur, the status is Nonfinite. An interval whose prior equity is not positive is skipped, while a current equity at or below zero is allowed; a non-finite equity, return or moment gives status Nonfinite instead of an error, so a request never fails the trial it describes.
Within a block the order is fixed and sequential and matches the return-statistics reducer: sum the usable returns in ascending interval k, divide that sum by the count, then add the separately rounded (r - mean) * (r - mean) in ascending interval k, forcing m2 = 0 for a block of one interval. This translation unit must therefore be built with floating-point contraction and fast-math disabled, like the statistics reducer it sits beside.
References reduce_return_blocks().
Referenced by reduce_return_blocks().
| void pineforge::hpo::require_return_stats_identity | ( | ) |
Refuses return statistics in a build whose identity is unbound.
Return statistics are published only by a build whose identity is bound to the compile commands that produced the reducer (see docs/internal/return-stats-identity.md). When it is not, because of a multi-configuration generator, a compiler launcher, a disabled compilation database, a CMake older than 3.19 and the like, this throws hpo_toolchain_unavailable (reason native_runner) whose text names the exact unbound reason. Every ordinary run, which requests no return statistics, never calls it and is unaffected. TrialExecutor calls it when a series is requested; the command line calls it earlier, before any plugin or dataset is loaded.
|
noexcept |
Returns the wire text of a status: ok, non_positive_equity, non_finite, and empty for the statuses that are never published as a payload status.
References return_blocks_status_text().
Referenced by return_blocks_status_text().
|
constexprnoexcept |
Contract string that was bound into this build's identity at configure time.
It is a separate constant from the reducer's own contract constant; a caller that includes both headers should assert that the two are equal.
Definition at line 30 of file return_stats_identity.hpp.
|
noexcept |
Sanity probe of this translation unit's build: true when a multiply followed by an add is evaluated as two rounded operations (no contraction) and explicit fma is fused.
This is a fail-closed check, not an attestation of the whole translation unit and not a proof of cross-architecture equality.
References return_stats_contraction_free().
Referenced by return_stats_contraction_free().
|
constexprnoexcept |
True when this build's return-statistics identity is bound to the compile commands that the build system generated for the reducer translation units.
It is false for builds that cannot be bound exactly: multi-configuration generators, compiler launchers or wrappers, response files, a missing or ambiguous compilation database entry, or a CMake older than 3.19. Such a build compiles and runs as usual, but a caller must refuse to publish return statistics, because no claim-bearing identity exists for them.
Definition at line 16 of file return_stats_identity.hpp.
|
constexprnoexcept |
Exact descriptor text that the identity is the SHA-256 digest of.
The text names every hashed source and header with its digest, the compiler fields and one line per normalized compile-command token. Proof tooling compares it with the compilation database of the build; it is not part of any result. An unbound build carries a short descriptor that names the reason.
Definition at line 54 of file return_stats_identity.hpp.
|
constexprnoexcept |
Short code naming why the identity is unbound; empty when it is bound.
Definition at line 21 of file return_stats_identity.hpp.
|
noexcept |
Returns the wire metric name, for example returns.bar.sharpe_per_period.
References return_stats_metric_name().
Referenced by return_stats_metric_name().
|
constexprnoexcept |
Opaque identity of the build that computes return statistics; empty when unbound.
It binds the reducer source digest, the compiler identity and driver bytes, the compile command of each reducer translation unit as generated by the build system, and the contract string. It is the same on every sampler path (grid, random, TPE and candidate lists) and is never derived from, combined with or compared to a sampler checkpoint identity. Equal identities name equal builds; they do not attest that two builds produce equal arithmetic, and they say nothing about other architectures.
Definition at line 43 of file return_stats_identity.hpp.
|
constexprnoexcept |
SHA-256 digest, in lower-case hexadecimal, of the sorted reducer source and header entries; empty when unbound.
Definition at line 61 of file return_stats_identity.hpp.
| std::string pineforge::hpo::serialize_parameter_value | ( | const ParameterValue & | value | ) |
Produces the exact text passed to strategy_set_input or strategy_set_override.
Real values use enough digits for a binary64 round trip. Non-finite real values are rejected because the engine input grammar has no portable representation for them.
| std::invalid_argument | if value is a non-finite real. |
| std::string pineforge::hpo::sobol_numeric_build_identity | ( | ) |
Numeric build identity of the floating-point Sobol mapper, starting with portable-sobol-v1.
Request it only for a space with a varying real, stepped-real or log-integer column; a discrete-only space has no numeric identity. The portable-math environment is checked first and refused with the same typed error as the TPE sampler. An unbound build then throws hpo_toolchain_unavailable (reason native_runner) naming the exact unbound reason, so a missing identity can neither be published nor admit a floating-point continuation.
The string binds the mapper contract and revision, the Joe-Kuo table name, subset digest and word size, the digest of the build descriptor (sources, generated table, compile commands of every Sobol and portable-math translation unit, both compiler drivers), and the current rounding, gradual-underflow, contraction-canary and portable-probe evidence. The evidence is a sanity limit of this process, not an attestation: equal strings name equal builds, they do not show that two builds or two architectures compute equal values, and they are independent of the TPE checkpoint identity and of the return-statistics identity.
| bool pineforge::hpo::sobol_numeric_identity_bound | ( | ) |
True when this build's Sobol numeric identity is bound to the compile commands that the build system generated for the Sobol sources and the portable-math target.
It is false for builds that cannot be bound exactly: multi-configuration generators, compiler launchers or wrappers, response files, a disabled, missing or ambiguous compilation database entry, or a CMake older than 3.19. Such a build compiles and runs as usual, including Sobol spaces without a floating-point column; only the floating-point identity is unavailable.
| std::string_view pineforge::hpo::sobol_numeric_identity_descriptor | ( | ) |
Exact descriptor text whose SHA-256 digest is the build_sha256 field of the identity.
Proof tooling compares it with the compilation database of the build; it is not part of any result. An unbound build carries a short descriptor that names the reason.
| std::string_view pineforge::hpo::sobol_numeric_identity_unbound_reason | ( | ) |
Short code naming why the identity is unbound; empty when it is bound.
| EngineVersion pineforge::hpo::validate_selected_engine_version | ( | const std::optional< pf_version_t > & | numbers, |
| const std::optional< std::string > & | full, | ||
| const std::optional< std::string > & | expected_manifest_version = std::nullopt |
||
| ) |
Parses and cross-checks embedded metadata without loading a plugin or consulting build headers.
Requires stable engine 1.x at least 1.6.2. Parses X.Y.Z[-rc.N][-D-gSHA][-dirty]; dirty suffixes are admitted with or without git distance, but release candidates are refused. A supplied manifest version must match the full embedded string exactly. Missing, malformed, unsupported and mismatched identities raise hpo_walkforward_unavailable with the corresponding engine reason.
|
inlineconstexpr |
Contract string of the per-row block_returns object and of the result-level return_blocks object that declares the layout its rows were reduced under (version 1, bar series).
Definition at line 17 of file return_stats.hpp.
|
inlineconstexpr |
Number of published fields per series.
Definition at line 35 of file return_stats.hpp.
|
inlineconstexpr |
Contract string of the result-level return_stats object (legacy mode, version 1).
Definition at line 13 of file return_stats.hpp.
|
inlineconstexpr |
Number of metric names of this contract (two series times nine fields).
Definition at line 38 of file return_stats.hpp.
|
inlineconstexpr |
Fixed annual risk-free rate.
The per-period rate is this value divided by the series' periods per year; it is not configurable in contract version 1.
Definition at line 21 of file return_stats.hpp.
|
inlineconstexpr |
Latest Unix millisecond timestamp whose UTC month can be derived (inclusive).
Definition at line 32 of file return_stats.hpp.
|
inlineconstexpr |
Earliest Unix millisecond timestamp whose UTC month can be derived (inclusive).
The monthly series refuses a timestamp outside [kReturnStatsUtcMinMs, kReturnStatsUtcMaxMs] explicitly (status 6) instead of converting it with unproved arithmetic. The range is floor(time_ms / 1000) within plus or minus (2^40 - 1) seconds, about 34,800 years each way. Negative epochs inside the range are valid: months are floored, never truncated toward zero.
Definition at line 29 of file return_stats.hpp.