1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! `indicatrix-worker`: a library server for a `indicatrix`-backed gemstone design catalogue,
//! with optional render capacity on top.
//!
//! **Default role: library server.** Running `serve` with no extra features accepts
//! `indicatrix-net`'s read-only design-library protocol (see [`serve::library`]) over
//! mutual TLS -- listing/searching designs, fetching one in full, fetching an
//! attachment's bytes. This is the default, not an add-on: a future Slint mobile client
//! talks to exactly this protocol and never has a renderer compiled in.
//!
//! **`worker` feature (off by default): render capacity.** Gates `RenderRequest`
//! handling, `stream_emit`, `render_core`, `render_cmd`, the `render` subcommand, and
//! `Backend` advertisement in `WELCOME` -- see `Cargo.toml` for exactly what that turns
//! on, and [`serve`]'s module docs for how one connection dispatches between the library
//! and render protocols once both are compiled in.
//!
//! - `render` (only meaningful with `worker` on): trace a scene straight to a PNG, no
//! networking. See [`render_cmd::run`].
//! - `serve`: the coordinator. Serves the library protocol to
//! viewers (always); under `worker` also accepts `join`ing workers on a separate
//! worker port ([`coordinator`]) and, with `--render`, renders `RenderRequest`s with
//! its own CPU/GPU. **`serve` no longer renders by default.** See [`serve::run`].
//! - `join` (`worker`): dial a coordinator's worker port and serve its render requests
//! over that outbound connection. See [`join::run`].
//!
//! # GPU
//!
//! An optional `gpu` feature (off by default, implies `worker`) routes tracing through
//! `indicatrix`'s GPU megakernel instead of `optics::raytracer::trace_spectral_ray`.
//! Verified end to end against a real adapter -- see
//! `crates/indicatrix/examples/gpu_equivalence_harness.rs`.
//!
//! [`indicatrix::renderer::gpu_backend::GpuBackend`] is the decline/fallback wrapper both
//! this crate and `apps/indicatrix-cut` drive. It lives in `indicatrix`, not here, since
//! a duplicated copy of a correctness policy (the HDR-environment decline) can drift
//! into silently rendering the wrong image.
// Trait-solver resource limit, not a lint: under `--features gpu`, proving the
// `thread::spawn` closure in `serve::run`'s accept loop is `Send` requires recursing
// through `wgpu`'s internal types deeper than the default limit allows. Unconditional
// (not `cfg_attr`-gated to `gpu`) since a single crate-wide limit is simpler than
// tracking which feature combination needs it, and it's a no-op when `wgpu` isn't
// pulled in. Do not remove: the overflow reproduces on every `--features gpu` build.