> For the complete documentation index, see [llms.txt](https://clarity-7.gitbook.io/clarity-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://clarity-7.gitbook.io/clarity-docs/clarity-moniversive-invariant-static-mis/mis-taxonomy/hand-coding.md).

# Hand-coding & outcomes

## High-level ergonomic (`.mis` / Python-level)

```python
@mis_kernel
def execute_trade(sender: mis_ptr, receiver: mis_ptr, amount: u64) -> u8:
  mis.invariant(mis.load(sender) >= amount)
  mis.store(sender, mis.load(sender) - amount)
  mis.store(receiver, mis.load(receiver) + amount)
  return mis.SUCCESS
```

## Low-level bare-metal

```mis
mis_kernel fn clrty_atomic_swap_hand(reg_a: mis_ptr<u256>, val: u256) -> u32 {
    mis_reg state_val: u256 = mis::load_aligned_u256(reg_a);
    mis.invariant(state_val != 0u256);
    mis::store_aligned_u256(reg_a, val);
    return 1u32;
}
```

## End outcomes

1. **Zero runtime stack unwinding / predictable cycles** — bounds proven by `misc`/`clrtyc`
2. **Thread & hardware determinism** — branchless SIMD, lock-free arenas
3. **Native ZK verification** — programs as circuits; IVC $O(1)$ proofs
4. **Paradigm** — Python ergonomics → bare-metal speed → formal safety

Settlement always **clrty-1 / 1202**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://clarity-7.gitbook.io/clarity-docs/clarity-moniversive-invariant-static-mis/mis-taxonomy/hand-coding.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
