S12: tag the SMT state buses binary - #154
Draft
OBrezhniev wants to merge 1 commit into
Draft
OBrezhniev wants to merge 1 commit into
OBrezhniev wants to merge 1 commit into
Conversation
SMTVerifierState and SMTProcessorState carried no tags, yet every use
treats their fields as one-hot bits: the level templates multiply by
them as booleans (proofHash.out * st.top, old1leaf * st.iold), the state
machines' other inputs is0, levIns and fnc are tagged {binary}, and the
closing check st.na + st.iold + st.inew + st.i0 === 1 reads as one hot
only if each field is a bit. The property the machine rests on was the
one thing about it left undeclared.
The bus fields are now {binary}. The state machines' outputs are
declared through the bus, so they grant the tag; a comment records that
st.top <== prev.top - prev_top_lev_ins is binary by the machine's
invariant rather than by inspection of the line. The initial state in
SMTVerifier and SMTProcessor fed constants and 1 - enabled straight into
the bus; those become a tagged zero and NOT()(enabled), the pattern the
rest of the library uses for constants into tagged signals.
Internal templates: SMTVerifier and SMTProcessor keep their ports.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D1w729xzwemQigkf3PCisD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #149 (
fix/circomlib_buses_review); this PR shows only its own commits. Independent of the other stacked PRs unless stated. Full suite passes on the branch.Internal templates only; constraint counts unchanged.
Tag the SMT state buses binary
SMTVerifierState and SMTProcessorState carried no tags, yet every use
treats their fields as one-hot bits: the level templates multiply by
them as booleans (proofHash.out * st.top, old1leaf * st.iold), the state
machines' other inputs is0, levIns and fnc are tagged {binary}, and the
closing check st.na + st.iold + st.inew + st.i0 === 1 reads as one hot
only if each field is a bit. The property the machine rests on was the
one thing about it left undeclared.
The bus fields are now {binary}. The state machines' outputs are
declared through the bus, so they grant the tag; a comment records that
st.top <== prev.top - prev_top_lev_ins is binary by the machine's
invariant rather than by inspection of the line. The initial state in
SMTVerifier and SMTProcessor fed constants and 1 - enabled straight into
the bus; those become a tagged zero and NOT()(enabled), the pattern the
rest of the library uses for constants into tagged signals.
Internal templates: SMTVerifier and SMTProcessor keep their ports.
🤖 Generated with Claude Code
https://claude.ai/code/session_01D1w729xzwemQigkf3PCisD