Problem
src/cpp/server/system_info.cpp::get_global_vram_usage_pct() uses two goto labels (try_nvidia, try_amd) for early-exit flow control. While valid C++, this is a code smell and makes the logic harder to follow and modify.
Proposed Solution
Replace the goto-based flow with flag-based early exit (e.g., bool tried_nvidia = false; bool has_kfd = ...;). Restructure as:
// Step 1: NVIDIA path (always attempted)
// Step 2: AMD sysfs path (early-exit via KFD + PCI vendor check if no NVIDIA GPU exists)
// Step 3: Return best ratio found
This matches the existing style elsewhere in the codebase and improves readability without changing behavior.
Scope
src/cpp/server/system_info.cpp only -- ~50 lines of logic restructure, zero behavioral change.
Problem
src/cpp/server/system_info.cpp::get_global_vram_usage_pct()uses twogotolabels (try_nvidia,try_amd) for early-exit flow control. While valid C++, this is a code smell and makes the logic harder to follow and modify.Proposed Solution
Replace the
goto-based flow with flag-based early exit (e.g.,bool tried_nvidia = false; bool has_kfd = ...;). Restructure as:This matches the existing style elsewhere in the codebase and improves readability without changing behavior.
Scope
src/cpp/server/system_info.cpponly -- ~50 lines of logic restructure, zero behavioral change.