Skip to content

Studio: do not call the host CPU-only before the System tab has read anything - #9315

Merged
danielhanchen merged 8 commits into
unslothai:mainfrom
LeoBorcherding:pr-d-system-tab-placeholder
Aug 23, 2026
Merged

danielhanchen merged 8 commits into
unslothai:mainfrom
LeoBorcherding:pr-d-system-tab-placeholder

Conversation

@LeoBorcherding

Copy link
Copy Markdown
Collaborator

useSystemInfo's placeholder says cpu backend, no GPU, zero everything, and the System tab rendered it as "No visible GPU detected. CPU-only resources are shown above." Opening Settings before /api/system answered told an AMD user their card was unused.

A client-side status gates that verdict behind having read something, and distinguishes the two non-answers: still checking, or asked and got nothing back. The second matters because with polling off nothing retries, so "still checking" would outlive the check. Data already on screen is never blanked by a failed poll; only a placeholder moves, off "pending".

The two new strings are in every locale overlay, so the strict parity gate passes.

Tests

Two cases added to system-discovery.test.ts: a settled failure leaves the placeholder rather than a live check, and a settled failure does not blank a reading already on screen. Locale parity clean.

Split out of #8863 at review request. Pure frontend, independent of the other three.

useSystemInfo starts on a placeholder that says cpu backend, no GPU, zero cores
and zero RAM, and the System tab renders it as a verdict: "No visible GPU
detected. CPU-only resources are shown above." A user who opens Settings before
/api/system answers, or whose request fails, is told their GPU is not being
used. Carry a client-side loaded flag on the response and show that the check is
still running until it lands.
Codex P2 on unslothai#8863: the loaded flag only ever flipped on success, so a single
failed /api/system with polling off left the System tab saying "Checking for
GPUs..." forever, with nothing retrying it. shouldRetrySystemDiscovery bails at
retrySubscribers <= 0 and useSystemInfo's finally returns early without pollMs,
so no request was coming.

Replace the flag with a three-state status. A settled failure moves the
placeholder to unavailable and the tab says it could not read the hardware,
which is true and does not promise a check that is not running. Data already on
screen survives a later failed poll rather than being blanked.
Frontend CI's locale parity gate is strict: a key added only to en.ts
falls back to English at runtime, so nothing breaks and nothing complains,
which is how the overlays drifted before. The System tab's "still
checking" and "could not read this host" lines landed in en.ts alone and
failed the gate.
@danielhanchen

Copy link
Copy Markdown
Member

Confirmed this hits resources-tab.tsx where the System tab renders the pre-fetch placeholder as "No visible GPU detected", and the new status gate on useSystemInfo separates still checking from settled empty. Will get this reviewed.

useSystemInfo pulls through fetchSystemInfo but never joined the subscriber
bus, and the status a failed read settles at lives only in the hook. So a tab
that settled unavailable stayed there for the life of the mount even after the
shared cache went ready: nothing retries a placeholder once its own request has
settled, and with live updates off nothing polls either.

Subscribe to the bus use-gpu-info.ts already uses. A placeholder takes the
published snapshot; a reading already on screen is left to this hook's own
poll, which the live-updates switch governs.
The placeholder's device_backend is cpu and its package list is empty, so two
sections below the gated text the tab still read Backend: CPU and Torch: Not
installed before the host had been read. Same false verdict, same tab.

Also carry both MetricTile lines as a title. They truncate in a half-width
tile, and the settled-failure string is a sentence, so it was cut with no way
to recover it. InfoRow already does this.
system-discovery.test.ts covers settledFailureStatus, which is three lines.
It cannot fail for the bug this guards: revert the gate in resources-tab.tsx
to its pre-fix form and those cases still pass, and so do they if the identity
short-circuit that keeps a reading on screen is deleted.

Lift the verdict and both setSystemInfo callbacks out of their sources and
evaluate them, the way chat-only-route-guard.test.ts lifts the route guard out
of __root.tsx.
The Live monitor's CPU, RAM and disk tiles folded every missing reading to 0,
so an unread host rendered 0 GiB / 0 GiB and a 0% meter beside a VRAM tile that
had just said Unknown. MetricTile already takes percent null for a usage it
must not fabricate, which is exactly this.

Their detail line takes common.loading rather than the GPU wording: Checking
for GPUs beside a RAM reading is the wrong sentence. The failure string already
speaks of the whole host.
@danielhanchen

Copy link
Copy Markdown
Member

Reviewed this and pushed four commits to the branch rather than leaving a list of asks. The core of the PR is right and the bug is real: the first /api/system call runs a live hardware probe (_get_cached_system_gpu_info in main.py), so the window where DEFAULT_SYSTEM is on screen is a real interval on a cold ROCm or Vulkan host, not a sub-frame flash. Gating the verdict on a client-side status is also how the rest of the codebase already models this: isProvisionalVerdict / resolveVerdict in config/hardware-verdict.ts, and HostClass = "unknown" | ... in host-artifact-policy.ts, whose comment makes exactly this argument about a boolean.

What I pushed:

1. useSystemInfo now joins the subscriber bus. It pulled through fetchSystemInfo but was never a subscribeSystemInfo subscriber, and the status a failed read settles at lived only in the hook. So a tab that settled unavailable stayed there for the life of the mount even after the shared cache went ready. Open Settings > System with live updates off, let the first read fail, then press that tab's own "Floating window" button: the monitor polls, succeeds, and the tab behind it goes on saying the hardware could not be read. Nothing retries a placeholder once its own request settled. The 3s retry in scheduleVulkanRetry reaches the same state with no user action at all, since shouldRetrySystemDiscovery returns true for any cold cache when a useGpuDevices consumer is mounted, so the comment in system-discovery.ts about nothing retrying is not quite right on the pages where this is reachable. A placeholder now takes the published snapshot; a reading already on screen is left to the hook's own poll, so the live-updates switch still means what it says.

2. The Environment rows now wait for the same read. Two sections below the gated text, the tab still read Backend: CPU and Torch: Not installed off the placeholder. Same false verdict, same tab.

3. The other three tiles too. CPU, RAM and disk folded every missing reading to 0, so an unread host rendered 0 GiB / 0 GiB and a 0% meter next to a VRAM tile that had just said Unknown. MetricTile already takes percent: null for a usage it must not fabricate. Their detail line takes common.loading rather than the GPU wording, since "Checking for GPUs..." beside a RAM reading is the wrong sentence. No new locale keys.

Also added title to both MetricTile lines. They truncate in a half-width tile and the settled-failure string is a sentence, so at 640px it was cut with no way to recover it. InfoRow already does this.

4. A test that can actually fail. system-discovery.test.ts covers settledFailureStatus, which is three lines. I checked by mutation: revert the gate in resources-tab.tsx to its pre-fix form and all four of those cases still pass, and they also pass if the identity short-circuit that keeps a reading on screen is deleted. tests/system-status-verdict.test.ts lifts the verdict and both setSystemInfo callbacks out of their sources and evaluates them, the way chat-only-route-guard.test.ts lifts the route guard out of __root.tsx.

Verification, all on this head:

  • Frontend gates green: strict locale parity, tsc -b plus the test project, 4076/4076 node tests, production build, eslint on the changed files. Biome output is identical before and after (6 errors, 38 warnings, all pre-existing).
  • 20 host cells across the cartesian product of platform and vendor, plus Intel XPU, Apple MLX, Intel Mac, Vulkan iGPU, heterogeneous multi-GPU, the Windows ROCm unknown-VRAM case from [Bug] Stops Reading VRAM Total / Usage on RDNA3 #7452, a cold Vulkan probe reporting available: true with no devices, and a host with no torch. Payloads come from the real get_system_info() with only the hardware probes spoofed. 20 cells x 4 states, no violations: "No visible GPU detected" appears in exactly the ready states of the 6 cells that genuinely have no usable GPU.
  • Chromium, Firefox and WebKit, 75/75 across five viewport and locale profiles including 640px and Arabic, driving the real built SettingsDialog with /api/system intercepted. With the two fixes reverted the same three checks fail identically in all three engines, so the assertions are not vacuous and the bug reproduces in Gecko and WebKit too.
  • 19 wire and lifecycle cases against the real module: a backend that sends no status reads ready, the keys main.py spreads in survive the client stamp, a future backend sending its own status cannot override the client's, 401/403/500/502, a non-JSON 200, StrictMode double mount, unsubscribe on unmount, and the new subscription does not arm the Vulkan retry.

Left alone deliberately, worth follow-ups rather than growing this PR:

  • run-preview-card.tsx:516 renders "No GPU detected" off gpu.available alone while its own useGpuInfo() already exposes budgetKnown.
  • hub-page.tsx labels VRAM, RAM and CPU "Unavailable" on the cold placeholder, in hardcoded English the parity gate cannot see.
  • classifyGgufFit has no budgetKnown, so on an unread host a comfortably fitting quant is badged "Won't fit, exceeds combined VRAM and system RAM budget". That is the worst instance of this class left, and it sits on a download decision.
  • authFetch("/api/system") has no timeout, and the in-flight promise is handed to every later caller, so a backend that accepts the connection and never answers pins every consumer at "Checking for GPUs..." with no second request. Pre-existing, but this PR's copy is what makes it visible.

Thanks for splitting this out of #8863, it made it much easier to review.

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

danielhanchen added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Aug 23, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 470da58056

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

danielhanchen added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Aug 23, 2026
@danielhanchen
danielhanchen merged commit 96994fb into unslothai:main Aug 23, 2026
31 of 33 checks passed
@danielhanchen

Copy link
Copy Markdown
Member

Ran the frontend CI set on an AMD DevLab runner at the merge commit 96994fb84 and its parent 8625c2e84, as a post-merge check. No regression from this PR.

check parent merge commit
i18n:check:strict pass pass
typecheck pass pass
test fail fail
biome:check fail fail

Both failures reproduce identically at the parent, so they pre-date this change and are not caused by it. The failing test is tests/research-activity-progress.test.ts in both cases.

Worth raising separately though: this means main currently has a failing frontend test and a failing Biome check, independent of this PR. Happy to open an issue for that if it is not already known.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants