Anders429 / word_filter

A Word Filter for filtering text.
Apache License 2.0
1 stars 0 forks source link

Flaky Results #4

Closed Anders429 closed 3 years ago

Anders429 commented 3 years ago

In using a larger WordFilter as a Lazy static using once_cell, flaky behavior is encountered. Sometimes tests pass, sometimes they don't, and it is unclear why.

It seems that flakiness is introduced when dealing with aliases specifically. Perhaps it is due to an incorrect usage of Pin?

Anders429 commented 3 years ago

After a lot of searching, it turns out the problem is actually with adding new aliases. This commit resolves the issue.

The real question is why. It seems that at times the traversal stopped early for some reason, as a consequence of addresses stored on a completely separate branch of alias-searching. The only thing I can figure is that perhaps ordering of the aliases was different on different runs? Or perhaps some were being falsely found within the HashSet, and this removal clears out those issues.

Regardless, this fix allows the system to work again at a larger scale. Closing for now. Hope it doesn't come back lol.

Anders429 commented 3 years ago

As a side note, I'm going to yank 0.1.5, since this was a regression from 0.1.3.

Anders429 commented 3 years ago

One morr note: the cause of the flaky behavior is due to the alias map being iterated over and applied to root, meaning the order would be different each run. This is what led to the inconsistency. Therefore, it has nothing to do with the use of ByAddress.

I believe the actual error is still due to not traversing every alias path, although I'm not sure why that would occur, since the traversal is always depth first. Regardless, this at least explains the flakiness.