Repository navigation
Improve the performance of LexicalLookup - #627
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #627 +/- ##
==========================================
- Coverage 75.33% 75.29% -0.04%
==========================================
Files 454 454
Lines 38509 38524 +15
Branches 5335 5337 +2
==========================================
- Hits 29010 29008 -2
- Misses 8364 8377 +13
- Partials 1135 1139 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Public API, target framework, package, machine.py parity: None verified. Findings: F1 addressed, F2 addressed, F3 accepted (no benchmark), F4 addressed (cost partly reintroduced by the F8 fix, noted in F8), F5 addressed, F6 addressed, F7 addressed, F8 addressed. Reviewed at d10da37 |
| .Where(LexEntrySelector) | ||
| .Distinct() | ||
| ) | ||
| foreach (RootAllomorph allomorph in SearchRootAllomorphs(input.Stratum, input.Shape)) |
There was a problem hiding this comment.
Dropping the siblings of matched allomorphs changes output, not just speed, and I think the new behaviour is right. With a FLEx deletion rule i -> 0 / [u,i] _ at the default Deletion Reapplications (0), entry BU with allomorphs buii and bui / _ [C], and the word bu: analysis reaches only bui, whose environment fails in synthesis. Master still parses bu because it also proposes the sibling buii; without the bui allomorph, master finds nothing either. This branch gives the same answer both ways. Please add a test that pins this and a sentence in the PR body saying sibling allomorphs are no longer proposed.
| foreach (RootAllomorph allomorph in entry.Allomorphs) | ||
| if ((allomorph.Morpheme is LexEntry entry) && LexEntrySelector(entry)) | ||
| { | ||
| Word newWord = input.Clone(); |
There was a problem hiding this comment.
This check now uses entry.SyntacticFeatureStruct, so it can move above Clone() (and the tracing), which saves a Word per rejected candidate.
johnml1135
left a comment
There was a problem hiding this comment.
I compared #627 (d10da37) with master on the fieldworks-parser-conformance suite and our HC reference grammars. No parse changed.
- Conformance suite: 145 fixture runs and 16 stress fixtures. The per-word output is byte-identical.
- Amharic (673 words), Aweti (206), Indonesian (70), Sena (1,000) and Mbugwe (130): the same analyses for every word.
None of these words reaches the sibling-allomorph case, so this shows the change is safe on our data rather than that it never changes output. The test I asked for at Morpher.cs:438 would pin that case. Swahili and Cebuano are FieldWorks projects only, so they weren't run here.
|
No new findings. Reviewed at d26dd37 |
|
No new findings. Reviewed at 64a0250 |
* Improve the performance of LexicalLookup * Fix issues found by Claude * Fix F1 * Fix F8 * Fix problems reported by Johnml1135 * Create new FailureReason to avoid confusion (cherry picked from commit 1eae226)
This improves the performance of LexicalLookup in two ways:
This change is