feat(vm): add reference identity and deterministic value hashing

This commit is contained in:
2026-10-23 14:29:00 +01:00
parent 57992cf214
commit 69ad1931de
41 changed files with 2521 additions and 121 deletions
@@ -192,3 +192,13 @@ remain unchanged. CPU timings never change guest-visible cycle weights.
## Random core integration
The [random core](02e-vm-owned-random-core.md) charges fixed calls before checks and bounded range calls as 4+8*N (at most 64 draws), retaining fault cycles and whole-instruction overshoot.
## Identity and hash attempts
The [identity/hash contract](02f-vm-identity-and-value-hashing.md) charges
8+w(T) for reference hash, 4+w(A)+w(B) for identity comparison, eight for scalar
numeric hashes, and 8+n resident UTF-8 bytes for String. Known lengths charge
before traversal/refusal; null/wrong/unavailable String carriers charge eight.
Checked cost overflow charges base and faults. These are total attempted costs,
without a generic extra INTRINSIC cycle or refunds. Existing whole-instruction
overshoot and zero-budget rules apply; the operations introduce no safepoint.