Coherence triage starts by separating stale data from wrong order. Stale data means ownership moved wrongly; wrong order means visibility arrived in an unexpected sequence.
Symptom | Signature to confirm | First trigger |
|---|---|---|
Stale read after a remote write | Owner timeline shows a missing invalidate ack | Ack-timeout precursor counter |
Right data, wrong order | Fence spacing against the visibility window | Hand to the ordering model |
Progress stalls with free datapath | Credit and queue occupancy, not ownership | Retry-rate counters |
Reconstruct who owned each line, who invalidated it, and who acknowledged. Per-line ownership plus invalidate-ack records carry the causality.
Trace with triggers, not always-on capture. Broad tracing perturbs arbitration and hides the bug it should catch.
Counter | What it arms | Window captured |
|---|---|---|
Ack timeout | A missing invalidate acknowledgement | 64 cycles around the gap |
Fence outlier | A visibility delay past the bound | Barrier plus burst |
Retry rate | Credit pressure near a mismatch | Completion skew window |
True sharing moves a hot line between writers. Each handoff pays a miss plus invalidations, so cost follows miss penalty times handoff rate.
Assume a 64 B line, a 100 ns miss penalty, and 1000 handoffs.
Ping-pong on one line, 1000 iterations:
misses = 1000
bytes moved = 1000 x 64 B = 64 000 B
time = 1000 x 100 ns = 100 000 ns = 100 usFalse sharing splits one line across cores that touch disjoint bytes. Assume eight 8 B counters in one 64 B line with per-core increments.
False sharing, 8 counters in one line vs one counter per line:
shared line: each increment invalidates the other 7 sharers
padded lines: each increment stays local
invalidation ratio about 8 to 1; fix by padding or per-core mergeClosure needs invariant monitors plus a soak sized from the repro rate. A falling repro rate alone proves nothing.
Assume 7 hits in 500 runs, then a fix followed by a clean soak.
Repro rate and soak sizing:
p = 7 / 500 = 0.014 = 1.4 percent
runs for 95 percent capture = 3 / 0.014 = 214.3, so about 215 runs
clean soak of 3000 runs: 95 percent upper bound = 3 / 3000 = 0.001, about 0.1 percentAbout 215: 3 divided by 0.014.
A true rate near or below 0.1 percent at 95 percent confidence, with no unexplained near-miss patterns.