SSMT – Tier S1 Validation: Proving the Math Holds Before Touching Real Data (5.0–5.3)

Before any field rollout, the math, the guards, and the outputs must hold under replay.

Purpose.
Tier S1 is the foundation of trust in Shunyaya Symbolic Mathematical Temperature (SSMT). Tier S1 says: even with zero real-world data, the encoding rules, clamps, dials, guards, and pooling math are internally consistent, bounded, monotone, and auditable. Tier S1 is designed for reproducible testing, continuous integration, and compliance review.

Tier S1 does three things:

  1. Confirms that symbolic temperature (e_T) is stable and monotone for every allowed lens.
  2. Confirms that safety dials (a_T, a_phase, fused phase, hysteresis Q_phase) stay bounded and behave as advertised.
  3. Confirms that supporting machinery (clamps, pooling, validity flags, domain guards) responds the right way to edge cases and unsafe input.

No field dataset is required. This can run in isolation on a laptop, in firmware CI, or in a verification pipeline.


5.1 Coverage (no data required)

Unit standardization.
Every numeric path starts the same way: convert to Kelvin, apply a floor for numerical safety, and never pretend negative Kelvin is valid.

T_K := max(T_K, eps_TK)

This removes °C/°F confusion up front and pins the physical baseline in a standard frame.

Lenses.
Each approved lens generates e_T such that:

  • e_T = 0 exactly at the declared reference T_ref.
  • e_T is monotone in T_K (hotter reads as “more positive,” colder reads as “more negative,” or vice versa in the cold-emphasis lens).
  • The math handles local vs wide-span regimes (linear, log, beta, hybrid, kBT, qlog) without redefining policy every time.

Hybrid and qlog are deterministic:

  • Hybrid: linear for small excursions, log for wide excursions.
  • qlog: avoids log(0) near extremely low Kelvin but still forces e_T = 0 at T_ref.

Domain guards.
Each lens declares what physical ranges are allowed:

  • log / beta require T_K > 0 and T_ref > 0.
  • linear requires DeltaT > 0.
  • kBT requires E_unit > 0.
  • hybrid requires tau > 0.
  • qlog requires T_ref > 0 and alpha > 0.

If those constraints are not met, the system must refuse configuration or mark the sample unhealthy. This prevents “undefined math” from sneaking into production.

Alignment bounds.
Alignment dials such as a_T live in (-1,+1) by design:

a_T := tanh(c_T * e_T)
a_T := clamp_a(a_T, eps_a)  # enforce |a_T| <= 1 - eps_a

This keeps downstream logic from being dominated by one absurd spike.

Phase dial.
a_phase encodes “which side of a critical pivot are we on, and how deep” in a bounded, signed dial. The fused multi-pivot variant a_phase_fused combines multiple survival pivots (for example freeze vs warp) into one bounded signal in (-1,+1).

Soft hysteresis.
Q_phase holds memory so alerts only escalate if danger is persistent, not if the reading jitters for a few seconds:

Q_phase := rho * Q_prev + (1 - rho) * clip(p_side, 0, 1)

with 0 < rho < 1. This lowers flicker without hiding risk.

Validity handling.
If a reading is physically out of the declared safe range, SSMT requires explicit flags:

  • health.range_ok = false
  • oor = "below_min" or "above_max"
    Computation continues in a saturated form (clamped within T_valid_range_K) so downstream math doesn’t explode, but the record shows the violation.

Pooling.
When multiple sensors need to become one fleet dial, SSMT uses rapidity pooling:

U      := sum_i ( w_i * atanh(a_i) )
W      := max( sum_i w_i , eps_w )
a_pool := tanh( U / W )

This is associative, bounded, and replayable. You can regroup sensors arbitrarily and get the same result.


5.2 Test vectors (copy-paste, minimal)

These test vectors are the contract. Any implementation of SSMT should be able to run these cases and match the expected behavior within small tolerances.

A) Unit invariance (to-K and lens)
Same physics, different unit inputs → identical e_T.

Case A1.
lens = log
T_ref = 298.15 K
Inputs: 35 C, 95 F, 308.15 K
Expect: all yield e_T = ln(308.15/298.15) ≈ 0.03298996  (tol 1e-6)

Case A2 (Kelvin floor).
to_kelvin(-273.16, "C") -> T_K = eps_TK   # floor applied

B) Lens zero and monotonicity

Case B1.
Any lens: T_K = T_ref  ⇒ e_T = 0.

Case B2.
T1 = 290 K < T2 = 300 K ⇒ e_T(T2) > e_T(T1).

C) Lens domain guards

Case C1 (log/beta).
T_K <= 0 or T_ref <= 0 ⇒ health.sensor_ok = false.

Case C2 (linear).
DeltaT <= 0 ⇒ reject config at init.

Case C3 (kBT).
E_unit <= 0 ⇒ reject config at init.

Case C4 (hybrid).
tau <= 0 ⇒ reject config at init.

Case C5 (qlog).
T_ref <= 0 or alpha <= 0 ⇒ reject config at init.

D) Alignment/channel clamps
Very large excursions in e_T must still produce a bounded a_T:

Given c_T = 0.7, eps_a = 1e-6.

Case D1.
e_T = +1000
a_T = tanh(0.7*1000) -> clamp to < +1 by eps_a.

Case D2.
e_T = -1000
a_T = tanh(-0.7*1000) -> clamp to > -1 by eps_a.

E) Phase dial sign and symmetry
Correct behavior around a critical pivot T_m:

Given:
T_m = 273.15
DeltaT_m = 2.0
c_m = 1.2
eps_a = 1e-6

Case E1.
T = 271.15 K
d_m = -1.0
a_phase ≈ -0.83365461

Case E2.
T = 275.15 K
d_m = +1.0
a_phase ≈ +0.83365461

Case E3.
T = 273.15 K
d_m = 0.0
a_phase = 0

Fused multi-pivot symmetry:

Case E4.
Let P1 = {T_m=273.15, DeltaT_m=2.0, c_m=1.2}
    P2 = {T_m=373.15, DeltaT_m=2.0, c_m=1.2}

At T = (273.15 + 373.15)/2 = 323.15 K:
standardized distances are +25 and -25 (equal and opposite)
⇒ a_phase_fused = tanh(0) = 0.

F) Soft hysteresis evolution
Q_phase should build and decay smoothly, not oscillate wildly:

rho = 0.90
k_side = 2.0
start Q_prev = 0.30
Sequence of sides s = [+1,+1,+1,+1,+1,-1,-1,-1,+1,+1]
Expect:
Q_phase increases on warm steps,
decays on cold,
never overshoots or flickers chaotically.

G) Validity and saturation
If a sensor reports beyond the declared safe range, you must surface that:

T_valid_range_K = [180, 500]

Case G1.
T_K = 170
health.range_ok = false
oor = "below_min"
compute with T_K_eff = 180 for math safety

Case G2.
T_K = 510
health.range_ok = false
oor = "above_max"

H) Pooling safety (if pooling is enabled)

Given:
a = [0.2, 0.4, -0.1]
w = [1,   1,    1]

a_pool = tanh( mean(atanh(a_i)) )

Checks:
• Associativity: regrouping sensors gives the same a_pool.
• Bounds: |a_pool| < 1 always.

I) Hybrid branch selection (deterministic)

Config:
lens   = hybrid
T_ref  = 300 K
DeltaT = 10 K
tau    = 5 K

Case I1 (linear branch).
T = 302 K
|delta| = 2 K <= tau
e_T = (302 - 300)/10 = 0.2

Case I2 (log branch).
T = 310 K
|delta| = 10 K > tau
e_T = ln(310/300) ≈ 0.032789

J) qlog zero and monotonicity

Config:
lens  = qlog
T_ref = 298.15 K
alpha = 1.0

Case J1.
T = T_ref
e_T = ln((1 + alpha)/(1 + alpha)) = 0

Case J2.
T1 = 295 K
T2 = 305 K
e_T(T2) > e_T(T1)

These vectors define “correct.” If your implementation fails here, it is not SSMT.


5.3 Runnable harness (ASCII pseudo-code)

This harness is intentionally boring. It encodes nothing but physics sanity, boundedness, determinism, and replayability. Any compliant implementation should execute a variant of this and pass.

tol_abs  = 1e-6
tol_pool = 1e-12
R        = 8.314462618
eps_TK   = 1e-6

# To Kelvin + floor
assert to_kelvin(35, "C")           == 308.15
assert abs(to_kelvin(95, "F")-308.15) < tol_abs
assert to_kelvin(308.15, "K")      == 308.15
assert to_kelvin(-273.16, "C")     == eps_TK  # floor applied

# Lens core (zero and monotone)
assert abs( ln(298.15/298.15) - 0.0 ) < tol_abs
assert ( (300 - 298.15) / 10.0 ) > ( (290 - 298.15) / 10.0 )

# Hybrid branch selection
T_ref   = 300.0
DeltaT  = 10.0
tau     = 5.0
assert abs( encode_eT(302.0, lens="hybrid", T_ref=T_ref, DeltaT=DeltaT, tau=tau)
            - 0.2 ) < tol_abs
assert abs( encode_eT(310.0, lens="hybrid", T_ref=T_ref, DeltaT=DeltaT, tau=tau)
            - ln(310.0/300.0) ) < tol_abs

# qlog zero and monotone
alpha   = 1.0
T_ref   = 298.15
assert abs( encode_eT(T_ref, lens="qlog", T_ref=T_ref, alpha=alpha) - 0.0 ) < tol_abs
assert encode_eT(305.0, lens="qlog", T_ref=T_ref, alpha=alpha) > \
       encode_eT(295.0, lens="qlog", T_ref=T_ref, alpha=alpha)

# Domain guards
assert invalid_log   (T_K=0.0,  T_ref=298.15)
assert invalid_beta  (T_ref=0.0, T_K=298.15)
assert invalid_linear(DeltaT=0.0)
assert invalid_kBT   (E_unit=0.0)
assert invalid_hybrid(tau=0.0)
assert invalid_qlog  (T_ref=0.0, alpha=1.0) or \
       invalid_qlog  (T_ref=298.15, alpha=0.0)

# Alignment clamps
a_hi = clamp_a( tanh(0.7*1000), 1e-6 )
a_lo = clamp_a( tanh(-0.7*1000), 1e-6 )
assert a_hi <=  1 - 1e-6
assert a_lo >= -1 + 1e-6

# Phase dial
a1 = clamp_a( tanh(1.2 * ((271.15 - 273.15)/2)), 1e-6 )
a2 = clamp_a( tanh(1.2 * ((275.15 - 273.15)/2)), 1e-6 )
assert abs(a1 + 0.83365461) < tol_abs
assert abs(a2 - 0.83365461) < tol_abs

# Fused multi-pivot (symmetry case)
a_fused = tanh( 1.2*((323.15 - 273.15)/2) + 1.2*((323.15 - 373.15)/2) )
assert abs(a_fused - 0.0) < tol_abs

# Soft hysteresis (shape check)
Q = 0.30
for s in [+1,+1,+1,+1,+1,-1,-1,-1,+1,+1]:
    p_side = 0.5 * (1 + tanh(2.0 * s))
    Q      = 0.90*Q + 0.10*clip(p_side, 0, 1)
assert 0.0 <= Q <= 1.0

# Validity
range_ok, oor, e_T_eff = validity_encode(T_K=170,
                                         T_min=180,
                                         T_max=500,
                                         ...)
assert (range_ok == False) and (oor == "below_min")

# Pooling (associativity and bounds)
a_pool_1 = pool([0.2, 0.4], [1, 1])
a_pool_2 = pool([a_pool_1, -0.1], [2, 1])                   # regrouped
a_pool_3 = pool([0.2, pool([0.4, -0.1],[1,1])], [1, 2])     # regrouped
assert abs(a_pool_2 - a_pool_3) < tol_pool
assert abs(a_pool_2) < 1

This harness is how engineering leadership, safety, and audit agree: “Yes, this symbolic layer is numerically sane, bounded, monotone, replayable, and enforceable.”


Navigation
Previous: SSMT – ML Hygiene, Sensor Fault Detection, and Fleet Snapshot Testing (4.9–4.11)
Next: SSMT – CI, Compliance, and Upgrade Safety (5.4–5.5)


Directory of Pages
SSMT – Table of Contents