Repository navigation
perf(umbrielfx): unified transient scratch pool, cache eviction, fused blur, and bounded captures - #965
perf(umbrielfx): unified transient scratch pool, cache eviction, fused blur, and bounded captures#965ZhangDM-520 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Talia preliminary review
| Check | Result |
|---|---|
| Merge score | 🟡 3/5 — Minor changes needed before merging |
| Findings | 🟡 2 medium |
| Review depth | 2/5 — how thoroughly the changed code could be checked by reading it |
| Coverage | 25 of 25 changed files reviewed |
What Talia checked: Read the full wlr_scene.c, fx_pass.c, fx_offscreen_buffers.[ch], effect and src diffs; confirmed the always-zero skipped-depth tracking is dead, but could not fully validate blur half-res src/dst scaling or scratch-buffer aging within budget.
Findings
| # | Severity | Finding | Location |
|---|---|---|---|
| 1 | 🟡 P2 | Dead skipped_persistent_depth render state added by the animation-capture rewrite | umbrielfx/types/scene/wlr_scene.c:1012 |
| 2 | 🟡 P2 | Dead skipped_persistent_depth/skipped_depth tracking in render path | umbrielfx/types/scene/wlr_scene.c:4862 |
Each finding is explained in a review comment on its line.
Run details
- Commit reviewed: bd6889d
- Source lookups: 114 file reads, 92 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.
bd6889d to
68aef31
Compare
|
Hey, thanks for the PR Zhang! I've been running it on my ThinkPad and VRAM dropped by about 35%, nice work! A few things before merging: Needs a fix
Question
Smaller things
Split Please move the parts that don't use the pool into a separate PR: Also, please close #837, #840 and #844; they stay available for reference once closed and this helps unclutter the queue. I'll keep running it for a bit on the lappy, to ensure I don't discover any other regression. |
|
I have reproduced it, my live test missed this case, thanks for pointing it out! greatly grateful for correction. I will look further per your findings and split the PR into refactor part (pool) and behaviour fixes (bounded animation, quantization and etc) I will update when it's ready. i mistakenly force-pushed the PR split with review fixes, making the history obscure... my bad. I am summarizing the changes. i have split the PR (both are independent) and addressed the findings you flagged out, also some more problem found.
marking it ready. |
68aef31 to
1b068e3
Compare
327be23 to
898fd93
Compare
Split out from noctalia-dev#965 as requested in review: - Add AnimatedValue::finishQuantizedSpringTail(255.0) to stop 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>
…d blur, and bounded captures Replace per-feature output-sized offscreen buffers with a per-output transient fx_scratch_pool keyed by (width, height, drm_format) with 2-idle-frame eviction, and unify the umbrielfx bandwidth/memory improvements: - Transient scratch pool (fx_scratch_pool) replacing struct fx_target_buffers and per-slot scratch fields, eliminating FBO allocation thrash on drag/deform/shadow frames. - Persistent optimized blur cache aging/eviction (2 idle frames) with consumer-gated dirty uncull and on-demand rebuild, plus dropping stale optimized_no_blur_buffer when skipped. - Half/quarter-resolution fused blur and half-resolution optimized_blur_buffer, with capture-box offset sampling so bounded/offset captures (drag, deform, window move, open/close) sample the optimized blur cache directly. - Bounded drag deformation, depth-1 zero-copy backdrop, 128 px quantized capture boxes, and shadow caster reuse. - Regression tests (perf-budget-scratch-pool-eviction, perf-budget-persistent-cache-eviction) and updated color/effects tests. Assisted-by: LLM (human-reviewed) Signed-off-by: ZhangDM-520 <jixianqiang1540@gmail.com>
898fd93 to
ff54666
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>
Summary
Unifies the
umbrielfxoffscreen buffer pool, persistent blur cache eviction, half/quarter-res fused blur, and bounded capture optimizations into a single coherent rework:fx_scratch_pool): Replacesstruct fx_target_buffers(output/group) and per-slot scratch fields with a per-output transient FBO pool keyed by(width, height, drm_format)with 2-idle-frame eviction (fx_scratch_acquire,fx_scratch_release,fx_scratch_end_frame).optimized_blur_buffer/optimized_no_blur_bufferafter 2 idle frames viafx_offscreen_buffers_age_optimized_blur, wired to consumer-gated dirty uncull and on-demand rebuild. Dropsoptimized_no_blur_bufferwhenskip_optimized_no_bluris set so partial-strength blur never re-blurs a stale wallpaper.optimized_blur_bufferat half resolution and fuses the final upsample. Samplesoptimized_blur_bufferat the accumulatedpass->animation_boxesoffset so bounded/offset captures (drag, physics deform, window move, open/close) use the wallpaper-only optimized cache instead of falling back to live blur. Usesoptimized_blur_target_aligned(pass)infx_render_pass_add_optimized_blurso output-sized depth-1 workspace captures can still rebuild the cache.perf-budget-scratch-pool-evictionandperf-budget-persistent-cache-eviction(umbrielfx/tests/perf_budget.c), and updatedcolor.c/effects.cassertions.Motivation
Previously,
fx_offscreen_buffersowned a fixed set of output-sized offscreen buffers per feature with separate lifetimes, holding tens of megabytes of idle VRAM and causing FBO allocation thrash when bounded captures, blur, and deformation interacted. Replacing them with a single transient scratch pool and unified cache eviction cuts idle VRAM and offscreen fill-rate without per-feature buffer proliferation.Type of Change
Testing
clang-format --dry-run -Werroron all modified C/C++ files: PASSninja -C build-debug umbriel umbrielfx/umbrielfx-perf-budget-test: PASS (0 warnings)UMBRIELFX_TEST_DRM_DEVICE=/dev/dri/renderD128 meson test -C build-debug --suite umbrielfx: 81/82 PASS (only pre-existing hostumbrielfx-egl-abifails)just check output/direct_scanout_state layout/struts: PASSChecklist
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
finishQuantizedSpringTail, vblank-seeded focus dim, 8-bit setter guards) were split into perf(animation): cut 8-bit spring tails and seed focus dim from vblank #971 per review feedback.