Function sequant::opt::detail::roofline_op_cost

Function Documentation

inline double sequant::opt::detail::roofline_op_cost(double flops, double traffic, double machine_balance, double fast_mem_elems, double block_tiles, double block_prefactor) noexcept

Per-contraction roofline secondary cost (tie-break wall-time proxy).

Returns max(flops, beta * Q), with data movement Q = max(traffic, kappa * flops / sqrt(M / c0)) combining compulsory single-pass traffic with the finite-cache (Hong-Kung) re-read bound. With beta (machine_balance) <= 0 this is exactly flops (pure-flop tie-break, no behavior change). traffic is the operand+result footprint (elements), M is fast_mem_elems, c0 is block_tiles, kappa is block_prefactor. See doc/dev/specs/2026-06-23-roofline-tiebreak-cost.md.