Skip to content

Feat/wholefield#10

Merged
0pendev merged 5 commits into
mainfrom
feat/wholefield
Apr 9, 2026
Merged

Feat/wholefield#10
0pendev merged 5 commits into
mainfrom
feat/wholefield

Conversation

@0pendev
Copy link
Copy Markdown
Collaborator

@0pendev 0pendev commented Apr 2, 2026

@N3ur0sis can you have a look at this 🙏
Hoping you can still get the same coverage with this version.
Would interested to have tests you can think of 🙏

Open to any suggestion

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new domain type called .whole_values to constrain entire field instances (including all inner array dimensions) to fixed byte patterns, rather than choosing each element independently. This is useful when a field array must match one of a few complete patterns.

Changes:

  • Added .whole_values domain variant to allow fixed byte-blob constraints on entire array-shaped fields
  • Implemented validation functions to ensure candidate blob lengths match the field's total byte span
  • Updated seed byte calculation to charge only one selector byte per field instance (global array instances only), not per field element
  • Added code generation for sampling and validation of whole_values domains
  • Comprehensive test coverage including integration and unit tests
  • Documentation updates explaining the new domain type, when to use it vs .values, and fuzzer byte accounting

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
USAGE.md Documentation of .whole_values domain with examples and guidance on when to use it
src/cgen/ir.zig New domain type, validation functions, and helper functions for byte calculations
src/cgen/emit.zig Code generation for static domain tables, sampler, and checker for .whole_values
src/seed.zig Updated byte calculation logic for new domain type with comprehensive tests
src/main.zig Call to validate domains before code generation
src/Invariant.zig Test for applying .whole_values domains to globals
src/root.zig Export ir module for use in main
tests/whole_field_byte_array_invariant/ New integration test files for the feature
README.md & CONTRIBUTING.md Documentation updates mentioning the new domain type

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@0pendev
Copy link
Copy Markdown
Collaborator Author

0pendev commented Apr 9, 2026

@N3ur0sis You go ahead with your review, the issue you found should be fixed 🙏

@N3ur0sis
Copy link
Copy Markdown
Contributor

N3ur0sis commented Apr 9, 2026

@N3ur0sis You go ahead with your review, the issue you found should be fixed 🙏

Everything looks good to me, thanks !

@0pendev 0pendev merged commit ac930b9 into main Apr 9, 2026
6 checks passed
@0pendev 0pendev deleted the feat/wholefield branch April 9, 2026 14:45
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.

3 participants