Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Environment variables and tools

PSYNC_GRAPH

ValueEffect
offevery #[psync::graph] function in the build compiles as written
unset or anything elsenormal rewriting

The variable is read when the macro expands. Cargo does not track it, so touch the annotated files, or use a separate CARGO_TARGET_DIR, whenever you change it. See Comparing builds.

cargo psync

cargo psync check [--deny] [--notes] [CARGO CHECK ARGS...]
cargo psync summaries [CRATE] [--all]

Checks #[psync::graph] rewrites against the compiled bodies of callees. Built from psync-check/ with a pinned nightly (cd psync-check && cargo install --path .). See Checking rewrites.

VariableSet by cargo psyncMeaning
PSYNC_SUMMARY_DIRtarget/psync/summarieswhere the driver writes and reads per-crate effect summaries
PSYNC_FINDINGS_DIRtarget/psync/findingswhere the driver writes per-crate findings (JSON)
PSYNC_CHECK_DENY--deny1: findings are errors
PSYNC_CHECK_NOTES--notes1: also report output order and interior mutability

psync-expand

cargo run -p psync-graph --features cli --bin psync-expand -- FILE LINE [BOUND]

Applies #[psync::graph] to the innermost function containing LINE of FILE and prints JSON: function, start_line, end_line, bound, changed, explain, report and expanded. The cli feature enables span locations, so line numbers appear in reports. See Reading the report.

graph_suite

cargo run --example graph_suite --no-default-features [-- --brief] [-- FILTER]

Times 16 real-world functions before and after the rewrite, and checks that the results match. See Sixteen real-world shapes.

Tests

cargo test --no-default-features --test graph        # macro behaviour
cargo test --no-default-features --test scheduling   # executor
cargo test -p psync-graph                            # analysis unit tests
./scripts/test-rp2350.sh [--flash]                   # host tests and RP2350 firmware build

Cargo features

CrateFeatureEffect
psyncrp235x (default)RP2350 heap (init_heap), WFE/SEV parking and HAL dependencies, on thumbv8m.main-none-eabihf only
psync-graphclithe psync-expand binary, line numbers, JSON reports