Repository navigation
feat(vcli-perception): Tier-1 and Tier-2 predicate evaluators - #8
Merged
Merged
Conversation
…ursion Plan deviation: stub perception.rs pre-wires ColorAt + PixelDiff dispatch so logical evaluator tests can call through to leaf evaluators; the full façade is wired in Task 13.
Plan deviation: NCC (CrossCorrelationNormalized) returns 0 for constant- valued (all-black) templates due to zero variance. Adapted test to use a template with variation (white border + black inner block) and a matching scene. The evaluator implementation is unchanged; only the test fixture was adapted. Noted in template.rs test doccomment.
… state persistence
Fix all clippy::pedantic warnings surfaced by -D warnings: - doc_markdown: backtick-wrap DashMap, pixel_diff, elapsed_ms_since_true, program_id, predicate_name identifiers in doc comments - many_single_char_names: #[allow] on ColorAtEvaluator::sample (r/g/b/dr/dg/db are the only natural names for RGB components) - cast_sign_loss / cast_possible_wrap / cast_possible_truncation: replace bare `as` casts with #[allow]-annotated let bindings at each site; all casts are provably safe (coords non-negative after guard, dimensions < 2^31) Verification gate (Task 15): cargo fmt --all -- --check PASS (no diffs) cargo clippy -p vcli-perception PASS (0 warnings) cargo clippy --workspace PASS (0 warnings) cargo test --workspace --locked PASS (141 tests: 84 core + 55 perception) cargo doc -p vcli-perception PASS (no warnings) cargo check --workspace PASS Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…li-perception # Conflicts: # Cargo.lock # Cargo.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vcli-perceptioncrate (Tasks 1–15 of plan2026-04-16-vcli-perception.md), providing all predicate evaluators for the vcli perception pipelineDashMap-backedPredicateCache(per-tick, cleared by runtime at tick start) andPerceptionState(cross-tick: dHash snapshots forpixel_diff, first-true timers forelapsed_ms_since_true)ColorAt(pixel sample + Euclidean distance),PixelDiff(dHash motion detection),AllOf/AnyOf/Not(logical composition with depth-bounded recursion and shared-cache dedup),ElapsedMsSinceTrue(program-scoped rising-edge timer),Template(imageproc NCC with bbox recovery)Perceptionfaçade wraps everything withevaluate_named(), memoizes throughPredicateCache, and routes to per-kind evaluatorsKey design decisions
Evaluatoris&self+Send + Sync(safe underrayon::par_iter)DashMap 6for both cache and state (lock-free concurrent access)imageproc 0.25CrossCorrelationNormalizedfor NCC; templates must have non-zero variance (constant templates return NCC=0 — documented in test comments)vcli_core::predicate_hash()for content-addressed cache keys#![forbid(unsafe_code)],#![deny(rust_2018_idioms)],#![warn(clippy::pedantic)]Verification gate (Task 15)
cargo fmt --all -- --check— PASScargo clippy -p vcli-perception --all-targets -- -D warnings— PASS (0 warnings)cargo clippy --workspace --all-targets -- -D warnings— PASS (0 warnings)cargo test --workspace --locked— PASS (141 tests: 84 vcli-core + 55 vcli-perception)cargo doc -p vcli-perception --no-deps— PASS (0 warnings)cargo check --workspace— PASSTest plan
cargo test --workspace --lockedruns green (141 tests)cargo clippy --workspace --all-targets -- -D warningsproduces no outputcargo doc -p vcli-perception --no-depsbuilds without warningstests/cache_and_state.rsverify cross-tick state persistence and per-tick cache dedup🤖 Generated with Claude Code