Skip to content

feat: add horizontal column virtualization (S3)#3

Merged
blove merged 11 commits into
mainfrom
feature/column-virtualization
Apr 21, 2026
Merged

feat: add horizontal column virtualization (S3)#3
blove merged 11 commits into
mainfrom
feature/column-virtualization

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented Apr 21, 2026

Summary

  • Add planColumns() to layout-core — binary search for visible column range with overscan clamping and pinned column support
  • Expand grid-core GridCoreViewportState with scrollLeft and width for horizontal scroll tracking
  • Integrate column planning into renderer-dom snapshots (backwards-compatible: virtualizes when viewportWidth provided, returns all columns when omitted)
  • Switch React surface cells from CSS grid to absolute positioning and wire up horizontal scroll tracking with viewport width measurement
  • Make S3 (500 columns, 10K rows, 2 pinned) runnable in the bench app

Verification

  • Tests: 135 passing across all packages, 0 failures
  • Lint/Typecheck: clean
  • S1/S2/S7 regression: H1 satisfied, no scroll quality degradation
  • S3 smoke: dom_nodes_peak=160 (proving column virtualization active with 500 cols), 0 blank gap frames, 0 long tasks

Test plan

  • pnpm lint && pnpm typecheck && pnpm test
  • node --test scripts/__tests__/bench-matrix.test.mjs
  • pnpm bench:matrix -- --project=chromium --adapters=pretable --scenarios=S1,S2,S7 --scripts=scroll --scale=dev --repeats=3 (regression)
  • pnpm bench:matrix -- --project=chromium --adapters=pretable --scenarios=S3 --scripts=scroll --scale=dev --repeats=3 (S3 smoke)

blove and others added 11 commits April 20, 2026 21:24
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements planColumns() as the horizontal equivalent of planViewport(),
using binary search for efficient visible-range detection with pinned-left
column support and configurable overscan.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…wport

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add scrollLeft and width fields to GridCoreViewportState and update the
setViewport equality check to suppress duplicate emissions on all four
fields. Fix all TypeScript callers with placeholder values (0) to be
wired up in later tasks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Integrates planColumns() from layout-core into createDomRenderSnapshot,
virtualizing columns when viewportWidth is provided while remaining
backwards compatible when it is omitted.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace CSS grid layout with absolute cell positioning, which is required
for column virtualization where only a subset of columns will be in the DOM.
The surface now iterates renderSnapshot.columns instead of the full columns
array, using plannedCol.left and plannedCol.width for positioning.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…cking

Adds viewportWidth to usePretableModel, measures the DOM viewport width
in PretableSurface via useLayoutEffect, and threads scrollLeft/viewportWidth
through to createDomRenderSnapshot so column virtualization is active.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add S3 to bench app query parsing, bench-runner P0a validation list,
and bench-matrix default scenarios. S3 supports scroll only — no
interaction scripts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… fallback

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@blove blove merged commit 45f94ec into main Apr 21, 2026
5 checks passed
blove added a commit that referenced this pull request May 9, 2026
* docs(specs): B2 follow-up #3 — autosize end-to-end wiring design

End-to-end autosize harness wiring (pretable + ag-grid + mui; tanstack
unsupported), with H22 comparator-parity hypothesis evaluator reusing
the min-repeat gate from PR #125, and a full B2 matrix re-run with
autosize included.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* docs(plans): B2 follow-up #3 — autosize wiring implementation plan

Six-task plan for wiring autosize through the bench harness end-to-end,
adding evaluateH22 with the min-repeat gate, and re-running the B2
matrix with autosize included.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* feat(bench-runner): accept autosize script through harness pipeline

Adds "autosize" to the bench-runner supportedScripts allowlist (gated
to S2 and to pretable | ag-grid | mui — tanstack remains unsupported
per the B2 spec), to the apps/bench query-state parser, and to the
BenchScriptName Extract narrow in bench-types.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* feat(bench): measureBenchAutosizeRun helper for autosize script

Adds a single-event autosize latency helper that awaits the adapter's
autosize callback and one rAF, reporting interaction_latency_ms as
"call-to-paint" timing. Mirrors the shape of measureBenchKeySequenceRun.

Also unblocks the now-accepted "autosize" script in the query-state
parser by retargeting the existing fallback-to-defaults test to an
unrelated bogus value.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* feat(bench): wire onAutosizeReady on pretable/ag-grid/mui adapters

Pretable, AG Grid, and MUI adapters now publish their autosize entry
point through a new onAutosizeReady callback. bench-app.tsx captures it
in autosizeApiRef and dispatches measureBenchAutosizeRun on the autosize
script, mirroring the updateApiRef + measureBenchUpdatesRun chain.

Replaces AG Grid's pre-emptive onGridReady autosize branch (which only
ran at mount) with a callback so autosize fires on bench-script
dispatch. MUI now exposes apiRef via useGridApiRef so the harness can
call apiRef.current.autosizeColumns({ includeOutliers: true }) — async
on v7+. TanStack accepts the prop for harness uniformity but the
bench-runner returns "unsupported" before the adapter ever mounts.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* feat(bench-matrix): evaluateH22 autosize comparator-parity hypothesis

Adds H22 ("pretable autosize is within a single 60Hz frame and within
10% of the best ag-grid/mui comparator on S2"). Reuses the H1
comparator-parity pattern: 16 ms single-frame floor, 10% parity band,
≥10 repeats per side before resolving a tight-zone (0.9–1.2) ratio.

Hoists COMPARATOR_PARITY_MIN_REPEATS to module scope so H1 and H22
share a single source of truth.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* chore(bench): B2 matrix re-run with autosize; H22 evaluated

S2/hypothesis/Chromium, all 13 scripts including autosize, repeats=3,
~5 min wall-clock. H22 satisfied: pretable autosize 5.3 ms vs MUI 11 ms
(ratio 0.482, outside the tight zone — gate does not apply).

H1 also flipped from failing → satisfied vs the 2026-05-08 milestone
(parity at n=3 with mui this run; matches the n=20 correction documented
in the previous repo-memory entry).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* chore(format): prettier formatting for B2 follow-up #3

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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