-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Unify and deduplicate float tests (exp, log, hyperbolic, gamma) #151167
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
Conversation
Migrate the following tests from library/std/tests/floats/ to use the unified float_test! macro infrastructure in library/coretests/tests/floats/mod.rs: - exp, exp2: Exponential functions - ln, log, log2, log10: Logarithmic functions - asinh, acosh, atanh: Inverse hyperbolic functions - gamma, ln_gamma: Gamma functions This eliminates duplicate test code across f16, f32, f64, and f128 test files.
This comment has been minimized.
This comment has been minimized.
The Cranelift codegen backend (cg_clif) does not support f16/f128 math intrinsics, causing linker errors. Add `randomized_layouts` to check-cfg.
The Cranelift codegen backend (cg_clif) does not support f16/f128 math intrinsics, which causes linker errors for undefined symbols like logf16, expf16, etc. Add `not(randomized_layouts)` to the cfg attributes for f16 and f128 math tests to skip them when running under Cranelift's randomized layout testing, which sets the `randomized_layouts` cfg flag.
This comment has been minimized.
This comment has been minimized.
After migrating exp, log, hyperbolic, and gamma function tests to the unified float_test! macro infrastructure in library/coretests, the TOL constant in library/std/tests/floats/f128.rs became unused. This removes the dead code to fix the CI warning: "warning: constant `TOL` is never used" The remaining constants (TOL_PRECISE, TOL_IMPR) are still used by test_real_consts and test_powf respectively.
|
Hello! Thank you for the interest, but I am afraid this conflicts with #148206 |
|
Unfortunately I have no recommendations, but I think you were on the right track looking for E-Easy issues. Just keep your eyes peeled, or ask on Zulip if you are looking for something specific :) |
For future reference, please do not include these AI-generated summaries. They're pure noise - we know what the functions do, GitHub shows you the +/- diffstat, and the third section is meaningless (the goal of review is to figure out if these things are done correctly. The statement happens to be wrong because I see some things that aren't). |
Ok then I will close this branch, thank you for the feedback |
Summary
This PR migrates duplicated float tests from
library/std/tests/floats/to use the unifiedfloat_test!macro infrastructure inlibrary/coretests/tests/floats/mod.rs.Tests migrated:
exp,exp2- Exponential functionsln,log,log2,log10- Logarithmic functionsasinh,acosh,atanh- Inverse hyperbolic functionsgamma,ln_gamma- Gamma functionsResult:
All tests properly handle:
target_has_reliable_f16_math/target_has_reliable_f128_math#[cfg(not(miri))]#[cfg(false)]Fixes #141726
Test plan
./x.py test library/coretests --stage 1passes locally./x.py test library/std --stage 1passes locally