Skip inactive animation key encoding#182
Conversation
Greptile SummaryThis PR skips animation-key encoding when keyed updates cannot run. The main changes are:
Confidence Score: 5/5This looks safe to merge. No blocking issues were found in the changed code. The policy gate matches the documented effective-animation rules, and fallback-only state reaches direct and aggregate payload paths without adding identity columns. None.
What T-Rex did
Important Files Changed
Reviews (1): Last reviewed commit: "Skip inactive animation key encoding" | Re-trigger Greptile |
Merging this PR will not alter performance
Performance Changes
Comparing Footnotes
|
Root cause
Declarative
key=values were always resolved, validated, canonicalized, hashed, retained, and serialized, even when no effective animation policy could perform keyed updates. A normal 100k scatter withanimation=Falsetherefore spent O(N) Python-object work building two identity columns and shipped an extra 8 bytes per row that the browser never consumed. Keys above the browser's 200k matching bound also paid the full digest cost before the payload layer discarded them.Changes
match="key"update != "none"enabled="auto"as an effective policy because reduced-motion preference is browser-resolvedMAX_ANIMATION_MATCH_ROWSand carry an internal explicit fallback to the payloadsnap:key-limitfor direct traces andsnap:aggregatefor aggregate tiersNo JavaScript or wire-protocol shape changes are required.
Measured impact
100k-row scatter with string keys and animation explicitly disabled; 9 warmed construction repetitions and 15 payload repetitions:
A real 200,001-row direct chart additionally produced
snap:key-limit, zero u32 identity columns, and no key digest.Active keyed scatter, stable-sorted line, and role-expanded errorbar specs/blobs were SHA-256 byte-identical to current main.
Verification
pytest -q tests/test_animation.py benchmarks/test_codspeed_animation.py: 71 passedupdate="none"typassedgit diff --check: passedThe one deselection is the known current-main minified-bundle marker mismatch in
tests/reflex_adapter/test_assets.py; it reproduces unchanged atb0f8780and is already fixed by #177.Closes #172