Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resources not being used up correctly when there are missing items #756

Closed
wants to merge 1 commit into from

Conversation

raoulvdberge
Copy link
Contributor

This now always makes it so that output resources are being added to the internal storage.
If we do not do this, when there are missing resources, and we have the same ingredient being used multiple times, it would start from scratch for each of that same
ingredient, causing a calculation that needs too many resources.
So we have to always return resources so they can be reused later down the line, even if there are missing resources. However, we must use these resources up correctly
if we do end up with missing resources!
Otherwise, if another ingredient needs this resource later down the calculation, it will use them when it's not allowed to (the yields of the child calculation must be used up...)
See #612

This now always makes it so that output resources are being
added to the internal storage.
If we do not do this, when there are missing resources,
and we have the same ingredient being used multiple times,
it would start from scratch for each of that same
ingredient, causing a calculation that needs too many
resources.
So we have to *always* return resources so they can be
reused later down the line, even if there are missing resources.
However, we must use these resources up correctly
if we do end up with missing resources!
Otherwise, if another ingredient needs this resource
later down the calculation, it will use them when it's
not allowed to (the yields of the child calculation must
be used up...)
@raoulvdberge raoulvdberge force-pushed the NO-ISSUE/fix/calculation-bug branch from c173636 to 6bd658a Compare December 26, 2024 20:35
@raoulvdberge raoulvdberge deleted the NO-ISSUE/fix/calculation-bug branch December 26, 2024 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant