Breaking Changes
Codebase quality improvements:
- Fix cu_benchmarks test crash by checking for SBF binary before loading mollusk
- Mark
typed_builderre-export as#[doc(hidden)]non-stable API - Add 11 tests for
pina_clierror type Display impls - Add
cargo docAPI docs check toverify:docsCI - Rename
loaders.rs→impls.rsfor clarity - Improve SAFETY documentation for all unsafe blocks in impls.rs
Features
Add multi-file module resolution to the IDL parser.
parse_program() now follows mod declarations from src/lib.rs to discover and parse additional source files. This enables IDL generation for programs that split code across multiple modules (e.g. src/state.rs, src/instructions/mod.rs).
New module: crates/pina_cli/src/parse/module_resolver.rs with 5 unit tests covering single-file crates, child modules, mod.rs style, missing modules, and inline modules.
The existing assemble_program_ir() function is preserved for backward compatibility and now delegates to the new assemble_program_ir_multi().
Implement opcode-aware CU cost model for the static profiler.
The profiler now decodes each 8-byte SBF instruction's opcode and assigns costs based on the instruction class:
- Regular instructions (ALU, memory, branch): 1 CU each
- Syscall instructions (
call immwithsrc_reg=0): 100 CU each
Per-function profiles now include syscall_count and the text output shows a Syscall column. The JSON output includes total_syscalls and per-function syscall_count.
This replaces the previous flat 1-CU-per-instruction model which could underestimate programs with heavy syscall usage by 10-100x.
Fixes
Comprehensive documentation update across workspace.
New mdt providers (template.t.md):
pinaCliCommands— CLI command reference tablepinaIntrospectionDescription— introspection module overviewpinaProfileDescription— static CU profiler overview
Updated documentation:
docs/src/crates-and-features.md— addedpina_profile, CLI commands table, multi-file parser note, pod arithmetic, codama renderer module structuredocs/src/core-concepts.md— added Pod types table, arithmetic description, introspection section; fixed staleloaders.rs→impls.rsreferencereadme.md— added Pod arithmetic examples, static CU profiler section, replaced outdated 3-crate table with full workspace packages tablecrates/pina_cli/readme.md— addedpina profilecommand, multi-file note- Fixed missing
CU_PER_INSTRUCTIONimport in profiler tests
mdt provider/consumer counts: 23/46 → 26/56.
Add 12 integration tests for pina::introspection module (previously 0% coverage).
Tests construct fake Instructions sysvar account data following the exact binary layout that pinocchio's Instructions parser expects, then exercise each introspection function end-to-end:
get_instruction_count: single and multiple instructionsget_current_instruction_index: correct index returnedassert_no_cpi: passes for top-level, fails for CPI, checks correct indexhas_instruction_before: finds earlier programs, returns false when firsthas_instruction_after: finds later programs, returns false when last- Instructions with account metas and data
- Wrong sysvar address rejection
Refactor pina_codama_renderer: split monolithic lib.rs into focused render modules.
render/helpers.rs— string utilities, docs rendering, numeric castsrender/discriminator.rs— discriminator type/value resolutionrender/types.rs— POD type rendering and defined-type pagesrender/accounts.rs— account struct, PDA helpers, accounts modrender/instructions.rs— instruction struct, account metas, data structrender/seeds.rs— variable and constant PDA seed expression renderingrender/errors.rs— error enum pages and errors modrender/scaffold.rs— crate scaffold creation and file writingrender/mods.rs— root mod and programs mod rendering
lib.rs retains only the public API (RenderConfig, read_root_node, render_idl_file, render_root_node, render_program) and the orchestrator render_program_to_files.
All 13 existing tests continue to pass.