Skip to content

perf(vision): reuse exact LK template samples across iterations - #336

Merged
rsasaki0109 merged 3 commits into
mainfrom
codex/lk-template-reuse
Oct 22, 2026
Merged

rsasaki0109 merged 3 commits into
mainfrom
codex/lk-template-reuse

Conversation

@rsasaki0109

Copy link
Copy Markdown
Owner

Sparse CPU LK repeatedly sampled the same previous-image template during each point/level solve. Lazily retain its exact center and gradient values in a call-local array for radii at most five and multiple configured iterations. Keep both-frame bounds checks every iteration, the accumulation/update order, fallback expressions, custom conversions and public APIs. The complete cache type is compile-time bounded to 4 KiB with no new heap allocation.

Validation: 96 vision tests before and after, 24 web tests, no-feature vision build, two Clippy checks and formatting pass. The complete parent module is frozen before implementation. All 126 independent native camera reports and 252 actual WASM reports/84 rejections match. All 92 JS, six asset and 86 browser controls pass with synthetic capture.

Two interleaved surveys retain every result: 17 of 36 paired medians are lower, 19 higher, with a worst observed ratio of 1.521. All 12 nonempty translated-image pairs are 66-75% shorter. Stationary/empty cases and compiler placement/inlining differences are explicit limitations; the frozen module is local to the driver and the candidate calls the library. Empty calls never enter the changed kernel. Existing independent camera timings were also inspected as an explicitly exploratory secondary check, with every condition retained separately. No physical-phone, GPU or end-to-end browser speed claim.

The fresh offline target stays under its 1 GiB cap with zero shared-cache growth, preserving all 5,038 earlier camera/renderer files and scientific/native evidence. No sensor, model, SDK, browser or toolchain acquisition. See docs/LK_TEMPLATE_REUSE.md and docs/receipts/2026-10-22_lk_template_reuse.json. Operational 80% gates remain open.

@rsasaki0109
rsasaki0109 merged commit 05b4f64 into main Oct 22, 2026
132 checks passed
@rsasaki0109
rsasaki0109 deleted the codex/lk-template-reuse branch October 22, 2026 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant