Skip to content

AMBA CHI · Module 22 · CHI Misconceptions Engineers Have

“Directory Means No Snoops”

Fixing one myth breeds its opposite. Having learned the directory fixes broadcast snooping, engineers over-correct into believing it removes snoops. It does not; it targets them. The directory knows which caches hold a line, so the Home snoops just those — and for many accesses nobody else holds it, so zero snoops. That is the kernel of truth: the uncontended case needs none. But a shared-line write must snoop the sharers to invalidate them, and a dirty-line read must snoop the holder to fetch the data — not optional, because the permission or data genuinely lives in another cache. The directory made snoops targeted, not absent — targeted is not zero. The trap is modeling a directory system as snoop-free.

Intermediate14 min readAMBA CHIMisconceptionDirectorySnoopingCoherence

Module 22 · Chapter 22.3 · CHI Misconceptions Engineers Have

Project thread — 22.2 fixed broadcast with the directory. 22.3 corrects the over-correction; 22.4 turns to ordering.

1. The Misconception

The belief: "a directory means no snoops — directory-based coherence doesn't snoop." It is the natural over-correction from Chapter 22.2: if the directory cures the broadcast snoop storm, then surely it removes snoops entirely. It is an Intermediate misconception because it appears precisely in engineers who have just learned the directory — the fix for one myth planting the next. The directory makes snoops few and targeted; it does not make them absent.

2. Why It's Tempting

The over-correction is tempting because the directory does eliminate snoops — often.

  • Many accesses genuinely need zero snoops. If the directory shows no other cache holds the line, a read or write proceeds with no snoop at all — and this is the common case.
  • The contrast is stark. Next to broadcast (snoop everyone), the directory's targeted approach feels like the opposite — and "opposite of broadcast" slides into "no snoops".
  • "Directory-based" sounds like "snoop-based's replacement". The taxonomy pits directory against snoop, so they feel mutually exclusive — but CHI is both.

The seed is real: the directory removes snoops for uncontended lines. The error is generalizing "often zero" to "always zero".

3. Key Terms

4. Previous Chapter Connection

This chapter completes Chapter 22.2. There, the directory turned broadcast into targeted snooping (Chapter 15.6); here we insist the target is not always empty. The coherence states (Chapter 4) explain why: a shared line being written, or a modified line held elsewhere, forces a snoop. The Home's role (Chapter 8) is to decide whether a snoop is needed and to whom.

Where 22.2 warned against assuming broadcast, 22.3 warns against the opposite — assuming none. Together they bracket the truth: snoops scale with sharing. And it sets up 22.4 (coherence vs ordering) and 22.5 (ReadUnique doesn't always fetch), both of which also hinge on not over-simplifying what the protocol actually does.

5. The Claim, Precisely

State the myth falsifiably.

Claim: "A directory-based protocol like CHI does not use snoops — the directory replaces snooping entirely."

Testable. If true, no CHI transaction would ever generate a snoop. But consider a line Shared by two caches when a third agent issues a write: to gain Unique, the writer needs those two copies invalidated, which the Home does by snooping them. A snoop provably occurs. The claim fails on the first shared-line write.

6. Why It's Wrong — The Core

The directory locates the caches that must be snooped; it does not make the need disappear.

  • Shared-write needs invalidating snoops. A writer must gain Unique, so every other sharer's copy must be invalidated — via snoops to those sharers.
  • Dirty data lives in a cache, not memory. If a modified copy is in another cache, the only place to get the latest data is that cache — reached by a snoop.
  • The directory knows who, not instead-of. The directory's contribution is which caches — turning broadcast into targeted. It does not remove the reason a snoop exists.
  • Zero only when unshared. Snoops drop to zero exactly when the directory shows no other holder — not in general.

The snoop count tracks contention/sharing: zero when uncontended, one or a few when shared or dirty — never guaranteed zero.

7. Engineering Diagram — the directory decides: zero or targeted

The Home consults its directory and branches: for an unshared line it answers directly with zero snoops, the common case that makes directories feel snoop-free; for a shared line a writer wants, it sends targeted snoops to the actual sharers to invalidate their copies; for a modified line held elsewhere, it snoops that cache to fetch the latest data. The directory changed broadcast-to-all into targeted-to-sharers, often none or one, but shared and dirty lines still require snoops.Requesterread or writeHome + directorywho holds the line?Unshared0 snoops — data directSharertargeted snoop —invalidateDirty holdertargeted snoop — fetchdatarequestif unsharedif shared+writeif dirty12
Figure 1 — a directory targets snoops, it does not remove them. The Home consults its directory and branches: for an unshared line it answers directly with zero snoops (the common case that makes directories feel snoop-free); for a shared line a writer wants, it sends targeted snoops to the actual sharers to invalidate their copies; for a modified line held elsewhere, it snoops that cache to fetch the latest data. The directory changed broadcast-to-all into targeted-to-sharers, but shared and dirty lines still require snoops.

The Home branches on the directory: unshared → zero snoops (why directories feel snoop-free), shared-write or dirty → targeted snoops to the caches that matter. The directory removed the broadcast, not the snoop.

8. The Mechanism

When a directory snoops, and when it does not.

ScenarioDirectory showsSnoops needed
Read an unshared lineno other holderzero — data from memory/SLC
Write an unshared lineno other holderzero — grant Unique directly
Write a shared lineother sharerstargeted — invalidate each sharer
Read a modified linedirty copy elsewheretargeted — fetch from that cache
Broadcast (no directory)all agents (the storm)

The rule to carry: a directory converts broadcast snoops into targeted snoops, and to zero only when there is genuinely nobody to snoop. The snoop is a physical necessity when permission or data lives in another cache — the directory decides who, never abolishes whether.

9. The Kernel of Truth

Steelman the belief.

  • Uncontended accesses truly need no snoop. Private data, memory-only lines, a line only the requester holds — the directory completes these with zero snoops. This is a large fraction of real traffic.
  • That is the directory's whole point. Avoiding snoops when possible is exactly the scaling win over broadcast (Chapter 22.2) — the belief correctly senses this.
  • Snoops become the exception, not the rule. For well-partitioned workloads, most lines are unshared, so snoops are rare — "mostly no snoops" is true.

The truth: the directory makes snoops the exception. The myth only errs by turning "mostly none" into "none" — dropping the shared and dirty cases where snoops are unavoidable.

10. A Concrete Counterexample

Two accesses to the same line — one snoop-free, one not.

  1. Access A — private read. Core 0 reads a line no one else holds. The Home's directory shows no sharers → it returns data from memory/SLC with zero snoops. The belief looks true.
  2. Now the line is Shared. Core 0 and Core 1 both hold it Shared — the directory records both.
  3. Access B — Core 2 writes it. Core 2 issues a write needing Unique. The Home cannot just grant it: Cores 0 and 1 hold stale-to-be copies.
  4. The unavoidable snoops. The Home sends targeted invalidating snoops to Core 0 and Core 1. Only after they invalidate can Core 2 get Unique and write.
  5. Count them. Access A: 0 snoops. Access B: 2 snoops — to the exact sharers, not everyone. The directory made B targeted, not snoop-free.

The counterexample is the same line, twice: zero snoops when unshared, two when shared-and-written. "Directory means no snoops" is true of A and false of B — so it is false as a general claim.

11. What's Actually True

The correct model.

  • A directory targets snoops; it does not eliminate them.
  • Zero snoops occur for unshared lines — the common, uncontended case.
  • Targeted snoops occur for shared-line writes (invalidate sharers) and dirty-line reads (fetch data).
  • Snoop count tracks sharing/contention — zero to a few, never guaranteed zero.
  • The win over broadcast is "targeted," not "absent" — few and precise, not none.

12. Why The Distinction Matters

Believing "no snoops" has concrete costs.

  • You under-provision the snoop channel. Assuming no SNP traffic leaves the SNP channel undersized for the real shared-write / dirty-fetch load (Chapter 21.4).
  • You mis-predict shared-write latency. Modeling a shared-line write as snoop-free underestimates its latency by the snoop round-trip (Chapter 15.1).
  • You mis-debug a "surprise" snoop. Seeing a snoop in a trace of a "directory" system looks like a bug if you believe there should be none (Chapter 21.5).
  • You misjudge false sharing. Not seeing that sharing drives snoops makes false-sharing performance cliffs mysterious (Chapter 15.7).

13. Design Implications

What to do once the over-correction is dropped.

  • Provision the SNP channel for real shared-write and dirty-fetch traffic — snoops are not zero.
  • Model snoop cost as a function of sharing — zero when private, a round-trip when shared/dirty.
  • Expect snoops in traces of shared/modified lines — they are correct, not bugs.
  • Attack sharing to cut snoops — reduce false sharing and needless sharing (Chapter 15.7).
  • Keep the mental model precise — directory = who to snoop, including no one, not never snoop.

14. The Trap

  • Directory and snooping are mutually exclusive. No — CHI is directory-coordinated snooping; it uses both.
  • A snoop in a directory system is a bug. No — snoops to sharers/dirty holders are required and correct.
  • Writes to shared lines are cheap. No — they cost invalidating snoops to every sharer (Chapter 15.6).
  • The directory always knows exactly who. Approximately — a snoop filter may over-approximate, causing extra snoops (the setup for Chapter 22.7).
  • Zero snoops is the normal case. Partly — true for unshared lines, false for shared/dirty ones.

16. Answering It In An Interview

If asked "does a directory eliminate snoops?" — the strong answer:

  1. Correct the absolute. "It targets snoops, it doesn't eliminate them. Broadcast → targeted, not → zero."
  2. Give the zero case. "For an unshared line the directory answers with no snoops — the common, uncontended case."
  3. Give the must-snoop cases. "But a shared-line write needs invalidating snoops to the sharers, and a dirty-line read needs a snoop to fetch the data — those are unavoidable."
  4. State the principle. "Snoop count tracks sharing — zero to a few, never guaranteed zero."

That distinguishes targeted from absent, gives both cases, and states the principle — reasoning, not recital (Chapter 21.6).

17. Key Takeaways

  • A directory targets snoops; it does not eliminate them.
  • Zero snoops for unshared lines — the common case that seeds the myth.
  • Targeted snoops are required for shared-line writes and dirty-line reads.
  • Snoop count tracks sharing/contention — zero to a few, never guaranteed zero.
  • The directory's win over broadcast is targeted, not absent.
  • The trap: modeling a directory system as snoop-free — under-provisioning SNP, mis-predicting latency.

18. Quick Revision

"Directory Means No Snoops" — refuted. The over-correction from Chapter 22.2: having learned the directory fixes the broadcast snoop storm, engineers conclude it removes snoops entirely. It does not — it targets them. The directory records which caches hold each line, so the Home snoops exactly those instead of broadcasting — and for unshared lines (private data, memory-only, a line only the requester holds) the answer is nobody else, so the access completes with zero snoops. That common, uncontended case is the kernel of truth and why directory coherence feels snoop-free. But it is not always: a write to a shared line requires invalidating snoops to every sharer (so the writer can gain Unique), and a read of a modified line requires a snoop to fetch the latest data from the cache that holds it — those snoops are a physical necessity, because the permission or the data genuinely lives in another cache the Home must reach. The directory turned a broadcast-to-all into a targeted-to-sharers (often none or one) — a huge win — but targeted is not zero. Snoop count tracks sharing/contention: zero when private, a few when shared or dirty, never guaranteed zero. The trap is modeling a directory system as snoop-free: under-provisioning the SNP channel (which then bottlenecks on real shared traffic), mis-predicting shared-write latency (off by a snoop round-trip), or mis-debugging a correct snoop as a bug. Model snoops as sharing-dependent, provision the SNP channel for the contended case, and hold the precise model — a directory decides who to snoop, possibly no one, never no snoops. Next, 22.4 separates coherence from ordering.

Coming Next

Chapter 22.4 — "Coherency Guarantees Ordering". Two properties engineers routinely fuse are actually distinct. Chapter 22.4 refutes "coherency guarantees ordering" — why keeping a single line's value consistent (coherence) is not the same as guaranteeing the order in which different memory operations become visible (the memory consistency model), why CHI provides coherence without implying sequential consistency, and why conflating the two produces some of the hardest CHI reasoning errors of all.