Skip to content

fix(motiondiff0r): bound history by memory only - #322

Merged
jaromil merged 2 commits into
masterfrom
fix/motiondiff0r-memory-budget
Nov 5, 2026
Merged

jaromil merged 2 commits into
masterfrom
fix/motiondiff0r-memory-budget

Conversation

@jaromil

@jaromil jaromil commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Remove the independent 128-frame ceiling so the selected delay can retain as many frames as the 1 GiB history budget permits. Pixel storage and history metadata both count toward the cap and are allocated at construction. Released slots and their metadata are reused before unused slots, preserving small working sets for short offsets and allocation-free rendering.

Validation: all five focused checks passed under both Clang and GCC; all four contract/allocation checks passed under AddressSanitizer. A module compiled with exceptions disabled passed the rendering contract. The memory contract covers histories beyond 128 frames, timestamp expiry, allocation failures, and eviction at the byte-derived capacity using a separate small-budget build of the same test. At 1080p with zero offset, the measured resident-memory increase remained about 16 MiB after 200 updates.

Full local core-bundle build: all 192 selected native CTests passed. Optional OpenCV/Cairo/GAVL plugins and the two bundle profiles requiring their development packages were excluded.

Remove the independent 128-frame ceiling and allocate frame metadata alongside pixel storage within the 1 GiB history budget. Reuse inactive entries before touching unused buffers and metadata; rendering remains allocation-free.

Test histories beyond 128 frames, both constructor allocations, and eviction at the byte-derived capacity using a small-budget build of the same contract.
The core registry exercises motiondiff0r with its constructor-owned history. Allow its heap to grow beyond the initial 64 MiB, and return allocation failures to nothrow callers instead of aborting.
@jaromil
jaromil merged commit c8aeb2a into master Nov 5, 2026
10 checks passed
@jaromil
jaromil deleted the fix/motiondiff0r-memory-budget branch November 5, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant