feat: Gaussian elimination optimization for R1CS witness reduction#338
Open
feat: Gaussian elimination optimization for R1CS witness reduction#338
Conversation
added 5 commits
March 24, 2026 17:48
- Added to handle Gaussian elimination optimization for R1CS constraints. - Introduced methods to identify linear constraints, select pivot variables, and substitute them into remaining constraints. - Enhanced struct with methods to check for linear constraints and extract linear expressions. - Updated with new utility methods for row manipulation and entry retrieval. - Integrated optimization pass into the Noir proof scheme compilation process. - Added display functions for optimization statistics in the CLI. - Included tests for various linear elimination scenarios to ensure correctness of the optimization logic.
…pruning unreachable builders
- Added field to the R1CS struct to account for computation-only columns. - Modified the DigitalDecompositionWitnesses struct to use output indices instead of first witness index and number of witnesses. - Updated the WitnessBuilder enum to replace output_start with output_indices for ChunkDecompose and SpreadBitExtract. - Enhanced the WitnessIndexRemapper to handle virtual witnesses and adjust remapping logic accordingly. - Adjusted the NoirProver to allocate space for both real and virtual witnesses. - Updated CompressedR1CS to include num_virtual and provide a method to retrieve it. - Refactored witness solving logic in DigitalDecompositionWitnessesSolver to utilize output indices. - Modified the CLI circuit stats display to include virtual witness counts.
8661bcc to
028f7bb
Compare
added 4 commits
March 25, 2026 12:21
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.
Overview
This PR introduces virtual witnesses to handle dead columns that are still required for computation but not for the proof.
Benchmarks
complete_age_check1,248,358 → 1,054,324(15.5% reduction)noir_sha25632,278 → 25,336(21.5% reduction)