A cache replacement policy chooses which existing cache line to evict when a new memory block targets a full cache set. It does not move the block to another set. CPUs commonly use pseudo-LRU because exact least-recently-used tracking is too complex. section 12.1.5
When repeated rows evict one another
A matrix traversal can repeatedly address blocks whose set index is 00. After set 0 fills, reading the next row replaces an existing line; revisiting the first row then misses because its block was evicted. These conflict misses arise from concentrating accesses in one cache set, a pattern called a critical stride. section 12.1.5
func calculateSum512(s [][512]int64) int64 { #1
var sum int64
for i := 0; i < len(s); i++ {
for j := 0; j < 8; j++ {
sum += s[i][j]
}
}
return sum
}
func calculateSum513(s [][513]int64) int64 { #2
// Same implementation as calculateSum512
}
Compare the otherwise identical calculateSum512 and calculateSum513 traversals when diagnosing cache behavior caused by their row layouts. section 12.1.5

