TimelyDataflow / TimelyDataflow/differential-dataflow

Possible minor perf bug in `work`

Open
#148 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
3k
Forks
211
Avg merge
10h 42m
Merged PRs (30d)
34

Description

It looks like work can consume exactly all of the fuel and still complete the merge:

https://github.com/TimelyDataflow/differential-dataflow/blob/3d4bd15daf94bf4e5a40aaa7592778af6e2ed913/src/trace/implementations/vec.rs#L126

		if effort >= *fuel { *fuel = 0; }
		else 			   { *fuel -= effort; }

However, in the doc for Merger,

	/// If `fuel` is non-zero after the call, the merging is complete and
	/// one should call `done` to extract the merged results.
	fn work(&mut self, source1: &Output::Base, source2: &Output::Base, frontier: &Option<Vec<T>>, fuel: &mut usize);

Unless I'm overlooking something, this means we may notice that the merge is in fact complete only on the next invocation of work. If work finishes with exactly zero fuel, we should be able to call done right away.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/trace/implementations/vec.rs around line 126 and compare the fuel handling with the Merger::work documentation quoted in the issue. Trace when a merge is considered complete and when done may be called; done means the exact-fuel case follows the documented completion contract without requiring another work invocation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
distributed-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.