Skip to content

feat(resources): clearer two-line view (secure-environment vs per-run allocation) - #359

Merged
LukasWodka merged 2 commits into
developfrom
fix/resources-copy-two-line
Jul 21, 2026
Merged

feat(resources): clearer two-line view (secure-environment vs per-run allocation)#359
LukasWodka merged 2 commits into
developfrom
fix/resources-copy-two-line

Conversation

@LukasWodka

@LukasWodkaLukasWodka commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Part of epic backend#1142 / cli#355 (copy consistency). Driven by Lukas's review of tb resources.

Before

This machine
capacity: 12 CPU · 23.3 GiB
tracebloc uses
per training run: up to 2 CPU · 8 GiB
Raise tracebloc's share with `tracebloc resources set` …

"This machine" is really the summed capacity of the environment's nodes (misleading on remote/multi-node), and "tracebloc uses" reads like total usage when it's the per-run ceiling.

After

Your secure environment is equipped with: 12 CPU · 23.3 GiB
A training run is allocated up to: 2 CPU · 8 GiB
Do you want to change the allocation? Run `tb resources set` (guided …).
  • new ui.Printer.Stat (aligned full-sentence label/value)
  • hint now resolves tb vs tracebloc like the home screen (fixes the inconsistency Lukas spotted)
  • "secure environment" matches the v2 terminology SoT

Note

The allocation shown is cluster-wide per-run — jobs-manager stamps the same ceiling on every training run; there is no per-run override today (see the discussion on OOM feedback, filed separately).

gofmt/vet clean; cli + ui tests green.


Note

Low Risk
Presentation and copy only; cluster reads and ceiling logic are unchanged aside from how results are printed.

Overview
tracebloc resources now shows two aligned sentences instead of section headers and Field rows: your secure environment capacity and per-run allocation (cluster-wide ceiling), using v2 “secure environment” wording so it’s clear the first line is schedulable capacity, not “this machine,” and the second is each run’s limit, not total tracebloc usage.

Adds ui.Printer.Stat for dim, fixed-width full-sentence labels. The per-run value uses perRunSize (same formatting as resources set) with “up to” in the label only; trainingLine is removed. Help text and the closing hint are updated—the hint picks tb vs tracebloc like the home screen when the alias exists.

Reviewed by Cursor Bugbot for commit 17738e7. Bugbot is set up for automated code reviews on this repo. Configure here.

… per-run
tb resources used the labels "This machine" (capacity) and "tracebloc uses"
(per training run), which confused: "This machine" is actually the summed
capacity of the environment's Ready nodes (misleading on a remote/multi-node
cluster), and "tracebloc uses" reads like total usage when it's the per-RUN
ceiling. Reframe as two plain aligned lines:
Your secure environment is equipped with: 12 CPU · 23.3 GiB
A training run is allocated up to: 2 CPU · 8 GiB
Do you want to change the allocation? Run `tb resources set` (guided ...).
- New ui.Printer.Stat: aligned label/value for full-sentence labels (Field's
14-col key is too narrow here).
- The trailing hint now resolves the launcher like the home screen
(invokedName + tbAliasAvailable) so it reads `tb ...` on a real install and
`tracebloc ...` otherwise — fixing the tb/tracebloc inconsistency Lukas spotted.
- Value strips the leading "up to " (the label carries it now).
Part of epic tracebloc/backend#1142 / cli#355 (copy consistency).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@LukasWodkaLukasWodka self-assigned this Jul 20, 2026
@LukasWodka
LukasWodka requested a review from saadqbalJuly 20, 2026 15:22
@LukasWodka

Copy link
Copy Markdown
ContributorAuthor

@BugBot run

Comment threadinternal/cli/resources.go Outdated
Bugbot: the Stat value called trainingLine then stripped its 'up to ' prefix —
a round-trip that duplicated perRunSize (resources_set.go), which already
returns the clean 'CPU · mem' ceiling. Use perRunSize directly and delete
trainingLine (its only caller was this stripped one).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@LukasWodka

Copy link
Copy Markdown
ContributorAuthor

@BugBot run

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 17738e7. Configure here.

@aptraceblocaptracebloc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified — approving. Presentation/copy only, no logic change:

  • Reword is accurate: "Your secure environment is equipped with:" (schedulable capacity) and "A training run is allocated up to:" (per-run ceiling) are clearer than the old "This machine" / "tracebloc uses", and match the v2 terminology.
  • ui.Stat is correct — dim 42-col fixed-width label; both sentences fit, so values align.
  • Consistency win: the per-run value now uses the shared perRunSize (same as resources set), with "up to" carried in the label — that resolved Bugbot's redundant-TrimPrefix finding, and trainingLine is removed cleanly.
  • tb/tracebloc hint now resolves like the home screen. CI green.

Non-blocking note (not for this PR): "equipped with" shows the summed capacity across the environment's nodes, while a run lands on a single node — so on a multi-node environment the headline can read larger than any one run could actually use. This predates the PR (from the #237 SHOW command), --verbose shows the per-node breakdown, and "secure environment" is strictly less misleading than "This machine", so nothing to change now. Flagging only because the copy goal is clarity: a future iteration could show "the largest single node a run can land on" to match resources set's single-node fit — even more honest. Out of scope here.

LGTM.

— drafted with Claude (Opus 4.8), sent by @aptracebloc

@LukasWodka
LukasWodka merged commit 9de525c into developJul 21, 2026
20 checks passed
@LukasWodka
LukasWodka deleted the fix/resources-copy-two-line branch July 21, 2026 08:02
@LukasWodka

Copy link
Copy Markdown
ContributorAuthor

/fr-pass — verified live on dev: resources renders the two aligned lines ("Your secure environment is equipped with: 12 CPU · 23.3 GiB" / "A training run is allocated up to: 2 CPU · 8 GiB") with the launcher-aware resources set hint.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@LukasWodka@aptracebloc@saadqbal