Struct DefUseMeter

Nested Relationships

Nested Types

Struct Documentation

struct DefUseMeter

diagnostic (analysis-only, off by default): measures def-to-use distance — how many production “ops” elapse between a value being stored (produced by a contraction) and each time it is consumed. A global op-clock ticks once per genuine store_and_access(key,data); each value records its production tick, and every access_at hit accumulates (current_clock - production_tick), weighted by the operand’s bytes. The byte-weighted aggregate proxies CPU-cache reload pressure: a large operand that waited many ops between production and use is likely evicted from cache and must be reloaded from DRAM when finally read. Uniform across schedulers (both route produced values through store_and_access() and reads through access_at). Robust to forest’s immediate-consume bypass: a distance-0 consumption contributes ~0 to the byte-weighted sum. Env gate SEQUANT_UT_DEFUSE_METER; inert when unset. Single-threaded runs only.

Public Static Functions

static inline bool enabled() noexcept
static inline std::size_t &op_clock() noexcept
static inline std::unordered_map<std::size_t, std::size_t> &produce_at() noexcept
static inline std::unordered_map<std::size_t, std::size_t> &store_count() noexcept

distinct-node -> number of store (production) events, exposing recompute: a node stored more than (iterations) times was rebuilt while cacheable.

static inline std::size_t &reads() noexcept
static inline std::uint64_t &sum_dist() noexcept
static inline long double &sum_dist_bytes() noexcept
static inline long double &sum_bytes() noexcept
static inline std::size_t &max_dist() noexcept
static inline void on_store(std::size_t hash) noexcept

Tick the op-clock and record this value’s production time.

static inline void on_read(std::size_t hash, std::size_t bytes) noexcept

Accumulate the def-to-use distance for a consumption of hash whose current stored size is bytes. Values never stored (leaves/inputs) are skipped &#8212; their production op is undefined.

Public Static Attributes

static Reporter reporter_ = {}
struct Reporter

Public Functions

inline ~Reporter()