The scanner stopped at the first '#[cfg(test)] mod x;' of a file, so the code below was invisible. It now skips only the item under a test-only cfg (an inline mod body, a declaration, a fn, a use; any(test, feature) is not test-only) and reads on. process-global counted the type name OnceLock/LazyLock/OnceCell, which also matched instance fields (six exceptions existed only for that) and missed Atomic*, Mutex, RwLock, Once, Cell and RefCell statics, thread_local! included. It now counts a static whose type is a cell or a workspace type that holds one (derived per crate and its dependencies), and static mut. Eight exceptions that only excused instance fields go; the rest of the file's hits are re-judged. Newly visible: 123 static cells in 58 files, 15 allow(unused_imports) in 6 files and the engine settings::process() cell (read at about 78 sites). Each gets an exception whose reason starts kept: (the boundary that forces it) or debt: (what removes it); the settings cell is the largest debt and is not removed here because the engine does not compile on Windows. Entries 173 -> 229, baseline stays empty. 11 new self-tests (39 in all).
294 lines
68 KiB
JSON
294 lines
68 KiB
JSON
{
|
|
"_comment": "Policy read by scripts/check-architecture.py (STRA-338 ADR). Layers are ordered low to high; a normal dependency must point to the same or a lower layer. L2 (core) holds the extracted domain crates: leleka-gateway-domain (S21); the engine domain crates follow (S19). Every workspace package appears in exactly one layer.",
|
|
"max_lines": 400,
|
|
"adapter_layer": "L3",
|
|
"pure_layers": ["L0", "L1", "L2"],
|
|
"forbidden_in_pure": ["tokio", "axum", "tonic", "tonic-prost", "reqwest", "hyper", "libc", "rustix", "windows-sys", "sysinfo", "wgpu"],
|
|
"layers": {
|
|
"L0": ["leleka-backend-api", "leleka-worker-protocol"],
|
|
"L1": [
|
|
"leleka-obs", "leleka-context", "leleka-sampler-ref", "leleka-quant-core", "leleka-serving-policy", "leleka-harmony",
|
|
"leleka-tokenizer", "leleka-gguf", "leleka-kar-codec", "leleka-experimental-ref", "leleka-cpu-sys", "leleka-cpu-kernels",
|
|
"leleka-shm", "leleka-openvino", "leleka-memory", "leleka-gateway-text", "leleka-cuda-model"
|
|
],
|
|
"L2": ["leleka-gateway-domain", "leleka-engine-core"],
|
|
"L3": [
|
|
"leleka-libc-shim", "leleka-memory-os", "leleka-model-format", "leleka-cuda-driver", "leleka-native-cpu-expert", "leleka-gptoss", "leleka-igpu",
|
|
"leleka-gptoss-igpu", "leleka-gptoss-npu", "leleka-npu-service", "leleka-cpu-worker", "leleka-igpu-worker", "leleka-npu-worker",
|
|
"leleka-gpu-npu-worker", "leleka-offline-tools", "leleka-runtime-client",
|
|
"leleka-engine-fake",
|
|
"leleka-engine-qwen35-cuda"
|
|
],
|
|
"L4": ["leleka-runtime", "leleka-engine-host", "leleka-control-plane", "leleka-deploy", "leleka-native-parity-bench"]
|
|
},
|
|
"adapter_edges": [
|
|
["leleka-cuda-driver", "leleka-libc-shim"],
|
|
["leleka-cuda-driver", "leleka-model-format"],
|
|
["leleka-model-format", "leleka-libc-shim"],
|
|
["leleka-native-cpu-expert", "leleka-libc-shim"],
|
|
["leleka-cpu-worker", "leleka-gptoss"],
|
|
["leleka-gptoss-igpu", "leleka-gptoss"],
|
|
["leleka-gptoss-igpu", "leleka-igpu"],
|
|
["leleka-gptoss-npu", "leleka-gptoss"],
|
|
["leleka-igpu-worker", "leleka-cpu-worker"],
|
|
["leleka-igpu-worker", "leleka-gptoss-igpu"],
|
|
["leleka-npu-worker", "leleka-cpu-worker"],
|
|
["leleka-npu-worker", "leleka-gptoss-npu"],
|
|
["leleka-gpu-npu-worker", "leleka-cpu-worker"],
|
|
["leleka-gpu-npu-worker", "leleka-gptoss"],
|
|
["leleka-gpu-npu-worker", "leleka-gptoss-igpu"],
|
|
["leleka-gpu-npu-worker", "leleka-gptoss-npu"],
|
|
["leleka-offline-tools", "leleka-model-format"],
|
|
["leleka-engine-qwen35-cuda", "leleka-cuda-driver"],
|
|
["leleka-engine-qwen35-cuda", "leleka-model-format"],
|
|
["leleka-engine-qwen35-cuda", "leleka-native-cpu-expert"],
|
|
["leleka-engine-qwen35-cuda", "leleka-memory-os"]
|
|
],
|
|
"mechanical_names": {
|
|
"why": "a module name must say what it is and what it is for; names left by mechanical splits (impl_*, *_fn, numbered) make the source hard to read",
|
|
"patterns": ["^impl_.*\\.rs$", "_fn\\.rs$", "_[0-9]+(_[0-9]+)*\\.rs$"],
|
|
"allow": ["^(quantize_)?q[0-9]_[0-9k]\\.rs$"]
|
|
},
|
|
"_exceptions": "Sites that must stay, so the ratchet is zero outside this list (STRA-338 stage 10). Each entry: crate, file (relative to the crate directory), ratchet (a source_patterns id), reason. The reason starts with `kept:` (the site must stay, and the boundary that forces it) or `debt:` (a real remaining owner problem, and what removes it). The file's hits of that ratchet are not counted; an entry that excuses nothing is an error.",
|
|
"exceptions": [
|
|
{"crate": "leleka-cuda-model", "file": "src/env_switch.rs", "ratchet": "env-read", "reason": "EnvSwitch is the one reader of the operator environment in this crate: it reads one named variable on the first get() and applies a typed rule"},
|
|
{"crate": "leleka-cpu-worker", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
|
|
{"crate": "leleka-tokenizer", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
|
|
{"crate": "leleka-gptoss-npu", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
|
|
{"crate": "leleka-gpu-npu-worker", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
|
|
{"crate": "leleka-igpu", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
|
|
{"crate": "leleka-memory", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
|
|
{"crate": "leleka-gptoss", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
|
|
{"crate": "leleka-model-format", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
|
|
{"crate": "leleka-obs", "file": "src/level.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: LELEKA_LOG* parsed once into Settings, and the request-log path"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: its catalogue holds the operator settings as named cells (EnvSwitch, EnvSetting, LazySetting from leleka_cuda_model::env_switch, MarkerFiles) read on first use; the option parsers that take several variables (stager, stream-all, chain flags, sm120 switches) call the pass-through var/var_os from their own parse functions"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate (CPU expert pool, a hot path): the Setting catalogue parses the A/B switches and the kernel dispatch once; the pool and report readers still call the pass-through var/var_os with their own parsing"},
|
|
{"crate": "leleka-cpu-kernels", "file": "src/dispatch.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: ISA_ENV is parsed by Isa::from_request into the selected instruction set"},
|
|
{"crate": "leleka-libc-shim", "file": "src/cuda_trace/trace_state.rs", "ratchet": "env-read", "reason": "Windows interposer (FFI): the CUDA call tracer reads its own LELEKA_BRINGUP_TRACE switches and must not depend on other crates"},
|
|
{"crate": "leleka-libc-shim", "file": "src/lib.rs", "ratchet": "env-read", "reason": "Windows interposer (FFI): the DLL search directories come from the process environment before any other crate can load"},
|
|
{"crate": "leleka-memory-os", "file": "src/heap.rs", "ratchet": "env-read", "reason": "platform adapter (glibc heap): reads its own LELEKA_MEMORY_NO_TRIM switch once"},
|
|
{"crate": "leleka-native-parity-bench", "file": "src/lib.rs", "ratchet": "env-read", "reason": "benchmark host (L4): reads the operator's STRATA_IQ_MT_MIN override to report which value it measured"},
|
|
{"crate": "leleka-npu-worker", "file": "src/main.rs", "ratchet": "env-read", "reason": "worker binary (composition root): reads LELEKA_OPENVINO_ROOT into its configuration"},
|
|
{"crate": "leleka-memory", "file": "src/settings.rs", "ratchet": "process-global", "reason": "kept: the LELEKA_NO_TRIM_FILE path is ambient process environment, immutable after start (a cached read equals a fresh one); this crate is below the engine Settings owner and MemoryServices carries the governor, not the environment, so no settings value reaches the reader"},
|
|
{"crate": "leleka-memory", "file": "src/governor.rs", "ratchet": "dyn-trait", "reason": "port boundary: the Governor holds its MemoryPressure adapter as Arc<dyn MemoryPressure>, chosen at start-up (hexagonal.md, ports table)"},
|
|
{"crate": "leleka-memory", "file": "src/governor/operations/setup.rs", "ratchet": "dyn-trait", "reason": "port boundary: Governor::new takes the host as Arc<dyn ProcSource + Send + Sync> (the adapter is chosen by the composition root) and source() hands it back"},
|
|
{"crate": "leleka-memory", "file": "src/lock/page_locking.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedPageLocking = Arc<dyn PageLocking>, the OS adapter of mmap/mlock chosen by the composition root"},
|
|
{"crate": "leleka-memory", "file": "src/telemetry.rs", "ratchet": "dyn-trait", "reason": "port boundary: the GPU probe is a closure chosen at start-up (nvidia-smi or NVML) and owned by the sampler thread"},
|
|
{"crate": "leleka-memory", "file": "src/smi.rs", "ratchet": "dyn-trait", "reason": "port boundary: the nvidia-smi probe closure handed to the telemetry sampler (see telemetry.rs)"},
|
|
{"crate": "leleka-cpu-worker", "file": "src/engine.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: load and prefill wall-time measurement, reported in the worker's timing line"},
|
|
{"crate": "leleka-cpu-worker", "file": "src/serve.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: per-request wall-time measurement (prefill and decode), reported in the worker's timing line"},
|
|
{"crate": "leleka-cpu-worker", "file": "src/serve/decode_loop.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: per-token lap timers of the decode loop; one reading per lap, summed into the timing line"},
|
|
{"crate": "leleka-gptoss", "file": "src/forward_pass.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: per-pass lap timer inside the forward pass; one reading per lap, summed into the timing report"},
|
|
{"crate": "leleka-gptoss", "file": "src/generation.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: generation wall-time measurement for the timing report"},
|
|
{"crate": "leleka-gptoss-igpu", "file": "src/prefill_pass.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wall-time measurement of one prefill pass, reported with the pass"},
|
|
{"crate": "leleka-gptoss-igpu", "file": "src/prefill_run.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: stage lap timers of the iGPU prefill, reported in the timing line"},
|
|
{"crate": "leleka-gptoss-npu", "file": "src/expert_pass.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: stage lap timers of the NPU expert pass, reported in the timing line"},
|
|
{"crate": "leleka-gptoss-npu", "file": "src/prefill_batch.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: stage lap timers of the NPU prefill batch, reported in the timing line"},
|
|
{"crate": "leleka-gptoss-npu", "file": "src/prefill_part_pass.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wall-time measurement of one NPU prefill part, reported with the pass"},
|
|
{"crate": "leleka-gptoss-npu", "file": "src/service_transfers.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: transfer wall-time measurement toward the NPU service"},
|
|
{"crate": "leleka-gpu-npu-worker", "file": "src/lib.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wall-time measurement of the split prefill passes, reported in the timing line"},
|
|
{"crate": "leleka-gpu-npu-worker", "file": "src/split_run.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: lap timers of the GPU and NPU legs of the split prefill"},
|
|
{"crate": "leleka-igpu", "file": "src/matrix_uploads.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wall-time measurement of the weight upload, reported at load"},
|
|
{"crate": "leleka-npu-service", "file": "src/engine/execution.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: lap timers of one NPU execution, summed into the profile report"},
|
|
{"crate": "leleka-model-format", "file": "src/bulk_read/for_each_chunk.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wall-time measurement of the bulk read, reported in the load report"},
|
|
{"crate": "leleka-model-format", "file": "src/huge_pages.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wall-time measurement of the huge-page allocation probe, reported in the load report"},
|
|
{"crate": "leleka-model-format", "file": "src/kar/independent_handles.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wall-time measurement of opening the independent file handles"},
|
|
{"crate": "leleka-model-format", "file": "src/pinned_arena_plan/expert_parallel_load.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: read and copy lap timers of the expert load, reported in the load report"},
|
|
{"crate": "leleka-model-format", "file": "src/ple_reader/read_queue.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: readings of the per-row read queue's latency window, inside the reader loop"},
|
|
{"crate": "leleka-model-format", "file": "src/ple_reader/row_reading.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: latency measurement of one PLE row read, inside the reader loop"},
|
|
{"crate": "leleka-obs", "file": "src/time/clock.rs", "ratchet": "instant-now", "reason": "the clock adapter itself: SystemClock, AnyClock and ManualClock are the one place that reads the monotonic clock"},
|
|
{"crate": "leleka-memory-os", "file": "src/heap.rs", "ratchet": "process-global", "reason": "kept: platform adapter over the glibc heap, which is itself process-wide; the LELEKA_MEMORY_NO_TRIM switch is ambient immutable environment read once, and the adapter is below the Settings owner"},
|
|
{"crate": "leleka-libc-shim", "file": "src/cuda_trace/trace_state.rs", "ratchet": "process-global", "reason": "kept: FFI interposer boundary. The CUDA call tracer is state behind C-ABI hooks that the dynamic loader calls with no context pointer and no way to carry an argument; the process is the only scope that exists there"},
|
|
{"crate": "leleka-obs", "file": "src/lib.rs", "ratchet": "process-global", "reason": "kept: the logger facade, like the `log` crate, is process-wide by contract: elog! and request logging are called from every crate without a handle; its Settings, rate limiter and request sink are built once from the environment"},
|
|
{"crate": "leleka-obs", "file": "src/write_stderr.rs", "ratchet": "process-global", "reason": "kept: the request-log sink of the process-wide logger facade of lib.rs (same reason: written by every thread, no handle at the call sites)"},
|
|
{"crate": "leleka-tokenizer", "file": "src/lib.rs", "ratchet": "process-global", "reason": "kept: immutable constant tables (the pre-tokenizer regex and the character classes) compiled on first use; a pure function of constants, a memo no caller can observe"},
|
|
{"crate": "leleka-gptoss-npu", "file": "src/half.rs", "ratchet": "process-global", "reason": "kept: immutable constant table (half-to-float conversion), a pure function of constants built once; no caller can observe the memo"},
|
|
{"crate": "leleka-cuda-model", "file": "src/original_prefill_schedule.rs", "ratchet": "dyn-trait", "reason": "parameter struct SourceView borrows three residency queries (resident, pinned, transient) from the caller's tables; a generic parameter per closure would make the type unnameable in the callers' signatures"},
|
|
{"crate": "leleka-experimental-ref", "file": "src/remote_experts.rs", "ratchet": "dyn-trait", "reason": "parameter struct Candidates borrows the primary's residency test from the caller's table; generic parameters would leak into every caller's signature"},
|
|
{"crate": "leleka-cpu-worker", "file": "src/engine.rs", "ratchet": "dyn-trait", "reason": "port boundary: the engine holds the prefill accelerator (iGPU, NPU or split) as Box<dyn PrefillAccelerator + Send>, chosen by the worker binary"},
|
|
{"crate": "leleka-cpu-worker", "file": "src/serve.rs", "ratchet": "dyn-trait", "reason": "dyn-compatible worker trait: the progress callback of a trait method must be a trait object"},
|
|
{"crate": "leleka-gptoss", "file": "src/decode_state.rs", "ratchet": "dyn-trait", "reason": "port boundary: PrefillAccelerator and LayerCache are the accelerator seams, chosen by the worker binary; their methods take the progress callback as a trait object"},
|
|
{"crate": "leleka-gptoss", "file": "src/model.rs", "ratchet": "dyn-trait", "reason": "port boundary: the model's weights read through Arc<dyn ModelBytes> (file, memory map or test bytes), chosen when the model is loaded"},
|
|
{"crate": "leleka-gptoss", "file": "src/tensor_loading.rs", "ratchet": "dyn-trait", "reason": "port boundary: the model's weights read through Arc<dyn ModelBytes> (file, memory map or test bytes), chosen when the model is loaded"},
|
|
{"crate": "leleka-gptoss", "file": "src/weights.rs", "ratchet": "dyn-trait", "reason": "port boundary: the model's weights read through Arc<dyn ModelBytes> (file, memory map or test bytes), chosen when the model is loaded"},
|
|
{"crate": "leleka-gptoss", "file": "src/pool.rs", "ratchet": "dyn-trait", "reason": "the worker pool runs heterogeneous closures: Box<dyn FnOnce + Send> is the type-erased job of its queue"},
|
|
{"crate": "leleka-gptoss-igpu", "file": "src/lib.rs", "ratchet": "dyn-trait", "reason": "port boundary: the memory probe closure and the PrefillAccelerator impl (trait objects by the trait's own signature)"},
|
|
{"crate": "leleka-gptoss-npu", "file": "src/lib.rs", "ratchet": "dyn-trait", "reason": "port boundary: the memory probe closure chosen by the worker binary"},
|
|
{"crate": "leleka-gptoss-npu", "file": "src/accelerator.rs", "ratchet": "dyn-trait", "reason": "PrefillAccelerator impl: the progress callback is a trait object by the trait's own signature"},
|
|
{"crate": "leleka-gpu-npu-worker", "file": "src/lib.rs", "ratchet": "dyn-trait", "reason": "port boundary: the memory probe closure, the LayerCache seam and the PrefillAccelerator impl (trait objects by the traits' own signatures)"},
|
|
{"crate": "leleka-tokenizer", "file": "src/lib.rs", "ratchet": "dyn-trait", "reason": "Result<T, Box<dyn Error>> of the public tokenizer API: the error is the std error object at the library boundary"},
|
|
{"crate": "leleka-model-format", "file": "src/gguf.rs", "ratchet": "dyn-trait", "reason": "Result<T, Box<dyn Error>> of the GGUF reader's public API: the std error object at the library boundary"},
|
|
{"crate": "leleka-model-format", "file": "src/qwen4exp.rs", "ratchet": "dyn-trait", "reason": "the artifact error wraps any std error (Box<dyn Error>) from the byte sources it reads through"},
|
|
{"crate": "leleka-model-format", "file": "src/qwen4exp/binding_topology.rs", "ratchet": "dyn-trait", "reason": "std::error::Error::source() returns &(dyn Error + 'static) by the trait's own signature"},
|
|
{"crate": "leleka-model-format", "file": "src/ple_reader.rs", "ratchet": "dyn-trait", "reason": "port boundary: the PLE reader holds its PageSource (file, direct-IO file or test double) as Arc<dyn PageSource>"},
|
|
{"crate": "leleka-model-format", "file": "src/ple_reader/row_reading.rs", "ratchet": "dyn-trait", "reason": "port boundary: PleReader::open takes the PageSource as Arc<dyn PageSource>"},
|
|
{"crate": "leleka-model-format", "file": "src/huge_pages.rs", "ratchet": "process-global", "reason": "kept: ambient environment and the mapping registry. The huge-page mode (LELEKA_HUGEPAGES, MODE) is immutable after start so the cache equals a fresh read, and model-format is below the engine Settings owner (dependency direction); LIVE is the registry of the live huge-page mappings that the release path needs, a process-wide fact of the allocator"},
|
|
{"crate": "leleka-model-format", "file": "src/kar/independent_handles.rs", "ratchet": "process-global", "reason": "kept: ambient environment. The identity-recheck switch is immutable after start so the cache equals a fresh read; model-format is below the engine Settings owner (dependency direction)"},
|
|
{"crate": "leleka-model-format", "file": "src/kar.rs", "ratchet": "process-global", "reason": "kept: COLD_SKIP, the number of upcoming calls that read in parallel without probing after a cold verdict (a cold file would pay the probe's latency each time); a read-path heuristic of the process's one archive reader, output-neutral. The OnceLock field of the archive is an instance field and no longer counted"},
|
|
{"crate": "leleka-control-plane", "file": "src/env_settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the crate: every variable is parsed here into a typed value (number, path, flag, mode)"},
|
|
{"crate": "leleka-deploy", "file": "src/env_settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the crate: every variable is parsed here into a typed value (path, flag, text)"},
|
|
{"crate": "leleka-engine-host", "file": "src/env_settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the crate and its binaries: credentials by name, the evaluation switches, the inherited child variables"},
|
|
{"crate": "leleka-gateway-text", "file": "src/prompt/env_settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the crate: the two prompt rendering switches"},
|
|
{"crate": "leleka-npu-service", "file": "src/env_settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the crate: the profile report switch"},
|
|
{"crate": "leleka-control-plane", "file": "src/adapters/system_clock.rs", "ratchet": "instant-now", "reason": "the production Clock adapter: the one place that reads the runtime clock for the injected Clock port"},
|
|
{"crate": "leleka-control-plane", "file": "src/ports/fakes/clock.rs", "ratchet": "instant-now", "reason": "test fixture: the manual clock needs one base instant to count from and never moves by itself"},
|
|
{"crate": "leleka-engine-host", "file": "src/clock.rs", "ratchet": "instant-now", "reason": "the runtime-clock adapter of the Clock port of the crate"},
|
|
{"crate": "leleka-engine-host", "file": "src/node_connection.rs", "ratchet": "instant-now", "reason": "freshness stamp and retry back-off of the node subscription: the monotonic time of network events, compared with elapsed(); the tests use real short timings"},
|
|
{"crate": "leleka-npu-service", "file": "src/engine/execution.rs", "ratchet": "instant-now", "reason": "profile laps around each product on the NPU execution loop (LELEKA_NPU_PROFILE report); a clock call per lap would be the only change on that path"},
|
|
{"crate": "leleka-backend-api", "file": "src/scripted/play.rs", "ratchet": "instant-now", "reason": "the scripted test engine paces a fake generation in real time; the L0 contract crate has no dependency to take a clock from"},
|
|
{"crate": "leleka-control-plane", "file": "src/ports/clock.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedClock is the Arc<dyn Clock> the composition root hands to AppState"},
|
|
{"crate": "leleka-control-plane", "file": "src/ports/engine.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedEngine is the Arc<dyn EngineClient> the composition root hands to AppState"},
|
|
{"crate": "leleka-control-plane", "file": "src/ports/response_store.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedResponseStore is the Arc<dyn ResponseStore> the composition root hands to AppState"},
|
|
{"crate": "leleka-control-plane", "file": "src/ports/tool_hub.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedToolHub is the Arc<dyn ToolHub> the composition root hands to AppState"},
|
|
{"crate": "leleka-control-plane", "file": "src/ports/vision.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedVisionEncoder is the Arc<dyn VisionEncoder> the composition root hands to AppState"},
|
|
{"crate": "leleka-control-plane", "file": "src/app/state.rs", "ratchet": "dyn-trait", "reason": "the tokenizer family (Qwen or gpt-oss) is chosen at start-up and held as Arc<dyn TextCodec>, once per request"},
|
|
{"crate": "leleka-control-plane", "file": "src/responses.rs", "ratchet": "dyn-trait", "reason": "SharedCodec, the alias of Arc<dyn TextCodec> that the response stages share"},
|
|
{"crate": "leleka-control-plane", "file": "src/model/manifest_fetch.rs", "ratchet": "dyn-trait", "reason": "walks an error's source() chain, whose items are dyn Error"},
|
|
{"crate": "leleka-control-plane", "file": "src/wire.rs", "ratchet": "dyn-trait", "reason": "the per-request token-bytes closure of a reasoning plan, built once per request from the tokenizer"},
|
|
{"crate": "leleka-engine-host", "file": "src/node.rs", "ratchet": "dyn-trait", "reason": "tonic server-streaming response type: the generated trait wants a boxed stream"},
|
|
{"crate": "leleka-engine-host", "file": "src/runtime_rpc.rs", "ratchet": "dyn-trait", "reason": "tonic server-streaming response type: the generated trait wants a boxed stream"},
|
|
{"crate": "leleka-backend-api", "file": "src/scripted.rs", "ratchet": "dyn-trait", "reason": "the scripted test engine stores the test's responder closure"},
|
|
{"crate": "leleka-gateway-domain", "file": "src/responses/schema.rs", "ratchet": "process-global", "reason": "kept: pure memo (not state): the validity of a tool schema keyed by its compact text, so the dozen schemas of a coding agent compile once, not three times per request; the result depends on the key alone, so no caller can observe the cache; a per-request owner would defeat it"},
|
|
{"crate": "leleka-gateway-text", "file": "src/prompt/renderer.rs", "ratchet": "process-global", "reason": "kept: the compiled pinned chat template is an immutable constant of the build, compiled on first use and read by every request; a pure memo of a constant"},
|
|
{"crate": "leleka-control-plane", "file": "src/stage_trace.rs", "ratchet": "process-global", "reason": "kept: diagnostic stage table of the replay harness and STRATA_STAGE_TRACE; time() and span() are called from deep helpers (render, tokenize) that carry no state argument, and the output is diagnostic only, never read by serving logic"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/settings/source.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the engine: ProcessEnv is the adapter of the EnvSource port, and Settings parses every variable into typed fields there (S13)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_engine/round_tally/serve_rounds.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: one reading per traced port call, only when the bring-up trace is on; the reading is a Duration that only feeds a log line or a counter, never a decision"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_lookahead.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: one reading per routing prediction on the lookahead thread; the reading is a Duration that only feeds a log line or a counter, never a decision"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_pool/direct_group_steps.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: one reading per CPU expert group of a decode round; the reading is a Duration that only feeds a log line or a counter, never a decision"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_pool/direct_tier.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: one reading per eager admission, once at start-up; the reading is a Duration that only feeds a log line or a counter, never a decision"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_pool.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: one reading per pool phase lap of a decode round; the reading is a Duration that only feeds a log line or a counter, never a decision"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_residency/pcie_share_controllers.rs", "ratchet": "instant-now", "reason": "control input, not a log line: PcieLag spins until the PCIe copies of a group have landed and PcieAuto times a round from one apply_pending to the next, and the control law reads those wall-clock durations to move the PCIe share; both controllers are opt-in experiments (LELEKA_PCIE_AUTO=lag|on, off in every shipped profile) and their unit tests drive the control law through round() without the clock"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/prefill_profile.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: one reading per prefill stage span, only when the profile switch is on; the reading is a Duration that only feeds a log line or a counter, never a decision"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/prompt_device_rows/prompt_device_read/produce_original_gdn.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: one reading per GDN layer producer lap, only when the command profile is on; the reading is a Duration that only feeds a log line or a counter, never a decision"},
|
|
{"crate": "leleka-engine-core", "file": "src/family.rs", "ratchet": "dyn-trait", "reason": "EngineFamily::spawn returns Box<dyn Backend>: the family seam is the process boundary of the engine, called once at start-up"},
|
|
{"crate": "leleka-engine-fake", "file": "src/lib.rs", "ratchet": "dyn-trait", "reason": "Box<dyn Backend> is the process boundary: the factory hands the composed engine to the host, which holds one Backend per process (startup composition only, never per round)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/backend/family.rs", "ratchet": "dyn-trait", "reason": "Box<dyn Backend> is the process boundary: the factory hands the composed engine to the host, which holds one Backend per process (startup composition only, never per round)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/backend/spawn.rs", "ratchet": "dyn-trait", "reason": "Box<dyn Backend> is the process boundary: the factory hands the composed engine to the host, which holds one Backend per process (startup composition only, never per round)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/backend/spawn_optimized.rs", "ratchet": "dyn-trait", "reason": "Box<dyn Backend> is the process boundary: the factory hands the composed engine to the host, which holds one Backend per process (startup composition only, never per round)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/backend/spawn_original.rs", "ratchet": "dyn-trait", "reason": "Box<dyn Backend> is the process boundary: the factory hands the composed engine to the host, which holds one Backend per process (startup composition only, never per round)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/backend/spawn_preview.rs", "ratchet": "dyn-trait", "reason": "Box<dyn Backend> is the process boundary: the factory hands the composed engine to the host, which holds one Backend per process (startup composition only, never per round)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/backend/measurement.rs", "ratchet": "dyn-trait", "reason": "the evaluation measurement sink is a stored callback handed in by the host (observer port, called once per request)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/backend/original_serve/runner.rs", "ratchet": "dyn-trait", "reason": "the GPU telemetry probe is a stored callback handed in by the host at load (port, sampled by the telemetry tick, not per token)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_stack.rs", "ratchet": "process-global", "reason": "kept: DBG_T0, the epoch of the bring-up trace timestamps (dbg_el()); diagnostics only, called from trace macros in many files that hold no common owner, never read by serving logic"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/compute_drain.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: stall span of one timed drain, reported by the prefill stall trace"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/mmq/resident/original_group/copy_ring/chunk_stream/chunk_issuing.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: span of one chunk issue, summed into the copy-ring profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/mmq/resident/original_group/copy_ring/original_mmq_copy_schedule/stream_start.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: start of the copy-ring stream, read once per stream for the profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/native_prompt_device/original_prompt_device/run_phases.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: span of one prompt phase, reported by the prefill profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_file_expert_source/original_file_expert_source_operations/file_expert_source_prefetch.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: span of one expert-file prefetch, summed into the stager profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_file_expert_source/original_file_expert_source_operations/file_expert_source_blobs.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: spans of the expert-file stages, summed into the stager profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_gpu_schedule/original_gpu_graph.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: span of one graph launch, reported by the graph profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_gpu_schedule/original_gpu_stream.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: span of one stream synchronisation, reported by the stream profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/diag.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wait loop of the live-verifier release diagnostic, bounded by its own timeout"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/schedule/verifier_commit_window_lifecycle.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: span of one commit window, reported by the verifier profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/schedule/verifier_logits_diagnostics_close.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: span of one logits readout, reported by the verifier profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/schedule/window_phases.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: spans of the window phases, reported by the verifier profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/share_window_modules/physical.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: span of the physical bank open, reported by the verifier profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qsa_prompt_index/prompt_device/resident_device/original_qsa_prompt_device.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: timestamp of the last prompt-device use, read by the idle-trim policy of the device"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qsa_prompt_index/resident_program/qsa_prompt_index_workspace.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: span of one resident index program run, reported by the prefill profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qsa_prompt_kv/mapped_journal/original_qsa_mapped_prefix/qsa_mapped_journal_arena.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: spans of the mapped-journal append and resolve, reported by the prefill profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qwen_dispatch/gdn_native_batch/prompt_device/original_gdn_prompt_device/original_gdn_prompt_device_drain.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: spans of the GDN prompt drain, reported by the prefill profile"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/rust_bench_frontend/cpu_blob.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: benchmark harness timers around the blob kernels, printed by the bench"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/rust_general_pool/epoch_scheduling.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: per-epoch timers of the CPU expert pool (hot loop), summed into the pool trace; one reading per phase"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/rust_general_pool/expert_pool.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: per-call phase timers of the CPU expert pool (hot loop), summed into the pool trace; one reading per phase"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/rust_general_pool/expert_pool_split_multi_run.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: per-run phase timers of the split multi-expert run (hot loop), summed into the pool trace"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/rust_general_pool/phase_handoff.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wait and quantize lap timers of the pool (hot loop), summed into the pool trace"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/rust_pool/epoch_scheduling.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: the pool's one monotonic reading, wrapped so every epoch timestamp comes from it (hot loop)"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/rust_pool/native_pool.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: per-thread start stamps of the native pool for its timing mode (hot loop)"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/rust_pool/trace.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: origin of the pool trace timeline, read once when tracing starts"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/mmq/resident/original_group.rs", "ratchet": "dyn-trait", "reason": "the group borrows its arena view (GroupArena) from the caller for one run; a test seam with a mock arena"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/mmq/resident/original_group/copy_ring.rs", "ratchet": "dyn-trait", "reason": "the copy ring borrows its arena view (RingArena) from the caller for one run; a test seam with a mock arena"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/mtp_dense_kv/original_int8/prefill/scalar/full_forward/full_round/put.rs", "ratchet": "dyn-trait", "reason": "the put step takes the copy and the fence of one round as callbacks, so the same code runs over the real streams and a recording test double"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/diag.rs", "ratchet": "dyn-trait", "reason": "the live-verifier release diagnostic writes an optional note to any writer (stderr, a file or a buffer in the tests)"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/gr.rs", "ratchet": "dyn-trait", "reason": "the window planner reads weight addresses through the ArenaMap seam (the device arena in production, an in-memory table in the tests); the planner structs keep it for one window plan, which is built at capture time, not per token"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/moe/plan_expert_groups.rs", "ratchet": "dyn-trait", "reason": "the window planner reads weight addresses through the ArenaMap seam (the device arena in production, an in-memory table in the tests); the planner structs keep it for one window plan, which is built at capture time, not per token"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/moe/plan_f32_to_bf16.rs", "ratchet": "dyn-trait", "reason": "the window planner reads weight addresses through the ArenaMap seam (the device arena in production, an in-memory table in the tests); the planner structs keep it for one window plan, which is built at capture time, not per token"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/planner.rs", "ratchet": "dyn-trait", "reason": "the window planner reads weight addresses through the ArenaMap seam (the device arena in production, an in-memory table in the tests); the planner structs keep it for one window plan, which is built at capture time, not per token"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/qsa.rs", "ratchet": "dyn-trait", "reason": "the window planner reads weight addresses through the ArenaMap seam (the device arena in production, an in-memory table in the tests); the planner structs keep it for one window plan, which is built at capture time, not per token"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/qsa/qsa_window/qsa_window_query_key_paths.rs", "ratchet": "dyn-trait", "reason": "the window planner reads weight addresses through the ArenaMap seam (the device arena in production, an in-memory table in the tests); the planner structs keep it for one window plan, which is built at capture time, not per token"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qwen_dispatch/gdn_native_batch.rs", "ratchet": "dyn-trait", "reason": "the batch owner holds its GEMM provider (cuBLAS-backed in production, a host stand-in in the tests) as a trait object for the life of one batch; it is a port, chosen when the owner is opened"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qwen_dispatch/gdn_native_batch/context.rs", "ratchet": "dyn-trait", "reason": "the batch owner holds its GEMM provider (cuBLAS-backed in production, a host stand-in in the tests) as a trait object for the life of one batch; it is a port, chosen when the owner is opened"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qwen_dispatch/moe_prefill_batch.rs", "ratchet": "dyn-trait", "reason": "the batch owner holds its GEMM provider (cuBLAS-backed in production, a host stand-in in the tests) as a trait object for the life of one batch; it is a port, chosen when the owner is opened"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qwen_dispatch/moe_prefill_batch/moe_prefill_batch_lifecycle.rs", "ratchet": "dyn-trait", "reason": "the batch owner holds its GEMM provider (cuBLAS-backed in production, a host stand-in in the tests) as a trait object for the life of one batch; it is a port, chosen when the owner is opened"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/mmq/asset.rs", "ratchet": "process-global", "reason": "kept: pure memo of the verdict of the immutable embedded MMQ artifact check (a function of the embedded bytes alone), so no caller can observe the cache; a Context-owned copy would re-prove the same bytes per Context"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/prefill_stage.rs", "ratchet": "process-global", "reason": "kept: pure memo of a proof about an embedded sealed image (usability of the kh recurrence), a result per device that no caller can observe as state; and two per-arm A/B overrides (GDN_OVERRIDE, NOSTORE_OVERRIDE) of the prefill GDN switches, written by the test harness for paired passes in one process"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qsa_index_ffi.rs", "ratchet": "process-global", "reason": "kept: pure memo of the RoPE ABI proof of the embedded index module, a function of the embedded bytes alone"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qsa_prompt_resolver.rs", "ratchet": "process-global", "reason": "kept: pure memo of the resolver ABI proof of the embedded module, a function of the embedded bytes alone"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qwen_ffi/n_types.rs", "ratchet": "process-global", "reason": "kept: the table of the PTX proof memos of asset_admission.rs, one cell per operation; pure functions of embedded bytes"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/rust_bench_frontend.rs", "ratchet": "process-global", "reason": "kept: FFI. `static mut stdout` is libc's C stream, declared in an extern block; it is the C library's own global, not ours"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/settings.rs", "ratchet": "process-global", "reason": "kept: the cell of each `static Setting` (operator switches and the CPU probes the kernels dispatch on), computed on first read from the immutable environment and the CPU; the kernels are free functions called from pool worker threads that carry no context to pass a value through, and a hot path pays one atomic load"},
|
|
{"crate": "leleka-control-plane", "file": "src/request_log.rs", "ratchet": "process-global", "reason": "kept: `tokio::task_local! CURRENT`, the request context (ReqCtx) of the running request, read without a request argument by code that holds no handle; it is scoped to one task, not to the process"},
|
|
{"crate": "leleka-control-plane", "file": "src/responses.rs", "ratchet": "process-global", "reason": "kept: NEXT_RESPONSE_ID, the counter in the `resp_<time>_<n>` id of a response: unique across every request of the process by definition, so it has no narrower owner than the process"},
|
|
{"crate": "leleka-control-plane", "file": "src/responses/tool_recovery.rs", "ratchet": "process-global", "reason": "debt: the EXPERIMENTAL tool_call_recovery flag, set once by `main` from the config file or STRATA_TOOL_CALL_RECOVERY and read by the response decoder. It belongs on the Services/config value the handlers already receive; it stays a cell until the decoder takes it by argument"},
|
|
{"crate": "leleka-control-plane", "file": "src/vision.rs", "ratchet": "process-global", "reason": "kept: NEXT_DIR numbers the scratch directories of vision requests so two requests of one process never share a directory; uniqueness across the process is its job"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/arch_ptx.rs", "ratchet": "process-global", "reason": "debt: STREAM_K_AVOIDED, the fact that the sm_86 companion image was chosen so the stream-K kernels stay off, set in stream_k_off when the module loads and read by the same decision; a fact about the loaded device image that belongs on the Context"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/compute_drain.rs", "ratchet": "process-global", "reason": "kept: the registry of every stream the crate creates (STREAMS) and the id of the registered background copy stream (BACKGROUND), which `Api::synchronize` consults in all of the crate's producers (blas, Original schedule, owned copy, swap) that have no common owner; plus the diagnostic counters and per-site table of the drains (SEEN, SHOWN, SITES, BLOCK_*, thread-local LOCAL_DRAINS) and two A/B overrides (ZERO_MEMSET, DEPTH_OVERRIDE). Moving the registry into the Context needs the Api handle in every producer"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/deferred_status.rs", "ratchet": "process-global", "reason": "kept: per-thread queue of the deferred status read-backs, bound to the context that created it (the contexts are single-thread owners); one state per thread by design, like the thread that owns the Context"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/mmq/resident/original_group/copy_ring/chunk_stream.rs", "ratchet": "process-global", "reason": "kept: the thread's active inline-mode chunk stream, which `prefetch_point` finds without a handle (its doc comment: the producers have no handle to the stream)"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_gpu_schedule.rs", "ratchet": "process-global", "reason": "debt: SIDE_STREAMS_WANTED is stored by `set_side_streams_wanted` and read by the capture phases; the thread-local SUMS of `capture_timing` is the serve profile's per-thread diagnostic. The flag belongs on the schedule value; it stays a cell until the capture call takes it"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_gpu_schedule/abi/platform/api.rs", "ratchet": "process-global", "reason": "kept: WARMED, once per process: the first graph callback thread is started pinned (Linux); a failure is ignored and the first real callback creates the thread"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_gpu_schedule/transport.rs", "ratchet": "process-global", "reason": "kept: SEEN counts the verifier-window graph instantiations of the process for the test hook LELEKA_TEST_WINDOW_INSTANTIATE_OOM_AT=N (the N-th instantiation of the process fails once); a process-wide count is what the hook means"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/chain.rs", "ratchet": "process-global", "reason": "debt: per-arm override of one switch so a paired A/B pass can flip it inside one process (-1 none, 0 off, 1 on); written by the test and replay harness, read when a window graph is recorded. It belongs in the configuration value of the arm, handed to the recording call; it stays a cell until the arm configuration is threaded through"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/combine_head.rs", "ratchet": "process-global", "reason": "kept: once-per-process notice on the operator log (`std::sync::Once`) that a non-default kernel set is in use; output only, never read by serving logic, and the call sits in a function that has no owner object to hold the flag"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/diag.rs", "ratchet": "process-global", "reason": "kept: REGISTRY of the live verifier diagnostics, read by `original_verify_diagnostics` and the release hooks from the operator and shutdown paths that hold no verifier handle; diagnostics only"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/gdn_fused.rs", "ratchet": "process-global", "reason": "kept: once-per-process notice on the operator log (`std::sync::Once`) that a non-default kernel set is in use; output only, never read by serving logic, and the call sits in a function that has no owner object to hold the flag"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/gr/fused_down.rs", "ratchet": "process-global", "reason": "kept: once-per-process notice on the operator log (`std::sync::Once`) that a non-default kernel set is in use; output only, never read by serving logic, and the call sits in a function that has no owner object to hold the flag"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/gr/head_chain.rs", "ratchet": "process-global", "reason": "kept: once-per-process notice on the operator log (`std::sync::Once`) that a non-default kernel set is in use; output only, never read by serving logic, and the call sits in a function that has no owner object to hold the flag"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/qsa/fused_prelude.rs", "ratchet": "process-global", "reason": "kept: once-per-process notice on the operator log (`std::sync::Once`) that a non-default kernel set is in use; output only, never read by serving logic, and the call sits in a function that has no owner object to hold the flag"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/sm120.rs", "ratchet": "process-global", "reason": "debt: per-arm override of one switch so a paired A/B pass can flip it inside one process (-1 none, 0 off, 1 on); written by the test and replay harness, read when a window graph is recorded. It belongs in the configuration value of the arm, handed to the recording call; it stays a cell until the arm configuration is threaded through"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/window_ops/original_verifier.rs", "ratchet": "process-global", "reason": "kept: once-per-process notice on the operator log (`std::sync::Once`) that a non-default kernel set is in use; output only, never read by serving logic, and the call sits in a function that has no owner object to hold the flag"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qsa_cluster.rs", "ratchet": "process-global", "reason": "debt: per-arm override of one switch so a paired A/B pass can flip it inside one process (-1 none, 0 off, 1 on); written by the test and replay harness, read when a window graph is recorded. It belongs in the configuration value of the arm, handed to the recording call; it stays a cell until the arm configuration is threaded through"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qsa_late.rs", "ratchet": "process-global", "reason": "debt: per-arm overrides (OVERRIDE, TOPK_OVERRIDE) for paired A/B passes in one process, plus a once-per-process notice (SAID). The overrides belong in the arm configuration handed to the recording call; they stay cells until it is threaded through"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qsa_prompt_kv/resident_transport.rs", "ratchet": "process-global", "reason": "debt: per-arm override of one switch so a paired A/B pass can flip it inside one process (-1 none, 0 off, 1 on); written by the test and replay harness, read when a window graph is recorded. It belongs in the configuration value of the arm, handed to the recording call; it stays a cell until the arm configuration is threaded through"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/settings.rs", "ratchet": "process-global", "reason": "kept: operator environment switches of the CUDA driver, one `static EnvSwitch/EnvSetting/LazySetting/MarkerFiles` per variable, computed on first read from the process environment, which cannot change after start, so a cached read equals a fresh one; they are read from free functions deep in the launch and prefill paths that carry no settings argument, and the driver sits below the engine Settings owner (dependency direction). A driver settings struct on the Context would remove them (follow-up of STRA-338)"},
|
|
{"crate": "leleka-cuda-model", "file": "src/bringup_trace.rs", "ratchet": "process-global", "reason": "kept: the LELEKA_BRINGUP_TRACE switch, an `EnvSwitch` declared where it is read (same reason as env_switch.rs: immutable environment, and the crate is below the engine Settings owner)"},
|
|
{"crate": "leleka-cuda-model", "file": "src/command_profile.rs", "ratchet": "process-global", "reason": "kept: the LELEKA_PREFILL_PROFILE_SYNC switch (an `EnvSwitch`, reason of env_switch.rs) and TOTALS, the table of per-command timings that the profile report prints; diagnostics only, recorded from command wrappers that hold no profile handle"},
|
|
{"crate": "leleka-cuda-model", "file": "src/host_profile.rs", "ratchet": "process-global", "reason": "kept: the LELEKA_SERVE_PROFILE switch (an `EnvSwitch`, reason of env_switch.rs) and the thread-local SUMS of the host profile; diagnostics only"},
|
|
{"crate": "leleka-deploy", "file": "src/supervisor.rs", "ratchet": "process-global", "reason": "debt: HIDDEN is set once by `--hidden` (the Windows logon task) in the entry point and read when the supervisor spawns its children (no console window). It belongs in the supervisor's options; it stays a cell until the options reach the spawn call"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/backend/config.rs", "ratchet": "process-global", "reason": "kept: RECONFIGURING (a reconfigure is reopening the serve stack, new generations are refused and retryable meanwhile) and INSTANCE (the number of the backend instance, taken by each spawn). Both describe the one engine of the process and are touched from the control thread and the request threads; open item: move them next to the backend handle when the engine builds on Windows (STRA-390) and can be compiled"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/backend/original_serve.rs", "ratchet": "process-global", "reason": "kept: PREFIX_SUMMARY, the prefix cache's pool summary that the owner thread publishes after each request and any status thread reads; its doc comment: one backend per process, so one cell"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/backend/original_serve/runner.rs", "ratchet": "process-global", "reason": "debt: PREVIOUS_TIER, the expert tier counters after the previous request, to turn stack-lifetime figures into a request's share; it belongs to the runner that reports each request, and stays a cell until the runner owns it (needs the engine to compile, STRA-390)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/backend/original_serve/runner/stack_reports.rs", "ratchet": "process-global", "reason": "kept: NEXT numbers the per-request id dump files of the process so that two dumps never share a name"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/load_clock.rs", "ratchet": "process-global", "reason": "kept: CLOCK, the start and last-lap time of the one model load of the process, written by `lap` and `span` from the loading thread and the parallel verification threads; the output is the `leleka-load-time` log line only"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/memory_governor.rs", "ratchet": "process-global", "reason": "debt: MAPPED_WORKING_SET is the RAM kept for the hot part of a file-mapped expert bank, set by `startup` and read when the prefix budget is resolved at open; a value that should travel in the memory settings handed to open. It stays a cell until the engine compiles on Windows (STRA-390) and the plumbing can be verified"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/model_binding/kar_ple_source/private_copy.rs", "ratchet": "process-global", "reason": "kept: SEQUENCE numbers the temporary private copies of a source file, so two copies of one process never collide on a name (macOS and test builds only)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/model_binding/weight_binding/mtp/backing.rs", "ratchet": "process-global", "reason": "kept: SERIAL numbers the temporary backing files of the process (`tiny-<pid>-<serial>`), so two never collide"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/gdn.rs", "ratchet": "process-global", "reason": "debt: per-arm override of one switch so a paired A/B pass can flip it inside one process (-1 none, 0 off, 1 on); written by the test and replay harness, read when a window graph is recorded. It belongs in the configuration value of the arm, handed to the recording call; it stays a cell until the arm configuration is threaded through"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/moe_weight_cache/cache_original_prompt.rs", "ratchet": "process-global", "reason": "debt: per-arm override of one switch so a paired A/B pass can flip it inside one process (-1 none, 0 off, 1 on); written by the test and replay harness, read when a window graph is recorded. It belongs in the configuration value of the arm, handed to the recording call; it stays a cell until the arm configuration is threaded through"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_cache_startup.rs", "ratchet": "process-global", "reason": "debt: per-arm override of one switch so a paired A/B pass can flip it inside one process (-1 none, 0 off, 1 on); written by the test and replay harness, read when a window graph is recorded. It belongs in the configuration value of the arm, handed to the recording call; it stays a cell until the arm configuration is threaded through"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_host/ple_on_chain.rs", "ratchet": "process-global", "reason": "kept: once-per-process notice on the operator log (`std::sync::Once`) that a non-default kernel set is in use; output only, never read by serving logic, and the call sits in a function that has no owner object to hold the flag"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_native/native_window.rs", "ratchet": "process-global", "reason": "kept: WINDOW_SEQ numbers the residual trace files of a window (diagnostic trace output, LELEKA trace directory only)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_pool.rs", "ratchet": "process-global", "reason": "kept: thread-local diagnostic accumulator of the serve profile (written from deep helpers that hold no profile handle, drained by the profile report on the same thread); never read by serving logic"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_profile.rs", "ratchet": "process-global", "reason": "kept: thread-local diagnostic accumulator of the serve profile (written from deep helpers that hold no profile handle, drained by the profile report on the same thread); never read by serving logic"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_residency.rs", "ratchet": "process-global", "reason": "debt: TAIL_SKIP_RANK, the route-tail skip rank resolved once from the settings and the cache on first use and read by the router each round. It belongs to the residency state of the serve stack; it stays a cell until that owner exists and the engine compiles on Windows (STRA-390)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_residency/source_spans.rs", "ratchet": "process-global", "reason": "kept: once-per-process notice on the operator log (`std::sync::Once`) that a non-default kernel set is in use; output only, never read by serving logic, and the call sits in a function that has no owner object to hold the flag"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_residency/tail_skip_rank.rs", "ratchet": "process-global", "reason": "kept: ANNOUNCED, the effective tail-skip rank last printed, so the operator log prints a change once; output only"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_stack/prompt_chunk.rs", "ratchet": "process-global", "reason": "kept: LOWEST_FREE, the low-water mark of the card's free VRAM over every note of the process (diagnostic print when the serve profile is on; the number the reserve must cover)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/prefill_profile.rs", "ratchet": "process-global", "reason": "kept: thread-local diagnostic accumulator of the serve profile (written from deep helpers that hold no profile handle, drained by the profile report on the same thread); never read by serving logic"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/quality_force.rs", "ratchet": "process-global", "reason": "kept: FORCED, the teacher-forcing sequence of the model quality gate; production code never installs one (the only caller is the Original serve smoke) and with nothing installed `apply` is one uncontended lock and an empty check"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/settings.rs", "ratchet": "process-global", "reason": "debt (the largest remaining process cell): `settings::process()` holds the engine Settings in a OnceLock captured from the real environment on first ask, and is read at about 78 sites. It must become a value built once by the composition root and passed through the Context/ModelBinding/config structs, as the serving context was in phase 2c. Not done in phase 2e: leleka-engine-qwen35-cuda does not compile on Windows at the base (std::os::unix in model_binding/weight_binding/mtp, STRA-390), and no uncompiled code is committed"},
|
|
{"crate": "leleka-gptoss-npu", "file": "src/par.rs", "ratchet": "process-global", "reason": "debt: LIMIT, the thread budget of the parallel helpers, set once by the NPU prefill setup (`set_threads`) and read by every helper; it belongs to the setup value the helpers are called with"},
|
|
{"crate": "leleka-libc-shim", "file": "src/cuda_trace.rs", "ratchet": "process-global", "reason": "kept: FFI interposer boundary (same reason as trace_state.rs): the real entry points, launch counters and stream sync marks live in statics because the CUDA call wrappers are C-ABI functions the loader calls with no context pointer and no way to carry an argument"},
|
|
{"crate": "leleka-libc-shim", "file": "src/lib.rs", "ratchet": "process-global", "reason": "kept: the loader hook that registers the extra DLL directories is `Once`-guarded, once per process, because it changes the process-wide DLL search path"},
|
|
{"crate": "leleka-memory", "file": "src/telemetry.rs", "ratchet": "process-global", "reason": "kept: the telemetry state (STATE, PUBLISHED, SETTINGS): the serve loop calls the `record_*` functions from many places that hold no common handle, one sampler thread publishes once a second; process-wide by contract like the obs logger. Diagnostics only (rides the runtime snapshot), never read by serving logic"},
|
|
{"crate": "leleka-model-format", "file": "src/gguf/resident.rs", "ratchet": "process-global", "reason": "kept: NEXT_SOURCE_ID mints the private source-owner identity after an admitted file fill; unique across the process by definition, checked exhaustion refuses rather than wraps"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/rust_legacy.rs", "ratchet": "process-global", "reason": "kept: ORACLE, the q8-zero oracle switch of the legacy kernel (`set_oracle_q8_zero`), a test hook read by the kernel free functions that pool worker threads call with no context argument"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/rust_weight_iq.rs", "ratchet": "process-global", "reason": "kept: pure memo of the IQ quantizer grids (one slot per grid kind, built on first use from constant tables, dropped by the release call), shared by the pool worker threads that call the quantizers as free functions; no caller can observe the cache"},
|
|
{"crate": "leleka-obs", "file": "src/redact.rs", "ratchet": "process-global", "reason": "kept: the secret values registered for scrubbing: the logger facade is process-wide by contract (same reason as lib.rs) and `scrub` runs on every log line of every thread"},
|
|
{"crate": "leleka-control-plane", "file": "src/config.rs", "ratchet": "allow-unused-imports", "reason": "debt: two glob re-exports of the config split that the compiler reports unused in the lib build; they stay because the lib test build of control-plane cannot be compiled on Windows (std::os::unix), so a use from a test module cannot be ruled out. Delete or narrow them on a Linux compile"},
|
|
{"crate": "leleka-control-plane", "file": "src/mcp.rs", "ratchet": "allow-unused-imports", "reason": "debt: three glob re-exports of the mcp split that the compiler reports unused in the lib build; kept because the lib test build of control-plane cannot be compiled on Windows (std::os::unix) and a test use cannot be ruled out. Delete or narrow them on a Linux compile"},
|
|
{"crate": "leleka-control-plane", "file": "src/request_log.rs", "ratchet": "allow-unused-imports", "reason": "debt: one glob re-export (metrics_text) that the compiler reports unused in the lib build; kept because the lib test build of control-plane cannot be compiled on Windows and a test use cannot be ruled out"},
|
|
{"crate": "leleka-control-plane", "file": "src/request_monitor.rs", "ratchet": "allow-unused-imports", "reason": "debt: one glob re-export (record) that the compiler reports unused in the lib build; kept because the lib test build of control-plane cannot be compiled on Windows and a test use cannot be ruled out"},
|
|
{"crate": "leleka-engine-host", "file": "src/runtime_gateway.rs", "ratchet": "allow-unused-imports", "reason": "debt: four glob re-exports of the gateway split; not checked, because leleka-engine-host needs the engine, which does not compile on Windows (STRA-390). Narrow or delete them with the compiler once it does"},
|
|
{"crate": "leleka-engine-host", "file": "src/runtime_rpc.rs", "ratchet": "allow-unused-imports", "reason": "debt: four glob re-exports of the rpc split; not checked, because leleka-engine-host needs the engine, which does not compile on Windows (STRA-390). Narrow or delete them with the compiler once it does"}
|
|
],
|
|
"source_patterns": [
|
|
{"id": "env-read", "regex": "\\benv::var(_os)?\\(", "why": "configuration must be parsed once into a Settings struct (S13), not read all over the code"},
|
|
{"id": "instant-now", "regex": "\\bInstant::now\\(\\)", "why": "time must come from an injected Clock in core logic (S14)"},
|
|
{"id": "path-include", "regex": "#\\[path\\s*=\\s*\"(?![^\"]*tests\\.rs\")(?![A-Za-z0-9_]+/[A-Za-z0-9_]+\\.rs\")", "why": "a file compiled into two crates must be one crate (S8); a tests.rs or a child module file of the form dir/name.rs is not an include"},
|
|
{"id": "process-global", "ignore_imports": true, "regex": "\\bstatic\\s+mut\\b|\\bstatic\\s+[A-Z_][A-Z0-9_]*\\s*:[^=;]*{cell_types}|\\blazy_static!|Governor::global\\(|serving_cells\\(\\)", "why": "process globals make core logic untestable without a GPU (S14). Counted: a `static` (also inside thread_local!) whose type is a cell (Atomic*, Mutex, RwLock, Once, OnceLock, LazyLock, Cell, RefCell, ...) or a workspace type that holds one, and `static mut`; an instance field of those types is not a global"},
|
|
{"id": "dyn-trait", "regex": "\\bdyn\\s+[A-Z]", "why": "no dynamic dispatch per round or token; dyn is for startup composition only"},
|
|
{"id": "glob-super-import", "regex": "^use super::\\*;", "why": "a glob import of the parent hides what a module needs; name the items (use super::{A, B}); scripts/dev/explicit_imports.py does it for the files rustsplit leaves"},
|
|
{"id": "allow-unused-imports", "regex": "#\\[allow\\(unused_imports\\)\\]", "why": "a blanket allow hides imports that are really unused; it belongs on re-exports and on names that only some cargo features use"}
|
|
]
|
|
}
|