Skip to content
class

TraceIdMap

TraceIdMap

Bidirectional mapping between a trace's raw TensorId values and the canonical first-appearance numbering minted by make_cache_key.

The session ExecutableCache stores each cached executable with its input_ids and output_ids translated into canonical indices 0 .. to_raw.size() - 1 via canonicalize_executable, and each caller of compile_or_cached receives a copy relabelled into that caller's own raw TensorId space via localize_executable. Without this translation, a session-cache hit returned an executable whose input_ids / output_ids carried the first trace's raw ids — which either failed feed lookup in the second trace (silently dropping the second callable to eager) or bound feeds in the wrong order when an earlier RNG draw or folded constant shifted raw ids (LCD-454).