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).
+2 -2
View File
@@ -51,6 +51,6 @@ Relative to the static-operation prerequisite (RFC 0029), all full-source counts
cl100k growth is +0.9% / +4.6% / +4.1%. library/std.md is 16,504 cl100k tokens. AIR remains 179,282 bytes / 19 files / 51 sections (46,300 cl100k in the source bundle). No normative AIR material is needed. Full source growth from the pre-stdlib 33,981-token baseline is +80.9%; the justification is a general owning-key map meeting the original HashMap<Key, Own<Value>> gate, exact failure/resource contracts and a separate numeric API retained for compatibility. The Quick Reference has one compact paragraph; policies/invariants/accounting stay on demand. Selective reference reading/consolidation remains separate work; no empirical MCC benefit is claimed.
## Validation progress
## Validation result
The complete conformance corpus passes 947 cases, including 33 general-map cases. Unit tests, Quick Reference checking, formatting, reference-bundle generation, source coverage (104/104 constructs) and 55 CLI/source/AIR/profile/package/provenance checks pass. Independent Python dict/dense-order oracles cover 192 public operations across Copy and owning-value traces, checking every key and complete returned owners. Tests cover owning byte-buffer keys, owning key/value replacement/full returns, files, sender task transfer, shared lookups, exact allocation peaks, both reserve-failure phases, new-allocation rollback, cross-authority refunds and invalid-metadata nonempty free. The focused collection-before-every-step/scheduler-stress process is still running; its result is not yet claimed. No wall-clock execution limit is used.
The complete conformance corpus passes 947 cases, including 33 general-map cases. Unit tests, Quick Reference checking, formatting, reference-bundle generation, source coverage (104/104 constructs) and 55 CLI/source/AIR/profile/package/provenance checks pass. Independent Python dict/dense-order oracles cover 192 public operations across Copy and owning-value traces, checking every key and complete returned owners. Tests cover owning byte-buffer keys, owning key/value replacement/full returns, files, sender task transfer, shared lookups, exact allocation peaks, both reserve-failure phases, new-allocation rollback, cross-authority refunds and invalid-metadata nonempty free. The focused collection-before-every-step/scheduler-stress process has completed: all 33 general-map cases pass, including both independent owning/Copy model traces; scheduled fixtures run 12 seeds under quanta 1, 2, 7 and their own quantum. The process used no wall-clock termination. Subsequent set/heap regression passes the full 1007-case corpus. General key-policy/storage validation is complete on this branch (Q-037); RFC status remains Proposed for owner review.
+1 -1
View File
@@ -44,4 +44,4 @@ Copy/owning/byte keys, duplicate/full preservation, collisions, pop/remove order
Full conformance passes 973/973, including 26 set fixtures. All runtime set fixtures pass collection before every instruction, including both independent model traces; shared lookup runs 12 schedule seeds under quanta 1, 2, 7 and its own quantum. Existing compilation checks reject owner leaks, missing moves, bad borrows/task loans, wrong nominal policies, missing effects and non-Share file keys. Copy and owning key traces use independent Python set/representative/dense-order oracles for 80 operations, checking every domain key after every operation. Duplicate input/stored representative and complete probe metadata, owning byte keys, files, full/remove/pop/nonempty-free ownership, zero/overflow, both failure phases, rollback, exact peaks and cross-authority refunds are covered.
Unit/Quick Reference checks, formatting, hosted smoke, agent-reference generation, source coverage (106/106 constructs) and 53 CLI checks pass. CLI checks compare source/AIR results, hosted execution, explicit package policies, reordered imports, report/audit and callback provenance. AIR and source syntax remain unchanged. The separate general-map full GC/stress process remains running, with no result claimed here and no wall-clock termination. BinaryHeap and I/O/path remain subsequent work.
Unit/Quick Reference checks, formatting, hosted smoke, agent-reference generation, source coverage (106/106 constructs) and 53 CLI checks pass. CLI checks compare source/AIR results, hosted execution, explicit package policies, reordered imports, report/audit and callback provenance. AIR and source syntax remain unchanged. The separate general-map full GC/stress process subsequently completed with all 33 cases passing, without wall-clock termination. BinaryHeap and I/O/path remain subsequent work.