Skip to content

Commit

Permalink
integration tests work; the new api is confusing and will cause issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wcharczuk committed Feb 12, 2024
1 parent e352106 commit c54bf3b
Show file tree
Hide file tree
Showing 8 changed files with 349 additions and 142 deletions.
4 changes: 2 additions & 2 deletions adjust_heights_heap.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

func newAdjustHeightsHeap(maxHeightAllowed int) *adjustHeightsHeap {
return &adjustHeightsHeap{
nodesByHeight: make([]map[Identifier]INode, maxHeightAllowed+32),
nodesByHeight: make([]map[Identifier]INode, maxHeightAllowed),
lookup: make(set[Identifier]),
}
}
Expand All @@ -28,7 +28,7 @@ func (ah *adjustHeightsHeap) len() (out int) {
}

func (ah *adjustHeightsHeap) maxHeightAllowed() int {
return len(ah.nodesByHeight)
return len(ah.nodesByHeight) - 1
}

func (ah *adjustHeightsHeap) remove(node INode) {
Expand Down
6 changes: 3 additions & 3 deletions bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func benchmarkParallelSize(size int, b *testing.B) {

func benchmarkDepth(width, depth int, b *testing.B) {
graph := New(
GraphMaxRecomputeHeapHeight(1024),
OptGraphMaxHeight(1024),
)
vars := make([]VarIncr[string], width)
for x := 0; x < width; x++ {
Expand Down Expand Up @@ -245,7 +245,7 @@ func benchmarkDepth(width, depth int, b *testing.B) {
func benchmarkNestedBinds(depth int, b *testing.B) {
ctx := context.Background()
graph := New(
GraphMaxRecomputeHeapHeight(1024),
OptGraphMaxHeight(1024),
)
fakeFormula := Var(graph, "fakeFormula")
g, o := makeNestedBindGraph(graph, depth, fakeFormula)
Expand Down Expand Up @@ -313,7 +313,7 @@ func makeNestedBindGraph(graph *Graph, depth int, fakeFormula VarIncr[string]) (
func benchmarkConnectedGraphWithNestedBinds(depth int, b *testing.B) {
ctx := context.Background()
graph := New(
GraphMaxRecomputeHeapHeight(1024),
OptGraphMaxHeight(1024),
)
fakeFormula := Var(graph, "fakeFormula")
observed := make([]ObserveIncr[*int], depth)
Expand Down
2 changes: 1 addition & 1 deletion bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ func Test_Bind_unbindRegression(t *testing.T) {
func Test_Bind_nested_amplification(t *testing.T) {
ctx := testContext()
g := New(
GraphMaxRecomputeHeapHeight(1024),
OptGraphMaxHeight(1024),
)
depth := 4
fakeFormula := Var(g, "fakeFormula")
Expand Down
Loading

0 comments on commit c54bf3b

Please sign in to comment.