barretenberg icon indicating copy to clipboard operation
barretenberg copied to clipboard

feat: add normalized_cache to UltraCircuitBuilder

Open Himess opened this issue 8 months ago • 0 comments

Summary

Closes #1052

This PR introduces a normalized_cache mechanism to the UltraCircuitBuilder to support memoization of normalized witness variables.

Changes

  • Added normalized_cache as a member field in UltraCircuitBuilder.
  • Implemented the following methods:
    • has_normalized(...)
    • get_normalized(...)
    • cache_normalized(...)
  • All methods are field-agnostic and templated over ExecutionTrace.

Motivation

The cache allows the builder to reuse previously computed normalized values, avoiding redundant work and improving performance in cases where normalization is invoked multiple times for the same inputs.

Himess avatar May 09 '25 21:05 Himess