Repository navigation
Description
Summary
virtual_rows windows a vertical list by index. Two common layouts need windowing in two dimensions, and neither can get it today:
- Infinite canvases / node graphs. Thousands of absolutely positioned items under an app-owned camera (
live_offset/live_scale). Only items near the camera should exist as elements. Today the app rebuilds the view with a new set of children whenever the camera moves far enough, so every window change re-runsviewand re-subscribes everything still mounted. - Wide tables (spreadsheet-like, hundreds of columns).
virtual_rowsbuilds only visible rows, but every row builds all of its cells. 40 visible rows × 200 columns is 8,000 cell elements with only a small block on screen, and commit, layout andLivesubscriptions scale with all of them. Strata's table view in Virtual lists and grids: a heading row counts as an item, an item's set size replaces its row's, and no row or column index #533 is built the same way (cells inside virtual rows).
Where we hit it (canvas, rev d751f07)
A node-graph canvas with 200 nodes at near zoom, nodes running with progress. Apple M1 Max, --profile perf, 120 frames after warm-up, median of 5 runs: 10.8 ms/frame average, 25.3 ms peaks, mostly view re-runs as nodes enter and leave the window. At 10,000 nodes / 15,000 edges, building everything is not an option. We have not measured a wide table; the numbers above are the canvas case.
What we'd like
- A core primitive: an element owning a keyed set of positioned items whose window the app decides, for example
El::virtual_items(Rc<dyn VirtualItems>)withversion()(called every frame, cheap),keys()(current window, back to front),build(key)(no app state), plus optionalmount_budget()andmount_priority(key).- A commit that only changes that set behaves like a
virtual_rowsremount:viewdoes not run and mounted items keep their subtrees. - Entering items mount within a per-frame budget, nearest first. Leaving items unmount at once. A focused item stays pinned.
- Content changes go through a new key plus a version bump.
- A commit that only changes that set behaves like a
- On top of it, or alongside
virtual_rows, a scroll-driven grid for tables: rows × columns with row heights and column widths, windowed on both axes from the scroll offset. Ideally frozen header rows / leading columns, and the row and column indices from Virtual lists and grids: a heading row counts as an item, an item's set size replaces its row's, and no row or column index #533 for accessibility. - Related: One
live_textanywhere makes every virtual-window shift run the view #544. Alive_textinside a windowed item should not force a full rebuild. We lay it out against its first sampled text and draw the current text.
Result with a patched build (canvas)
The same 200-node scene: 0.93 ms/frame average, 2.3 ms peak. A 10,000-node graph pans and zooms with zero view runs per window change (RUNE_FRAME_LOG commit reasons are only virtual).
Reference implementation of (1) on our fork, reusing the remount move plan: zohu@56d14e65 (based on d751f07, before the newer pins / fill-state work on dev). It does not include (2).
Activity
opencodejr commentedon Nov 25, 2026
Thanks for the detailed write-up, the numbers and the reference commit.
I checked this against
dev:El::virtualize/El::virtual_rows(crates/rune/src/el/virtual_rows.rs) only window a vertical growth stack inside a scroll viewport, by index. I found no keyed or 2D equivalent incrates/: nothing likevirtual_items, a grid source or column windowing.crates/rune-kit/src/containers/table/view.rs) builds every cell of each mounted row, so wide tables scale with column count, as you describe.live_offset/live_scalepan and zoom a camera with noviewre-run, but changing which items exist still needs one.I'm tracking this as a feature request with three parts:
version/keys/build, a mount budget with nearest-first priority, focused items pinned). A commit that only changes the set takes the remount path, soviewdoesn't run.live_textinside a windowed item that doesn't force a rebuild (Onelive_textanywhere makes every virtual-window shift run the view #544).This overlaps #1384 (wrapped grids and horizontal windowing for
virtual_rows) but isn't the same, so the two stay separate. Your fork commit (56d14e65, based ond751f07) is a useful reference.devhas moved since then (pins and fill-state work), so any change has to be rebased onto the current remount code.opencodejr commentedon Nov 25, 2026
I looked at bringing this in and haven't made a change. It's bigger than one patch should be, and part of it needs a maintainer decision first.
virtual_itemsprimitive: your commit56d14e65is a good reference, but it's based ond751f07, and the runtime it touches has since been restructured.Runtime,MeasurementandCxwere type-erased intoRuntimeCore(perf(rune): type-erase Runtime, Measurement, and Cx into non-generic RuntimeCore #1192), private state was grouped into subsystem structs (refactor(runtime): group the runtime's private state into subsystem structs #1234), the#[path]modules inruntime.rswere removed (refactor(runtime): remove all 9 remaining #[path] attributes in runtime.rs #1255), and nested virtual lists (Virtual lists: a list in a row of another windows against the same scroll viewport #956), append-only rows (perf(virtual-rows): add El::virtual_rows_append_only() so growing lists read only appended keys #1802) and descendant scroll anchoring (feat(scroll): add El::no_scroll_anchor and virtual-row descendant anchoring #1989) were added.runtime/commit/remount.rshas had 30 commits, andruntime/virtual/no longer exists. Getting the same behaviour ontodevmeans redesigning it against the current remount and window code, not rebasing it.live_textin windowed items:live_textelements already stay on thevirtual_rowsremount fast path (fix(virtual): live_text elements keep virtual-window remounts on the fast path #1472). Laying out against the first sampled text while drawing the current one changes behaviour, so that belongs in Onelive_textanywhere makes every virtual-window shift run the view #544..virtualizein a horizontal scroll stacks diagonally, and wide rows are cut #1384.If you'd like to move part 1 forward, a PR against current
devwould be the easiest thing to review. It should follow the conventions inAGENTS.md(feature-owned state, one bullet inchangelog/unreleased/, a sibling test file) and come with your paired--profile perfnumbers.zohu commentedon Nov 25, 2026
Thanks for looking into this. We agree that the keyed
virtual_itemsprimitive makes sense as a standalone PR.We’ve since ported our implementation to upstream
22ebd7e7. Here’s the patch we use downstream. It shows how keyed items fit into the restructured remount code and includes a paired headless benchmark comparing a window change with a full view rebuild.The patch also includes Playground integration and our
live_textmeasurement change. For an upstream PR, we’d keep the scope to the core primitive, leavelive_textto #544, and keep the scroll-driven grid as a separate design discussion.The canvas timings in the original report were measured on the earlier build.
Hona commentedon Nov 25, 2026
Thank you for the clear description and numbers.
Please do not spend time preparing a pull request — as the README notes, this project does not accept external pull requests. We are building the core keyed
El::virtual_itemsprimitive ourselves from scratch against currentdev, and separately working on column windowing forrune-kit'sTable.For the third part (live text inside windowed items), recent work on
devalready covers keepinglive_texton the remount fast path, paint keep, and tabular digits (#1472, #2094, #2105, #2119).We will measure our implementation against the scenario and numbers in your description, and let you know here once it lands so you can try it.
feat(rune-kit): Table::virtual_columns and Table::frozen_columns for …
Hona commentedon Nov 25, 2026
Part 1 (core
El::virtual_itemskeyed container) is now ondevin #2236 (2be8844).rune::VirtualItems(version,keys,build, plus defaultedmount_budgetandmount_priority) andEl::virtual_items(Rc<dyn VirtualItems>).version()is checked in O(1) each frame so idle windows do nothing; window changes takeCommitKind::Remountwithout re-runningview; staying items keep theirNodeId, paint-keep epochs,memoentries, andLive/LiveTextsubscriptions without callingbuild; leaving items unmount immediately except an item holding keyboard focus (or a focused descendant), which stays pinned until focus leaves it; entering items mount settled up tomount_budget()per frame nearest-first bymount_priority(key)while rendering inkeys()back-to-front order.--profile perfbenchmark (cargo run --profile perf -p rune --example virtual_items_bench, 5 paired alternating runs × 120 frames, 4 entering / 4 leaving items per frame + 1 stayingLiveTextupdate, headlessRuntimeomitting GPU upload and presentation):viewrunsviewrebuildEl::virtual_itemsremountviewrebuildEl::virtual_itemsremountSee the
Lists/Virtual items canvasstory inexamples/playground. Follows spatial canvas culling separated from 1D scroll virtualizers and W3C CSS Containment Level 2 focus pinning.Tested headlessly on Windows (unit, runtime, a11y, remount/memo/prune/relayout, doctests, clippy,
wasm32WebGPU/WebGL checks, and--profile perfbenchmark), macOS arm64 (unit, runtime, doctest, and--examples --benches --testscheck), and Linux aarch64 (--examples --benches --testscheck); not viewed interactively in a live GPU window.Please try it on
dev(2be8844) and let us know if anything is missing or behaves unexpectedly for your canvas. Leaving this issue open for part 2 (column windowing inrune-kitTable).feat(rune-kit): Table::virtual_columns and Table::frozen_columns for …
feat(rune-kit): Table::virtual_columns and Table::frozen_columns for …
Hona commentedon Nov 25, 2026
Wide-table column windowing and frozen leading columns for
rune-kit::Tablelanded ondevin #2238 (73bf4e5b5), along with verticalEl::virtual_rowsremounts insideEl::scroll_xywrappers and ARIA grid counts/indices (aria-rowcount,aria-colcount,aria-rowindex,aria-colindex) on AccessKit and the web DOM mirror.Before / after (10,000 rows × 200 columns of 100 pt, 1,000 × 1,150 pt viewport ≈ 40 visible rows, 42 mounted rows with
virtual_overscan(0.0, 0.0), 5 paired alternating runs,--profile perf, headless commit + layout excluding GPU upload/present):viewruns): 36.59 ms → 2.37 ms.viewruns inside the hysteresis band; crossing a column window runsviewonce per shift (12.68 ms median per shift across 12,000 pt).Follows WAI-ARIA 1.2 windowed-grid attributes and CSS
position: sticky/ AG Grid pinned-left columns; both builders default off (false/0), leaving existing tables unchanged. Resizing, header-drag reordering, keyboard focus, andEl::caret_browsing(true)stay working while scrolled out of view. Seerune-table--virtual-columnsinexamples/kit-gallery.Tested on Windows, macOS, Linux (compile check), and headless Chromium (WebGPU + WebGL2 smoke and ARIA mirror checks); not seen in a live desktop window, real screen reader, non-Chromium browser, or iOS.
Still open here: a core
crates/runescroll-driven 2D grid / horizontal-axis virtualization primitive (for custom sheets outsiderune-kit::Tablewith zeroviewruns across horizontal column boundaries), to be designed alongside #1384. Let us know if this table API misses anything your wide-table case needs.Hona commentedon Nov 25, 2026
Both main pieces of this issue are now on current
dev:2be8844):rune::VirtualItemsandEl::virtual_itemsfor app-windowed keyed containers (canvases, node graphs, and custom 2D views) on the zero-view-run remount path.73bf4e5b5):Table::virtual_columnsandTable::frozen_columnsinrune-kit, with verticalvirtual_rowsremounts insidescroll_xyand ARIA grid counts/indices.For a custom wide sheet outside
rune-kit::Table,El::virtual_itemsalready supports zero-view-run scrolling on both axes by updating the source fromon_scroll_offset(which runs without rebuildingview):For part 3,
El::live_textinside windowed items already stays on the remount fast path without rebuilding or reshaping tabular digits (#1472, #2094, #2105, #2119). We will not changeEl::live_textto lay out against its first sampled text instead of its authored placeholder, because placeholder sizing (such astext("00:00")) is how apps reserve width so shorter initial values do not collapse or clip later updates.A built-in core scroll-driven 2D / horizontal-axis grid primitive in
crates/rune(so custom sheets do not wireVirtualItemsmanually) is now tracked in #1384 alongside wrapped grids and horizontalvirtual_rows.Both merges were verified with headless tests and benchmarks only, not in a live window. Please reopen if
El::virtual_itemsorTable::virtual_columnsfalls short for your canvas or wide sheet on currentdev.Thanks for the detailed report and numbers.