From bb0a034d25351807101f748a1ed83d8b859699f8 Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Fri, 1 May 2026 15:00:01 -0700 Subject: [PATCH] fix: L1 cache benchmark uses wrong buffer size due to case mismatch The cache_size_kb() function looks up "L1D" in lscpu -C output, but lscpu reports the L1 data cache as "L1d" (lowercase d). The case-sensitive awk match silently fails, causing the buffer size to fall back to 1 KB instead of the intended half-of-L1d size. This affects both L1 idle latency and L1 max bandwidth benchmarks. Co-Authored-By: Claude Opus 4.6 --- internal/script/scripts.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/script/scripts.go b/internal/script/scripts.go index 8242aa77..714bba7c 100644 --- a/internal/script/scripts.go +++ b/internal/script/scripts.go @@ -171,8 +171,8 @@ CORES_PER_SOCKET=$(lscpu | grep -E 'Core\(s\) per socket:' | head -1 | awk '{pri BUF_KB=$(( L3_KB * 2 / CORES_PER_SOCKET )) MIN_KB=102400 [ $BUF_KB -lt $MIN_KB ] && BUF_KB=$MIN_KB` - // for measuring L1 bandwidth and latency (half of L1D cache size minus 4KB) - mlcBufferSetupL1 = `L1D_KB=$(cache_size_kb L1D) + // for measuring L1 bandwidth and latency (half of L1d cache size minus 4KB) + mlcBufferSetupL1 = `L1D_KB=$(cache_size_kb L1d) BUF_KB=$(( L1D_KB / 2 - 4 )) [ $BUF_KB -lt 1 ] && BUF_KB=1` // for measuring L2 bandwidth and latency (half of L2 cache size)