Conversation
fe0cd7d to
4375784
Compare
e7e3fcf to
2a00167
Compare
4375784 to
0eb3312
Compare
Adds the %int2 (signed two's-complement) element-wise comparison (gth/gte/lth/lte) and reduction (cumsum/dot/min/max/argmin/argmax) array jets, on top of the twoc scalar jets, rebased onto #1057. - The %int2 cases slot into #1057's rewritten comparison and reduction wrappers; the dot case is added to #1057's restructured +dot wrapper (its unifying-equality-safe field reads made the auto-merge miss it). - All the new _la_int2_* helpers and the wrapper int2 results are typed u3_weak (they decline with u3_none); _la_int2_box, which transfers its r_data into the boxed ray, is annotated `@Refcount: transfers `r_data`` so the reduction wrappers do not read as leaking it (refcount linter, #1059). - The reduction result shape is the all-ones-of-rank +scalar-to-ray box, matching #1057's i754 _ones_shape; #1048's separate i754 reduction- shape fix is already carried by #1057, so only the %int2 additions land here. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rqqco86RgnvtiC4axw8Px3
2a00167 to
ead7273
Compare
|
Rebased onto #1047 (base retargeted to #1048's separate i754 reduction-shape fix is dropped — #1057 already boxes those with the all-ones-of-rank +scalar-to-ray shape ( Verification: builds clean at both loom widths (-Werror); linter reports 0 findings on lagoon.c (strict-weak). lagoon-int2 (5 arms: modular wrap, signed div/rem, abs, comparison convention, cumsum) and twoc (13 arms) run green jetted for both binaries. Merge order: #1057, then #1047, then this. |
Stacked on #1047. Hoon/master side: urbit/numerics#67.
Extends the Lagoon array jets with
%int2cases beside%i754for the comparison and reduction ops (no GEMM):gth/gte/lth/lte— per-lane signed (two's-complement) compare → 1/0 ray.cumsum— full wrapping sum → scalar ray.dot— sum of products (wrapping) → scalar ray.min/max— extremum by two's-complement order → scalar ray.argmin/argmax— forward ravel-index of the first extremum (bare index).Native per lane (8…128-bit, no GMP); signed compares reinterpret the lane as the matching signed C type. Scalar reductions box via a
_la_scalar_boxhelper =+scalar-to-ray's shape (all-1s of the input rank).Also fixes the i754 reduction-jet result shape (carries urbit/numerics#68 into the runtime):
cumsum/min/max/dotshared the same_la_scalar_boxhelper, replacing the prior hardcoded~[1 1]/~[len 1]/~[1]that only matched one rank — a silent jet/Hoon mismatch on the boxed meta.trace(always rank-2) anddiag(returns a vector) are correct as-is.Verified jet == numerics Hoon on a hoon-135 fakezod across native widths incl. 128-bit, ties, and negatives — for both
%int2and (now)%i754reductions.🤖 Generated with Claude Code