Skip to content

Latest commit

 

History

History
79 lines (58 loc) · 2.3 KB

AGENTS.md

File metadata and controls

79 lines (58 loc) · 2.3 KB

pixl agent instructions

purpose

pixl is a native rust image processing engine and cli. keep it small, correct and predictable. prefer straightforward rust over clever rust.

structure

  • crates/pixl-core — typed image representation, pixel formats, limits
  • crates/pixl-codecs — format detection and codec integration
  • crates/pixl-ops — image operations, scratch buffers, parallelism
  • crates/pixl-cli — argument parsing, ordered operations, diagnostics

pixl-color and pixl-cache are not separate crates: colour conversion is small and lives in core/ops, and scratch buffers are local to operations. create them only when a concrete need appears.

architecture

  • rgba8 is the internal working format.
  • images are contiguous vecs with checked dimensions.
  • limits are enforced before allocation.
  • resizing uses fast_image_resize with runtime cpu detection.
  • gaussian blur is separable convolution.
  • parallelism uses the rayon global pool; no nested pools.

commands

cargo fmt --all -- --check
cargo check --workspace --all-targets --locked
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --locked
cargo doc --workspace --no-deps
cargo bench -p pixl-ops

conventions

  • lowercase prose and comments.
  • snake_case modules and functions, PascalCase types.
  • no comments that restate code.
  • document public apis briefly.
  • no unnecessary abstractions, macros or dependency layers.

testing

  • unit tests live beside implementations.
  • reference tests use hand-computed expected values.
  • cli integration tests exercise the built binary.
  • every bug fix needs a regression test.

dependencies

  • exact pins in the workspace for reproducibility.
  • workspace inheritance for shared versions.
  • 3-day publish-age cooldown via .cargo/config.toml.
  • no dependency without a concrete reason.

performance

  • measure before optimising.
  • never invent benchmark numbers.
  • no target-cpu=native in portable builds.
  • no unsafe code without a documented reason.

security

  • all image input is untrusted.
  • enforce dimension and pixel limits.
  • handle decoder errors explicitly.
  • no unsafe blocks without a safety comment.

git

  • small, focused commits.
  • never commit generated artifacts or secrets.
  • do not claim checks passed unless they actually did.