diff --git a/harnesses/permissions-scan/cmd/script/static.go b/harnesses/permissions-scan/cmd/script/static.go new file mode 100644 index 00000000..65cdb15d --- /dev/null +++ b/harnesses/permissions-scan/cmd/script/static.go @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "math" +) + +var staticHours = map[string]float64{ + "lighter": 336, // 14-day Desert Mode from Ethereum priority queue (ZK self-exit) + "ostium": 720, // 3 × 30-day maxSettlementInterval (tryNewSettlement() public) + "gains": math.Inf(1), // oracle epochs required; no time-based override + "gmx": math.Inf(1), // keeper CONTROLLER role required; no user override + "vertex": math.Inf(1), // impl contracts unverified; slow-mode unconfirmed on-chain + "hyperliquid": math.Inf(1), // 2/3 validator co-sign; bridge EOA-upgradeable, no timelock + "aster": math.Inf(1), // 2/3 internal validators; no escape hatch documented +} + +func emitStatic() { + for venue, hours := range staticHours { + worstCaseHoursGauge.WithLabelValues(venue).Set(hours) + } + fmt.Println("[STATIC] perp_exit_worst_case_hours emitted for all 7 venues") +} diff --git a/src/components/count-leaderboard.tsx b/src/components/count-leaderboard.tsx index 0888c716..11a8fadc 100644 --- a/src/components/count-leaderboard.tsx +++ b/src/components/count-leaderboard.tsx @@ -24,19 +24,23 @@ export function CountLeaderboard({ headerActions?: ReactNode; }) { const ranked = rankResults(benchmark.results, benchmark.higherIsBetter); - const max = Math.max(...ranked.map((r) => r.ms.p50)) || 1; + // Exclude +Inf from max so finite bars render at meaningful widths + // instead of collapsing to 0% (Inf/Inf = NaN). + const finiteVals = ranked.map((r) => r.ms.p50).filter(Number.isFinite); + const max = Math.max(...finiteVals) || 1; const colors = useMemo(() => buildProviderColors(benchmark.results), [benchmark.results]); const [hoveredSlug, setHoveredSlug] = useState(null); const validRanked = ranked.filter((r) => r.ms.p50 > 0); const leader = validRanked[0]; const trailer = validRanked[validRanked.length - 1]; - const gapRatio = + const rawGap = leader && trailer && leader.ms.p50 > 0 ? benchmark.higherIsBetter ? leader.ms.p50 / trailer.ms.p50 : trailer.ms.p50 / leader.ms.p50 : 0; + const gapRatio = Number.isFinite(rawGap) ? rawGap : null; // range: always ascending (best → worst). for lower-is-better leader is min, // trailer is max; for higher-is-better flip them so low is still left. const [rangeMin, rangeMax] = benchmark.higherIsBetter @@ -75,7 +79,7 @@ export function CountLeaderboard({ /> 0 ? `${gapRatio.toFixed(1)}×` : "-"} + value={gapRatio != null && gapRatio > 0 ? `${gapRatio.toFixed(1)}×` : "-"} hint="leader vs lowest" /> @@ -87,7 +91,8 @@ export function CountLeaderboard({

    {ranked.map((r, i) => { - const pct = (r.ms.p50 / max) * 100; + // +Inf venues get full-width bar (visually "worst"); finite bar otherwise. + const pct = Number.isFinite(r.ms.p50) ? (r.ms.p50 / max) * 100 : 100; const color = colors.get(r.slug) ?? "var(--color-ink-soft)"; const hasFormula = Boolean(r.formula); const isHovered = hoveredSlug === r.slug; diff --git a/src/lib/format.ts b/src/lib/format.ts index 5677c2f6..47d1b7dd 100644 --- a/src/lib/format.ts +++ b/src/lib/format.ts @@ -82,6 +82,7 @@ export function fmtUnit(value: number, unit: string) { return `${value.toFixed(1)}x`; } if (unit === "count") { + if (!Number.isFinite(value)) return "∞"; // Sub-unit values are common when a "count" bench is measuring an // error or gap that converges toward zero (e.g. gas-oracle prediction // error in gwei — PublicNode feeHistory's p50 sits around 1e-9,