Skip to content

lagoon: %int2 comparison + reduction array jets#69

Merged
sigilante merged 1 commit into
mainfrom
sigilante/twoc-int2-cmp-reduce
Jun 29, 2026
Merged

lagoon: %int2 comparison + reduction array jets#69
sigilante merged 1 commit into
mainfrom
sigilante/twoc-int2-cmp-reduce

Conversation

@sigilante

Copy link
Copy Markdown
Collaborator

(Re-opened against main — the original #67 was auto-closed when its stacked base branch was deleted on #66's merge.)

Extends the Lagoon %int2 array jets with the comparison and reduction ops (no GEMM). Runtime counterpart: urbit/vere#1048.

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

Native per lane (8…128-bit, no GMP). Scalar reductions reuse the _la_scalar_box helper from #68 (all-1s of input rank, per +scalar-to-ray), so %int2 and %i754 reductions share one boxing helper — no duplication.

Verified jet == %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.  Reuses the _la_scalar_box helper added by #68 (forward-index
argmin/argmax and the rank-correct scalar shape), so int2 and i754 reductions
share one boxing helper.  Verified jet == %int2 Hoon on a hoon-135 fakezod.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sigilante
sigilante merged commit b5312ce into main Jun 29, 2026
@sigilante
sigilante deleted the sigilante/twoc-int2-cmp-reduce branch June 29, 2026 16:01
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