Skip to content

Upgrade LUI to 93b2097 and adapt native event forwarding - #144

Merged
RCmerci merged 3 commits into
mainfrom
upgrade/lui-ios-20261030
Oct 30, 2026
Merged

RCmerci merged 3 commits into
mainfrom
upgrade/lui-ios-20261030

Conversation

@RCmerci

@RCmerci RCmerci commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Upgrade LUI from 4fdb9136026af7863a8d025133871e34864eace1 to 93b209713acd852094af085737762e59161e2265, the latest main resolved when this task began.

Journal keeps its native Timeline, fixed resident graph hosts and existing UI/UX. The new virtualWindow event uses typed Swift → C → OCaml forwarding with full-width IDs, validated ranges/pins, GC roots and owned patch delivery after releasing the runtime. The app explicitly negotiates the existing host-code-2 eager capability; this does not adopt LUI virtual_rows. Thirteen required transitive dependencies are added, with all previously locked package versions retained. The link-only build stub is aligned with the new symbol.

Validation

  • Final head fb64304e13ec6ee75bf87140abb0e0b75efdfcd1; clean diff, independent read-only review of all ten changed files found no evidenced issue.
  • Full dune build @all app/native_embed.exe.o and dune runtest --force: pass at final head.
  • 26 real native Swift/C/OCaml bridge tests, including empty windows, wide IDs, pins, invalid input and callback reentry: pass. Existing runtime startup/failure tests: pass.
  • Existing build-helper suite: pass, including the new symbol boundary that failed the first CI run; the test was not weakened.
  • Old/new image color, inert preview hit barrier, draft isolation and Chinese/dark native menus/settings: pass. Two stable corresponding image states are pixel-identical outside the status bar.
  • Candidate actual-touch tests for keyboard/Photo overlay cancel and continued focus, details/Favorites, left/cancel/continuous swipes, per-graph scroll position, resident management, rapid save, delayed/hidden image completion, real loopback TLS hidden graph synchronization and sign-out cleanup: pass. The Chinese test enters committed text; it does not exercise Pinyin marked-text composition.
  • Across all eight diagnostic runs: three panes created, zero warm-window pane/list make/disappear/restore events. Sign-out separately dismantles all three panes.

Repeated performance comparison

Same M4 Max/64 GiB, macOS 26.6.2, Xcode 26.1.1, Swift 6.2.1, OCaml 5.5.0 and iOS 26.1 Simulator. Same optimized Release fixture configuration, synthetic data and operations. Normal binaries have no added timing/display probes. No local builds or recording overlap timed samples.

The following rows are five iterations per version within one XCTest session, not five independent processes. Memory is XCTest physical memory in decimal kB, converted to MiB. CPU is whole app CPU during the actions, including in-process AX handling, not pure main-thread rendering time.

Measure Before median [min, max] After median [min, max] Median difference Max difference
App launch (s) 1.025 [0.899, 1.803] 0.973 [0.761, 1.166] -0.052 (-5.04%) -0.637
Warm graph: three-swipe app CPU (s) 2.030 [2.007, 2.062] 1.839 [1.797, 1.900] -0.191 (-9.41%) -0.161
Warm graph: peak physical memory (MiB) 158.878 [158.003, 159.597] 149.472 [149.003, 149.785] -9.406 (-5.92%) -9.813
Image Timeline: eight-scroll app CPU (s) 4.290 [4.153, 4.325] 3.066 [2.893, 3.163] -1.224 (-28.53%) -1.162
Image Timeline: peak physical memory (MiB) 147.629 [146.722, 149.629] 138.441 [136.394, 142.066] -9.188 (-6.22%) -7.563
2,114 roots: eight-scroll app CPU (s) 3.865 [3.695, 3.980] 2.725 [2.634, 2.751] -1.141 (-29.52%) -1.229
2,114 roots: peak physical memory (MiB) 144.394 [143.394, 145.254] 131.597 [128.347, 133.847] -12.797 (-8.86%) -11.406

Five additional independent fresh-data process pairs alternate old/new order. These title/image observations include the XCTest drag and AX polling overhead and are not first-pixel timing:

Measure Before median [min, max] After median [min, max] Median difference Max difference
fresh-process-launch-title-observation (s) 3.359 [3.227, 4.597] 3.166 [3.108, 3.689] -0.193 (-5.76%) -0.908
cold-first-graph-titleObservationSeconds (s) 2.858 [2.848, 2.867] 2.851 [2.836, 2.869] -0.007 (-0.26%) +0.002
cold-first-graph-loadedImageObservationSeconds (s) 3.951 [3.938, 3.962] 3.940 [3.924, 3.963] -0.011 (-0.28%) +0.000
warm-graph-titleObservationSeconds (s) 2.777 [2.767, 2.789] 2.775 [2.766, 2.787] -0.002 (-0.08%) -0.003
warm-graph-loadedImageObservationSeconds (s) 3.864 [3.849, 3.887] 3.861 [3.850, 3.881] -0.003 (-0.07%) -0.006

Standard fixture: 114 roots per graph, with three fixed canonical transactions already present before every standard comparison (Today page creation plus two Capture entries on A; A has 116 roots). Large fixture: an independent zero-cursor peer with 2,000 added roots per graph, 2,114 total. Each run starts from an independent checkpoint copy.

Separate diagnostic binaries

Three independent no-recording process pairs are the primary diagnostic sample; the separately recorded first pair is excluded. There are six cold preparations and fifteen warm commits per version. Synchronous emission wall time is distinct from full handoff latency. CADisplayLink callback gaps are not hardware presented FPS. The 608 pooled warm callback intervals per version are correlated frames, not 608 independent runs.

Measure Before median [min, max] After median [min, max] Median difference Max difference
runtime_start_ms (ms) 25.506 [11.185, 25.670] 11.677 [10.635, 27.013] -13.829 (-54.22%) +1.342
cold_snapshot_ms (ms) 19.376 [15.176, 20.359] 18.777 [17.814, 20.695] -0.598 (-3.09%) +0.335
cold_prepare_emission_ms (ms) 9.985 [9.340, 11.133] 8.453 [8.114, 8.957] -1.532 (-15.34%) -2.176
cold_source_slide_callback_ms (ms) 255.262 [247.105, 266.123] 248.044 [242.580, 251.825] -7.218 (-2.83%) -14.298
cold_reveal_after_source_submission_ms (ms) 288.859 [279.244, 298.855] 279.892 [274.220, 283.122] -8.967 (-3.10%) -15.733
cold_window_max_callback_gap_ms (ms) 147.827 [144.482, 152.957] 119.351 [107.495, 136.603] -28.475 (-19.26%) -16.354
warm_commit_emission_ms (ms) 0.753 [0.572, 1.445] 0.147 [0.138, 0.232] -0.606 (-80.49%) -1.213
warm_window_max_callback_gap_ms (ms) 49.988 [32.718, 66.664] 49.979 [33.340, 50.138] -0.009 (-0.02%) -16.526
warm_callback_intervals_ms (ms) 16.668 [16.090, 66.664] 16.668 [16.189, 50.138] -0.000 (-0.00%) -16.526

Small tail increases are retained: instrumented runtime-start max +1.342 ms, cold snapshot max +0.335 ms and warm display interval p95 +0.030 ms. With small event counts, nearest-rank p95 often equals max; no significance claim is made.

Extended memory comparison

Short five-iteration memory deltas were higher after upgrading (standard median 491.520 → 917.504 kB; large median 655.360 → 1163.264 kB), despite lower absolute/peak memory. We therefore repeated the identical 2,114-root scroll operation twenty times per version, 160 native scrolls each, with no probe or recording:

Measure Before median [min, max] After median [min, max] Median difference Max difference
Memory Physical (lui-upgrade-probe), kB (MiB) 0.180 [-1.234, 5.125] 0.133 [-0.828, 1.609] -0.047 (-26.09%) -3.516
Absolute Memory Physical (lui-upgrade-probe), kB (MiB) 141.597 [139.488, 142.941] 131.402 [128.691, 133.332] -10.195 (-7.20%) -9.609
CPU Time (lui-upgrade-probe), s (s) 3.708 [3.614, 3.778] 2.615 [2.589, 2.712] -1.093 (-29.47%) -1.066
Memory Peak Physical (lui-upgrade-probe), kB (MiB) 142.324 [140.504, 143.722] 131.949 [130.519, 134.378] -10.375 (-7.29%) -9.344

Twenty-iteration follow-up: app CPU median 3.708279 → 2.6154075 s (−29.47%); peak physical memory median 142.324 → 131.949 MiB (−7.29%), with maxima 143.722 → 134.378 MiB. Every observed candidate absolute/peak sample remains below its baseline counterpart.

The per-iteration physical-memory delta median is 188.416 → 139.264 kB (−26.09%); its p95 rises 638.976 → 1114.112 kB (+475.136 kB), while its maximum falls 5374.000 → 1687.552 kB. Both versions gain exactly 1,228.8 kB (1.171875 MiB) across the last ten ordered absolute-memory observations. This does not establish a complete plateau: first-to-last growth is 2,162.688 → 3,440.688 kB, and last-ten fitted slopes are 126.703 → 169.003 kB/iteration. We retain this higher fitted slope and the early-session growth difference rather than calling the candidate leak-free. One long session per version cannot settle very long-term memory behavior.

The cumulative signpost duration for eight scrolling gestures (not a single-frame hitch) median is essentially unchanged, 2.566040 → 2.5660275 s. Its maximum rises 2.599369 → 2.632817 s (+33.448 ms, +1.287%). This tail observation is retained; the sample does not justify claiming that every latency metric improves, nor does it identify a repeatable latency regression by itself. The bounded Simulator tests show lower CPU and absolute/peak memory, while hardware frame-rate and indefinite-memory guarantees remain unproven.

Evidence and practical limits

The task-local report, CSV and raw evidence retain ordered samples, min/max, standard deviation, absolute/relative differences, traces, historical driver snapshots, producer records and SHA-256 manifests. The delivered recordings show actual native operations at original speed; the two swipe clips exclude a Simulator startup PTS discontinuity using unchanged contiguous video packets with a constant timestamp offset, and full sources remain locally preserved; diagnostic videos are not used for the no-recording performance comparison.

The apps retain production Journal UI/reducers with identical existing synthetic fixture hooks and memory-only authentication/key storage. JournalApp is Release-optimized with the existing DEBUG fixture storage hook; LUI is Release. Experimental host-restamped OCaml inputs retain cross_abi_validated=false. This is not physical-device ABI, real-account or hardware FPS proof. XCTest returned no usable hitch/FPS metric, so none is fabricated. spec-dev-tool check --all is unavailable (exit 127). No merge or TestFlight publication is included.

Production app binaries were built at b0c0440; subsequent commits change only the existing pin test constant and the link-only stub. Final runtime source is equivalent to the measured app, and final source checks bind fb64304.

Final-head CI: Journal CI run 41020389775 completed successfully. The PR is open, non-Draft and not merged. UI/video/raw evidence is retained locally; attachments are omitted.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T07:00:52.036815Z 50eac5b 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.

@RCmerci
RCmerci merged commit 5c47262 into main Oct 30, 2026
2 checks passed
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