Madhu Sudan

379 papers A* 87A 29B 8Journal 229Unranked 19
YearRankTypeTitle / Venue / Authors
2026 J jnl
CoRR
Amir Azarmehr, Soheil Behnezhad, Alma Ghafari, Madhu Sudan
2025 J jnl
CoRR
Prashanth Amireddy, Amik Raj Behera, Srikanth Srinivasan, Madhu Sudan
2025 J jnl
Electron. Colloquium Comput. Complex.
Prashanth Amireddy, Amik Raj Behera, Srikanth Srinivasan, Madhu Sudan
2025 A* conf
ICALP
Prashanth Amireddy, Amik Raj Behera, Srikanth Srinivasan, Madhu Sudan
2025 A* conf
ICALP
Sanjeev Khanna, Aaron Putterman, Madhu Sudan
2025 J jnl
CoRR
Sanjeev Khanna, Aaron Putterman, Madhu Sudan
2025 J jnl
Electron. Colloquium Comput. Complex.
Madhu Sudan
2025 A* conf
STOC
Sanjeev Khanna, Aaron Putterman, Madhu Sudan
2025 J jnl
CoRR
Prashanth Amireddy, Amik Raj Behera, Srikanth Srinivasan, Madhu Sudan
2025 J jnl
Electron. Colloquium Comput. Complex.
Prashanth Amireddy, Amik Raj Behera, Srikanth Srinivasan, Madhu Sudan
2025 A conf
APPROX/RANDOM
Prashanth Amireddy, Amik Raj Behera, Srikanth Srinivasan, Madhu Sudan
2025 J jnl
CoRR
Prashanth Amireddy, Amik Raj Behera, Srikanth Srinivasan, Madhu Sudan, Sophus Valentin Willumsgaard
2025 J jnl
Electron. Colloquium Comput. Complex.
Prashanth Amireddy, Amik Raj Behera, Srikanth Srinivasan, Madhu Sudan, Sophus Valentin Willumsgaard
2025 A* conf
STOC
Fatemeh Ghasemi, Swastik Kopparty, Madhu Sudan
2025 A* conf
SODA
Prashanth Amireddy, Amik Raj Behera, Manaswi Paraashar, Srikanth Srinivasan, Madhu Sudan
2025 A* conf
FOCS
Amir Azarmehr, Soheil Behnezhad, Alma Ghafari, Madhu Sudan
2025 J jnl
CoRR
Amir Azarmehr, Soheil Behnezhad, Alma Ghafari, Madhu Sudan
2025 A* conf
ICALP
Sanjeev Khanna, Aaron Putterman, Madhu Sudan
2025 J jnl
CoRR
Sanjeev Khanna, Aaron Putterman, Madhu Sudan
2025 J jnl
IEEE Trans. Inf. Theory
Kuan Cheng, Elena Grigorescu, Xin Li, Madhu Sudan, Minshen Zhu
2025 J jnl
CoRR
Cassandra Marcussen, Ronitt Rubinfeld, Madhu Sudan
2025 A* conf
SODA
Raghuvansh R. Saxena, Noah G. Singer, Madhu Sudan, Santhoshini Velusamy
2025 A conf
APPROX/RANDOM
Sumegha Garg, Madhu Sudan, Gabriel Wu
2024 A* conf
ICALP
Sanjeev Khanna, Aaron (Louie) Putterman, Madhu Sudan
2024 J jnl
CoRR
Sanjeev Khanna, Aaron (Louie) Putterman, Madhu Sudan
2024 A* conf
FOCS
Prahladh Harsha, Mrinal Kumar, Ramprasad Saptharishi, Madhu Sudan
2024 J jnl
CoRR
Sanjeev Khanna, Aaron (Louie) Putterman, Madhu Sudan
2024 A* conf
SODA
Sanjeev Khanna, Aaron (Louie) Putterman, Madhu Sudan
2024 J jnl
IEEE Trans. Inf. Theory
Siddharth Bhandari, Prahladh Harsha, Mrinal Kumar, Madhu Sudan
2024 A* conf
COLT
Anna M. Brandenberger, Cassandra Marcussen, Elchanan Mossel, Madhu Sudan
2024 J jnl
CoRR
Anna M. Brandenberger, Cassandra Marcussen, Elchanan Mossel, Madhu Sudan
2024 J jnl
IEEE Trans. Inf. Theory
Siddharth Bhandari, Prahladh Harsha, Mrinal Kumar, Madhu Sudan
2024 J jnl
CoRR
Fatemeh Ghasemi, Swastik Kopparty, Madhu Sudan
2024 J jnl
Electron. Colloquium Comput. Complex.
Fatemeh Ghasemi, Swastik Kopparty, Madhu Sudan
2024 J jnl
IACR Cryptol. ePrint Arch.
Fatemeh Ghasemi, Swastik Kopparty, Madhu Sudan
2024 A* conf
STOC
Prashanth Amireddy, Amik Raj Behera, Manaswi Paraashar, Srikanth Srinivasan, Madhu Sudan
2024 J jnl
CoRR
Prashanth Amireddy, Amik Raj Behera, Manaswi Paraashar, Srikanth Srinivasan, Madhu Sudan
2024 J jnl
Electron. Colloquium Comput. Complex.
Prashanth Amireddy, Amik Raj Behera, Manaswi Paraashar, Srikanth Srinivasan, Madhu Sudan
2024 J jnl
CoRR
Prashanth Amireddy, Amik Raj Behera, Manaswi Paraashar, Srikanth Srinivasan, Madhu Sudan
2024 J jnl
Electron. Colloquium Comput. Complex.
Prashanth Amireddy, Amik Raj Behera, Manaswi Paraashar, Srikanth Srinivasan, Madhu Sudan
2024 A* conf
FOCS
Sanjeev Khanna, Aaron Putterman, Madhu Sudan
2024 J jnl
CoRR
Sanjeev Khanna, Aaron (Louie) Putterman, Madhu Sudan
2024 B conf
ISIT
Kuan Cheng, Elena Grigorescu, Xin Li, Madhu Sudan, Minshen Zhu
2024 J jnl
J. ACM
Chi-Ning Chou, Alexander Golovnev, Madhu Sudan, Santhoshini Velusamy
2024 J jnl
CoRR
Raghuvansh R. Saxena, Noah G. Singer, Madhu Sudan, Santhoshini Velusamy
2024 J jnl
Comput. Complex.
Noah G. Singer, Madhu Sudan, Santhoshini Velusamy
2024 J jnl
CoRR
Sumegha Garg, Madhu Sudan, Gabriel Wu
2023 J jnl
CoRR
Prahladh Harsha, Mrinal Kumar, Ramprasad Saptharishi, Madhu Sudan
2023 J jnl
Electron. Colloquium Comput. Complex.
Prahladh Harsha, Mrinal Kumar, Ramprasad Saptharishi, Madhu Sudan
2023 J jnl
CoRR
Sanjeev Khanna, Aaron (Louie) Putterman, Madhu Sudan
2023 J jnl
CoRR
Anna M. Brandenberger, Cassandra Marcussen, Elchanan Mossel, Madhu Sudan
2023 A* conf
FOCS
Raghuvansh R. Saxena, Noah G. Singer, Madhu Sudan, Santhoshini Velusamy
2023 A conf
ITCS
Omri Ben-Eliezer, Dan Mikulincer, Elchanan Mossel, Madhu Sudan
2023 J jnl
CoRR
Prashanth Amireddy, Srikanth Srinivasan, Madhu Sudan
2023 A conf
APPROX/RANDOM
Prashanth Amireddy, Srikanth Srinivasan, Madhu Sudan
2023 J jnl
CoRR
Kuan Cheng, Elena Grigorescu, Xin Li, Madhu Sudan, Minshen Zhu
2023 A* conf
SODA
Raghuvansh R. Saxena, Noah Singer, Madhu Sudan, Santhoshini Velusamy
2022 J jnl
J. ACM
Jaroslaw Blasiok, Venkatesan Guruswami, Preetum Nakkiran, Atri Rudra, Madhu Sudan
2022 J jnl
CoRR
Omri Ben-Eliezer, Dan Mikulincer, Elchanan Mossel, Madhu Sudan
2022 J jnl
IEEE Trans. Inf. Theory
Elena Grigorescu, Madhu Sudan, Minshen Zhu
2022 A* conf
STOC
Chi-Ning Chou, Alexander Golovnev, Madhu Sudan, Ameya Velingker, Santhoshini Velusamy
2022 J jnl
ACM Trans. Comput. Theory
Noah Singer, Madhu Sudan
2022 A conf
APPROX/RANDOM
Chi-Ning Chou, Alexander Golovnev, Amirbehshad Shahrasbi, Madhu Sudan, Santhoshini Velusamy
2022 J jnl
CoRR
Chi-Ning Chou, Alexander Golovnev, Amirbehshad Shahrasbi, Madhu Sudan, Santhoshini Velusamy
2022 J jnl
Electron. Colloquium Comput. Complex.
Chi-Ning Chou, Alexander Golovnev, Amirbehshad Shahrasbi, Madhu Sudan, Santhoshini Velusamy
2022 A* conf
ICALP
Madhu Sudan
2022 J jnl
CoRR
Madhu Sudan
2022 J jnl
Electron. Colloquium Comput. Complex.
Madhu Sudan
2022 J jnl
CoRR
Raghuvansh R. Saxena, Noah Singer, Madhu Sudan, Santhoshini Velusamy
2022 J jnl
Electron. Colloquium Comput. Complex.
Raghuvansh Saxena, Noah Singer, Madhu Sudan, Santhoshini Velusamy
2022 J jnl
CoRR
Raghuvansh R. Saxena, Noah Singer, Madhu Sudan, Santhoshini Velusamy
2022 J jnl
Electron. Colloquium Comput. Complex.
Raghuvansh Saxena, Noah Singer, Madhu Sudan, Santhoshini Velusamy
2021 J jnl
CoRR
Chi-Ning Chou, Alexander Golovnev, Madhu Sudan, Santhoshini Velusamy
2021 J jnl
Electron. Colloquium Comput. Complex.
Chi-Ning Chou, Alexander Golovnev, Madhu Sudan, Santhoshini Velusamy
2021 A* conf
FOCS
Chi-Ning Chou, Alexander Golovnev, Madhu Sudan, Santhoshini Velusamy
2021 J jnl
CoRR
Chi-Ning Chou, Alexander Golovnev, Madhu Sudan, Santhoshini Velusamy
2021 J jnl
Electron. Colloquium Comput. Complex.
Chi-Ning Chou, Alexander Golovnev, Madhu Sudan, Santhoshini Velusamy
2021 A* conf
STOC
Siddharth Bhandari, Prahladh Harsha, Mrinal Kumar, Madhu Sudan
2021 conf
APPROX-RANDOM
Siddharth Bhandari, Prahladh Harsha, Mrinal Kumar, Madhu Sudan
2021 J jnl
CoRR
Siddharth Bhandari, Prahladh Harsha, Mrinal Kumar, Madhu Sudan
2021 J jnl
Electron. Colloquium Comput. Complex.
Siddharth Bhandari, Prahladh Harsha, Mrinal Kumar, Madhu Sudan
2021 J jnl
CoRR
Omri Ben-Eliezer, Elchanan Mossel, Madhu Sudan
2021 B conf
ISIT
Elena Grigorescu, Madhu Sudan, Minshen Zhu
2021 J jnl
CoRR
Chi-Ning Chou, Alexander Golovnev, Madhu Sudan, Ameya Velingker, Santhoshini Velusamy
2021 J jnl
Electron. Colloquium Comput. Complex.
Chi-Ning Chou, Alexander Golovnev, Madhu Sudan, Ameya Velingker, Santhoshini Velusamy
2021 J jnl
CoRR
Noah Singer, Madhu Sudan
2021 conf
APPROX-RANDOM
Noah Singer, Madhu Sudan, Santhoshini Velusamy
2021 J jnl
CoRR
Noah Singer, Madhu Sudan, Santhoshini Velusamy
2021 J jnl
Electron. Colloquium Comput. Complex.
Noah Singer, Madhu Sudan, Santhoshini Velusamy
2020 J jnl
IEEE Trans. Inf. Theory
Madhu Sudan, Himanshu Tyagi, Shun Watanabe
2020 J jnl
CoRR
Siddharth Bhandari, Prahladh Harsha, Mrinal Kumar, Madhu Sudan
2020 J jnl
Electron. Colloquium Comput. Complex.
Siddharth Bhandari, Prahladh Harsha, Mrinal Kumar, Madhu Sudan
2020 J jnl
CoRR
Elena Grigorescu, Madhu Sudan, Minshen Zhu
2020 J jnl
Random Struct. Algorithms
Mitali Bafna, Srikanth Srinivasan, Madhu Sudan
2020 J jnl
Theory Comput.
Mohammad Bavarian, Badih Ghazi, Elad Haramaty, Pritish Kamath, Ronald L. Rivest, Madhu Sudan
2020 A* conf
SODA
Noah Golowich, Madhu Sudan
2019 J jnl
CoRR
Madhu Sudan, David Xiang
2019 A conf
ITCS
Venkatesan Guruswami, Preetum Nakkiran, Madhu Sudan
2019 J jnl
CoRR
Madhu Sudan, Himanshu Tyagi, Shun Watanabe
2019 A* conf
SODA
Madhu Sudan, Badih Ghazi, Noah Golowich, Mitali Bafna
2019 A* conf
FOCS
Soheil Behnezhad, Mahsa Derakhshan, MohammadTaghi Hajiaghayi, Cliff Stein, Madhu Sudan
2019 J jnl
CoRR
Soheil Behnezhad, Mahsa Derakhshan, MohammadTaghi Hajiaghayi, Cliff Stein, Madhu Sudan
2019 J jnl
CoRR
Noah Golowich, Madhu Sudan
2018 J jnl
CoRR
Venkatesan Guruswami, Preetum Nakkiran, Madhu Sudan
2018 J jnl
Comput. Complex.
Badih Ghazi, Ilan Komargodski, Pravesh K. Kothari, Madhu Sudan
2018 J jnl
CoRR
Mitali Bafna, Badih Ghazi, Noah Golowich, Madhu Sudan
2018 J jnl
Electron. Colloquium Comput. Complex.
Mitali Bafna, Badih Ghazi, Noah Golowich, Madhu Sudan
2018 J jnl
CoRR
Jaroslaw Blasiok, Venkatesan Guruswami, Preetum Nakkiran, Atri Rudra, Madhu Sudan
2018 J jnl
Electron. Colloquium Comput. Complex.
Jaroslaw Blasiok, Venkatesan Guruswami, Preetum Nakkiran, Atri Rudra, Madhu Sudan
2018 A* conf
STOC
Jaroslaw Blasiok, Venkatesan Guruswami, Preetum Nakkiran, Atri Rudra, Madhu Sudan
2018 A conf
ITCS
Srikanth Srinivasan, Madhu Sudan
2018 conf
APPROX-RANDOM
Jaroslaw Blasiok, Venkatesan Guruswami, Madhu Sudan
2018 J jnl
CoRR
Jaroslaw Blasiok, Venkatesan Guruswami, Madhu Sudan
2018 A* conf
ICALP
Bernhard Haeupler, Amirbehshad Shahrasbi, Madhu Sudan
2018 J jnl
CoRR
Bernhard Haeupler, Amirbehshad Shahrasbi, Madhu Sudan
2017 A* conf
SODA
Michael Kapralov, Sanjeev Khanna, Madhu Sudan, Ameya Velingker
2017 J jnl
IEEE Trans. Inf. Theory
Clément L. Canonne, Venkatesan Guruswami, Raghu Meka, Madhu Sudan
2017 A conf
ITCS
Badih Ghazi, Elad Haramaty, Pritish Kamath, Madhu Sudan
2017 J jnl
CoRR
Srikanth Srinivasan, Madhu Sudan
2017 J jnl
Electron. Colloquium Comput. Complex.
Srikanth Srinivasan, Madhu Sudan
2017 J jnl
SIAM J. Comput.
David Gamarnik, Madhu Sudan
2017 J jnl
Comput. Complex.
Eli Ben-Sasson, Noga Ron-Zewi, Madhu Sudan
2017 A* conf
ICALP
Badih Ghazi, Madhu Sudan
2017 J jnl
CoRR
Badih Ghazi, Madhu Sudan
2017 J jnl
Electron. Colloquium Comput. Complex.
Badih Ghazi, Madhu Sudan
2016 A* conf
SODA
Badih Ghazi, Pritish Kamath, Madhu Sudan
2016 A* conf
SODA
Badih Ghazi, Ilan Komargodski, Pravesh Kothari, Madhu Sudan
2016 J jnl
CoRR
Badih Ghazi, Pritish Kamath, Madhu Sudan
2016 J jnl
Electron. Colloquium Comput. Complex.
Badih Ghazi, Pritish Kamath, Madhu Sudan
2016 A* conf
FOCS
Badih Ghazi, Pritish Kamath, Madhu Sudan
2016 J jnl
Algorithmica
Elad Haramaty, Madhu Sudan
2016 A ed.
ITCS
Madhu Sudan
2016 J jnl
CoRR
Mohammad Bavarian, Badih Ghazi, Elad Haramaty, Pritish Kamath, Ronald L. Rivest, Madhu Sudan
2016 J jnl
Electron. Colloquium Comput. Complex.
Mohammad Bavarian, Badih Ghazi, Elad Haramaty, Pritish Kamath, Ronald L. Rivest, Madhu Sudan
2015 J jnl
Theory Comput.
Elad Haramaty, Noga Ron-Zewi, Madhu Sudan
2015 J jnl
CoRR
Badih Ghazi, Pritish Kamath, Madhu Sudan
2015 J jnl
Electron. Colloquium Comput. Complex.
Badih Ghazi, Pritish Kamath, Madhu Sudan
2015 J jnl
CoRR
Ilan Komargodski, Pravesh Kothari, Madhu Sudan
2015 J jnl
Electron. Colloquium Comput. Complex.
Ilan Komargodski, Pravesh Kothari, Madhu Sudan
2015 A conf
ITCS
Clément Louis Canonne, Venkatesan Guruswami, Raghu Meka, Madhu Sudan
2015 A* conf
SODA
Venkatesan Guruswami, Madhu Sudan, Ameya Velingker, Carol Wang
2015 A* conf
FOCS
Alan Guo, Elad Haramaty, Madhu Sudan
2015 J jnl
Electron. Colloquium Comput. Complex.
Alan Guo, Elad Haramaty, Madhu Sudan
2015 A* conf
SODA
Michael Kapralov, Sanjeev Khanna, Madhu Sudan
2014 A* conf
SODA
Michael Kapralov, Sanjeev Khanna, Madhu Sudan
2014 J jnl
CoRR
Clément L. Canonne, Venkatesan Guruswami, Raghu Meka, Madhu Sudan
2014 J jnl
Electron. Colloquium Comput. Complex.
Clément L. Canonne, Venkatesan Guruswami, Raghu Meka, Madhu Sudan
2014 A conf
ITCS
Elad Haramaty, Madhu Sudan
2014 J jnl
Electron. Colloquium Comput. Complex.
Venkatesan Guruswami, Madhu Sudan, Ameya Velingker, Carol Wang
2014 A conf
ITCS
David Gamarnik, Madhu Sudan
2014 conf
APPROX-RANDOM
Alan Guo, Madhu Sudan
2014 J jnl
CoRR
Alan Guo, Madhu Sudan
2014 A* conf
STOC
Mohsen Ghaffari, Bernhard Haeupler, Madhu Sudan
2014 J jnl
CoRR
David Gamarnik, Madhu Sudan
2014 J jnl
CoRR
Michael Kapralov, Sanjeev Khanna, Madhu Sudan
2013 J jnl
Comput. Complex.
Elena Grigorescu, Tali Kaufman, Madhu Sudan
2013 J jnl
Theory Comput.
Noga Ron-Zewi, Madhu Sudan
2013 conf
APPROX-RANDOM
Elad Haramaty, Noga Ron-Zewi, Madhu Sudan
2013 J jnl
Electron. Colloquium Comput. Complex.
Elad Haramaty, Noga Ron-Zewi, Madhu Sudan
2013 J jnl
SIAM J. Comput.
Zeev Dvir, Swastik Kopparty, Shubhangi Saraf, Madhu Sudan
2013 J jnl
CoRR
David Gamarnik, Madhu Sudan
2013 J jnl
Electron. Colloquium Comput. Complex.
David Gamarnik, Madhu Sudan
2013 A conf
ITCS
Alan Guo, Swastik Kopparty, Madhu Sudan
2013 J jnl
CoRR
Mohsen Ghaffari, Bernhard Haeupler, Madhu Sudan
2013 J jnl
SIAM J. Comput.
Elad Haramaty, Amir Shpilka, Madhu Sudan
2013 J jnl
SIGMETRICS Perform. Evaluation Rev.
Joel Spencer, Madhu Sudan, Kuang Xu
2013 J jnl
CoRR
Katalin Friedl, Madhu Sudan
2012 conf
APPROX-RANDOM
Noga Ron-Zewi, Madhu Sudan
2012 J jnl
CoRR
Noga Ron-Zewi, Madhu Sudan
2012 J jnl
Electron. Colloquium Comput. Complex.
Madhu Sudan, Noga Zewi
2012 J jnl
J. ACM
Oded Goldreich, Brendan Juba, Madhu Sudan
2012 B conf
ITW
Madhu Sudan
2012 J jnl
CoRR
Elad Haramaty, Madhu Sudan
2012 J jnl
Electron. Colloquium Comput. Complex.
Elad Haramaty, Madhu Sudan
2012 J jnl
CoRR
Alan Guo, Madhu Sudan
2012 J jnl
Electron. Colloquium Comput. Complex.
Alan Guo, Swastik Kopparty, Madhu Sudan
2012 J jnl
Electron. Colloquium Comput. Complex.
Alan Guo, Madhu Sudan
2012 J jnl
CoRR
Joel Spencer, Madhu Sudan, Kuang Xu
2012 J jnl
Electron. Colloquium Comput. Complex.
Alan Guo, Madhu Sudan
2012 A* conf
FOCS
Eli Ben-Sasson, Noga Ron-Zewi, Madhu Sudan
2012 J jnl
Electron. Colloquium Comput. Complex.
Eli Ben-Sasson, Noga Ron-Zewi, Madhu Sudan
2012 J jnl
SIAM J. Discret. Math.
Elena Grigorescu, Tali Kaufman, Madhu Sudan
2011 A* conf
PODC
Oded Goldreich, Brendan Juba, Madhu Sudan
2011 A conf
ICS
Brendan Juba, Adam Tauman Kalai, Sanjeev Khanna, Madhu Sudan
2011 A* conf
FOCS
Sanjeev Khanna, Madhu Sudan
2011 J jnl
CoRR
Sanjeev Khanna, Madhu Sudan
2011 J jnl
Games Econ. Behav.
Gagan Aggarwal, Amos Fiat, Andrew V. Goldberg, Jason D. Hartline, Nicole Immorlica, Madhu Sudan
2011 A conf
ICS
Brendan Juba, Madhu Sudan
2011 ch.
Studies in Complexity and Cryptography
Oded Goldreich, Madhu Sudan, Luca Trevisan
2011 J jnl
SIGACT News
Madhu Sudan
2011 conf
APPROX-RANDOM
Eli Ben-Sasson, Madhu Sudan
2011 conf
APPROX-RANDOM
Eli Ben-Sasson, Elena Grigorescu, Ghid Maatouk, Amir Shpilka, Madhu Sudan
2011 J jnl
Electron. Colloquium Comput. Complex.
Eli Ben-Sasson, Elena Grigorescu, Ghid Maatouk, Amir Shpilka, Madhu Sudan
2011 A* conf
FOCS
Elad Haramaty, Amir Shpilka, Madhu Sudan
2011 J jnl
Electron. Colloquium Comput. Complex.
Elad Haramaty, Amir Shpilka, Madhu Sudan
2011 J jnl
Commun. ACM
Madhu Sudan
2011 conf
FSTTCS
Madhu Sudan
2011 A conf
ICS
Victor Chen, Madhu Sudan, Ning Xie
2011 A conf
CCC
Eli Ben-Sasson, Ghid Maatouk, Amir Shpilka, Madhu Sudan
2011 J jnl
Electron. Colloquium Comput. Complex.
Madhu Sudan
2011 J jnl
Theory Comput.
Arnab Bhattacharyya, Victor Chen, Madhu Sudan, Ning Xie
2010 J jnl
Electron. Colloquium Comput. Complex.
Brendan Juba, Madhu Sudan
2010 ch.
Property Testing
Madhu Sudan
2010 J jnl
Electron. Colloquium Comput. Complex.
Madhu Sudan
2010 J jnl
Electron. Colloquium Comput. Complex.
Eli Ben-Sasson, Madhu Sudan
2010 J jnl
SIAM J. Comput.
Eli Ben-Sasson, Venkatesan Guruswami, Tali Kaufman, Madhu Sudan, Michael Viderman
2010 J jnl
IEEE Trans. Inf. Theory
Silvio Micali, Chris Peikert, Madhu Sudan, David A. Wilson
2010 A* conf
FOCS
Arnab Bhattacharyya, Swastik Kopparty, Grant Schoenebeck, Madhu Sudan, David Zuckerman
2010 ch.
Property Testing
Arnab Bhattacharyya, Swastik Kopparty, Grant Schoenebeck, Madhu Sudan, David Zuckerman
2010 J jnl
CoRR
Victor Chen, Madhu Sudan, Ning Xie
2010 J jnl
Electron. Colloquium Comput. Complex.
Victor Chen, Madhu Sudan, Ning Xie
2010 J jnl
Electron. Colloquium Comput. Complex.
Eli Ben-Sasson, Ghid Maatouk, Amir Shpilka, Madhu Sudan
2010 ch.
Property Testing
Arnab Bhattacharyya, Victor Chen, Madhu Sudan, Ning Xie
2010 J jnl
Electron. Colloquium Comput. Complex.
Arnab Bhattacharyya, Victor Chen, Madhu Sudan, Ning Xie
2010 B conf
ISIT
Adam Kalai, Michael Mitzenmacher, Madhu Sudan
2009 J jnl
Electron. Colloquium Comput. Complex.
Oded Goldreich, Brendan Juba, Madhu Sudan
2009 A* conf
FOCS
Zeev Dvir, Swastik Kopparty, Shubhangi Saraf, Madhu Sudan
2009 J jnl
Electron. Colloquium Comput. Complex.
Zeev Dvir, Swastik Kopparty, Shubhangi Saraf, Madhu Sudan
2009 A conf
CCC
Eli Ben-Sasson, Venkatesan Guruswami, Tali Kaufman, Madhu Sudan, Michael Viderman
2009 J jnl
Electron. Colloquium Comput. Complex.
Eli Ben-Sasson, Venkatesan Guruswami, Tali Kaufman, Madhu Sudan, Michael Viderman
2009 J jnl
CoRR
Arnab Bhattacharyya, Swastik Kopparty, Grant Schoenebeck, Madhu Sudan, David Zuckerman
2009 J jnl
Electron. Colloquium Comput. Complex.
Arnab Bhattacharyya, Swastik Kopparty, Grant Schoenebeck, Madhu Sudan, David Zuckerman
2009 J jnl
Commun. ACM
Madhu Sudan
2009 J jnl
CoRR
Elena Grigorescu, Tali Kaufman, Madhu Sudan
2009 conf
APPROX-RANDOM
Elena Grigorescu, Tali Kaufman, Madhu Sudan
2009 J jnl
Electron. Colloquium Comput. Complex.
Elena Grigorescu, Tali Kaufman, Madhu Sudan
2009 A conf
STACS
Arnab Bhattacharyya, Victor Chen, Madhu Sudan, Ning Xie
2008 A conf
CCC
Elena Grigorescu, Tali Kaufman, Madhu Sudan
2008 J jnl
Electron. Colloquium Comput. Complex.
Elena Grigorescu, Tali Kaufman, Madhu Sudan
2008 B conf
ISSAC
Madhu Sudan
2008 A* conf
STOC
Tali Kaufman, Madhu Sudan
2008 J jnl
Electron. Colloquium Comput. Complex.
Irit Dinur, Elena Grigorescu, Swastik Kopparty, Madhu Sudan
2008 A* conf
STOC
Irit Dinur, Elena Grigorescu, Swastik Kopparty, Madhu Sudan
2008 J jnl
SIAM J. Comput.
Eli Ben-Sasson, Madhu Sudan
2008 J jnl
Electron. Colloquium Comput. Complex.
Arnab Bhattacharyya, Victor Chen, Madhu Sudan, Ning Xie
2008 J jnl
Electron. Colloquium Comput. Complex.
Brendan Juba, Madhu Sudan
2008 A* conf
STOC
Brendan Juba, Madhu Sudan
2007 J jnl
Electron. Colloquium Comput. Complex.
Tali Kaufman, Madhu Sudan
2007 A* conf
CRYPTO
Ran Canetti, Ronald L. Rivest, Madhu Sudan, Luca Trevisan, Salil P. Vadhan, Hoeteck Wee
2007 J jnl
ACM Trans. Algorithms
Noga Alon, Venkatesan Guruswami, Tali Kaufman, Madhu Sudan
2007 A* conf
FOCS
Tali Kaufman, Madhu Sudan
2007 J jnl
Electron. Colloquium Comput. Complex.
Tali Kaufman, Madhu Sudan
2007 J jnl
Electron. Colloquium Comput. Complex.
Brendan Juba, Madhu Sudan
2006 J jnl
Des. Codes Cryptogr.
Ari Juels, Madhu Sudan
2006 J jnl
Networks
Lars Engebretsen, Madhu Sudan
2006 conf
APPROX-RANDOM
Elena Grigorescu, Swastik Kopparty, Madhu Sudan
2006 J jnl
J. ACM
Oded Goldreich, Madhu Sudan
2006 B conf
LATIN
Madhu Sudan
2006 conf
APPROX-RANDOM
Irit Dinur, Madhu Sudan, Avi Wigderson
2006 J jnl
Electron. Colloquium Comput. Complex.
Irit Dinur, Madhu Sudan, Avi Wigderson
2006 J jnl
SIAM J. Comput.
Eli Ben-Sasson, Oded Goldreich, Prahladh Harsha, Madhu Sudan, Salil P. Vadhan
2006 J jnl
Random Struct. Algorithms
Eli Ben-Sasson, Madhu Sudan
2006 J jnl
SIAM J. Comput.
Oded Goldreich, Madhu Sudan
2005 A* conf
STOC
Gagan Aggarwal, Amos Fiat, Andrew V. Goldberg, Jason D. Hartline, Nicole Immorlica, Madhu Sudan
2005 A conf
DISC
Shafi Goldwasser, Madhu Sudan, Vinod Vaikuntanathan
2005 B conf
TCC
Silvio Micali, Chris Peikert, Madhu Sudan, David A. Wilson
2005 A conf
CCC
Eli Ben-Sasson, Oded Goldreich, Prahladh Harsha, Madhu Sudan, Salil P. Vadhan
2005 A* conf
STOC
Eli Ben-Sasson, Madhu Sudan
2004 J jnl
Electron. Colloquium Comput. Complex.
Oded Goldreich, Madhu Sudan, Luca Trevisan
2004 ch.
Computational Complexity Theory
Madhu Sudan
2004 J jnl
CoRR
Eli Ben-Sasson, Madhu Sudan
2004 J jnl
Electron. Colloquium Comput. Complex.
Eli Ben-Sasson, Madhu Sudan
2004 conf
APPROX-RANDOM
Eli Ben-Sasson, Madhu Sudan
2004 J jnl
Electron. Colloquium Comput. Complex.
Eli Ben-Sasson, Oded Goldreich, Prahladh Harsha, Madhu Sudan, Salil P. Vadhan
2004 A* conf
STOC
Eli Ben-Sasson, Oded Goldreich, Prahladh Harsha, Madhu Sudan, Salil P. Vadhan
2004 J jnl
Electron. Colloquium Comput. Complex.
Eli Ben-Sasson, Madhu Sudan
2003 conf
RANDOM-APPROX
Eli Ben-Sasson, Oded Goldreich, Madhu Sudan
2003 J jnl
Electron. Colloquium Comput. Complex.
Eli Ben-Sasson, Oded Goldreich, Madhu Sudan
2003 J jnl
IEEE Trans. Inf. Theory
Ilya Dumer, Daniele Micciancio, Madhu Sudan
2003 J jnl
Comb.
Sanjeev Arora, Madhu Sudan
2003 A* conf
STOC
Eli Ben-Sasson, Madhu Sudan, Salil P. Vadhan, Avi Wigderson
2003 A* conf
STOC
Don Coppersmith, Madhu Sudan
2002 J jnl
IACR Cryptol. ePrint Arch.
Ari Juels, Madhu Sudan
2002 J jnl
IEEE Trans. Inf. Theory
Venkatesan Guruswami, Johan Håstad, Madhu Sudan, David Zuckerman
2002 A conf
CCC
Venkatesan Guruswami, Madhu Sudan
2002 J jnl
J. Comput. Syst. Sci.
Madhu Sudan
2002 A* conf
SODA
Noga Alon, Venkatesan Guruswami, Tali Kaufman, Madhu Sudan
2002 J jnl
SIAM J. Comput.
Venkatesan Guruswami, Johan Håstad, Madhu Sudan
2002 A* conf
SODA
Lars Engebretsen, Madhu Sudan
2002 J jnl
Electron. Colloquium Comput. Complex.
Oded Goldreich, Madhu Sudan
2002 A* conf
FOCS
Oded Goldreich, Madhu Sudan
2001 J jnl
J. ACM
Allan Borodin, Jon M. Kleinberg, Prabhakar Raghavan, Madhu Sudan, David P. Williamson
2001 A* conf
FOCS
Madhu Sudan
2001 book
Complexity classifications of Boolean constraint satisfaction problems.
Nadia Creignou, Sanjeev Khanna, Madhu Sudan
2001 conf
AAECC
Madhu Sudan
2001 J jnl
J. Comput. Syst. Sci.
Yonatan Aumann, Johan Håstad, Michael O. Rabin, Madhu Sudan
2001 J jnl
IEEE Trans. Inf. Theory
Venkatesan Guruswami, Madhu Sudan
2001 J jnl
J. Comput. Syst. Sci.
Madhu Sudan, Luca Trevisan, Salil P. Vadhan
2001 A conf
STACS
Prahladh Harsha, Madhu Sudan
2000 A* conf
FOCS
Venkatesan Guruswami, Amit Sahai, Madhu Sudan
2000 J jnl
IEEE Trans. Inf. Theory
Oded Goldreich, Dana Ron, Madhu Sudan
2000 J jnl
SIAM J. Comput.
Luca Trevisan, Gregory B. Sorkin, Madhu Sudan, David P. Williamson
2000 A* conf
FOCS
Venkatesan Guruswami, Johan Håstad, Madhu Sudan
2000 J jnl
Electron. Colloquium Comput. Complex.
Venkatesan Guruswami, Johan Håstad, Madhu Sudan
2000 J jnl
SIAM J. Discret. Math.
Oded Goldreich, Ronitt Rubinfeld, Madhu Sudan
2000 conf
IFIP TCS
Madhu Sudan
2000 A* conf
STOC
Venkatesan Guruswami, Madhu Sudan
2000 J jnl
SIGACT News
Madhu Sudan
2000 A conf
ESA
Venkatesan Guruswami, Madhu Sudan
2000 A* conf
STOC
Ronald Fagin, Anna R. Karlin, Jon M. Kleinberg, Prabhakar Raghavan, Sridhar Rajagopalan, Ronitt Rubinfeld, Madhu Sudan, Andrew Tomkins
2000 J jnl
Electron. Colloquium Comput. Complex.
Prahladh Harsha, Madhu Sudan
2000 J jnl
Comput. Complex.
Prahladh Harsha, Madhu Sudan
2000 J jnl
SIAM J. Comput.
Sanjeev Khanna, Madhu Sudan, Luca Trevisan, David P. Williamson
1999 A* conf
STOC
Oded Goldreich, Dana Ron, Madhu Sudan
1999 J jnl
IACR Cryptol. ePrint Arch.
Oded Goldreich, Dana Ron, Madhu Sudan
1999 J jnl
J. Comput. Syst. Sci.
Oded Goldreich, Madhu Sudan
1999 J jnl
Electron. Colloquium Comput. Complex.
Ilya Dumer, Daniele Micciancio, Madhu Sudan
1999 A* conf
FOCS
Ilya Dumer, Daniele Micciancio, Madhu Sudan
1999 J jnl
IEEE Trans. Inf. Theory
Venkatesan Guruswami, Madhu Sudan
1999 J jnl
Electron. Colloquium Comput. Complex.
Yonatan Aumann, Johan Håstad, Michael O. Rabin, Madhu Sudan
1999 conf
RANDOM-APPROX
Yonatan Aumann, Johan Håstad, Michael O. Rabin, Madhu Sudan
1999 A* conf
STOC
Madhu Sudan, Luca Trevisan, Salil P. Vadhan
1999 A conf
CCC
Madhu Sudan, Luca Trevisan, Salil P. Vadhan
1998 J jnl
SIAM J. Discret. Math.
Benny Chor, Madhu Sudan
1998 A* conf
FOCS
Venkatesan Guruswami, Daniel Lewin, Madhu Sudan, Luca Trevisan
1998 J jnl
Electron. Colloquium Comput. Complex.
Venkatesan Guruswami, Daniel Lewin, Madhu Sudan, Luca Trevisan
1998 J jnl
CoRR
David R. Karger, Rajeev Motwani, Madhu Sudan
1998 J jnl
J. ACM
David R. Karger, Rajeev Motwani, Madhu Sudan
1998 J jnl
Algorithmica
Guy Even, Joseph Naor, Baruch Schieber, Madhu Sudan
1998 J jnl
Electron. Colloquium Comput. Complex.
Oded Goldreich, Dana Ron, Madhu Sudan
1998 J jnl
Electron. Colloquium Comput. Complex.
Oded Goldreich, Madhu Sudan
1998 A conf
CCC
Oded Goldreich, Madhu Sudan
1998 J jnl
SIAM J. Comput.
Mihir Bellare, Oded Goldreich, Madhu Sudan
1998 J jnl
SIAM J. Comput.
Amotz Bar-Noy, Alain J. Mayer, Baruch Schieber, Madhu Sudan
1998 A* conf
FOCS
Venkatesan Guruswami, Madhu Sudan
1998 J jnl
Electron. Colloquium Comput. Complex.
Venkatesan Guruswami, Madhu Sudan
1998 J jnl
Electron. Colloquium Comput. Complex.
Oded Goldreich, Ronitt Rubinfeld, Madhu Sudan
1998 J jnl
SIAM J. Comput.
Sanjeev Khanna, Rajeev Motwani, Madhu Sudan, Umesh V. Vazirani
1998 J jnl
J. ACM
Benny Chor, Eyal Kushilevitz, Oded Goldreich, Madhu Sudan
1998 A* conf
FOCS
Madhu Sudan, Luca Trevisan
1998 J jnl
Electron. Colloquium Comput. Complex.
Madhu Sudan, Luca Trevisan
1998 J jnl
J. ACM
Sanjeev Arora, Carsten Lund, Rajeev Motwani, Madhu Sudan, Mario Szegedy
1998 J jnl
Electron. Colloquium Comput. Complex.
Sanjeev Arora, Carsten Lund, Rajeev Motwani, Madhu Sudan, Mario Szegedy
1998 J jnl
Electron. Colloquium Comput. Complex.
Madhu Sudan, Luca Trevisan, Salil P. Vadhan
1998 J jnl
SIAM J. Comput.
Sigal Ar, Richard J. Lipton, Ronitt Rubinfeld, Madhu Sudan
1997 A* conf
STOC
Sanjeev Khanna, Madhu Sudan, David P. Williamson
1997 J jnl
Future Gener. Comput. Syst.
Jonathan R. M. Hosking, Edwin P. D. Pednault, Madhu Sudan
1997 conf
FSTTCS
Madhu Sudan
1997 A conf
CCC
Sanjeev Khanna, Madhu Sudan, Luca Trevisan
1997 J jnl
J. Complex.
Madhu Sudan
1997 A* conf
STOC
Sanjeev Arora, Madhu Sudan
1997 J jnl
Electron. Colloquium Comput. Complex.
Sanjeev Arora, Madhu Sudan
1996 J jnl
Electron. Colloquium Comput. Complex.
Sanjeev Khanna, Madhu Sudan, David P. Williamson
1996 A* conf
STOC
Allan Borodin, Jon M. Kleinberg, Prabhakar Raghavan, Madhu Sudan, David P. Williamson
1996 J jnl
Electron. Colloquium Comput. Complex.
Sanjeev Khanna, Madhu Sudan, Luca Trevisan
1996 J jnl
J. ACM
Alok Aggarwal, Amotz Bar-Noy, Don Coppersmith, Rajiv Ramaswami, Baruch Schieber, Madhu Sudan
1996 A* conf
FOCS
Luca Trevisan, Gregory B. Sorkin, Madhu Sudan, David P. Williamson
1996 J jnl
IEEE Trans. Inf. Theory
Mihir Bellare, Don Coppersmith, Johan Håstad, Marcos A. Kiwi, Madhu Sudan
1996 A* conf
FOCS
Madhu Sudan
1996 J jnl
IEEE Trans. Inf. Theory
Andres Albanese, Johannes Blömer, Jeff Edmonds, Michael Luby, Madhu Sudan
1996 J jnl
SIAM J. Comput.
Ronitt Rubinfeld, Madhu Sudan
1996 J jnl
Electron. Colloquium Comput. Complex.
Sanjeev Khanna, Madhu Sudan
1995 A conf
ESA
Benny Chor, Madhu Sudan
1995 B conf
IPCO
Guy Even, Joseph Naor, Baruch Schieber, Madhu Sudan
1995 book
Madhu Sudan
1995 J jnl
Electron. Colloquium Comput. Complex.
Mihir Bellare, Oded Goldreich, Madhu Sudan
1995 A* conf
FOCS
Mihir Bellare, Oded Goldreich, Madhu Sudan
1995 A* conf
SODA
Amotz Bar-Noy, Alain J. Mayer, Baruch Schieber, Madhu Sudan
1995 A* conf
FOCS
Oded Goldreich, Ronitt Rubinfeld, Madhu Sudan
1995 A* conf
FOCS
Mihir Bellare, Don Coppersmith, Johan Håstad, Marcos A. Kiwi, Madhu Sudan
1995 J jnl
Electron. Colloquium Comput. Complex.
Sanjeev Khanna, Rajeev Motwani, Madhu Sudan, Umesh V. Vazirani
1995 A* conf
FOCS
Benny Chor, Oded Goldreich, Eyal Kushilevitz, Madhu Sudan
1995 conf
ISTCS
Katalin Friedl, Madhu Sudan
1994 A* conf
FOCS
David R. Karger, Rajeev Motwani, Madhu Sudan
1994 J jnl
Discret. Appl. Math.
Rajeev Motwani, Madhu Sudan
1994 A* conf
SODA
Alok Aggarwal, Amotz Bar-Noy, Don Coppersmith, Rajiv Ramaswami, Baruch Schieber, Madhu Sudan
1994 A* conf
STOC
Mihir Bellare, Madhu Sudan
1994 A* conf
FOCS
Christos H. Papadimitriou, Prabhakar Raghavan, Madhu Sudan, Hisao Tamaki
1994 A* conf
FOCS
Sanjeev Khanna, Rajeev Motwani, Madhu Sudan, Umesh V. Vazirani
1994 J jnl
CoRR
Avrim Blum, Prasad Chalasani, Don Coppersmith, William R. Pulleyblank, Prabhakar Raghavan, Madhu Sudan
1994 J jnl
Algorithmica
Marshall W. Bern, Daniel H. Greene, Arvind Raghunathan, Madhu Sudan
1994 A* conf
FOCS
Andres Albanese, Johannes Blömer, Jeff Edmonds, Michael Luby, Madhu Sudan
1994 A* conf
STOC
Avrim Blum, Prasad Chalasani, Don Coppersmith, William R. Pulleyblank, Prabhakar Raghavan, Madhu Sudan
1992 J jnl
Inf. Process. Lett.
Peter Gemmell, Madhu Sudan
1992 A* conf
FOCS
Sanjeev Arora, Carsten Lund, Rajeev Motwani, Madhu Sudan, Mario Szegedy
1992 A* conf
FOCS
Sigal Ar, Richard J. Lipton, Ronitt Rubinfeld, Madhu Sudan
1992 A* conf
SODA
Ronitt Rubinfeld, Madhu Sudan
1991 A* conf
STOC
Peter Gemmell, Richard J. Lipton, Ronitt Rubinfeld, Madhu Sudan, Avi Wigderson
1990 A* conf
STOC
Marshall W. Bern, Daniel H. Greene, Arvind Raghunathan, Madhu Sudan
tests/unit/test_smali_normalization.py
← Index tests/unit/test_smali_normalization.py python
"""Unit tests for smali semantic normalization.

Tests the three normalization levels (category, opcode, opcode_api),
opcode categorization, ACFG feature index mapping, and integration
with MinHash computation.
"""
import pytest

pytestmark = [pytest.mark.unit, pytest.mark.apk, pytest.mark.decompile]


class TestCategorizeOpcode:
    """Tests for opcode -> semantic category mapping."""

    def test_arithmetic(self):
        from redb.extractors.decompiler.apk.smali_normalization import categorize_opcode
        assert categorize_opcode("add-int") == "ALU"
        assert categorize_opcode("mul-long/2addr") == "ALU"
        assert categorize_opcode("neg-int") == "ALU"

    def test_data_movement(self):
        from redb.extractors.decompiler.apk.smali_normalization import categorize_opcode
        assert categorize_opcode("move-result") == "MOV"
        assert categorize_opcode("const/4") == "CONST"
        assert categorize_opcode("const-string") == "CONST"

    def test_memory_access(self):
        from redb.extractors.decompiler.apk.smali_normalization import categorize_opcode
        assert categorize_opcode("iget-object") == "LOAD"
        assert categorize_opcode("sput-wide") == "STORE"
        assert categorize_opcode("aget-byte") == "LOAD"

    def test_invocation(self):
        from redb.extractors.decompiler.apk.smali_normalization import categorize_opcode
        assert categorize_opcode("invoke-virtual") == "CALL"
        assert categorize_opcode("invoke-static") == "CALL"
        assert categorize_opcode("invoke-direct") == "CALL"

    def test_control_flow(self):
        from redb.extractors.decompiler.apk.smali_normalization import categorize_opcode
        assert categorize_opcode("if-eqz") == "BRANCH"
        assert categorize_opcode("goto") == "JMP"
        assert categorize_opcode("goto/16") == "JMP"
        assert categorize_opcode("return-void") == "RET"

    def test_comparison(self):
        from redb.extractors.decompiler.apk.smali_normalization import categorize_opcode
        assert categorize_opcode("cmp-long") == "CMP"
        assert categorize_opcode("cmpl-float") == "CMP"
        assert categorize_opcode("cmpg-double") == "CMP"

    def test_conversion(self):
        from redb.extractors.decompiler.apk.smali_normalization import categorize_opcode
        assert categorize_opcode("int-to-long") == "CONV"
        assert categorize_opcode("float-to-int") == "CONV"

    def test_object_type(self):
        from redb.extractors.decompiler.apk.smali_normalization import categorize_opcode
        assert categorize_opcode("new-instance") == "ALLOC"
        assert categorize_opcode("check-cast") == "TYPE"
        assert categorize_opcode("instance-of") == "TYPE"

    def test_exception_sync(self):
        from redb.extractors.decompiler.apk.smali_normalization import categorize_opcode
        assert categorize_opcode("throw") == "EXC"
        assert categorize_opcode("monitor-enter") == "SYNC"

    def test_unknown(self):
        from redb.extractors.decompiler.apk.smali_normalization import categorize_opcode
        assert categorize_opcode("nop") == "OTHER"


class TestNormalizeInstruction:
    """Tests for single instruction normalization at various levels."""

    def test_category_level(self):
        from redb.extractors.decompiler.apk.smali_normalization import normalize_instruction
        assert normalize_instruction("add-int v0, v1, v2", "category") == "ALU"
        assert normalize_instruction("invoke-virtual {p0}, Lcom/Foo;->bar()V", "category") == "CALL"
        assert normalize_instruction("return-void", "category") == "RET"

    def test_opcode_level_strips_width(self):
        from redb.extractors.decompiler.apk.smali_normalization import normalize_instruction
        # Width variants collapse to same base
        assert normalize_instruction("add-int v0, v1, v2", "opcode") == "add"
        assert normalize_instruction("add-long v0, v2, v4", "opcode") == "add"
        assert normalize_instruction("add-float v0, v1, v2", "opcode") == "add"
        # Addressing modes collapse too
        assert normalize_instruction("add-int/2addr v0, v1", "opcode") == "add"

    def test_opcode_api_invoke(self):
        from redb.extractors.decompiler.apk.smali_normalization import normalize_instruction
        result = normalize_instruction(
            "invoke-virtual {p0, v0}, Lcom/example/Foo;->bar(I)V"
        )
        assert result == "CALL Lcom/example/Foo;->bar(I)V"

    def test_opcode_api_invoke_no_ref(self):
        from redb.extractors.decompiler.apk.smali_normalization import normalize_instruction
        # If somehow no method ref is found, fallback to CALL
        assert normalize_instruction("invoke-virtual {v0}") == "CALL"

    def test_opcode_api_field_load(self):
        from redb.extractors.decompiler.apk.smali_normalization import normalize_instruction
        result = normalize_instruction(
            "iget-object v0, p0, Lcom/Foo;->mField:Ljava/lang/String;"
        )
        assert result == "LOAD Lcom/Foo;->mField:Ljava/lang/String;"

    def test_opcode_api_field_store(self):
        from redb.extractors.decompiler.apk.smali_normalization import normalize_instruction
        result = normalize_instruction(
            "iput-object v0, p0, Lcom/Foo;->mField:Ljava/lang/String;"
        )
        assert result == "STORE Lcom/Foo;->mField:Ljava/lang/String;"

    def test_opcode_api_androguard_field_format(self):
        """androguard uses space instead of colon in field references."""
        from redb.extractors.decompiler.apk.smali_normalization import normalize_instruction
        result = normalize_instruction(
            "iget-object v0, p0, Lcom/Foo;->mField Ljava/lang/String;"
        )
        assert result.startswith("LOAD")
        assert "Lcom/Foo;->mField" in result

    def test_opcode_api_new_instance(self):
        from redb.extractors.decompiler.apk.smali_normalization import normalize_instruction
        result = normalize_instruction(
            "new-instance v0, Lcom/example/MyClass;"
        )
        assert result == "ALLOC Lcom/example/MyClass;"

    def test_opcode_api_const_string(self):
        from redb.extractors.decompiler.apk.smali_normalization import normalize_instruction
        result = normalize_instruction(
            'const-string v0, "hello world"'
        )
        assert result == 'CONST_STR "hello world"'

    def test_opcode_api_const_string_jumbo(self):
        from redb.extractors.decompiler.apk.smali_normalization import normalize_instruction
        result = normalize_instruction(
            'const-string/jumbo v0, "large string"'
        )
        assert result == 'CONST_STR "large string"'

    def test_opcode_api_fallback_to_category(self):
        from redb.extractors.decompiler.apk.smali_normalization import normalize_instruction
        # Non-special instructions fall back to category
        assert normalize_instruction("add-int v0, v1, v2") == "ALU"
        assert normalize_instruction("return-void") == "RET"
        assert normalize_instruction("nop") == "OTHER"

    def test_empty_input(self):
        from redb.extractors.decompiler.apk.smali_normalization import normalize_instruction
        assert normalize_instruction("") == ""
        assert normalize_instruction("   ") == ""


class TestNormalizeMethodBody:
    """Tests for full method body normalization."""

    def test_filters_directives_labels_comments(self):
        from redb.extractors.decompiler.apk.smali_normalization import normalize_method_body
        body = """\
.locals 2
# comment
:label_0
add-int v0, v1, v2
.line 42
invoke-virtual {p0}, Lcom/Foo;->bar()V
return-void
"""
        result = normalize_method_body(body, "category")
        assert result == ["ALU", "CALL", "RET"]

    def test_opcode_api_preserves_api_refs(self):
        from redb.extractors.decompiler.apk.smali_normalization import normalize_method_body
        body = """\
const/4 v0, 0x0
invoke-virtual {p0, v0}, Lcom/Foo;->setX(I)V
iget-object v1, p0, Lcom/Foo;->name:Ljava/lang/String;
return-void
"""
        result = normalize_method_body(body, "opcode_api")
        assert result[0] == "CONST"
        assert result[1] == "CALL Lcom/Foo;->setX(I)V"
        assert result[2] == "LOAD Lcom/Foo;->name:Ljava/lang/String;"
        assert result[3] == "RET"

    def test_empty_body(self):
        from redb.extractors.decompiler.apk.smali_normalization import normalize_method_body
        assert normalize_method_body("") == []
        assert normalize_method_body("\n\n") == []


class TestNormalizationWithMinHash:
    """Integration tests: normalization + MinHash computation."""

    def test_minhash_returns_signature(self):
        from redb.extractors.decompiler.apk.method_extractor import compute_minhash
        body = """\
const/4 v0, 0x0
invoke-virtual {p0, v0}, Lcom/Foo;->bar(I)V
iget-object v1, p0, Lcom/Foo;->name:Ljava/lang/String;
add-int v2, v0, v1
return-void
"""
        sig = compute_minhash(body)
        assert sig is not None
        assert len(sig) == 64
        assert all(0 <= v < 256 for v in sig)

    def test_minhash_register_invariance(self):
        """Same operations with different registers should produce identical signatures."""
        from redb.extractors.decompiler.apk.method_extractor import compute_minhash
        body_a = """\
const/4 v0, 0x0
invoke-virtual {p0, v0}, Lcom/Foo;->bar(I)V
iget-object v1, p0, Lcom/Foo;->name:Ljava/lang/String;
add-int v2, v0, v1
return-void
"""
        body_b = """\
const/4 v3, 0x0
invoke-virtual {p1, v3}, Lcom/Foo;->bar(I)V
iget-object v4, p1, Lcom/Foo;->name:Ljava/lang/String;
add-int v5, v3, v4
return-void
"""
        sig_a = compute_minhash(body_a)
        sig_b = compute_minhash(body_b)
        assert sig_a == sig_b

    def test_minhash_width_invariance(self):
        """Width variants of same operations should produce identical signatures."""
        from redb.extractors.decompiler.apk.method_extractor import compute_minhash
        body_int = """\
add-int v0, v1, v2
sub-int v3, v0, v1
mul-int v4, v0, v3
return v4
"""
        body_long = """\
add-long v0, v2, v4
sub-long v6, v0, v2
mul-long v8, v0, v6
return-wide v8
"""
        sig_int = compute_minhash(body_int)
        sig_long = compute_minhash(body_long)
        # Both normalize to ALU, ALU, ALU, RET -> identical
        assert sig_int == sig_long

    def test_minhash_different_apis_differ(self):
        """Methods calling different APIs should produce different signatures."""
        from redb.extractors.decompiler.apk.method_extractor import compute_minhash
        body_a = """\
const/4 v0, 0x0
invoke-virtual {p0, v0}, Lcom/crypto/AES;->encrypt([B)[B
invoke-virtual {v0}, Ljava/io/OutputStream;->write([B)V
return-void
"""
        body_b = """\
const/4 v0, 0x0
invoke-virtual {p0, v0}, Ljava/lang/String;->length()I
invoke-virtual {v0}, Ljava/io/PrintStream;->println(I)V
return-void
"""
        sig_a = compute_minhash(body_a)
        sig_b = compute_minhash(body_b)
        assert sig_a != sig_b

    def test_minhash_too_few_instructions(self):
        from redb.extractors.decompiler.apk.method_extractor import compute_minhash
        assert compute_minhash("return-void\nnop") is None


class TestACFGBlockFeatures:
    """Tests for per-block ACFG feature extraction via smali_cfg."""

    def test_simple_linear_method(self):
        from redb.extractors.decompiler.apk.smali_cfg import compute_cfg_metrics
        body = """\
add-int v0, v1, v2
invoke-virtual {p0}, Lcom/Foo;->bar()V
return-void
"""
        metrics = compute_cfg_metrics(body)
        assert metrics.block_count >= 1
        assert len(metrics.block_features) == metrics.block_count
        # Each feature vector has 8 elements
        for feat in metrics.block_features:
            assert len(feat) == 8

    def test_branching_method_has_multiple_blocks(self):
        from redb.extractors.decompiler.apk.smali_cfg import compute_cfg_metrics
        body = """\
const/4 v0, 0x0
if-eqz v0, :cond_0
invoke-virtual {p0}, Lcom/Foo;->a()V
goto :goto_0
:cond_0
invoke-virtual {p0}, Lcom/Foo;->b()V
:goto_0
return-void
"""
        metrics = compute_cfg_metrics(body)
        assert metrics.block_count >= 3
        assert len(metrics.block_features) == metrics.block_count

    def test_feature_vector_arithmetic_count(self):
        from redb.extractors.decompiler.apk.smali_cfg import compute_cfg_metrics
        body = """\
add-int v0, v1, v2
sub-int v3, v0, v1
mul-int v4, v0, v3
return v4
"""
        metrics = compute_cfg_metrics(body)
        assert len(metrics.block_features) == 1
        feat = metrics.block_features[0]
        # feat[0] = instr_count (4), feat[1] = arithmetic (3)
        assert feat[0] == 4
        assert feat[1] >= 3  # 3 ALU ops

    def test_feature_vector_call_count(self):
        from redb.extractors.decompiler.apk.smali_cfg import compute_cfg_metrics
        body = """\
invoke-virtual {p0}, Lcom/A;->a()V
invoke-static {v0}, Lcom/B;->b()V
return-void
"""
        metrics = compute_cfg_metrics(body)
        feat = metrics.block_features[0]
        # feat[4] = call count
        assert feat[4] == 2