math_brute_force: Refactor input generation & reduce default test size#2697
Open
rjodinchr wants to merge 2 commits into
Open
math_brute_force: Refactor input generation & reduce default test size#2697rjodinchr wants to merge 2 commits into
rjodinchr wants to merge 2 commits into
Conversation
25ff430 to
65ad379
Compare
65ad379 to
cc958dc
Compare
6cb65b2 to
161cd13
Compare
This patch consolidates the hardcoded arrays of edge-case test values from multiple individual test files into a single, shared location. Ref KhronosGroup#2669
This patch addresses execution time and input coverage in the math_brute_force tests by centralizing input generation and scaling down the default number of tested values. Key changes: * Abstracted input generation: Replaced duplicated array-filling logic across test files with shared `fill*Input` helper functions (for unary, binary, and ternary operations). This ensures that special edge-case values (NaNs, Infs, denormals) and random payloads are consistently injected across all tests. * Reduced default test size: The default loop bounds have been reduced from an exhaustive `1ULL << 32` values to a randomized subset of `1ULL << 27` inputs. This drastically speeds up standard test runs. * Added exhaustive `-a` flag: Introduced a new `-a` command-line option that restores the exhaustive testing behavior, allowing validation against all 2^32 sequential values when needed. * Improved wimpy mode scaling: Removed the `scale` and `step` skip logic, which could inadvertently skip combinations of special values. Instead, the patch now directly reduces the total `input_count_power_of_two` by using a De Bruijn sequence bit-hack to calculate the `log2` of the `wimpyReductionFactor`. Fixes: KhronosGroup#2669 [run-test: test_bruteforce -w -1]
161cd13 to
6917a88
Compare
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.
This patch addresses execution time and input coverage in the
math_brute_force tests by centralizing input generation and scaling
down the default number of tested values.
Key changes:
across test files with shared
fill*Inputhelper functions (for unary,binary, and ternary operations). This ensures that special edge-case
values (NaNs, Infs, denormals) and random payloads are consistently
injected across all tests.
from an exhaustive
1ULL << 32values to a randomized subset of1ULL << 27inputs. This drastically speeds up standard test runs.-aflag: Introduced a new-acommand-line optionthat restores the exhaustive testing behavior, allowing validation
against all 2^32 sequential values when needed.
scaleandstepskip logic,which could inadvertently skip combinations of special values. Instead,
the patch now directly reduces the total
input_count_power_of_twobyusing a De Bruijn sequence bit-hack to calculate the
log2of thewimpyReductionFactor.individual test files into a single, shared location.
Ref #2669