Monitoring for budget pressure, prover abuse - #90
Conversation
Adds nudges to the agent to give up/try something new; refuse to run the prover on "let's just try a timeout again" case
jar-ben
left a comment
There was a problem hiding this comment.
Left some comments. The high-level approaches here look good; I think both the budget constraints and the check for "looping over the same prover input" can be helpful (and I think it would solve the real issue we have seen).
|
|
||
| if len(state['prover_history']) > 0: | ||
| last_item = state["prover_history"][-1] | ||
| if last_item["sort"] == "run" and any(i == "TIMEOUT" for (_,i) in last_item) and last_item["spec_digest"] == spec_hash: |
There was a problem hiding this comment.
Why only timeouts? verified rules, violated rules, sanity failures, .., are also not transient
There was a problem hiding this comment.
that's a great point actually.
|
|
||
| if len(state['prover_history']) > 0: | ||
| last_item = state["prover_history"][-1] | ||
| if last_item["sort"] == "run" and any(i == "TIMEOUT" for (_,i) in last_item) and last_item["spec_digest"] == spec_hash: |
There was a problem hiding this comment.
last_item["spec_digest"] == spec_hash is it possible in the current (or intended future) workflow that the .spec remains the same, but the .conf or .sol files changed? In such situations, a rerun makes sense.
There was a problem hiding this comment.
yeah, this assumes the only thing the agent can change is the spec. That's true currently, but will change. we'll have to digest the conf and/or VFS once those changes land.
ericeil
left a comment
There was a problem hiding this comment.
I like the use of context vars for this; it feels like a good fix for "ambient" data that would be a pain to pass around explicitly everywhere. I left some naive comments, but overall the mechanism looks good to me.

Uses the monitoring feature of Certora/graphcore#24 to add two monitors:
Budget cancellation is co-operative, if the agent is overbudget/under budget pressure, it throws a special exception which is interpreted as the appropriate "I give up" type (only for the verification tasks).
As mentioned, there is a per cost center budget and a total "overall run" budget. The sum of cost center budgets does not necessarily have to be the overall budget, in fact, it is expected to be greater. This was chosen over a strict allocation of the total budget to different centers, with some arcane budget rebalancing for unused costs.
As part of this, and as predicted by @shellygr, we have moved the pricing information out of the display subsystem into the
llm/module. We also more accurately track 1hr vs 5m cache costs, as this matters when computing budget pressure.