Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
263 commits
Select commit Hold shift + click to select a range
0b15657
Begin input buffer/offset calculations
alnoki Feb 3, 2026
2a3ac50
Update scaffolding
alnoki Feb 3, 2026
1dbc387
Add group extension
alnoki Feb 3, 2026
bf19241
Update e code macros
alnoki Feb 3, 2026
a1f1e9c
Begin rs impl
alnoki Feb 3, 2026
38d438c
Add more rs impl
alnoki Feb 3, 2026
2a08f22
Refactor macros, make build pass
alnoki Feb 4, 2026
c8c515f
Start input buffer map
alnoki Feb 4, 2026
02cede7
Make repr C, packed
alnoki Feb 4, 2026
7b9e465
Update offsets in constant group
alnoki Feb 4, 2026
3bc987c
Add asm const group support
alnoki Feb 4, 2026
4e53e5c
Tweak macro logic
alnoki Feb 4, 2026
cce114e
Begin fast fail finalization
alnoki Feb 4, 2026
2486695
Preserve hex status
alnoki Feb 4, 2026
181a1ba
Complete ASM fast fail
alnoki Feb 4, 2026
bbf0ec4
Use pinocchio
alnoki Feb 4, 2026
f669aaa
Add tree data length calcs
alnoki Feb 4, 2026
c36c375
Simplify comment
alnoki Feb 4, 2026
7d9e0c9
Add preliminary test harness
alnoki Feb 4, 2026
0903f2c
Add prelim docs include
alnoki Feb 4, 2026
909104b
Include test MD
alnoki Feb 4, 2026
304f41d
Tweak preliminary testing/includes
alnoki Feb 4, 2026
0998858
Add anchor support
alnoki Feb 4, 2026
95b62f3
Update algorithm parity stub
alnoki Feb 4, 2026
6df28c0
Try setting return data
alnoki Feb 4, 2026
63af484
Beging instruction layout
alnoki Feb 5, 2026
37afbbe
Add tree data length checks
alnoki Feb 5, 2026
6f10a5c
Add input buffer tail parsing
alnoki Feb 5, 2026
ce3a496
Begin adding CPI interface bindings
alnoki Feb 5, 2026
63914c3
Add bindings/stack layout
alnoki Feb 5, 2026
5698d2f
Start adding PDA checks
alnoki Feb 5, 2026
56961f8
Add preliminary init fail tests
alnoki Feb 5, 2026
137e34d
Update init logic
alnoki Feb 5, 2026
f89017c
Abstract helpers
alnoki Feb 5, 2026
cf7272b
Make helper generic
alnoki Feb 5, 2026
9664c2b
Clean up ASM defs
alnoki Feb 5, 2026
fd05cbd
Tidy up ASM checks
alnoki Feb 5, 2026
4c2cb98
Update init parse logic
alnoki Feb 5, 2026
fa46e97
Put prefix in ASM defs
alnoki Feb 5, 2026
e07c0b0
Update initialize logic
alnoki Feb 5, 2026
74535b4
Implement initialize check parity
alnoki Feb 5, 2026
2932f9d
Enforce comment parity
alnoki Feb 5, 2026
64820dd
Make tests into groups
alnoki Feb 5, 2026
5c14f45
Clean up tests
alnoki Feb 5, 2026
99aa22b
Update test harnessing
alnoki Feb 5, 2026
91da722
Refactor testing, include in docs
alnoki Feb 5, 2026
2b24bb7
Regen snippet
alnoki Feb 5, 2026
ffdc578
Begin extern refactor
alnoki Feb 5, 2026
64fd118
Make constants compile
alnoki Feb 5, 2026
4ea7217
Clean interface
alnoki Feb 5, 2026
6a6a725
Pin impl
alnoki Feb 5, 2026
76a9874
Pin program
alnoki Feb 6, 2026
d508f0c
Pin disassembly
alnoki Feb 6, 2026
fa368ec
Pin impl
alnoki Feb 6, 2026
5d2b071
Rebuild with v2
alnoki Feb 6, 2026
e5f4a88
Pin impl with cold paths
alnoki Feb 6, 2026
8f409de
Add hints
alnoki Feb 6, 2026
a47909d
Add macros
alnoki Feb 6, 2026
5d6f4bc
Pin match
alnoki Feb 6, 2026
f25eb80
Update match
alnoki Feb 6, 2026
adc4294
Tie off versioning
alnoki Feb 6, 2026
c42e720
Begin stack frame layout
alnoki Feb 6, 2026
c589a94
Add stack definitions
alnoki Feb 6, 2026
aa3a416
Add macros
alnoki Feb 6, 2026
4eb3380
Update size_of macro
alnoki Feb 6, 2026
6c53a53
Update sizes macro
alnoki Feb 6, 2026
87a2b9b
Clean up size/stack frame offset macros
alnoki Feb 6, 2026
8131a91
Add logic to check PDA
alnoki Feb 6, 2026
5b57f73
Add anchor
alnoki Feb 6, 2026
7733559
Add pubkey chunk group
alnoki Feb 6, 2026
f9c7e7c
Add PDA mismatch testing
alnoki Feb 7, 2026
a7b3fac
Clean up PDA chunk test
alnoki Feb 7, 2026
bb9b745
Implement address check in RS
alnoki Feb 7, 2026
99ca0ad
Pin RS vs ASM tests for PDA
alnoki Feb 7, 2026
44f3b26
Silence warning
alnoki Feb 7, 2026
5d3a345
Disallow warnings
alnoki Feb 7, 2026
01644c5
Clean up artifact generation
alnoki Feb 7, 2026
fd7523e
Remove stale file
alnoki Feb 7, 2026
92dcf88
Fix warnings
alnoki Feb 7, 2026
8133087
Add cfg block
alnoki Feb 7, 2026
6ce29ac
Build examples
alnoki Feb 7, 2026
0f151cb
Update deps
alnoki Feb 7, 2026
9b6b602
fmt
alnoki Feb 7, 2026
6762ddf
fmt tests
alnoki Feb 7, 2026
412eef7
Use cast instead of transmute
alnoki Feb 7, 2026
dd60a37
Consolidate imports
alnoki Feb 7, 2026
8d3b097
Fix ptr handling
alnoki Feb 7, 2026
08c9db9
Add tests
alnoki Feb 7, 2026
bbb81ed
Clean up RS logic
alnoki Feb 9, 2026
4261036
Clean up ASM
alnoki Feb 9, 2026
6a1c292
Add ASM pubkey chunked offsets
alnoki Feb 10, 2026
77edbf4
Cold-path PDA mismatch
alnoki Feb 10, 2026
0569a7f
Check in tests
alnoki Feb 10, 2026
d95c33c
Begin refactors for 4 accounts
alnoki Feb 10, 2026
4e25e3b
Begin passing rent sysvar
alnoki Feb 10, 2026
75ded32
Add rent/header/footer layout
alnoki Feb 10, 2026
ef9a24a
Update offset arithmetic
alnoki Feb 10, 2026
312cd5f
Add happy path PDA test
alnoki Feb 10, 2026
66fff6d
Fix rent size offset issue
alnoki Feb 10, 2026
b609169
Take out tempo happy path test
alnoki Feb 10, 2026
28e8724
Optimize rent sysvar pubkey compare
alnoki Feb 10, 2026
5b3e8ad
Correct comment
alnoki Feb 10, 2026
44da0c5
Test chunks
alnoki Feb 10, 2026
e48c754
Clean up ptr syntax
alnoki Feb 10, 2026
55af72b
Begin CreateAccount construction
alnoki Feb 10, 2026
2260629
Begin packing create account insn
alnoki Feb 10, 2026
3dc3ca5
Pack insn data
alnoki Feb 10, 2026
d950ca0
Prepare bulk pointer ops
alnoki Feb 11, 2026
3035bb2
Begin bulk pointer operations
alnoki Feb 11, 2026
bc57144
Pack meta/infos
alnoki Feb 11, 2026
2cb0e18
Finalize CPI draft impl
alnoki Feb 11, 2026
5490614
Fix syscall
alnoki Feb 11, 2026
05e2450
Update program logic x2
alnoki Feb 11, 2026
742a7b2
Update deferred pointer load comment
alnoki Feb 11, 2026
4c5fe22
Finalize tests
alnoki Feb 11, 2026
c3c36f3
Implement rs CPI
alnoki Feb 11, 2026
861c2ca
Rebuild
alnoki Feb 11, 2026
f715012
Include in docs
alnoki Feb 11, 2026
a8b00af
Abstract pointer
alnoki Feb 12, 2026
1d91fe9
Refactor CPI packing layout
alnoki Feb 12, 2026
c752346
Update anchor block
alnoki Feb 12, 2026
77aaae8
Rebuild tests
alnoki Feb 12, 2026
5cb73b2
Add more test cases
alnoki Feb 12, 2026
e691e42
Add more tests
alnoki Feb 12, 2026
88e46ab
Add fixed cost reporting
alnoki Feb 12, 2026
8a02987
Check in tests
alnoki Feb 12, 2026
c88dc24
Update reporting layout
alnoki Feb 12, 2026
ad225e4
Update docs
alnoki Feb 12, 2026
5b24da7
Update docs more
alnoki Feb 12, 2026
b2d77f3
Update case tables
alnoki Feb 12, 2026
d39559e
Run quick-lint
alnoki Feb 12, 2026
ae103c3
Re-gen results
alnoki Feb 12, 2026
10079a6
Run quick-lint
alnoki Feb 12, 2026
be21401
Add tail call note
alnoki Feb 12, 2026
31dcf27
Add tree defs
alnoki Feb 12, 2026
aa51c85
Clean up anchors
alnoki Feb 12, 2026
b24839e
REbuild
alnoki Feb 12, 2026
e66a8ba
TIdy up constants
alnoki Feb 12, 2026
6e97463
Begin insert layout
alnoki Feb 12, 2026
7996a41
Add next ptr allocation
alnoki Feb 12, 2026
cf472d3
Rebuild
alnoki Feb 12, 2026
ebc3fb5
Fix next impl
alnoki Feb 12, 2026
6767858
Finalize testing
alnoki Feb 13, 2026
47aee4f
Check in results
alnoki Feb 13, 2026
64f0fd7
Begin insert logic
alnoki Feb 13, 2026
8cfe637
Add common handler, expected failure tests
alnoki Feb 13, 2026
bd9579d
Add general branching optimization
alnoki Feb 13, 2026
f2597e0
Begin insert algo
alnoki Feb 13, 2026
d9fe96b
Use _ptr
alnoki Feb 13, 2026
359773e
Use _ptrs
alnoki Feb 13, 2026
b212697
Take out _ptr
alnoki Feb 13, 2026
9d3cf57
Take out more _ptr
alnoki Feb 13, 2026
71851f7
Clean up ptr style
alnoki Feb 13, 2026
cb41b73
Update RS impl, tests
alnoki Feb 13, 2026
dc245e9
Rebuild examples
alnoki Feb 13, 2026
d0aa1b5
Update docs for branching flow
alnoki Feb 13, 2026
00d2ea7
Abstract macros for accounts
alnoki Feb 14, 2026
5c1c962
Begin insert allocatin logic
alnoki Feb 14, 2026
5b203f6
Begin insert allocation path
alnoki Feb 14, 2026
f8ad317
Begin allocation refactor
alnoki Feb 14, 2026
c76f812
Update allocations block
alnoki Feb 14, 2026
0bf5db8
Update init behavor, test harness
alnoki Feb 14, 2026
cb5577c
Clean up new allocation path
alnoki Feb 14, 2026
429c338
Rebuild examples
alnoki Feb 14, 2026
3cb65b0
Add asm parity draft for allocate/pop
alnoki Feb 14, 2026
7c6f072
Begin Claude.md
alnoki Feb 16, 2026
4561551
Update CLAUDE.md
alnoki Feb 16, 2026
37fe75c
Tweak CLAUDE.md
alnoki Feb 16, 2026
e0dd1bc
Update scaffolding
alnoki Feb 16, 2026
59d19d2
Add spec
alnoki Feb 16, 2026
d88fa62
Tweak algos
alnoki Feb 16, 2026
f991c7a
Add failure tests, more parity
alnoki Feb 16, 2026
bacd211
Consolidate cast
alnoki Feb 16, 2026
dcfb52c
Begin insert to tree flow
alnoki Feb 17, 2026
bb46e16
Add insertion algorithm
alnoki Feb 17, 2026
4809fb1
Add insert test spec
alnoki Feb 17, 2026
5448f1b
Pass rust insert
alnoki Feb 17, 2026
6f0d77c
Begin implementing asm insert
alnoki Feb 17, 2026
75b0ae8
Fix insert search algo
alnoki Feb 17, 2026
3b00e53
REbuild exampels
alnoki Feb 17, 2026
49829d2
Check in result
alnoki Feb 17, 2026
2aa3e53
Continue with asm impl
alnoki Feb 17, 2026
d2ceba7
Rebuild
alnoki Feb 17, 2026
32fb213
Add insert cases except 5/6
alnoki Feb 17, 2026
469d0e0
Add SPP insertion
alnoki Feb 17, 2026
df70f61
Optimize, build examples
alnoki Feb 17, 2026
11a4524
Begin optimizing
alnoki Feb 17, 2026
dd42760
Inline sidewise cases
alnoki Feb 17, 2026
f2f71b3
Add back parity, anchors
alnoki Feb 17, 2026
963a0f4
Update listings
alnoki Feb 17, 2026
8199812
Spec out more tests
alnoki Feb 17, 2026
42abd15
Clean up tests
alnoki Feb 17, 2026
95b4db9
Refactor tests
alnoki Feb 17, 2026
f617922
Update test listings
alnoki Feb 17, 2026
3452c18
Add more input check cases
alnoki Feb 17, 2026
75245f9
Rebuild, list
alnoki Feb 17, 2026
0039fb0
Clean up tests
alnoki Feb 17, 2026
ecb9892
Include multi-insert
alnoki Feb 17, 2026
26b87ba
Add remove insn scaffolding
alnoki Feb 18, 2026
12f85ea
Update likely branches
alnoki Feb 18, 2026
c4a209f
Optimize more
alnoki Feb 18, 2026
9ecadf3
Inline ja loop
alnoki Feb 18, 2026
3487c9c
Eliminate ja
alnoki Feb 18, 2026
fc3b90c
REbuild exmaples
alnoki Feb 18, 2026
35586cb
Inline optimization for RS
alnoki Feb 18, 2026
23ecb3f
Add block comment
alnoki Feb 18, 2026
44d21e2
Add remove spec
alnoki Feb 18, 2026
4ea55eb
Beging remove impl
alnoki Feb 18, 2026
11d45e3
Add testing spec
alnoki Feb 18, 2026
9ec470e
Bump sbpf version
alnoki Feb 18, 2026
0417f01
Begin testing implementation
alnoki Feb 18, 2026
7544e45
Add build/test skills
alnoki Feb 18, 2026
03cb70d
Add hook
alnoki Feb 18, 2026
59ddc68
Update specs
alnoki Feb 18, 2026
179c166
Add invariants spec
alnoki Feb 18, 2026
3c2741d
Add invariants
alnoki Feb 19, 2026
109e52d
Remove status return parts
alnoki Feb 19, 2026
f98b267
Add more insert testing tweaks
alnoki Feb 20, 2026
42fe103
Implement remove search
alnoki Feb 20, 2026
2de2587
Implement remove search with parity
alnoki Feb 20, 2026
748542e
Update specs per Wikipedia
alnoki Feb 20, 2026
9f00707
Architect simple remove control flow
alnoki Feb 20, 2026
9b33df6
Add simple remove cases
alnoki Feb 20, 2026
c5983e5
Update simple remove
alnoki Feb 20, 2026
81606da
Tweak read/write
alnoki Feb 20, 2026
959d07f
Incorporate prelim remov algo docs
alnoki Feb 23, 2026
40e9bba
Port simple remove algos
alnoki Feb 24, 2026
5d28e5e
Update test spec
alnoki Feb 24, 2026
ecdff11
UPdate tests
alnoki Feb 24, 2026
94b36df
Update tests
alnoki Feb 24, 2026
b6b4623
Re-order tests
alnoki Feb 24, 2026
376933a
Remove prompt hook
alnoki Mar 2, 2026
e6d6431
Add Pentagon skills
alnoki Mar 2, 2026
36ea969
Add example disassembly skill
alnoki Mar 2, 2026
43a26db
Update inlining
alnoki Mar 3, 2026
4c18d39
Add overhead analysis
alnoki Mar 3, 2026
968f97e
Add preliminary remove complex impl
alnoki Mar 3, 2026
d864460
Add first pass of remove-complex algo
alnoki Mar 4, 2026
bef6001
Fix minor impl issues
alnoki Mar 4, 2026
a4dbdf7
Add more fixes
alnoki Mar 4, 2026
38caa6a
Tidy up docs
alnoki Mar 6, 2026
8469827
Remove warning escapes
alnoki Mar 6, 2026
1d5b2f2
Run format
alnoki Mar 6, 2026
ec82c57
RUn quick-lint
alnoki Mar 6, 2026
b9e88f3
Run lint/fmt
alnoki Mar 6, 2026
9ecbff4
Fix quick-lint
alnoki Mar 6, 2026
e2d8266
Add emoji headings
alnoki Mar 6, 2026
be5cf81
Link opcodes
alnoki Mar 6, 2026
5df1b8e
Fix some clippy
alnoki Mar 6, 2026
d5ade29
Re-build examples
alnoki Mar 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .claude/commands/build-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Build example

Run the full build-examples pipeline that builds, dumps, disassembles,
tests, and verifies artifacts.

From the `examples/` directory, run:

```sh
cargo run --bin build-examples -- --example $ARGUMENTS
```

If `$ARGUMENTS` is empty, run without the `--example` flag to build all
examples:

```sh
cargo run --bin build-examples
```

This executes `examples/utils/build-examples/src/main.rs` which handles
building ELF files, generating dumps/disassembly, running tests, saving
test snippets, and verifying code snippets.

Report the outcome. If the command fails, show the relevant error output.
32 changes: 32 additions & 0 deletions .claude/commands/disassemble-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Disassemble example

Quick compile and disassemble cycle for a specific example program.

Run the following commands sequentially from the example directory at
`examples/$ARGUMENTS`:

1. Remove stale binary:

```sh
rm -f ../target/deploy/${ARGUMENTS//-/_}.so
```

1. Build for the disassembly architecture:

```sh
cargo build-sbf --arch v2 --tools-version 1.52
```

1. Disassemble and write output:

```sh
sbpf disassemble ../target/deploy/${ARGUMENTS//-/_}.so \
> artifacts/rs-disassembly.s
```

If `$ARGUMENTS` is empty, infer the example name from the current
conversation context (e.g. recent file paths or discussion). If you still
cannot determine it, ask which example to disassemble.

Report the result. Show the disassembly content or the relevant section
if the user is focused on specific functions.
18 changes: 18 additions & 0 deletions .claude/commands/test-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Test example

Quick build and test cycle for a specific example program.

Run the following commands sequentially from the example directory at
`examples/$ARGUMENTS`:

```sh
cargo build-sbf --arch v3 --tools-version 1.51
sbpf build
cargo test -- --test-threads 1
```

If `$ARGUMENTS` is empty, infer the example name from the current
conversation context (e.g. recent file paths or discussion). If you still
cannot determine it, ask which example to test.

Report the result of each step. If any step fails, stop and show the error.
1 change: 1 addition & 0 deletions .claude/skills/manage-pentagon-agent
1 change: 1 addition & 0 deletions .claude/skills/manage-pentagon-canvas
1 change: 1 addition & 0 deletions .claude/skills/manage-pentagon-role
1 change: 1 addition & 0 deletions .claude/skills/manage-pentagon-team
1 change: 1 addition & 0 deletions .claude/skills/send-pentagon-message
2 changes: 1 addition & 1 deletion .github/workflows/build-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ env:
SBPF_ARCH_DISASSEMBLE: 'v2'
SBPF_ARCH_DUMP: 'v4'
SBPF_ARCH_TEST: 'v3'
SBPF_CLI_REVISION: 'eb67fc5'
SBPF_CLI_REVISION: 'c52805f'
SOLANA_VERSION: 'v3.1.2'
TOOLS_VERSION_DISASSEMBLE: 'v1.52'
TOOLS_VERSION_DUMP: 'v1.51'
Expand Down
34 changes: 34 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Conventions

## Self-Improvement

After every task, check what was learned and route it:

- Repeated instruction (corrected twice): add it to CLAUDE.md.
- Design decision: write or update a spec.
- Repeatable workflow: propose a skill.
- Must always happen: propose a hook.
- Learned pattern: save to memory.

Before implementing anything non-trivial, write or update a spec and get
approval first.

## Markdown

- Use `-` for list markers.
- End list items with periods.
- Wrap lines to maximize use of the 80-column limit. Break at word boundaries,
not early.

Every markdown change must pass (run both):

```sh
cfg=cfg/pre-commit/quick-lint.yml
pre-commit run -c $cfg markdownlint-fix --files <file>
pre-commit run -c $cfg mdformat --files <file>
```

## Specs

- `specs/` for cross-cutting concerns (build, CI, conventions).
- `examples/tree/specs/` for tree-specific design decisions.
4 changes: 4 additions & 0 deletions cfg/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ lamports
lddw
ldxb
ldxdw
ldxh
ldxw
markdownlint
mathjax
mdformat
memcmp
memcpy
metas
Expand All @@ -41,6 +44,7 @@ syscalls
sysvar
sysvars
uninit
uoff
usize
vitepress
xffff
1 change: 1 addition & 0 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default {
{ text: "Fibonacci", link: "/examples/fibonacci" },
{ text: "Transfer", link: "/examples/transfer" },
{ text: "Counter", link: "/examples/counter" },
{ text: "Tree", link: "/examples/tree" },
],
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/src/examples/fibonacci.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<!-- @include: ./disclaimer.md -->

## :1234: Fibonacci sequence background
## :1234: Background

The [Fibonacci sequence] is a classic mathematical sequence where each number is
the sum of the two preceding ones, typically starting with $F(0) = 0$ and
Expand Down
8 changes: 7 additions & 1 deletion docs/src/examples/memo.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@

<!-- @include: ./disclaimer.md -->

## :world_map: Memory map background
## :desktop_computer: Background

This program logs arbitrary message data passed via instruction data. It accepts
no accounts and simply writes the provided bytes to the program log using the
[`sol_log_`] syscall. If any accounts are passed, the program returns an error.

## :world_map: Memory map layout

The [SBPF instruction set architecture] defines 12 registers, including
10 general-purpose registers `r0` through `r9`. At the start of instruction
Expand Down
Loading