Struct EvalStat

Struct Documentation

struct EvalStat

Eval | <mode> | <time> | [left=L | right=R |] result=X | alloc=A | hw=H | rss=R | <label>

One log record per eval op. Line format: Which fields are set depends on the op’s arity:

mode | left/right | alloc ——————————————-&#8212;+———&#8212;+—–&#8212; Constant / Variable / Tensor (leaf) | — | result Permute / MultByPhase / | — | result Symmetrize / Antisymmetrize | | SumInplace | — | 0B Sum / Product | set | result

Only Sum and Product set left/right, since their operand sizes can differ from the result. Other modes omit those fields rather than zeroing them, so a logged 0B always means an empty buffer.

mem_result is the size of the buffer the op produces; for SumInplace it’s the size of the accumulator after the add. mem_alloc is what the op allocated — equal to mem_result everywhere except SumInplace, which writes into the accumulator and allocates nothing.

mem_hwmark is the eval engine’s high-water mark: the running maximum, over all ops since the cache was last reset, of the per-op live working set

bytes(cache) + bytes(result) + bytes of each operand not aliased to a cache entry

(aliasing is evaluated at each call site using cache.alive, canon_phase, and the requested layout). It is reported as a running max so it is monotonically non-decreasing within one evaluation — the peak memory the engine reaches — rather than the instantaneous per-op working set, which oscillates as the cache fills and drains. The max is held by the CacheManager and cleared by CacheManager::reset() (called per term), so each term reports its own peak.

rss is the process physical-memory footprint measured immediately before the record is emitted (phys_footprint via TASK_VM_INFO on macOS — the value Activity Monitor’s “Memory” column shows; resident pages from /proc/self/statm on Linux; 0 on other platforms). Use it to triage memory held outside the eval engine — long-lived tensors not in the cache, runtime/library overhead, allocator fragmentation. mem_hwmark and rss diverge by roughly that “everything else” component.

Public Members

EvalMode mode
Duration time
Bytes mem_result = {}
Bytes mem_alloc = {}
Bytes mem_hwmark = {}
std::optional<Bytes> mem_left
std::optional<Bytes> mem_right