-
Notifications
You must be signed in to change notification settings - Fork 18
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
Make witin_namespace_map
more robust
#465
Conversation
In almost all the case, unifying source of truth and less error prune make much sense! We expect ceno/ceno_zkvm/src/circuit_builder.rs Line 82 in 79bb73b
to be serialized into proving/verifying key. So, we expect some fields scope should be move to cfg[test] or just under some feature flag toggle onAll the "xxxxx_map" fields is one of the example. Those debug info are
With above 2 points, I will say this PR change is unnessesary, because source of truth shouldn't reverse release info to depends on debug info |
@hero78119 Could you please add that reasoning as a comment in the code? And perhaps make it so that Btw, I don't think we should spend effort removing variable names from a release build. It's better to leave them around for debugging, because things can go wrong with the release build, too. (That's all assuming that constructing the circuit is far from the most expensive thing we are doing. I expect (recursive) proving to take the majority of the runtime.)
You can do that, even with the change I suggested here. You would keep a Vector in memory, but serialise just it's length. Deserialisation would read the number and produce dummy entries for the vector. |
Earlier, we cached the length of
witin_namespace_map
andfixed_namespace_map
inside theCircuitBuilder
. That means we had to manually keep the cache in sync with the underlying source of truth.In this PR, we remove the caches and instead ask for the lengths when we need them.
This makes our logic simpler and more robust: fewer moving parts that can go out of sync.
Git agrees:
For context, this PR prepares for removing the need to clone our
Expression
s.