Skip to content

Split octagon autotuner to separate octagonAnalysis and octagonVars autotuners#1952

Open
karoliineh wants to merge 2 commits intomasterfrom
issue-1449
Open

Split octagon autotuner to separate octagonAnalysis and octagonVars autotuners#1952
karoliineh wants to merge 2 commits intomasterfrom
issue-1449

Conversation

@karoliineh
Copy link
Member

Solves #1449

@karoliineh karoliineh added cleanup Refactoring, clean-up usability sv-comp SV-COMP (analyses, results), witnesses precision relational Relational analyses (Apron, affeq, lin2var) labels Mar 5, 2026
@karoliineh karoliineh marked this pull request as ready for review March 5, 2026 15:16
@karoliineh karoliineh requested a review from sim642 March 5, 2026 15:16
Copy link
Member

@michael-schwarz michael-schwarz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should start to document what these autotuners do somehow. Maybe we can have some way they are registered and a command line option to get the description of all autotuners like you can get one for the analyses?

@sim642
Copy link
Member

sim642 commented Mar 9, 2026

We should start to document what these autotuners do somehow. Maybe we can have some way they are registered and a command line option to get the description of all autotuners like you can get one for the analyses?

We don't actually have the analysis descriptions available at runtime. They exist as module documentation in the API docs for now (which isn't too user-friendly but better than none at all).
The command line listing exists for options, but we have so many that it's probably unusable compared to the schema itself.

But documenting the autotuners would definitely be a good idea.
I think for a start there could be a documentation comment in the code, e.g. on its main function that is used in the list of available autotuners.

A separate next step would be to split autotune.ml into individual files (while maintaining git blame history) like the analyses, but that requires a bit of trickery.

@@ -1,4 +1,4 @@
// SKIP PARAM: --enable ana.sv-comp.functions --enable ana.autotune.enabled --set ana.autotune.activated[+] octagon
// SKIP PARAM: --enable ana.sv-comp.functions --enable ana.autotune.enabled --set ana.autotune.activated[+] octagonVars
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why just octagonVars? I'd think that octagonAnalysis also needs to be activated.

And perhaps octagonVars isn't even necessary? Depends on what the test was added to test: the activation of the analysis or the selection of the variables.

Comment on lines +10 to +11
$ goblint --enable ana.autotune.enabled --set ana.autotune.activated[*] octagonVars 38-autotune-octagon-fun.c
[Info] Enabled octagon domain.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So octagonVars also enables octagonAnalysis autotuner implicitly?

I think for #1449 they should be independent.

Comment on lines +426 to +431
let activateOctagonAnalysis () =
set_string "ana.apron.domain" "octagon";
set_auto "ana.activated[+]" "apron";
set_bool "ana.apron.threshold_widening" true;
set_string "ana.apron.threshold_widening_constants" "comparisons";
Logs.info "Enabled octagon domain."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem right without the costs thing. It will always enable octagons if octagonAnalysis autotuner is activated.
That's not much of an autotuner if it just unconditionally activates things which could be activated directly.

I think I wasn't aware of this dependency when I opened #1449. Maybe it's actually impossible to separate them then?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, what I did was to just implement the requirements from the issue:

split the autotuner into two:

  1. octagonAnalysis, which is just in charge of enabling the octagon analysis, but not choosing a subset of the variables.
  2. octagonVars, which is in charge of choosing the variables, i.e. disabling octagon analysis for all other variables (because that's what it's really doing, not enabling for additional variables).

where the main problem was that the option octagon:

implicitly means "disabling octagon analysis for all other variables, even if explicitly enabled by the user".

Due to the separation, the confusing behavior is gone as the option names now better reflect what they actually do.

However, it is true that I did not really consider that the autotuner should actually tune something with each option, which is not the case for octagonAnalysis now.

The reason I separated it the way I did is that the cost calculation depends on the number of selected variables. At first glance, this made it seem like the cost belonged purely to the variable selection step. Because of that, I overlooked the fact that the cost value is later used.

Looking at this again from the perspective of autotuning, I see two possible approaches:

  1. Base the cost on all program variables. The cost calculation for octagonAnalysis could consider all variables present in the program, but I am not sure if we can count these easily with some visitor. I am also not sure if the cost will then ever stay under some threshold that the analysis would even be considered (I haven't looked into how the cost is used).
  2. Actually tune the activation of octagonAnalysis meaningfully Instead of simply enabling it through a portfolio configuration, the tuner could decide whether activating it makes sense based not only on the number of variables but also on their structure, e.g., the presence of patterns that would require relational analyses like y = x + 1;.

It definitely is not impossible to separate them cleanly. The question is whether this change is already worthwhile because it makes the options less confusing, even though one of them does not actually tune anything yet, or whether we should wait and introduce that separation only once we also improve the autotuning of enabling octagon in some way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Refactoring, clean-up precision relational Relational analyses (Apron, affeq, lin2var) sv-comp SV-COMP (analyses, results), witnesses usability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants