Skip to content

feat: Add empty_array helper to create an array with all elements borrowed - #2327

Open
hsemenenko wants to merge 3 commits into
mainfrom
hs/feat/create-array-all-taken
Open

hsemenenko wants to merge 3 commits into
mainfrom
hs/feat/create-array-all-taken

Conversation

@hsemenenko

Copy link
Copy Markdown
Contributor

This PR adds a helper method to expose the new_all_borrowed op to create an array where all elements have been borrowed.

This is useful for array manipulation, for example combining two existing arrays without resorting to using array[Option[T], N] types.

@hsemenenko
hsemenenko requested a review from a team as a code owner September 14, 2026 10:50
@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectguppylang
Branchhs/feat/create-array-all-taken
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
62.10 x 1e3
(0.00%)Baseline: 62.10 x 1e3
62.72 x 1e3
(99.01%)
📈 view plot
🚷 view threshold
4,585.00
(0.00%)Baseline: 4,585.00
4,630.85
(99.01%)
tests/benchmarks/test_ctrl_flow.py::test_many_ctrl_flow_compile📈 view plot
🚷 view threshold
27.76 x 1e3
(0.00%)Baseline: 27.76 x 1e3
28.03 x 1e3
(99.01%)
📈 view plot
🚷 view threshold
1,301.00
(0.00%)Baseline: 1,301.00
1,314.01
(99.01%)
tests/benchmarks/test_queue_push_pop.py::test_queue_push_benchmark_compile📈 view plot
🚷 view threshold
7.24 x 1e3
(0.00%)Baseline: 7.24 x 1e3
7.32 x 1e3
(99.01%)
📈 view plot
🚷 view threshold
310.00
(0.00%)Baseline: 310.00
313.10
(99.01%)
tests/benchmarks/test_queue_push_pop.py::test_queue_push_pop_benchmark_compile📈 view plot
🚷 view threshold
9.86 x 1e3
(0.00%)Baseline: 9.86 x 1e3
9.96 x 1e3
(99.01%)
📈 view plot
🚷 view threshold
411.00
(0.00%)Baseline: 411.00
415.11
(99.01%)
🐰 View full continuous benchmarking report in Bencher

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.40%. Comparing base (58ad84b) to head (f74226f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2327      +/-   ##
==========================================
+ Coverage   93.38%   93.40%   +0.02%     
==========================================
  Files         165      165              
  Lines       16248    16253       +5     
==========================================
+ Hits        15173    15181       +8     
+ Misses       1075     1072       -3     

☔ View full report in Codecov by Harness.
📢 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

codspeed Bot commented Sep 14, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 11 untouched benchmarks


Comparing hs/feat/create-array-all-taken (f74226f) with main (58ad84b)

Open in CodSpeed

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.

2 participants