Pseudocode · three rounds

1if cta == 1: # producer 2 for round in range(3): 3 arrive_remote(full) 4if cta == 0: # consumer 5 for round in range(3): 6 wait(full, round % 2) 7 out[round] = round + 1

One thread per CTA executes the protocol. Barrier full lives on CTA 0 and needs one arrival per phase. Initialization is complete.

State
P = producer arrivals
C = completed consumer waits
Each arrival advances the phase; parity = phase % 2.

The search stops a branch when the producer completes a second phase before the consumer observes the first.

Reachable states · L = pseudocode line

Try each enabled event

After either of the first two arrivals, the consumer can finish its wait or the producer can arrive again. The search explores both choices. Red states mark a phase completed before the preceding phase was observed.