null, ]; public function toggleVisibility(int $id): void { $run = BenchmarkRun::where('user_id', auth()->id())->findOrFail($id); $run->fill([ 'visibility' => $run->visibility === BenchmarkRun::VISIBILITY_PUBLIC ? BenchmarkRun::VISIBILITY_PRIVATE : BenchmarkRun::VISIBILITY_PUBLIC, ])->save(); Flux::toast(variant: 'success', text: __('Visibility updated.')); } // --- GPU confirmation ------------------------------------------------- // Runs whose raw gpu string has no catalog match carry gpu_id = null. // The owner confirms them here; confirming links gpu_id and re-runs the // summary so the run retro-merges into the correct session band. public ?int $confirmingRunId = null; public string $gpuSearch = ''; #[Computed] public function gpuChoices(): array { if ($this->gpuSearch === '') { return Gpu::active()->orderBy('vendor')->orderBy('name')->limit(10)->pluck('name', 'id')->all(); } return Gpu::active() ->where('name', 'like', "%{$this->gpuSearch}%") ->orderBy('name') ->limit(10) ->pluck('name', 'id') ->all(); } public function startGpuConfirm(int $id): void { $this->confirmingRunId = $id; $this->gpuSearch = ''; $this->modal('gpu-confirm-modal')->show(); } public function confirmGpu(int $gpuId): void { $run = BenchmarkRun::where('user_id', auth()->id())->findOrFail($this->confirmingRunId); $gpu = Gpu::active()->findOrFail($gpuId); $run->fill(['gpu' => $gpu->name, 'gpu_id' => $gpu->id])->save(); // Historical regroup: the run moves into the correct session band. Illuminate\Support\Facades\Artisan::call('festbench:summary'); Illuminate\Support\Facades\Artisan::call('festbench:snapshot'); $this->modal('gpu-confirm-modal')->close(); $this->confirmingRunId = null; Flux::toast(variant: 'success', text: __('GPU confirmed — run regrouped.')); } public function resetFilters(): void { $this->filters = ['search' => null]; $this->resetPage(); } #[Computed] public function runs(): LengthAwarePaginator { // Row + pass counts across the suite tables (runs are single-suite, // but the owning table varies per run, hence the union of counts). return BenchmarkRun::query() ->where('user_id', auth()->id()) ->select('benchmark_runs.*') ->selectRaw('(SELECT count(*) FROM softbench_results sr WHERE sr.benchmark_run_id = benchmark_runs.id) + (SELECT count(*) FROM infrabench_results sr WHERE sr.benchmark_run_id = benchmark_runs.id) + (SELECT count(*) FROM prosebench_results sr WHERE sr.benchmark_run_id = benchmark_runs.id) + (SELECT count(*) FROM psychbench_results sr WHERE sr.benchmark_run_id = benchmark_runs.id) + (SELECT count(*) FROM scenario_runs sr WHERE sr.benchmark_run_id = benchmark_runs.id) as results_count') ->selectRaw('(SELECT count(*) FROM softbench_results sr WHERE sr.benchmark_run_id = benchmark_runs.id AND sr.ok) + (SELECT count(*) FROM infrabench_results sr WHERE sr.benchmark_run_id = benchmark_runs.id AND sr.ok) + (SELECT count(*) FROM prosebench_results sr WHERE sr.benchmark_run_id = benchmark_runs.id AND sr.ok) + (SELECT count(*) FROM psychbench_results sr WHERE sr.benchmark_run_id = benchmark_runs.id AND sr.ok) + (SELECT count(*) FROM scenario_runs sr WHERE sr.benchmark_run_id = benchmark_runs.id AND sr.ok) as passed_count') ->when($this->filters['search'], fn ($q, $search) => $q->where(function ($q) use ($search) { $q->where('run_id', 'like', "%{$search}%") ->orWhere('model_id', 'like', "%{$search}%") ->orWhere('label', 'like', "%{$search}%"); })) ->orderByDesc('ran_at') ->orderByDesc('id') ->paginate(25); } }; ?>
{{ __('My Runs') }} {{ __('Runs attributed to you. Toggle visibility or add notes from a run page.') }}
{{ __('All results') }}
@if ($this->runs->count() > 0) {{ __('Date') }} {{ __('Run') }} {{ __('Model') }} {{ __('Suite') }} {{ __('GPU') }} {{ __('Tasks') }} {{ __('Passed') }} {{ __('Visibility') }} @foreach ($this->runs as $run) {{ optional($run->ran_at)->format('Y-m-d') }} {{ $run->run_id }} {{ $run->model_id }} {{ $run->suite }} @if ($run->gpu_id !== null) {{ $run->gpu }} @elseif ($run->gpu !== null && ! in_array(strtolower($run->gpu), ['unknown', 'hosted', 'cloud'])) {{ __('Unconfirmed') }}: {{ $run->gpu }} @else {{ $run->gpu ?? '—' }} @endif {{ $run->results_count }} {{ $run->passed_count }} {{ __($run->visibility) }} {{ $run->visibility === 'public' ? __('Make private') : __('Make public') }} @endforeach @else {{ __('No runs yet') }} {{ __('Runs you import or submit will appear here.') }} @endif
{{ __('Confirm GPU') }} {{ __('Pick the card this run executed on. Confirming regroups the run into the matching session.') }}
@foreach ($this->gpuChoices as $gpuId => $gpuName) {{ $gpuName }} @endforeach @if (count($this->gpuChoices) === 0) {{ __('No catalog matches — ask an admin to add this card.') }} @endif