#90 residual: records separable only through broken-typed fields collide → order-dependent counter; hash couples to typeToString text

未关闭
#141 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
typescript
领域
compilers

调研方向

首先阅读 PR #140 中的 structuralSig 逻辑以及仅添加的已见 diamond 折叠路径(Rcyc),然后比较此处描述的 base-ui menuStore 和 blend selectMenu 案例。完成的标准是:真正完全相同的结构签名可以安全合并,refs 会重定向,计数器会消失,并且 Rcyc 路径不会使不同的条目看起来相同。

由索引模型根据 Issue 内容生成。

描述

Follow-up to #90 (PR #140), from the PR review. Low severity — the primary #90 goal (no churn across compiler versions / unrelated edits) holds for the general case and is verified byte-identical on TS 5.9 → 6.0.3.

Residual 1 — under-discrimination of broken-typed fields

structuralSig normalizes every unknown/any/opaque/review field to the same token, so two DISTINCT records separable only through broken-typed fields hash identically and fall back to an order-dependent counter (…2) — a narrow slice of the churn #90 targets.

  • Real case: base-ui menuStoreV1x8ec / …2 (differ only in rootMenuStore… vs triggerMenuStore…, both → string).
  • The PR #140 refinement (base + t.text in the sig) fixed base-ui but regressed blend 0 → 2 counters (selectMenuGroupType2, selectMenuItemType2), which are structuralSig-EQUAL entries (sort can't stabilize equal keys). So the churn class moved rather than disappeared.

Residual 2 — hash couples to typeToString

The t.text discriminator is TS's typeToString output, which is version-sensitive (e.g. intersection-member order {a}&{b} vs {b}&{a} could canonicalize on a major bump). Verified stable across 5.9 → 6.0.3, but latent risk for names distinguishable ONLY by broken-field text.

Proper fix (deferred — bigger/riskier)

Merge entries whose FULL structuralSig is genuinely identical (they're structurally interchangeable → one name, refs redirect). Needs care around the add-only seen diamond-collapse (Rcyc), which could otherwise make two genuinely-different entries look equal → unsound merge. Would fix both base-ui and blend and drop the counters entirely.

Meanwhile

Counters here are STABLE across the 5.9 → 6.0.3 transition (deterministic sort), so no active churn today; this tracks closing the residual properly.

主要语言
ReScript
星标
11
派生
0
平均合并
7 小时 27 分钟
30 天内合并 PR
6

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

juspay/rescript-bindgen 的其他 Issue

查看 juspay/rescript-bindgen 的全部 Issue

相似的 Issue

更多 Compilers Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。