Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • Architecture Metrics Reference
  • Workload Taxonomy for Architects
  • Architecture Glossary
  • Computer Architecture Cheatsheet
  • Pipeline Fundamentals14
  • Memory Hierarchy15
  • NoC and Interconnect Architecture6
  • Coherency and Memory Ordering9
    • Cache Coherence for the Architect
      • MESI States and the Single-Writer Invariant
      • Misses, Upgrades, and Evictions
      • Variants and Scaling: MOESI, MESIF, Snoop, Directory
      • ACE and CHI: An Honest Introduction
      • Sharing Costs and Coherence Triage
    • Memory Ordering Models
  • Performance Analysis9
  • Accelerator Architectures6
  • SoC Architecture Tradeoffs9
  • Architecture Interview Prep14
Loading lesson

‹Cache Coherence for the Architect
  1. Topics
  2. Computer Architecture
  3. Coherency and Memory Ordering
  4. Cache Coherence for the Architect
  5. Sharing Costs and Coherence Triage

Computer Architecture · All levels

Sharing Costs and Coherence Triage

From symptom to root cause: timelines, selective triggers, and invariant closure.

On this page

    Symptom to signature

    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

    Ownership timelines and selective triggers

    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

    Sharing costs: ping-pong and false sharing

    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.

    Diagram
    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 us

    False sharing splits one line across cores that touch disjoint bytes. Assume eight 8 B counters in one 64 B line with per-core increments.

    Diagram
    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 merge

    Closure: proving it stays fixed

    Closure 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.

    Diagram
    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 percent

    Common pitfall

    Declaring victory when the repro rate falls. Monitors must show zero illegal transitions and bounded ack latency across the whole soak.

    Interview

    On-call: a stale-data bug appears once per several billion transactions. Answer with selective trigger capture around precursor counters, a per-line ownership timeline, and closure by invariant monitors plus a sized soak.

    Check yourself 7 hits in 500 runs: how many runs give 95 percent capture confidence?

    About 215: 3 divided by 0.014.

    Check yourself The soak runs 3000 times with zero hits and clean monitors. What can you claim?

    A true rate near or below 0.1 percent at 95 percent confidence, with no unexplained near-miss patterns.

    Related topics

    • Cache-coherency course

    • Memory consistency models

    Previous

    44 / 86

    Next: Memory Ordering Models

    Up next

    Up nextMemory Ordering Models

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • MESI States and the Single-Writer Invariant
    • Misses, Upgrades, and Evictions
    • Variants and Scaling: MOESI, MESIF, Snoop, Directory