[#cluster_linearize-SFLDefaultCostModel] = xref:cluster_linearize.adoc[cluster_linearize]::SFLDefaultCostModel :relfileprefix: ../ :mrdocs: A default cost model for SFL for SetType=BitSet<64>, based on benchmarks. == Synopsis Declared in `<cluster_linearize.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class SFLDefaultCostModel; ---- == Description The numbers here were obtained in February 2026 by: * For a variety of machines: * Running a fixed collection of ~385000 clusters found through random generation and fuzzing, optimizing for difficulty of linearization. * Linearize each ~3000 times, with different random seeds. Sometimes without input linearization, sometimes with a bad one. * Gather cycle counts for each of the operations included in this cost model, broken down by their parameters. * Correct the data by subtracting the runtime of obtaining the cycle count. * Drop the 5% top and bottom samples from each cycle count dataset, and compute the average of the remaining samples. * For each operation, fit a least‐squares linear function approximation through the samples. * Rescale all machine expressions to make their total time match, as we only care about relative cost of each operation. * Take the per‐operation average of operation expressions across all machines, to construct expressions for an average machine. * Approximate the result with integer coefficients. Each cost unit corresponds to somewhere between 0.5 ns and 2.5 ns, depending on the hardware. == Member Functions [cols="1,4"] |=== | Name| Description | xref:cluster_linearize/SFLDefaultCostModel/ActivateBegin.adoc[`ActivateBegin`] | Marks the start of activating a dependency. | xref:cluster_linearize/SFLDefaultCostModel/ActivateEnd.adoc[`ActivateEnd`] | Accounts for the cost of activating a dependency. | xref:cluster_linearize/SFLDefaultCostModel/DeactivateBegin.adoc[`DeactivateBegin`] | Marks the start of deactivating a dependency. | xref:cluster_linearize/SFLDefaultCostModel/DeactivateEnd.adoc[`DeactivateEnd`] | Accounts for the cost of deactivating a dependency. | xref:cluster_linearize/SFLDefaultCostModel/GetCost.adoc[`GetCost`] | Returns the accumulated cost. | xref:cluster_linearize/SFLDefaultCostModel/GetLinearizationBegin.adoc[`GetLinearizationBegin`] | Marks the start of extracting the linearization. | xref:cluster_linearize/SFLDefaultCostModel/GetLinearizationEnd.adoc[`GetLinearizationEnd`] | Marks the end of extracting the linearization (cost already charged in InitializeEnd). | xref:cluster_linearize/SFLDefaultCostModel/InitializeBegin.adoc[`InitializeBegin`] | Marks the start of the initialization phase. | xref:cluster_linearize/SFLDefaultCostModel/InitializeEnd.adoc[`InitializeEnd`] | Accounts for the cost of initialization and of the final linearization. | xref:cluster_linearize/SFLDefaultCostModel/MakeTopologicalBegin.adoc[`MakeTopologicalBegin`] | Marks the start of making the linearization topological. | xref:cluster_linearize/SFLDefaultCostModel/MakeTopologicalEnd.adoc[`MakeTopologicalEnd`] | Accounts for the cost of making the linearization topological. | xref:cluster_linearize/SFLDefaultCostModel/MergeChunksBegin.adoc[`MergeChunksBegin`] | Marks the start of merging chunks. | xref:cluster_linearize/SFLDefaultCostModel/MergeChunksEnd.adoc[`MergeChunksEnd`] | Accounts for the per‐step cost of merging chunks. | xref:cluster_linearize/SFLDefaultCostModel/MergeChunksMid.adoc[`MergeChunksMid`] | Accounts for the per‐transaction cost of merging chunks. | xref:cluster_linearize/SFLDefaultCostModel/MinimizeStepBegin.adoc[`MinimizeStepBegin`] | Marks the start of a single minimization step. | xref:cluster_linearize/SFLDefaultCostModel/MinimizeStepEnd.adoc[`MinimizeStepEnd`] | Accounts for the cost of finishing a minimization step. | xref:cluster_linearize/SFLDefaultCostModel/MinimizeStepMid.adoc[`MinimizeStepMid`] | Accounts for the per‐transaction cost of a minimization step. | xref:cluster_linearize/SFLDefaultCostModel/PickChunkToOptimizeBegin.adoc[`PickChunkToOptimizeBegin`] | Marks the start of picking a chunk to optimize. | xref:cluster_linearize/SFLDefaultCostModel/PickChunkToOptimizeEnd.adoc[`PickChunkToOptimizeEnd`] | Accounts for the cost of picking a chunk to optimize. | xref:cluster_linearize/SFLDefaultCostModel/PickDependencyToSplitBegin.adoc[`PickDependencyToSplitBegin`] | Marks the start of picking a dependency to split. | xref:cluster_linearize/SFLDefaultCostModel/PickDependencyToSplitEnd.adoc[`PickDependencyToSplitEnd`] | Accounts for the cost of picking a dependency to split. | xref:cluster_linearize/SFLDefaultCostModel/PickMergeCandidateBegin.adoc[`PickMergeCandidateBegin`] | Marks the start of picking a merge candidate. | xref:cluster_linearize/SFLDefaultCostModel/PickMergeCandidateEnd.adoc[`PickMergeCandidateEnd`] | Accounts for the cost of picking a merge candidate. | xref:cluster_linearize/SFLDefaultCostModel/StartMinimizingBegin.adoc[`StartMinimizingBegin`] | Marks the start of a minimization pass. | xref:cluster_linearize/SFLDefaultCostModel/StartMinimizingEnd.adoc[`StartMinimizingEnd`] | Accounts for the cost of starting a minimization pass. | xref:cluster_linearize/SFLDefaultCostModel/StartOptimizingBegin.adoc[`StartOptimizingBegin`] | Marks the start of setting up an optimization round. | xref:cluster_linearize/SFLDefaultCostModel/StartOptimizingEnd.adoc[`StartOptimizingEnd`] | Accounts for the cost of setting up an optimization round. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#