Skip to content

Step growth by each frame's own time - #1067

Merged
Hona merged 3 commits into
devfrom
motion/growth-frame-time
Nov 17, 2026
Merged

Hona merged 3 commits into
devfrom
motion/growth-frame-time

Conversation

@Hona

@Hona Hona commented Nov 16, 2026

Copy link
Copy Markdown
Member

Growth stacks stepped only in whole 1/240 s substeps and carried the rest of the frame's time to the next frame. At 144 and 165 Hz a frame is 1.73 and 1.45 substeps, so frames alternated one substep and two. Every expand, collapse, growing reply and the rows riding them advanced unevenly (judder), while 60, 120 and 240 Hz, which are whole substeps, were fine.

Each frame now takes its whole substeps and then the time left:

// growth.rs
pub(crate) fn substeps(dt: f32) -> Substeps // SUBSTEP × ⌊dt / SUBSTEP⌋, then the remainder
// GrowTrack::step_by(dt, …), with GrowTrack::step = step_by(SUBSTEP, …)
flowchart LR
  F["frame dt = 6.06 ms (165 Hz)"] --> B["before: floor(acc / 4.17 ms) steps<br/>1, 2, 1, 1, 2 … rest carried"]
  F --> A["after: 1 step of 4.17 ms + 1.89 ms<br/>every frame at its own time"]
Loading
  • What it covers: row growth (runtime/motion/tracks.rs), blocks of fold rows (growth_runs.rs), content slides (content_slide.rs), and a pinned list's closing slack (scroll/bottom.rs, whose SlackPhase::Closing no longer carries an accumulator).
  • What stays the same: at 60, 120 and 240 Hz a frame is a whole number of substeps, so every step is what it was.
  • Runtime::grow_acc: removed.

The fold, per frame, before and after

Height change per frame of the growing rows in examples/keep_stuck and examples/growth_reorder steer (their motion-audit scripts), on the virtual clock:

keep_stuck (a fold from a stuck header) growth_reorder gap

Median ratio between consecutive frames' height change while moving (1.0 = even):

Scene 60 Hz 120 Hz 144 Hz 165 Hz 240 Hz
keep-stuck, before → after 1.000 → 1.000 1.000 → 1.000 2.000 → 1.002 2.000 → 1.002 1.000 → 1.000
grow, before → after 1.267 → 1.267 1.121 → 1.121 1.817 → 1.103 1.920 → 1.083 1.057 → 1.057
gap, before → after 1.268 → 1.268 1.121 → 1.121 1.809 → 1.103 1.920 → 1.083 1.059 → 1.059

Unchanged elsewhere

  • Motion audit: every scripts/motion-audit scenario on dev and on this branch, traced at 60, 120 and 240 Hz (37–38 scenarios each). Per-frame element state (e, sc, and g and m compared as sets) and the end trees are byte-identical. analyze.py findings are identical.
  • Tests, macOS: 3,079 passed, 0 failed (clipboard::macos skipped).
  • Tests, Windows: not run yet; pending a farm job.
  • content_slide_tests.rs, one line: it imports SUBSTEP from crate::growth. It used to reach SUBSTEP through runtime.rs's import, which this change no longer needs. No expectation changed: a_slide_shrinks_with_the_growth_left_to_open and a_growth_that_stops_opening_toward_it_hands_its_speed_to_a_spring still compare against SUBSTEP and GROWTH.sample(…, SUBSTEP) as before.

Hona added 2 commits November 16, 2026 18:44
Growth tracks, content slides and closing slack stepped in whole 1/240 s substeps and carried the remainder, so at 144 or 165 Hz frames advanced one substep or two and folds juddered. Each frame now takes its whole substeps and then the time left. Adds a 165 Hz growth-reorder scenario to scripts/motion-audit.
The 165 Hz run is a workspace proof, not a new check in the repository.
Copilot AI balanced review requested due to automatic review settings November 16, 2026 09:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@Hona

Hona commented Nov 17, 2026

Copy link
Copy Markdown
Member Author

Windows whole suite (-p rune -p rune-kit) on adais, judged against dev's own failures at 32eb7811 (this lane, whole suite) and eb5ae6c9 (FUNCTION's run, rune only): #1067 f0a1980f (17 Nov 19:14): 2836 passed, 17 failed in 170 binaries; also on dev: alloc::disabled_trace_hooks_neither_format_nor_allocate, canvas_input::the_middle_button_drags_only_elements_that_take_it, rune::edit::tests::hidden_multiline_pristine_replace_and_delete, rune::edit::tests::pill_edge_cases_words_lines_bidi_and_direct_text_mutation, rune::edit::tests::the_caret_steps_over_a_pill_in_one_move, rune::input::keycaps::tests::repeated_chords_count_and_named_keys_use_glyphs, rune::native_surface::gpu_tests::mirrored_video_is_exact_cropped_centred_and_toggles_without_a_new_frame, rune::native_surface::gpu_tests::video_gpu_colour_sharpness_geometry_and_lifetime, rune::render::breaker::tests::a_refused_blur_pipeline_draws_unblurred, rune::render::layers::cache_tests::live_scale_zoom_sweep_buckets_during_motion_and_settles_crisp, rune::render::layers::rebind_tests::a_texture_switch_binds_no_parked_target_until_one_returns, rune::render::layers::tests::clipped_single_draw_fades_do_not_allocate_targets, rune::runtime::tests::layout_rows::send_flight_follows_the_measured_bubble_while_earlier_rows_land, rune::runtime::tests::picture_scale::a_changing_static_scale_keeps_the_glyph_atlas_bounded, rune::runtime::tests::picture_scale::text_inside_a_scale_draws_at_that_size, rune::text::macos::smoothing::tests::pipelines_never_share_masks, selectable_text::copy_select_all_and_the_context_menu; none new. Proof 467ae738.

@Hona

Hona commented Nov 17, 2026

Copy link
Copy Markdown
Member Author

New head 703f5524: dev at 47195cfa merged in. It's a merge, not a rebase, so there's no force-push. The tree is the PR's two commits on top of dev. Nothing in Kit's #1085, #1098 or #1100 steps growth by the old accumulator or by fixed substeps. His live rows grow on the same GrowTracks this change steps by each frame's time, and his delivery handoff (virtual/handoff.rs) reads the arriving row's progress after that step. So his code needed no change.

Per frame, dev against this head (virtual clock, air)

Median ratio between consecutive frames' change while moving (1.0 = even). Kit's motions come from his own live_tail_tests.rs view and poll: Delivery is a live row growing from 48 to 64 pt while it trades places with "Working". Room is a delivered row taking space from the panel below it.

Scene 60 Hz 120 Hz 144 Hz 165 Hz 240 Hz
keep-stuck fold 1.0 → 1.0 1.0 → 1.0 2.0 → 1.002 2.0 → 1.002 1.0 → 1.0
growing reply (grow) 1.268 → 1.268 1.122 → 1.122 1.833 → 1.103 1.964 → 1.083 1.054 → 1.054
growing reply (gap) 1.269 → 1.269 1.121 → 1.121 1.833 → 1.103 1.95 → 1.083 1.057 → 1.057
Delivery: row height 1.284 → 1.284 1.131 → 1.131 1.826 → 1.107 1.917 → 1.091 1.061 → 1.061
Delivery: Working's place 1.291 → 1.291 1.122 → 1.122 1.088 → 1.088 1.083 → 1.083 1.044 → 1.044
Room: row height 1.3 → 1.3 1.136 → 1.136 1.815 → 1.112 1.882 → 1.097 1.065 → 1.065
Room: panel height 1.259 → 1.259 1.101 → 1.101 1.8 → 1.083 2.0 → 1.074 1.043 → 1.043

At 60, 120 and 240 Hz, every frame's state is identical at both commits in all seven rows.

Tests

  • macOS, whole suite at 703f5524: 3,088 passed, 1 failed. The failure is the known order-dependent runtime::tests::scroll_children::scroll_xy_with_direct_children_scrolls_both_axes_and_warns_on_trailing_growth_sibling, which also fails on dev. clipboard::macos is included. The general pasteboard's change count was the same before and after (18 → 18).
    • An earlier run aborted the lib test binary with a foreign exception. It hasn't come back. At both 47195cfa and 703f5524, images_and_files_are_written_for_other_apps passed alone, and the whole lib binary ran to its end: 2,180 passed, 1 failed (the same known test). The count didn't move.
    • One earlier whole-suite run moved the count from 17 to 18. No test reproduces that: every binary that touches a clipboard or a pasteboard ran alone twice with the count unchanged, and the run above didn't move it.
  • Windows, first pass (the lib binary) at 703f5524: 1,966 passed, 15 failed, all 15 also failing on dev, none new. The whole suite follows.

@Hona

Hona commented Nov 17, 2026

Copy link
Copy Markdown
Member Author
  • Pasteboard: no Rune test moves the general pasteboard's change count on its own. Every test binary that touches a clipboard or pasteboard ran alone, twice, at 703f5524: rune --lib clipboard:: (68 tests), macos_drag_out, macos_overlay_drag_out, selectable_text, selectable_text_edges, selection_api, selection_copy_breaks, and rune-kit's markdown_copy_source, markdown_select, markdown_table_card and diff. The count held at 18 ΓåÆ 18 across all 22 runs. The whole lib binary also held it, at both 47195cfa and 703f5524. The Mac lock keeps no log, only its current holder. The holders I saw around the 17 ΓåÆ 18 run were another package's mac-tests before it and STORAGE-4's signoff after it. The Mac was in use outside the lock during that run.
  • Mac whole suite, final line at 703f5524 (the rerun after freeing space on air): 3,088 passed, 1 failed (the known order-dependent runtime::tests::scroll_children::scroll_xy_with_direct_children_scrolls_both_axes_and_warns_on_trailing_growth_sibling, which also fails on dev). clipboard::macos included. General pasteboard change count 18 before, 18 after.

@Hona

Hona commented Nov 17, 2026 •

Copy link
Copy Markdown
Member Author

Windows whole suite (-p rune -p rune-kit) on adais, judged against dev's own failures at 32eb7811 (this lane, whole suite) and eb5ae6c9 (FUNCTION's run, rune only) and 3468f3a3 and cca5df6f: #1067 703f552 703f5524 (18 Nov 00:18): 2840 passed, 19 failed in 170 binaries; also on dev: alloc::disabled_trace_hooks_neither_format_nor_allocate, canvas_input::the_middle_button_drags_only_elements_that_take_it, rune::edit::tests::hidden_multiline_pristine_replace_and_delete, rune::edit::tests::pill_edge_cases_words_lines_bidi_and_direct_text_mutation, rune::edit::tests::the_caret_steps_over_a_pill_in_one_move, rune::input::keycaps::tests::repeated_chords_count_and_named_keys_use_glyphs, rune::native_surface::gpu_tests::mirrored_video_is_exact_cropped_centred_and_toggles_without_a_new_frame, rune::render::breaker::tests::a_refused_blur_pipeline_draws_unblurred, rune::render::layers::cache_tests::cache_matches_uncached_at_rest_and_skips_rerasterize_on_ancestor_live_offset, rune::render::layers::cache_tests::live_scale_zoom_sweep_buckets_during_motion_and_settles_crisp, rune::render::layers::filter_tests::filtered_video_and_image_page_match_primitive_source, rune::render::layers::rebind_tests::a_texture_switch_binds_no_parked_target_until_one_returns, rune::render::layers::tests::clipped_single_draw_fades_do_not_allocate_targets, rune::runtime::tests::layout_rows::send_flight_follows_the_measured_bubble_while_earlier_rows_land, rune::runtime::tests::picture_scale::a_changing_static_scale_keeps_the_glyph_atlas_bounded, rune::runtime::tests::picture_scale::text_inside_a_scale_draws_at_that_size, rune::runtime::tests::scroll_children::scroll_xy_with_direct_children_scrolls_both_axes_and_warns_on_trailing_growth_sibling, rune::text::macos::smoothing::tests::pipelines_never_share_masks, selectable_text::copy_select_all_and_the_context_menu; none new. Base 47195cfa. Proof 2941f7a9.

@Hona
Hona merged commit 18caec7 into dev Nov 17, 2026
1 check 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.

2 participants