You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Icon preloading cannot work: its cache key can never match the painter's #166
prefetch_icons exists so that N render threads do not hit the network in parallel for the same icon. It served no purpose: its cache key and the painter's could never coincide.
The painter oversamples by 2 and keys on the render size:
For a 40x40 icon the preloader wrote under icon:x:#fff:40x40 and the painter read icon:x:#fff:80x80. No collision was possible at any size.
Consequences
The preload never helped. Every render thread made its own HTTP request on first paint of each icon — exactly what prefetch_icons was meant to prevent.
It cost extra. The preload downloaded, rasterized (fetch_icon_svg + usvg + tiny_skia::Pixmap, preload.rs:85-95) and stored under a key nobody read. Wasted network and CPU on every render.
The preloader rasterized at the wrong resolution: render_w = (*w).max(1) (preload.rs:91), without OVERSAMPLE. Fixing the key alone would have served the painter a bitmap at half size.
Root cause
OVERSAMPLE was a constant local to icon.rs, and the cache key was built by format! in two independent places. Nothing tied them together — the same class of defect as the audio sample rate fixed by PR #151, where two sites declared a rate without consulting each other.
Resolution
PR #168 extracted a single icon_cache_key(icon, color, target_w, target_h) that applies the oversample and builds the key, called by both sites. The oversample is applied to the preloader's rasterization too.
Fixing the key without fixing the rasterization would have turned a useless preload into a harmful one: the painter would find a bitmap at half size and display it blurred. The two had to go together.
changed the title [-]Le préchargement d'icônes est mort : sa clé de cache ne peut jamais correspondre à celle du peintre[/-][+]Icon preloading cannot work: its cache key can never match the painter's[/+]on Aug 10, 2026
Fixed by #168, merged into main. Both sites now go through a single icon_cache_key, which applies the oversample and builds the key, so the two can no longer disagree. The preloader's rasterization was corrected in the same change — fixing the key alone would have turned a useless preload into a harmful one, serving the painter a bitmap at half resolution.
Activity
[-]Le préchargement d'icônes est mort : sa clé de cache ne peut jamais correspondre à celle du peintre[/-][+]Icon preloading cannot work: its cache key can never match the painter's[/+]LeadcodeDev commentedon Aug 11, 2026
Fixed by #168, merged into
main. Both sites now go through a singleicon_cache_key, which applies the oversample and builds the key, so the two can no longer disagree. The preloader's rasterization was corrected in the same change — fixing the key alone would have turned a useless preload into a harmful one, serving the painter a bitmap at half resolution.