Quantum Taco Consumption

fronobulax

Developer
Staff member
In the process of fixing a divide by zero error there was some discussion of quantum tacos. See https://kolmafia.us/threads/divide-...tum-taco-consuming-astral-energy-drink.28941/ and https://github.com/kolmafia/kolmafia/pull/1759

The focus was on EatItemRequest.maximumUses(...) which in most cases just computes how many of an item can be eaten using the current available space and the fullness of an item. AFAIK the returned value is not really visible to users or scripts. It is used to determine some aspects of the Item Manager consumption display and when actually making a request to KoL.

Quantum tacos have zero fullness, currently, which is how they got involved in the divide by zero discussion and fix. But you cannot actually eat a QT according to KoL unless you have 2 fullness available. The amount of fullness actually used is random.

There was a suggestion that the "correct" value of maximumUses was just the remaining fullness divided by two (and that change could be done by making the entry in fullness.txt 2 instead of 0). But no matter what the value of maximumUses is, any kind of loop using it while consuming will have to recompute the value after every taco and possibly exit.

The discussion was tabled but I said I'd try and keep it from getting lost.

Some if anyone sees anything unexpected in the consumption of QTs since r27421 then it should be reported or discussed here, at least initially

If I am wrong in how EatItemRequest.maximumUses(...) is used and how that usage would be visible to the user then there should be a discussion of the right answer.

But for the moment I am just keeping the discussion available since my personal opinion is that the status quo since r27421 is acceptable.
 

MCroft

Developer
Staff member
Well, it didn't change for the worse, as far as I can tell.

When we get to this, Schrödinger's thermos is also randomized, but it doesn't have a consumption limit, since it's booze.
 

fronobulax

Developer
Staff member
Well, it didn't change for the worse, as far as I can tell.
Didn't expect it to :)

As a concept the maximum uses of a QT is merely a prediction and the value is either zero or a positive integer, one or greater. You need two fullness to initiate the consumption but the fullness after is not determined by subtracting two. AFAIK the only thing the value actually does is prevent server hits from trying to consume too many QTs because of an outdated knowledge of fullness. But the question caused concern so....
 

MCroft

Developer
Staff member
yeah, if it was immediately obvious to me what the right answer was, I'd've suggested we implement it. That's a strange consumable.
 

MCroft

Developer
Staff member
The maximum uses is visible in the Item Manager and, with a fullness of 15/15, shows "1 current", which is not the case. It's a minor flaw I can correct by selling that damn QT that I will never eat.

1687631580343.png
 

fronobulax

Developer
Staff member
One possible is the correct answer as long as current fullness is 2 or greater.

That's what this is about. Is some other number besides zero or one "more correct"?

Maybe you need to just eat the taco and then it won't matter :)
 
Top