← All compilation units

Flyology_Bench.Sweeps

Description

Maximum optional point-label length.

Append

procedure Append (Set : in out Point_Set; Item : Parameter_Point)

Append in execution order. A repeated kind/value identity is rejected even when its label differs.

Parameters
Set

Destination collection.

Item

Point appended at the end.

Availability

function Availability (Summary : Throughput_Summary) return Throughput_Availability

Return rate availability.

Parameters
Summary

Derived rate summary.

Return value

Exact availability state.

Available

function Available (Summary : Throughput_Summary) return Boolean

Test whether all rates are usable.

Parameters
Summary

Derived rate summary.

Return value

True only for Throughput_Available.

Collection_Available

function Collection_Available (Result : Ordinary_Point_Result) return Boolean

Test whether the ordinary runner returned a measurement.

Parameters
Result

Point result.

Return value

True even when only the later throughput derivation failed.

Collection_Available

function Collection_Available (Result : Paired_Point_Result) return Boolean

Test whether the paired runner returned a comparison.

Parameters
Result

Point result.

Return value

True even when only the later throughput derivation failed.

Compare_Sweep

generic
   with procedure Select_Point (Item : Parameter_Point);
   with function Work_For (Item : Parameter_Point) return Work_Amount;
   with procedure Run_Point (Config : Configuration; Result : out Comparison);
procedure Compare_Sweep
  (Case_Name : String;
   Points    : Point_Set;
   Config    : Configuration := Default_Configuration;
   Policy    : Sweep_Policy := (others => <>);
   Result    : out Paired_Sweep_Result)

Execute an ordered adjacent paired sweep with statically bound formals.

Generic formal parameters
Select_Point
Work_For
Run_Point
Parameters
Case_Name

Suite-compatible full benchmark identity.

Points

Ordered exact points.

Config

Base comparison configuration.

Policy

Budget, failure, and dry-run policy.

Result

Bounded inspectable outcomes.

Contender_Throughput

function Contender_Throughput (Result : Paired_Point_Result) return Throughput_Summary

Return contender-side throughput.

Parameters
Result

Paired point result.

Return value

Contender rate summary.

Data

function Data (Result : Ordinary_Point_Result) return Measurement

Return ordinary measurement storage.

Parameters
Result

Point result.

Return value

Completed measurement when Collection_Available is true; otherwise a reset default measurement, including after runner failure.

Data

function Data (Result : Paired_Point_Result) return Comparison

Return paired comparison storage.

Parameters
Result

Point result.

Return value

Completed comparison when Collection_Available is true; otherwise a reset default comparison, including after runner failure.

Derive_Throughput

function Derive_Throughput (Amount : Work_Amount; Result : Measurement) return Throughput_Summary

Derive throughput from a completed wall measurement. A default measurement reports Wall_Time_Unavailable rather than an invalid wall summary.

Parameters
Amount

Exact work per logical operation.

Result

Completed or default measurement.

Return value

Available or explicitly unavailable rate summary.

Derive_Throughput

function Derive_Throughput
  (Amount                  : Work_Amount;
   Median_Nanoseconds      : Long_Float;
   Mean_Confidence_Low_NS  : Long_Float;
   Mean_Confidence_High_NS : Long_Float) return Throughput_Summary

Derive rate summaries from a wall-time summary. The median rates are exact inversions of Median_Nanoseconds. Confidence endpoints invert the mean-time interval and therefore reverse its endpoints.

Parameters
Amount

Exact work per logical operation.

Median_Nanoseconds

Median wall time per operation.

Mean_Confidence_Low_NS

Lower mean-time interval endpoint.

Mean_Confidence_High_NS

Upper mean-time interval endpoint.

Return value

Available or explicitly unavailable rate summary.

Direction

function Direction (Amount : Work_Amount) return Throughput_Direction

Return the favorable rate direction.

Parameters
Amount

Work identity.

Return value

Higher_Is_Better.

Display_Scale

function Display_Scale (Amount : Work_Amount) return Display_Scaling

Return the requested display scaling.

Parameters
Amount

Work identity.

Return value

Decimal or binary scaling.

Display_Scaling

type Display_Scaling is (Decimal_Scaling, Binary_Scaling);

Human-readable display divisor.

Enumeration literals
Decimal_Scaling

Powers of 1000 with SI prefixes.

Binary_Scaling

Powers of 1024 with IEC prefixes.

Display_Unit

function Display_Unit (Amount : Work_Amount) return String

Return human-scaled unit.

Parameters
Amount

Work identity.

Return value

Prefixed items, bytes, or caller unit.

Display_Value

function Display_Value (Amount : Work_Amount) return Long_Float

Return human-scaled work value.

Parameters
Amount

Work identity.

Return value

Raw value divided by the selected display power.

Element

function Element (Result : Ordinary_Sweep_Result; Index : Positive) return Ordinary_Point_Result

Return one ordinary point result.

Parameters
Result

Ordinary sweep.

Index

One-based attempted position.

Return value

Inspectable point result.

Element

function Element (Result : Paired_Sweep_Result; Index : Positive) return Paired_Point_Result

Return one paired point result.

Parameters
Result

Paired sweep.

Index

One-based attempted position.

Return value

Inspectable point result.

Element

function Element (Set : Point_Set; Index : Positive) return Parameter_Point

Return one point in execution order.

Parameters
Set

Point collection.

Index

One-based position.

Return value

Selected point.

Exact_Value

subtype Exact_Value is Interfaces.Unsigned_64 range 1 .. Interfaces.Unsigned_64'Last;

Exact positive numeric parameter or work value.

Failure_Message

function Failure_Message (Result : Ordinary_Point_Result) return String

Return a retained ordinary failure message.

Parameters
Result

Point result.

Return value

Bounded exception identity/message or empty string.

Failure_Message

function Failure_Message (Result : Paired_Point_Result) return String

Return a retained paired failure message.

Parameters
Result

Point result.

Return value

Bounded exception identity/message or empty string.

Identity

function Identity (Item : Parameter_Point) return String

Canonical point identity, independent of the optional label.

Parameters
Item

Parameter point.

Return value

size:VALUE or count:VALUE.

Kind

function Kind (Item : Parameter_Point) return Parameter_Kind

Return a point's parameter kind.

Parameters
Item

Parameter point.

Return value

Size or count identity.

Label

function Label (Item : Parameter_Point) return String

Return a point's optional label.

Parameters
Item

Parameter point.

Return value

Label or an empty string.

Length

function Length (Result : Ordinary_Sweep_Result) return Natural

Return retained ordinary point count.

Parameters
Result

Ordinary sweep.

Return value

Attempted point count.

Length

function Length (Result : Paired_Sweep_Result) return Natural

Return retained paired point count.

Parameters
Result

Paired sweep.

Return value

Attempted point count.

Length

function Length (Set : Point_Set) return Natural

Return the number of points.

Parameters
Set

Point collection.

Return value

Appended point count.

Max_Error_Length

Max_Error_Length : constant := 160;

Maximum retained exception-message length.

Max_Label_Length

Max_Label_Length : constant := 64;

Maximum optional point-label length.

Max_Unit_Length

Max_Unit_Length  : constant := 32;

Maximum caller-named work-unit length.

Measure_Sweep

generic
   with procedure Select_Point (Item : Parameter_Point);
   with function Work_For (Item : Parameter_Point) return Work_Amount;
   with procedure Run_Point (Config : Configuration; Result : out Measurement);
procedure Measure_Sweep
  (Case_Name : String;
   Points    : Point_Set;
   Config    : Configuration := Default_Configuration;
   Policy    : Sweep_Policy := (others => <>);
   Result    : out Ordinary_Sweep_Result)

Execute an ordered ordinary sweep with statically bound formals.

Generic formal parameters
Select_Point
Work_For
Run_Point
Parameters
Case_Name

Suite-compatible full benchmark identity.

Points

Ordered exact points.

Config

Base runner configuration.

Policy

Budget, failure, and dry-run policy.

Result

Bounded inspectable outcomes.

Operations_Confidence_High

function Operations_Confidence_High (Summary : Throughput_Summary) return Long_Float

Return upper operations-per-second confidence endpoint.

Parameters
Summary

Derived rate summary.

Return value

Inverted lower mean-time endpoint, or zero.

Operations_Confidence_Low

function Operations_Confidence_Low (Summary : Throughput_Summary) return Long_Float

Return lower operations-per-second confidence endpoint.

Parameters
Summary

Derived rate summary.

Return value

Inverted upper mean-time endpoint, or zero.

Operations_Per_Second

function Operations_Per_Second (Summary : Throughput_Summary) return Long_Float

Return median logical operations per second.

Parameters
Summary

Derived rate summary.

Return value

Median wall-rate inversion, or zero when unavailable.

Ordinary_Point_Result

type Ordinary_Point_Result is private;

Inspectable ordinary measurement and rate for one exact point.

Ordinary_Sweep_Result

type Ordinary_Sweep_Result (Maximum_Points : Positive) is private;

Bounded ordinary point results in attempted order.

Record fields
Maximum_Points

Result capacity.

Paired_Point_Result

type Paired_Point_Result is private;

Inspectable adjacent paired comparison and rates for one exact point.

Paired_Sweep_Result

type Paired_Sweep_Result (Maximum_Points : Positive) is private;

Bounded paired point results in attempted order.

Record fields
Maximum_Points

Result capacity.

Parameter

function Parameter (Result : Ordinary_Point_Result) return Parameter_Point

Return an ordinary result's exact point.

Parameters
Result

Point result.

Return value

Parameter identity and label.

Parameter

function Parameter (Result : Paired_Point_Result) return Parameter_Point

Return a paired result's exact point.

Parameters
Result

Point result.

Return value

Parameter identity and label.

Parameter_Kind

type Parameter_Kind is (Size_Parameter, Count_Parameter);

Meaning of an exact numeric point.

Enumeration literals
Size_Parameter

Input size in caller-defined terms.

Count_Parameter

Input count in caller-defined terms.

Parameter_Point

type Parameter_Point is private;

Exact bounded point identity with optional display label.

Point

function Point (Kind : Parameter_Kind; Value : Exact_Value; Label : String := "") return Parameter_Point

Construct one exact positive numeric point. Labels are optional stable display metadata and use [A-Za-z0-9][A-Za-z0-9_.-]*.

Parameters
Kind

Meaning of the numeric input.

Value

Exact positive input.

Label

Optional stable display label.

Return value

Validated parameter point.

Point_Set

type Point_Set (Maximum_Points : Positive) is tagged private;

Bounded ordered collection of unique parameter points.

Record fields
Maximum_Points

Point capacity.

Point_Status

type Point_Status is
  (Point_Not_Run,
   Point_Measured,
   Point_Dry_Run,
   Point_Setup_Failed,
   Point_Measurement_Failed,
   Point_Budget_Exhausted,
   Point_Wall_Time_Unavailable,
   Point_Throughput_Overflow);

Exact outcome for one attempted point.

Enumeration literals
Point_Not_Run

Internal initial state.

Point_Measured

Valid wall measurement and throughput.

Point_Dry_Run

Selection succeeded without timing.

Point_Setup_Failed

Work or selection raised.

Point_Measurement_Failed

Measurement raised.

Point_Budget_Exhausted

Whole-sweep budget ended before the point.

Point_Wall_Time_Unavailable

Wall summary could not derive a rate.

Point_Throughput_Overflow

Rate arithmetic overflowed.

Raw_Value

function Raw_Value (Amount : Work_Amount) return Exact_Value

Return exact unscaled work.

Parameters
Amount

Work identity.

Return value

Exact raw value.

Reference_Throughput

function Reference_Throughput (Result : Paired_Point_Result) return Throughput_Summary

Return reference-side throughput.

Parameters
Result

Paired point result.

Return value

Reference rate summary.

Status

function Status (Result : Ordinary_Point_Result) return Point_Status

Return an ordinary point's exact outcome.

Parameters
Result

Point result.

Return value

Point status.

Status

function Status (Result : Paired_Point_Result) return Point_Status

Return a paired point's exact outcome.

Parameters
Result

Point result.

Return value

Point status.

Stopped_Early

function Stopped_Early (Result : Ordinary_Sweep_Result) return Boolean

Test whether failure policy stopped an ordinary sweep.

Parameters
Result

Ordinary sweep.

Return value

True when registered points remain unattempted.

Stopped_Early

function Stopped_Early (Result : Paired_Sweep_Result) return Boolean

Test whether failure policy stopped a paired sweep.

Parameters
Result

Paired sweep.

Return value

True when registered points remain unattempted.

Sweep_Budget_Scope

type Sweep_Budget_Scope is (Per_Point_Budget, Whole_Sweep_Budget);

Interpretation of Configuration.Maximum_Sampling_Time.

Enumeration literals
Per_Point_Budget

Apply the limit independently at every point.

Whole_Sweep_Budget

Treat the limit as total outer elapsed time.

Sweep_Failure_Policy

type Sweep_Failure_Policy is (Stop_On_Point_Failure, Continue_After_Point_Failure);

Behavior after one point cannot produce a valid measurement.

Enumeration literals
Stop_On_Point_Failure

Retain failure and stop before later points.

Continue_After_Point_Failure

Retain failure and attempt later points.

Sweep_Mode

type Sweep_Mode is (Collect_Measurements, Dry_Run);

Whether timed measurement occurs.

Enumeration literals
Collect_Measurements

Select and measure every attempted point.

Dry_Run

Validate selection and work only; produce no rate.

Sweep_Policy

type Sweep_Policy is record
   Failure : Sweep_Failure_Policy := Stop_On_Point_Failure;
   Budget  : Sweep_Budget_Scope := Per_Point_Budget;
   Mode    : Sweep_Mode := Collect_Measurements;
end record;

Per_Point_Budget passes Config.Maximum_Sampling_Time unchanged to every point. Whole_Sweep_Budget interprets that field as an outer elapsed-time budget, including selection, warmup, calibration, and collection; each point receives the remaining duration as its collection limit. Zero is unlimited in either mode.

Record fields
Failure

Stop or continue after one failed point.

Budget

Per-point or whole-sweep budget interpretation.

Mode

Measurement or unmistakable dry run.

Throughput

function Throughput (Result : Ordinary_Point_Result) return Throughput_Summary

Return ordinary wall-derived throughput.

Parameters
Result

Point result.

Return value

Available or explicitly unavailable rate summary.

Throughput_Availability

type Throughput_Availability is
  (Throughput_Available, Wall_Time_Unavailable, Invalid_Wall_Summary, Throughput_Overflow);

Availability of wall-derived rate summaries.

Enumeration literals
Throughput_Available

Every rate is finite and positive.

Wall_Time_Unavailable

No completed wall measurement exists.

Invalid_Wall_Summary

Wall inputs are invalid or incoherent.

Throughput_Overflow

Derived arithmetic exceeded numeric bounds.

Throughput_Direction

type Throughput_Direction is (Higher_Is_Better);

Favorable throughput direction.

Enumeration literals
Higher_Is_Better

More work per second is favorable.

Throughput_Summary

type Throughput_Summary is private;

Median and confidence-bound operations and work rates.

Unit_Kind

function Unit_Kind (Amount : Work_Amount) return Work_Unit_Kind

Return work-unit kind.

Parameters
Amount

Work identity.

Return value

Items, bytes, or caller-named.

Unit_Name

function Unit_Name (Amount : Work_Amount) return String

Return stable raw unit name.

Parameters
Amount

Work identity.

Return value

items, bytes, or caller name.

Value

function Value (Item : Parameter_Point) return Exact_Value

Return a point's exact input.

Parameters
Item

Parameter point.

Return value

Positive unsigned value.

Wall_Time_Available

function Wall_Time_Available (Summary : Throughput_Summary) return Boolean

Test whether the source wall summary remains valid. This is true when rate arithmetic overflowed after validating the collected wall values.

Parameters
Summary

Derived rate summary.

Return value

True for available rates or throughput-only overflow.

Work

function Work
  (Value   : Exact_Value;
   Unit    : Work_Unit_Kind;
   Name    : String := "";
   Scaling : Display_Scaling := Decimal_Scaling) return Work_Amount

Construct work from an already exact positive value.

Parameters
Value

Exact integral amount.

Unit

Built-in or caller-named unit kind.

Name

Required only for Caller_Named.

Scaling

Human display scaling.

Return value

Validated exact work amount.

Work

function Work
  (Value   : Long_Float;
   Unit    : Work_Unit_Kind;
   Name    : String := "";
   Scaling : Display_Scaling := Decimal_Scaling) return Work_Amount

Construct an integral work amount per logical operation. Value must be finite, positive, exactly integral, and representable by Exact_Value. Caller_Named requires a valid Unit; built-in units require Unit = "".

Parameters
Value

Integral amount supplied as a floating-point value.

Unit

Built-in or caller-named unit kind.

Name

Required only for Caller_Named.

Scaling

Human display scaling.

Return value

Validated exact work amount.

Work_Amount

type Work_Amount is private;

Exact integral work performed by one logical operation.

Work_Available

function Work_Available (Result : Ordinary_Point_Result) return Boolean

Test whether ordinary setup established exact work.

Parameters
Result

Point result.

Return value

False when work failed or the point was skipped before setup.

Work_Available

function Work_Available (Result : Paired_Point_Result) return Boolean

Test whether paired setup established exact work.

Parameters
Result

Point result.

Return value

False when work failed or the point was skipped before setup.

Work_Confidence_High

function Work_Confidence_High (Summary : Throughput_Summary) return Long_Float

Return upper work-rate confidence endpoint.

Parameters
Summary

Derived rate summary.

Return value

Upper operations endpoint times raw work, or zero.

Work_Confidence_Low

function Work_Confidence_Low (Summary : Throughput_Summary) return Long_Float

Return lower work-rate confidence endpoint.

Parameters
Summary

Derived rate summary.

Return value

Lower operations endpoint times raw work, or zero.

Work_Per_Operation

function Work_Per_Operation (Result : Ordinary_Point_Result) return Work_Amount

Return ordinary work per logical operation.

Parameters
Result

Point result.

Return value

Exact work identity.

Raised exceptions
Constraint_Error

Work was not established.

Work_Per_Operation

function Work_Per_Operation (Result : Paired_Point_Result) return Work_Amount

Return paired work per logical operation.

Parameters
Result

Point result.

Return value

Exact work identity shared by both sides.

Raised exceptions
Constraint_Error

Work was not established.

Work_Unit_Kind

type Work_Unit_Kind is (Items, Bytes, Caller_Named);

Work-unit identity.

Enumeration literals
Items

Logical items processed.

Bytes

Bytes processed.

Caller_Named

Caller-defined bounded unit.

Work_Units_Per_Second

function Work_Units_Per_Second (Summary : Throughput_Summary) return Long_Float

Return median work units per second.

Parameters
Summary

Derived rate summary.

Return value

Median operations rate times raw work, or zero.