Skip to content

examples: ListOps O-SSM vs H-SSM-8 (dual quaternion) vs diagonal#44

Draft
agourakis82 wants to merge 1 commit intomainfrom
cursor/quaternionic-ssm-88c0
Draft

examples: ListOps O-SSM vs H-SSM-8 (dual quaternion) vs diagonal#44
agourakis82 wants to merge 1 commit intomainfrom
cursor/quaternionic-ssm-88c0

Conversation

@agourakis82
Copy link
Copy Markdown
Contributor

Summary

Implements the planned ListOps ablation in examples/listops_benchmark.sio:

  • O-SSM: recurrence uses octonion multiplication (oct_mul, Fano plane) with per-dim a/b scaling and small residual on the input branch, matching the pattern in ossm_vs_qssm_ablation.sio.
  • H-SSM-8: state is two independent quaternions in ℝ⁸; each step applies the Hamilton product on dims 0–3 and 4–7 with the same a/b/embed layout as O-SSM. The quaternion step is fully unrolled because a version using quat_mul + small loops caused a native codegen segfault (exit 139).
  • Diagonal: h_d = a_d * h_d + b_d * embed_d with the same 8 a/b scalars.

Weight layout (200 reals)

  • 0..103: embed 13×8
  • 104..111: a[8]
  • 112..119: b[8]
  • 120..199: output 8×10

Removes the previous dense 8×8 “cross” linear layer that was labeled O-SSM but was not octonion recurrence.

Test harness

//@ expect-stdout: ALL PASS is preserved; the program no longer asserts that O-SSM must beat diagonal (empirical outcomes vary).

Verification

  • ./bin/souc check examples/listops_benchmark.sio
  • ./bin/souc run examples/listops_benchmark.sio
Open in Web Open in Cursor 

…ion vs diagonal

- Align O-SSM with oct_mul (Fano) + a/b scaling like ossm_vs_qssm_ablation
- H-SSM-8: two independent Hamilton products on dims 0-3 and 4-7 (unrolled; avoids native codegen segfault)
- Shared 200-weight layout: embed 104, a[8], b[8], out 80; remove dense 8x8 cross path
- Main runs all three modes; ALL PASS without requiring O to win

Co-authored-by: Demetrios Chiuratto Agourakis <demetrios@agourakis.med.br>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sounio Ready Ready Preview, Comment Apr 7, 2026 6:25pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants