Differential cost analysis with simultaneous potentials and anti-potentials

We present a novel approach to differential cost analysis that, given a program revision, attempts to statically bound the difference in resource usage, or cost, between the two program versions. Differential cost analysis is particularly interesting because of the many compelling applications for i...

Full description

Saved in:
Bibliographic Details
Main Authors: ZIKELIC, Dorde, CHANG, Bor-Yuh Evan, BOLIGNANO, Pauline, RAIMONDI, Franco
Format: text
Language:English
Published: Institutional Knowledge at Singapore Management University 2022
Subjects:
Online Access:https://ink.library.smu.edu.sg/sis_research/9062
https://ink.library.smu.edu.sg/context/sis_research/article/10065/viewcontent/3519939.3523435.pdf
Tags: Add Tag
No Tags, Be the first to tag this record!
Institution: Singapore Management University
Language: English
id sg-smu-ink.sis_research-10065
record_format dspace
spelling sg-smu-ink.sis_research-100652024-08-01T15:32:32Z Differential cost analysis with simultaneous potentials and anti-potentials ZIKELIC, Dorde CHANG, Bor-Yuh Evan BOLIGNANO, Pauline RAIMONDI, Franco We present a novel approach to differential cost analysis that, given a program revision, attempts to statically bound the difference in resource usage, or cost, between the two program versions. Differential cost analysis is particularly interesting because of the many compelling applications for it, such as detecting resource-use regressions at code-review time or proving the absence of certain side-channel vulnerabilities. One prior approach to differential cost analysis is to apply relational reasoning that conceptually constructs a product program on which one can over-approximate the difference in costs between the two program versions. However, a significant challenge in any relational approach is effectively aligning the program versions to get precise results. In this paper, our key insight is that we can avoid the need for and the limitations of program alignment if, instead, we bound the difference of two cost-bound summaries rather than directly bounding the concrete cost difference. In particular our method computes a threshold value for the maximal difference in cost between two program versions simultaneously using two kinds of cost-bound summaries—a potential function that evaluates to an upper bound for the cost incurred in the first program and an anti-potential function that evaluates to a lower bound for the cost incurred in the second. Our method has a number of desirable properties: it can be fully automated, it allows optimizing the threshold value on relative cost, it is suitable for programs that are not syntactically similar, and it supports non-determinism. We have evaluated an implementation of our approach on a number of program pairs collected from the literature, and we find that our method computes tight threshold values on relative cost in most examples. 2022-06-01T07:00:00Z text application/pdf https://ink.library.smu.edu.sg/sis_research/9062 info:doi/10.1145/3519939.3523435 https://ink.library.smu.edu.sg/context/sis_research/article/10065/viewcontent/3519939.3523435.pdf http://creativecommons.org/licenses/by-nc-nd/4.0/ Research Collection School Of Computing and Information Systems eng Institutional Knowledge at Singapore Management University Differential cost analysis Cost analysis Relational reasoning Potential functions Programming Languages and Compilers
institution Singapore Management University
building SMU Libraries
continent Asia
country Singapore
Singapore
content_provider SMU Libraries
collection InK@SMU
language English
topic Differential cost analysis
Cost analysis
Relational reasoning
Potential functions
Programming Languages and Compilers
spellingShingle Differential cost analysis
Cost analysis
Relational reasoning
Potential functions
Programming Languages and Compilers
ZIKELIC, Dorde
CHANG, Bor-Yuh Evan
BOLIGNANO, Pauline
RAIMONDI, Franco
Differential cost analysis with simultaneous potentials and anti-potentials
description We present a novel approach to differential cost analysis that, given a program revision, attempts to statically bound the difference in resource usage, or cost, between the two program versions. Differential cost analysis is particularly interesting because of the many compelling applications for it, such as detecting resource-use regressions at code-review time or proving the absence of certain side-channel vulnerabilities. One prior approach to differential cost analysis is to apply relational reasoning that conceptually constructs a product program on which one can over-approximate the difference in costs between the two program versions. However, a significant challenge in any relational approach is effectively aligning the program versions to get precise results. In this paper, our key insight is that we can avoid the need for and the limitations of program alignment if, instead, we bound the difference of two cost-bound summaries rather than directly bounding the concrete cost difference. In particular our method computes a threshold value for the maximal difference in cost between two program versions simultaneously using two kinds of cost-bound summaries—a potential function that evaluates to an upper bound for the cost incurred in the first program and an anti-potential function that evaluates to a lower bound for the cost incurred in the second. Our method has a number of desirable properties: it can be fully automated, it allows optimizing the threshold value on relative cost, it is suitable for programs that are not syntactically similar, and it supports non-determinism. We have evaluated an implementation of our approach on a number of program pairs collected from the literature, and we find that our method computes tight threshold values on relative cost in most examples.
format text
author ZIKELIC, Dorde
CHANG, Bor-Yuh Evan
BOLIGNANO, Pauline
RAIMONDI, Franco
author_facet ZIKELIC, Dorde
CHANG, Bor-Yuh Evan
BOLIGNANO, Pauline
RAIMONDI, Franco
author_sort ZIKELIC, Dorde
title Differential cost analysis with simultaneous potentials and anti-potentials
title_short Differential cost analysis with simultaneous potentials and anti-potentials
title_full Differential cost analysis with simultaneous potentials and anti-potentials
title_fullStr Differential cost analysis with simultaneous potentials and anti-potentials
title_full_unstemmed Differential cost analysis with simultaneous potentials and anti-potentials
title_sort differential cost analysis with simultaneous potentials and anti-potentials
publisher Institutional Knowledge at Singapore Management University
publishDate 2022
url https://ink.library.smu.edu.sg/sis_research/9062
https://ink.library.smu.edu.sg/context/sis_research/article/10065/viewcontent/3519939.3523435.pdf
_version_ 1814047720840626176