Skip to content

chore(gpu): unify trait structs, refactor MSM API, fix naming, update docs#3325

Open
pdroalves wants to merge 1 commit intomainfrom
pa/chore/zk-cleanup
Open

chore(gpu): unify trait structs, refactor MSM API, fix naming, update docs#3325
pdroalves wants to merge 1 commit intomainfrom
pa/chore/zk-cleanup

Conversation

@pdroalves
Copy link
Contributor

@pdroalves pdroalves commented Feb 20, 2026

  • Create point_traits.h with canonical Affine<T>, Projective<T>
    definitions, replacing duplicates in curve.cu and common.cuh
    (PointSelector/ProjectiveSelector removed)
  • Standardize associated type name to FieldType (was Field in curve.cu)
  • Add mixed_add() to unified Projective<T> trait
  • Move MSM function declarations from curve.h to msm.h
  • Change MSM scratch buffer type from typed pointer to void* and add
    gpu_memory_allocated parameter, removing internal Montgomery
    conversion from unmanaged wrappers (callers must provide Montgomery
    points)
  • Add pippenger_scratch_size_g1/g2 helpers so callers can query exact
    scratch buffer size instead of computing it externally
  • Use safe_mul_sizeof from checked_arithmetic.h in managed wrappers,
    replacing verbose __builtin_mul_overflow blocks
  • Rename get_msm_threads_per_block -> msm_threads_per_block (int -> uint32_t)
  • Add Montgomery form annotations to Fp operator declarations
  • Update Rust FFI bindings to match new C API signatures
  • Add Display trait doc comments for G1/G2 types noting Montgomery assumption
  • Add NAMING_CONVENTIONS.md with full naming reference
  • Update README.md: project structure, MSM API examples, scratch size
    API, remove dead links

closes: please link all relevant issues

PR content/description

Check-list:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Relevant issues are marked as resolved/closed, related issues are linked in the description
  • Check for breaking changes (including serialization changes) and add them to commit message following the conventional commit specification

@pdroalves pdroalves requested a review from a team as a code owner February 20, 2026 11:34
@cla-bot cla-bot bot added the cla-signed label Feb 20, 2026
@pdroalves pdroalves force-pushed the pa/chore/zk-cleanup branch 4 times, most recently from ad0abb5 to e4f022a Compare February 20, 2026 13:15
… docs

zk-cuda-backend:
- Create point_traits.h with canonical Affine<T>, Projective<T>
  definitions, replacing duplicates in curve.cu and common.cuh
  (PointSelector/ProjectiveSelector removed)
- Standardize associated type name to FieldType (was Field in curve.cu)
- Add mixed_add() to unified Projective<T> trait
- Move MSM function declarations from curve.h to msm.h
- Change MSM scratch buffer type from typed pointer to void* and add
  gpu_memory_allocated parameter, removing internal Montgomery
  conversion from unmanaged wrappers (callers must provide Montgomery
  points)
- Add pippenger_scratch_size_g1/g2 helpers so callers can query exact
  scratch buffer size instead of computing it externally
- Use safe_mul_sizeof from checked_arithmetic.h in managed wrappers,
  replacing verbose __builtin_mul_overflow blocks
- Rename get_msm_threads_per_block -> msm_threads_per_block (int -> uint32_t)
- Add Montgomery form annotations to Fp operator declarations
- Update Rust FFI bindings to match new C API signatures
- Add Display trait doc comments for G1/G2 types noting Montgomery assumption
- Add NAMING_CONVENTIONS.md with full naming reference
- Update README.md: project structure, MSM API examples, scratch size
  API, remove dead links
@pdroalves pdroalves changed the title feat(gpu): update zk-cuda-backend MSM and curve APIs chore(gpu): unify trait structs, refactor MSM API, fix naming, update docs Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments