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

オープン
#141 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
typescript
領域
compilers

調査の方向性

まず PR #140 の structuralSig ロジックと、既知の diamond を add-only で折りたたむパス (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分
マージ済み PR(30日)
6

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

juspay/rescript-bindgen のほかの issue

juspay/rescript-bindgen の issue をすべて見る

似ている issue

Compilers の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。