fix(runtime): port yoga backend to taffy 0.13 - #8503
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
Included review availability: Your plan provides up to 8 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe runtime upgrades Taffy from 0.7 to 0.13, updates alignment constants, and moves Yoga node and GC scanner state from process-wide storage to thread-local storage. Tests cover alignment safety and per-thread registry isolation. ChangesTaffy and Yoga runtime update
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to This localized runtime dependency migration preserves the intended thread-isolated behavior and includes focused regression coverage; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant YogaWorkerThread
participant YogaNodeRegistry
participant GCScanner
participant MeasureCallbacks
YogaWorkerThread->>YogaNodeRegistry: call with_nodes
YogaNodeRegistry->>GCScanner: register root scanner once per thread
GCScanner->>YogaNodeRegistry: scan current thread's nodes
YogaNodeRegistry->>MeasureCallbacks: scan stored measure callbacks
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Audited and merging. This is more than a dependency bump — it also closes a latent multi-thread GC rooting hole, and the PR description undersells that half.
Moving both the registry and the latch to The port itself is mechanical — associated constants for the alignment enums, Validation on this branch:
One consequence worth a line in the changelog: a yoga node created on one thread is no longer visible from another. That is consistent with the single-threaded UI runtime the handle design assumes, and the new isolation test pins it — but it is a real behavioral narrowing, not just an internal refactor. |
Summary
Ports the Perry TUI and Yoga layout backends from taffy 0.7 to 0.13 without an unsafe
Sendassertion. Yoga nodes now live in a per-thread registry, matching the single-threaded UI runtime and taffy 0.13 storage model.Changes
Related issue
Closes #8438
Test plan
cargo check --locked -p perry-runtimecargo test -p perry-runtime --lib yoga::tests -- --test-threads=1cargo test -p perry-runtime --lib tui::layout::tests -- --test-threads=1cargo fmt --all -- --checkgit diff --check./scripts/pre-tag-check.sh --quickcargo build --releasecleancargo test --workspace --exclude perry-ui-ios --exclude perry-ui-tvos --exclude perry-ui-watchos --exclude perry-ui-gtk4 --exclude perry-ui-android --exclude perry-ui-windowspasses(if user-facing) Added or updated a test under
test-files/or a#[test]in the affected crate(if CLI / stdlib / runtime API changed) Docs are not required; no public API changed
(if touching a platform UI backend) Built
-p perry-ui-<backend>locally on that platformChecklist
feat:/fix:/docs:/chore:prefix convention used in the logCONTRIBUTING.mdand agree to the Code of ConductSummary by CodeRabbit
Bug Fixes
Documentation