feat: support field-specific binary constraint files#1483
Open
DavePearce wants to merge 1 commit into
Open
Conversation
1b2b4cf to
d9f90e4
Compare
d9f90e4 to
7092f66
Compare
2ea4020 to
2102b9a
Compare
65dd955 to
ed68256
Compare
0446a6b to
c6006fd
Compare
555a089 to
3563efd
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
This updates the binfile.BinaryFile format to support the embedding of compiled constraints. Specifically, it now includes both the top-level "abstract" constraints, along with an (optional) embedding of the low-level (e.g. AIR) constraints. The latter is fixed to a specific field, whilst the former is not. Attempting to use the latter under a different field results in a runtime failure. The approach to implementing this feature was to replace the existing encoding for the binfile (which was a mixture of GOB and ad-hoc translations) with just a GOB encoding. This required ensuring that lower-level IRs (MIR/AIR) can be GOB encoded (i.e. since these pathways were not previously tested). To ensure that adequate testing is done of this, the test framework always goes through the gob encoder/decoder to access the underlying constraints.
3563efd to
b965d40
Compare
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.

Note
Medium Risk
Bumps the binfile format and changes gob serialization/registration across ASM/HIR/MIR/AIR and assignments, which can break backwards compatibility or cause decode/runtime issues if registrations/config mismatches occur.
Overview
Binary constraint files (
.bin) now optionally embed a field-specific, pre-compiled schema (CompiledSchema) alongside the existingMacroHirProgram, and the binfile major version is bumped to11.The CLI/schema pipeline is refactored from
SchemaStacker.Build()producing in-memory layers to aSchemaStackthat carriesCompiledSchemablobs; commands (check,trace,inspect,debug,generate,verify) now extract concrete schemas viabinfile.ExtractSchemaand useAbstractSchema()for propagation.To support gob encoding/decoding of embedded compiled schemas, the PR adds broad gob registrations for micro/macro programs, AIR/MIR/HIR schema/constraint/term types, micro instructions, and various assignments/gadgets; it also standardizes many internal wrappers and constraint/assignment structs to store/export pointer-backed fields and exported struct members for gob.
Reviewed by Cursor Bugbot for commit b965d40. Bugbot is set up for automated code reviews on this repo. Configure here.