bloom-lang / bud

Prototype Bud runtime (Bloom Under Development)
http://bloom-lang.net
Other
854 stars 59 forks source link

Incorrect join results #276

Closed neilconway closed 12 years ago

neilconway commented 12 years ago

Test case:

class TestJoinReplay
  include Bud

  state do
    table :t1
    table :t2
    scratch :x1
    scratch :x2
    scratch :x3
  end

  bloom do
    x1 <= (t1 * t2).pairs {|x,y| [x.key, y.val]}
    x1 <= (x2 * x3).pairs {|x,y| [x.key, y.val]}
  end
end

class JoinReplayTest < MiniTest::Unit::TestCase
  def test_join_replay
    i = TestJoinReplay.new
    i.t1 <+ [[2, 3]]
    i.t2 <+ [[3, 4]]
    i.x2 <+ [[5, 6]]
    i.x3 <+ [[7, 8]]
    i.tick
    puts i.x1.to_a.inspect
    i.x2 <+ [[5, 6]]
    i.x3 <+ [[7, 8]]
    i.tick
    puts i.x1.to_a.inspect
  end
end

Expected outcome:

[[2, 4], [5, 8]]
[[2, 4], [5, 8]]

Observed outcome:

[[2, 4], [5, 8]]
[[5, 8]]

Looking into it shortly -- just created the issue for tracking purposes.

neilconway commented 12 years ago

Fixed in be9b3106d5229397b0fee6fc6ca3570b561482c9 and f7bd5357e47c18ec54077ce8a7f9988a55270014