anchor.diff:    Merger = fun(_Key, V1, V2) -> max(V1, V2) end,
     orddict:merge(Merger, D1, D2).
   
  +find_latest_hb_index(ActorClock, StateClock) ->
  +  %% This is the max index that is in the Actor clock but not in the
  +  %% corresponding state clock.
  +  Fold =
  +    fun(K, V, Next) ->
  +        case orddict:find(K, StateClock) =:= {ok, V} of
  +          true -> Next;
  +          false -> max(V, Next)
  +        end
  +    end,
  +  orddict:fold(Fold, -1, ActorClock).
  +
   -else.
   
   empty_map() ->
  
positive.code:              || {I,S} <- IndexedNotDep])]
       end).
  
  maybe_log_race(TraceState, Index, Event, State) ->
    #scheduler_state{logger = Logger} = State,
    if State#scheduler_state.show_races ->
        #trace_state{done = [EarlyEvent|_], index = EarlyIndex} = TraceState,
        EarlyUID = TraceState#trace_state.unique_id,
        UID = State#scheduler_state.current_state_unique_id,
        concuerror_logger:graph_race(Logger, EarlyUID, UID),
        IndexedEarly = {EarlyIndex, EarlyEvent#event{location = []}},
        IndexedLate = {Index, Event#event{location = []}},
  
negative.code: -record(scheduler_state, {
            assertions_only              :: boolean(),
            assume_racing                :: assume_racing_opt(),
            depth_bound                  :: pos_integer(),
            dpor                         :: concuerror_options:dpor(),
            entry_point                  :: mfargs(),
  