Add analysis of open type slot problem space in gt4py.next - #14
Open
havogt wants to merge 2 commits into
Open
Conversation
Migrate docs/development/next/type-system-open-type-slots-analysis.md from the gt4py repo into the knowledge garden as a havogt proposal. - Knowledge-base frontmatter (title/author/tags/created) and house-style Status + Related blockquote. - Cross-links the related proposals: dtype-generic-fields (ADR 0023, role R4), dimension-generic-fields (the dims-genericity payoff and the pivotal dependency), and scan-redesign (the R5 "scan hack" motivation). - Adds a "Relation to other proposals and recommended sequencing" section recommending the redesign be pursued only after dimensions are proper types, and surfacing the representational tension with the asymmetric DimensionVar/DimsVar prototype in dimension-generic-fields §5.2. - Index entry added under havogt, keywords in sync with tags. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BXfFm8Gbvt3ehckg8syNVN
Rewrite the "open type slot" analysis to assume today's mainline gt4py state -- DeferredType and TypeVarType as two separate classes (ADR 0023) -- rather than the post-merge state. The DeferredType/TypeVarType merge (candidate "ADR 0024", branch-only, not in mainline) is now presented as an evaluated alternative in a dedicated section (new §4) and argued to consolidate along the wrong axis, instead of being treated as the landed status quo under critique. - New §4 "A tempting consolidation" describes and evaluates the merge idea (single TypeVarType with name-is-None discriminator, bound/constraints, DeferredType-as-factory) and why splitting Axis A beats collapsing it. - §3 narrowed to the current two-class design's patchiness. - Baseline note added to the status/related blockquote. - Clean-slate design, trade-offs, migration path, and sequencing made merge-agnostic (the design absorbs the merge either way). Title and index keywords unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BXfFm8Gbvt3ehckg8syNVN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a comprehensive design analysis document examining how
gt4py.nextrepresents not-yet-known and generic types, identifying structural issues in the current approach, and proposing a clean-slate redesign.Changes
New document:
content/ideas/havogt/open-type-slots.mdDeferredType/name is Nonecase ofTypeVarType) is overloaded to express six semantically different conceptsOptional[TypeSpec](kept out of type language)TypeScheme/TypeParam/ParamRef(unifies dtype and dimension genericity)Updated index: Added reference to the new document in the ideas index
Context
This is a forward-looking design analysis (not a decision) that deliberately ignores backwards-compatibility to state the target design in its purest form. It builds on the dtype-generics work (ADR 0023) and critiques the subsequent merge (ADR 0024), with the decisive payoff materializing once dimensions become proper types. The analysis is intended to inform future generic work, particularly dimension genericity and scan redesign.
https://claude.ai/code/session_01BXfFm8Gbvt3ehckg8syNVN