#!/usr/bin/env bash
# Resolve bench runtime tree — flat layout (2026-07): ~/EtherGold/dev (or prod if imaged).
# Sourced by switch/apply scripts — do not execute directly.

resolve_bench_timing_root() {
  local dev="${ETHERGOLD_DEV:-${ETHERGOLD_ROOT:-$HOME/EtherGold}/dev}"
  local runtime="${ETHERGOLD_RUNTIME:-${dev}}"
  if [[ -f "${runtime}/run_bridge_jun11_good.sh" ]]; then
    printf '%s' "${runtime}"
    return 0
  fi
  printf '%s' "${dev}"
}

if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
  echo "resolve_bench_timing.sh — source from switch/apply scripts" >&2
  exit 1
fi
