Record serialized increments against one owned counter and report the deterministic final count.

actor-serialized count A coordination report can record state that an actor would keep consistent. An `actor` owns its counter and applies each `bump` one at a time so the updates never interleave, leaving a single deterministic total. This report models that guarantee with one owned `count` updated through a single `bump` step per loop iteration, since the trace bridge cannot instrument the body of an `actor` type cleanly; the scalar model keeps the same serialized, replay-safe behavior. With no updates the counter stays idle, with a few updates it is still counting, and once the count reaches the threshold it is reported as settled. The status line summarizes the mode while the count confirms the serialized total.

Actor Counter Coordination Report

updates
actor_counter_coordination_report.swift
Replay: real traced execution (multi-file project)
func bump(_ current: Int, by amount: Int) -> Int {
    return current + amount
}

let updates = 1
let step = 2
var count = 0

for _ in 0..<updates {
    count = bump(count, by: step)
}

var status = "counting"
if updates == 0 {
    status = "idle"
}
if count >= 6 {
    status = "settled"
}

let line = "updates=\(updates) count=\(count) \(status)"

print(line)
func bump(_ current: Int, by amount: Int) -> Int {
    return current + amount
}

let updates = 0
let step = 2
var count = 0

for _ in 0..<updates {
    count = bump(count, by: step)
}

var status = "counting"
if updates == 0 {
    status = "idle"
}
if count >= 6 {
    status = "settled"
}

let line = "updates=\(updates) count=\(count) \(status)"

print(line)
func bump(_ current: Int, by amount: Int) -> Int {
    return current + amount
}

let updates = 3
let step = 2
var count = 0

for _ in 0..<updates {
    count = bump(count, by: step)
}

var status = "counting"
if updates == 0 {
    status = "idle"
}
if count >= 6 {
    status = "settled"
}

let line = "updates=\(updates) count=\(count) \(status)"

print(line)
  1. updates ← 1, step ← 2, count ← 0

    5let updates→ 1 = 1  //@updates=0, 36let step→ 2 = 27var count→ 0 = 0
  2. for _ in 0..<updates

    9for _ in 0..<updates1 {10    count = bump(count0, by: step2)11}
  3. func bump(_ current: Int, by amount: Int) -> Int

    1func bump(_ current0: Int, by amount2: Int) -> Int {2    return current0 + amount23}
  4. count ← 2

    9for _ in 0..<updates {10    count→ 2 = bump(count, by: step2)11}
  5. status ← counting, line ← updates=1 count=2 counting

    13var status→ counting = "counting"14if updates == 0 {15    status = "idle"16}17if count >= 6 {18    status = "settled"19}2021let line→ updates=1 count=2 counting = "updates=\(updates1) count=\(count2) \(statuscounting)"2223print(lineupdates=1 count=2 counting)
    outputupdates=1 count=2 counting
  1. updates ← 0, step ← 2, count ← 0, status ← counting

    5let updates→ 0 = 06let step→ 2 = 27var count→ 0 = 089for _ in 0..<updates {10    count = bump(count, by: step)11}1213var status→ counting = "counting"14if updates == 0 {
  2. if updates == 0

    13var status = "counting"14if updates0 == 0 {15    status = "idle"16}
  3. line ← updates=0 count=0 idle

    21let line→ updates=0 count=0 idle = "updates=\(updates0) count=\(count0) \(statusidle)"2223print(lineupdates=0 count=0 idle)
    outputupdates=0 count=0 idle
  1. updates ← 3, step ← 2, count ← 0

    5let updates→ 3 = 36let step→ 2 = 27var count→ 0 = 0
  2. for _ in 0..<updates

    pass 1 of 3
    9for _ in 0..<updates3 {10    count = bump(count0, by: step2)11}
    All 3 passes — pass 1 is the card above
    passcount
    10
    22
    34
  3. func bump(_ current: Int, by amount: Int) -> Int

    pass 1 of 3
    1func bump(_ current0: Int, by amount2: Int) -> Int {2    return current0 + amount23}
    All 3 passes — pass 1 is the card above
    passcurrent
    10
    22
    34
  4. count ← 2

    9for _ in 0..<updates {10    count→ 2 = bump(count, by: step2)11}
  5. count ← 4

    9for _ in 0..<updates {10    count→ 4 = bump(count, by: step2)11}
  6. count ← 6

    9for _ in 0..<updates {10    count→ 6 = bump(count, by: step2)11}
  7. status ← counting

    13var status→ counting = "counting"14if updates == 0 {
  8. if count >= 6

    16}17if count6 >= 6 {18    status = "settled"19}
  9. line ← updates=3 count=6 settled

    21let line→ updates=3 count=6 settled = "updates=\(updates3) count=\(count6) \(statussettled)"2223print(lineupdates=3 count=6 settled)
    outputupdates=3 count=6 settled