twsearch icon indicating copy to clipboard operation
twsearch copied to clipboard

Use a `HashSet` to track target patterns.

Open lgarron opened this issue 10 months ago • 2 comments

I have a draft at https://github.com/cubing/twsearch/compare/lgarron/TargetPatternCache but it will take some design work because:

  1. I don't want SemiGroupActionPuzzle to require Pattern: Hash (since it's not needed when searching for a single target).
  2. I don't want an automatic fallback to a slower method when Pattern: Hash is not implemented.

Note that Rust doesn't have negative traits, so we can implement where TPuzzle:Pattern: Hash but not where TPuzzle:Pattern: !Hash. We can hang this off of SearchOptimizations if we need, but it needs to interoperate with HashPruneTable and I'm worried that adding even more type constraints to the codebase to make this work would confuse everyone other than me.

lgarron avatar Mar 15 '25 01:03 lgarron

Can't we just plug in a trait?

-tom

On Fri, Mar 14, 2025 at 6:40 PM Lucas Garron @.***> wrote:

I have a draft at https://github.com/cubing/twsearch/compare/lgarron/TargetPatternCache but it will take some design because:

  1. I don't want SemiGroupActionPuzzle to require Pattern: Hash (since it's not needed when searching for a single target).
  2. I don't want an automatic fallback to a slower method when Pattern: Hash is not implemented.

— Reply to this email directly, view it on GitHub https://github.com/cubing/twsearch/issues/127, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMOLSYODZ5WQPKKEDKZFQD2UOAHJAVCNFSM6AAAAABZB45IFCVHI2DSMVQWIX3LMV43ASLTON2WKOZSHEZDCNJZGQ2DEOI . You are receiving this because you are subscribed to this thread.Message ID: @.***> [image: lgarron]lgarron created an issue (cubing/twsearch#127) https://github.com/cubing/twsearch/issues/127

I have a draft at https://github.com/cubing/twsearch/compare/lgarron/TargetPatternCache but it will take some design because:

  1. I don't want SemiGroupActionPuzzle to require Pattern: Hash (since it's not needed when searching for a single target).
  2. I don't want an automatic fallback to a slower method when Pattern: Hash is not implemented.

— Reply to this email directly, view it on GitHub https://github.com/cubing/twsearch/issues/127, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMOLSYODZ5WQPKKEDKZFQD2UOAHJAVCNFSM6AAAAABZB45IFCVHI2DSMVQWIX3LMV43ASLTON2WKOZSHEZDCNJZGQ2DEOI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

--

rokicki avatar Mar 15 '25 01:03 rokicki

Can't we just plug in a trait?

Sure, but "just" is doing a lot of heavy lifting. 😛

lgarron avatar Mar 15 '25 02:03 lgarron