Skip to content

Conversation

@stemlaud
Copy link

@stemlaud stemlaud commented Sep 25, 2025

Description

Go 1.21 adds built-in functions min and max. https://tip.golang.org/doc/go1.21
Therefore, we can directly remove our own implementations and use the built-in function with the same names.

Fixes # (issue)

Type of change

  • New feature (non-breaking change which adds functionality)

How has this been tested?

  • Test A
  • Test B

How has this been benchmarked?

  • Benchmark A, on Macbook pro M1, 32GB RAM
  • Benchmark B, on x86 Intel xxx, 16GB RAM

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I did not modify files generated from templates
  • golangci-lint does not output errors locally
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Note

Replaces x/exp slices/constraints with stdlib slices/cmp, removes a local min helper and the x/exp dependency, and adds an empty-terms guard plus slices.Max in multivariate quotient sizing.

  • Dependencies:
    • Remove golang.org/x/exp from go.mod and purge related entries from go.sum.
  • Stdlib adoption:
    • Replace golang.org/x/exp/slices with standard slices in std/fiat-shamir/transcript.go and std/recursion/wrapped_hash.go.
    • Replace golang.org/x/exp/constraints with standard cmp and update generic bounds in std/math/emulated/field.go.
  • Compression utilities:
    • Remove local min helper from std/compress/io.go.
  • Emulated field arithmetic:
    • In std/math/emulated/field_mul.go:
      • Add early return when mv.Terms is empty in polyMvEvalQuoSize.
      • Use slices.Max for quoSize computation.

Written by Cursor Bugbot for commit fe63ab8. This will update automatically on new commits. Configure here.

Signed-off-by: stemlaud <stemlaud@outlook.com>
@ivokub ivokub added feat: gkr PRs related to GKR src: community Community originating PRs and issues labels Sep 25, 2025
@stemlaud
Copy link
Author

@ivokub Hi, Could you please review this PR at your convenience? Thank you very much.

@ivokub
Copy link
Collaborator

ivokub commented Oct 13, 2025

@ivokub Hi, Could you please review this PR at your convenience? Thank you very much.

Thanks for the contribution. Seems to be a small change. We will merge small community PRs into a single commit to be merged to gnark master before next release to simplify review, CI and development workflow.

@ivokub ivokub changed the base branch from master to typo/fixes-v15 November 11, 2025 00:25
Copy link
Collaborator

@ivokub ivokub left a comment

Choose a reason for hiding this comment

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

Looks good. I also updated other places where we can use builtin functions.

@ivokub ivokub merged commit a1edc8d into Consensys:typo/fixes-v15 Nov 11, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: gkr PRs related to GKR src: community Community originating PRs and issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants