Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: cache lookup blueprint entries in solving phase #915

Merged
merged 2 commits into from Nov 16, 2023

Conversation

gbotrel
Copy link
Collaborator

@gbotrel gbotrel commented Nov 15, 2023

See #898 .

Adds blueprint.Reset() and BlueprintLookup now maintains a cache of resolved entries during solving time.

@gbotrel gbotrel added the perf label Nov 15, 2023
Copy link
Collaborator

@ivokub ivokub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

constraint/blueprint_logderivlookup.go Show resolved Hide resolved
Copy link

📦 github.com/consensys/gnark/std/math/emulated
TestInverse 0s

TestInverse/Goldilocks/limb=64 0s

TestInverse/Goldilocks/limb=64/bn254 0s

panic: test timed out after 30m0s
running tests:
	TestInverse (30m0s)
	TestInverse/Goldilocks/limb=64 (30m0s)
	TestInverse/Goldilocks/limb=64/bn254 (30m0s)

goroutine 306 [running]:
testing.(*M).startAlarm.func1()
	/opt/hostedtoolcache/go/1.21.3/x64/src/testing/testing.go:2259 +0x3b9
created by time.goFunc
	/opt/hostedtoolcache/go/1.21.3/x64/src/time/sleep.go:176 +0x2d

goroutine 1 [chan receive, 29 minutes]:
testing.(*T).Run(0xc0000a3d40, {0xeb2f0c?, 0x51fadc?}, 0xf17aa0)
	/opt/hostedtoolcache/go/1.21.3/x64/src/testing/testing.go:1649 +0x3c8
testing.runTests.func1(0x155cd00?)
	/opt/hostedtoolcache/go/1.21.3/x64/src/testing/testing.go:2054 +0x3e
testing.tRunner(0xc0000a3d40, 0xc000163c48)
	/opt/hostedtoolcache/go/1.21.3/x64/src/testing/testing.go:1595 +0xff
testing.runTests(0xc000153180?, {0x15538c0, 0x1d, 0x1d}, {0x4182bf?, 0xc000163d08?, 0x155b3e0?})
	/opt/hostedtoolcache/go/1.21.3/x64/src/testing/testing.go:2052 +0x445
testing.(*M).Run(0xc000153180)
	/opt/hostedtoolcache/go/1.21.3/x64/src/testing/testing.go:1925 +0x636
main.main()
	_testmain.go:109 +0x19c

goroutine 123 [chan receive, 29 minutes]:
testing.(*T).Run(0xc00041a4e0, {0xc000438120?, 0xc0004266d0?}, 0xc00040a6c0)
	/opt/hostedtoolcache/go/1.21.3/x64/src/testing/testing.go:1649 +0x3c8
github.com/consensys/gnark/test.(*Assert).Run(0xc000426718, 0xc00040a6b0, {0xc000426728?, 0x39?, 0x5ad?})
	/home/runner/work/gnark/gnark/test/assert.go:64 +0x99
github.com/consensys/gnark/std/math/emulated.testInverse[...](0xc00041a4e0)
	/home/runner/work/gnark/gnark/std/math/emulated/element_test.go:403 +0x107
github.com/consensys/gnark/std/math/emulated.TestInverse(0xc00062f2c0?)
	/home/runner/work/gnark/gnark/std/math/emulated/element_test.go:392 +0x25
testing.tRunner(0xc00041a4e0, 0xf17aa0)
	/opt/hostedtoolcache/go/1.21.3/x64/src/testing/testing.go:1595 +0xff
created by testing.(*T).Run in goroutine 1
	/opt/hostedtoolcache/go/1.21.3/x64/src/testing/testing.go:1648 +0x3ad

goroutine 124 [chan receive, 29 minutes]:
testing.(*T).Run(0xc00041a680, {0xc000404f40?, 0xc000087cc8?}, 0xc00040a760)
	/opt/hostedtoolcache/go/1.21.3/x64/src/testing/testing.go:1649 +0x3c8
github.com/consensys/gnark/test.(*Assert).Run(0xc00040a720, 0xc0004065d0, {0xc000087e08?, 0x151232c?, 0x2?})
	/home/runner/work/gnark/gnark/test/assert.go:64 +0x99
github.com/consensys/gnark/test.(*Assert).CheckCircuit(0xc000489160?, {0x1006e00?, 0xc0004362d0}, {0xc000087e88, 0x1, 0x1})
	/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:39 +0x168
github.com/consensys/gnark/std/math/emulated.testInverse[...].func1()
	/home/runner/work/gnark/gnark/std/math/emulated/element_test.go:409 +0x2bd
github.com/consensys/gnark/test.(*Assert).Run.func1(0xc00041a680)
	/home/runner/work/gnark/gnark/test/assert.go:66 +0xa7
testing.tRunner(0xc00041a680, 0xc00040a6c0)
	/opt/hostedtoolcache/go/1.21.3/x64/src/testing/testing.go:1595 +0xff
created by testing.(*T).Run in goroutine 123
	/opt/hostedtoolcache/go/1.21.3/x64/src/testing/testing.go:1648 +0x3ad

goroutine 125 [runnable]:
github.com/consensys/gnark/test.(*engine).ConstantValue(0xc00043c0b0, {0xea4f80?, 0xc000489200?})
	/home/runner/work/gnark/gnark/test/engine.go:570 +0x48
github.com/consensys/gnark/std/math/emulated.(*Field[...]).constantValue(0x101c840, 0xc000436500)
	/home/runner/work/gnark/gnark/std/math/emulated/field.go:223 +0xa8
github.com/consensys/gnark/std/math/emulated.(*Field[...]).enforceWidthConditional(0x101c840, 0xc000436500)
	/home/runner/work/gnark/gnark/std/math/emulated/field.go:170 +0x3b
github.com/consensys/gnark/std/math/emulated.(*Field[...]).Reduce(0x101c840?, 0xc000436500)
	/home/runner/work/gnark/gnark/std/math/emulated/field_ops.go:253 +0x30
github.com/consensys/gnark/std/math/emulated.(*Field[...]).reduceAndOp(0x101c840?, 0xc000655b50, 0xc000655b38, 0xc000436500, 0x0)
	/home/runner/work/gnark/gnark/std/math/emulated/field_ops.go:404 +0x132
github.com/consensys/gnark/std/math/emulated.(*Field[...]).Inverse(0x10152d8?, 0xc00043c0b0?)
	/home/runner/work/gnark/gnark/std/math/emulated/field_ops.go:44 +0x7b
github.com/consensys/gnark/std/math/emulated.(*InverseCircuit[...]).Define(0x1008e00, {0x10152d8, 0xc00043c0b0?})
	/home/runner/work/gnark/gnark/std/math/emulated/element_test.go:386 +0x65
github.com/consensys/gnark/test.IsSolved({0x1006e00, 0xc0004362d0}, {0x1006e00, 0xc000436320}, 0xc000489480, {0x0, 0x0, 0x0?})
	/home/runner/work/gnark/gnark/test/engine.go:139 +0x4cf
github.com/consensys/gnark/test.(*Assert).CheckCircuit.func1(0x0?)
	/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:49 +0x29b
github.com/consensys/gnark/test.(*Assert).Run.func1(0xc00041a820)
	/home/runner/work/gnark/gnark/test/assert.go:66 +0xa7
testing.tRunner(0xc00041a820, 0xc00040a760)
	/opt/hostedtoolcache/go/1.21.3/x64/src/testing/testing.go:1595 +0xff
created by testing.(*T).Run in goroutine 124
	/opt/hostedtoolcache/go/1.21.3/x64/src/testing/testing.go:1648 +0x3ad

@gbotrel gbotrel merged commit ae6789f into master Nov 16, 2023
7 checks passed
@gbotrel gbotrel deleted the perf/statefulsolve branch November 16, 2023 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants