null, 'suite' => null, 'level' => null, 'model' => null, 'result' => null, ]; private const SORTABLE = [ 'ran_at', 'model_id', 'suite', 'task', 'section', 'level', 'ok', 'decode', 'user_tps', 'ttft', 't_answer', 'wall', 'total', ]; public function resetFilters(): void { $this->filters = [ 'search' => null, 'suite' => null, 'level' => null, 'model' => null, 'result' => null, ]; $this->resetPage(); } #[Computed] public function results(): LengthAwarePaginator { return RunResult::query() ->join('benchmark_runs', 'run_results.benchmark_run_id', '=', 'benchmark_runs.id') ->select('run_results.*', 'benchmark_runs.ran_at', 'benchmark_runs.model_id', 'benchmark_runs.model_quant', 'benchmark_runs.engine', 'benchmark_runs.run_id', 'benchmark_runs.visibility', 'benchmark_runs.user_id as run_user_id') ->tap(fn (Builder $q) => $q->where(BenchmarkRun::visibleClause(auth()->user()))) ->tap(fn (Builder $q) => $this->applySorting($q)) ->tap(fn (Builder $q) => $this->applyFilters($q)) ->with('run:id,run_id') ->paginate(25); } #[Computed] public function suites(): array { return RunResult::query()->distinct()->orderBy('suite')->pluck('suite')->all(); } #[Computed] public function models(): array { return BenchmarkRun::visibleTo(auth()->user()) ->distinct()->orderBy('model_id')->pluck('model_id')->all(); } private function applySorting(Builder $query): Builder { $column = in_array($this->sortBy, self::SORTABLE, true) ? $this->sortBy : 'ran_at'; return $query->orderBy($column, $this->sortDirection === 'asc' ? 'asc' : 'desc') ->orderBy('run_results.id', 'desc'); } private function applyFilters(Builder $query): Builder { return $query ->when($this->filters['search'], fn (Builder $q, string $search) => $q->where(function (Builder $q) use ($search) { $q->where('run_results.task', 'like', "%{$search}%") ->orWhere('benchmark_runs.model_id', 'like', "%{$search}%") ->orWhere('benchmark_runs.label', 'like', "%{$search}%"); })) ->when($this->filters['suite'], fn (Builder $q, string $suite) => $q->where('run_results.suite', $suite)) ->when($this->filters['level'], fn (Builder $q, string $level) => $q->where('run_results.level', $level)) ->when($this->filters['model'], fn (Builder $q, string $model) => $q->where('benchmark_runs.model_id', $model)) ->when($this->filters['result'] !== null && $this->filters['result'] !== '', fn (Builder $q) => $q->where('run_results.ok', (bool) $this->filters['result'])); } }; ?>
{{ __('Benchmark Results') }} {{ __('Every datapoint festbench captures — sortable.') }}
@foreach ($this->suites as $suite) {{ $suite }} @endforeach @foreach (['off', 'low', 'medium', 'xhigh'] as $level) {{ $level }} @endforeach @foreach ($this->models as $model) {{ $model }} @endforeach {{ __('Pass') }} {{ __('Fail') }} {{ __('Clear') }}
@if ($this->results->count() > 0)
{{ __('Date') }} {{ __('Model') }} {{ __('Suite') }} {{ __('Task') }} {{ __('Level') }} {{ __('Pass') }} {{ __('User tok/s') }} {{ __('Decode') }} {{ __('TTFT') }} {{ __('Wall') }} {{ __('Tokens') }} @foreach ($this->results as $result) {{ optional($result->ran_at)->format('Y-m-d') }} {{ $result->model_id }} @if ($result->model_quant) {{ $result->model_quant }} @endif {{ $result->suite }} {{ $result->task }} {{ $result->level ?? '—' }} @if ($result->ok) @elseif ($result->ok === null) — @else @endif {{ number_format($result->user_tps, 1) }} {{ number_format($result->decode, 1) }} {{ number_format($result->ttft, 2) }} {{ number_format($result->wall, 2) }} {{ number_format($result->total) }} @endforeach
@else
{{ __('No results') }} {{ __('No benchmark results match the current filters.') }}
@endif