Renderer Audit — October 16, 2026
Audit date: October 16, 2026. Baseline revision: 1f358406.
Measured CPU and GPU costs on Raspberry Pi 5, optimization controls, and implementation progress toward an 8.333 ms frame budget.
The baseline report below records the completed audit. Measurements retain their original binary provenance; the revision above identifies the checkout for this follow-up. Subsequent implementation results are recorded separately. Evidence paths refer to verification/results/performance-audit-oct16/ in the repository. See also the renderer optimization inventory.
The next work should make sparse updates cheap on the CPU and make large damaged regions cheap on the GPU. The existing flags help, but do not make these workloads sustain 120 FPS. Static scenes already bypass rendering. Small changes can still trigger whole-tree HeraKit and renderer planning, and a changing DMA-BUF inside a large rounded window remains expensive to compose despite localized damage.
The deployed all-optimizations release was measured directly at 1920×1080@60 and 3840×2160@30. Separate optimized diagnostic builds expose internal CPU/GPU boundaries. No production implementation was changed during baseline collection; subsequent source changes and measurements are recorded under Implementation Progress. The original clip bypass exists only in isolated diagnostic binaries. The full timing tables (measurements.md), source audit and proposed mechanisms (findings.md), machine-readable distributions (summary.json), and per-trial benchmark tables (timing-tables.md) accompany this report.
What the measurements establish
- HeraKit candidate construction dominates sparse client updates in larger trees. A one-leaf opacity update in 1,024 keyed cells / 2,049 retained nodes emits one 66-byte operation, but spends 9.84 ms in build/layout/reconciliation. At 4,096 cells / 8,193 nodes that becomes 42.40 ms. State mutation, wire encoding, sparse composer mutation, and composer preparation are much smaller. Adding
.memo()to every inexpensive leaf did not improve this workload. - Large changing DMA-BUF windows are GPU-bound. The production browser’s fixed 792×320 animated canvas presents about 48.7 updates/s at 1080p; maximizing the 4K canvas drops primary presentation to 2.83/s. Kernel attribution puts most active render-engine time in Hera, not WebKit. Diagnostic GPU timestamps measure about 13 ms for the fixed canvas, 64 ms for the maximized 1080p canvas, and 315 ms for the maximized 4K canvas.
- Blur cache eligibility changes the answer dramatically. A repeating retained blurred scene takes 0.916 ms GPU at 1080p / 5.349 ms at 4K. Continuous unique fractional movement gets zero filtered-cache hits and takes 9.359 / 59.164 ms. Reporting only the repeating case would hide the important bottleneck.
- Small raster damage does not imply small CPU planning. A hardware cursor moving over unchanged wallpaper still drives ~56.3 primary flips/s and ~10.3% of one CPU core in the production daemon at 1080p. The diagnostic trace has zero repaint pixels but ~1.49 ms of CPU scene work per attempt. Four-window and 12-window synthetic results also expose substantial whole-scene planning and cache-comparison costs.
- Idle suppression works. Settled Notes and static DMA-BUF browser scenes produce zero primary flips and zero V3D render jobs during their 12-second production captures. Preserve this behavior.
Presentation-count correction
The October 16 implementation follow-up identified that drm_vblank_event_delivered also reports internal cursor-only KMS completions (file=(nil)). Primary presentation rates now count only non-null file events. This materially corrects the four-window live results (59.1 → 21.1/s at 1080p; 29.8 → 24.7/s at 4K), while the DMA-BUF rates, GPU timestamps, and CPU measurements are unchanged. Raw recordings are retained; summarize.py and the tables use the corrected classification.
Selected timing tables
Milliseconds are mean of two trial medians / worse trial p95 for isolated benchmarks. Live captures are single 12-second observations. The detailed tables distinguish those populations.
HeraKit → wire codec → composer: one changed leaf
| Cells / nodes | Kit build/layout/diff | Encode + decode¹ | Composer commit | Composer prepare | Serial harness total | |---|---:|---:|---:|---:|---:| | 128 / 257 | 0.751 / 0.793 | ~0.003 | 0.005 / 0.006 | 0.005 / 0.006 | 0.803 / 0.847 | | 1,024 / 2,049 | 9.839 / 10.135 | ~0.009 | 0.014 / 0.015 | 0.071 / 0.072 | 10.658 / 10.943 | | 4,096 / 8,193 | 42.399 / 44.175 | ~0.009 | 0.016 / 0.018 | 0.279 / 0.294 | 45.774 / 47.776 |
¹ Approximate sum of independently reported stage medians, for scale only. Total is measured directly. The harness includes transactional acceptance, but excludes sockets, input handlers, fonts/text, scheduling, rendering, and display. It forces candidate preparation; an unchanged result is not a claim that a normal idle app rebuilds continuously.
At 1,024 cells, the median Kit stages are view build 5.382, layout preparation 0.480, layout synchronization 1.260, propagation <0.001, layout application 1.392, and reconciliation 1.312 ms. A sparse reactive mutation is cheap; discovering, rebuilding, and comparing the resulting candidate is not. Bulk changes additionally expose composer mutation cost: updating all 4,096 leaves takes 28.09 ms in composer commit and 84.42 ms serial total.
Isolated GPU rendering, excluding readback
| Workload, all reviewed flags enabled unless stated | 1080p | 4K | |---|---:|---:| | Full repaint, 256 solid cells | 2.973 / 2.983 | 13.810 / 16.466 | | Full repaint, 16 blur groups, warm reusable filtered images | 4.304 / 4.375 | 18.271 / 20.999 | | Same blur groups, filtered cache disabled | 58.787 / 59.032 | 384.399 / 386.619 | | Retained blurred interface, repeating positions | 0.916 / 0.927 | 5.349 / 7.097 | | Continuously moving filtered group, cache enabled but zero hits | 9.359 / 9.383 | 59.164 / 59.644 | | Clipped blurred interface, bounded writes enabled | 17.337 / 17.583 | 82.228 / 84.917 |
The blur-group fixture scales sigma with output resolution, so its 4K increase is not solely a pixel-count effect. The split probe waits between render and readback phases; it establishes stage costs, not asynchronous display throughput. Ordinary readback benchmarks include another ~3 ms at 1080p / ~12 ms at 4K. Those costs were not subtracted from unrelated measurements.
Multi-window scaling
The production release presents a dragged Notes window at 58.3/s and Notes plus three Render Studio windows at 21.1/s at 1080p60. At 4K30, the corresponding rates are 29.8/s and 24.7/s. These are observed primary presentation rates during the captures, not evidence of 120 FPS headroom. The initial report counted internal KMS completions as primary flips; the corrected rates exclude events with a null file pointer.
The separate 1080p synthetic window fixture rotates three retained targets and moves the top window:
| Windows | Run cache | CPU planning + recording | GPU including readback | Attempt wall time | |---:|---|---:|---:|---:| | 1 | on | 1.117 / 1.377 | 10.123 / 10.204 | 11.485 / 11.833 | | 4 | on | 4.157 / 5.799 | 20.936 / 21.973 | 25.804 / 28.575 | | 12 | on | 13.922 / 16.041 | 43.542 / 45.234 | 59.818 / 63.727 | | 12 | off | 11.861 / 13.902 | 47.248 / 49.099 | 61.104 / 66.556 |
The cache saves GPU work, but maintenance is not free. The 12-window CPU stage alone exceeds an 8.33 ms frame interval. Two trials do not establish a universal CPU regression from the cache; they establish that retaining pixels has not eliminated expensive planning. This fixture internally forces several visibility/effect flags, documented in the detailed tables.
A separate single-node dense-grid update repaints only 1,363 pixels at 1080p / 4,968 at 4K, but CPU scene work remains 1.376 / 1.391 ms. Both resolutions pass a byte-exact full-repaint oracle. The readback-inclusive GPU totals are not useful estimates of presentation cost for these tiny updates. This directly supports making planning incremental alongside raster damage.
DMA-BUF: producer, server and GPU
The browser uses the actual WPE DMA-BUF path (modifier 0x700000000000006), not a CPU-upload substitute. Static/small/full tests use the same 840×460 browser backing buffer. Small animates a 320×180 canvas; full animates a 792×320 canvas. Maximized tests resize both the buffer and canvas; the 1080p canvas is 1,848×700 and the 4K canvas is 3,768×1,780. Every animation tick changes the whole canvas. No video decoding or network content is involved.
| Production workload | 1080p primary flips/s | 4K primary flips/s | Hera / WebKit active RCL ms per second, 4K | |---|---:|---:|---:| | Static browser | 0 | 0 | 0 / 0 | | Small animated canvas | 60.0 | 30.0 | 92 / 14 | | Full canvas in default window | 48.7 | 29.9 | 369 / 28 | | Maximized animated canvas | 12.0 | 2.83 | 863 / 68 |
RCL intervals measure active V3D render jobs; they are not whole-frame latency or interchangeable with Vulkan timestamps.
Diagnostic 1080p small/full canvases retain ~61k/~257k repaint pixels and need 0.79 ms CPU scene work in either case, but 3.46/12.94 ms GPU. Composer preparation plus queueing is ~0.06 ms. For maximized 4K, CPU scene work is ~2.23 ms while GPU is ~315 ms. A separate validation-enabled DMA-BUF lifecycle test measures ~0.103 ms import and ~0.065 ms release medians for a 1,000×666 buffer; this supports prioritizing composition ahead of import caching in this workload. The renderer response includes GPU-ready waits and must not be labelled CPU time. A fixed-size window remains roughly the same GPU cost at 1080p and 4K; maximizing its damaged area is what causes the severe slowdown.
Supplementary per-pass observations place ~85% of the 1080p maximized graph and ~88% of the 4K maximized graph in Group.SegmentTail; final Backdrop.Composite accounts for another ~12.5%/~11%. A same-binary control deliberately bypassing exact image clipping reduces GPU medians as follows:
| Canvas | Exact image clips | Diagnostic bypass | Reduction | |---|---:|---:|---:| | Fixed 1080p window | 12.93 ms | 8.38 ms | 35% | | Maximized 1080p | 63.70 ms | 40.71 ms | 36% | | Maximized 4K | 315.03 ms | 196.53 ms | 38% |
This identifies a substantial clipped-image shader cost, while leaving a large residual content/composite cost. The bypass is not a valid implementation: it removes exact clip coverage and is only a profiling control. A correct fast path must preserve clip and sampling semantics. Do not attribute all remaining time to the image draw without a finer draw-level experiment. Producer RAF callbacks also slow to ~12/s at maximized 1080p and ~2.85/s at maximized 4K, consistent with the current acknowledgment/presentation feedback loop; these are not independent WebKit throughput limits.
Flags and operational choices
All primary baselines retain the user's deployed settings. Flag tables record exact alternatives; flags were changed temporarily for measurements and restored.
| Control | Recommendation from this audit | Evidence / limitation |
|---|---|---|
| HERA_FILTER_CACHE=1 | Keep | Repeating blurred scene: 9.284 → 0.916 ms GPU at 1080p. Zero benefit with zero hits during unique fractional motion; instrument eligibility and improve it. |
| HERA_BLUR_REGIONS=1 | Keep | Clipped blur: 43.057 → 17.337 ms GPU. Important reduction, still above 120 FPS budget. |
| HERA_MERGE_COLOR_PASSES=1 | Keep | Eligible retained case: 1.096 → 0.916 ms GPU. |
| HERA_RUN_CACHE=1 | Keep, reduce CPU validation overhead | Four-/12-window GPU reduction; overall wall improvement is smaller than GPU improvement. |
| HERA_BACKDROP_DOWNSAMPLE=4 | Preserve deployed quality choice | Live Notes GPU medians: native 7.100 ms, 2× 4.567 ms, 4× 4.101 ms. Content-blur fixtures do not test this flag. Native/2×/4× are quality choices, not interchangeable pixel-identical implementations. |
| HERA_PRECISE_TIMER=1 | Keep | Median / p95 wake lateness: off 1.135 / 1.613 ms; on 0.012 / 0.016 ms. This does not fix GPU fence polling. |
| HERA_RENDER_AHEAD=1 | Preserve pending workload-specific evidence | The one-window 60 Hz trace shows no meaningful gain: renderer response on 7.780 ms, off 7.751 ms. Benefit depends on readiness and client pacing. More buffers do not cure an over-budget GPU stage. |
| HERA_CURSOR_PACING=1 | Preserve; separate cursor invalidation next | Pacing off still causes 46.3 primary flips/s and 9.75% daemon CPU. Hiding the cursor yields zero primary flips and ~1.05% CPU, confirming invalidation cost; hiding it is not a user-facing solution. |
| HERA_DAMAGE_REGIONS=1, HERA_PARTIAL_OCCLUSION=1, HERA_BORDER_CULL=1 | Preserve reviewed settings | Mostly unchanged retained fixtures are non-diagnostic for these flags. Small browser damage verifies locality collectively, not an isolated speedup for each switch. |
| HERA_COMPOSITE_OVERWRITE=1, HERA_MASK_COPY=1 | Keep | Notes GPU: all on 4.101 ms; overwrite off 7.950 ms; mask-copy off 5.898 ms. Benefits overlap and must not be added. |
| HERA_SHADOW_SPECIALIZE=1 | Preserve prior reviewed choice | Notes GPU off 4.157 ms versus on 4.101 ms is a small single-run difference. Neither content-blur fixture nor Notes chrome is a strong modern box-shadow stress case. This audit does not establish a broad shadow speedup. |
Do not enable profile/damage overlays during baseline measurement. HERA_AUDIT_GPU_PASSES is supplementary instrumentation that inserts pass-boundary timestamps; it is not a production optimization.
Recommended implementation order
- Separate hardware-cursor invalidation from scene invalidation. A bounded, directly evidenced way to bypass both CPU planning and empty primary submissions. Preserve software fallback, hotplug, actual hover edits, and concurrent animations. Acceptance: cursor-only motion has zero primary rendering and unchanged primary contents while hardware cursor movement remains responsive.
- Make HeraKit sparse candidates incremental. Retain unchanged subtree, layout, handler, and reconciliation state; track a dirty frontier instead of reconstructing every accepted node. Preserve candidate acceptance/rejection semantics. Acceptance: one-leaf cost scales primarily with the changed ancestry, measured at 128/1,024/4,096 cells, without changing one-op wire output or state identity. Cheap leaf memoization alone is insufficient.
- Reduce large-window composition work per damaged pixel. Per-pass data places ~85% of the large-browser graph in
Group.SegmentTail. A same-binary diagnostic image-clip bypass reduces the fixed canvas GPU time from 12.93 to 8.38 ms, establishing a substantial partial opportunity. Implement a correct clipped-texture fast path or prove scissor equivalence for eligible rectangular clips; retain the general path for other clips. Then profile the remaining content draws and final composite. Preserve unchanged offscreen content. Compare default/maximized DMA-BUF windows with identical producer content and damage. Acceptance: reduce Hera GPU timestamps and RCL time, with independent full-repaint pixel checks across rotating targets and newly exposed areas. - Retain renderer draw plans and effect products in local coordinates. Patch per-surface/subtree transforms and dirty ranges, avoid revalidating every cache key, and extend safe filter reuse to continuous movement where possible. Preserve fractional phase, source identity, effect support, masks, paint order, and rollback. Acceptance: lower CPU plan time as windows/nodes grow, and demonstrated cache hits during real movement rather than only repeated positions.
- Optimize unavoidable blur misses. Evaluate reduced-resolution content filters or a less radius-sensitive GPU algorithm. Keep quality changes explicit and compare against the current finite kernel; do not introduce GPU readback/CPU blur/upload as a default path.
- Then improve readiness and eligible server-controlled scanout. Replace the worker's 1 ms GPU-ready polling with readiness-driven wakeups if correlated timing shows benefit. Explore direct scanout/planes for genuinely eligible opaque DMA-BUF content, with server-owned plane selection, synchronization, fallback, and lifecycle. Rounded windows, overlapping UI, and backdrop readers require composition or a proven plane arrangement. A client must never own the display.
Steps 2–5 address much larger costs than sparse composer snapshot preparation. Avoid spending the next iteration shaving a few microseconds from the codec while candidate construction or GPU effects consume tens of milliseconds.
120 FPS interpretation
A 120 Hz stream has 8.333 ms per interval. CPU, producer GPU, compositor GPU, and display can overlap across buffered frames; adding unrelated medians is not a valid frame-time model. Each sustained stage must support that rate, and the end-to-end critical path must meet the chosen latency target with tail headroom. Median success is insufficient.
This display advertises 1080p60 and 4K30, with no 120 Hz mode. The audit can reject over-budget stages and estimate headroom; it cannot certify actual 120 Hz presentation. Even a full-output 4K solid-grid GPU repaint exceeds 8.33 ms on this Pi. Consistent 4K120 for complex, fully changing scenes therefore requires much less work per frame, a constrained quality/content policy, or different hardware. Retained small-damage rendering is the most promising route for ordinary UI; it does not make arbitrary full-screen effects free.
Method, provenance and limits
- Existing release daemon SHA-256:
accb21e74138669da5603dc888a0ea2e497c841dc6a5311bb3cef61de88e6344. Existing renderer-test executable:052ce2c99d263680b2835eb8a4c7b1c8dfe58c4e19f530a2e4cfac08857a2981. - The diagnostic daemon is an optimized build of the recorded working tree, with release debug tracing and CPU scope timing enabled. Its source identity is not proven equal to the deployed binary. It is used for internal attribution and within-binary flag comparisons, not as an exact release-versus-instrumentation A/B. Four-window diagnostic behavior differs materially from production; those numbers remain separate. A capture taken during diagnostic dragging also caught a wallpaper-only frame, which could be a capture/reuse race or a rendering issue; the settled four-window capture is correct. Do not use that run as proof of production visual correctness or a production regression.
- The clip-cost control is a third isolated build with a diagnostic environment switch. It deliberately bypasses exact clip coverage only for sampled image draws and permits the lightweight texture pipeline. This experiment identifies cost; it does not establish pixel equivalence or authorize dropping clips in production.
- Per-pass diagnostics are another isolated build that enables existing test query instrumentation and reads it only after slot-fence completion. Pass-boundary timestamps serialize observations and can perturb performance. Production timing and per-pass attribution remain separate.
- Isolated GPU runs stop the desktop/server and execute sequentially. Main matrix: 58 successful invocations; extra controls: 16 successful invocations, including validated DMA-BUF rendering; four successful sparse-damage controls. There are 123 byte-exact full-repaint oracle records with zero differing pixels, plus the other named test assertions. Repeated GPU cases use reversed trial/resolution order. Warmup/sample counts are in each record. Synthetic cache cases use three target histories.
- The 51 live captures (18 release, 23 detailed diagnostic, four per-pass, six clip controls) retain real shell/Notes/Render Studio/browser binaries and use 120 input events/s for drags. Kernel events and 499 Hz user-CPU samples are recorded concurrently. CPU percentages are of one core over the profiler helper lifetime (~13 seconds). GPU job ownership is joined by unique command-address ranges and sequence-number completion, with unknown/ambiguous observations retained.
- Trace distributions are restricted to recorded helper wall-time bounds where timestamps are available; they are not exactly the kernel's 12-second window. Boundary frames may have only some phases. Initial idle trace leftovers are excluded from the selected stage table; production zero-event idle results come from kernel captures.
- The local browser page reports
requestAnimationFramebatches. These are producer progress, not input-to-photon latency. Socket receive/decode/commit, producer buffer acquire/release, and client candidate events are not yet joined into one causal trace. This audit provides measured stage attribution, not a complete cross-process latency distribution. - No governor, clock, firmware, display EDID, or persistent service settings were changed. Recorded live temperatures range from 59.3–71.4°C and every throttle sample is
0x0. Frequency was not pinned, so small single-run differences should not drive flag changes. - Existing working-tree edits were preserved. Build/script validation and device tests are recorded; baseline collection did not include a new React Native integration run or production implementation changes; follow-up validation is recorded below.
Evidence and reproduction
run_matrix.py, run_extra.py, finish_controls.py, run_live.py, live_supervisor.py, run_pass_live.py, run_clip_control.py, and the isolated pipeline/ Cargo workspace contain the workload definitions. session.py saves/restores process launch arguments and settings. build_trace.sh, build_pass_trace.py, and build_clip_control.py instrument only a copied source tree inside the hermetic builder. measure.py, drag.py, input.py, web.py, and workload.html define the live captures. Device executables and original process environments remain on the Pi.
Run python3 summarize.py then python3 make_tables.py in this directory to regenerate statistics from the evidence. Nearest-rank p95/p99, sample counts, maximums, and fractions above 8.333 ms are retained in summary.json. source-manifest.json, preexisting-renderer.patch, audit-binary-manifest.json, and environment.json record provenance. The detailed report distinguishes readback-inclusive, render-only, CPU-only, kernel-job, and live-presentation boundaries throughout.
Final state and saved evidence
The original release daemon hash, 1080p60 mode, reviewed flags, Notes and Browser launch arguments were verified after the final experiment; see final-state.json (final-state.json) and restored screenshot (restored.png). The experimental bypass and diagnostic daemon are no longer active. At the end of baseline collection, audited production source hashes and tracked working-tree status were unchanged.
validation.md (validation.md) records successful checks and the diagnostic limitations. evidence.tar.gz contains 535 hash-verified evidence files, including 103 raw perf recordings (about 297 MiB compressed). Readable logs, screenshots and metadata are extracted alongside the report; raw recordings stay compressed. import_evidence.py verifies every archived hash before analysis. Matching device executables remain on the Pi; their hashes are recorded for subsequent perf symbolization. No production optimization has been deployed by this audit.
Implementation Progress
These follow-up changes are based on 1f358406 and remain working-tree changes. The baseline above preserves the original workload costs, with the explicit presentation-count correction. Follow-up evidence is under verification/results/performance-audit-oct16/improvements/.
Cursor-only frame suppression
The server now samples the latest cursor position and confirmed hardware-plane ownership before frame admission. Once the promotion frame is presented, cursor motion updates metadata without invalidating the scene. Hover/client edits and animations retain their normal scene revisions. Warming or unavailable hardware keeps software cursor rendering. A permanent cursor-plane failure clears independence, forcing the next scheduled frame even if there is no further pointer input; failed submissions retain that revision for retry.
Two 12-second captures per variant and resolution use fresh release builds, the existing reviewed flags, 120 input events/s, and reversed trial order. CPU is percent of one core over the profiler helper lifetime, not per-frame time.
| Mode | Baseline primary presentations/s | Improved primary presentations/s | Baseline daemon CPU | Improved daemon CPU | |---|---:|---:|---:|---:| | 1080p60 | 58.0–59.1 | 0 in both trials | 13.02–13.21% | 1.42–1.49% | | 4K30 | 29.7–29.9 | 0 in both trials | 6.86–7.24% | 1.04% in both trials |
This removes CPU scene work and primary submissions. Cursor-only raster work was already mostly suppressed in the baseline; this is not evidence of a comparable GPU shader speedup. Internal cursor KMS completions continue and are excluded from primary presentation counts. Each optimized capture retains one primary framebuffer, byte-identical before/after primary pixels, 32–45 distinct sampled hardware-cursor positions, and a hidden cursor after input-device removal. All four have zero V3D render submissions. Three baseline before/after captures cross a shell-clock minute update; their small clock-label changes explain the pixel differences and occasional baseline GPU jobs, so these are not perfectly isolated clock-free CPU comparisons. The large reduction in persistent scene work remains clear across both trials.
Exact clipped-texture shader
HERA_CLIPPED_TEXTURE=1 selects a smaller image/glyph shader while retaining the general shader's exact nested rectangle, rounded-rectangle, transformed, and path clip coverage. The image/glyph sampling implementation is shared with the existing texture specialization. Gradients and blur at or above 0.5 retain the general shader. Unclipped draws retain their existing path. The switch defaults off.
The new path passes 64 image pixel-oracle cases, existing glyph specialization and inherited-clip checks, all 29 pipeline-allocation failure checkpoints, and 70 retained-damage full-pixel comparisons on both software Vulkan and the Pi. Shader comparisons disable pixel caches so both sides execute their shaders. The following paired measurements use one optimized tracing-enabled binary, toggling only HERA_CLIPPED_TEXTURE, with all prior reviewed flags and 4× backdrop downsampling retained. Each condition has two 10-second captures in reversed order. GPU columns are the mean of the two medians / worse p95; primary rates show the two-trial range. GPU timestamp intervals exclude readback and include any GPU scheduling/contention during the interval.
| Canvas | Flag off: GPU median / p95 | Flag on: GPU median / p95 | Median reduction | Primary presentations/s, off → on | |---|---:|---:|---:|---| | 792×320, fixed 1080p window | 12.933 / 12.989 ms | 11.696 / 11.740 ms | 9.6% | 46.6–47.2 → 55.1–58.1 | | 1,848×700, maximized 1080p | 63.694 / 63.779 ms | 57.512 / 57.615 ms | 9.7% | 12.1–12.1 → 13.7–14.7 | | 3,768×1,780, maximized 4K | 315.526 / 322.614 ms | 283.929 / 341.462 ms | 10.0% | 2.8–2.9 → 3.0–3.0 |
Enablement recommendation: use HERA_CLIPPED_TEXTURE=1 for the tested 1080p browser workloads. Keep the default off and treat 4K enablement as experimental: both short maximized-4K runs improve the median but worsen the observed p95. There are only 32–35 GPU samples per 4K trial, so longer correlated producer/compositor traces are needed to identify the tail's cause. Do not describe this as a universal frame-time improvement. Every measured GPU median remains above 8.333 ms.
This correct implementation captures a smaller gain than the original invalid clip bypass. Exact coverage and the remaining window-composition work still need attention; the bypass's 35–38% saving was not a safe implementation result. Four-window drag checks with the new release and specialization enabled preserve scene updates at 21.2 primary presentations/s at 1080p and 24.7/s at 4K, matching the corrected baseline's scale. Both engaged screenshots show all four windows correctly. This is a regression check, not an isolated attribution of multi-window speedup.
Validation and remaining work
The rebuilt React Native mount/acknowledgment integration check passes, as do 137 composer tests, 318 non-device renderer tests, and 33 server tests with tracing enabled. The release-only server trace assertion cannot observe debug events because the production tracing ceiling is warning; it passes in the isolated tracing-enabled build. Documentation route checks and the production website build pass.
The first attempted cursor A/B reused the baseline executable because the shared Cargo target directory considered the copied sources fresh. Those captures are excluded. The rerun forced rebuilding the affected packages and verifies distinct binary hashes. An audit-helper process-exit race was also fixed; neither issue is reported as a renderer regression.
The next priorities are:
- Make HeraKit's sparse candidate preparation incremental; the unchanged 1,024-cell baseline still spends 9.84 ms rebuilding/layout/reconciling one changed leaf.
- Investigate the 4K GPU tail with longer causal traces, then reduce exact clip coverage and unchanged window-composition work. A proven constant-coverage interior or cheaper common-rectangle clip representation is a candidate; retain exact edges and unsupported-clip fallbacks.
- Retain renderer draw plans and local filter products, targeting the 12-window CPU planning cost and continuous-motion blur misses.
The cursor result removes a measured source of unnecessary work; it does not solve sparse client rebuilds or make complex 4K scenes fit 8.333 ms. A 120 Hz display is still needed to validate actual 120 FPS presentation.
Saved evidence and device state
Twenty-two corrected live captures, five Pi Vulkan fixture invocations, screenshots, producer progress, and raw perf recordings are saved in improvements/evidence.tar.gz: 178 hash-verified files, including 44 raw perf recordings. improvements/summary.json retains individual distributions and sample counts; improvements/timing-tables.md, improvements/validation.md, and improvements/source-manifest.json record the results and build boundaries. The initial identical-binary cursor captures remain on the Pi but are excluded from these results.
At the end of the initial implementation phase, the original release daemon (accb21e7…), reviewed flags, Notes/Browser launch arguments, and 1080p60 mode were restored and verified. The deployment follow-up below supersedes that device state. All corrected follow-up throttle observations are 0x0.
Release deployment and shell/planning follow-up
After the cursor and clipped-texture changes were deployed, the next iteration targeted window movement and retained CPU planning. The resulting production binaries are herad-planning-oct16 (11f44f5f…) and hera-shell-planning-oct16 (6784dda4…). These remain changes on top of 1f358406; the audit baseline has not moved.
Changes
- Window movement now updates the window root’s retained offset. Descendant layout coordinates remain local, so an ordinary move sends one property update instead of 20. The measured commit payload falls from 868 to 70 bytes. Resizing still follows normal layout; compositor-owned input transforms, rounded clips, and embedded-surface coordinates remain authoritative.
- Dock icon memos track size, surface identity, menu visibility, provider identity, and their local pressed/focused state. They no longer subscribe to the whole desktop model, which previously invalidated every icon for every window movement.
- Retained damage planning checks whether producer frame history exists before attempting its buffer-independent geometry/table comparison. Ordinary draws now undergo one comparison instead of two. DMA-BUF history traversal and conservative fallback rules are unchanged.
Shell CPU measurements
The target-native benchmark runs the actual shell view with 1, 4, or 12 windows and empty embedded surfaces. Each variant has two trials in reversed order, 20 warm-up updates and 300 measured moves per window count. Kit timings cover candidate preparation; composer timings cover applying the commit. They exclude socket delivery, input dispatch, client rendering and GPU work. Optional hera-shell/profiling enables Kit stage measurements only in the benchmark build. Production builds use the default features.
| Windows | Kit preparation before → after, median range | Composer commit before → after, median range | |---|---:|---:| | 1 | 0.139–0.139 → 0.113–0.114 ms | 0.036–0.036 → 0.004–0.004 ms | | 4 | 0.356–0.434 → 0.296–0.297 ms | 0.038–0.048 → 0.004–0.004 ms | | 12 | 1.350–1.363 → 1.225–1.226 ms | 0.064–0.065 → 0.012–0.013 ms |
The root-only intermediate run reduces commit work but leaves most view construction intact. Dock memoization accounts for the additional Kit improvement. The second four-window baseline trial is slower than the first; the table retains that variation rather than presenting a single favorable percentage. Worst observed p95 Kit preparation across the two trials falls from 0.141 to 0.117 ms (one window), 0.450 to 0.307 ms (four), and 1.388 to 1.257 ms (twelve). At twelve windows, the optimized shell still spends about 0.77 ms building its candidate and about 1.23 ms in total Kit preparation. This is separate from the earlier synthetic 1,024-cell HeraKit workload.
Retained renderer comparison
This CPU microbenchmark isolates DamageSnapshot::repaint_regions for unchanged draws. It uses two reversed-order trials, 20 warm-up batches and 200 measured batches, each averaging 20 calls. It includes no submission or GPU timing. Median ranges are below; the reduction is about 47% for this comparison stage, not for total renderer planning or total frame time.
| Fixture | Draws | Before median range | After median range | |---|---:|---:|---:| | dense_grid | 1025 | 0.197–0.201 ms | 0.105–0.106 ms | | interface_sharp | 184 | 0.037–0.038 ms | 0.020–0.020 ms | | interface_blurred | 184 | 0.037–0.037 ms | 0.020–0.020 ms |
Whole-renderer context
The existing complete-render fixture was also run at 1080p with three rotating retained targets, all reviewed flags, clipped-texture specialization, and 4× backdrop downsampling. Each condition has two reversed-order trials of 48 samples after three warm-ups. Validation is disabled only for these explicitly marked performance runs; the separate validation fixtures above remain enabled.
| Workload | CPU scene recording before → after, median range | Total including GPU wait/readback before → after, median range | |---|---:|---:| | 1,025-node grid, one leaf changing | 1.377–1.391 → 1.297–1.304 ms | 4.519–4.544 → 4.446–4.457 ms | | Moving filtered interface | 0.231–0.236 → 0.220–0.226 ms | 4.188–4.192 → 4.177–4.184 ms |
The historical scope name gpu.scene_render measures CPU scene recording, not GPU elapsed time. Draw-list construction stays approximately unchanged, as expected. All eight end-of-run retained/full repaint comparisons are byte-exact. The whole-frame improvement is modest because this change removes only redundant CPU comparison work.
Live movement results
Two reversed-order trials per variant use Notes plus three Render Studio windows on the Paths tab and 120 pointer events/s. Each capture lasts 12 seconds. Only primary KMS events count as presentations; internal cursor completions are excluded. CPU is percent of one core over the profiler helper lifetime.
| Mode / flags | Primary presentations/s, before → after | Daemon CPU, before → after | Shell CPU, before → after | |---|---:|---:|---:| | 1080p60, clipped texture 1 | 21.08–21.17 → 21.00–21.08 | 29.38–32.21% → 29.68–29.90% | 9.55–10.44% → 9.64–10.17% | | 4K30, clipped texture 0 | 24.33–24.67 → 24.25–24.25 | 33.56–36.04% → 34.49–35.47% | 9.84–10.74% → 9.95–10.93% |
All earlier reviewed flags stay enabled, including precise timing and shadow specialization, with 4× backdrop downsampling. The three new CPU changes require no flag. Clipped texture is enabled at 1080p and disabled at 4K for both variants, following the earlier tail-latency recommendation.
There is no demonstrated live throughput gain in this matrix. CPU ranges overlap, and the 4K optimized presentation rate is slightly below both baselines. The isolated savings are real, but these short live captures do not establish an overall CPU/FPS improvement. The complex four-window workload remains far from 120 FPS. All eight captures report throttled=0x0 and no unclassified KMS events.
All four before/after engaged screenshot pairs are byte-identical below the top 40-pixel clock area; the second trial at both resolutions is byte-identical across the entire framebuffer. Rounded window boundaries, titlebar blur, controls and embedded content preserve their pixels.
The new daemon (11f44f5f…) and shell (6784dda4…) are deployed and verified at 1080p60, with clipped texture enabled, all reviewed flags and 4× backdrop downsampling, and Notes/Browser restored. The evidence archive contains 92 hash-verified files, including 18 raw perf recordings; the extra unnumbered live capture is exploratory and excluded from the paired table. Raw perf data remain in planning/evidence.tar.gz.
Verification and next work
All 25 shell tests and 318 non-device renderer tests pass, including the new root-only movement and fractional embedded-input regression. The cache tests verify model replacement does not retain stale callbacks. The React Native mount/acknowledgment integration check passes with freshly built artifacts. Pi Vulkan validation passes the retained-frame full-pixel oracle, inherited-clip/input fixture, and 64 clipped-texture image cases.
These changes reduce client commit churn and redundant retained comparison work. They do not yet retain the complete evaluated draw list: traversal, text quad generation, clip-table construction, group planning and damage-history construction still run. The next larger CPU step is bounded reuse of evaluated local/subtree plans, keyed by immutable node content plus inherited transform/clip/font inputs. Its correctness gate must cover movement, fractional transforms, resizing, font/resource changes, destination-dependent blur, and rotating render targets. GPU gains require retaining or avoiding unchanged composition work in addition to these CPU reductions.
Reproduction scripts, per-sample timings, test logs, source hashes and the complete implementation patch are under verification/results/performance-audit-oct16/planning/. run.py defines the paired matrix and restores the new 1080p release session after experiments.
Retained leaf planning follow-up
The preceding shell and retained-damage changes are now committed as 842ff31b. This iteration compares one release executable with HERA_DRAW_CACHE=0 and 1; the original audit remains dated October 16 against 1f358406.
The optional cache retains evaluated draw items, style records and gradient stops for immutable, non-group leaves. A hit requires the same immutable node allocation, exact inherited transform, clip geometry, opacity, z order and output extent. Style and gradient offsets relocate into each frame’s tables. Changed or unsupported inputs follow ordinary planning. Products are admitted only after two consecutive visits with the same inputs; continuous motion retains a small observation instead of repeatedly allocating products that cannot hit. The cache charges at most 16 MiB and admits at most 4,096 entries, pruning unused entries after each frame. It charges geometry work on hits and falls back to ordinary planning at admission limits. Weak node identities prevent address reuse without keeping deleted node payloads alive.
Text remains uncached because atlas-authoritative metrics need an explicit revision before reuse is safe. Surface embedding and isolated groups retain their existing traversal; group numbering, damage, filter planning, resource imports, command recording and GPU work still run. Image geometry may be reused, but image contents and producer damage remain subject to the normal resource and damage checks. This cache cannot itself skip a GPU submission.
CPU and whole-renderer measurements
The isolated CPU fixture uses 1,025 gradient-view nodes, 20 warm-up frames and 100 measured frames per condition in each of two trials. It measures only draw-list construction. Conditions run off then on within each trial; the larger complete-render matrix below reverses condition order between trials. Median ranges with the final admission policy are:
| CPU planning workload | HERA_DRAW_CACHE=0 | HERA_DRAW_CACHE=1 |
|---|---:|---:|
| Unchanged leaves | 0.512–0.520 ms | 0.344–0.357 ms |
| One changed leaf | 0.488–0.512 ms | 0.346–0.349 ms |
| Moving common parent | 0.493–0.509 ms | 0.699–0.701 ms |
The initial policy allocated products on every miss and took 1.058–1.071 ms for the moving-parent case. Waiting for repeated inputs reduces that waste, but motion still regresses. Exact world-space transforms in the key prevent reuse while a parent moves. This is evidence for separating local geometry from frame placement, rather than enabling this cache broadly.
The complete-render fixture uses two reversed-order trials, 64 measured frames per condition, three rotating retained targets, and a full-repaint pixel check. The dense grid changes one leaf; the blurred interface moves one group. All prior reviewed flags and 4× backdrop downsampling remain enabled; clipped texture is on at 1080p and off at 4K. gpu.scene_render is CPU planning/recording time despite its historical name. Total time includes submission and readback. The following ranges retain both trial medians:
| Workload | CPU scene, off → on | GPU interval, off → on | Total including readback, off → on | |---|---:|---:|---:| | 1080p sparse 1,025-node grid | 1.253–1.269 → 1.191–1.202 ms | 3.032–3.036 → 3.028–3.040 ms | 4.395–4.423 → 4.346–4.351 ms | | 4K sparse 1,025-node grid | 1.255–1.272 → 1.213–1.220 ms | 12.317–12.319 → 12.322–12.327 ms | 13.690–13.721 → 13.649–13.667 ms | | 1080p moving blurred interface | 0.221–0.223 → 0.221–0.283 ms | 3.900–3.901 → 3.905–3.907 ms | 4.176–4.179 → 4.182–4.257 ms | | 4K moving blurred interface | 0.222–0.222 → 0.341–0.349 ms | 15.884–15.889 → 17.652–17.659 ms | 16.166–16.173 → 18.077–18.102 ms |
The sparse-grid CPU saving is only about 0.04–0.08 ms in the complete renderer. Every paired workload has identical recorded repaint bounds and pixel-operation counts, and all final retained/full repaint checks are byte-exact. The moving-interface timing regression needs clock/context interpretation; equal pixel work does not by itself establish equal execution time. No GPU saving is attributed to this CPU cache.
Enablement and next priorities
Keep HERA_DRAW_CACHE off for the general shell workload. The experiment establishes safe reuse for eligible unchanged leaves, but its small complete-render benefit does not justify universal enablement while moving-parent planning regresses. Use it only for controlled workload experiments. The default and the Pi’s final session leave it off. Existing reviewed optimization flags and 4× backdrop downsampling remain enabled.
The next implementation priorities are:
- Separate local draw products from placement. Retain path flattening, primitive geometry and local style data across ancestor movement. Recompute world bounds, scissors, exact clip transforms and damage placement per frame. Preserve fractional sampling, group isolation and destination-dependent backdrop semantics. The present world-space cache cannot provide this benefit.
- Make HeraKit sparse preparation incremental. The earlier one-leaf/1,024-cell result still spends 9.84 ms in candidate preparation, far larger than this iteration’s renderer saving. Scope candidate construction/layout/reconciliation to dirty dependencies while preserving context and input callback freshness.
- Reduce GPU work using measured damage and dependency footprints. Focus on unchanged window composition, exact-clip interiors and backdrop regions affected by moving content. Existing integer-translation cache reuse is already present; further reuse needs proof that source content, filter sampling phase and backdrop dependencies match. The 4K fixtures remain above 8.333 ms even before client preparation or live presentation overhead.
- Audit server-selected direct scanout eligibility for opaque DMA-BUF scenes. A complete opaque buffer without composition effects is a candidate for avoiding GPU work. This requires format/modifier, transform, clipping, synchronization, lifetime and fallback checks; it is not an implemented outcome of this iteration. Rounded, blurred or overlapping desktop windows still require composition unless a separate hardware-plane proof applies.
The target display remains 1080p60/4K30. These tests measure stage costs and presentation rates at those modes; they cannot validate actual 120 Hz presentation.
Source Reference
-
crates/composer/src/composer.rs -
crates/server/src/frame/mod.rs -
crates/server/src/input/pointer.rs -
crates/renderer/src/display/cursor/input.rs -
crates/renderer/src/display/cursor/worker.rs -
crates/renderer/src/vulkan/scene/encode.rs -
crates/kit/src/app/mod.rs -
crates/renderer/shaders/clipped_texture.frag -
crates/renderer/shaders/texture.glsl -
crates/renderer/src/vulkan/tests/clipped_textures.rs