From 05bcabb73bce5747e5c9e5e415764a3852cf8824 Mon Sep 17 00:00:00 2001 From: Marius Bughiu Date: Sun, 19 Jul 2026 17:32:01 +0300 Subject: [PATCH] fix(DisjointSetBenchmark): rename ElementCount param to ItemCount so the dashboard card renders The benchmark dashboard (web/dev/bench/index.html and detail.html) parses BDN benchmark names with a regex that requires the literal `ItemCount:` in the parameter suffix. DisjointSetBenchmark emitted `(ElementCount: N)`, so `parseName` returned null for every arm and the DisjointSet card showed no data. Rename the `[Params]` property from `ElementCount` to `ItemCount` (matching every other core benchmark) so the emitted name matches the regex. No benchmark logic changes. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../DisjointSetBenchmark.cs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Celerity.Benchmarks/DisjointSetBenchmark.cs b/src/Celerity.Benchmarks/DisjointSetBenchmark.cs index 644a9b2..21e21a4 100644 --- a/src/Celerity.Benchmarks/DisjointSetBenchmark.cs +++ b/src/Celerity.Benchmarks/DisjointSetBenchmark.cs @@ -28,28 +28,28 @@ public class DisjointSetBenchmark private Dictionary> dictFull = null!; [Params(1000, 100_000)] - public int ElementCount; + public int ItemCount; [GlobalSetup] public void Setup() { - int edges = ElementCount; // a near-spanning edge stream over the universe + int edges = ItemCount; // a near-spanning edge stream over the universe edgeA = new int[edges]; edgeB = new int[edges]; var rand = new Random(42); for (int i = 0; i < edges; i++) { - edgeA[i] = rand.Next(ElementCount); - edgeB[i] = rand.Next(ElementCount); + edgeA[i] = rand.Next(ItemCount); + edgeB[i] = rand.Next(ItemCount); } - int queries = Math.Min(ElementCount, 10_000); + int queries = Math.Min(ItemCount, 10_000); queryA = new int[queries]; queryB = new int[queries]; for (int i = 0; i < queries; i++) { - queryA[i] = rand.Next(ElementCount); - queryB[i] = rand.Next(ElementCount); + queryA[i] = rand.Next(ItemCount); + queryB[i] = rand.Next(ItemCount); } dsFull = BuildCelerity(); @@ -130,8 +130,8 @@ public int Dictionary_Components() private DisjointSet BuildCelerity() { - var ds = new DisjointSet(ElementCount); - for (int i = 0; i < ElementCount; i++) + var ds = new DisjointSet(ItemCount); + for (int i = 0; i < ItemCount; i++) ds.Add(i); for (int i = 0; i < edgeA.Length; i++) ds.Union(edgeA[i], edgeB[i]); @@ -140,8 +140,8 @@ private DisjointSet BuildCelerity() private Dictionary> BuildDictionary() { - var map = new Dictionary>(ElementCount); - for (int i = 0; i < ElementCount; i++) + var map = new Dictionary>(ItemCount); + for (int i = 0; i < ItemCount; i++) map[i] = new HashSet { i }; for (int i = 0; i < edgeA.Length; i++)