cli: add safe owning binary heaps
Add std.heap with an exact explicit pure ordering operation, bounded push, Copy-only peek, moving pop and empty-only free. Sift Copy indices while complete owners remain in dense initialized storage; repair holes through complete exchange. Reserve preserves layout on returned failure and accounts for both old/new buffers and separately owned payloads. Integrate normative contracts, RFC, references, bundle measurements, independent heapq/permutation oracles and CLI/package/profile checks. Validation: 1007 conformance cases; 34 heap GC fixtures and scheduled stress; unit/Quick Reference, formatting, hosted smoke, 70 CLI checks, 109 source coverage constructs and unchanged AIR reference bundle.
This commit is contained in:
1 parent
4114a39846
commit
cfece6080c
51 files changed
+2192
-12
No files matched your search
@@ -123,3 +123,5 @@ RFC 0029 static function parameters (cl100k, relative to numeric maps): Quick Re
|
||||
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.
|
||||
|
||||
RFC 0032 owning BinaryHeap (cl100k, relative to HashSet): Quick Reference 8,201 → 8,284 (+1.0%), other source docs 54,798 → 56,770 (+3.6%), full source excluding AIR 62,999 → 65,054 (+3.3%). library/std.md is 19,911 tokens; AIR remains 179,282 bytes / 51 sections. Eight safe source operations bind explicit pure order and sift Copy indices while complete owners remain in initialized storage. No new syntax, diagnostic or verifier/runtime state; cumulative source growth is +91.4%, justified by visible ordering/ownership/failure/accounting contracts without an empirical MCC claim.
|
||||
@@ -367,6 +367,8 @@ The usual enum rules apply: missing arm `E7004`, wrong enum/payload `E7005`, unk
|
||||
|
||||
`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.heap.BinaryHeap<T,fn before>` binds pure `fn(ref<T>,ref<T>)->bool effects []` as a stable strict weak order. Push returns full input; pop moves the priority root; peek requires T: Copy. Only new/reserve allocate with explicit authority; free returns nonempty heaps. Ties have no stable-order guarantee. 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, numeric/general maps and general sets, signatures and failure contracts | `/docs/library/std.md` |
|
||||
| built-in bytes/math/text/formatting/hash, option/result, owning Vec/Deque, numeric/general maps, sets/heaps, 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