Repository navigation
Fix native platform review findings (clocks, store validation, Vulkan, resources) - #401
Merged
Merged
Conversation
A RemoveChild named against the wrong parent left the child in its real parent's list but still added it to the forest roots, so preorder visited it twice. Only promote to roots when a link was actually cut. Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
Cyclic inserts, stale RemoveChild, and structural ops on missing nodes now fail the whole batch with op context, leaving the tree unchanged. Lui_host.apply_batch returns false so the runtime can resync, matching Web and Android. Property writes to missing ids stay ignored. Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
Shadow child sets replace per-op list filters so wide RemoveChild batches stay O(n). InsertChild/MoveChild whose parent is not a node (including gallery parent=-1) is a no-op, matching apply_op. The incremental layout random test now mutates the leaf ids it created. Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
Lui_window.fold_wait_ms combines the UI input deadline, Lui_clock.next_delay, and an optional host-wants-frame wake. Toast nodes with a duration prop schedule Dismiss from store_changed and wake next_input_deadline, replacing the demo toast_since workaround. Idle store_changed stays allocation-quiet when no toasts are live. Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
Lui_vulkan.resize rebuilds the offscreen image and framebuffer while keeping the instance, device and pipelines. changed_rows lets the Linux host upload a dirty row span instead of the whole readback. Shader fallback compile uses a private mkdtemp directory, cleans up on every path, and releases the OCaml runtime around fork/wait. Window swapchain present remains a follow-up. Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
Lui_resource.create defaults to a small Domain pool instead of one spawn per load. request/reload mark the entry Failed when the executor raises, so a domain-cap error cannot leave it stuck Loading. Completions call an optional set_completion_wake so hosts can unblock an idle wait. Hosts that drain every frame land in a later commit. Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
The Unix master fd gets FD_CLOEXEC. The spawn OOM path frees argv, env and the pty record before failing. OCaml close zeros the handle before c_close, and the stub clears mfd so a second close does not double-free. Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
pump keeps the unwritten tail of nonblocking writes instead of dropping it. pending is oldest-first. Service tables (terms/next) are mutex protected because resource workers can complete off the main domain. Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
Shell and a11y expose unix_fd so the Linux wait loop can select instead of capping idle at 50ms. dbus_wait_cap_ms keeps the cap only when the bus is connected but no fd is available. Blocking send_with_reply_and_block releases the OCaml runtime. Noop renderer frames are zeroed with Bytes.make. Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
A missing pangocairo/pangoft2/fontconfig used to produce empty cflags and a later missing-header error. The rule now exits so the configure failure is visible. Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
…oops. macOS, Linux and Windows window loops call Lui_app.tick_clock and Lui_host.tick every iteration, fold Lui_clock.next_delay into the wait, drain Lui_resource, and wake on completions. Demo toast_since clocks are gone. Linux watches DBus fds instead of a 50ms idle cap, recreates only the Vulkan frame on resize, uploads damaged rows, and treats blit resize failure as a demotion. Swapchain present is documented as a follow-up. Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
| (with-stdout-to %{target} | ||
| (bash | ||
| "case '%{system}' in linux) printf '(%s)' \"$(pkg-config --cflags pangocairo pangoft2 fontconfig 2>/dev/null)\";; *) printf '()';; esac")))) | ||
| "case '%{system}' in linux) flags=$(pkg-config --cflags pangocairo pangoft2 fontconfig) || exit; printf '(%s)' \"$flags\";; *) printf '()';; esac")))) |
Contributor
There was a problem hiding this comment.
Invalidate Vulkan damage after blit resize so window moves re-upload. Keep the blit cell after a resize error so later events can retry. Sample the Linux/Windows clocks after draining events so scrollbar ticks stay monotonic. macOS wait no longer zeros Frame.Wait_ms. Windows idle Sleep is capped at 4ms so input still drains. D-Bus watch uses a C select on raw fds; GTK keeps a 50ms GLib wake. Resource spawn failures notify watchers. Terminal pending writes use a two-list queue. Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
A Failed on_state callback can reload immediately. Notifying from spawn before request/reload stored the result overwrote the retry's task with None, so scope disposal could not cancel it. Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
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.
Fixes review findings against
platform/nativeat87fcf6af. Host loops now tick application and animation clocks, the retained store rejects invalid structural batches atomically, Linux Vulkan uploads only damaged rows and resizes the frame image without rebuilding the device, and resource/PTY/DBus paths stop dropping work or blocking the runtime.Review follow-up (
9f2cba78): Vulkan damage is invalidated after blit resize; blit resize errors are logged without dropping the cell; Linux/Windows clocks are sampled after event drain; macOS wait preservesFrame.Wait_ms; Windows idleSleepis capped at 4ms; D-Bus watch uses Cselecton raw fds (no%identity); GTK still gets a 50ms GLib wake; resource spawn failures notify watchers; terminal pending writes use a two-list queue.Findings
High
Lui_app.tick_clockevery iteration and foldLui_clock.next_delayviaLui_window.fold_wait_ms. Toastdurationis applied byUi.store_changed; demotoast_sinceworkarounds are gone.RemoveChildonly adds a child to roots when a link was actually cut.Lui_vulkan.resizekeeps instance/device/pipelines. Swapchain present deferred (host still readback+blit).Medium
apply_batchvalidates against a structural shadow (cycles, wrong-parentRemoveChild, missing nodes) and fails the batch with op context so the host can resync.InsertChild/MoveChildwith an unknown parent (galleryparent=-1) remains a no-op. Property ops on missing ids stay ignored.Lui_host.tick ~nowevery frame;wants_repaintalready requests redraws while animations run.Failedand notify watchers; hostsdrain_allandset_completion_wakevia SDL; terminal plugin tables are mutex-protected.selectand wakes SDL. GTK/AppIndicator still uses a 50ms cap because GLib sources are not those fds.pumpretries the unwritten tail of nonblocking PTY writes.dbus_connection_send_with_reply_and_blockreleases the OCaml runtime.Low
Bytes.make ... '\000'.mkdtemp, cleans up on all paths, releases the runtime around fork/wait.FD_CLOEXEC, spawn OOM frees argv/env/record,closeis idempotent. Unix still ignoresenv(documented, unchanged).Tests
fold_wait_ms, toast duration dismiss, idle allocations.changed_rows, resize keeps device.flush_pending, close twice.Build
Swapchain present for Linux Vulkan is the remaining H3 follow-up. A full GLib fd integration for idle tray actions is the remaining M4 follow-up when GTK is up.