Skip to content

lagoon: %int2 comparison + reduction array jets#67

Closed
sigilante wants to merge 1 commit into
sigilante/twoc-jetsfrom
sigilante/twoc-int2-cmp-reduce
Closed

lagoon: %int2 comparison + reduction array jets#67
sigilante wants to merge 1 commit into
sigilante/twoc-jetsfrom
sigilante/twoc-int2-cmp-reduce

Conversation

@sigilante

Copy link
Copy Markdown
Collaborator

Stacked on #66. Extends the Lagoon %int2 array jets with the comparison and reduction ops (no GEMM). Runtime counterpart: urbit/vere (linked in a comment).

Adds %int2 cases beside %i754 for:

  • Comparisons gth/gte/lth/lte — per-lane signed (two's-complement) compare → 1/0 ray.
  • Reductions cumsum (full wrapping sum), dot (sum of products, wrapping), min/max (extremum by two's-complement order), argmin/argmax (forward ravel-index of the first extremum).

Native per lane (8…128-bit, no GMP). Signed compares reinterpret the lane as the matching signed C type (native signed compare is two's-complement order). Scalar reductions box via +scalar-to-ray's shape (all-1s of the input rank); argmin/argmax return the bare index.

Verified jet == numerics %int2 Hoon on a hoon-135 fakezod across native widths incl. 128-bit, ties, and negatives.

🤖 Generated with Claude Code

Mirror the vere change (urbit/vere): Lagoon %int2 cases for gth/gte/lth/lte,
cumsum, dot, min/max, argmin/argmax -- native per-lane two's-complement, signed
compares via the matching signed C type, scalar reductions boxed per
+scalar-to-ray.  Verified jet == %int2 Hoon on a hoon-135 fakezod.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sigilante

Copy link
Copy Markdown
Collaborator Author

Runtime counterpart: urbit/vere#1048

@sigilante

Copy link
Copy Markdown
Collaborator Author

Superseded by #69 (re-opened against main; GitHub auto-closed this when the stacked base branch was deleted on #66's merge).

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.

1 participant