evijit HF Staff Claude Sonnet 4.6 commited on
Commit
970fdbe
·
1 Parent(s): 0f5fb5f

Fix ranks-high/low-in using only sidecar ordinal data

Browse files

- Require total > 0 so raw-score fallbacks (bestRankPosition = 0.59…)
never appear in the summary chips
- Exclude strong-ranked benchmarks from the weak list so they can't overlap
- Rename "Strong/Weak scores" → "Ranks high in / Ranks low in"
- Display rank as #position/total (not #score)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. components/benchmark-detail.tsx +34 -33
components/benchmark-detail.tsx CHANGED
@@ -2531,36 +2531,37 @@ export function BenchmarkDetail({
2531
  ? filteredBenchmarkGroups
2532
  : benchmarkGroups
2533
 
 
 
 
2534
  const rankedBenchmarkGroups = useMemo(
2535
- () => overviewBenchmarkGroups.filter((group) => getGroupPeerRank(group, modelIds, peerRanks) != null),
2536
- [overviewBenchmarkGroups, modelId, peerRanks]
2537
- )
2538
- const strongRankedBenchmarks = useMemo(
2539
- () =>
2540
- [...rankedBenchmarkGroups]
2541
- .sort((a, b) => {
2542
- const aRank = getGroupPeerRank(a, modelIds, peerRanks)
2543
- const bRank = getGroupPeerRank(b, modelIds, peerRanks)
2544
- const aRatio = aRank ? aRank.position / (aRank.total || aRank.position) : Number.POSITIVE_INFINITY
2545
- const bRatio = bRank ? bRank.position / (bRank.total || bRank.position) : Number.POSITIVE_INFINITY
2546
- return aRatio - bRatio
2547
- })
2548
- .slice(0, 3),
2549
- [rankedBenchmarkGroups, modelId, peerRanks]
2550
- )
2551
- const weakRankedBenchmarks = useMemo(
2552
  () =>
2553
- [...rankedBenchmarkGroups]
2554
- .sort((a, b) => {
2555
- const aRank = getGroupPeerRank(a, modelIds, peerRanks)
2556
- const bRank = getGroupPeerRank(b, modelIds, peerRanks)
2557
- const aRatio = aRank ? aRank.position / (aRank.total || aRank.position) : Number.NEGATIVE_INFINITY
2558
- const bRatio = bRank ? bRank.position / (bRank.total || bRank.position) : Number.NEGATIVE_INFINITY
2559
- return bRatio - aRatio
2560
- })
2561
- .slice(0, 3),
2562
- [rankedBenchmarkGroups, modelId, peerRanks]
2563
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2564
  const repeatedBenchmarkCount = overviewBenchmarkGroups.filter((group) => group.variants.length > 1).length
2565
  const setupDrivenBenchmarkCount = overviewBenchmarkGroups.filter((group) =>
2566
  group.variants.some((variant) => variant.variantType === "setup" || variant.variantType === "setup+slice")
@@ -4502,7 +4503,7 @@ export function BenchmarkDetail({
4502
  <dl className="ec-datalist max-w-[64rem] mb-8">
4503
  {strongRankedBenchmarks.length > 0 && (
4504
  <>
4505
- <dt>Strong scores</dt>
4506
  <dd>
4507
  <div className="flex flex-wrap gap-1.5">
4508
  {strongRankedBenchmarks.map((group) => {
@@ -4518,9 +4519,9 @@ export function BenchmarkDetail({
4518
  <span className="truncate max-w-[14rem] normal-case tracking-normal text-[12px] font-medium text-[color:var(--fg)]">
4519
  {group.title}
4520
  </span>
4521
- {rank && (
4522
  <span className="font-mono tabular-nums text-[color:var(--fg-muted)]">
4523
- #{rank.position}{rank.total ? `/${rank.total}` : ""}
4524
  </span>
4525
  )}
4526
  </button>
@@ -4532,7 +4533,7 @@ export function BenchmarkDetail({
4532
  )}
4533
  {weakRankedBenchmarks.length > 0 && (
4534
  <>
4535
- <dt>Weak scores</dt>
4536
  <dd>
4537
  <div className="flex flex-wrap gap-1.5">
4538
  {weakRankedBenchmarks.map((group) => {
@@ -4548,9 +4549,9 @@ export function BenchmarkDetail({
4548
  <span className="truncate max-w-[14rem] normal-case tracking-normal text-[12px] font-medium text-[color:var(--fg)]">
4549
  {group.title}
4550
  </span>
4551
- {rank && (
4552
  <span className="font-mono tabular-nums text-[color:var(--fg-muted)]">
4553
- #{rank.position}{rank.total ? `/${rank.total}` : ""}
4554
  </span>
4555
  )}
4556
  </button>
 
2531
  ? filteredBenchmarkGroups
2532
  : benchmarkGroups
2533
 
2534
+ // Only groups with actual sidecar ordinal rank data (total > 0) qualify
2535
+ // for the "ranks high / low in" summary. Fallback bestRankPosition values
2536
+ // are raw scores (0–1), not ordinal positions, so they must be excluded.
2537
  const rankedBenchmarkGroups = useMemo(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2538
  () =>
2539
+ overviewBenchmarkGroups.filter((group) => {
2540
+ const rank = getGroupPeerRank(group, modelIds, peerRanks)
2541
+ return rank != null && rank.total > 0
2542
+ }),
2543
+ [overviewBenchmarkGroups, modelId, peerRanks]
 
 
 
 
 
2544
  )
2545
+ const strongRankedBenchmarks = useMemo(() => {
2546
+ const sorted = [...rankedBenchmarkGroups].sort((a, b) => {
2547
+ const aRank = getGroupPeerRank(a, modelIds, peerRanks)!
2548
+ const bRank = getGroupPeerRank(b, modelIds, peerRanks)!
2549
+ return aRank.position / aRank.total - bRank.position / bRank.total
2550
+ })
2551
+ return sorted.slice(0, 3)
2552
+ }, [rankedBenchmarkGroups, modelId, peerRanks])
2553
+
2554
+ const weakRankedBenchmarks = useMemo(() => {
2555
+ const strongKeys = new Set(strongRankedBenchmarks.map((g) => g.key))
2556
+ const sorted = [...rankedBenchmarkGroups]
2557
+ .filter((g) => !strongKeys.has(g.key))
2558
+ .sort((a, b) => {
2559
+ const aRank = getGroupPeerRank(a, modelIds, peerRanks)!
2560
+ const bRank = getGroupPeerRank(b, modelIds, peerRanks)!
2561
+ return bRank.position / bRank.total - aRank.position / aRank.total
2562
+ })
2563
+ return sorted.slice(0, 3)
2564
+ }, [rankedBenchmarkGroups, strongRankedBenchmarks, modelId, peerRanks])
2565
  const repeatedBenchmarkCount = overviewBenchmarkGroups.filter((group) => group.variants.length > 1).length
2566
  const setupDrivenBenchmarkCount = overviewBenchmarkGroups.filter((group) =>
2567
  group.variants.some((variant) => variant.variantType === "setup" || variant.variantType === "setup+slice")
 
4503
  <dl className="ec-datalist max-w-[64rem] mb-8">
4504
  {strongRankedBenchmarks.length > 0 && (
4505
  <>
4506
+ <dt>Ranks high in</dt>
4507
  <dd>
4508
  <div className="flex flex-wrap gap-1.5">
4509
  {strongRankedBenchmarks.map((group) => {
 
4519
  <span className="truncate max-w-[14rem] normal-case tracking-normal text-[12px] font-medium text-[color:var(--fg)]">
4520
  {group.title}
4521
  </span>
4522
+ {rank && rank.total > 0 && (
4523
  <span className="font-mono tabular-nums text-[color:var(--fg-muted)]">
4524
+ #{rank.position}/{rank.total}
4525
  </span>
4526
  )}
4527
  </button>
 
4533
  )}
4534
  {weakRankedBenchmarks.length > 0 && (
4535
  <>
4536
+ <dt>Ranks low in</dt>
4537
  <dd>
4538
  <div className="flex flex-wrap gap-1.5">
4539
  {weakRankedBenchmarks.map((group) => {
 
4549
  <span className="truncate max-w-[14rem] normal-case tracking-normal text-[12px] font-medium text-[color:var(--fg)]">
4550
  {group.title}
4551
  </span>
4552
+ {rank && rank.total > 0 && (
4553
  <span className="font-mono tabular-nums text-[color:var(--fg-muted)]">
4554
+ #{rank.position}/{rank.total}
4555
  </span>
4556
  )}
4557
  </button>