Repository navigation
Feat: Add Spring timing and 3D matrix animation (CR-8a, FR-41.2, FR-41.2.1) - #966
Merged
Merged
Conversation
Adds TimingKind::Spring = 4 and Timing::Spring { stiffness, damping_ratio }.
The keyframe keeps its 24 byte head: p1 is the stiffness, p2 the damping
ratio, p3, p4 and the step position are zero. Both decoders refuse a
stiffness or damping ratio that is not finite and positive, and anything in
the unused fields.
The Renderer eases a spring segment as Compose's SpringSimulation from 0 to 1
at t = u * T, where T is Compose's estimateAnimationDurationMillis with a
visibility threshold of 0.001, ported step for step. T is worked out once per
keyframe when the animation arrives, so a frame allocates nothing, and the
curve is exactly 1 at u = 1. An overshooting alpha and colour are clamped by
the paths that already clamp an overshooting cubic-bezier.
AnimationSpec::spring fills duration_ms with the same settle time
(spring_settle_ms), so the default length moves at Compose's speed.
The mutation vector gains one spring record after every existing record.
Generated files (Protocol.gen.kt, vectors, schema hash) are left for the
codegen run.
Tests: fr41_spring_timing_round_trips, fr41_spring_with_invalid_parameters_
is_a_protocol_error (Rust and Kotlin), fr41_spring_spec_duration_is_the_
settle_time and fr41_spring_settle_time_matches_the_host_table (S3, same
table), fr41_spring_easing_matches_compose_spring (S2),
fr41_spring_alpha_is_clamped_while_it_overshoots (S4).
…#46) Adds AnimatedProperty::Transform3D = 6 and KeyframeValue::Matrix3D([f32; 16]), column-major like the Transform3D modifier: a 64 byte value, an 88 byte keyframe. Both decoders refuse a value that is not finite and a record with an origin of its own, because the origin and backface-visibility are the base modifier's. The Renderer refuses, once the batch is in, a Transform3D animation on a node without a Transform3D modifier, and a Transform animation on a node that has only one. The Renderer interpolates as CSS Transforms Level 2 does: both ends are taken apart into translation, scale, skew, perspective and a quaternion, the parts are interpolated (the quaternion by slerp) and put back together; a singular end switches at progress 0.5. The decomposition works in scratch made once, and Transform3DPlan.solve no longer allocates, so a frame allocates nothing. A node whose Transform3D is animated draws through one fixed layer shape (affine layers outside, a perspective layer inside) whose blocks read the animated matrix and solve the plan again in the layer phase, so playing it neither recomposes nor remeasures the node and hit testing follows the shape. from_presented starts from the matrix shown. The Rust authoring API takes a Matrix3D keyframe through transition(). The mutation vector gains one Transform3D record after every existing record. Generated files are left for the codegen run; android-kotlin is re-staged. Tests: fr41_2_1_transform3d_animation_round_trips (Rust and Kotlin), fr41_2_1_transform3d_animation_needs_its_base_modifier (Rust decoder and Kotlin table), fr41_2_1_a_transform3d_record_that_cannot_be_played_is_a_ protocol_error, fr41_2_1_matrix_interpolation_follows_css_transforms_2, fr41_2_1_transform3d_animation_writes_the_interpolated_matrix, fr41_2_1_transform3d_animation_draws_without_recomposition, fr41_compose_api_animates_a_3d_matrix.
…(FR-21.2.4) An absent Count was written as a clear on a freshly created node, and a count of 0 is a count, so Count gets its own tracking bit: only None is neutral.
….2.4) The fixture replied to every event, including the reports the Renderer sends at start, so the count had already changed before the test took its baseline.
…OutlineVariant (FR-22.2) OutlineVariant equals SurfaceVariant in Material's dark scheme, so it cannot separate the two tiers.
…600) OutlineVariant equals SurfaceVariant in Material's dark scheme, so the two tiers came out the same grey and fr22_2_neutral_button_tiers_carry_no_accent failed.
Conflicts only in generated files (Protocol.gen.kt twice, schema-hash.txt, vectors.json); this side is kept here and the next commit regenerates them.
…I half) Makes feat/cr8a-neutral-buttons-counts an ancestor, so this branch's diff against it is the animation half. The tree does not change: every commit on that branch is already here.
b-re-w
changed the base branch from
develop
to
feat/cr8a-neutral-buttons-counts
November 22, 2026 05:10
…-vocabulary # Conflicts: # compose-rust/android-kotlin/shared/Protocol.gen.kt # compose-rust/schema-hash.txt # compose-rust/tests/vectors/vectors.json # renderer/desktop/src/protocol/Protocol.gen.kt
…-vocabulary # Conflicts: # compose-rust/src/codegen.rs # compose-rust/tests/vectors/mutations.bin
b-re-w
added a commit
that referenced
this pull request
Nov 25, 2026
b-re-w
changed the base branch from
feat/cr8a-neutral-buttons-counts
to
develop
November 26, 2026 18:53
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.
Second of two stacked pull requests. Based on #972 (
feat/cr8a-neutral-buttons-counts); the diff against it is the animation half only.Timing::Spring { stiffness, damping_ratio },TimingKind4: Compose'sspring()as one timing function inside the Web Animations time model (FR-41.2 S1-S4).AnimatedProperty::Transform3D = 6withKeyframeValue::Matrix3D, 4x4 column-major keyframes, interpolated as CSS Transforms 2 does (FR-41.2.1, the compose-rust half of CSS transform, transition and animation for HTML/CSS screens (FR-34.1, FR-34.2) dioxus-compose#46).Size: about 1790 changed lines with generated files and the staged Android copies excluded (about 2420 with the copies). It is not split further because Spring and Transform3D share the timing table, the keyframe encoder and the Kotlin animator (
RendererAnimations.kt); the leader approved this.Existing tests touched:
transform_animation.rsandProtocolVectorsTest.kt: the vector's animation count goes from 10 to 12, and the border colour check reads the third record from the end, because the spring and the matrix come after it.New tests:
fr41_spring_timing_round_trips,fr41_spring_with_invalid_parameters_is_a_protocol_error,fr41_spring_spec_duration_is_the_settle_time,fr41_spring_alpha_is_clamped_while_it_overshoots,fr41_2_1_transform3d_animation_round_trips,fr41_2_1_transform3d_animation_needs_its_base_modifier,fr41_2_1_transform3d_animation_writes_the_interpolated_matrix,fr41_2_1_transform3d_animation_draws_without_recomposition,fr41_2_1_a_transform3d_record_that_cannot_be_played_is_a_protocol_error,fr41_compose_api_animates_a_3d_matrix,AnimationSpringMatrixTest.kt.Left open: dioxus-compose needs arms for
Timing::Spring,KeyframeValue::Matrix3DandAnimatedProperty::Transform3Don its pin bump (DX-2 owns the Host half of DarkPyonix/dioxus-compose#46); the rsxModifiergets notransform3dhere, by the leader's decision.The full gate runs again at this pull request's schema LOCK turn, after #972 merges and develop is merged in; the result goes here.
Closes #552
Refs DarkPyonix/dioxus-compose#46