Repository navigation
Reduce memory use in anime cadence smoothing - #10
Merged
MONZikWasTaken merged 15 commits intoNov 20, 2026
Merged
Conversation
The new stream test fails to compile against the existing EngineReport because the memory breakdown is missing.
Track allocation lifetimes through stream slots, the tensor arena, and plan bindings. Keep the cumulative counter for existing hosts and split out cadence scratch so its cost can be isolated from the three video pair plans. Verified with native stream and arena tests and the browser WASM build on Apple M5. Opening and freeing realtime, video, and cadence streams at 1920x1080 returned the portable-f16 engine to its 3 KiB baseline.
MONZikWasTaken
marked this pull request as ready for review
November 20, 2026 01:08
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.
This follows #8, which adds the live and peak allocation counters I used for the measurements below. I opened this as a draft so the memory reporting and the cadence changes can be reviewed separately. Until #8 lands, the branch includes those commits. Cadence-only diff
Anime cadence smoothing keeps three neighboring pairs available. It was retaining three sets of model weights, inference scratch, and render buffers even though it only runs one plan at a time. I started by comparing pixels and retiming decisions on drawings held for two or three frames, pans, cuts, and seeks, then changed one part at a time.
What changes
1080p results
Chrome WebGPU f16 used 413.20 → 270.72 MiB in its own matched run, a 34.5% reduction. It returned to 3 KiB after closing the stream. These are engine-tracked allocations, not driver-reserved VRAM.
Native f16 and f32 matched baseline pixel fingerprints and retiming decisions on the controlled animation fixtures. Chrome matched all 28 generated 1080p frame hashes and 14 retiming decisions. The baseline browser build let a stale result change the new interval after a seek. The updated build didn't. Engine and browser-target Clippy, the cadence regressions, and the relevant non-timestamp GPU tests passed.
Windows NVIDIA and real-episode playback throughput are still untested. This doesn't include the separate Metal timestamp fix.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.