calculator icon indicating copy to clipboard operation
calculator copied to clipboard

Windows calculator support for new floating-point formats: cfloats, areals, unums, posits, valids, etc.

Open Ravenwater opened this issue 2 years ago • 3 comments

Problem Statement

Both AI/HPC and numerical analysis communities are experimenting with new number systems, such as bfloat16, tensorfloat, fp9, fp24, etc., as well as tapered number systems such as posits and valids. When starting to use a new number system, the first step is to see how a value gets sampled by the number system. This is one feature that the Windows Calculator already has for hex/dec/bin encodings of the integers. This request is to enhance that feature for floating-point number systems. The UI/UX design would be most important as there is currently a rapid proliferation of different number systems and thus the UI would need to be able to organize that productively.

Evidence or User Insights

In number system design, we constantly juxtapose the value and the encoding. This is well supported for hex/dec/bin, but not for floating-point encodings. So, we have been building separate UIs to help us. But to have this feature consolidated in a standard utility on the Windows platform would be a huge enabler for a large swath of developers that are working on numerical software, as well as an educational tool for students that are just learning about computer arithmetic.

Proposal

The Universal library (https://github.com/stillwater-sc/universal) is a C++ template library that contains tens of thousands of number systems that can be used as plug-and-play replacements of native types. By integrating this engine into the Windows calculator will we enable the entire Windows community with a resource to interact with these new number systems that are making a difference in AI right now. Any student of computer science will get a resource that will enable them to learn, test, and comprehend the behavior of these new number systems. As programmer, the programmer view of Windows calculator already provides visualization of bit encodings for integers. By expanding this view with floating-point types, we stay consistent with the Windows Calculator UX but expand its use case to numerics.

Goals

User can present a floating-point value, and see how it gets sampled by a Number System Under Test. For example, how does the value 0.0625 get sampled by a quarter-precision floating-point number system like fp<8,2> (8 bits total, 2 exponent bits)?

If we support interval and Oracle number systems, we can also offer error values of such samplings.

If we support error propagation, using techniques like Shaman (https://github.com/nestordemeure/shaman), we can show accumulated error during a computational sequence.

Non-Goals

No graphing calculations.

Low-Fidelity Concept

The UX is going to be key. One design would have IEEE-754 formats as standard, with a dialog that enables the user to select one or more custom number systems to contrast with. This would be presented in a new view, much like the current Programmer View, but say a "Numerical View". Any values and computational results will then be presented in encoded and value form, possibly with an error value.

This design would be analogous to the current Programmer View, but extended for Numerical use cases.

Requested Assignment

I am the principal for the Universal library, so we already have all the number system machinery available. Encodings, conversions, arithmetic, math libraries are already production-worthy and integrated into many R&D CAE and computational science software packages. I am looking to collaborate with a UI/UX person to add this new 'Numerical View' to the Windows Calculator and get this in the hands of the larger Windows community.

Ravenwater avatar Sep 01 '21 13:09 Ravenwater

This is your friendly Microsoft Issue Bot. I've seen this issue come in and have gone to tell a human about it.

MicrosoftIssueBot avatar Sep 01 '21 14:09 MicrosoftIssueBot

We are waiting for it!

psztoch avatar Jun 21 '22 22:06 psztoch

@psztoch Love to have a brother in arms for this integration. The past six months we have been working mostly on integrations with computer aided engineering and simulation codes, and there math library support is more important. Sampling quantization is very interesting for DL algorithms. The UI/UX to communicate how the arithmetic treats the computation continues to be the biggest question. Some people think ULPs, other's think max error, and some are purely visual and need to see error plots.

Having some folks that think about these matters both from a research and a pedagogical perspective is going to be needed to pull this off.

Ravenwater avatar Jun 22 '22 01:06 Ravenwater