closure plots

25 views
Skip to first unread message

Theodore Omtzigt

unread,
Oct 7, 2025, 3:51:40 PM (12 days ago) Oct 7
to Unum Computing
I have implemented closure plots for the number systems in Universal (https://github.com/stillwater-sc/universal). I was very interested to see the cover change as you add more bits. 

Here is the progression for posits for nbits sizes that custom hardware can take advantage of.

Also included is a progression for 8-bit floating-point with different exponent field widths. These have been studied deeply for AI use cases.

And for fun, also included is an lns progression. Less studied for AI, but some custom hardware exists for them (Recogni).

Enjoy!

P.S. If you want to generate your own closure plots for your own number system, take a look at the ./tools/closure directory and you will find the driver programs that use the closure plot API to generate the above plots


lns8_closure_plots.png
posit_progression.png
cfloat8_closure_plots.png

Angelo Bulfone

unread,
Oct 8, 2025, 5:55:36 PM (11 days ago) Oct 8
to Unum Computing
Looks like the posits reported some overflow and underflow, which while prior closure plots didn't report them at all since "posits don't overflow", MAX_POS and MIN_POS work close enough to IEEE infinity and 0 that I think it's reasonable to label results of those magnitudes as "overflow" and "underflow".

John Gustafson

unread,
Oct 8, 2025, 8:11:47 PM (11 days ago) Oct 8
to Angelo Bulfone, Unum Computing
I agree that posits overflow and underflow, if you define those terms carefully. A magnitude greater than maxPos can legitimately round down to magnitude maxPos. That is, if you had one more bit after the LSB, you could represent another factor of uSeed higher, so values in [maxPos, uSeed) do not overflow. Beyond that, yes, that should probably be considered overflow and the behavior is to saturate to maxPos. A debugger should flag when that happens so it can be more easily eliminated in finished code. Saturation at least preserves the sign of the too-large value.

The situation for minPos is symmetric to that for maxPos.

I'll attach two screenshots from Every Bit Counts: Posit Computing that cover this topic.

John

Screenshot 2025-10-08 at 5.08.34 PM.JPG


Screenshot 2025-10-08 at 5.09.00 PM.JPG



--
You received this message because you are subscribed to the Google Groups "Unum Computing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unum-computin...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/unum-computing/59e12e29-c6e8-4ea0-bdb0-03bc0814d8c5n%40googlegroups.com.

Theodore Omtzigt

unread,
Oct 9, 2025, 7:43:27 AM (10 days ago) Oct 9
to Unum Computing
Initially, I had implemented SATURATE, for example, fixed-point number systems for DSP tend to use saturation. This yielded the following plots:


However, for posits, we have the saturation to minpos, and that is a very different numerical event than saturating to maxpos; therefore, it was more informative to separate these events and map them back to overflow/underflow. 
fixpnt8_saturate_v2.png
posit8_saturate_closure_plots.png
Reply all
Reply to author
Forward
0 new messages