Skip to content

chore(brillig): Document and test explicit memory limit#11290

Merged
TomAFrench merged 3 commits intomasterfrom
mv/brillig-explicit-memory-limit
Jan 22, 2026
Merged

chore(brillig): Document and test explicit memory limit#11290
TomAFrench merged 3 commits intomasterfrom
mv/brillig-explicit-memory-limit

Conversation

@vezenovm
Copy link
Contributor

@vezenovm vezenovm commented Jan 21, 2026

Description

Problem

Resolves #11200

Check out #11200 (comment) and the preceding discussion for more context. Rust has a fundamental per-allocation isize::MAX limit.

Summary

Changes:

  • Clearer panic message instead of "capacity overflow" panic from Rust
  • Test displaying this behavior
  • Deterministic behavior on 32-bit and 64-bit architectures

Additional Context

To actually fix the auditor's concern in #11200 about being able to use the full u32 address space, we would most likely need chunked memory. In order to bypass Rust's fundamental allocation limit we would need many smaller Vec fields to cover the full address space. I made a follow-up here #11291 for 1.0+, although I find this to be low priority either way as i32::MAX is a practical limit for the time being.

User Documentation

Check one:

  • No user documentation needed.
  • Changes in docs/ included in this PR.
  • [For Experimental Features] Changes in docs/ to be submitted in a separate PR.

PR Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'ACVM Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 59754c9 Previous: bb296ff Ratio
perfectly_parallel_batch_inversion_opcodes 2799589 ns/iter (± 1739) 2269293 ns/iter (± 1033) 1.23

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

Copy link
Contributor

@aakoshh aakoshh left a comment

Choose a reason for hiding this comment

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

TIL my limits 🙇

@TomAFrench TomAFrench added this pull request to the merge queue Jan 22, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 22, 2026
@TomAFrench TomAFrench added this pull request to the merge queue Jan 22, 2026
Merged via the queue into master with commit c99e648 Jan 22, 2026
137 checks passed
@TomAFrench TomAFrench deleted the mv/brillig-explicit-memory-limit branch January 22, 2026 16:08
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.

Resize function does not allow use of full intended memory space

3 participants