#1493 [Engine] Add opt-in memory relief and supervised tool resource leases
open · draft · @midhatn · 0 Kommentare · Auf GitHub
BenchmarksServer & APIAMD / HIPNVIDIA / CUDAModels & quantsSecurityDocumentationWindowsLinux
Beschreibung
## Problem and result Local agents need memory for compilers and GPU tools between model calls. This opt-in draft lets a supervisor declare that work, request resident relief or confirmed inference unload, and return after a fresh capacity check. Sustained external pressure can also trigger relief. Uncertain execution or teardown keeps the ownership barrier in place instead of repeating a tool or regrowing inference over it. **This remains a draft. Current head is `aebeae281e16a6ab0448f00af76c52b1b5f7e81d`, following merge `6e459b94379f798023edb4c7189b3619381db07e` of upstream `504b143342a9fe1aa8320a7b31e11f5c0ac265c3` after v0.2.13. Both public parents are preserved.** This is conflict maintenance of the existing feature, not new GPU qualification. The [current revision report](https://github.com/midhatn/Strata/blob/aebeae281e16a6ab0448f00af76c52b1b5f7e81d/bench/results/2026-11-09-adaptive-0213/README.md) records the integration decisions, host checks and missing backend/device checks. Earlier native executable qualification applies only to `a69684f1`; it does not qualify this updated native source. Reopening after the tracker reset did not mark the feature ready for review. ## Related discussion This continues #1493 following the [tracker-reset invitation](https://github.com/Niko1221/Strata/pull/1493#issuecomment-6272336034). The reset was not a technical rejection or approval of the scope; no separate maintainer scope agreement is recorded here. The allocator foundation is medking82's #726. The engine-independent Hermes terminal authorization seam is [Hermes #135418](https://github.com/NousResearch/hermes-agent/pull/135418). The separate Windows token-default correction is #3399. ## Approach Reuse the existing live RAM blocks, GPU VMM cache, acknowledged memory protocol and server lifecycle/FIFO. An authenticated loopback lease separates admission, execution, renewal and release; a supervisor grants tool profiles and runtime-identified workers share one broker. Physical RAM, commit headroom and native GPU headroom are checked separately. The feature is opt-in; unsupported combinations refuse startup rather than bypassing adaptive ownership. Capacity is observed, not reserved by the OS. The upstream merge retains current vision diagnostics, tool-picture handling, drafting configuration and web API-key behavior while preserving adaptive admission and confirmed process shutdown. Startup validation uses effective user arguments. [Protocol and limits](https://github.com/midhatn/Strata/blob/b580e6270c0e8d2756b0ca9e15cbed4e57ba21ab/docs/TOOL_RESOURCE_LEASES.md) and [implementation provenance](https://github.com/midhatn/Strata/blob/b580e6270c0e8d2756b0ca9e15cbed4e57ba21ab/docs/ADAPTIVE_PROVENANCE.md) retain behavior and attribution. The private disk checkpoint bank and the newer local Python scheduling experiment are excluded. ## Validation **Passed:** - Follow-up `aebeae28`: corrected the inherited batch-STOP scan for this branch's `InputLine` wrapper and made the migrated SYCL private prefill signature match the shared declaration, refusing unsupported cooperative arguments before device work. Also repaired generated documentation and two stale test fixtures. Six local documentation checks and 34 affected tools tests pass (one explicit missing-native skip); extracted native contract checks pass. Hosted [Metal engine build](https://github.com/Niko1221/Strata/actions/runs/42697473131/job/129433050113), [Metal link](https://github.com/Niko1221/Strata/actions/runs/42697473556/job/129433055170), documentation and Linux/Windows CPU builds are now observed passing. Hosted CUDA12.9, CUDA13, HIP7.2 and SYCL2026.1 builds also pass on this exact head. Wider Python jobs were still running at this update. Windows/macOS host jobs failed; their causes are being compared against upstream. No device execution or new performance qualification is claimed. - Head `6e459b94`: resolved the current upstream CMake/server/vision/drafting conflicts. Six CPU-only native programs and 12 resource-controls JavaScript tests pass. The combined server run executed **607 tests in 310.151s: one error and two skips**; its error exposed an ordinary encoder-start failure being mistaken for a model-ownership failure. After the narrow typed-error correction, **89 affected tests pass in 13.949s**, and the final five-test tool-image module passes with exact ownership/cancellation exception identities preserved. Independent review also passed 15 focused tests. The complete 607-test selection was not rerun after that final correction and is not claimed as a complete pass. See the [revision-specific report](https://github.com/midhatn/Strata/blob/6e459b94379f798023edb4c7189b3619381db07e/bench/results/2026-11-09-adaptive-0213/README.md). No complete CUDA/HIP/SYCL/Metal build or GPU model qualification was performed for this merge. - Head `06ba725d`: correct delivery of the coadaptive route through the existing native request serializer's `strata_tune.pcie_frac` field. Explicit nested values, including zero, take precedence and other tuning values remain intact. The new actual-Service/serializer regression fails on preceding public `b580e627` (three tests, four failed subtest/assertion results). After the nine-line production correction, all **46 focused routing/coadaptive tests pass**. These are CPU/fake-engine checks, not new model or native-build qualification. The independent Windows token-rights fix #3399 and the larger scheduling/learner experiment remain excluded. - Exact source `a69684f1f2609da46c82f9719d5159f5f9b307dc`: Windows CUDA 13.4, MSVC 14.44.35207, architecture 89, portable Release build. All 183 build steps completed with one worker in 961.907s. All 13 native utility, protocol and parity programs exited zero, including `live_memory_test --protocol-only`. No model was started. Configure, build, tests and outer worker exited zero; all 1,638 retained process handles signaled exit and owned cleanup was verified. The `strata.exe` SHA-256 is `744205e4e024b5cbba19e4b560678ffe21e6899e59050929f7af51557f3c6198`. - Resolved upstream merge `e1242813` (upstream `7ddc17a3`, source tree `b37e52d2`): 14 focused server/web modules, **188 collected, 187 passed, one optional `jsonschema` skip**, in 39.078s including wrapper overhead. A separate terminal drafting run passed **40 tests in 7.746s**. The [current report](https://github.com/midhatn/Strata/blob/b580e6270c0e8d2756b0ca9e15cbed4e57ba21ab/bench/results/2026-10-23-adaptive-022/README.md) lists commands, module counts, exact identities, cleanup scope and the [compact native receipt](https://github.com/midhatn/Strata/blob/b580e6270c0e8d2756b0ca9e15cbed4e57ba21ab/bench/results/2026-10-23-adaptive-022/native-validation.json). - Earlier v0.2.2 source `037314f9` plus the five-line test-only synchronization committed as `e39dbb99`: `python -B -m unittest serve.test_idle_parking_service -v`, **42 passed in 4.920s**. The client could receive its response before the server's `finally` released preparation ownership; the bounded wait preserves the original assertions. This focused pass does not replace the failed complete run below. Historical v0.1.45 results remain in the [original revision-specific report](https://github.com/midhatn/Strata/blob/667deb1594ffd975b83f2b8e9c2da3beaf34e439/bench/results/2026-10-18-adaptive-0145/README.md). They are not counted as current-head passes. **Failed:** - Initial merge `6e459b94` hosted builds exposed the `InputLine` and SYCL signature integration errors; documentation/tools checks also exposed stale index/register and test-fixture state. These motivated `aebeae28`; original failed runs remain evidence. Hosted checks on the follow-up are not collectively green while the remaining jobs and macOS failure above are unresolved. - The complete server run on v0.2.2 source `037314f9` executed **1,402 tests with two failures, one error and 21 skips**. One failure was the corrected idle fixture ordering. The remaining failure/error reproduce on exact unmodified upstream v0.2.2 after `adopt_user_defaults()`: readable child identity and its ownership record fail. The same three selected lifeline tests pass on plain upstream and with only default-token DACL `FA` changed to `GA`. This is tracked separately in #3399; the patch is not folded into this PR. The original complete run remains failed. - Two preliminary merge-validation harness runs stopped at child-handle observation after upstream token adoption denied the required observer rights. Their owned jobs emptied; neither is counted as a pass. The final module-isolated checks and the narrower terminal cleanup scope are recorded separately in the report. **Not run:** - GPU hardware/model qualification has not been run on this updated source. Current-head hosted CUDA/HIP/SYCL/Metal compilation success does not substitute for live GPU cache resizing under a model. - A public-only real-model lease/compiler/reload workflow, arbitrary detached-tool containment, visible Desktop/media acceptance and complete normal-history continuation. Private combined-runtime results contain additional code and do not qualify this PR. - A new complete server-suite pass after the fixture correction, or current-head CI results inferred from historical runs. ## Limits All touched-backend builds remain required before requesting review; this PR stays draft while those checks and scope review are unfinished. It targets a single engine; finite execution workspace and races with unrelated allocations remain. There is no universal no-OOM, uninterrupted-progress, foreground-performance or speedup claim. Prepared with Codex; contributor responsibility, authorship and license notices are retained.
Mehr auf der Site
Links zu Install, Modellen, Releases.