Skip to content

Commit 82aaf0e

Browse files
committed
Add Mozilla commutativity bug
1 parent 115c01a commit 82aaf0e

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

docs/native_math_bugs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
* [After 10 years, Mozilla updates `Math.random`][@bug:mozilla:322529]
4242
* [WebKit bug to use a better PRNG][@bug:webkit:151641]
4343
* [WebKit 32-bit Math bug][@bug:webkit:40367]
44+
* [Mozilla optimizations break commutativity][@bug:mozilla:969203]
4445

4546

46-
* [Mozilla optimizations break commutativity][27]
4747
* [Mozilla debate on speed versus precision][28]
4848
* [Division bug to due C library delegation][29]
4949
* [Fixit to unify Math implementations in Chrome][30]
@@ -98,14 +98,14 @@
9898
[@bug:mozilla:322529]: https://bugzilla.mozilla.org/show_bug.cgi?id=322529
9999
[@bug:webkit:151641]: https://bugs.webkit.org/show_bug.cgi?id=151641
100100
[@bug:webkit:40367]: https://bugs.webkit.org/show_bug.cgi?id=40367
101+
[@bug:mozilla:969203]: https://bugzilla.mozilla.org/show_bug.cgi?id=969203#c8
101102

102103

103104
[v8-issue-tracker]: https://bugs.chromium.org/p/v8/issues/list?can=1&q=math&colspec=ID%20Type%20Status%20Priority%20Owner%20Summary%20HW%20OS%20Component%20Stars&num=100&start=100
104105
[webkit-issue-tracker]: https://bugs.webkit.org/buglist.cgi?quicksearch=math
105106
[mozilla-issue-tracker]: https://bugzilla.mozilla.org/buglist.cgi?quicksearch=math
106107

107108

108-
[27]: https://bugzilla.mozilla.org/show_bug.cgi?id=969203#c8
109109
[28]: https://bugzilla.mozilla.org/show_bug.cgi?id=967709
110110
[29]: https://bugzilla.mozilla.org/show_bug.cgi?id=948321
111111
[30]: https://bugs.chromium.org/p/v8/issues/detail?id=5086

docs/references/bugs.bib

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,3 +326,12 @@ @misc{bug:webkit:40367
326326
year = {2010}
327327
}
328328

329+
@misc{bug:mozilla:969203,
330+
abstract = {I just made a plain C program that generates random numbers and checks whether a math function commutes (it generates a million random float numbers and directly tests the property upon these inputs -- and it finds counter examples after only a few tries (<10), so this empirical method sounds acceptable). The functions that can precisely commute are cos, sin, floor, ceil, round (the former is not specialized in Ion at the moment, see also bug 930477). The ones that don't precisely commute and that we do optimize for now are log, tan, atan, asin, acos. pow isn't optimized and doesn't commute precisely neither, but it was planned at some point (see also bug 930477 once again). Removing these functions would imply that we can't use them in Odin too (otherwise there would be a difference of behaviour between Odin and no-asm modes). This is a shame as this added more expressivity to asm.js, since C code compiled with emscripten using float functions (as logf, for instance), could behave the same in JS and in native code, at the same speed. If we remove optimizations for these functions and still want to have them available in Odin, we'd have to: convert the float input to a double, call the double math function, then convert it back to a float, which is worse in terms of performance. But precision seems more important here, so that's clearly a question of tradeoff. What do you think?},
331+
keywords = {math, firefox, mozilla},
332+
notes = {},
333+
title = {{Float32: Take out all Math functions that don't properly commute}},
334+
url = {https://bugzilla.mozilla.org/show_bug.cgi?id=969203#c8},
335+
year = {2014}
336+
}
337+

0 commit comments

Comments
 (0)