Files
lightcraft/crates/denoise
akvaithiandClaude Opus 5.5 84b8995d7b LR-EDIT-DETAIL-DENOISE: run tiles on another computer's graphics card
- `lightcraft_denoise::remote`: protocol v1 over TCP (JSON lines + byte-shuffled,
  deflated half-float tiles), a `Remote` client (connection pool, four slots,
  greeting checks the model's SHA-256 and tile size, gives up after three failed
  tiles) and `serve` (shared token compared in constant time, size caps including
  payloads that inflate past their tile, connection limit, timeouts).
- Engine: with LIGHTCRAFT_DENOISE_URL / LIGHTCRAFT_DENOISE_TOKEN set, the loaded
  model greets the server on first use and adds its slots to this computer's
  tiles at once; a tile goes to a free server slot, else runs here, and a tile
  the server fails runs here too. `denoise.status` → `device.remote` says where.
- `lightcraft-cli denoise-serve` serves the installed, selected model on this
  computer's card (checked against the CPU, as in the app) or CPU.
- docs/denoise.md: setup, safety (unencrypted: VPN/LAN only) and the protocol.

Tested: protocol round trips, refusals (token, model, tile size, hostile
payloads), fallback and give-up; the engine model with a live, a mismatched
and a dead server; the CLI binary serving a synthetic model end to end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 15:21:48 -05:00
..

lightcraft-denoise

L1 pure-Rust AI RAW denoise primitives and CPU inference. No weights are bundled. See user workflow and limitations.

lightcraft-denoise-core provides metadata, Bayer helpers and cache formats, re-exported here. manifest and known validate opt-in models; onnx reads a bounded operator subset into net; cpu executes it and reference supplies scalar checks. bayer, tiles and run pack sensor data and blend overlapping tiles while preserving clipped highlights. product reads/writes the disposable .lcdn cache. runtime supplies the installation self-test. Synthetic networks are generated in Rust for tests.

Run cargo test -p lightcraft-denoise --features runtime. The CPU backend is optional; featureless and web builds keep the model metadata and cache format without faer/GEMM. The rawnind-model feature enables the otherwise empty download catalog and requires an explicit release-policy decision. Real-model tests are ignored by default and require an explicitly supplied local model. The GPU twin is lightcraft-gpu::nn; model management, background jobs and export integration live in lightcraft-engine.