C# HermitCrab synthesis generates iiiaiii from aaaa for a simultaneous aa → iii rule, but its own analysis rejects that surface form

Ouverte
#628 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
csharp
Domaine
backend

Piste de recherche

Start with the listed HermitCrab files under src/SIL.Machine.Morphology.HermitCrab/PhonologicalRules/, then trace how simultaneous synthesis and analysis handle overlapping matches in the pinned C# engine. Use the supplied aa → iii grammar with roots aaaa and aa to reproduce the mismatch. Done means synthesis and analysis agree for the literal grammar, or the sources and tests establish that the difference is intended.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Pinned C# HermitCrab (Machine 4d9b454d42a0da35e058641a65596339a79d115b) generates iiiaiii from root aaaa under one simultaneous rule aa → iii, yet its own analysis rejects iiiaiii as a surface form of that root. The same engine's analysis does accept ROOT|iiiaiii in a variant where the input carries an unbound feature variable.

Found while checking a Rust port of HermitCrab in PanGloss (sillsdev/PanGloss#199). The PanGloss port now rejects iiiaiii on analysis, matching C#, but its synthesis still produces iiiaiii, matching C#. The disagreement is inside the C# engine itself, and the sources do not say which behaviour the rule intends.

Next: decide what the rule intends for overlapping simultaneous matches. Then either make C# synthesis and analysis agree, or document the synthesis/analysis difference as intended.

Minimal repro

Grammar (strict XML, fully specified features):

  • Segments: a (+back, -round), i (-back, -round), u (+back, +round).
  • One phonological rule, multipleApplicationOrder="simultaneous", with two a segments as input and three i segments as output:
<PhonologicalRule id="rExpand" multipleApplicationOrder="simultaneous">
  <PhoneticInput><PhoneticSequence><Segment segment="cA" /><Segment segment="cA" /></PhoneticSequence></PhoneticInput>
  <PhonologicalSubrules><PhonologicalSubrule><PhoneticOutput><PhoneticSequence><Segment segment="cI" /><Segment segment="cI" /><Segment segment="cI" /></PhoneticSequence></PhoneticOutput></PhonologicalSubrule></PhonologicalSubrules>
</PhonologicalRule>
  • Two roots: ROOT with shape aaaa and SHORT with shape aa.

Pinned C# run (XmlLanguageLoader.Load, then Morpher.GenerateWords and Morpher.ParseWord), output:

ROOT generate iiiaiii
SHORT generate iii
iii	SHORT|iii
iiiaiii	-
iiiiii	-
aaaa	-

So synthesis from ROOT yields iiiaiii, while analysis of iiiaiii yields no analysis. SHORT|iii is the positive control.

Variant where C# analysis accepts the form

Two input constraints over an unrestricted feature natural class, both carrying the same alpha variable on back (bound on the input side only), with roots ROOT/aaaa and SHORT/aa. Pinned C# generates and analyses iiiaiii as ROOT|iiiaiii. The PanGloss review recorded the same unbound-input behaviour in a second replay, so the literal grammar and this variant disagree within C# analysis.

Source locations

The PanGloss reviews read these files at 4d9b454d (paths confirmed with git ls-tree) under src/SIL.Machine.Morphology.HermitCrab/PhonologicalRules/:

  • SimultaneousPhonologicalPatternRule.cs: the review reads simultaneous synthesis as collecting matches and subrules against the original input before applying RHS operations.
  • AnalysisRewriteRule.cs, FeatureAnalysisRewriteRuleSpec.cs
  • NarrowAnalysisRewriteRuleSpec.cs: the reviewed captured-output guard at lines 67–97 is a different case from this one.

The sources do not name the C# lines that decide overlap selection for the literal grammar. That is the open question.

PanGloss context
  • PanGloss's Rust analysis was changed so that the literal grammar rejects iiiaiii, matching C#. Its generation regression requires the C# synthesis output iiiaiii, so the PanGloss change only touched analysis.
  • A PanGloss review (ba8957dd) proposed matching the unbound-input two-constraint case to C# analysis; the reports do not confirm it has merged.
  • Oracle outputs, fixture files, and review reports are held in PanGloss's review workspace, not in this issue.
Langage dominant
C#
Étoiles
29
Forks
16
Merge moyen
4 j 14 h
PR mergées (30 j)
13

Préparer son environnement

  • Aucun Dockerfile ni fichier Docker Compose
  • Propose un modèle de pull request
  • Aucun guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de sillsdev/machine

Toutes les issues de sillsdev/machine

Issues similaires

Plus d'issues C#

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.