Repository navigation
perf(animation): cut 8-bit spring tails and seed focus dim from vblank - #971
Open
ZhangDM-520 wants to merge 1 commit into
Open
ZhangDM-520 wants to merge 1 commit into
ZhangDM-520 wants to merge 1 commit into
Conversation
Contributor
|
The description now contains the required template structure. |
ZhangDM-520
marked this pull request as ready for review
December 2, 2026 05:37
11 tasks done
ZhangDM-520
marked this pull request as draft
December 2, 2026 05:47
ZhangDM-520
force-pushed
the
perf/alpha-spring-and-setter-guards
branch
from
December 2, 2026 06:07
c06b627 to
eff98b1
Compare
Split out from noctalia-dev#965 as requested in review: - Add AnimatedValue::finishQuantizedSpringTail(255.0) to stop springs (e.g. overdamped alpha springs) once remaining displacement stays strictly within the target's 8-bit rounding cell, skipping the cut when an animation effect preset is bound (Layers / DimUnfocused). - Add Output::latestVblankMsec() (reused by Output::handleFrame()) and AnimatedValue::seedStartMsec() to seed focus-dim transitions from the latest vblank so the first tick advances immediately. Assisted-by: LLM (human-reviewed) Signed-off-by: ZhangDM-520 <jixianqiang1540@gmail.com>
ZhangDM-520
force-pushed
the
perf/alpha-spring-and-setter-guards
branch
from
December 2, 2026 06:22
eff98b1 to
a877d43
Compare
ZhangDM-520
marked this pull request as ready for review
December 2, 2026 07:20
There was a problem hiding this comment.
Talia preliminary review
| Check | Result |
|---|---|
| Merge score | 🟢 4/5 — No issues found; likely ready after CI and human review |
| Findings | None found |
| Review depth | 3/5 — how thoroughly the changed code could be checked by reading it |
| Coverage | 8 of 8 changed files reviewed |
What Talia checked: Inspected all eight changed hunks plus AnimatedValue tick/retarget/snap and spring-bound helpers, effect preset binding/gating, Output vblank sampling and View/Output consumers. No concrete introduced bug is supported; remaining uncertainty is runtime vblank-seeded first-frame timing and the 8-bit precision assumption, neither of which was executed.
Run details
- Commit reviewed: a877d43
- Source lookups: 36 file reads, 31 searches
- Prompt version: 859b7490ca3d
Preliminary automated review: Talia read the changed code and related source; nothing was built, run or tested, and AI can make mistakes. It is not a scope acceptance or a promise to merge; a human reviewer makes the final call. See our ethos.
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.
Summary
Split out from #965 per review feedback so the non-pool animation optimizations can be reviewed independently:
AnimatedValue::finishQuantizedSpringTail(255.0)to stop overdamped alpha springs (m_focusDim,m_ruleOpacity,m_modalShadeAlpha,LayerSurface::m_fade) once remaining displacement stays strictly within the target's 8-bit rounding cell (roundingMargin = 0.5 - |targetSteps - round(targetSteps)|, matchingfinishSpringTail). Skips the cut when an animation effect preset is bound (AnimationEvent::Layers/AnimationEvent::DimUnfocused) soumbriel_progressis unaffected.Output::latestVblankMsec()(reused byOutput::handleFrame()to avoid duplicating time sampling) andAnimatedValue::seedStartMsec()som_focusDimadvances on the first frame instead of stalling atelapsed = 0.Motivation
Overdamped alpha springs (such as
dim_unfocused) currently keep ticking and damaging the output for dozens of frames after the 8-bit quantized alpha has already converged within the target's rounding cell, triggering unnecessary compositing and blur passes. Seeding focus-dim from the latest vblank also eliminates the 1-frame initial stall.Type of Change
Testing
clang-format --dry-run -Werroron all 8 modified files: PASSninja -C build-debug umbriel tests/animation-test: PASS (0 warnings)meson test -C build-debug animation: PASS (1/1)just check animation/focus_rules: PASS (3.41s)Checklist
SCOPE.md, or its scope was agreed in an issue or on Discord first.CONTRIBUTING.md.just format, or this PR has no C++, shader, or Markdown changes.docs/andexamples/config.toml, or this PR does not change user-facing configuration or behavior.Additional Notes
latestVblankMsec()inOutput::handleFrame()).