Repository navigation
Trace HermitCrab failure reasons and template slot outcomes - #534
johnml1135 wants to merge 10 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #534 +/- ##
==========================================
+ Coverage 74.57% 75.24% +0.67%
==========================================
Files 453 455 +2
Lines 38342 38590 +248
Branches 5284 5326 +42
==========================================
+ Hits 28593 29038 +445
+ Misses 8583 8416 -167
+ Partials 1166 1136 -30 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@johnml1135 Did you ask Beth about this? I'm worried that this will make it harder to find a needle in a haystack because the haystack will be so much bigger. It may also slow Try A Word down. |
|
@jtmaxwell3 I measured both concerns, on a real Indonesian grammar exported from FLEx (70 wordforms, two compounding rules), comparing the merge-base with this branch. Speed with tracing off (normal parsing): no measurable change. All 70 words give identical parses, and total time is 4.4 s on both, within 2%. Every new callback sits behind Trace size in Try A Word: you were right, and it was worse than the branch description said. Fixed in 371ba39. I haven't timed parsing with tracing on beyond those 40 words. |
This comment has been minimized.
This comment has been minimized.
The suite added Trace.FailureAllomorph so FailureRuleAttributor could credit an affix rule whose allomorph failed an environment or co-occurrence check. That is an engine API change riding in a test-suite PR, and #534 adds the same fact as Trace.Allomorph. Drop it here; the attribution returns with #534. No generated ledger changes: coverage.csv and rules.csv regenerate byte-identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
371ba39 to
9124922
Compare
This comment has been minimized.
This comment has been minimized.
9124922 to
928d7fa
Compare
This comment has been minimized.
This comment has been minimized.
The suite added Trace.FailureAllomorph so FailureRuleAttributor could credit an affix rule whose allomorph failed an environment or co-occurrence check. That is an engine API change riding in a test-suite PR, and #534 adds the same fact as Trace.Allomorph. Drop it here; the attribution returns with #534. No generated ledger changes: coverage.csv and rules.csv regenerate byte-identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3a63132 to
df2cf21
Compare
928d7fa to
54393fd
Compare
This comment has been minimized.
This comment has been minimized.
54393fd to
9bcdcd5
Compare
This comment has been minimized.
This comment has been minimized.
9bcdcd5 to
610c8d6
Compare
|
Verdict: approve. This push rebased onto 2f70c04 and added 610c8d6, which fixes F11. No new findings, and every finding is now closed.
Public API: the PR adds Findings: F1 addressed, F2 addressed, F3 addressed, F4 addressed, F5 withdrawn, F6 addressed, F7 addressed, F8 addressed, F9 withdrawn, F10 addressed, F11 addressed. Reviewed at 610c8d6 |
The suite added Trace.FailureAllomorph so FailureRuleAttributor could credit an affix rule whose allomorph failed an environment or co-occurrence check. That is an engine API change riding in a test-suite PR, and #534 adds the same fact as Trace.Allomorph. Drop it here; the attribution returns with #534. No generated ledger changes: coverage.csv and rules.csv regenerate byte-identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The suite added Trace.FailureAllomorph so FailureRuleAttributor could credit an affix rule whose allomorph failed an environment or co-occurrence check. That is an engine API change riding in a test-suite PR, and #534 adds the same fact as Trace.Allomorph. Drop it here; the attribution returns with #534. No generated ledger changes: coverage.csv and rules.csv regenerate byte-identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
610c8d6 to
fc92b76
Compare
|
@johnml1135: Have you asked Beth about this? I'm worried that they new, detailed trace will provide too much information for the user to find analyses that failed but should have succeeded (e.g. find the needle in the haystack). Have any users reported that TryAWord doesn't provide enough information? |
fc92b76 to
bc97db6
Compare
The suite added Trace.FailureAllomorph so FailureRuleAttributor could credit an affix rule whose allomorph failed an environment or co-occurrence check. That is an engine API change riding in a test-suite PR, and #534 adds the same fact as Trace.Allomorph. Drop it here; the attribution returns with #534. No generated ledger changes: coverage.csv and rules.csv regenerate byte-identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add optional detailed trace callbacks for analysis rejections, slot branches, and completed lexical lookup counts. Retain failure operands, blocking entries, and partial-parse causes in TraceManager without replaying linguistic checks. Preserve the ITraceManager member contract and verify legacy callbacks, parallel slot outcomes, interrupted lookups, and morphological analyses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ITraceManager implementations previously received CompoundingRuleNotUnapplied only for the productivity-restriction rejection, with subrule index -1. This branch had sent them every new compounding gate as well. FieldWorks writes a trace node for each call, so Try A Word would have gained a reasonless failure node per rejected compound analysis. They now receive exactly the original call. Detailed consumers still get every gate with its subrule index. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ting rejection callbacks unchanged Records the rejection callbacks (name, subrule index, input identity, reason, failure object type) a manager implementing only ITraceManager receives across affix, realizational, compounding and partial-parse scenarios. The expected sequences equal what origin/master produces; nine of them fail at this head. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… compounding subrule yields no word Detailed managers still receive the specific Pattern or gate reason; a manager implementing only ITraceManager again gets the three-argument callback with the input at subrule-loop exit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…jections and the per-word Required rejection ITraceManager implementations receive only the Pattern rejection through the extension, and affix subrules report them at loop exit with the input, as before; the gates and the Required rejection reach IDetailedTraceManager only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…IDetailedTraceManager A manager implementing only ITraceManager receives a null failure object for PartialParse at all three raise sites, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tCrab tool Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the present tense Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…unknown, including a compound non-head Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed NonHeadRequired check cloned the word for the trace even when the trace manager was a plain ITraceManager, which drops that reason. Clone only for an IDetailedTraceManager, so Try A Word's tracing cost stays where it was on master. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bc97db6 to
15ad1dd
Compare
|
No new findings. Reviewed at 15ad1dd |
Start here:
src/SIL.Machine.Morphology.HermitCrab/IDetailedTraceManager.cs-- the opt-in interface, enums andPartialParseFailure; thenTraceManager.csfor what Machine retains.Status: open since 2026-10-01, targets master (no longer stacked on #480). CI green on this head: builds on ubuntu and windows, NuGet package, comment hygiene; the
claudejob is skipped.Try A Word cannot show several facts HermitCrab already computes, because they never reach the trace or
TraceManagerdiscards them. This passes them through an optionalIDetailedTraceManagerand retains them in Machine'sTraceManager, without rerunning any linguistic check: the first failed gate of an analysis affix rejection and its operand, template slot outcomes (applied, optional skipped, required unfilled), the cause of a partial parse, yielded-candidate counts per lexical lookup, compounding gates, the blocking lexical entry, and environment failures with all failed alternatives.The unknown a reviewer arrives with is whether existing
ITraceManagerimplementers break. They do not:ITraceManagergains no members, andLegacyTraceManagerTestsrecord its plain callbacks, which match master. Compounding is the one place plain consumers could regress, so they receive only the productivity-restriction rejection with subrule index -1, as before.Where to look:
AnalysisCompoundingRule.csandTraceManagerExtensions.cskeep plain managers on the old callback; detailed ones get the new gates.TraceManager's tree as aCompoundingRuleAnalysisnode with subrule index i (rule-level rejection is -1); successful subrules stayMorphologicalRuleAnalysis.TraceReasonTestscarries the new facts; analyses are unchanged with tracing on or off, sequential or parallel.Not here: the FieldWorks side (
FwXmlTraceManager,FormatHCTrace.xsl; follow-up list below) and the conformance-suite commits for failure attribution, which move to #480 after this merges.Stack and verification: no dependency; #480 follows this. Windows local checks and WSL HermitCrab tests passed at earlier heads of this branch and were not rerun at this head;
./local_check.shwas never run whole, and the full solution test suite has not passed on this tree (details under Evidence).Next: approve, or name the callback shape you want changed.
Reading this a year from now -- start here
HermitCrab's analysis and synthesis rules already know why a candidate failed, but
ITraceManageronly said that it failed. Adding members toITraceManagerwould force every implementer, FieldWorks included, to change, so the facts travel on a second interface (IDetailedTraceManager) that extension methods inTraceManagerExtensionscall only when the manager implements it. Plain managers keep exactly the callbacks they had. The enum additions (TemplateSlotOutcome,PartialParseCause, newFailureReasonvalues) keep existing values.The conformance suite (#480) was deferred, so this PR was retargeted from stacking on it to master. Its two suite-side commits (failure-rule attribution crediting through
Trace.Allomorph, and FieldWorks-producibility rows for the four new failure reasons) are held back and will be added to #480 after this merges.Decisions, and why
ITraceManagermembers: existing implementations stay source- and behaviour-compatible.CompoundingRuleNotUnappliedcall, so sending it the new gates would add reasonless failures to Try A Word.Trace.BlockingEntry). Environment failure already passes the allomorph and all failed alternatives; Machine's trace now retains both, along with the other failure operands (Trace.FailureObject).Evidence
TraceReasonTests(synthetic grammars) covers the facts above, interrupted and interleaved lookups, and analysis equivalence;LegacyTraceManagerTestsrecords plain-manager callbacks, and its expectations were also run onorigin/masterat an earlier head and passed there../local_check.sh --agent-strictpassed on Windows (full solution build and every test project); in WSL the HermitCrab test project,SIL.Machine.Testsand a HermitCrab.Tool Release build (0 warnings) passed; strict comment hygiene was clean. CSharpier was checked from a scratch install because the manifest's tool would not resolve there, solocal_check.shstopped at that step../local_check.shand./local_check.sh --agent-strictexited at the solution build becausecmakeis missing for SentencePiece; the standard rerun also reported MSBuild child-node shutdown errors. These local checks do not collect CI-equivalent coverage../local_check.shas a whole, and the full solution test suite.Deferred, and what would unblock it: FieldWorks follow-up (outside this PR)
File and line references are FieldWorks's tree as last read and were not rechecked here.
IDetailedTraceManagerinFwXmlTraceManager: the reason-bearingMorphologicalRuleNotUnappliedoverload,TemplateSlotProcessed, andLexicalLookupCompleted. Serialize the new operands, branch outcomes and completed counts. Keep lookup/synthesis associations correct inLexicalLookupandSynthesizeWordwhen other trace nodes are inserted.Blockedto serialize the replacement Word's root entry. ExtendCompoundingRuleNotUnappliedto handle each reason, not only productivity restrictions.Failed, serializePartialParseFailure.Causeand its pending rule; forEnvironments, serialize each failed alternative alongside the supplied allomorph instead of passing the collection directly toXElement.NonFinalTemplateAppliedLastandApplicableTemplatesNotAppliedcallbacks already distinguish those two template completion failures.MorphologicalRuleNotApplied, fix theprefixEnv/suffixEnvbranches atFwXmlTraceManager.cs:299-302: they currently writeenvinstead of their own values.FormatHCTrace.xsl:ShowAnyFailure(environment branch near line 597, partial-parse branch near line 661) andShowCompoundingRuleFailure(near line 1149) to show the detailed facts. ExtendShowTracePath(near line 1237), which selects synthesis children ofLexLookupTracebut excludes the lookup node itself, to include empty lookup, slot and blocking events; adjustDetermineIfMoreToShowfor the added nodes. Display unknown phonological causes as unknown.🤖 Generated with Claude Code
This change is