Remove HermitCrab's analysis-cascade memo - #522
Open
johnml1135 wants to merge 3 commits into
Open
johnml1135 wants to merge 3 commits into
johnml1135 wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #522 +/- ##
==========================================
- Coverage 74.07% 73.90% -0.18%
==========================================
Files 456 453 -3
Lines 38164 38000 -164
Branches 5228 5206 -22
==========================================
- Hits 28270 28083 -187
- Misses 8734 8751 +17
- Partials 1160 1166 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds focused AnalysisMergeKey regressions covering non-head count and per-rule unapplication counts, the two merge-key dimensions the deleted memo tests exercised. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
johnml1135
force-pushed
the
hc/remove-analysis-memo
branch
from
September 25, 2026 22:54
4490f59 to
a84dc6f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Quick summary
Removes HermitCrab's opt-in analysis-cascade memo; the sequential rule cascade
and
MergeEquivalentAnalysesstill work exactly as before. Measured as apackage (#490), it cost 28-32% and ~29 GB on Sena for no net speedup on FLEx's
parallel path. Pruning (#474 landed; #491/#494/#519 open) is untouched and is
where the real parse-time wins come from.
Where to look
AnalysisMergeKey(AnalysisStratumRule.csL226-309) still distinguishes non-head count andper-rule unapplication counts -- pinned by
AnalysisMergeKeyTests.csandMergeEquivalentAnalysesTests.cs.AnalysisScope.cs,AnalysisStateKey.cs,MemoizedCombinationRuleCascade.csdeleted) --
maxDegreeOfParallelismand the sequential cascade are unchanged public API.docs/review/hermitcrab.mdand others).Validation
dotnet build(MSBUILDDISABLENODEREUSE=1) -- succeeded, 0 warnings, 0 errors.dotnet test tests/SIL.Machine.Morphology.HermitCrab.Tests --no-build-- 89 passed, 0 failed.dotnet csharpier check .-- 713 files checked, clean.pwsh -NoProfile -File scripts/comment-hygiene.ps1 -BaseRef origin/master-- clean.git diff origin/master..HEAD --stat-- 16 files, +196/-1520; production diff unchanged, onlyAnalysisMergeKeyTests.csadded../local_check.shwas not run as such; the commands above cover its steps individually.Reading this a year from now
The memo only ran when
maxDegreeOfParallelism == 1and tracing was off. FLEx usesthe default parallelism, so production never executed it. #490's ledger measured
the optimization round as a package: no net speedup, and cross-word memo sharing
was 28-32% slower on Sena and cost ~29 GB of memory. The gains keep coming from
search-space pruning that doesn't need a replay cache: #474 (landed), and #491,
#494, and #519 (open at the time of writing). Those shrink the work instead of
caching it, and they apply on the parallel path FLEx actually uses. The memo was
~1,400 lines of subtle code (
ReplayOntografting, arrival-count bookkeeping)whose correctness depended on an unenforced key invariant (#490, "narrowing that
key breaks correctness with no test failure").
What stays, and why
Morpher(..., maxDegreeOfParallelism)parameter and the sequentialcascade. They are API and still useful without the memo.
MergeEquivalentAnalysesfix. It keyed onAnalysisStateKey; that keynow lives as an internal
AnalysisMergeKeyinAnalysisStratumRule, covering thesame dimensions (shape, stratum, syntactic and realizational feature structures,
non-head count, per-rule unapplication counts).
Prior measurements (not reproduced by this review round)
These are earlier author measurements from the memo-removal work, not commands run
as part of this pass's validation, and no reproducible artifact for them is checked
into the tree:
each, all with at least one parse: analysis multisets (gloss, allomorph identity,
root index, feature structures) were reported identical between master memo-off
and this branch in both default and sequential modes, 25/25 match.
than this branch's sequential mode (e.g. 3,286 ms memo-on vs 3,122 ms without it;
412 vs 350 ms; the rest within noise).
🤖 Generated with Claude Code
This change is