feat(encode): incremental encoding for multi-view slide compositions#43
Merged
Conversation
Incremental re-encoding was hardcoded to views[0] of single-slide scenarios. It now segments any all-slide composition into slots — one per scene plus one per inter-view transition, in exact build_frame_tasks order (locked by an equivalence test): - segment_slots / slot_hash / plan_dirty are pure and unit-tested; a view-transition slot hashes both boundary scenes + the transition config so it re-renders when either side changes - the last scene of a view keeps the existing rule (re-render when the next scene changed and has an incoming transition) - slot-count changes vs the previous cache fall back to a full re-render; single-view scenarios keep byte-identical slot layouts so existing watch caches stay valid - world views still return IncrementalUnsupported with an honest reason: camera pans composite several scenes per frame, so frames aren't scene-partitioned (real per-scene surface caching is a separate performance project)
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.
Closes #23.
Goal: lift incremental re-encoding beyond
views[0]of single-slide scenarios.build_frame_tasksorder — locked by an equivalence test asserting concatenated per-slot tasks equal the full builder's output, with and without view transitions (the incremental stream may not differ from a full encode).segment_slots/slot_hash/plan_dirty. A view-transition slot hashes both boundary scenes + the transition config, so changing the last scene of a view re-renders that scene and the transition into the next view (asserted: dirty =[false, true, true, false]).Tests: 5 new — 3 pure planning (enumeration order, full-builder equivalence, dirty propagation incl. layout-change fallback) + 2 integration (a 2-view composition that previously failed
IncrementalUnsupportedencodes twice with a strict subset re-rendered on run two; world views keep their explicit refusal). 222 total, all green.Verify:
cargo test --workspace→ 222 passed ✓ ·cargo fmt --check✓ · clippy 0 warnings ✓