8000 refactor: reduce runtime overhead across core, Bridge and clients by wu-hongjun · Pull Request #9 · wu-hongjun/InstantLink · GitHub
[go: up one dir, main page]

Skip to content

refactor: reduce runtime overhead across core, Bridge and clients - #9

Draft
wu-hongjun wants to merge 5 commits into
mainfrom
codex/performance-audit-ten
Draft

wu-hongjun wants to merge 5 commits into
mainfrom
codex/performance-audit-ten

Conversation

@wu-hongjun
Copy link
Copy Markdown
Owner

Summary

Ten Astra agents audited ten distinct areas and implemented one measured optimization per area. Finished agents were reused for independent cross-review. See the evidence index and plan 099 for reproduction, raw measurements, review findings and limits.

  • Rust: copy opaque RGB8 Contain rows and extract already validated packet payloads directly.
  • Bridge: reduce retention comparison and outbox serialization work, construct packed IPv4 interfaces directly, stream support-bundle hashing, and bound hue intermediates to 512 × 256 RGB tiles.
  • App: prepare invariant Levels coefficients, pack LUTs directly, and hash firmware artifacts in 1 MiB chunks.
  • iOS app: bound progress delivery to 100 ms intervals while preserving accepted restart/resume offsets, terminal counts and stale-task rejection.

Host results include 8 MP hue tracked peak allocation 762.8 → 10.8 MiB, native RGB Contain composition 4.258 → 0.130 ms, and 256 MiB firmware validator peak RSS 262.47 → 8.58 MiB. These are separate stage/process measurements, not a whole-print or Pi speed claim. Per-area evidence documents noisy/inconclusive measurements and tradeoffs.

Correctness and review

Exact pixels/JPEG/chunks, model orientation, packet error/drain behavior, original ownership and atomic index publication, fresh network snapshots, hashing failures and existing validation paths are preserved. There are no dependency, version, ABI, sync schema or localization changes.

Independent review found and resolved Python-version-dependent FTP test injection. Primary review found and fixed an iOS retry progress regression before acceptance. Tiled hue refinement avoids the original candidate's large temporary arrays. Independent Rust/App, Bridge, hue and iOS review records are included.

Validation

  • cargo build --workspace --locked, cargo fmt --all -- --check, cargo clippy --workspace --locked -- -D warnings, cargo test --workspace --locked: passed; 349 tests passed, one optional benchmark ignored.
  • bash scripts/check-ffi-header.sh: passed. Rust uses the existing Homebrew static JPEG library through explicit TURBOJPEG_* variables because the host lacks vendored-build prerequisites.
  • Bridge Ruff format/lint, strict mypy and full pytest: passed; 3,196 tests, eight expected non-Pi GPIO fallback warnings.
  • bash scripts/test-macos.sh: 165 passed; existing Combine import warnings only. Shell syntax passed.
  • XcodeGen + iOS simulator xcodebuild test, signing disabled: 51 executed, zero failures, one existing unavailable-Keychain skip.
  • Eight Python benchmark helpers pass lint/format with the Bridge Ruff configuration.
  • MkDocs strict build and Git whitespace checks: passed.
  • Localization checker retains the byte-identical baseline failure: 270 missing English keys. No strings changed.
  • All path-scoped commit hooks passed.

Hardware and scope

Software image/render/filesystem checks ran on Apple M3 Max / macOS 27.0.1, with an arm64 macOS 15 deployment target. iOS tests used iPhone 17 / iOS 27.0 Simulator. No physical Pi, Printer, camera or iPhone was accessed, no film was used, and no firmware was installed. Pi timing, full pipeline memory, reconnect/upload hardware behavior and battery savings remain unmeasured for these changes. UI layouts and copy are unchanged.

This branch has not been deployed

No deployments
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

0