Introduce a structured, interned HIR type system
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- C++
- Estrellas
- 0
- Forks
- 0
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de CrossGL/compiler
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
-
Track CrossTL project-porting report and source-remap compatibilityQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
Todos los issues de CrossGL/compiler
Issues similares
-
Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Niko1221/Strata#3673 · 2 comentarios ·
Los mantenedores suelen responder en 3 días
-
bug P4
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
open-astro/AlpacaBridge#1520 ·
Los mantenedores suelen responder en 1 día
-
[Docs] CONTRIBUTING still says FreeType 2.14.3 and TabLabel.h says ImGui 1.92.9b after the bumpsPosiblemente ocupada @mgradwohl la tomó hoy. Abiertoagent:WSL documentation LOW
Dificultad 1/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día