Some benchmarks from a library im working on

50 views
Skip to first unread message

Keshava Grama

unread,
Feb 18, 2026, 12:49:54 PM (7 days ago) Feb 18
to Unum Computing
Alu only for now
══════════════════════════════════════════════════════════════════════╗
║              Encode/Decode SNR (f64 → SBP → f64)                     ║
╚══════════════════════════════════════════════════════════════════════╝

  Format │ Range            │  Samples │  Mean dB │   Min dB │  Exact
─────────┼──────────────────┼──────────┼──────────┼──────────┼────────
  SBP8   │ In-range         │    10000 │     38.2 │      0.0 │      0
  SBP8   │ Negative         │    10000 │     38.2 │      0.0 │      0
  SBP16  │ In-range         │    10000 │     74.1 │     65.4 │      0
  SBP16  │ Negative         │    10000 │     74.1 │     65.4 │      0
  SBP16  │ Near-unity       │    10000 │     74.1 │     65.4 │      1
  SBP32  │ In-range         │    10000 │    122.3 │    113.6 │      0
  SBP32  │ Negative         │    10000 │    122.3 │    113.6 │      0
  SBP32  │ Near-unity       │    10000 │    122.3 │    113.6 │      1
  SBP64  │ In-range         │    10000 │    218.6 │    209.9 │      0
  SBP64  │ Negative         │    10000 │    218.6 │    209.9 │      0
─────────┴──────────────────┴──────────┴──────────┴──────────┴────────

╔══════════════════════════════════════════════════════════════╗
║           Operations SNR Sweep (ADD, SUB, MUL, DIV)          ║
╚══════════════════════════════════════════════════════════════╝

SBP8 (4+4 bits, ~1.2 decades: 0.3 to 3.0)
  Op   │  Mean dB │   Min dB │   Max dB │  Samples
───────┼──────────┼──────────┼──────────┼──────────
  ADD  │     28.9 │      6.2 │    118.7 │      844
  SUB  │     24.8 │     -3.5 │    105.7 │      734
  MUL  │     43.5 │      3.7 │     78.5 │      552
  DIV  │     37.6 │      4.0 │     66.2 │      550

SBP16 (8+8 bits, 15 decades: 1e-7 to 1e7)
  Op   │  Mean dB │   Min dB │   Max dB │  Samples
───────┼──────────┼──────────┼──────────┼──────────
  ADD  │     79.4 │     60.3 │    264.0 │     1224
  SUB  │     78.9 │     60.1 │    244.2 │     1224
  MUL  │    103.9 │     61.3 │    319.1 │      935
  DIV  │     99.0 │     61.3 │    257.9 │      900

SBP32 (16+16 bits, ~3900 decades)
  Op   │  Mean dB │   Min dB │   Max dB │  Samples
───────┼──────────┼──────────┼──────────┼──────────
  ADD  │    127.5 │    108.2 │    191.5 │     1275
  SUB  │    127.6 │    106.6 │    191.5 │     1225
  MUL  │    127.3 │    108.9 │    319.1 │     1268
  DIV  │    124.9 │    108.9 │    183.7 │     1224

SBP64 (32+32 bits, wide u128 arithmetic)
  Op   │  Mean dB │   Min dB │   Max dB │  Samples
───────┼──────────┼──────────┼──────────┼──────────
  ADD  │    138.4 │     38.1 │    296.1 │     1275
  SUB  │    135.3 │     38.1 │    296.1 │     1225
  MUL  │    223.1 │    205.2 │    319.1 │     1268
  DIV  │    222.1 │    205.2 │    304.3 │     1224

╔══════════════════════════════════════════════════════════════╗
║         SBP8 Decade Range Test (precision vs range)          ║
╚══════════════════════════════════════════════════════════════╝

  Range              │  MUL dB │  DIV dB │  ADD dB │  SUB dB
─────────────────────┼─────────┼─────────┼─────────┼─────────
  1 decade (0.3-3)   │    43.5 │    37.6 │    28.9 │    24.8
  2 decades (0.1-10) │    57.5 │    39.9 │    23.3 │    19.1
  3 decades (0.03-30) │    43.7 │    35.7 │    25.1 │    22.8
  4 decades (0.01-100) │    73.0 │    40.1 │    28.5 │    27.2
─────────────────────┴─────────┴─────────┴─────────┴─────────

╔══════════════════════════════════════════════════════════════╗
║        SBP16 Decade Range Test (precision vs range)          ║
╚══════════════════════════════════════════════════════════════╝

  Range                     │  MUL dB │  DIV dB │  ADD dB │  SUB dB
────────────────────────────┼─────────┼─────────┼─────────┼─────────
  7 decades (1e-3 to 1e4)   │   106.3 │   102.6 │    73.0 │    71.9
  10 decades (1e-5 to 1e5)  │    95.1 │    90.8 │    75.2 │    74.9
  14 decades (1e-7 to 1e7)  │   103.9 │    99.0 │    79.4 │    78.9
  20 decades (1e-10 to 1e10) │    96.0 │    89.3 │    76.6 │    76.9
────────────────────────────┴─────────┴─────────┴─────────┴─────────

╔══════════════════════════════════════════════════════════════╗
║        SBP32 Decade Range Test (precision vs range)          ║
╚══════════════════════════════════════════════════════════════╝

  Range                       │  MUL dB │  DIV dB │  ADD dB │  SUB dB
──────────────────────────────┼─────────┼─────────┼─────────┼─────────
  100 decades (1e-50 to 1e50) │   127.1 │   124.9 │   127.5 │   127.6
  200 decades (1e-100 to 1e100) │   126.6 │   124.1 │   125.9 │   126.1
  300 decades (1e-150 to 1e150) │   128.0 │   124.2 │   125.6 │   125.8
  400 decades (1e-200 to 1e200) │   125.8 │   121.6 │   128.3 │   128.6
  450 decades (1e-225 to 1e225) │   128.1 │   122.8 │   128.5 │   128.8
  500 decades (1e-250 to 1e250) │   127.6 │   123.4 │   124.8 │   124.9
──────────────────────────────┴─────────┴─────────┴─────────┴─────────

╔══════════════════════════════════════════════════════════════╗
║        SBP64 Decade Range Test (precision vs range)          ║
╚══════════════════════════════════════════════════════════════╝

  Range                       │  MUL dB │  DIV dB │  ADD dB │  SUB dB
──────────────────────────────┼─────────┼─────────┼─────────┼─────────
  100 decades (1e-50 to 1e50) │   222.9 │   222.1 │   138.4 │   135.4
  200 decades (1e-100 to 1e100) │   222.1 │   221.3 │   175.3 │   173.4
  300 decades (1e-150 to 1e150) │   222.5 │   221.2 │   193.2 │   192.4
  400 decades (1e-200 to 1e200) │   219.9 │   218.6 │   203.6 │   203.2
  450 decades (1e-225 to 1e225) │   220.9 │   219.0 │   202.9 │   202.5
  500 decades (1e-250 to 1e250) │   221.7 │   220.8 │   208.3 │   208.1
──────────────────────────────┴─────────┴─────────┴─────────┴─────────

Will release once 64 bit fixed. Any benchmark in particular that would be useful?


╔══════════════════════════════════════════════════════════════════════════╗
║        SBP8 Edge Cases & Boundary Tests                            ║
╚══════════════════════════════════════════════════════════════════════════╝

  Test                    │      Input │     Output │ Status
──────────────────────────┼────────────┼────────────┼────────
  Zero                     │     0.00e0 │     0.00e0 │   OK  
  Negative zero            │    -0.00e0 │     0.00e0 │   OK  
  Min positive (0.3)       │    3.00e-1 │     0.00e0 │  FAIL
  Max positive (3.0)       │     3.00e0 │        inf │  FAIL
  Unity (1.0)              │     1.00e0 │     1.00e0 │   OK  
  Below range (0.1)        │    1.00e-1 │     0.00e0 │   OK  
  Above range (10)         │     1.00e1 │        inf │   OK  
  Negative (-1.0)          │    -1.00e0 │    -1.00e0 │   OK  
  Tiny (1e-10)             │   1.00e-10 │     0.00e0 │   OK  
  Huge (1e10)              │    1.00e10 │        inf │   OK  
  Infinity                 │        inf │        inf │   OK  
  Neg infinity             │       -inf │        inf │   OK  
  NaN                      │        NaN │        NaN │   OK  
──────────────────────────┴────────────┴────────────┴────────

╔══════════════════════════════════════════════════════════════════════════╗
║        SBP16 Edge Cases & Boundary Tests                            ║
╚══════════════════════════════════════════════════════════════════════════╝

  Test                    │      Input │     Output │ Status
──────────────────────────┼────────────┼────────────┼────────
  Zero                     │     0.00e0 │     0.00e0 │   OK  
  Min positive (1e-7)      │    1.00e-7 │    1.00e-7 │   OK  
  Max positive (1e7)       │     1.00e7 │     1.00e7 │   OK  
  Unity (1.0)              │     1.00e0 │     1.00e0 │   OK  
  Below range (1e-10)      │   1.00e-10 │     0.00e0 │   OK  
  Above range (1e10)       │    1.00e10 │        inf │   OK  
  Negative (-1e3)          │    -1.00e3 │    -1.00e3 │   OK  
  Subnormal (1e-310)       │  1.00e-310 │     0.00e0 │   OK  
  Near overflow (1e38)     │    1.00e38 │        inf │   OK  
  Infinity                 │        inf │        inf │   OK  
  NaN                      │        NaN │        NaN │   OK  
──────────────────────────┴────────────┴────────────┴────────

╔══════════════════════════════════════════════════════════════════════════╗
║        SBP32 Edge Cases & Boundary Tests                            ║
╚══════════════════════════════════════════════════════════════════════════╝

  Test                    │      Input │     Output │ Status
──────────────────────────┼────────────┼────────────┼────────
  Zero                     │     0.00e0 │     0.00e0 │   OK  
  Tiny (1e-150)            │  1.00e-150 │  1.00e-150 │   OK  
  Huge (1e150)             │   1.00e150 │   1.00e150 │   OK  
  Unity (1.0)              │     1.00e0 │     1.00e0 │   OK  
  Negative (-1e50)         │   -1.00e50 │   -1.00e50 │   OK  
  f64 MIN_POSITIVE         │  2.23e-308 │  2.23e-308 │   OK  
  f64 MAX                  │   1.80e308 │        inf │   OK  
  f64 EPSILON              │   2.22e-16 │   2.22e-16 │   OK  
  Subnormal (1e-310)       │  1.00e-310 │  1.00e-310 │   OK  
  Infinity                 │        inf │        inf │   OK  
  NaN                      │        NaN │        NaN │   OK  
──────────────────────────┴────────────┴────────────┴────────

╔══════════════════════════════════════════════════════════════════════════╗
║        SBP64 Edge Cases & Boundary Tests                            ║
╚══════════════════════════════════════════════════════════════════════════╝

  Test                    │      Input │     Output │ Status
──────────────────────────┼────────────┼────────────┼────────
  Zero                     │     0.00e0 │     0.00e0 │   OK  
  Tiny (1e-150)            │  1.00e-150 │  1.00e-150 │   OK  
  Huge (1e150)             │   1.00e150 │   1.00e150 │   OK  
  Unity (1.0)              │     1.00e0 │     1.00e0 │   OK  
  Negative (-1e50)         │   -1.00e50 │   -1.00e50 │   OK  
  f64 MIN_POSITIVE         │  2.23e-308 │  2.23e-308 │   OK  
  f64 MAX                  │   1.80e308 │   1.80e308 │   OK  
  Precision (1+1e-12)      │     1.00e0 │     1.00e0 │   OK  
  Subnormal (1e-310)       │  1.00e-310 │  1.00e-310 │   OK  
  Infinity                 │        inf │        inf │   OK  
  NaN                      │        NaN │        NaN │   OK  
──────────────────────────┴────────────┴────────────┴────────
 
Reply all
Reply to author
Forward
0 new messages