9 Commits
Author SHA1 Message Date
geramyloveless 32b9c675a2 amdgpu_mtop: make the top charts adaptive so the dashboard fits the terminal
c5b0313 rendered both top charts at the full 20 braille text rows each
(5 cell rows x 4 sub-rows), which made the dashboard ~86 rows tall. On a
normal 40-50 row terminal that pushed the GFX/UMC usage rows, VRAM,
power/sensor state, GRBM/GRBM2, and the processes panel below the fold,
leaving a screen that is mostly graphs.

The chart height is now computed from the terminal instead of hardcoded:

  chart budget = terminal_rows - (rows needed by everything else)

The "everything else" count is measured from the actual render:
device-list header (3 rows single GPU) + VRAM/POWER block (8) + GRBM
block (17, 16 when hidden) + processes block (8) + footer (1) + blank
separators (4, 3 hidden) = 41 rows. The remaining rows are split evenly
between the two charts and clamped to a floor of 4 text rows (one braille
cell row, still a chart) and a ceiling of 20 (five cell rows, the full
axis). At 50 rows the charts get 4 text rows each and the whole
dashboard fits in one screen; at 80+ rows they grow back to the full
20 rows.

Y-axis labels degrade gracefully with the chart height: each quarter
(100/75/50/25/0%) labels the row nearest its position, matching the
original 20-row chart's convention; 4-row charts show only 100%/0% so a
label never sits at the wrong height. Captions are unchanged.

The UMC source caption fallback (no plotted point yet) now follows the
source the next live sample will actually prefer (fresh+plausible SMU
field vs MMHUB PERFCTR delta) instead of assuming the SMU table.

No data sources, sampling, or observer protocol changes; TUI layout only.

The render test now asserts the user-visible regression directly: an
interactive 50-row frame contains both charts and every panel (VRAM,
power/sensor, GRBM/GRBM2, processes) with the footer as the last row,
plus a tall-terminal case (80 and 100 rows) that asserts the charts grow
back to the full quarter-labeled axis.
2026-09-25 22:13:11 -07:00
geramyloveless c5b0313202 amdgpu_mtop: render the full braille chart rows so the history is visible
mtop::tui::braille() returns height*4 text rows (one braille sub-row per
terminal row: 5 cell rows x 4 = 20 rows), but both braille charts only
rendered rows 0..4 with the 100/75/50/25/0% axis labels. Rows 0..4 are
the top braille cell row, i.e. only the 75..100% band of the scale, so
any series at or below 75% (idle dispatch-in-flight, SMU/UMC activity)
plotted in rows 5..19 that were never drawn. The headline percentage
came straight from the same history series, which is why the number
moved while the chart under it stayed blank.

Both the GPU CORE LOAD and SMU MEMORY ACTIVITY (UMC) charts now render
all 20 rows, with axis labels only at the 100/75/50/25% sub-row
positions so the caption column stays compact. The UMC chart stays
honestly empty while the source has no samples (stage 0 driver, or the
incoherent SMU table without the selector-68 MMHUB fallback), and
fills in as soon as a value arrives.

The render test's interactive-layout assertion now uses an 80-row
terminal: the dashboard legitimately needs ~78 rows with both full
braille charts, so the sort footer at 50 rows no longer asserts.
2026-09-25 21:15:46 -07:00
geramyloveless a8c0667322 amdgpu_mtop: dark-on-light palette + --dark flag + SMU/MEM-CTRL chart rows
Palette rework: the original bright neon colors (cyan #00F0FF, blue #0072FF,
yellow, orange, crimson) are unreadable on terminals with light backgrounds.
The default palette now uses dark text that stays legible on white; a new
--dark flag restores the original bright-on-dark colors.

- tui.h: add mtop::tui::Palette (border/empty/n/a/value/label/section SGR
  codes) and makePalette(bool dark). gradient(percent, dark) selects darkened
  stops for the light palette and the original bright stops for --dark.
  gradientBar takes a Palette for the empty-bar color and gradient stops.
  A safe default Palette constructor means a caller that omits one never
  dereferences a null SGR.
- main.cpp: add --dark flag; dashboard() takes a Palette and routes all
  bright()/dim()/kBorder usage through it.

New SMU MEMORY ACTIVITY (UMC) chart row. Per the layout correction the TUI is
(1) GPU LOAD (the true dispatch-in-flight utilization, already the GPU CORE
LOAD braille chart) and (2) a real 0-100% memory-activity chart. The memory
source is UmcActivityPercent in the SMU metrics table (firmware offset 126,
sibling to GfxActivityPercent at 124): the unified-memory-controller busy
fraction, 0-100%, no extra scaling. It is already sampled into
d.metrics.values[UmcActivityPercent] and verified by metrics_test.cpp.

- history.h: ActivityPoint.umcPercent; add() gains a umcPercent parameter.
- main.cpp: feed umcPercent from hardwareValue(..., UmcActivityPercent, ...)
  and render a braille chart (same treatment as GPU CORE LOAD: braille matrix,
  x-axis caption, min/max/avg footer) with a dim source citation.

MMHUB PERFSTATUS is still not exposed, but the SMU table does expose a
memory-controller activity percentage, so the memory row uses that real
signal rather than a bare n/a placeholder.

Tests: mtop-render-test bumped to a 50-row frame for the extra chart and
gains assertions for the SMU MEMORY ACTIVITY row (label, UmcActivityPercent
source, min/max/avg footer); mtop_tui_test updated for the dual-palette
gradient/gradientBar. All 7 ctest suites and the kitty/iTerm/text PTY tests
pass.
2026-09-25 18:33:39 -07:00
geramyloveless e8e7c4911b Rebuild amdgpu_mtop as btop-style TUI per TUI-DESIGN-SPEC
Add tui.h: Braille 2x4 dot-matrix canvas, 8-level sub-cell bars,
TrueColor gradient bars (cyan->blue->yellow->orange->crimson),
rounded box-drawing borders, hotkey dispatch, y-scale/x-axis geometry.

Rewrite dashboard() in main.cpp to the spec layout:
  Section 1: header (model, CUs/SEs, build, sensors)
  Section 2: GPU CORE LOAD Braille chart (120 x, 5 rows)
  Section 3: VRAM/GTT sub-cell bars + POWER & SENSOR STATE
  Section 4: PERFORMANCE COUNTERS (GRBM / GRBM2)
  Section 5: GPU PROCESSES (fdinfo) -- documented n/a
  Footer:    [q] Quit [h] Interval [p] [m] [g] [r] hotkeys

Every metric is cited from live driver sources or rendered as a dim
n/a with the exact missing query. No driver code modified.

Add mtop-tui-test: Braille canvas, sub-cell bars, gradient stops,
y-scale geometry, hotkey dispatch, layout fit. Update
mtop-render-test for new layout invariants. Update PTY terminal
test footer assertion.

All 7 ctest suites + 3 PTY protocol tests pass.
2026-09-25 18:15:02 -07:00
geramyloveless 884f984661 Rework amdgpu_mtop: sparkline histories, delta-based utilization, 0.01/0.1 s refresh
Replace the Braille charts with Rust-amdgpu_top-style 8-level block
sparklines (▁▂▃▄▅▆▇█) showing 60 s history per metric: GPU utilization,
VRAM used, temperature, and the raw SMU AverageGfxActivity. Each row
carries the current value plus min/avg/max.

Wire the driver's software_stats pendingNs (cumulative dispatch-in-flight
union) into a true delta-based utilization row: (pendingNs delta) /
(wall window) clamped to 0-100%. The old SMU-only headline (documented
as 'idle can report 100%') is retained as a secondary reference row.

Refresh rates: slow 0.1 s (default), fast 0.01 s (was 0.5 s / 0.1 s).

Add a read-only QueryInfo tag-8 GFXSpecSnapshot query for chip geometry
(CU count, SE count) in the header; kIOReturnNotReady before GC
discovery is handled gracefully.

CPU-side unit tests: busyRatio edge cases (rollback, saturation, window
delta), sparkline known-series to expected bar strings (exact UTF-8
byte comparison), stats min/max/avg. Render tests updated for the new
layout. PTY test updated for the new refresh labels and block
characters.
2026-09-25 17:33:08 -07:00
geramyloveless 6f24602d32 Render pixel GPU charts with responsive observer sampling
Add Kitty and iTerm2 PNG charts, compact labeled clocks and sensors, differential terminal redraws, and background sampling. Replace refresh-dependent aggregate copy spikes with directional one-second completion rates and state their coverage. Validate rendering, input responsiveness, counter resets, and protocol framing.
2026-09-23 21:56:02 -07:00
geramyloveless 8fa37f8a2a Optimize Loom inference and qualify host waits and monitoring
Add Q6 panel reuse, pointwise fusion, compiler calibration and measured decode batching to the macOS LSE adapter. Preserve FP32 calculations and record exact MLX token comparisons and bounded performance evidence.

Add verified HRX transfer and owned-idle diagnostics, configurable blocked signal polling, and monitor graphs that distinguish stale or unreliable raw activity counters. Document reproduction, validation limits and remaining performance work.
2026-09-23 20:23:33 -07:00
geramyloveless 3fe89e1ace Scale GPU buffers and integrate validated HSA signals with LSE
Grow and reclaim BO metadata in64-entry pages, raise client capacity to4096 handles, and prevent VRAM free-range metadata exhaustion. Add GPU activity history, bounded sensor sampling and clock/counter reporting.

Select the qualified GPU-owned signal mailbox by default while gating native mixed atomics on original PCIe evidence. Include native HRX/LSE adapters, guarded compute tests, reproducible signing and local build/server guides linked to Lemon Seed Engine.

Hardware validation covers1024 live buffers with fragmented reuse, pooled HRX allocations and2GiB boundaries, shared signal lifecycle, Q6 projection and680 exact convolution outputs. Full-model token generation remains blocked on the missing Loom repeat template.
2026-09-23 17:52:41 -07:00
geramyloveless bde3f99364 Add native compute dispatch and live VRAM allocation monitoring 2026-09-23 00:03:15 -07:00