-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
internal: internal numerics (double, single, fixed?) #26
Comments
Removing milestone as I think this is a longer-term question. As the library matures I think we are becoming entrenched in not necessarily using fixed-point. I'm left wondering if we need them at all, ultimately. Other tools (e.g., tiny-skia in Rust land, and Skia itself, (i.e., the C++ version) use Currently, as it stands, any strong cases for any particular format are still hypothetical. I still think speed and/or accuracy are the major drivers, but I think we could do with some more concrete data. |
Just wanted to add some stuff back-referenced from #49: if we do end up doing fixed-point, we likely want to use 24.8, this is consistent with Cairo, and they have a well-documented reason for this change in their changelog (link). TL;DR: 16.16 was consistent for X (e.g., X11) drawables historically, but the needs of Cairo to scale past the 16-bit integer representation became pretty obvious (not surprising, given the relatively small value this represents). Meanwhile, having 16 fractional bits proved to be excessive. The 24.8 representation has existed in Cairo since this point (so around 2008), so it seems to have worked out well. |
Just logging some notes and testing here: Main takeaway: likely abandoning fixed point as a possibility, favoring f32, want more data before we migrate. However, I would like to have this concluded soon (so milestone is being added again).
The main case for f32 right now as such is more memory optimization as we move forward on efforts like #44 and #50; I plan on migrating more of the rendering processes to Benchmarks (f32/f64)I ran the acceptance test suite using both the default
|
NOTE you'll want to go down to the bottom if you're curious about the current status of this work.
From #11
This tracks any efforts towards getting the internal plumbing to fixed-point arithmetic, spun off from the other units discussion.Currently our main floating-point unit is f64 (the value that we accept onPath
for co-ordinates). The case for moving internal calculations to fixed-point would be accuracy and speed (more stable rounding, possibly optimized calculations).https://github.com/ziglibs/zigfp would probably be what I'd want to look at first before implementing our own stack.The text was updated successfully, but these errors were encountered: