Closed Zannick closed 1 month ago
That last change fixed another issue we hadn't noticed at all: with an Option, insert
replaces the stored value with the one provided, so every observation bitflag was actually only one flag ever.
This fix actually has a large negative impact on performance... sometimes... which I take to mean there's more contention on updating the trie or the solution collector. The program is still quite good otherwise: I had a peak of 28k/s throughput for 100000-200000, but when it has solutions to process it gets much slower, down into the hundreds per 100k step.
I imagine we should treat collecting singleton items like Set, to reduce the number of flags in earlier steps.
Actually, it may be that we're running out of states to process... I see threads blocked in rayon waiting for work and not for a lock in axiom_verge2. That probably means we haven't put enough in the queue and what's actually there is being held by threads who grab several at a time to work on. So this is technically okay although I would like to speed up part of the initial solution processing (the mutations for example could be immediately put in instead of waiting for all of them... if it were easier to write a generator function).
I believe this is working, although there are still not-quite-ideal quirks showing up in the best solution that will be investigated in another issue.
Since we look at observations in reverse order of step execution, we may see the following things:
The observations we should have are:
This means that within actions and prices, modifications must apply to observations:
What we have right now:
I believe this may mean we have this:
We may need to add a observation debug output to see for sure. Even if we modify in Set, it's still kind of convoluted that affordability observation is calculated one way for the first observation only (step N) and another way for every other one (step N-1 etc state diff updates).