Skip to content

HermitCrab synthesis: memoize and hoist Word.ExpandAlternatives (rejected: word clones unchanged at 4,747,013) #584

Closed as not planned

Description

@johnml1135

The experiment memoized the Source recursion in Word.ExpandAlternatives and computed an analysis word's expansion once outside the per-root-candidate loop. It is a memo. It was exact, and was removed from production.

Measured. On 45 Sena words, word clones were unchanged at 4,747,013. Deeper strata did not branch, so the only saving was small temporary list work. The earlier "75% fewer alternatives expanded" figure cannot be attributed to the final diff. A separate duplicate census with the pending-trail content in the key found only 11% of alternatives are duplicates, a 2.28% wall-clock ceiling on Sena (ledger row 16).

Why rejected. It changed no clone count, and the broader deduplication ceiling is below the ledger's 5% close gate.

Record: https://github.com/sillsdev/machine/blob/2eba2f502338705a4d529d7034cecb6303db7f35/docs/rejected-optimizations/alternatives-memo-and-hoist.md
Ledger: https://github.com/sillsdev/machine/blob/2eba2f502338705a4d529d7034cecb6303db7f35/docs/hermitcrab-optimization-ledger.md; disposition: https://github.com/sillsdev/machine/blob/2eba2f502338705a4d529d7034cecb6303db7f35/docs/hermitcrab-perf-2026-09-disposition.md
From #490 (closed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions