Skip to content

Share output-statement checks across native operations - #531

Open
robknight wants to merge 1 commit into
mainfrom
reuse-statement-cache
Open

Share output-statement checks across native operations#531
robknight wants to merge 1 commit into
mainfrom
reuse-statement-cache

Conversation

@robknight

Copy link
Copy Markdown
Collaborator

Each native-operation checker previously rebuilt an expected output statement and compared it independently, even though the argument checks were derived from the same cached inputs. This duplicated a significant number of constraints across the MainPod circuit.

During input resolution, StatementCache represents each operation argument as a normalized equation pairing the statement argument that identifies the input with the concrete value used by the operation. For a referenced container entry, for example, this is roughly anchored_key(origin, key) = entry_value; the left-hand side is what must appear in the output statement.

This change precomputes whether each output argument matches those left-hand sides and whether the remaining arguments are correctly padded with None. Individual operation checkers now only verify the predicate and select the shared argument check for that predicate's arity.

This reduces the total gate count by 6,282 gates.

@robknight
robknight requested a review from ed255 August 10, 2026 11:56

@ed255 ed255 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice! LGTM!

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.

2 participants