Skip to content

gui: reorder overview tiles card#10217

Open
jherrera-jump wants to merge 1 commit into
firedancer-io:mainfrom
jherrera-jump:jherrera/gui-tile-reorder
Open

gui: reorder overview tiles card#10217
jherrera-jump wants to merge 1 commit into
firedancer-io:mainfrom
jherrera-jump:jherrera/gui-tile-reorder

Conversation

@jherrera-jump

Copy link
Copy Markdown
Contributor

No description provided.

@jherrera-jump jherrera-jump force-pushed the jherrera/gui-tile-reorder branch from a934bae to 0261ec7 Compare June 13, 2026 20:04
@jherrera-jump jherrera-jump force-pushed the jherrera/gui-tile-reorder branch from 0261ec7 to edb6463 Compare June 13, 2026 20:05
@jherrera-jump jherrera-jump marked this pull request as ready for review June 13, 2026 20:05
Copilot AI review requested due to automatic review settings June 13, 2026 20:05

Copilot AI 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.

Pull request overview

This PR introduces a stable, explicit “display order” for topology tiles in the disco GUI so the overview tiles card (and associated tile-ordered JSON outputs) render in a preferred, human-friendly sequence rather than raw topo->tiles[] order.

Changes:

  • Added persistent storage in fd_gui_t.summary for a computed tile index ordering (tile[] + tile_cnt).
  • Added a one-time init-time builder (fd_gui_build_tile_order) that orders known tile kinds first, then appends any remaining tiles.
  • Updated tile JSON emitters in fd_gui_printf.c to iterate using the new display order and to index timer/metric snapshots by the underlying topo tile index (not the display-loop index).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/disco/gui/fd_gui.h Adds summary.tile[] and summary.tile_cnt to store topo tile indices in display order.
src/disco/gui/fd_gui.c Builds the tile display order once during fd_gui_new() initialization.
src/disco/gui/fd_gui_printf.c Switches tile-related JSON output loops to use the precomputed display order while keeping snapshot indexing consistent with topo indices.

@greptile-jt

greptile-jt Bot commented Jun 13, 2026

Copy link
Copy Markdown

Greptile Summary

This PR introduces a deterministic display order for tiles in the GUI overview card, instead of using the raw topology insertion order. A new function fd_gui_build_tile_order builds a permutation array (gui->summary.tile[]) once at init, mapping display positions to raw topology indices. All tile-iteration loops in fd_gui_printf.c are updated to iterate in display order while correctly dereferencing timer/metric arrays via the remapped topology index.

  • Adds fd_gui_build_tile_order() in fd_gui.c with a hardcoded preferred display order and a fallback that appends any unlisted tiles
  • Adds tile[FD_TOPO_MAX_TILES] and tile_cnt fields to the summary struct in fd_gui.h
  • Converts all tile-iteration loops in fd_gui_printf.c (tiles, tile_timers, tile_metrics, backpressure, alive, context switches, faults, CPU, interrupts, priority) from raw topology order to display order
  • Timer/metric array accesses correctly use the remapped raw topology index (t = gui->summary.tile[i]), maintaining consistency with the snapshot storage which still uses raw indices

Confidence Score: 5/5

This PR is safe to merge — it is a clean, well-structured display-order refactor with no logic changes to data collection.

The change is a straightforward permutation of tile display order. The build function correctly places all tiles (handling duplicates and unknowns). All printf loops are consistently updated to use the mapping, and raw-indexed timer/metric arrays are correctly dereferenced via the remapped index. No remaining inconsistent iteration patterns were found in fd_gui_printf.c.

No files require special attention.

Important Files Changed

Filename Overview
src/disco/gui/fd_gui.c Adds fd_gui_build_tile_order() function that builds a display-order permutation of tile indices, called once during fd_gui_new initialization. Correctly handles duplicate tile names and unknown tiles via fallback loop.
src/disco/gui/fd_gui.h Adds tile[FD_TOPO_MAX_TILES] and tile_cnt fields to the summary struct to store the display-order tile index mapping.
src/disco/gui/fd_gui_printf.c All tile iteration loops converted from raw topology order to display order. Timer/metric array indexing correctly uses remapped raw topology index t.

Sequence Diagram

sequenceDiagram
    participant Init as fd_gui_new
    participant Build as fd_gui_build_tile_order
    participant Snap as fd_gui_tile_timers_snap
    participant Printf as fd_gui_printf_* (display)

    Init->>Build: Called once at init
    Build->>Build: Iterate hardcoded display order names
    Build->>Build: Match topology tiles, build summary.tile[] permutation
    Build->>Build: Append unmatched tiles at end
    Build-->>Init: summary.tile[] and summary.tile_cnt set

    Note over Snap: Periodic timer snapshots
    Snap->>Snap: Store metrics at raw topology index cur[i]

    Note over Printf: On GUI request
    Printf->>Printf: for i in 0..summary.tile_cnt
    Printf->>Printf: t = summary.tile[i] (display to raw mapping)
    Printf->>Printf: Access cur[t] / prev[t] for timer data
    Printf->>Printf: Output tile name, metrics in display order
Loading

Reviews (1): Last reviewed commit: "gui: reorder overview tiles card" | Re-trigger Greptile

Sign up for free to 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.

2 participants