Repository navigation
Spec: D119 Amendment 1 ruled — Vector[T, N], element first (Eric, 2026-10-12) - #2376
Merged
Merged
Conversation
…nt first §4.3d spelled the count before the element (Vector[N, T]) while §4.3a spells the element first ([T; N]); the D119 decision left the agreement open for the array-length-generics brief. Ruled on that brief (#2311): they agree, element first — Vector[T, N], the aliases (f32x4 and kin) unchanged, the rename one mechanical pass. §4.3a's cross-reference, §16.1's C-vector import spelling, and the ABI document's current-shape lines follow; historical changelog and ABI version-history entries keep the spelling they recorded. Mask[N, W] was not named in the ruling and keeps its order until ruled — recorded in the D119 decision entry, whose Open point this closes. The implementation (parser/Sema rename plus array-length generics) is #2311; until it lands the compiler is non-compliant with §4.3d by design, since the spec leads.
ehartford
marked this pull request as ready for review
October 13, 2026 02:40
ehartford
added a commit
that referenced
this pull request
Oct 13, 2026
…enerics (#2380) * D119 Amendment 1 (#2311): Vector[T, N] element-first, and array lengths are generic parameters §4.3d (ruled 2026-10-12, #2376): Vector writes its element first like [T; N]; Mask[N, W] keeps its count first, as the ruling left it. The internal type (d0 lane, d1 count) is unchanged — every resolver, the frozen twins, the call-site binding walk, the declaration validator, and the printers (diagnostics, c_import, bundle interfaces) swap the two written arguments. The retired spelling with a literal count is refused by naming the order. One Lexer-accurate pass renamed the tree's 40 unambiguous sites in tests (plus hand fixes inside f-strings, which lex as one token); comments followed. Array-length generics by Vector's mechanism: [T; N] binds a generic N from the argument's array length in bind_type_params_from_type_expr (nested nodes bind [T; N, N] and [T; R, C], with a conflict diagnostic), as a TY_CONST_INT substitution. array_type_len and array_fill_count read that substitution per instantiation and keep the length node in d2 — each instance writes its own d1, the next re-reads d2; the frozen and substitution resolvers bind the same way. type_expr_mentions_type_param now counts a generic length as a mention: without it the expected-type probe resolved [i32; N] with N unbound (erroring and consuming the length node) before inference could bind it. A probe that resolves a generic length under a non-integer substitution (template probe, cascade suppression) is non-destructive and quiet — the one 'cannot infer' diagnostic owns the failure. Tests: behav_d119a1_vector_element_first (dot[N] over Vector[f32, N], aliases unchanged), behav_d119a1_array_length_generics (total[N], trace[N], transpose[R, C] incl. [0; C, R]), err fixtures for the retired spelling and a length conflict. A bracket literal still takes no generic array demand — pre-existing on main, filed as #2379. * Re-record the ABI hash for the TypeLayout comment (Vector[f32, 3] spelling) The Amendment 1 comment sweep changed bytes in an ABI-defining source; the convention did not change, so the hash is re-recorded with no WITH_ABI_VERSION bump. Every .wo rebuilds once. --------- Co-authored-by: Eric Hartford <[email protected]>
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.
Docs only (outside the battery's green-evidence inputs). Lands Eric's ruling on the D119 Amendment 1 brief: element first,
Vector[T, N], aliases unchanged, rename one mechanical pass.Mask[N, W]was not named in the ruling and keeps its order until ruled — flagged here for a one-word follow-up ruling either way.