Repository navigation
xls/dslx/stdlib/tests: Fix silent no-op and masked-bug issues in C++ float tests. - #5469
Draft
copybara-service[bot] wants to merge 1 commit into
Draft
copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
copybara-service
Bot
force-pushed
the
test_1023920433
branch
from
November 23, 2026 17:53
7bab96d to
8340347
Compare
copybara-service
Bot
force-pushed
the
test_1023920433
branch
from
November 24, 2026 21:33
8340347 to
4891c3e
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
xls/dslx/stdlib/tests: Fix silent no-op and masked-bug issues in C++ float tests.
Several existing C++ floating-point tests and testbench helpers silently masked
correctness bugs or failed to exercise edge-case inputs:
TestbenchBuilder'sdefault
GenerateRandomValue<T>template was an empty no-op for unsupportedtypes (causing
bfloat16_mul_test_ccto test(0.0, 0.0)1M times), the FMAtests filtered out all
exp == 0inputs (masking signed-zero bugs), andCompareResultsWith1PercentMarginomittedstd::abs(passing any overestimate,including the ~55% error on
bexp == 1inputs infloat32::fast_rsqrt).GenerateRandomValuefallback inxls/tests/testbench_builder_utils.hwithLOG(FATAL), add auint16_tspecialization, and add unit tests in
testbench_builder_utils_test.cc.uint16_ttuple inputs (bijective enumeration for exhaustive runs,TestbenchBuilder's default random generator otherwise), sign-preservingsubnormal flushing, canonical
+qNaNverification, printers, and correct(ComputeExpected, ComputeActual)argument order inbfloat16_mul_test.cc.±0.0, subnormals, infinities, and NaNs via a12^3special-valuepass plus
TestbenchBuilder's default uniform random bit patterns infloat32_fma_test.ccandfloat64_fma_test.cc, flush subnormal inputs inComputeExpected, compare exact bits (and canonical+qNaNinfloat64)after
FlushSubnormal, and fixPrintFloathex formatting widths.xls::FlushSubnormal, bit-exact non-NaN and canonical+qNaNcomparison, and correct(ComputeExpected, ComputeActual)order infloat64_mul_test.cc.doublewithstd::absand explicitNaN/infhandling in
CompareResultsWith1PercentMargin(float32_test_utils.h) andbump
float32_fast_rsqrt_test.ccdefaultnum_samplesto1024 * 1024.float32_downcast_test.cctoArbitrary<uint64_t>()with bit-exactnon-NaN comparison and enable
enable_llvm_coverage = Trueonfloat32_downcast_jit_wrapper.float32_test.cc's--exhaustivemode, and move file-local test helpers into anonymous namespaces.
COPYBARA_INTEGRATE_REVIEW=#5468 from xlsynth:cdleary/2026-11-18-reject-incomparable-equality 96637a4
FUTURE_COPYBARA_INTEGRATE_REVIEW=#5468 from xlsynth:cdleary/2026-11-18-reject-incomparable-equality 96637a4