code wiki / (root) / nx_blob_store_test.nx

nx_blob_store_test.nx

buildroot/runtime/nx_blob_store_test.nx

7883 B188 linesdepth 6pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic blob
docsdependenciesstructsconstsfunctions

about

nx_blob_store_test.nx -- smoke for nx_blob_store ST-1 MVP. Exercises: 1. Allocation + canary integrity + initial state 2. Put + get roundtrip on a known byte sequence 3. DEDUP: putting same bytes twice yields same hash + same entry count 4. Distinct bytes -> distinct hashes 5. has_blob positive + negative 6. SHA-256 determinism: same input across two stores produces same hash (content-addressing key property) 7. Bad-input gates (null bytes with len>0, negative len, null out_hash, null store, null hash, oversized buffer) 8. Capacity gate: filling beyond NX_BLOB_STORE_CAPACITY -> NX_BLOB_FULL 9. Tamper detection: stomp canary_post -> store invalidated; all subsequent ops refuse 10. nx_blob_hash_eq positive + negative + null gates 11. Empty-blob (len=0) round-trip

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_blob_store.nx nx_blob_store_test.nx

imports: nx_syscalls.nxnx_blob_store.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nx_blob_store_new sys_mmap nx_blob_store_is_valid nx_blob_store_count nx_blob_store_is_valid ↻ sys_mmap ↻ _fill_pattern nx_blob_hash_new sys_mmap ↻ nx_blob_store_put nx_blob_store_is_valid ↻ _hash_bytes_to_struct sys_mmap ↻ sha256_digest sys_mmap ↻ sha256_init sys_mmap ↻ sha256_k sha256_update sha256_compress_ni_blocks blk_set_byte sha256_compress sha256_compress_ni blk_word sha256_final blk_set_byte ↻ sha256_compress ↻ _load_i64_le _find_entry_idx _entry_hash_eq _alloc_entry sys_mmap ↻ nx_blob_store_get nx_blob_store_is_valid ↻ _find_entry_idx ↻ nx_blob_hash_eq nx_blob_store_has nx_blob_store_is_valid ↻ _find_entry_idx ↻

structs

none

consts

none

functions

24func _fill_pattern(buf: *u8, len: i64, seed: i64) -> i64
called by 1: main
33func main() -> i64