Nockchain evidence

NockVM source safety

Nockchain Runtime Safety Trace

Source anchors for NockStack frame bounds, jam/cue decode behavior, noun-space provenance, HAMT traversal limits, and PMA direct-reader offset checks.

Commit
33ba97b1e206
Anchors
9
Classes
5
Crate
nockvm

Source Anchors

nockstack-frame-bounds

file

crates/nockvm/rust/nockvm/src/mem.rs

symbols

NockStack::is_in_frame

lineRange

1338-1377

Classifies whether a pointer belongs to the current NockStack frame before preserving or copying runtime structures.

The check rejects null pointers, debug-asserts arena bounds, derives the pointer word offset, and compares it with the current and previous frame offsets.

nockstack-frame-lifecycle

file

crates/nockvm/rust/nockvm/src/mem.rs

symbols

NockStack::frame_push, NockStack::frame_pop, NockStack::with_frame

lineRange

1952-2032

Pushes and pops frame metadata while preserving returned nouns into the previous frame.

Frame push bounds-checks the requested words, saves previous frame/stack/alloc pointers, and frame_pop refuses null saved pointers before restoring offsets.

interpreter-stack-frame-preserve

file

crates/nockvm/rust/nockvm/src/interpreter.rs

symbols

Context::with_stack_frame, NockStack::frame_push, NockStack::frame_pop

lineRange

506-524

Wraps jet work in a stack frame and preserves return value plus cache/cold/warm nouns before popping.

The interpreter pushes a frame, runs the closure, preserves runtime state into the stack, then pops the frame.

cue-stack-deserialization

file

crates/nockvm/rust/nockvm/src/serialization.rs

symbols

cue_bitslice_with_mode, cue_bitslice, cue, CueStackEntry

lineRange

125-205

Deserializes jam/cue data through an explicit stack of destination pointers and backreference entries.

Cue uses stack.with_frame, a HAMT backreference map, next-bit tag dispatch, and deterministic failure when a backreference cannot resolve.

rub-backref-bounds

file

crates/nockvm/rust/nockvm/src/serialization.rs

symbols

rub_atom_internal, rub_backref, get_size, next_up_to_n_bits

lineRange

371-420

Bounds the atom and backreference decoding path that malformed jam/cue payloads exercise.

Atom decode uses get_size and bounded bit slices; backrefs over 64 bits return a nondeterministic failure instead of producing an unchecked offset.

jam-traversal-bounds

file

crates/nockvm/rust/nockvm/src/serialization.rs

symbols

jam, jam_atom, jam_cell, jam_backref, mat, double_atom_size

lineRange

431-610

Serializes nouns with an iterative traversal, backreference map, and retry-on-growth atom buffer.

Jam pushes nouns onto the NockStack instead of recursing, doubles output atoms when needed, and preserves the normalized result before popping the frame.

noun-space-provenance

file

crates/nockvm/rust/nockvm/src/noun.rs

symbols

AllocLocation, NounSpace, NounSpace::with_brand, BrandedNounHandle

lineRange

56-390, 630-650

Separates stack, PMA pointer, and PMA offset nouns while giving handles a scope tied to a specific NounSpace.

NounSpace records stack/PMA arenas, stack epoch snapshots, PMA bounds, and a branded handle API that prevents handles from escaping the intended scope.

hamt-fixed-depth-preserve

file

crates/nockvm/rust/nockvm/src/hamt.rs

symbols

Preserve for Hamt<T>, Hamt<T>::preserve, Hamsterator

lineRange

488-620, 1018-1048

Preserves HAMT structures with a fixed-depth traversal stack matching the bounded key layout.

HAMT preserve copies in-frame stems/leaves into the previous frame and uses fixed arrays sized for maximum depth rather than unbounded recursion.

pma-direct-reader-bounds

file

crates/nockvm/rust/nockvm/src/pma/stream.rs

symbols

PmaDirectReader, PmaDirectReader::read_u64, PmaDirectReader::read_cell, PmaDirectReader::indirect_atom_words

lineRange

98-284

Reads PMA words and noun structures directly from disk while enforcing alloc-word and indirect-atom bounds.

read_u64 rejects offsets past alloc_words, read_cell rejects cells that would cross the limit, and indirect_atom_words rejects forwarding pointers, zero-length atoms, overflow, and end offsets past alloc_words.

Runtime Safety Classes

stack-frame-pointer-outside-arena

Stack frame pointer outside arena

Debug panic or support-bundle frame check while preserving NockVM data.

sourceAnchorIds

nockstack-frame-bounds, nockstack-frame-lifecycle, interpreter-stack-frame-preserve

receiptFields

stackFrameCheck, runtimeSafetyIssue, nockvmCommit

jam-cue-malformed-input

Malformed jam/cue input

Cue returns deterministic or nondeterministic failure on malformed serialized noun data.

sourceAnchorIds

cue-stack-deserialization, rub-backref-bounds

receiptFields

cueInputLength, cueValidationError, jamBackrefCheck

p2p-jam-empty-buffer

P2P jam/cue empty buffer

Peer or gossip decode path sees an empty or truncated jam/cue payload.

sourceAnchorIds

rub-backref-bounds, cue-stack-deserialization

receiptFields

cueInputLength, cueValidationError, peerEvidenceTraceId

height-bound-worker-panic

Height-bound worker panic

Worker panic risk after malformed or out-of-range runtime input reaches traversal or height-sensitive code.

sourceAnchorIds

jam-traversal-bounds, hamt-fixed-depth-preserve

receiptFields

runtimeSafetyIssue, supportBundleTraceId, nockchainBuild

noun-space-stale-epoch

NounSpace stale epoch

Noun handles or PMA offsets are interpreted after a stack reset, flip, or artifact mismatch.

sourceAnchorIds

noun-space-provenance, pma-direct-reader-bounds

receiptFields

nounSpaceEpoch, pmaOffsetBoundsCheck, runtimeSafetyIssue

Receipt Contract

nockvmCommit
nockchainBuild
runtimeSafetyIssue
stackFrameCheck
cueInputLength
cueValidationError
pmaOffsetBoundsCheck
nounSpaceEpoch
supportBundleTraceId
highlightedField

runtimeSafetyIssue

highlightedField

stackFrameCheck

highlightedField

cueValidationError

highlightedField

pmaOffsetBoundsCheck

highlightedField

supportBundleTraceId

reviewRule

Runtime safety receipts cite source anchors, issue class, build, and summarized validation results.

reviewRule

Support bundles may include lengths, hashes, status labels, and trace ids, but not raw jam payloads, stack memory, PMA slabs, or event logs.

reviewRule

Use Nockchain PR radar and upstream commit provenance before interpreting a panic as fixed or still actionable.

reviewRule

Tie PMA offset checks to alloc_words and noun-space epoch context before trusting a state-jam or snapshot-derived receipt.

Operator Triage

frame-check-panic

Frame check panic

Capture the build, source anchor id, and frame check result before changing stack-size or memory runbooks.

checks

nockvmCommit, stackFrameCheck, runtimeSafetyIssue

classIds

stack-frame-pointer-outside-arena

malformed-cue-payload

Malformed cue payload

Record payload length and validation class; store only a hash or trace id for any operator-local raw input.

checks

cueInputLength, cueValidationError, peerEvidenceTraceId

classIds

jam-cue-malformed-input, p2p-jam-empty-buffer

state-jam-pma-offset

State-jam PMA offset

Treat PMA/state-jam evidence as metadata-only until offset bounds and producing build match.

checks

pmaOffsetBoundsCheck, nounSpaceEpoch, supportBundleTraceId

classIds

noun-space-stale-epoch

traversal-worker-panic

Traversal worker panic

Attach traversal class, source commit, and recommended cargo gate to the support bundle.

checks

hamtTraversalDepth, runtimeSafetyIssue, nockchainBuild

classIds

height-bound-worker-panic

Local Verification

status

source-inspected

inspectedSourceCommit

33ba97b1e206dd89b15c61b72b7802caf2136c18

highlightedCommand

cargo check -p nockvm

command

cargo check -p nockvm

command

cargo test -p nockvm serialization::tests::test_cue_invalid_input

command

cargo test -p nockvm serialization::tests::test_cue_invalid_backreference

Forbidden Evidence

forbiddenField

rawJamPayload

forbiddenField

rawPmaSlab

forbiddenField

rawCoreDump

forbiddenField

rawStackMemory

forbiddenField

rawEventLog

forbiddenField

walletSeedPhrase

highlightedForbidden

rawJamPayload

highlightedForbidden

rawPmaSlab

highlightedForbidden

rawStackMemory

symbol

NockStack::is_in_frame

symbol

NockStack::frame_push

symbol

Context::with_stack_frame

symbol

cue_bitslice_with_mode

symbol

rub_backref

symbol

NounSpace::with_brand

symbol

PmaDirectReader::read_u64