The console is hidden by winsys::hide_console right where the flag was stored; nothing in the workspace loads supervisor::HIDDEN, so the cell and its exception entry go. cargo check -p leleka-deploy --all-targets passes.
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).
Where the split left pub use x::* over items that no outside module can name, the compiler said the glob re-exports nothing pub. The glob now has the visibility its items really have: plain use where they are pub(self), pub(crate) where siblings reach them (model.rs file_download, libc-shim launch_interposers). One glob of backend-api scripted.rs was dead and is deleted. 7 globs of control-plane stay with their allow: the compiler calls them unused in the lib build and the lib test build of control-plane cannot be built on Windows, so a test use cannot be ruled out.
cargo check --all-targets on backend-api, control-plane, gateway-domain, gateway-text and libc-shim: no new warning, no new error (the one control-plane lib test error is the pre-existing std::os::unix use).
admitted_slots coerced the read lease to &dyn RingArena only to call stage_slots on it. RingArena::stage_slots(read) is the same method of the same impl without the vtable; the Ring keeps its own dyn field, which has its exception entry.
The probe module is compiled under cfg(any(test, feature = "expert-tier-probe")), so it is production code of that feature and the glob import counts for the gate. The 16 names it uses are listed; cargo check --all-targets with features cuda-driver,expert-tier-probe and with cuda-driver alone gives no new warning.
The re-exports left by the mechanical module splits carried a blanket allow(unused_imports). 49 of them cover nothing: cargo check --all-targets on backend-api, control-plane, gateway-domain, gateway-text and libc-shim gives no new unused-import or glob-import warning without them. 39 others in those crates still silence a real warning and stay; the 8 in desktop-core (engine-host) could not be checked because that crate needs the engine, which does not build on Windows (STRA-390), and stay too.
Eight exceptions of the instant-now ratchet in leleka-engine-qwen35-cuda ended in a deferral ("which is the S14 follow-up"), and one of them was wrong: pcie_share_controllers.rs does not feed a log line, because PcieLag and PcieAuto read the wall-clock duration of the PCIe leg and of a round as the input of their control law. Seven reasons now say that the reading is a measurement that only feeds a log line or a counter, and the controller entry says that its timing is the control input, that both controllers are opt-in (LELEKA_PCIE_AUTO=lag|on, set by no shipped profile) and that their unit tests drive the control law through round() without the clock.
The per-call-site ledger of LELEKA_VRAM_LEDGER is now part of what a Context retains: Context::allocate and the DeviceBuffer free note into the ledger of their own context, and the engine reports through Context::report_vram_ledger, so the OnceLock singleton of vram_ledger.rs and its architecture.json exception are gone. The operator switch stays an EnvSwitch and the default is unchanged (off: one cached bool read per allocation); with the switch on, each context now accounts for its own allocations instead of every context of the process sharing one table.
ExpertTierConfig now carries AdaptTuning (minimum routed count, margin, decay) parsed once with the tier switches; the residency pool, the cross-layer estimate and the seed ranking take it as a value, so the OnceLock of split_group_pcie.rs and its architecture.json exception are gone. The production default is unchanged (the values still come from LELEKA_ADAPT_MIN_COUNT, _MARGIN and _DECAY with the same fallbacks), and the line for an invalid LELEKA_ADAPT_DECAY is now printed when the tier configuration is read instead of at the first adaptation.
Provenance of two comments that left ExpertTierConfig::off() so that the function stays within the 30-line limit. decode_reserve_mib 300: measured (jobs 989/990/988), the per-request verifier needs about 450 MiB, so 1024 left about 550 MiB idle (180k smoke included); 300 gives the auto-sized cache about 330 more slots. On the 5090, 5 x 245k session (speedtrain-ab), with 300 the card never had less than 563 MiB free (vanilla runs down to 315), so 130 would be safe on the card (+87 slots), but the first slots-footprint A/B showed the Context budget is a second ceiling the planner respects (usable_room); 130 stays an opt-in (LELEKA_ORIGINAL_SERVE_DECODE_RESERVE_MIB=130) until its own arm measures it. pcie_frac 0.45: the PCIe share that equalises the legs when the CPU pool and the DMA share the host's memory ceiling (P/(P+C) = 0.45, job 987-b/909; 0.45 against 0.55 gave +0.5 % / +4.7 % at the auto-sized cache and was equal at 2048 slots).
The request middleware, the backend worker and the metrics handler now share one RequestMetrics value that Services holds, so the LazyLock registry of request_log.rs and its architecture.json exception are gone. The middleware gets it through Observe, the worker through BackendWorkerConfig, and prometheus::render takes it as an argument; the counters, histograms, labels and log lines are unchanged, and the unit tests now count into a registry of their own instead of one shared by the whole test process.
The 32 remaining process-global exceptions are classified: instance-local OnceCell/OnceLock fields
that the gate pattern only matches by type name, pure memos of constants or embedded sealed
images, ambient immutable environment read below the Settings owner, FFI and logger-facade
boundaries, diagnostics, and three entries marked "kept for now, NOT a boundary" (request_log
counters, split_group_pcie tuning, vram_ledger) that can still take the value by argument.
PromptDate was set once by serve into a process OnceLock and read by harmony_prompt::render.
It is now ModelView::prompt_date, built from the config in build_state, and prepare_input_tokens
hands it to render_prompt/render. The default of a bare AppState is still Utc, as the unset cell was.
One process-global exception deleted.
install_layout/expert_layout (a process RwLock cell) and install_release_gpu_waits (a process
OnceLock hook read on a pool stall) have no caller anywhere in the workspace, so the cells were
never written and the hook never ran. They are deleted instead of injected; the origin of the
pool's diagnostic millisecond clock is now a field of the pool's shared state (Shared::origin)
instead of a process OnceLock. Three process-global exceptions deleted.
ServingContext::new(cells, rope) replaces configure_serving_context and the process cell of
cuda-model; serving_context() is gone. The backend spawn makes the value once (serving::
admit_context_tokens) and hands it down: OwnerThread -> LoadEnv -> ServedArtifact (the
model binding captures it, ModelBinding::serving()) and Device::create_context_serving
(every Context of the Load). Device::create_context stays the trained default for tools and
tests. contract::serving_cells, the QSA index context()/device_peak() reads, the
native-resources size read, the memory governor, the stack config and the RoPE constants
read the binding or the Context instead; the stack open refuses a binding and a Context
made for different serving contexts. The two laptop tools build their own value.
Five process-global exceptions deleted (cuda-model serving_context, engine contract,
binding_identity, qsa_index/context, qsa_native_resources).
bf16_f32_mmvf, iq3_s_q8_1, moe_group_iq3_s, moe_group_iq3_s_nc4 (sm_120 in src/, sm_86 in ptx-sm86/) change in // header comments only (proof: identical after comment
stripping, no .file/.loc directive or string carries the path). The sm_86 companions are re-derived with sm86_assets.retarget + ptxas -arch=sm_86 (== the edited files);
MANIFEST.json (sm120/sm86 sha256 and byte counts of the four, the -I flags of the one recompiled companion) and the five-part sm86_table rows (new keys, re-sorted, same 27/27/27/27/23
layout) follow; FORMER_TABLE_DIGEST is recomputed with the algorithm of its test (reproduces the old value on main). Rust pins that cover the changed bytes:
bf16_receipt_types.rs BF16_RECEIPT (.cu source_sha256 and bf16_f32_mmvf.ptx ptx_sha256; a Receipt, not a PtxPin, so patched token by token), the frozen-artifact hash of
iq3_s_q8_1.ptx in context_handle.rs and in scripts/test-cuda-projection-family-driver.sh. Instruction streams, entry names and pinned symbol names are untouched.
21 .cu/.cuh files change in comments only (proof: identical after comment stripping; where the file compiles without the removed headers, nvcc 13.2.86 gives the same PTX
modulo the content-hashed symbol names, which nvcc derives from the source text and which the committed PTX keeps as sealed). Every pin that covered such a file moves:
cu_pin sha256+bytes in the seal plans of mmq_original_prefill_misc, s_gemv_legacy, experimental_keyless, experimental_cvec (no repo tool writes cu_pin; computed with sha256),
experimental.rs PINS[3] and PINS[5] and closed_kernels.rs PINS[1] .source_sha256 (rustpins.apply_field, then rustfmt as seal_pins.py does). The four experimental sources
that were already pending a reseal stay pending. Seal-plan prose and -I flags follow the same wording as the gpu-bringup data.
Rust comments that named scripts/offline/*, gen_goldens.py, oracle/gen_*.{sh,cpp,py}, build_oracle.sh and similar retired generators now say where the data
came from (the Original's code, Strata 41cf05a0) or drop the sentence. The path/generator text of seven generated fixtures (sampler_oracle.json, sampling_keys.json,
memory_plan_golden.json, rope_golden.json, cvec_oracle.json, stra161 fixtures.json, commentary-tool-prompt.json) is reworded; no test reads those fields and no pin
covers their bytes. cmd_time/doc.rs: the two path texts in the format string; its lines are re-broken so they stay within 120 columns (the string is unchanged
otherwise). Comment-only except those data/string spots; no behaviour change.
The recipe data (sm86-recipes.json, extra-seal-plan.json, rope-regeneration.json), STANDARD_INCLUDES, the sm86 include list and the one test that asserts them
now spell the include directories as strata-41cf05a0/{include,src,third_party/ggml}; prose that named engine/strata/CMakeLists.txt or the retired
build-original-verify-ptx.sh now says Strata 41cf05a0 or the precise flags. UPSTREAM.md records where to place a restored checkout.
No pin covers these files; behaviour of the tools is unchanged (the directories did not exist before either).
Owner decision 2026-11-23: the vendored tree is junk. Leleka never builds or runs it (no Cargo.toml or build.rs depends on it), the vanilla benchmark
builds from its own checkout on the server, the comparison measurements are finished and the CUDA ports are frozen. Strata is MIT: its licence text
stays and ships (third_party/strata/LICENSE, `leleka engine license`).
- git rm -r engine: engine/strata (upstream 41cf05a0 plus 25 locally patched files), engine/README.md, engine/upstream.md (its pin record moved to
third_party/strata/UPSTREAM.md) and engine/upstream/ (the two local-patch diffs against the removed tree). They belong to the same vendored mechanism.
- The files Rust and the product still read were moved to third_party/strata and control-plane/tests/mcp_hub in the first commit of this branch.
- The full tree is in git history before this commit; 87e2633af is the last commit that changed it. Restore with `git archive <this commit>^ engine/strata`.
- Four doc-comment lines that the path rewrite made too wide are re-wrapped (check-limits stays at 0 errors).
The vendored Strata tree engine/strata is removed for good (owner decision 2026-11-23): Leleka never builds or runs it, the vanilla
benchmark builds from its own checkout, the comparison measurements are finished and the CUDA ports are frozen. Everything below
compiled or read that tree, so it cannot run without it and is retired (the tree stays in git history, see third_party/strata/UPSTREAM.md).
Checked-in fixtures, golden JSON, sealed PTX, seal plans and MANIFEST hashes are untouched and keep being replayed by the cargo tests.
Drift guard
- crates/experimental-ref/tests/literal_port.rs: include_str! of the Original .cu files compared with the checked-in experimental ports.
Oracle generators and builders (they compile or extract from the Strata C++/Python sources; their outputs are the checked-in goldens)
- crates/experimental-ref/oracle/gen_{cvec,kv,remote,stream}_golden.{cpp,sh}, gen_seal_additions.py and the cuda_runtime stub they used
- crates/sampler-ref/oracle/build_oracle.sh, gen_fixtures.cpp, gen_sampling_keys.py, stub/ (run_port_host_tests.sh and the fixtures stay)
- crates/serving-policy/oracle/ (build_oracle.sh, gen_{host,cvec,vision}_fixtures.cpp)
- crates/context/tests/rope_plan_golden/gen_* (plan, rope, kv pool)
- crates/engine-core/src/conversation/golden/gen*.{sh,cpp} and stub/
- crates/cuda-driver/oracle/gen_prefill_ring_trace.py and drivers/prefill_ring_trace.cpp (extracted prefill.cpp), check_cu_syntax.sh
- crates/engine-qwen35-cuda/tests/stra161_reference/reference.py (fixtures.json and the Rust constants stay)
- control-plane/tests/golden/gen_goldens.py, scripts/offline/ (Python differentials and golden generators against the Strata Python tools)
Source-compiling CUDA oracles and builders
- scripts/build-cuda-{projection-family,q5,q6,qsa}-oracle.sh with scripts/cuda-{projection-family,q5,q6,qsa}-oracle/ (include the Original .cu; sha256 pins of them)
- scripts/build-original-verify-ptx.sh, scripts/q8/rebuild_quantizer_ptx.sh, scripts/decode-sm120/make_iq_prefix.py (needs engine/strata/include)
- scripts/cuda-stubs/ (check-cu.py and literal_diff.py need the strata headers and the Original sources; the stub headers served only them)
- tools/chain-probe/build.sh, tools/kernel-ab/{cpp,aa.sh,smoke.sh,time_smoke.sh} (the C++ comparator is built from the Strata CPU kernels; verify_manifest.py stays)
- scripts/e2e/codex/speed/verify-hc-down-kernel-microbench-vs-upstream/ (compiles the upstream kernel from the tree)
Engine builds and Python smokes that need the tree
- scripts/build-cpu.sh, scripts/build-static-cuda.sh, scripts/check-keyless-gpu.sh, scripts/test-static-cuda-profile.py (CMake of engine/strata)
- scripts/compare-real-tokenizer.py, scripts/smoke-mtp-pack.py (reads src/core/mtp.cpp and a bench manifest), scripts/prepare-keyless-routing.py and its test
- scripts/smoke-native-pack.py became scripts/native-pack-fixture.py: the synthetic GGUF fixtures the four other smokes import stay, the iq_pack.py oracle comparison goes
Gates and CI
- scripts/check-local.sh: no live Python oracle differentials, no literal_port note, no check-cu, no build-cpu, no retired test scripts
- .github/workflows/linux.yml: the keyless-cuda, static-cuda-package and hosted-cuda-package jobs (they built the engine from the tree) and their dispatch
inputs, and the two oracle smoke steps; .github/workflows/port.yml: the Python oracle environment and the llama.cpp fetch of port-oracles
(the sampler host shim still runs)
- limits.json and scripts/check_limits_test.py exclude third_party/strata/ instead of engine/strata/
Documentation and comments: README.md names third_party/strata and the pin; deploy/README.md marks the retired build and smoke commands; comments
in Rust, Python and Markdown that named engine/strata/... now name "Strata 41cf05a0, ..."; the gpu-bringup scratch-copy test no longer copies the
removed include directories. Stale engine/strata paths in sealed .cu, .ptx, seal-plan and MANIFEST files are left as they are (hashes may depend on the bytes).
Device::create_context_serving fixes the ServingContext (cell count and RoPE constants) of one Context in Retained.serving; create_context takes the process value once, at creation. Context::serving() / serving_geometry() replace the ~55 reads of cuda-model geometry() / serving_context() in qsa_prompt_index, qsa_prompt_kv, qsa_index_ffi (Arguments::for_launch takes the ServingContext), qsa_prompt_host_ffi (MappedAllocation::new takes the geometry), the resolver and qsa_fixed_kernels. cuda-model geometry() is deleted; the KV window file becomes context_serving.rs; ServingContext::resident_pages_for carries the window arithmetic. The engine call site OriginalQsaMappedPrefix::validate_retained(context) takes the Context (this signature change completes the call-site edit that commit 1 already carries, so commit 1 alone does not compile: merge the branch as a whole).
Behaviour notes for review: the ScoreTC reach check against max_blocks moves from launch time to argument-build time (same error value). OriginalQsaMappedSnapshot::logical_payload_eq no longer re-checks end against the serving cells (a diagnostic comparison; the owner validates snapshots on every use). The old process-wide guards only fired for a second load with different values in one process.
Context::configure_kv_resident fixes the window of one Context (Retained.kv_resident) and streamed QSA owners size their pool from c.kv_resident_pages(). The process cell KV_RESIDENT and configure_kv_resident / kv_resident_cells / kv_resident_pages leave cuda-model and the driver exports; the serve stack open phase configures the window on its Context (that call site already changed in the previous commit). Behaviour note: the old process-wide guard "resident KV window already configured differently" fired only for a second load with another window in the same process; a fresh Context after Unload now accepts another window.
Owner decision 2026-11-23: the vendored Strata tree engine/strata is removed for good. This first step moves what is still read
at build, test or ship time into one small directory, byte for byte:
- third_party/strata/LICENSE (MIT; `leleka engine license` embeds it, the packagers ship it)
- third_party/strata/ggml/LICENSE, project-maya/LICENSE, project-maya/NOTICE.md (licence texts the release packager ships)
- third_party/strata/serve/chat_template.jinja (one copy, embedded by control-plane server_api.rs and gateway-text prompt.rs)
- third_party/strata/serve/chat_golden.json (gateway-text prompt tests)
- third_party/strata/tests/data/native_experts/*.txt (control-plane native_pack tests)
- control-plane/tests/mcp_hub/mcp_fake_server.py next to its test harness
- third_party/strata/UPSTREAM.md replaces engine/upstream.md: pin 41cf05a0, URL, the 25 locally patched files, where the removed tree is in history
include_str! paths, deploy/build.rs (the `leleka version` Strata pin now reads third_party/strata/UPSTREAM.md), Dockerfile.static-cli,
.dockerignore, .gitattributes, the release packagers (package-5090.sh, package-release.py: the subtree facts of the removed tree are
dropped from PROVENANCE) and the evidence capture scripts follow the move. The tree itself is deleted in a later commit.
BindingIdentity and ModelBinding carry position_dimension(), built from the serving cells the binding captured when the model was bound. contract::position_dimension() (a read of the driver's process serving context) is deleted; the ~50 call sites in production code use the binding they already hold, tests use a cfg(test) trained_dimension() (262144 cells). No behaviour change: production binds the model after the context is admitted, so both values are the same.
SpecContext (request ceiling and serving cells) replaces the bare max_context of SpecConfig and OriginalServeSettings; DraftPreparation and PrefillRecords keep the serving cells they were made for. The stack open passes the bound of its model binding. Three more process-global exceptions are deleted. STRA-338
InputConstants and BindingIdentity capture the serving cells when the model is bound (the one read of the driver's context, contract::serving_cells). Seventeen validators (MTP frame, dense KV, snapshots, chunk charges, window limits, stack config, prompt plan) now receive the bound from the binding they already hold instead of reading the process-wide context; two redundant checks next to a context_length comparison are dropped. The laptop and prefix smokes fix their geometry before they bind the model. Seventeen process-global exceptions are deleted. STRA-338
Eight files kept their own OnceLock next to a settings::var parse (or a CPUID probe); they now ask settings.rs for a named Setting (same variables, same defaults, same parse, computed on first use). Eight process-global exceptions are deleted, one for the Setting cell is added. STRA-338
Eleven call sites cached their own parse of an environment variable in a function-local OnceLock; they now ask settings.rs for a named cell (same variable, same default, same parse, read on first use). The three copies of the 250 ms marker-file poll become one MarkerFiles type. Eleven process-global exceptions are deleted; STRA-338
EnvSwitch becomes the alias of EnvSetting<bool>; EnvSetting carries any value a rule parses from one variable, LazySetting a value one function parses from several variables or from the host. STRA-338
spawn_backend_configured creates the MemoryServices (the first Load installs the governor into it, at the same moment
as before) and hands it to the owner thread (LoadEnv), the Original runner (Run, ReopenEnv, GenerateEnv), the stack
(StackConfig.memory) and the status proxy. The prefix cache, the conversation device, the expert tier, the inventory
classes and the page-cache release ask it instead of Governor::global. NativeBackendConfig.verification carries the
stamp policy of leleka-inference (--verify-stamps, --verify-rehash, --kar-attested-by-stamp) to the shard and archive
verification. The nine Governor::global exceptions of architecture.json and the three singleton exceptions of
leleka-memory and leleka-model-format are deleted; the smokes and probes make their own services.
verify_stamp::set_global/global and set_attested_archive/attested_archive are gone. The operator binary builds a
VerifyPolicy from its flags and the loaders receive it: VerifiedGgufFile::open_with and
VerifiedKarPleArtifact::verify_under take it; open, verify and verify_sparse keep their signatures and hash in full
(the default policy vouches for nothing), which is what a process that never set the globals did (STRA-338 S13).
The process-wide cells (GLOBAL governor, the global inventory, the published-report static) become state of one
Governor value. MemoryServices is the one handle a composition root creates per engine: it holds the governor once
installed (first install wins), starts its sampler once and answers the status surface. A test builds its own
governor, inventory and services (STRA-338 S13/S14 follow-up).
The Original serve host and its decode round no longer call the routed-expert pool through a trait object. OriginalServeHost and HostOwners take the pool as a type parameter, the serve step chooses the pool type once per request (the GPU share over the CPU pool, or the CPU pool alone) and runs one generic body over it, so every window group and every round is a direct call. The decode view is split so the pool can borrow the view's tier while the serve body uses the rest; the order of every call, the ownership of the pool until the teardown and the log lines are unchanged. The dyn-trait ratchet of leleka-engine-qwen35-cuda falls from 3 to 0 and the architecture baseline is regenerated.
- serve_over_pool.rs: ServeJob, ServeParts and the generic serve_over, with the host and env builders moved from decode_steps.rs
- decode_steps.rs: serve picks the pool type and hands over
- serve_request_step.rs, original_serve_host*: generic over the pool
PrefillLoans<'a, 'ctx, G: GdnGemm> and the GDN and MoE prefill stage functions take the loaned GEMM by type; prefill_profile::span takes the
Context itself (it was the only implementer of Drain). The same calls in the same order; static instead of dynamic dispatch.
Not run on a GPU: needs the laptop two-binary identity gate.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>