Skip to main content

Module optimizer_trace

Module optimizer_trace 

Source
Expand description

One place to read what the optimizer dropped and what the executor chose (ROADMAP rows 157, 158).

Two kinds of event, both cheap and always on:

  • The executor’s arm choice. Every Op::Branch the streaming walk resolves bumps one atomic per arm index (0, 1, 2, and 3 for “3 or more”). No allocation, no lock.
  • What the region pathfinder did with its candidates. Candidates dropped because they overlap a larger chosen region, branches recorded, branches collapsed to one arm, and branches finalize_branches REJECTED, with the reason. Rejections used to be thrown away (.ok().flatten()); the reasons are kept here, newest MAX_KEPT_REJECTIONS, behind a lock that only a rejection takes.

Read it with snapshot; compare two snapshots with TraceSnapshot::since. The counters are process-wide and monotonic, so a test that wants “this realize only” takes a snapshot before and after. FUEL_PRINT_BRANCH_COUNT=1 still prints the same events as they happen.

Structs§

Trace
The counters. The process has one (global); tests build their own so they cannot race with the rest of the test binary.
TraceSnapshot
A copy of the counters at one moment.

Constants§

ARM_SLOTS
Number of arm-index slots: arms 0, 1, 2, and slot 3 for arm 3 and above.
BACKEND_SLOTS
Backend slots for Trace::record_lookup_none: Cpu, Cuda, Vulkan, Metal, and slot 4 for any other backend.
MAX_KEPT_REJECTIONS
How many rejection reasons are kept (the newest).

Functions§

global
The process-wide trace the executor and the pathfinder write to.
snapshot
A copy of the process-wide counters.