Skip to content
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

log2: Presto vs Velox values differ #12338

Open
peterenescu opened this issue Feb 14, 2025 · 1 comment
Open

log2: Presto vs Velox values differ #12338

peterenescu opened this issue Feb 14, 2025 · 1 comment
Labels
bug Something isn't working fuzzer Issues related the to Velox fuzzer test components. fuzzer-found triage Newly created issue that needs attention.

Comments

@peterenescu
Copy link
Contributor

peterenescu commented Feb 14, 2025

Bug description

log2 produces different values between Presto/Velox queries found during fuzzer execution.

Reproduction

(Presto followed by Velox):

presto:di> select log2(0.3213630791287869);
        _col0         
---------------------
 -1.6377239051944648 
(1 row)
presto:di> select log2(c0) from (values (0.3213630791287869) ) t(c0);
        _col0         
---------------------
 -1.6377239051944645 
(1 row)

log2 value differences affect the following fuzzer call: SELECT trail(to_base64(to_ieee754_64(log2(c0))), INTEGER '525854645')

@peterenescu peterenescu added bug Something isn't working triage Newly created issue that needs attention. fuzzer Issues related the to Velox fuzzer test components. fuzzer-found labels Feb 14, 2025
@kagamiori
Copy link
Contributor

The mismatch of log2() is actually OK because that is basically the imprecision of floating-point numbers (and we don't plan to match that 100%). But this is a good finding. It means that when generating a subexpression for an argument of floating-point type, we need some special handling (e.g., round the floating-point result) because the imprecision can propagate and be magnified.

@peterenescu peterenescu removed fuzzer Issues related the to Velox fuzzer test components. fuzzer-found labels Feb 20, 2025
@kagamiori kagamiori added fuzzer Issues related the to Velox fuzzer test components. fuzzer-found labels Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fuzzer Issues related the to Velox fuzzer test components. fuzzer-found triage Newly created issue that needs attention.
Projects
None yet
Development

No branches or pull requests

2 participants