Shunyaya Symbolic Mathematical Hardware – Interop: SSMS Ports, Stamp & Domain Patterns (10.1–10.3)

10.1 — SSMS as the connector contract
Verb → port mapping (canonical). s_sum, s_add, s_sub, s_mul, s_div, s_pow, s_unary, s_gt, s_eq, s_gate.
Contract. Each port consumes/emits pairs x := (m, a); collapse parity holds (phi((m,a)) = m); clamp discipline is mandatory; streaming ports use the {U,W} rule by default.
Semantics recap (lane only).
a_mul := tanh(atanh(clamp(a1,eps_a)) + atanh(clamp(a2,eps_a)))
a_div := tanh(atanh(clamp(a_f,eps_a)) - atanh(clamp(a_g,eps_a)))
U += w*atanh(clamp(a,eps_a)); W += w; a_out := tanh(U/max(W,eps_w))
Alignment-only gate. a_env := clamp(g_t * a_op, -1+eps_a, +1-eps_a) with m untouched.

Adapter sketch (SSMS to SSMH API)

# x := (m, a); phi((m,a)) = m
def s_mul(x1, x2):
    m = x1.m * x2.m
    a = a_mul(x1.a, x2.a)  # lane-only M2 compose
    return (m, a)

def s_div(xf, xg, policy="strict"):
    m = div_policy(xf.m, xg.m, policy)   # value-lane policy only
    a = a_div(xf.a, xg.a)
    return (m, a)

def s_sum(xs, ws):
    U = sum(w * atanh(clamp(a, EPS_A)) for (_, a), w in zip(xs, ws))
    W = sum(ws)
    m_sum = sum(m for (m, _) in xs)
    return (m_sum, tanh(U / max(W, EPS_W)))

10.2 — Logging and integrity with SSM-Clock Stamp
What to log. For each KPI: (time, kpi_name, m, a, band, knobs_hash, build_id, site_id, unit_id, note).
Daily anchor. Append one ASCII manifest+checksum line per day; never mutate historical rows.
Ordering. Stamp each bundle (e.g., per-hour CSV or Parquet) with a bundle hash; link daily anchors in an append-only list.
Separate economics. Track any stamp-related savings in a distinct ledger from lane-driven savings.

Stamp emitter (pseudocode)

bundle_hash   = SHA256(file_bytes)
manifest_hash = SHA256(manifest_text)
anchor_line   = f"SSMCLOCK day=YYYY-MM-DD bundle_sha256={bundle_hash} manifest_sha256={manifest_hash}"
append_to("anchors.log", anchor_line)

10.3 — Pattern library for domains (drop-in)
Ratios near zero. Compute a_div; keep value visible; band alerts by a_div.
Hook example: raise WARN if value > threshold and band in {A-,A--}; else INFO.
Fusion outputs. Maintain {U,W}; publish a_out next to fused value. Order-invariance guarantees batch == stream == shuffled.
Observers/controllers. Shape non-critical gains and smoothing by bands; actuators remain keyed to m until a safety case exists.

Examples

# Telecom KPI (ratio near zero)
value = errors / traffic                        # classical value
a_div  = tanh(atanh(clamp(a_errors,EPS_A)) - atanh(clamp(a_traffic,EPS_A)))
tier   = band(a_div)                            # tiers; do not hide value

# Fusion for state estimator (ROS-like)
U += w_cam*atanh(clamp(a_cam,EPS_A));  W += w_cam
U += w_imu*atanh(clamp(a_imu,EPS_A));  W += w_imu
a_out = tanh(U / max(W, EPS_W))
publish({"m": estimator_value, "a": a_out})


Navigation
Back: Shunyaya Symbolic Mathematical Hardware – Software Reference: I/O & Gotchas (9.10–9.11)
Next: Shunyaya Symbolic Mathematical Hardware – Interop: Adapters, Transport & Timekeeping (10.4–10.6)


Directory of Pages
SSMH – Table of Contents