wush978 / FeatureHashing

Implement feature hashing with R
GNU General Public License v3.0
97 stars 38 forks source link

Analyze the package with RcppDeepState #135

Open FabrizioSandri opened 2 years ago

FabrizioSandri commented 2 years ago

This PR adds a new Github Action which runs RcppDeepState+valgrind on your package. That means the C++ functions of your package will be tested with random inputs, and there will be a comment like this one for each new PR (which reports if valgrind found any issues with random inputs).

RcppDeepState analysis result

This package contains problems, according to RcppDeepState. The report was generated by RcppDeepState-action in this repository's fork and is accessible here.

FabrizioSandri commented 2 years ago

RcppDeepState Report

function name message file line address trace R code
h2 53 (32 direct, 21 indirect) bytes in 1 blocks are definitely lost in loss record 19 of 1,302 hash_internal.cpp:74 No Address Trace found
Test code
testlist <- list(src = c("jazeifhqzmbtzbqqslhq", NA, "phko", "anlryxemlxxbhmilaiqw", "hpfsiuxeyjqhngapuzlh", "wqcwprpwzqhyaheqgvcu", "otvjqlnwvfxquzaycsxl", "qmkkguzixhlsjlznmjad", NA, NA, "oygxeofadbbtqdfhufav", NA, "dxrqgqrwrmmyuceqbdfx", "gkabzcxquukazenuavoz", "sitlzefnjknckaeqvhfy", NA, NA, NA, "bkxmfuo", "eouyrykmunxrqhfslbke", NA, "brkhxnkxoopwdhamtfe", "lxi", "zriycskichjbxkpudqvk", NA, "saieboreynbgpdobrfpn", NA, NA, "wvmltjfqivltdwngaifv", NA, "ujwbgqkpyqatgxmhiccg", NA, "fjmmmvddoqi", "fwmjmpfafeshvxkggzbz", "bdjjsnqhweraulzurcio", "wduxhunosdiheymviirf", "hicpwlibazatqymeecee", NA, NA, NA, NA, NA, NA, NA, "tfjgkspjtxkppuntpobj", "laqxoaeefhbeqsthvkz", "qmebrzcbwepry", NA, "upxcvadsjinzlajtuugv", NA, "eckigchnemjkqrbioghz", "foyzawmyprxkxjhpruzp", "xxeyrphiaufwn", "pzhoyvlem", "ocgxjbvbusn", "wn", NA, "eniwqddxrpyxyzpdmfnh", "jnjcbqsnkbbjhscgzbcv", "vdlkhxgwidnvqqrjvmjt", "whqiseusmpnafqcnvtkc", "sdxwlikpyymufftmugs", NA, "avobfw", "zaqiywdojmlaasaihyhq", "nyeoxknymbmkqjrpgowo", "", "ufaaxszimpo", NA, "bfh"))
result <- do.call(FeatureHashing:::h2, testlist)
merge Invalid read of size 8 as.cpp:54 No Address Trace found
Test code
testlist <- list(i = c(69398254L, 829846253L, -429754007L, 454722234L, 1264783649L, -1219574286L, 98015985L, -775865131L, -466959339L, -1607073146L, -1736708173L, -1787662879L, -713162100L, -842498350L, -1625701520L, -620804674L, 688509897L, 1071009752L, 1363053543L, -1325807483L, 2009731652L, -1836050895L, -1445355132L, -655932927L, -266941904L, -333903811L, 1486038024L, -1930654204L, -1214232503L, NA, 941383185L, 60822260L, -1227021150L, -164831154L, -1090234548L, -236629848L, -2053574219L, -143880400L, -1980939892L, -1907130300L, 816113447L, -792234608L, -875766596L, -1322490826L, -1000936260L, -1032065973L, 1764612343L, -2141701199L, -48047923L, -380805707L, 439972299L, 1708524074L, 753854190L, 1775385298L, -15545985L, 1778724967L, 654849297L, 1452459632L, -868795599L, 222124857L, 725690517L, 325216018L, 1949405918L, 918701661L, -881103327L, NA), x = c(2.6418255479042e+85, 6.07873525587314e-251, -4.59496552839096e-76, 4.79262697592702e+176, 4.30861760173751e+137, -5.57029530620198e-132, 1.18609923591999e+145, 3.0780499668069e-188, 1.9692951427735e+149, 1.22968162162933e+166, 3.42600588934252e+134, -8.12928883376752e+53, -1.06100393021654e-204, 2.38737072127253e+60, 2.30146283245002e-283, -Inf, 1.84849990736347e+132, -3.7645496125776e-58, NaN, -1.42641477407811e-85, -3.65128110239489e+95, 1.14665263843998e+197, 6.53626777066896e+173, -7.53121526436136e-194, -4.13417458979099e+95, -1.9711153367173e-118, -1.04954177401165e+265, 6.50134101905189e-92, -256985985604.01, 1.18609923591999e+145, 2.13742218979633e-135, 8.32217483209601e+73, -4.03976361621628e-231, NA, 1.16105830823157e-296, 6.02621439200311e-117, 8.52493453349611e-267, -3.31112584039748e-28, 1.97145268229036e+267, -6.45517924440172e-18, -4.27827418540752e+289, -2.80040090197631e-109, -1.17243978706259e-105, 3.36421367032313e-16, 1.70915652178292e-243, 3.49351263005719e-230, -9.9032330303416e+232, -4.64727168508508e-284, -7.65114924609716e-196, -1.13483669278294e+137, 4.09950044746732e-281, 0))
result <- do.call(FeatureHashing:::merge, testlist)
pair_sort Invalid read of size 8 as.cpp:31 No Address Trace found
Test code
testlist <- list(i = c(69398254L, 829846253L, -429754007L, 454722234L, 1264783649L, -1219574286L, 98015985L, -775865131L, -466959339L, -1607073146L, -1736708173L, -1787662879L, -713162100L, -842498350L, -1625701520L, -620804674L, 688509897L, 1071009752L, 1363053543L, -1325807483L, 2009731652L, -1836050895L, -1445355132L, -655932927L, -266941904L, -333903811L, 1486038024L, -1930654204L, -1214232503L, NA, 941383185L, 60822260L, -1227021150L, -164831154L, -1090234548L, -236629848L, -2053574219L, -143880400L, -1980939892L, -1907130300L, 816113447L, -792234608L, -875766596L, -1322490826L, -1000936260L, -1032065973L, 1764612343L, -2141701199L, -48047923L, -380805707L, 439972299L, 1708524074L, 753854190L, 1775385298L, -15545985L, 1778724967L, 654849297L, 1452459632L, -868795599L, 222124857L, 725690517L, 325216018L, 1949405918L, 918701661L, -881103327L, NA), x = c(2.6418255479042e+85, 6.07873525587314e-251, -4.59496552839096e-76, 4.79262697592702e+176, 4.30861760173751e+137, -5.57029530620198e-132, 1.18609923591999e+145, 3.0780499668069e-188, 1.9692951427735e+149, 1.22968162162933e+166, 3.42600588934252e+134, -8.12928883376752e+53, -1.06100393021654e-204, 2.38737072127253e+60, 2.30146283245002e-283, -Inf, 1.84849990736347e+132, -3.7645496125776e-58, NaN, -1.42641477407811e-85, -3.65128110239489e+95, 1.14665263843998e+197, 6.53626777066896e+173, -7.53121526436136e-194, -4.13417458979099e+95, -1.9711153367173e-118, -1.04954177401165e+265, 6.50134101905189e-92, -256985985604.01, 1.18609923591999e+145, 2.13742218979633e-135, 8.32217483209601e+73, -4.03976361621628e-231, NA, 1.16105830823157e-296, 6.02621439200311e-117, 8.52493453349611e-267, -3.31112584039748e-28, 1.97145268229036e+267, -6.45517924440172e-18, -4.27827418540752e+289, -2.80040090197631e-109, -1.17243978706259e-105, 3.36421367032313e-16, 1.70915652178292e-243, 3.49351263005719e-230, -9.9032330303416e+232, -4.64727168508508e-284, -7.65114924609716e-196, -1.13483669278294e+137, 4.09950044746732e-281, 0))
result <- do.call(FeatureHashing:::pair_sort, testlist)

Analyzed functions summary

function name tested inputs inputs with issues
h 3 0
h2 3 3
intToRaw 3 0
merge 3 2
pair_sort 3 3
xi 3 0

Report details

wush978 commented 1 year ago

Thanks. I'll arrange sometimes to take a look.