Skip to content

Complete the @c family: @ch (half) and @cq (quad) complex, end to end#50

Merged
sigilante merged 1 commit into
mainfrom
sigilante/complex-ch-cq
Jun 8, 2026
Merged

Complete the @c family: @ch (half) and @cq (quad) complex, end to end#50
sigilante merged 1 commit into
mainfrom
sigilante/complex-ch-cq

Conversation

@sigilante
Copy link
Copy Markdown
Collaborator

Summary

Fills the two unimplemented slots in the @c aura family — @ch (half) and @cq (quad) — reserved in /lib/complex's header but never built. Now implemented end to end across all three layers, so the family is @ch / @cs / @cd / @cq everywhere.

layer change
/lib/complex new ch (2×@rh, 16-bit components → 32-bit element) and cq (2×@rq, 128-bit → 256-bit) doors — verbatim analogues of cs/cd over the rh/rq float doors — with full per-arm doccords and complete test coverage (all 14 public arms). Every example/test value captured from the ship.
Lagoon %cplx wired bloq 5 (ch) / 8 (cq) into eye/ones/fun-scalar/trans-scalar (previously 6/7 only). Element-wise add/sub/mul/div/abs/conj/equ/neq now work at all four widths; lagoon-cplx gains ch/cq cases.
Saloon eig cb-comp collapses to (dec cb); the scalar-float helpers (faddfeps, fsqt) cover component bloq 4–7 (rh/rs/rd/rq) and the complex helpers cover bloq 5–8 (ch/cs/cd/cq). eig-herm accepts %cplx 5–8 and symmetric eig accepts %i754 4–7.

Eigendecomposition now runs at half through quad precision. New saloon-eigh-cc test verifies the analytic case [[2,i],[−i,2]] → {1,3} at @ch and @cq (NumPy can't emit true IEEE binary128, so the precision-independent case is used).

Tests (all green on ~hex)

  • /tests/lib/complex: 16 cases — cs/cd/ch/cq × components/arith/unary/compare.
  • /tests/lib/lagoon-cplx: +test-cplx-ch, +test-cplx-cq.
  • /tests/lib/saloon-eigh-cc: half + quad Hermitian eig. Existing cs/cd eig unchanged.

Depends on the merged doccord PR #49 (which established the cd doccord/test template these ch/cq doors follow).

🤖 Generated with Claude Code

Fills the two unimplemented slots in the @c aura family across all three layers.

/lib/complex: add the ch (2x@rh, 16-bit components) and cq (2x@rq, 128-bit
components) doors -- verbatim analogues of cs/cd over the rh/rq float doors --
with full per-arm doccords and complete test coverage (re/im/pak/zero/one/add/
sub/neg/conj/mul/div/abs/equ/neq).  All example/test values captured from the
ship.

Lagoon %cplx: wire bloq 5 (ch) and bloq 8 (cq) into the eye/ones one-value and
the fun-scalar/trans-scalar dispatches (which previously handled only 6/7).
Element-wise add/sub/mul/div/abs/conj/equ/neq now work for all four widths;
lagoon-cplx tests gain ch/cq cases.

Saloon eig: generalize the component dispatch.  cb-comp is now just (dec cb);
the scalar float helpers (fadd..feps, fsqt) cover component bloq 4/5/6/7
(rh/rs/rd/rq) and the complex helpers cover complex bloq 5/6/7/8 (ch/cs/cd/cq).
+eig-herm accepts %cplx bloq 5-8 and symmetric +eig accepts %i754 bloq 4-7, so
eigendecomposition now runs at half through quad precision.  New
saloon-eigh-cc test verifies [[2,i],[-i,2]] -> {1,3} at @ch and @cq.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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