cli: add safe owning general-key hash sets
Add std.hashset with explicit pure hash/equality policies and complete owning keys. Duplicate/full insert returns the original input, while remove/pop and nonempty free preserve explicit resource ownership. Reuse safe HashMap storage and failure/peak/refund accounting. Integrate normative contracts, RFC, references, complexity measurements, CLI/profile checks and independent Copy/owner set traces. Validation: 973 conformance cases; runtime set GC and schedule stress; unit/Quick Reference, formatting, hosted smoke, 53 CLI checks, 106 source coverage constructs and bundle generation.
This commit is contained in:
1 parent
7743f515c5
commit
4716cda0f1
43 files changed
+2696
-7
No files matched your search
@@ -121,3 +121,5 @@ RFC 0028 numeric-key owning map (cl100k, relative to error_values; includes the
|
||||
RFC 0029 static function parameters (cl100k, relative to numeric maps): Quick Reference 7,863 → 8,051 (+2.4%); other source docs 50,079 → 51,002 (+1.8%); full source excluding AIR 57,942 → 59,053 (+1.9%). language/generics.md is 2,194 tokens; AIR remains 179,282 bytes / 51 sections. One explicit operation-selection concept adds two source forms and bounded frontend state, with no runtime/verifier state or new AIR construct/diagnostic. Cumulative growth is +73.8%; the RFC justifies the general hash/equality/order prerequisite, keeps general collections open and makes no empirical MCC claim.
|
||||
|
||||
RFC 0030 general owning HashMap (cl100k, relative to static operations): Quick Reference 8,051 → 8,124 (+0.9%), other source docs 51,002 → 53,363 (+4.6%), full source excluding AIR 59,053 → 61,487 (+4.1%). library/std.md is 16,504 tokens; AIR remains 179,282 bytes / 51 sections. Ten safe source functions use explicit static policies and complete key/value transfer, with no new language form, verifier/runtime state or diagnostic. Cumulative source growth is +80.9%, justified in the RFC without an empirical MCC claim; full policies/failure/dense-index invariants stay on demand.
|
||||
|
||||
RFC 0031 general owning HashSet (cl100k, relative to HashMap): Quick Reference 8,124 → 8,201 (+0.9%), other source docs 53,363 → 54,798 (+2.7%), full source excluding AIR 61,487 → 62,999 (+2.5%). library/std.md is 17,939 tokens; AIR remains 179,282 bytes / 51 sections. Nine safe wrappers return duplicate/full incoming keys and transfer stored keys through ordinary ownership rules. No new syntax, diagnostic or verifier/runtime state; cumulative source growth is +85.4%, justified by explicit ownership/accounting contracts without an empirical MCC claim.
|
||||
@@ -365,6 +365,8 @@ The usual enum rules apply: missing arm `E7004`, wrong enum/payload `E7005`, unk
|
||||
|
||||
`std.hashmap.HashMap<K,V,fn hash,fn equal>` supports general owning keys/values through explicit pure ref-key operations (§12). Insert returns replaced/full key/value pairs; remove/pop move both out, get requires only V: Copy, growth is explicit and free returns nonempty maps. Full contracts are in `/docs/library/std.md`.
|
||||
|
||||
`std.hashset.HashSet<K,fn hash,fn equal>` uses the same policies for complete owning keys. Insert returns `present(input)` for duplicates, preserving the stored key, or `full(input)`; remove/pop move stored keys out. Only new/reserve allocate with explicit authority; free returns nonempty sets. Full contracts are in `/docs/library/std.md`.
|
||||
|
||||
`std.hash.fnv1a64` and `crc32c` hash byte slices without allocation; their `_extend` forms continue from a previous result. Hashes do not establish key equality or authentication. Exact algorithms and chunk/byte-order conventions are in `/docs/library/std.md`.
|
||||
|
||||
## 11. Package modules
|
||||
|
||||
@@ -8,7 +8,7 @@ The other files in `/docs` hold the full rules. Open one only when this page is
|
||||
|
||||
| Need | Read |
|
||||
|---|---|
|
||||
| built-in bytes/math/text/formatting/hash, option/result, owning Vec/Deque and numeric/general maps, signatures and failure contracts | `/docs/library/std.md` |
|
||||
| built-in bytes/math/text/formatting/hash, option/result, owning Vec/Deque, numeric/general maps and general sets, signatures and failure contracts | `/docs/library/std.md` |
|
||||
| initialized buffer storage, explicit growth/drain and child views | `/docs/language/buffers.md` |
|
||||
| whole-value linear aggregates, unpack, exchange and allocation failure | `/docs/language/linear-aggregates.md` |
|
||||
| generic declarations/applications, property constraints, static function contracts and specialization limits | `/docs/language/generics.md` |
|
||||
|
||||
Reference in new issue
Block a user