docs: close general map and set validation gate

This commit is contained in:
dev committed 2026-10-07 11:41:06 +03:00
1 parent 4716cda0f1
commit 4114a39846
4 files changed
+7 -7

No files matched your search

+2 -2
View File
@@ -1,12 +1,12 @@
# Owning hash map design
Status: STD-6d.2 numeric-key branch implementation (RFC 0028 Proposed); general keys remain Q-037. Spec 16 §2.13 is normative for std.map. This document records design rationale and does not override the specification.
Status: STD-6d.2 numeric-key and STD-6d.4/5 general-key branch implementations validated (RFCs 0028/0030/0031 Proposed); Q-037 resolved. Spec 16 §2.13–§2.15 is normative for std.map/std.hashmap/std.hashset. This document records design rationale and does not override the specification.
## Key policy and scope
The eventual collection gate still requires HashMap<Key, Own<Value>>. At the numeric-map decision, type parameters supplied no hashing/equality operations (spec 15 §15); Copy supplies neither. RFC 0029/spec 15 §18 now supplies explicit static functions without runtime callbacks, methods, user traits or captured values. Treating a digest as key identity is incorrect because different keys can collide. Adding a language feature solely to make this API look generic would add more agent concepts before establishing their general value.
The initial branch increment was `std.map.U64Map<V>`: exact u64 keys, generic Copy or linear values, initialized buffer primitives and explicit error construction (RFC 0027). Users with genuine numeric identifiers can use it directly. Bytes/struct keys cannot be converted to digests and then treated as unique numeric keys; general key hashing/equality is Q-037. Byte-key ownership needs a separate owning representation contract. Do not name this specialization HashMap<K,V> or claim that it satisfies the general-key gate.
The initial branch increment was `std.map.U64Map<V>`: exact u64 keys, generic Copy or linear values, initialized buffer primitives and explicit error construction (RFC 0027). Users with genuine numeric identifiers can use it directly. Bytes/struct keys cannot be converted to digests and then treated as unique numeric keys; general key hashing/equality was Q-037, now resolved by explicit static policies and dense complete owning entries (spec 16 §2.14–§2.15). Byte-key ownership uses that general owning representation contract. Do not name this specialization HashMap<K,V> or claim that it satisfies the general-key gate.
## Public API
+2 -2
View File
@@ -275,7 +275,7 @@ STD-5 intentionally enables only complete fixed-size values and individually own
HashMap<K,V> needs a stable hash/equality pair: equal keys must hash equally, while hash collisions must still compare actual keys. Current Copy/Send/Share/Freeze/Local constraints supply no user operations; type parameters cannot carry callbacks or values (spec 15 §15). Struct/byte-key equality, key ownership and effect-visible callable policies have no general source contract. A hash digest alone cannot represent original-key identity.
**Static-operation prerequisite implemented (RFC 0029); general map validation in progress (RFC 0030).** The [owning map proposal](hash-map.md) starts with an honest U64Map<V> specialization, exact numeric equality and existing safe primitives. This does not complete the HashMap<Key, Own<Value>> collection gate. General key support must either use an independently specified concrete representation or justify a generally useful vertical language facility; it must not silently infer hashing/equality or introduce map-only compiler magic.
**Resolved on the STD-6d branch (RFCs 0029/0030/0031 Proposed):** spec 15 §18 supplies exact explicit static hash/equality operations; spec 16 §2.14–§2.15 specifies general owning HashMap<K,V,H,E>/HashSet<K,H,E> with dense complete entries and Copy probe indices. HashMap<Key, Own<Value>> and owning keys pass ordinary ownership/effect/borrow/task rules, independent model traces, source/AIR/profile/package checks and collection-before-every-step/scheduler stress. Numeric U64Map retains its API. No digest identity, inferred policy or map-only compiler primitive is introduced.
## Q-038 — Pure construction of built-in errors
@@ -287,4 +287,4 @@ STD-6d.2 needs to return allocation-size validation failure without allocating.
General collections and algorithms need explicit typed hash/equality/order operations, while current generics carry only types.
**Resolved contract (RFC 0029 Proposed):** spec 15 §18 permits explicitly selected source functions as static parameters with exact typed/effect contracts. Selection is part of nominal specialization identity and lowers to existing named AIR calls/workers. No function pointers, capture environment, inferred effects or runtime dispatch are introduced. Q-037 remains open until generic map/set storage and APIs are implemented and verified.
**Resolved contract (RFC 0029 Proposed):** spec 15 §18 permits explicitly selected source functions as static parameters with exact typed/effect contracts. Selection is part of nominal specialization identity and lowers to existing named AIR calls/workers. No function pointers, capture environment, inferred effects or runtime dispatch are introduced. Q-037 is resolved by the implemented and verified generic map/set contracts (RFCs 0030/0031).