test(kvm): prove tile stream ships only changed tiles (idle => zero) #83

Merged
Claude-Run merged 1 commit from verify/VA-79-tile-diff-changed-only into main 2026-06-29 03:42:08 +02:00
Member

Verify VA-79: desktop tile streaming sends only genuinely-changed tiles, so a static/idle screen settles to ~zero tiles per second after the initial full render.

Audit of vervain_agent_kvm::stream::capture_changed_tiles found the per-tile FNV-1a diff against the retained StreamState.tile_hashes is correct: an unchanged tile hashes identically and is skipped without re-encoding, the 33ms run_desktop interval only ships when the change set is non-empty, and cmd 6 Refresh maps to StreamState::invalidate which clears the hashes to re-ship the whole screen. The diff was effective, so no behaviour change was needed; this commit makes that behaviour mechanically enforced and field-measurable.

Extract the change-detection core into a pure diff_changed_tiles(state, &RawFrame, quality) so it can be exercised with synthetic frames in CI (the capture backends need a live X11 / Wayland / DXGI session). capture_changed_tiles keeps its signature and just calls capture_raw_frame then the new diff.

Add three unit tests (run by cargo test --workspace --lib in CI) that guard the acceptance criteria: an identical second frame ships zero tiles; a single changed pixel ships exactly the one tile containing it; and a Refresh (invalidate) re-ships every tile even when pixels are unchanged. A regression that re-ships unchanged tiles now fails CI.

Instrument run_desktop to debug-log tiles-per-interval and bytes-per-interval when the change set is non-empty, so the idle/active tile counts can be measured on a live host (desktop-02): an idle screen produces no log lines, an active screen logs the real change volume.

#VA-79

Verify VA-79: desktop tile streaming sends only genuinely-changed tiles, so a static/idle screen settles to ~zero tiles per second after the initial full render. Audit of vervain_agent_kvm::stream::capture_changed_tiles found the per-tile FNV-1a diff against the retained StreamState.tile_hashes is correct: an unchanged tile hashes identically and is skipped without re-encoding, the 33ms run_desktop interval only ships when the change set is non-empty, and cmd 6 Refresh maps to StreamState::invalidate which clears the hashes to re-ship the whole screen. The diff was effective, so no behaviour change was needed; this commit makes that behaviour mechanically enforced and field-measurable. Extract the change-detection core into a pure diff_changed_tiles(state, &RawFrame, quality) so it can be exercised with synthetic frames in CI (the capture backends need a live X11 / Wayland / DXGI session). capture_changed_tiles keeps its signature and just calls capture_raw_frame then the new diff. Add three unit tests (run by `cargo test --workspace --lib` in CI) that guard the acceptance criteria: an identical second frame ships zero tiles; a single changed pixel ships exactly the one tile containing it; and a Refresh (invalidate) re-ships every tile even when pixels are unchanged. A regression that re-ships unchanged tiles now fails CI. Instrument run_desktop to debug-log tiles-per-interval and bytes-per-interval when the change set is non-empty, so the idle/active tile counts can be measured on a live host (desktop-02): an idle screen produces no log lines, an active screen logs the real change volume. #VA-79
test(kvm): prove tile stream ships only changed tiles (idle => zero)
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 4m43s
Create release / Create release from merged PR (pull_request) Has been skipped
7a3b4e15aa
Verify VA-79: desktop tile streaming sends only genuinely-changed tiles, so a static/idle screen settles to ~zero tiles per second after the initial full render.

Audit of vervain_agent_kvm::stream::capture_changed_tiles found the per-tile FNV-1a diff against the retained StreamState.tile_hashes is correct: an unchanged tile hashes identically and is skipped without re-encoding, the 33ms run_desktop interval only ships when the change set is non-empty, and cmd 6 Refresh maps to StreamState::invalidate which clears the hashes to re-ship the whole screen. The diff was effective, so no behaviour change was needed; this commit makes that behaviour mechanically enforced and field-measurable.

Extract the change-detection core into a pure diff_changed_tiles(state, &RawFrame, quality) so it can be exercised with synthetic frames in CI (the capture backends need a live X11 / Wayland / DXGI session). capture_changed_tiles keeps its signature and just calls capture_raw_frame then the new diff.

Add three unit tests (run by `cargo test --workspace --lib` in CI) that guard the acceptance criteria: an identical second frame ships zero tiles; a single changed pixel ships exactly the one tile containing it; and a Refresh (invalidate) re-ships every tile even when pixels are unchanged. A regression that re-ships unchanged tiles now fails CI.

Instrument run_desktop to debug-log tiles-per-interval and bytes-per-interval when the change set is non-empty, so the idle/active tile counts can be measured on a live host (desktop-02): an idle screen produces no log lines, an active screen logs the real change volume.

#VA-79
David deleted branch verify/VA-79-tile-diff-changed-only 2026-06-29 03:58:13 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-agent!83
No description provided.