HermitCrab analysis can spin on simultaneous rewrites with incompatible environments
维护者通常 1 天内回复
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 58/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- csharp
- 领域
- backend, testing-qa
调研方向
Start with AnalysisRewriteRule.cs around the SelfOpaquing selection and reapplication loop, then inspect SimultaneousPhonologicalPatternRule.cs and its no-match behavior. Add regression cases for the three reduced shapes in the issue and check that reapplication stops when a simultaneous rule makes no change. The issue does not identify test file paths, so locate the existing analysis rewrite tests before adding cases; verify the cases terminate and produce the expected parses.
由索引模型根据 Issue 内容生成。
描述
HermitCrab’s C# analysis parser can hang indefinitely in a simultaneous rewrite when a replacement segment conflicts with an environment segment, consuming one CPU core; the pinned hc.dll reproduced all three reported shapes.
- Minimal segment case: one-feature
t → d / _ a, underlyingta, parseda. - Alpha-input case: input
[nasal:+, α(place)], outputm, environment_ pwithpnasal−; parse prefixedmp. - Underlying realization case: one rule
ʔ → - / _ V[+vocalic], underlyingʔa, parse-a. - Suspected source:
AnalysisRewriteRule.Applyselects an unboundedSelfOpaquingloop when RHS and environment feature structures are incompatible;SimultaneousPhonologicalPatternRule.Applyreturns a word even when it finds no matches. - Not known: whether synthesis has the same reapplication behavior.
Next: add regression cases for these reduced shapes and make self-opaquing reapplication stop when the simultaneous rule makes no change.
Reproduction and evidence
Replayed with the Release HermitCrab CLI from Machine commit 4d9b454d42a0da35e058641a65596339a79d115b using dotnet hc.dll -i <grammar.xml> -s <script>. The three original inputs each timed out at 45 seconds; all reduced shapes timed out at 10 seconds. Each timeout used a captured process PID and direct SIGTERM. Reduced runs sampled 107–112% CPU on one process. Compatible-output, no-environment, and feature-removal controls completed promptly.
At the pin, AnalysisRewriteRule.cs:47-69 selects SelfOpaquing after the RHS/environment FeatureStruct.IsUnifiable check fails; :166-173 has no progress or termination guard. SimultaneousPhonologicalPatternRule.cs:22-35 always returns the input word, including when Matcher.AllMatches produces no applicable match. The reduced alpha-input case also hangs after α is removed while retaining the feature-bearing input class, and the glottal case hangs with a single rule, so neither α nor the original rule chain is necessary to the loop.
The pin-matched driver was absent from the exact-pin worktree, so the Tool Release project was built from an exact-pin source archive (SHA-256 of resulting hc.dll: 9cd575be98ddb4e9e32e63114ee699c94d7a395af2074ad15f1557a272404964). The related loop files are unchanged in locally fetched Machine origin/master 9f284a3cc4d5e2c5896f885ba1103fb30594b1e8.
Found while comparing HC-Rust (PanGloss) with pinned hc.dll; PanGloss answers all three in about 1 ms.
- 主要语言
- C#
- 星标
- 29
- 派生
- 16
- 平均合并
- 5 天 11 小时
- 30 天内合并 PR
- 15
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
sillsdev/machine 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
HermitCrab: analysis metathesis drops the middle context that synthesis keeps可能已有人在做 @johnml1135 于 3 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 78/100
维护者通常 1 天内回复
-
Hermit Crab
难度 2/5 1-3 小时 新手友好度 45/100
维护者通常 1 天内回复
-
porting
难度 3/5 半天 新手友好度 25/100
sillsdev/machine#617 · 1 条评论 ·
维护者通常 1 天内回复
-
Hermit Crab
难度 4/5 3-5 天 新手友好度 18/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
sebastienros/jint#4531 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 65/100
NLog/NLog.MailKit#264 ·
维护者通常 1 天内回复
-
Unable to build未关闭Bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
Assert.That on a null non-generic IEnumerable throws ArgumentNullException, so IsNull() cannot pass未关闭bug P2
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
area/automation area/sdk kind/bug
难度 2/5 1-3 小时 新手友好度 78/100
unoplatform/uno.templates#2406 ·
维护者通常 1 天内回复