Skip to content

int_proxy: present VecReduceBackend input in time order at partially ordered times - #995

Open
bos wants to merge 1 commit into
TimelyDataflow:master-nextfrom
bos:fix-vec-backend-sorted-bridge
Open

bos wants to merge 1 commit into
TimelyDataflow:master-nextfrom
bos:fix-vec-backend-sorted-bridge

Conversation

@bos

@bos bos commented Oct 21, 2026

Copy link
Copy Markdown

Fixes #994.

VecReduceBackend draws each key's records sorted by (data, novel, time), so for each value it presents the prior records first and then the novel ones. It advances prior records to lower. With partially ordered times this can move a prior record past a novel record of the same value, for example (0, 5) to (1, 5), after the novel (1, 0). The input bridge is then unsorted, and it can also be unconsolidated, which fails debug_assert_sorted_bridge.

This change sorts the drawn records by (data, time, novel). The flag still stops consolidation from cancelling a novel record against a prior one. A prior and a novel record at the same time now arrive next to each other, so next_window nets them, as its comment says.

Release builds already gave correct output, because ValueHistory::load_iter sorts and consolidates each value's edits. This change makes the backend meet the contract that the assertion checks.

Test

reduce_prior_advanced_past_novel in tests/int_proxy.rs retires a prior record at (0, 5), then a novel +1 at (1, 0) and -1 at (1, 5) with lower = {(1, 0)}, and checks the output. It panics without this change. cargo test --workspace passes. With this change, 4,000 random inputs at partially ordered times on 1 to 4 workers run in a debug build without the assertion failing, and match a reference. Without it, the assertion fails on 1,374 of 1,600.

This branch has not been deployed

No deployments
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