MilkDrop: preset thumbnails in a grid (#575), with engine buffer and light sampler fixes - #608
Merged
Merged
Conversation
The MilkDrop panel's list gets a Layout choice, List or Grid. In the grid every preset shows a thumbnail, drawn once in a hidden window and kept in the user data. - Recipe measured on a seeded 200-preset sample of the corpus: a black start, 60 frames of the demo sound at 1/30 s, drawn at 640x360 and scaled to a 256x144 WebP. A fixed seed image cut black thumbnails only from 20 to 18, took 45% longer and painted its colours into presets that draw nothing like it; more frames did not help. - Each thumbnail is drawn by a new engine instance from black buffers, with Math.random and the preset seed taken from the key, and waits for the textures it asks for; the same preset gives the same bytes whatever was drawn before it. A texture that does not arrive is not written. - The key hashes the files the thumbnail page loads, the preset source and the textures it uses, so an engine change, an edited preset or a changed texture gets a new thumbnail. Unused files are deleted once per session. - The panel asks for the visible cells; cached thumbnails come back at once, the rest as they are drawn, newest request first. Waiting and failed cells look different from a thumbnail that is really black. Images come through an sv-thumb: protocol that accepts only a key. - The hidden window closes when idle and when the panel closes. - The smoke test draws a builtin preset's thumbnail through the whole chain into a temporary folder. Found on the way: - sampler_randNN picked from the texture list in file-system order, which differs between Windows and Linux; the list is now sorted. - The importer did not strip filter/wrap prefixes from sampler names, so a preset asking for sampler_fw_worms did not bring worms.jpg along. - The builtin presets module now gives its list to Node too. Refs #575, #560
…ll canvas Render targets were allocated empty and cleared with gl.clear. With another MilkDrop context drawing on the same GPU and the CPU busy, a freshly allocated feedback buffer could still hold that context's picture, and the feedback loop grew it: a preset whose first two seconds are black came out as the starburst another window was showing, in 13 of 24 draws. Neither the other window nor the CPU load alone did it. Targets are now allocated from a shared zero buffer that is never written (8 MB at 1080p) and the clear stays; the same conditions gave 0 of 48, and 200 presets drawn alone gave identical results before and after. Any window whose buffers are allocated again (a new window, a resize, a restored context) and the video export were exposed too. The light colour sampler (#589) read its 64x16 canvas with getImageData about 30 times a second; Chromium warned that the canvas should be made for frequent reading, and the smoke test counts that warning as an error. The downscale stays on the GPU canvas and only the small result is copied into a second canvas made for reading, so 4 KB come back instead of the whole frame. Refs #575, #589, #560
- A thumbnail is written only if every frame was drawn on a live context (the engine's frame counter matches the recipe, no loss or recovery). With no context the engine draws a placeholder and after a loss it keeps the last frame; either would be kept for good under a content key. - If the hidden drawing process crashes, its window is destroyed and the job fails at once instead of every later cell waiting for the 30 s limit. - The panel tests poll for their condition instead of racing the 80 ms batching timer, and a panel's leftover timer no longer leaks into the next test. - Docs: the order check with busy presets (7 of 7, textured and sampler_randNN included), the load check, the IPC cost, and that thumbnails use the engine defaults. Refs #575, #560
The smoke test and the screenshot tool run on the user's own profile. With Dynamic Lighting on in the settings, the app drove the lights at start-up in those runs too, and the smoke test itself turns OpenRGB on in the panel, which would reach a running OpenRGB server; Art-Net would send to the network. As with the camera, which automation never opens, the physical outputs are now off in these runs: every Dynamic Lighting setting goes through one function that sends it switched off, the device scan is skipped, and OpenRGB and Art-Net are never started. Diagnostics (--diag) still drives the lights. Docs: the light sampler fix, this guard, the cost of zero-filled targets (a full rebuild at 1080p 8.6 ms instead of 3.3 ms) and the test totals. Refs #575, #560
This was referenced Sep 22, 2026
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.
#575: preset thumbnails. Two engine fixes found along the way go beyond it and are listed separately below.
Thumbnails
The MilkDrop panel's list gets a Layout choice, List or Grid. In the grid, every preset shows a thumbnail. Each thumbnail is drawn once in a hidden window and kept in
userData/milkdrop-thumbs/.Math.randomand the preset seed are derived from the key.sampler_randNN.sv-thumb:protocol that accepts only a key.Found on the way
gl.clear.getImageDataabout 30 times a second, and Chromium warned about it. The smoke test caught the warning because lights in the current settings take MilkDrop's colours.--diagstill drives the lights.sampler_randNNpicked from an unsorted texture list; the list is now sorted.sampler_fw_worms).Not done
Checks
npm test: 2108/2108.process.platformset to Linux.npm run smoke: PASS. User-data checksums were unchanged.Refs #575, #589, #560