Skip to content

feat!: Make structs mutable by default#1795

Open
mark-koch wants to merge 2 commits into
mk/mutable-structsfrom
mk/mutable-by-default
Open

feat!: Make structs mutable by default#1795
mark-koch wants to merge 2 commits into
mk/mutable-structsfrom
mk/mutable-by-default

Conversation

@mark-koch
Copy link
Copy Markdown
Collaborator

@mark-koch mark-koch commented Jun 2, 2026

Closes #1776

Depends on #1793

BREAKING CHANGE: Structs are now mutable by default. Use @guppy.struct(frozen=True) to define immutable structs

@mark-koch mark-koch requested a review from a team as a code owner June 2, 2026 14:05
@mark-koch mark-koch requested review from tatiana-s and removed request for a team June 2, 2026 14:05
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

🐰 Bencher Report

Branchmk/mutable-by-default
TestbedLinux
Click to view all benchmark results
Benchmarkhugr_bytesBenchmark Result
bytes x 1e3
(Result Δ%)
Upper Boundary
bytes x 1e3
(Limit %)
hugr_nodesBenchmark Result
nodes
(Result Δ%)
Upper Boundary
nodes
(Limit %)
tests/benchmarks/test_big_array.py::test_big_array_compile📈 view plot
🚷 view threshold
158.77 x 1e3
(0.00%)Baseline: 158.77 x 1e3
160.36 x 1e3
(99.01%)
📈 view plot
🚷 view threshold
6,641.00
(0.00%)Baseline: 6,641.00
6,707.41
(99.01%)
tests/benchmarks/test_ctrl_flow.py::test_many_ctrl_flow_compile📈 view plot
🚷 view threshold
27.54 x 1e3
(0.00%)Baseline: 27.54 x 1e3
27.81 x 1e3
(99.01%)
📈 view plot
🚷 view threshold
1,074.00
(0.00%)Baseline: 1,074.00
1,084.74
(99.01%)
tests/benchmarks/test_queue_push_pop.py::test_queue_push_benchmark_compile📈 view plot
🚷 view threshold
10.91 x 1e3
(0.00%)Baseline: 10.91 x 1e3
11.02 x 1e3
(99.01%)
📈 view plot
🚷 view threshold
308.00
(0.00%)Baseline: 308.00
311.08
(99.01%)
tests/benchmarks/test_queue_push_pop.py::test_queue_push_pop_benchmark_compile📈 view plot
🚷 view threshold
14.84 x 1e3
(0.00%)Baseline: 14.84 x 1e3
14.99 x 1e3
(99.01%)
📈 view plot
🚷 view threshold
435.00
(0.00%)Baseline: 435.00
439.35
(99.01%)
🐰 View full continuous benchmarking report in Bencher

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jun 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.03%. Comparing base (7de7032) to head (6edaabc).

Additional details and impacted files
@@                 Coverage Diff                 @@
##           mk/mutable-structs    #1795   +/-   ##
===================================================
  Coverage               93.02%   93.03%           
===================================================
  Files                     135      135           
  Lines                   13138    13138           
===================================================
+ Hits                    12222    12223    +1     
+ Misses                    916      915    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jun 2, 2026

Merging this PR will not alter performance

✅ 9 untouched benchmarks


Comparing mk/mutable-by-default (6edaabc) with mk/mutable-structs (7de7032)

Open in CodSpeed

Copy link
Copy Markdown
Contributor

@tatiana-s tatiana-s left a comment

Choose a reason for hiding this comment

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

As this is just making the breaking change of removing the copyable check and adding frozen to various existing structs/tests, looks good to me

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