Introduce a structured, interned HIR type system
まだ誰も着手していません。
評価
調査の方向性
Start with include/crossgl/HIR/HIR.h, TypeSemantics.h, and docs/architecture/ARCHITECTURE_V2.md. For the first staged foundation, trace the existing HIRType parsing and the three array splitters, then inspect the .cgl fixture corpus and unit-test type set. Done means round-trip and differential tests preserve type spellings and formatType/typeToIR output without golden changes.
索引モデルが issue の本文から書いたものです。
説明
Problem
HIRType is string-based (include/crossgl/HIR/HIR.h): a single name string overloads the base spelling, qualifier prefixes (buffer /uniform /shared ), pointer suffixes (*), and generics (atomic<int>), while arraySize is a second ][-joined mini-grammar. Type meaning is decoded by re-parsing these strings at ~300 sites across ~38 files, with duplicated isVector/isScalar/isMatrix predicates in several backends and three separate ][ array splitters. This string-typed core caps the optimizer, the HIR verifier, target legalization, and any future native binary backend, and is the single biggest obstacle to a best-in-class typed IR.
Goal
Replace the string-typed HIRType with a structured, interned type model (Type / TypeKind / TypeContext) — scalar class + lane count, matrix shape, qualifier, pointer depth, array dimensions, struct/resource payloads — with O(1) interned equality and one canonical decoder. Enforce strict typing (no implicit int/float, signed/unsigned, vector-width, or address-space conversion) per docs/architecture/ARCHITECTURE_V2.md.
Staged plan (incremental, behind the TypeSemantics.h seam; no big-bang)
- This PR — foundation, off the hot path: add
Type/TypeKind/TypeContext,internType(const HIRType&)(the single parser, centralizingbaseTypeName/stripTypeQualifier/ vector-width / array-element logic and the three][splitters) andtoLegacyHIRType(const Type&)(re-serialize).HIRTypestorage is unchanged. Proven by a differential round-trip test over the full.cglfixture corpus + the unit-test type set:toLegacyHIRType(internType(t)) == t, with identicalformatType/typeToIRoutput. Zero golden movement. - Reimplement the
TypeSemantics.hpredicates on top ofType(same signatures); delete the divergent duplicate predicates. - Migrate
HIRTypeto carry an internedTypehandle (string fields become lazy accessors for one release). - Convert the four backend type mappers +
typeToIRto switch onTypeKind; rekey the SPIR-V type caches on the handle; remove the legacy string fields.
The compiler keeps accepting the same CrossGL language as the crosstl translator (cross-repo language contract); this is an internal-representation refactor — accepted source and emitted/reflected type spellings are preserved and pinned by the differential tests.
- 主要言語
- C++
- スター
- 0
- フォーク
- 0
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CrossGL/compiler のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
Track CrossTL project-porting report and source-remap compatibility再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
CrossGL/compiler の issue をすべて見る
似ている issue
-
[Docs] CONTRIBUTING still says FreeType 2.14.3 and TabLabel.h says ImGui 1.92.9b after the bumps対応中かも @mgradwohl が今日担当しました。 オープンagent:WSL documentation LOW
難易度 1/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
cudf-polars feature request
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 2 日以内に返信
-
(S1 - Need confirmation)
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
CleverRaven/Cataclysm-DDA#89212 ·
メンテナーはふだん 1 日以内に返信
-
Status: Needs confirmation Status: Needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
a byte order mark at the start of a migration makes dbmate miss the up block対応中かも @Dem1241 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 2 日以内に返信