Repository navigation
Bound virtual rows across Web, MyGo, SwiftUI and Kotlin - #274
Merged
Merged
Conversation
tiensonqin
marked this pull request as ready for review
October 25, 2026 19:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Loading 100,000 Gallery rows previously created 100,871 retained LUI nodes before the host virtualized their views. Clearing them left a large native process footprint. This follow-up to #273 adds
virtual_rowsso Web, MyGo, SwiftUI and Kotlin request only the viewport, overscan and active interaction rows; application data and its key index remain complete.Overlapping windows retain identity. Evicted rows dispose their scopes and handlers; persistent editor values belong in controlled application data. Focus, pointer holds, composition and owned popup interactions pin the required rows. Reorders, failed constructors, rollback, hot reload and stale generations preserve ownership. Internal window feedback does not call the public visible-range handler.
Literal and keyed lists keep eager LUI ownership. Updated native clients probe the optional
lui_ocaml_virtual_rows_version()export and negotiate host codes 258 (SwiftUI) or 260 (Kotlin), preserving their semantic platform and extension profiles. Old clients/libraries retain the complete eager fallback. Custom OCaml initializers pass the negotiated~virtual_rowscapability before mounting; custom native event switches forward the maintenance window event. Sparse metadata validates atomically with rollback on every supported host.SwiftUI uses native scrolling with bounded stable row views, retaining the actual editor during far reorder and composition. Kotlin keeps native LazyColumn geometry with stable bounded row composition and native pin ownership. Empty or zero-height roots retain positive logical geometry so layout cannot progressively materialize the entire source.
The migration guide records constructor/runtime capability arguments, lifecycle, host negotiation, wire/event changes and canonical native property admission. The Gallery README gives build, usage and reproducible native test commands.
The focused MyGo fork commit exposes actual requested windows, separate interaction pins and authoritative key lookup. The current immutable union pin also preserves the input-capture, committed-geometry and live native-input snapshot APIs merged into main. The related MyGo PR #3 is merged. Its upstream module identity/imports/links remain unchanged. Embedding applications copy the immutable replacement documented in the README. No dependency source, caches, binaries or recordings are committed.
The earlier allocation improvements remain: single-buffer OCaml encoding, streaming MyGo decoding and transactional application, owned-string receiving, deletion journals without discarded property clones, and abandoned handle binding release. Wire bytes and exact integers remain preserved. There is no active GC policy, forced collection, heap-limit change or allocation trick.
Actual retained counts
Current real OCaml Components integration, including the new Gallery controls, a distant bottom jump, resync and two load/Clear cycles:
Verification
CI now runs full Android coverage and real JVM/JNI/OCaml, SwiftUI/OCaml and UIKit lifecycle gates. The Native OCaml renderer remains outside this task.
Release physical memory
Ordinary macOS release Gallery at
04486a5d, 1,100 × 820 content, same baseline interaction/time windows. These are median OS physical footprints including compressed memory. No race instrumentation, debug endpoints, heap instrumentation, forced collection or active GC policy.Loaded footprint decreased 90.3%; the matching Clear checkpoint decreased 88.0%. A second ordinary load/Clear cycle measured 93.45/94.03 MiB and a 188.81 MiB lifetime peak. The second Clear was about 8 MiB above the first; this proves neither zero allocator retention nor an indefinitely flat process footprint. The two actual node/state cycles returned exactly to idle.
The allocation-only streaming control still measured 661.30 MiB loaded and 719.27 MiB after Clear. Bounding the mounted representation addresses the dominant live-node cost.
The frozen artifacts, manifests, raw 100 ms samples, AX evidence and reports remain outside Git at
/tmp/lui-mygo-release-bounded-20261026/. Both measurement processes closed normally. These footprint measurements are frozen at04486a5d; later native-host and zero-height edge-case fixes are qualified separately and are not a new release-footprint measurement.Final merge head
6f6912af814bc1d5eaaa573272a1c6aa7828bbd2passed all 15 CI jobs and WIP: Core, Web, SwiftUI, Kotlin and Native CI and MyGo desktop and actual OCaml integration CI. The hosted UIKit lifecycle check completed every native phase successfully.An earlier hosted UIKit launch returned no completion output. Fresh local iOS 26 cold-start and stdin-EOF checks passed; the runner now records durable phase checkpoints and preserves launch logs and crash reports on failure. Assertions and timeouts remain unchanged. The final hosted run completed every native phase successfully.
Merge qualification at
6f6912af814bc1d5eaaa573272a1c6aa7828bbd2preserves the new main APIs and the bounded-row fork changes in one immutable dependency. The live-input and bounded-row fork tests pass with the race detector. A full local macOS fork run found the same two font-thickening pixel failures (internal/text.TestThick,plugins/terminal.TestFont) reproduced on the earlier2949164dbaseline; no tests were disabled. The complete LUI CI passed on this exact merge head. Local full LUI race tests, production allocation budgets and the real OCaml/MyGo integration suite also passed.Reproduce the main checks: