HermitCrab: do literal-identity and natural-class restoration on hc.dll match the port's fixes? (unmeasured)

Ouverte
#609 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é
4/5
Temps estimé
3-5 jours
Accessibilité débutants
48/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
csharp
Domaine
backend, testing

Piste de recherche

Read PanGloss CHANGELOG origin/main lines 202–230 and docs/hermitcrab-2026-10-21-search-cost-round.md lines 59–113, then inspect the C# implementation in hc.dll for the two described identity/restoration patterns. Replay both patterns and count steps; add conformance cases to #480 for any divergence, or record that C# already matches. The issue does not name a specific test or code entry point.

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

Description

Claude-drafted.

Two identity fixes cut the PanGloss port's work sharply, and nobody has replayed them on hc.dll. Affix literal segments match only themselves on large featureless inventories: 98.5% less work on 7 spot words. Deleted natural-class members restore only their class: 94.7% less work on a 7,206-word list. Both were measured on the port (HC-Rust) only, in its own work units.

What we know:

  • The port's changelog says the literal fix matches HermitCrab ("as in HermitCrab", 0.9.0, line 233). The class fix cites divergence entry 103 and makes no such claim (line 209).
  • The ledger says C# gives a featureless segment a StrRep EqualTo constraint, so its literal matches only itself. That is in the code at CharacterDefinitionTable.cs#L73-L74. For the class case the ledger says C# unifies against the class's StrRep union, with no code reference (inferred).
  • The port ran 18 lookups on the slowest word on C#'s own export, against 49 for C# and 1,655 on its own snapshot. That gap is what led to both fixes.

Not known: whether hc.dll's work steps match the port's after the fixes, for either pattern.

Proposed change (C#): replay the two patterns on hc.dll and count steps. Add conformance cases to #480 for any divergence. If C# already behaves this way, record that.

Related: #480 (open). PanGloss: sillsdev/PanGloss#111 (the pointer issue for this one, open); the fixes are in PanGloss CHANGELOG 0.9.0 (divergence entries 090 and 103).

Next: replay both patterns on hc.dll and count work steps.


Evidence -- the port-side measurements
  • Literal identity (ledger row 24): 7 spot words 98.5% less work (2,365,602 to 35,913); worst variant 99.8% less (50,778,583 to 83,677); steps on full lists fell 46-55x. Parses identical on three private lists and on Amharic, Sena and Indonesian.
  • Natural-class restoration (ledger row 25): held list of 7,206 words 94.7% less work (303,966,311 to 16,220,190); the 16 words that hit a 1 s limit 99.9% less. Parses identical everywhere.
  • Cause of A: above 64 character definitions the port lost the literal's identity, so an enclitic matched any final segment. Cause of B: the port's re-inserted class node matched any segment and its root trie ignored the member set.
  • The three lookup counts (49, 18, 1,655) were supplied to that round and not reproduced by it.
Method rule -- how the bugs were found

Run the port on the oracle's own export of the same grammar and compare a cheap count, such as lookups per word. A large gap between the port's two inputs is a port bug. The round's rule: do this before measuring any algorithmic lead on a port.

Sources -- pinned
Langage dominant
C#
Étoiles
29
Forks
16
Merge moyen
5 j 16 h
PR mergées (30 j)
10

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.