Skip to content

feat(dashboard): Arc Pro ModelPicker, smooth auto-scroll, and sidebar shift fixes - #433

Merged
Brooooooklyn merged 1 commit into
mainfrom
feat/dashboard-model-picker-and-chat-ux
Nov 28, 2026
Merged

Brooooooklyn merged 1 commit into
mainfrom
feat/dashboard-model-picker-and-chat-ux

Conversation

@Brooooooklyn

Copy link
Copy Markdown
Contributor

Summary

  1. Arc Pro ModelPicker refactor (Chat/Work + System One)

    • Rebuilt ModelPicker on @radix-ui/react-dropdown-menu matching Arc Pro's Model Picker block: gliding highlight (useGlide), spring AutoHeight, crossfading width-morphing pill (TriggerLabel), desktop hover/keyboard submenus (Effort, More models, multi-build Quantization), narrow (<= 640px) sliding in-menu pages (← Back), Tab-reachable footer/Unload controls, and side/align placement (side="bottom" align="end" in System One header).
    • Wired installed models on our recommended list (MODEL_CATALOG, visible chat and systemone entries) to render outside at top level with 1-line blurbs (recommended, recommendedOrder, description), and grouped all other installed models inside More models by family/provider (or outside when no installed models are recommended).
  2. Sidebar conversation list layout shift fixes

    • Clipped Framer Motion popLayout overflow inside Button (overflow: clip) and fixed ComposerTray exit/height collapse, ConversationList scroll container stability, and AppShell FrozenLocation + live location context (live-location.ts) so switching conversations, navigating away from /chat, or returning via back/forward keeps < 0.5px shift.
    • Guarded pre-commit fork/first-send paths in chat.tsx (matchPath('/chat', live.pathname)) and post-remount rewind toast restoration.
  3. Smooth auto-scroll in running agent chat

    • Replaced abrupt bottom jumps in stick-to-bottom.ts with smooth rAF exponential chase (CHASE_TAU_MS = 85, overflowAnchor = 'none' during chase) while respecting user wheel/touch/keyboard disengagement (Ctrl+wheel, directional scroll containers, touchHold, window-level keydown).
    • Added overscroll-behavior: contain and viewport clipping in ChatFrame.

Verification

  • vp fmt --check, vp lint (0 warnings, 0 errors), yarn typecheck
  • Full @mlx-node/dashboard test suite (vp test packages/dashboard --run): all 246 active test files passed, including pack.test.ts production yarn build:ui + bundle checks
  • Real Chrome verification (light & dark, desktop & narrow 500px): zero console/page errors, 0px trigger-morph overflow, < 0.5px layout shift on conversation switches, smooth auto-scroll, short-viewport scrolling, narrow-page highlight, and Work mode effort switching

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-28T14:49:38.605752Z
We couldn’t complete this review. Comment @codex review to try again.
ad1ef72 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Nov 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d558e369-0b87-463a-8618-c9a85d8a29a1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@Brooooooklyn
Brooooooklyn merged commit 1f7bbb6 into main Nov 28, 2026
21 checks passed
@Brooooooklyn
Brooooooklyn deleted the feat/dashboard-model-picker-and-chat-ux branch November 28, 2026 15:39
Brooooooklyn added a commit that referenced this pull request Nov 29, 2026
…perf/parity, Work-mode images, and barrier KV eviction (#435)

## Summary

End-to-end speculative decoding, vision (`mmproj`), multi-lane Metal
kernel optimization, Dashboard Work-mode image attachments, and
exclusive-barrier KV reclamation across **Hy4-flash**, **Qwen 3.8 Flash
Next**, **Qwen 3.8 27B**, and **Inkling-2-Mini**.

```mermaid
flowchart LR
  subgraph Models["Native Engine & Metal Kernels"]
    HY4["Hy4-flash<br/>• DFly2-B6 speculative decoding<br/>• GGUF mmproj vision + 3D M-RoPE<br/>• Image prefix cache + ViT skip<br/>• Exclusive-barrier KV eviction"]
    Q4["Qwen 3.8 Flash Next<br/>• GGUF mmproj + image prefix cache<br/>• AOT dense NAX + grouped MoE<br/>• Batched GDN/QSA + DFlash2<br/>• 0.0-ULP 1L GDN parity<br/>• Barrier decode/verify KV eviction"]
    Q3["Qwen 3.8 27B & Inkling-2-Mini<br/>• Image prefix cache + ViT skip<br/>• Multimodal DFlash2 & DSpark<br/>• BF16 sampler & sync fixes"]
  end
  subgraph App["LM, CLI, Agent & Dashboard"]
    TS["Model discovery, catalog & CLI<br/>• Hy4-flash mmproj + DFly2-B6<br/>• Qwen4 mmproj discovery"]
    UI["Dashboard Work Mode<br/>• Direct image attachments<br/>• Per-family image caps"]
  end
  HY4 --> TS
  Q4 --> TS
  Q3 --> TS
  TS --> UI
```

---

## Key Changes

### 1. Hy4-flash: DFly2-B6 + GGUF Vision (`mmproj-Hy4-flash-bf16.gguf`)
+ Barrier KV Reclamation
- **DFly2-B6 (`crates/mlx-core/src/models/hy_v4_flash/dfly2/`)**:
3-layer Eagle/DFly2 speculative drafter (`block_size = 6`) integrated
with paged KV cache, lock-free Engram batching, `WINDOW_SLACK = 6`, and
multimodal verify.
- **GGUF Vision (`vision.rs`, `media.rs`, `indexer.rs`,
`persist_codec.rs`)**:
- SigLIP2-So400m ViT (27 blocks, exact erf GELU, bilinear-interpolated
`128×128` position embeddings) + `rmsnorm_mlp_adapter` (`mm.pre_norm` →
`2×2 s=2` Conv2d → GELU → `1×1` Conv2d → row-end `v.image_newline`).
- Interleaved `[12, 10, 10]` 3D M-RoPE in GPT-J pair order with hybrid
1D/3D multi-chunk prefill (pure-text chunks stay on fused 1D Metal
kernels with causal `rope_delta`), Indexer pooled-key 3D M-RoPE +
`open_pos` / `recent_group_pos` rollback ring persisted in `HY4S v3`.
- Image prefix caching + ViT skipping, zero-copy header-only planning
(`expandedPromptTokenCount`), lazy `mmproj` load with open-fd
fingerprint re-verification, zero-transfer Engram bypass + lookahead
filtering on masked image rows, and `supportsImages()` /
`expandedPromptTokenCount()` NAPI exports.
- **TS / Catalog / CLI (`packages/lm`, `packages/agent`,
`packages/cli`)**: Auto-discovery of `mmproj-Hy4-flash-*.gguf` and
`hy4-flash-dfly2-b6` (Metal-only draft gating preserving Windows/Linux
SPARK builds), catalog globs + sizes, and projector download tests.
- **Exclusive-Barrier KV Reclamation (`owner.rs`, `sched.rs`)**: LRU
idle-owner KV eviction on prefill, warm continuation, and decode/verify
block boundaries with host-headroom-capped partial grow while preserving
history-only `SessionContinue` owners and published prefix checkpoints.

### 2. Qwen 3.8 Flash Next (`qwen4_exp`): 4L > 1L Metal Optimizations +
Vision + Barrier Decode KV Reclamation
- **Zero-JIT Metal & Batching (`crates/mlx-sys/src/metal/qwen4/`,
`crates/mlx-core/src/models/qwen4_exp/`)**:
- AOT `qwen4_q8_nax_m16` dense NAX (routing `M = 1..16` directly to
`m16`, skipping narrow `N < 1024` / `(N == 1024 && R <= 8)`), grouped
MoE, batched deferred-fold GDN & paged QSA, compiled batched DFlash2,
`AlignConstant4` (0 dispatches on aligned `R = 1..4`), and batched
unquantized small projections (`count >= 5`, eliminating 3,840 serial
matmuls/wave).
- Compile-time `QWEN4_*_RUN(A)` `switch (active)` in
`dense_decode.metal.inc` & `mixer_act_decode.metal.inc` eliminating
register spills (`-14 ms/cyc` wall, `-16.7 ms` GPU on 1L SPEC).
- Restored **4/4 exact 1L AR greedy parity** (`0.0` ULP `state_out`
diff) via `metal::fast::log` in `gdn_verify_batch.metal`.
- Bounded `WaveCostModel` priors & per-width observation tracking; paged
QSA command-buffer memory budget scaling.
- **Multimodal & Prefix Persistence**: GGUF `mmproj` vision, image
prefix caching + ViT skipping, pinned prefill breaks, idle release
draining, media prefix persistence, and exclusive-barrier decode &
DFlash2 verify KV reclamation (`paged.rs`, `mod.rs`,
`decoder/draft_cycle/mod.rs`).

### 3. Dashboard Work-Mode Image Input (`packages/dashboard`,
`docs/dashboard.md`)
- Enabled direct `kind: 'image'` attachments in Work mode whenever
`modelRow?.images === true`.
- Enforced per-family `conversationImagesMax(family)` (`4` for Flash
Next, `64` otherwise) in both UI blockers and chat service, plus
`recheckModel()` preflight race guard.

---

## Benchmarks & Live E2E Results (Apple M5 Max, 128 GiB)

### Standalone Real-Weights Benchmarks

| Model | Workload | Baseline | **This PR** | Parity / Notes |
|---|---|---:|---:|---|
| **Qwen 3.8 Flash Next** (`UD-Q4_K_XL` + DFlash2, 48/48 direct banks,
4L) | `1L AR` warm (128 tok avg) | 54.07 tok/s | **58.47–58.99 tok/s**
(+9.1%) | `4/4` exact 1L AR parity |
| | `1L SPEC` warm (128 tok avg) | ~68–75 tok/s | **83.03–84.22 tok/s**
(math `110.4`, `1.43×`) | `-14.0 ms/cyc` wall (`-16.7 ms` GPU) |
| | `4L greedy` (512 tok wall / steady dec) | 30.82 → 81.33 |
**93.5–95.6 aggTok/s** (**141.9** steady) | `-65%` dispatches/wave
(`85.8 ms/wave`) |
| | `4L sampled topK=0` (512 tok wall / steady) | 57.66 → 82.09 |
**88.7–92.0 aggTok/s** (**131–137** steady) | **+55% to +60%** wall over
baseline |
| **Hy4-flash** (`Q4_K_M` + `mmproj` + DFly2-B6) | Cold screenshot →
Warm Turn 2 → Cross-owner | — | **46.7 → 52.8 tok/s** (`τ = 3.90`, `158
ms` hit TTFT) | Pixel-exact OCR, `576/597` ViT-skipped hit, exact
128-tok AR match |
| **Qwen 3.8 27B** (`UD-Q4_K_XL` + DFlash2) | `1L` / `4L` greedy / `4L`
sampled | — | **35.6** / **55.8** / **57.2 aggTok/s** | `exactMatchSolo
= 4/4` (`2.78×` AR) |
| **Inkling-2-Mini** (DFlash2 / Bundled DSpark) | `4L` greedy / `4L`
DSpark | — | **71.1–81.6** / **87.7 aggTok/s** | `exactMatchSolo = 4/4`,
`Inline AR = 4/4` |

### Live `mlx agent` Multi-Subagent E2E With Image Input (`napi-rs`
Security Audit)

| Model | Exit | Turns | Gen Tokens | Active Agg Decode | Peak Per-Lane
| Avg `τ` | Errors |
|---|---:|---:|---:|---:|---:|---:|---:|
| **Hy4-flash** (`Q4_K_M`, 100% Direct MoE `85.2 GiB`, `mmproj` +
DFly2-B6) | **0** | **574** | **244,106** | **32.7 tok/s** (`1L: 28.5` →
`4L+: 44.4`) | **52.0 tok/s** | **2.71** | **0** |
| **Qwen 3.8 Flash Next** (`UD-Q4_K_XL`, `mmproj`, 95k+ concurrent ctx)
| **0** | **185** | **180,794** | **31.1 tok/s** (`1L: 26.4` → `3L:
49.3`) | **59.0 tok/s** | AR | **0** |

---

## Verification
- `cargo fmt --all -- --check`: PASS
- `cargo clippy -p mlx-core --lib --tests -- -D warnings`: PASS (0
warnings)
- `cargo test -p mlx-core --lib models::hy_v4_flash::`: **464 passed, 0
failed** (32 vision & barrier KV tests)
- `cargo test -p mlx-core --lib models::qwen4_exp::`: **514 passed, 0
failed**
- `yarn build:native` + `tsc -b tsconfig.json` + `yarn --cwd
packages/dashboard build` + `yarn lint`: PASS (0 warnings, 0 errors)
- `vp test run` (`dashboard`, `lm`, `agent/catalog`, `cli/wizard`,
`cli/download-projector`, `agent-wizard`): **6,940+ passed, 0 failed**
(plus `chat-mode-page.test.ts` **81/81** re-verified after PR #433
rebase)
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.

1 participant