Cache Coherency · All levels

Directory vs Snoop Fundamentals

Broadcast snoops trade simplicity for traffic, while directory schemes trade metadata and lookup latency for scalable filtering.

What this topic teaches

Directory vs Snoop Fundamentals trains you to reason from shared-memory contract to actionable implementation and validation decisions.

Broadcast snoops trade simplicity for traffic, while directory schemes trade metadata and lookup latency for scalable filtering.

Core metric and artifact

diagram
METRIC: snoop bandwidth overhead vs served-demand bandwidth
ARTIFACT: fabric traffic report + sharer-vector histogram

Execution flow

diagram
COHERENCY DECISION FLOW — Directory vs Snoop Fundamentals

request intent (read/shared/unique/writeback/evict)
      |
      v
ownership check + sharer metadata evaluation
      |
      v
snoop / directory action + ordering gate
      |
      v
data source selection (owner forward vs memory)
      |
      v
state transition + acknowledgment closure
      |
      v
metric validation + regression guardrails

How to use this topic

  1. Read mechanism first and restate the invariant in your own words.

  2. Trace one realistic request flow through ownership transitions.

  3. Use reports and debug pages to connect symptom to evidence.

  4. Close with checklist and PPA impact before proposing product changes.

Key takeaways

  • Coherency work is contract engineering, not signal memorization.

  • Carry transaction identity across every tool and team boundary.

  • A change is complete only after regression and ownership signoff.

Common pitfalls

  • Assuming a fast benchmark implies protocol correctness.

  • Ignoring ordering edges when optimization pressure is high.

  • Skipping evidence preservation during urgent bug triage.

Cache coherency deep dive

Cache coherence is a correctness contract across caches, interconnect, and software ordering.

Concept diagram

diagram
requester -> coherence fabric -> owner or memory -> state update

Metric graph

diagram
traffic mix across request, snoop, response, data

Metrics and artifacts to collect

  • coherence latency

  • invalidation rate

  • retry rate

  • stale-read incidents

Mini case study

Anchor debug to first stale read and the exact line state transition.

Debug branches

  • Track ownership

  • Track ordering

  • Track evidence

Senior review question

Ask: what is the first line state transition that deviates, and which ordering rule does it break?

Key takeaways

  • Tie every coherency claim to one cache line, one transaction identity, and one measurable counter.

  • Keep proof artifacts from simulation and silicon replay aligned by address, state, and ordering event.

Common pitfalls

  • Chasing bandwidth regressions without checking false sharing and line bouncing first.

  • Assuming coherence correctness implies memory consistency correctness.

  • Declaring closure without litmus, stress, and post-silicon replay evidence.