diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e13a2c02..083414cd 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -10,11 +10,11 @@ if (GTest_FOUND) test_datastructures/test_denseskop.cc test_datastructures/test_sparseskop.cc - test_matmul_impls/linop_common.hh - test_matmul_impls/test_lskge3.cc - test_matmul_impls/test_rskge3.cc - test_matmul_impls/test_lskges.cc - test_matmul_impls/test_rskges.cc + test_matmul_cores/linop_common.hh + test_matmul_cores/test_lskge3.cc + test_matmul_cores/test_rskge3.cc + test_matmul_cores/test_lskges.cc + test_matmul_cores/test_rskges.cc test_matmul_wrappers/test_sketch_vector.cc ) @@ -34,10 +34,10 @@ if (GTest_FOUND) test_datastructures/test_spmats/test_coo.cc test_datastructures/test_spmats/test_conversions.cc - test_matmul_impls/test_spmm/spmm_test_helpers.hh - test_matmul_impls/test_spmm/test_spmm_csc.cc - test_matmul_impls/test_spmm/test_spmm_csr.cc - test_matmul_impls/test_spmm/test_spmm_coo.cc + test_matmul_cores/test_spmm/spmm_test_helpers.hh + test_matmul_cores/test_spmm/test_spmm_csc.cc + test_matmul_cores/test_spmm/test_spmm_csr.cc + test_matmul_cores/test_spmm/test_spmm_coo.cc ) target_link_libraries(SparseRandBLAS_tests RandBLAS diff --git a/test/DevNotes.md b/test/DevNotes.md index 9f29cdfa..215ffd03 100644 --- a/test/DevNotes.md +++ b/test/DevNotes.md @@ -1,2 +1,51 @@ Developer notes for RandBLAS' testing infrastructure ==================================================== + +Meta note: + + Don't defend previous design decisions. Just explain how they work. + That's easier and more useful. Plus, a good explanation will make + pros and cons of the decision (more) self-evident. + + + + +Right-multplication by a structured linear operator in a GEMM-like API can +always be reduced to left-multiplication by flipping transposition flags and +layout parameters. So, why have equally fleshed-out tests(/test tooling) for +both cases? + +Short answer: maybe it was a bad idea. + +Big picture defensive answer: + + Different linear operators vary in the extent to which code for their + action on the left can be reduced to their action on the right. Action + on the right is equivalent to adjoint-action from the left. + + Someone who's adding a new linear operator might prefer to think mostly + in terms of right-multiplication, and just have left-multiplication reduce + to adjoint-action from the right. + + We want someone who adds new functionality to benefit from our testing infrastructure. So we made infrastructure to test GEMM-like APIs where + one operand is structured, and it's easy to get started using this + infrastructure because it's equally valid to start with tests that + multiply only for one side and only another. + +Specifics: + + RSKGE3 doesn't actually reduce to LSKGE3. It could, but it was + easy enough to have it reduce directly to GEMM, and reducing + directly to GEMM had the advantage of improved readibility. We don't + test all possible combinations of flags (we omit when both arguments + are transposed) but the combinationed we leave untested are unrelated + to flow-of-control. + + RSKGES reduces to right_spmm, which does indeed fall back on + left_spmm. But left_spmm has a large number codepaths (twelve!). + It would have been awkward to write tests that hit all of those codepaths + directly. Instead, we write a smaller set of tests for left_spmm + and right_spmm, and count on the right_spmm tests to hit complementary + codepaths compared to the paths hit in the left_spmm tests. + (Admission: we don't know for sure if all codepaths are hit. Verifying + that is on our TODO list.) diff --git a/test/test_matmul_impls/linop_common.hh b/test/test_matmul_cores/linop_common.hh similarity index 100% rename from test/test_matmul_impls/linop_common.hh rename to test/test_matmul_cores/linop_common.hh diff --git a/test/test_matmul_impls/test_lskge3.cc b/test/test_matmul_cores/test_lskge3.cc similarity index 99% rename from test/test_matmul_impls/test_lskge3.cc rename to test/test_matmul_cores/test_lskge3.cc index 36eea6db..921dad05 100644 --- a/test/test_matmul_impls/test_lskge3.cc +++ b/test/test_matmul_cores/test_lskge3.cc @@ -27,7 +27,7 @@ // POSSIBILITY OF SUCH DAMAGE. // -#include "test/test_matmul_impls/linop_common.hh" +#include "test/test_matmul_cores/linop_common.hh" #include using RandBLAS::DenseDist; diff --git a/test/test_matmul_impls/test_lskges.cc b/test/test_matmul_cores/test_lskges.cc similarity index 99% rename from test/test_matmul_impls/test_lskges.cc rename to test/test_matmul_cores/test_lskges.cc index 557e8471..1bbd0d03 100644 --- a/test/test_matmul_impls/test_lskges.cc +++ b/test/test_matmul_cores/test_lskges.cc @@ -27,7 +27,7 @@ // POSSIBILITY OF SUCH DAMAGE. // -#include "test/test_matmul_impls/linop_common.hh" +#include "test/test_matmul_cores/linop_common.hh" #include using RandBLAS::SparseDist; @@ -185,7 +185,6 @@ TEST_F(TestLSKGES, sketch_saso_rowMajor_oneThread) } } - TEST_F(TestLSKGES, sketch_laso_rowMajor_oneThread) { for (int64_t k_idx : {0, 1, 2}) { diff --git a/test/test_matmul_impls/test_rskge3.cc b/test/test_matmul_cores/test_rskge3.cc similarity index 99% rename from test/test_matmul_impls/test_rskge3.cc rename to test/test_matmul_cores/test_rskge3.cc index db0b513c..2bd8f949 100644 --- a/test/test_matmul_impls/test_rskge3.cc +++ b/test/test_matmul_cores/test_rskge3.cc @@ -27,7 +27,7 @@ // POSSIBILITY OF SUCH DAMAGE. // -#include "test/test_matmul_impls/linop_common.hh" +#include "test/test_matmul_cores/linop_common.hh" #include using namespace test::linop_common; diff --git a/test/test_matmul_impls/test_rskges.cc b/test/test_matmul_cores/test_rskges.cc similarity index 99% rename from test/test_matmul_impls/test_rskges.cc rename to test/test_matmul_cores/test_rskges.cc index c6692e09..35b62f61 100644 --- a/test/test_matmul_impls/test_rskges.cc +++ b/test/test_matmul_cores/test_rskges.cc @@ -27,7 +27,7 @@ // POSSIBILITY OF SUCH DAMAGE. // -#include "test/test_matmul_impls/linop_common.hh" +#include "test/test_matmul_cores/linop_common.hh" #include using namespace test::linop_common; @@ -193,7 +193,6 @@ TEST_F(TestRSKGES, sketch_saso_rowMajor_oneThread) } } - TEST_F(TestRSKGES, sketch_laso_rowMajor_oneThread) { for (int64_t k_idx : {0, 1, 2}) { diff --git a/test/test_matmul_impls/test_spmm/spmm_test_helpers.hh b/test/test_matmul_cores/test_spmm/spmm_test_helpers.hh similarity index 99% rename from test/test_matmul_impls/test_spmm/spmm_test_helpers.hh rename to test/test_matmul_cores/test_spmm/spmm_test_helpers.hh index 20820591..5190e256 100644 --- a/test/test_matmul_impls/test_spmm/spmm_test_helpers.hh +++ b/test/test_matmul_cores/test_spmm/spmm_test_helpers.hh @@ -28,7 +28,7 @@ // #include "test/test_datastructures/test_spmats/common.hh" -#include "test/test_matmul_impls/linop_common.hh" +#include "test/test_matmul_cores/linop_common.hh" #include using namespace test::linop_common; diff --git a/test/test_matmul_impls/test_spmm/test_spmm_coo.cc b/test/test_matmul_cores/test_spmm/test_spmm_coo.cc similarity index 99% rename from test/test_matmul_impls/test_spmm/test_spmm_coo.cc rename to test/test_matmul_cores/test_spmm/test_spmm_coo.cc index d0535475..119b743d 100644 --- a/test/test_matmul_impls/test_spmm/test_spmm_coo.cc +++ b/test/test_matmul_cores/test_spmm/test_spmm_coo.cc @@ -27,7 +27,7 @@ // POSSIBILITY OF SUCH DAMAGE. // -#include "test/test_matmul_impls/test_spmm/spmm_test_helpers.hh" +#include "test/test_matmul_cores/test_spmm/spmm_test_helpers.hh" #include using namespace RandBLAS::sparse_data; diff --git a/test/test_matmul_impls/test_spmm/test_spmm_csc.cc b/test/test_matmul_cores/test_spmm/test_spmm_csc.cc similarity index 99% rename from test/test_matmul_impls/test_spmm/test_spmm_csc.cc rename to test/test_matmul_cores/test_spmm/test_spmm_csc.cc index b2c7ea00..1ee95552 100644 --- a/test/test_matmul_impls/test_spmm/test_spmm_csc.cc +++ b/test/test_matmul_cores/test_spmm/test_spmm_csc.cc @@ -27,7 +27,7 @@ // POSSIBILITY OF SUCH DAMAGE. // -#include "test/test_matmul_impls/test_spmm/spmm_test_helpers.hh" +#include "test/test_matmul_cores/test_spmm/spmm_test_helpers.hh" #include #include diff --git a/test/test_matmul_impls/test_spmm/test_spmm_csr.cc b/test/test_matmul_cores/test_spmm/test_spmm_csr.cc similarity index 99% rename from test/test_matmul_impls/test_spmm/test_spmm_csr.cc rename to test/test_matmul_cores/test_spmm/test_spmm_csr.cc index a534d92e..d8618a02 100644 --- a/test/test_matmul_impls/test_spmm/test_spmm_csr.cc +++ b/test/test_matmul_cores/test_spmm/test_spmm_csr.cc @@ -27,7 +27,7 @@ // POSSIBILITY OF SUCH DAMAGE. // -#include "test/test_matmul_impls/test_spmm/spmm_test_helpers.hh" +#include "test/test_matmul_cores/test_spmm/spmm_test_helpers.hh" #include #include