Skip to content

fix: Use froundeven for lowering float roundings - #2286

Merged
maximilianruesch merged 9 commits into
mainfrom
mr/fix/froundeven
Sep 7, 2026
Merged

fix: Use froundeven for lowering float roundings#2286
maximilianruesch merged 9 commits into
mainfrom
mr/fix/froundeven

Conversation

@maximilianruesch

Copy link
Copy Markdown
Collaborator

Ensures that we use tie-to-even instead of tie-away-from-zero, for more consistency with Pythons round.

@maximilianruesch
maximilianruesch marked this pull request as ready for review September 7, 2026 13:52
@maximilianruesch
maximilianruesch requested a review from a team as a code owner September 7, 2026 13:52
@maximilianruesch maximilianruesch added the B-backport-nominated A PR (or an issue pending a PR) that is nominated for backporting to the previous minor series. label Sep 7, 2026
@maximilianruesch

Copy link
Copy Markdown
Collaborator Author

This should be backported to v1.0.X as well, if we can do it (considering dependency constraints)

@maximilianruesch
maximilianruesch requested review from aborgna-q and removed request for acl-cqc September 7, 2026 13:53
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectguppylang
Branchmr/fix/froundeven
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.80 x 1e3
(0.00%)Baseline: 27.80 x 1e3
28.08 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

@maximilianruesch maximilianruesch added this to the guppylang v1.1 milestone Sep 7, 2026
@codecov-commenter

codecov-commenter commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.23%. Comparing base (a46555e) to head (37834a6).

Files with missing lines Patch % Lines
guppylang/src/guppylang/std/num.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                      @@
##           mr/perf/upgrade-toolchain    #2286      +/-   ##
=============================================================
- Coverage                      93.23%   93.23%   -0.01%     
=============================================================
  Files                            162      162              
  Lines                          15824    15828       +4     
=============================================================
+ Hits                           14754    14757       +3     
- Misses                          1070     1071       +1     

☔ 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-hq

codspeed-hq Bot commented Sep 7, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 40.31%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 2 improved benchmarks
✅ 9 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
test_queue_push_pop_benchmark 4.4 s 3.1 s +40.93%
test_queue_push_benchmark 3.4 s 2.4 s +39.69%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing mr/fix/froundeven (37834a6) with main (3560b6e)

Open in CodSpeed

@maximilianruesch maximilianruesch changed the title fix: Use froundeven instead of fround for implementing float rounding fix: Upgrade to latest toolchain and use froundeven for lowering float roundings Sep 7, 2026
Comment thread guppylang/pyproject.toml
"guppylang-internals==1.0.1",
"numpy>=2.2.6,<3",
"selene-hugr-qis-compiler~=0.4.2",
"selene-hugr-qis-compiler~=0.4.3",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is fine for backporting, but for guppy 1.1 we should bump it to qis-compiler 0.5

@maximilianruesch maximilianruesch Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, that upgrade will be done separately. I have now pulled out the actual dependency upgrades in #2284, so that this PR does not have a perf improvement attached that it should not have.

@maximilianruesch maximilianruesch changed the title fix: Upgrade to latest toolchain and use froundeven for lowering float roundings fix: Use froundeven for lowering float roundings Sep 7, 2026
@maximilianruesch
maximilianruesch changed the base branch from main to mr/perf/upgrade-toolchain September 7, 2026 15:39
@maximilianruesch
maximilianruesch added this pull request to the merge queue Sep 7, 2026
Base automatically changed from mr/perf/upgrade-toolchain to main September 7, 2026 16:02
Merged via the queue into main with commit ed6be7b Sep 7, 2026
14 checks passed
@maximilianruesch
maximilianruesch deleted the mr/fix/froundeven branch September 7, 2026 16:06
@maximilianruesch maximilianruesch added B-backport-accepted A PR (or issue pending a PR) that has been accepted for backporting to the previous minor series. and removed B-backport-nominated A PR (or an issue pending a PR) that is nominated for backporting to the previous minor series. labels Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-backport-accepted A PR (or issue pending a PR) that has been accepted for backporting to the previous minor series.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants