Show weighted-only speed on main page; add Gen tok/s column to scenario results

This commit is contained in:
PeterChrz 2026-09-30 19:35:17 -04:00
parent 8c9e512fc2
commit 6c19822235
Signed by untrusted user who does not match committer: pch
GPG key ID: 8F0826ECF7302C63
2 changed files with 17 additions and 12 deletions

View file

@ -13,7 +13,7 @@
private const SORTABLE = [ private const SORTABLE = [
'scenario', 'level', 'ok', 'outcome', 'scenario', 'level', 'ok', 'outcome',
'wall', 'turns', 'commands', 'submissions', 'rejected', 'wall', 'turns', 'commands', 'submissions', 'rejected',
't_first_sub', 't_pass', 'gen_tokens', 't_first_sub', 't_pass', 'gen_tokens', 'gen_tps',
]; ];
public ?int $sessionId = null; public ?int $sessionId = null;
@ -78,11 +78,16 @@ public function results()
$column = in_array($this->sortBy, self::SORTABLE, true) ? $this->sortBy : 'scenario'; $column = in_array($this->sortBy, self::SORTABLE, true) ? $this->sortBy : 'scenario';
$direction = $this->sortDirection === 'asc' ? 'asc' : 'desc'; $direction = $this->sortDirection === 'asc' ? 'asc' : 'desc';
return DB::table('scenario_runs') $query = DB::table('scenario_runs')
->whereIn('benchmark_run_id', $runIds) ->whereIn('benchmark_run_id', $runIds);
->orderBy($column, $direction)
->orderBy('id') if ($column === 'gen_tps') {
->get(); $query->orderByRaw('gen_tokens / nullif(wall, 0) ' . $direction);
} else {
$query->orderBy($column, $direction);
}
return $query->orderBy('id')->get();
} }
}; };
?> ?>
@ -120,6 +125,7 @@ public function results()
<flux:table.column sortable :sorted="$sortBy === 't_first_sub'" :direction="$sortDirection" wire:click="sort('t_first_sub')" class="text-center">{{ __('t first sub') }}</flux:table.column> <flux:table.column sortable :sorted="$sortBy === 't_first_sub'" :direction="$sortDirection" wire:click="sort('t_first_sub')" class="text-center">{{ __('t first sub') }}</flux:table.column>
<flux:table.column sortable :sorted="$sortBy === 't_pass'" :direction="$sortDirection" wire:click="sort('t_pass')" class="text-center">{{ __('t pass') }}</flux:table.column> <flux:table.column sortable :sorted="$sortBy === 't_pass'" :direction="$sortDirection" wire:click="sort('t_pass')" class="text-center">{{ __('t pass') }}</flux:table.column>
<flux:table.column sortable :sorted="$sortBy === 'gen_tokens'" :direction="$sortDirection" wire:click="sort('gen_tokens')" class="text-center">{{ __('Gen tokens') }}</flux:table.column> <flux:table.column sortable :sorted="$sortBy === 'gen_tokens'" :direction="$sortDirection" wire:click="sort('gen_tokens')" class="text-center">{{ __('Gen tokens') }}</flux:table.column>
<flux:table.column sortable :sorted="$sortBy === 'gen_tps'" :direction="$sortDirection" wire:click="sort('gen_tps')" class="text-center">{{ __('Gen tok/s') }}</flux:table.column>
</flux:table.columns> </flux:table.columns>
<flux:table.rows> <flux:table.rows>
@ -145,6 +151,7 @@ public function results()
<flux:table.cell class="text-center font-mono text-sm">{{ number_format($result->t_first_sub, 1) }}</flux:table.cell> <flux:table.cell class="text-center font-mono text-sm">{{ number_format($result->t_first_sub, 1) }}</flux:table.cell>
<flux:table.cell class="text-center font-mono text-sm">{{ $result->t_pass !== null ? number_format($result->t_pass, 1) : '—' }}</flux:table.cell> <flux:table.cell class="text-center font-mono text-sm">{{ $result->t_pass !== null ? number_format($result->t_pass, 1) : '—' }}</flux:table.cell>
<flux:table.cell class="text-center font-mono text-sm">{{ number_format($result->gen_tokens) }}</flux:table.cell> <flux:table.cell class="text-center font-mono text-sm">{{ number_format($result->gen_tokens) }}</flux:table.cell>
<flux:table.cell class="text-center font-mono text-sm">{{ $result->wall > 0 && $result->gen_tokens > 0 ? number_format($result->gen_tokens / $result->wall, 1) : '—' }}</flux:table.cell>
</flux:table.row> </flux:table.row>
@endforeach @endforeach
</flux:table.rows> </flux:table.rows>

View file

@ -190,7 +190,7 @@ class="w-64"
<span class="text-[10px] font-semibold uppercase tracking-wider text-zinc-400">{{ __('Benchmark') }}</span> <span class="text-[10px] font-semibold uppercase tracking-wider text-zinc-400">{{ __('Benchmark') }}</span>
<span class="text-[10px] font-semibold uppercase tracking-wider text-zinc-400">{{ __('Thinking') }}</span> <span class="text-[10px] font-semibold uppercase tracking-wider text-zinc-400">{{ __('Thinking') }}</span>
<span class="text-[10px] font-semibold uppercase tracking-wider text-zinc-400">{{ __('Result') }}</span> <span class="text-[10px] font-semibold uppercase tracking-wider text-zinc-400">{{ __('Result') }}</span>
<span class="text-[10px] font-semibold uppercase tracking-wider text-zinc-400">{{ __('Speed (tok/s)') }} <span class="font-normal normal-case">avg · wtd</span></span> <span class="text-[10px] font-semibold uppercase tracking-wider text-zinc-400">{{ __('Speed (tok/s)') }} <span class="font-normal normal-case">{{ __('weighted average') }}</span></span>
<span class="text-[10px] font-semibold uppercase tracking-wider text-zinc-400">{{ __('Tokens') }}</span> <span class="text-[10px] font-semibold uppercase tracking-wider text-zinc-400">{{ __('Tokens') }}</span>
<span></span> <span></span>
</div> </div>
@ -214,12 +214,10 @@ class="flex flex-wrap items-center gap-x-4 gap-y-1 px-4 py-2.5 hover:bg-zinc-50
<flux:badge size="xs" color="{{ $row->failed > 0 ? 'rose' : 'zinc' }}">✘ {{ $row->failed }}</flux:badge> <flux:badge size="xs" color="{{ $row->failed > 0 ? 'rose' : 'zinc' }}">✘ {{ $row->failed }}</flux:badge>
</span> </span>
<span> <span>
@if ($row->avg_user_tps !== null) @if ($row->weighted_user_tps !== null)
<span class="font-mono text-sm">{{ number_format($row->avg_user_tps, 1) }} <span class="text-xs text-zinc-400">avg</span></span> <span class="font-mono text-sm">{{ number_format($row->weighted_user_tps, 1) }}</span>
<span class="font-mono text-sm">{{ number_format($row->weighted_user_tps, 1) }} <span class="text-xs text-zinc-400">wtd</span></span>
@elseif ($row->gen_tps !== null) @elseif ($row->gen_tps !== null)
<span class="font-mono text-sm">{{ number_format($row->gen_tps, 1) }} <span class="text-xs text-zinc-400">gen</span></span> <span class="font-mono text-sm">{{ number_format($row->gen_tps, 1) }} <span class="text-xs text-zinc-400">{{ __('gen') }}</span></span>
<span class="font-mono text-sm text-zinc-400">—</span>
@endif @endif
</span> </span>
<span class="font-mono text-sm">{{ number_format($row->total_tokens) }}</span> <span class="font-mono text-sm">{{ number_format($row->total_tokens) }}</span>