Skip to content

S12: tag the SMT state buses binary - #154

Draft
OBrezhniev wants to merge 1 commit into
fix/circomlib_buses_reviewfrom
fix/smt-state-binary-tags
Draft

OBrezhniev wants to merge 1 commit into
fix/circomlib_buses_reviewfrom
fix/smt-state-binary-tags

Conversation

@OBrezhniev

Copy link
Copy Markdown
Member

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant