Markerless placeholders/Cooperative scheduling (fibers)/Portals/Multiwindow#5554
Draft
ealmloff wants to merge 62 commits into
Draft
Markerless placeholders/Cooperative scheduling (fibers)/Portals/Multiwindow#5554ealmloff wants to merge 62 commits into
ealmloff wants to merge 62 commits into
Conversation
8 tasks
`test -x` on the rustup path failed on the warp runner because `llvm-tools-preview` does not always drop `llvm-symbolizer` at the expected location. Try the rustup path first, fall back to whatever the runner has on PATH, then to a versioned `/usr/bin/llvm-symbolizer-*`. Without a symbolizer LSan reports unsymbolicated frames and the leak: suppressions silently match nothing.
Reset to ealmloff/fuzzing as the new base, then reapplied:
- fiber/scheduler split (api/driver/fairness/message/queues/work)
- portals + render_targets multi-render-target architecture
- markerless hydration (web/src/hydration/{plan,suspense,hydrate}.rs,
interpreter sledgehammer switch, ssr renderer/cache changes)
- desktop multi-window/portal plumbing
- concurrent-scheduler example + spec
Took from ealmloff/fuzzing:
- diff/attributes.rs k-way merge strategy (ported write_attribute to
the portal-aware render_targets[].elements table)
- new oracle (ported away from create_placeholder/replace_placeholder
to insert_children_at_path + pop_root; removed DynamicNode::Placeholder
arm since this branch removed that variant)
- new fuzz harness (ported MutationTrace to drop CreatePlaceholder,
rename ReplacePlaceholderWithNodes -> InsertChildrenAtPath, add
PopRoot; DynamicSpec::Placeholder -> empty Fragment in vdom builder)
- improved core tests + suspense tests
Added back render_suspense_immediate() wrapper around
render_suspense_concurrent() so ported tests compile.
Preserved both SubDocumentAttr (with take_document, used by desktop
portal) and CustomWidgetAttr (used by native wgpu example) via
write_once_attr.rs.
Workspace + tests compile. Still need to actually run tests.
54cf23a to
c64b2a0
Compare
Pulled `sort_template_attributes` const fn + helpers into core/src/nodes.rs and re-exported via dioxus_core::internal. Took ealmloff's rsx/src/element.rs which separates static/dynamic and wraps the static prefix in sort_template_attributes(...). Also derived Clone, Copy on TemplateAttribute so the const sort can swap entries. This fixes the 4 dynamic_attr_override_restores_* tests in diff_element.rs: they relied on attributes.rs's `static_template_attribute_value` finding static attrs by binary-search-able sorted name.
Found a real architectural mismatch: ealmloff's oracle walked DOM children by raw position, which broke for this branch's anchor diff because the empty-slot case has no DOM child to walk to (the markerless renderer uses logical `__dxSlotAnchors` instead). Replaced packages/oracle/src/ contents with the slot-aware oracle from fix-textarea-hydration-pre-ealmloff-merge, which tracks `child_template_indices` per node so path walks resolve through Dynamic slot positions even when no DOM child sits there. Added back ealmloff-style API: `rebuild`/`render` now return EditSummary directly, and `snapshot_eq(&[SnapshotNode]) -> bool` for the fuzz harness's `check_matches_fresh`. Updated test assertions for anchor mutation counts: - attr_cleanup, cycle, diff_dynamic_node, diff_element, diff_keyed_list, diff_unkeyed_list, lifecycle: anchor diff substitutes `load_template + remove_node` for ealmloff's `replace_node_with` on placeholder swap. Total mutations are equal or fewer. Ignored 3 suspense tests with `#[ignore = "needs suspense rerun start port from ealmloff/fuzzing"]` — they assert behaviors (re-rendering a suspending child during diff, promoting on task cancel) that require porting ealmloff's suspense algorithm. TODO comments mark the work. Core: 139 passed, 0 failed, 3 ignored.
Three suspense tests were failing because this branch's cooperative diff queues descendant component scopes for later instead of running them inline. The boundary's diff therefore committed before any `suspend(task)?` from a re-rendering child reached `suspense_context.suspended_futures()`, so: - empty `(None, false)` never switched to the fallback when a child re-suspended during the boundary's diff - `(Some, true)` never promoted to the resolved children when a child cancelled its suspended task during the boundary's diff Added `Scheduler::pop_dirty_descendant_of(scope_id)` that drains the smallest-height dirty fiber under a scope, and called it in a loop after each `diff_node` inside `SuspenseBoundaryProps::diff`. That forces descendant scopes to run synchronously while the boundary still owns the diff, so any suspend/cancel registers against the boundary's `SuspenseContext` before the post-diff branch is taken. Also extended `(None, false)` to move the just-rendered children into the background and show the fallback when descendants suspend during diff (mirrors `(None, true)` semantics but applied retroactively). Result: 142 core tests pass, 0 ignored.
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.
Currently we use comment nodes in several places at runtime and in hydration:
This PR removes all of those in favor of keeping track of the position of nodes relative to an anchor. This lets us:
<!--placeholder8-->when first loaded in fullstack #5548)This PR is working well enough to hydrate the docsite correctly, but needs some more refactoring and tests
TODO: